Vocabulary
interface.
| Modifier and Type | Field and Description |
|---|---|
| private final String[] | |
| private static final String[] | |
| public static final VocabularyImpl | EMPTY_VOCABULARY
Gets an empty |
| private final String[] | |
| private final int | |
| private final String[] |
| Access | Constructor and Description |
|---|---|
| public | VocabularyImpl(String[]
The literal names assigned to tokens, or literalNames, String[] null
if no literal names are assigned.The symbolic names assigned to tokens, or
symbolicNames)null if no symbolic names are assigned.Constructs a new instance of |
| public | VocabularyImpl(String[]
The literal names assigned to tokens, or literalNames, String[] null
if no literal names are assigned.The symbolic names assigned to tokens, or
symbolicNames, String[] null if no symbolic names are assigned.The display names assigned to tokens, or displayNames)null
to use the values in literalNames and symbolicNames as
the source of display names, as described in
getDisplayName(int).Constructs a new instance of |
| Modifier and Type | Method and Description |
|---|---|
| public static Vocabulary | fromTokenNames(String[]
The token names, or tokenNames)null if no token names are
available.Returns a |
| public String | getDisplayName(int
The token type. tokenType)Implements org. |
| public String[] | |
| public String | getLiteralName(int
The token type. tokenType)Implements org. |
| public String[] | |
| public int | getMaxTokenType()
Implements org. |
| public String | getSymbolicName(int
The token type. tokenType)Implements org. |
| public String[] |
| displayNames | back to summary |
|---|---|
| private final String[] displayNames | |
| EMPTY_NAMES | back to summary |
|---|---|
| private static final String[] EMPTY_NAMES | |
| EMPTY_VOCABULARY | back to summary |
|---|---|
| public static final VocabularyImpl EMPTY_VOCABULARY Gets an empty
No literal or symbol names are assigned to token types, so
| |
| literalNames | back to summary |
|---|---|
| private final String[] literalNames | |
| maxTokenType | back to summary |
|---|---|
| private final int maxTokenType | |
| symbolicNames | back to summary |
|---|---|
| private final String[] symbolicNames | |
| VocabularyImpl | back to summary |
|---|---|
| public VocabularyImpl(String[] literalNames, String[] symbolicNames) Constructs a new instance of
| |
| VocabularyImpl | back to summary |
|---|---|
| public VocabularyImpl(String[] literalNames, String[] symbolicNames, String[] displayNames) Constructs a new instance of
| |
| fromTokenNames | back to summary |
|---|---|
| public static Vocabulary fromTokenNames(String[] tokenNames) Returns a The resulting vocabulary instance returns
| |
| getDisplayName | back to summary |
|---|---|
| public String getDisplayName(int tokenType) Implements org. Doc from org. Gets the display name of a token type. ANTLR provides a default implementation of this method, but
applications are free to override the behavior in any manner which makes
sense for the application. The default implementation returns the first
result from the following list which produces a non-
| |
| getDisplayNames | back to summary |
|---|---|
| public String[] getDisplayNames() | |
| getLiteralName | back to summary | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public String getLiteralName(int tokenType) Implements org. Doc from org. Gets the string literal associated with a token type. The string returned
by this method, when not The following table shows examples of lexer rules and the literal names assigned to the corresponding token types.
| |||||||||||||
| getLiteralNames | back to summary |
|---|---|
| public String[] getLiteralNames() | |
| getMaxTokenType | back to summary |
|---|---|
| public int getMaxTokenType() Implements org. Doc from org. Returns the highest token type value. It can be used to iterate from zero to that number, inclusively, thus querying all stored entries.
| |
| getSymbolicName | back to summary | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| public String getSymbolicName(int tokenType) Implements org. Doc from org. Gets the symbolic name associated with a token type. The string returned
by this method, when not This method supports token types defined by any of the following methods:
The following table shows examples of lexer rules and the literal names assigned to the corresponding token types.
| |||||||||
| getSymbolicNames | back to summary |
|---|---|
| public String[] getSymbolicNames() | |