List of usage examples for org.antlr.v4.runtime Vocabulary getLiteralName
String getLiteralName(int tokenType);
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 .j a v a 2 s.c o m } return names.build(); }