antlr

Interface TokenManager

interface TokenManager

Interface that describes the set of defined tokens
Method Summary
Objectclone()
voiddefine(TokenSymbol ts)
define a token symbol
StringgetName()
Get the name of the token manager
StringgetTokenStringAt(int idx)
Get a token string by index
TokenSymbolgetTokenSymbol(String sym)
Get the TokenSymbol for a string
TokenSymbolgetTokenSymbolAt(int idx)
EnumerationgetTokenSymbolElements()
Get an enumerator over the symbol table
EnumerationgetTokenSymbolKeys()
VectorgetVocabulary()
Get the token vocabulary (read-only).
booleanisReadOnly()
Is this token manager read-only?
voidmapToTokenSymbol(String name, TokenSymbol sym)
intmaxTokenType()
Get the highest token type in use
intnextTokenType()
Get the next unused token type
voidsetName(String n)
voidsetReadOnly(boolean ro)
booleantokenDefined(String symbol)
Is a token symbol defined?

Method Detail

clone

public Object clone()

define

public void define(TokenSymbol ts)
define a token symbol

getName

public String getName()
Get the name of the token manager

getTokenStringAt

public String getTokenStringAt(int idx)
Get a token string by index

getTokenSymbol

public TokenSymbol getTokenSymbol(String sym)
Get the TokenSymbol for a string

getTokenSymbolAt

public TokenSymbol getTokenSymbolAt(int idx)

getTokenSymbolElements

public Enumeration getTokenSymbolElements()
Get an enumerator over the symbol table

getTokenSymbolKeys

public Enumeration getTokenSymbolKeys()

getVocabulary

public Vector getVocabulary()
Get the token vocabulary (read-only).

Returns: A Vector of Strings indexed by token type

isReadOnly

public boolean isReadOnly()
Is this token manager read-only?

mapToTokenSymbol

public void mapToTokenSymbol(String name, TokenSymbol sym)

maxTokenType

public int maxTokenType()
Get the highest token type in use

nextTokenType

public int nextTokenType()
Get the next unused token type

setName

public void setName(String n)

setReadOnly

public void setReadOnly(boolean ro)

tokenDefined

public boolean tokenDefined(String symbol)
Is a token symbol defined?