List of usage examples for org.antlr.v4.runtime Vocabulary getMaxTokenType
int getMaxTokenType();
From source file:com.facebook.presto.sql.ReservedIdentifiers.java
License:Apache License
private static Set<String> possibleIdentifiers() { ImmutableSet.Builder<String> names = ImmutableSet.builder(); Vocabulary vocabulary = SqlBaseLexer.VOCABULARY; for (int i = 0; i <= vocabulary.getMaxTokenType(); i++) { String name = nullToEmpty(vocabulary.getLiteralName(i)); Matcher matcher = IDENTIFIER.matcher(name); if (matcher.matches()) { names.add(matcher.group(1)); }// w ww .ja v a2s . co m } return names.build(); }