antlr
Class ImportVocabTokenManager

java.lang.Object
  extended by antlr.SimpleTokenManager
      extended by 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
protected  Grammar grammar
           
 
Fields inherited from class antlr.SimpleTokenManager
antlrTool, maxToken, name, readOnly, vocabulary
 
Constructor Summary
ImportVocabTokenManager(Grammar grammar, java.lang.String filename_, java.lang.String name_, Tool tool_)
           
 
Method Summary
 java.lang.Object clone()
           
 void define(java.lang.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
getName, getTokenStringAt, getTokenSymbol, getTokenSymbolAt, getTokenSymbolElements, getTokenSymbolKeys, getVocabulary, mapToTokenSymbol, maxTokenType, setName, setReadOnly, tokenDefined
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

grammar

protected Grammar grammar
Constructor Detail

ImportVocabTokenManager

ImportVocabTokenManager(Grammar grammar,
                        java.lang.String filename_,
                        java.lang.String name_,
                        Tool tool_)
Method Detail

clone

public java.lang.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(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 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