private boolean isVersionFollowedBy ( ElementType < Token > type ) { EnumSet < Token . Type > expected = EnumSet . of ( NUMERIC , DOT ) ; Iterator < Token > it = tokens . iterator ( ) ; Token lookahead = null ; while ( it . hasNext ( ) ) { lookahead = it . next ( ) ; if ( ! expected . contains ( lookahead . type ) ) { break ; } } return type . isMatchedBy ( lookahead ) ; }
Determines if the version terminals are followed by the specified token type .