Package antlr
Interface TokenManager
-
- All Known Implementing Classes:
ImportVocabTokenManager,SimpleTokenManager
interface TokenManagerInterface that describes the set of defined tokens
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Objectclone()voiddefine(TokenSymbol ts)define a token symboljava.lang.StringgetName()Get the name of the token managerjava.lang.StringgetTokenStringAt(int idx)Get a token string by indexTokenSymbolgetTokenSymbol(java.lang.String sym)Get the TokenSymbol for a stringTokenSymbolgetTokenSymbolAt(int idx)java.util.EnumerationgetTokenSymbolElements()Get an enumerator over the symbol tablejava.util.EnumerationgetTokenSymbolKeys()VectorgetVocabulary()Get the token vocabulary (read-only).booleanisReadOnly()Is this token manager read-only?voidmapToTokenSymbol(java.lang.String name, TokenSymbol sym)intmaxTokenType()Get the highest token type in useintnextTokenType()Get the next unused token typevoidsetName(java.lang.String n)voidsetReadOnly(boolean ro)booleantokenDefined(java.lang.String symbol)Is a token symbol defined?
-
-
-
Method Detail
-
clone
java.lang.Object clone()
-
define
void define(TokenSymbol ts)
define a token symbol
-
getName
java.lang.String getName()
Get the name of the token manager
-
getTokenStringAt
java.lang.String getTokenStringAt(int idx)
Get a token string by index
-
getTokenSymbol
TokenSymbol getTokenSymbol(java.lang.String sym)
Get the TokenSymbol for a string
-
getTokenSymbolAt
TokenSymbol getTokenSymbolAt(int idx)
-
getTokenSymbolElements
java.util.Enumeration getTokenSymbolElements()
Get an enumerator over the symbol table
-
getTokenSymbolKeys
java.util.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
void mapToTokenSymbol(java.lang.String name, TokenSymbol sym)
-
maxTokenType
int maxTokenType()
Get the highest token type in use
-
nextTokenType
int nextTokenType()
Get the next unused token type
-
setName
void setName(java.lang.String n)
-
setReadOnly
void setReadOnly(boolean ro)
-
tokenDefined
boolean tokenDefined(java.lang.String symbol)
Is a token symbol defined?
-
-