|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--antlr.SimpleTokenManager | +--antlr.ImportVocabTokenManager
Static implementation of the TokenManager, used for importVocab option
Field Summary | |
private java.lang.String |
filename
|
protected Grammar |
grammar
|
protected int |
maxToken
|
protected java.lang.String |
name
|
protected boolean |
readOnly
|
protected Tool |
tool
|
protected Vector |
vocabulary
|
Constructor Summary | |
(package private) |
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. |
java.lang.String |
getName()
Simple token manager doesn't have a name -- must be set externally |
java.lang.String |
getTokenStringAt(int idx)
Get a token symbol by index |
TokenSymbol |
getTokenSymbol(java.lang.String sym)
Get the TokenSymbol for a string |
TokenSymbol |
getTokenSymbolAt(int idx)
Get a token symbol by index |
java.util.Enumeration |
getTokenSymbolElements()
Get an enumerator over the symbol table |
java.util.Enumeration |
getTokenSymbolKeys()
|
Vector |
getVocabulary()
Get the token vocabulary (read-only). |
boolean |
isReadOnly()
importVocab token manager is read-only if output would be same as input |
void |
mapToTokenSymbol(java.lang.String name,
TokenSymbol sym)
Map a label or string to an existing token symbol |
int |
maxTokenType()
Get the highest token type in use |
int |
nextTokenType()
Get the next unused token type. |
void |
setName(java.lang.String name_)
Set the name of the token manager |
void |
setReadOnly(boolean ro)
|
boolean |
tokenDefined(java.lang.String symbol)
Is a token symbol defined? |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.lang.String filename
protected Grammar grammar
protected int maxToken
protected Vector vocabulary
protected Tool tool
protected java.lang.String name
protected boolean readOnly
Constructor Detail |
ImportVocabTokenManager(Grammar grammar, java.lang.String filename_, java.lang.String name_, Tool tool_)
Method Detail |
public java.lang.Object clone()
clone
in interface TokenManager
clone
in class SimpleTokenManager
public void define(TokenSymbol ts)
define
in interface TokenManager
define
in class SimpleTokenManager
public void define(java.lang.String s, int ttype)
public boolean isReadOnly()
isReadOnly
in interface TokenManager
isReadOnly
in class SimpleTokenManager
public int nextTokenType()
nextTokenType
in interface TokenManager
nextTokenType
in class SimpleTokenManager
public java.lang.String getName()
getName
in interface TokenManager
public java.lang.String getTokenStringAt(int idx)
getTokenStringAt
in interface TokenManager
public TokenSymbol getTokenSymbol(java.lang.String sym)
getTokenSymbol
in interface TokenManager
public TokenSymbol getTokenSymbolAt(int idx)
getTokenSymbolAt
in interface TokenManager
public java.util.Enumeration getTokenSymbolElements()
getTokenSymbolElements
in interface TokenManager
public java.util.Enumeration getTokenSymbolKeys()
getTokenSymbolKeys
in interface TokenManager
public Vector getVocabulary()
getVocabulary
in interface TokenManager
public void mapToTokenSymbol(java.lang.String name, TokenSymbol sym)
mapToTokenSymbol
in interface TokenManager
public int maxTokenType()
maxTokenType
in interface TokenManager
public void setName(java.lang.String name_)
setName
in interface TokenManager
public void setReadOnly(boolean ro)
setReadOnly
in interface TokenManager
public boolean tokenDefined(java.lang.String symbol)
tokenDefined
in interface TokenManager
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |