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 Objectclone()voiddefine(TokenSymbol ts)define a token symbolStringgetName()Get the name of the token managerStringgetTokenStringAt(int idx)Get a token string by indexTokenSymbolgetTokenSymbol(String sym)Get the TokenSymbol for a stringTokenSymbolgetTokenSymbolAt(int idx)EnumerationgetTokenSymbolElements()Get an enumerator over the symbol tableEnumerationgetTokenSymbolKeys()VectorgetVocabulary()Get the token vocabulary (read-only).booleanisReadOnly()Is this token manager read-only?voidmapToTokenSymbol(String name, TokenSymbol sym)intmaxTokenType()Get the highest token type in useintnextTokenType()Get the next unused token typevoidsetName(String n)voidsetReadOnly(boolean ro)booleantokenDefined(String symbol)Is a token symbol defined?
-
-
-
Method Detail
-
clone
Object clone()
-
define
void define(TokenSymbol ts)
define a token symbol
-
getName
String getName()
Get the name of the token manager
-
getTokenStringAt
String getTokenStringAt(int idx)
Get a token string by index
-
getTokenSymbol
TokenSymbol getTokenSymbol(String sym)
Get the TokenSymbol for a string
-
getTokenSymbolAt
TokenSymbol getTokenSymbolAt(int idx)
-
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
void mapToTokenSymbol(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(String n)
-
setReadOnly
void setReadOnly(boolean ro)
-
tokenDefined
boolean tokenDefined(String symbol)
Is a token symbol defined?
-
-