antlr
Class ImportVocabTokenManager
java.lang.Object
antlr.SimpleTokenManager
antlr.ImportVocabTokenManager
- All Implemented Interfaces:
- TokenManager, Cloneable
class ImportVocabTokenManager
- extends SimpleTokenManager
- implements Cloneable
Static implementation of the TokenManager, used for importVocab option
Methods inherited from class antlr.SimpleTokenManager |
getName, getTokenStringAt, getTokenSymbol, getTokenSymbolAt, getTokenSymbolElements, getTokenSymbolKeys, getVocabulary, mapToTokenSymbol, maxTokenType, setName, setReadOnly, tokenDefined |
grammar
protected Grammar grammar
ImportVocabTokenManager
ImportVocabTokenManager(Grammar grammar,
String filename_,
String name_,
Tool tool_)
clone
public Object clone()
- Specified by:
clone
in interface TokenManager
- Overrides:
clone
in class SimpleTokenManager
define
public void define(TokenSymbol ts)
- define a token.
- Specified by:
define
in interface TokenManager
- Overrides:
define
in class SimpleTokenManager
define
public void define(String s,
int ttype)
- define a token. Intended for use only when reading the importVocab file.
isReadOnly
public boolean isReadOnly()
- importVocab token manager is read-only if output would be same as input
- Specified by:
isReadOnly
in interface TokenManager
- Overrides:
isReadOnly
in class SimpleTokenManager
nextTokenType
public int nextTokenType()
- Get the next unused token type.
- Specified by:
nextTokenType
in interface TokenManager
- Overrides:
nextTokenType
in class SimpleTokenManager