antlr

Class ImportVocabTokenManager

Implemented Interfaces:
Cloneable, TokenManager

(package private) class ImportVocabTokenManager
extends SimpleTokenManager
implements Cloneable

Static implementation of the TokenManager, used for importVocab option

Field Summary

protected Grammar
grammar

Fields inherited from class antlr.SimpleTokenManager

antlrTool, maxToken, name, readOnly, vocabulary

Constructor Summary

ImportVocabTokenManager(Grammar grammar, String filename_, String name_, Tool tool_)

Method Summary

Object
clone()
void
define(String s, int ttype)
define a token.
void
define(TokenSymbol ts)
define a token.
boolean
isReadOnly()
importVocab token manager is read-only if output would be same as input
int
nextTokenType()
Get the next unused token type.

Methods inherited from class antlr.SimpleTokenManager

clone, define, getName, getTokenStringAt, getTokenSymbol, getTokenSymbolAt, getTokenSymbolElements, getTokenSymbolKeys, getVocabulary, isReadOnly, mapToTokenSymbol, maxTokenType, nextTokenType, setName, setReadOnly, tokenDefined

Field Details

grammar

protected Grammar grammar

Constructor Details

ImportVocabTokenManager

(package private)  ImportVocabTokenManager(Grammar grammar,
                                           String filename_,
                                           String name_,
                                           Tool tool_)

Method Details

clone

public Object clone()
Specified by:
clone in interface TokenManager
Overrides:
clone in interface SimpleTokenManager


define

public void define(String s,
                   int ttype)
define a token. Intended for use only when reading the importVocab file.


define

public void define(TokenSymbol ts)
define a token.
Specified by:
define in interface TokenManager
Overrides:
define in interface SimpleTokenManager


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 interface SimpleTokenManager


nextTokenType

public int nextTokenType()
Get the next unused token type.
Specified by:
nextTokenType in interface TokenManager
Overrides:
nextTokenType in interface SimpleTokenManager