Package antlr
Interface TokenManager
- All Known Implementing Classes:
ImportVocabTokenManager,SimpleTokenManager
interface TokenManager
Interface that describes the set of defined tokens
-
Method Summary
Modifier and TypeMethodDescriptionclone()voiddefine(TokenSymbol ts) define a token symbolgetName()Get the name of the token managergetTokenStringAt(int idx) Get a token string by indexgetTokenSymbol(String sym) Get the TokenSymbol for a stringgetTokenSymbolAt(int idx) Get an enumerator over the symbol tableGet the token vocabulary (read-only).booleanIs this token manager read-only?voidmapToTokenSymbol(String name, TokenSymbol sym) intGet the highest token type in useintGet the next unused token typevoidvoidsetReadOnly(boolean ro) booleantokenDefined(String symbol) Is a token symbol defined?
-
Method Details
-
clone
Object clone() -
define
define a token symbol -
getName
String getName()Get the name of the token manager -
getTokenStringAt
Get a token string by index -
getTokenSymbol
Get the TokenSymbol for a string -
getTokenSymbolAt
-
getTokenSymbolElements
Enumeration getTokenSymbolElements()Get an enumerator over the symbol table -
getTokenSymbolKeys
Enumeration getTokenSymbolKeys() -
getVocabulary
Vector getVocabulary()Get the token vocabulary (read-only).- Returns:
- A Vector of Strings indexed by token type
-
isReadOnly
boolean isReadOnly()Is this token manager read-only? -
mapToTokenSymbol
-
maxTokenType
int maxTokenType()Get the highest token type in use -
nextTokenType
int nextTokenType()Get the next unused token type -
setName
-
setReadOnly
void setReadOnly(boolean ro) -
tokenDefined
Is a token symbol defined?
-