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()
void
define
(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).boolean
Is this token manager read-only?void
mapToTokenSymbol
(String name, TokenSymbol sym) int
Get the highest token type in useint
Get the next unused token typevoid
void
setReadOnly
(boolean ro) boolean
tokenDefined
(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?
-