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 Grammargrammar-
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.Objectclone()voiddefine(TokenSymbol ts)define a token.voiddefine(java.lang.String s, int ttype)define a token.booleanisReadOnly()importVocab token manager is read-only if output would be same as inputintnextTokenType()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:
clonein interfaceTokenManager- Overrides:
clonein classSimpleTokenManager
-
define
public void define(TokenSymbol ts)
define a token.- Specified by:
definein interfaceTokenManager- Overrides:
definein 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:
isReadOnlyin interfaceTokenManager- Overrides:
isReadOnlyin classSimpleTokenManager
-
nextTokenType
public int nextTokenType()
Get the next unused token type.- Specified by:
nextTokenTypein interfaceTokenManager- Overrides:
nextTokenTypein classSimpleTokenManager
-
-