Package antlr
Interface TokenManager
-
- All Known Implementing Classes:
ImportVocabTokenManager
,SimpleTokenManager
interface TokenManager
Interface that describes the set of defined tokens
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object
clone()
void
define(TokenSymbol ts)
define a token symboljava.lang.String
getName()
Get the name of the token managerjava.lang.String
getTokenStringAt(int idx)
Get a token string by indexTokenSymbol
getTokenSymbol(java.lang.String sym)
Get the TokenSymbol for a stringTokenSymbol
getTokenSymbolAt(int idx)
java.util.Enumeration
getTokenSymbolElements()
Get an enumerator over the symbol tablejava.util.Enumeration
getTokenSymbolKeys()
Vector
getVocabulary()
Get the token vocabulary (read-only).boolean
isReadOnly()
Is this token manager read-only?void
mapToTokenSymbol(java.lang.String name, TokenSymbol sym)
int
maxTokenType()
Get the highest token type in useint
nextTokenType()
Get the next unused token typevoid
setName(java.lang.String n)
void
setReadOnly(boolean ro)
boolean
tokenDefined(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?
-
-