Package antlr
Class SimpleTokenManager
java.lang.Object
antlr.SimpleTokenManager
- All Implemented Interfaces:
TokenManager,Cloneable
- Direct Known Subclasses:
ImportVocabTokenManager
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()voiddefine(TokenSymbol ts) define a tokengetName()Simple token manager doesn't have a name -- must be set externallygetTokenStringAt(int idx) Get a token symbol by indexgetTokenSymbol(String sym) Get the TokenSymbol for a stringgetTokenSymbolAt(int idx) Get a token symbol by indexGet an enumerator over the symbol tableGet the token vocabulary (read-only).booleanSimple token manager is not read-onlyvoidmapToTokenSymbol(String name, TokenSymbol sym) Map a label or string to an existing token symbolintGet the highest token type in useintGet the next unused token typevoidSet the name of the token managervoidsetReadOnly(boolean ro) booleantokenDefined(String symbol) Is a token symbol defined?
-
Field Details
-
maxToken
protected int maxToken -
vocabulary
-
antlrTool
-
name
-
readOnly
protected boolean readOnly
-
-
Constructor Details
-
SimpleTokenManager
-
-
Method Details
-
clone
- Specified by:
clonein interfaceTokenManager- Overrides:
clonein classObject
-
define
define a token- Specified by:
definein interfaceTokenManager
-
getName
Simple token manager doesn't have a name -- must be set externally- Specified by:
getNamein interfaceTokenManager
-
getTokenStringAt
Get a token symbol by index- Specified by:
getTokenStringAtin interfaceTokenManager
-
getTokenSymbol
Get the TokenSymbol for a string- Specified by:
getTokenSymbolin interfaceTokenManager
-
getTokenSymbolAt
Get a token symbol by index- Specified by:
getTokenSymbolAtin interfaceTokenManager
-
getTokenSymbolElements
Get an enumerator over the symbol table- Specified by:
getTokenSymbolElementsin interfaceTokenManager
-
getTokenSymbolKeys
- Specified by:
getTokenSymbolKeysin interfaceTokenManager
-
getVocabulary
Get the token vocabulary (read-only).- Specified by:
getVocabularyin interfaceTokenManager- Returns:
- A Vector of TokenSymbol
-
isReadOnly
public boolean isReadOnly()Simple token manager is not read-only- Specified by:
isReadOnlyin interfaceTokenManager
-
mapToTokenSymbol
Map a label or string to an existing token symbol- Specified by:
mapToTokenSymbolin interfaceTokenManager
-
maxTokenType
public int maxTokenType()Get the highest token type in use- Specified by:
maxTokenTypein interfaceTokenManager
-
nextTokenType
public int nextTokenType()Get the next unused token type- Specified by:
nextTokenTypein interfaceTokenManager
-
setName
Set the name of the token manager- Specified by:
setNamein interfaceTokenManager
-
setReadOnly
public void setReadOnly(boolean ro) - Specified by:
setReadOnlyin interfaceTokenManager
-
tokenDefined
Is a token symbol defined?- Specified by:
tokenDefinedin interfaceTokenManager
-