Package antlr
Class ImportVocabTokenManager
- java.lang.Object
-
- antlr.SimpleTokenManager
-
- antlr.ImportVocabTokenManager
-
- All Implemented Interfaces:
TokenManager
,java.lang.Cloneable
class ImportVocabTokenManager extends SimpleTokenManager implements java.lang.Cloneable
Static implementation of the TokenManager, used for importVocab option
-
-
Field Summary
Fields Modifier and Type Field Description protected Grammar
grammar
-
Fields inherited from class antlr.SimpleTokenManager
antlrTool, maxToken, name, readOnly, vocabulary
-
-
Constructor Summary
Constructors Constructor Description ImportVocabTokenManager(Grammar grammar, java.lang.String filename_, java.lang.String name_, Tool tool_)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
void
define(TokenSymbol ts)
define a token.void
define(java.lang.String s, int ttype)
define a token.boolean
isReadOnly()
importVocab token manager is read-only if output would be same as inputint
nextTokenType()
Get the next unused token type.-
Methods inherited from class antlr.SimpleTokenManager
getName, getTokenStringAt, getTokenSymbol, getTokenSymbolAt, getTokenSymbolElements, getTokenSymbolKeys, getVocabulary, mapToTokenSymbol, maxTokenType, setName, setReadOnly, tokenDefined
-
-
-
-
Field Detail
-
grammar
protected Grammar grammar
-
-
Method Detail
-
clone
public java.lang.Object clone()
- Specified by:
clone
in interfaceTokenManager
- Overrides:
clone
in classSimpleTokenManager
-
define
public void define(TokenSymbol ts)
define a token.- Specified by:
define
in interfaceTokenManager
- Overrides:
define
in classSimpleTokenManager
-
define
public void define(java.lang.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 interfaceTokenManager
- Overrides:
isReadOnly
in classSimpleTokenManager
-
nextTokenType
public int nextTokenType()
Get the next unused token type.- Specified by:
nextTokenType
in interfaceTokenManager
- Overrides:
nextTokenType
in classSimpleTokenManager
-
-