public class TokenTable extends Object
| Constructor and Description |
|---|
TokenTable()
Construct a new OPToken.
|
TokenTable(String sIdentifierASTName, String sLiteralASTName)
Construct a new TokenTable with the given parameters to set the ast names for identifiers and literals.
|
| Modifier and Type | Method and Description |
|---|---|
OPToken |
addToken(OPToken token)
Add a token t under the id stored in the token
|
OPToken |
addToken(OPToken token, String sASTName)
Add a token t with given ast name
|
OPToken |
addToken(String sName, OPToken token)
Add a token t under the given name
|
OPToken |
addToken(String sName, OPToken token, String sASTName)
Add a token t under the given name with given ast name
|
OPToken |
addToken(String sName, OPToken token, String sLedName, String sNudName)
Add a token t under the given name with given led and nud names
|
void |
alias(String sName, String sInstalled)
Add a token alias under the given name for a token already installed
|
void |
disable(String sName)
Disable an installed token stored under the given name
|
void |
enable(String sName)
Enable an installed token stored under the given name
|
boolean |
isIgnoringCase()
Answer wheather the receiver is ignoringCase
|
OPToken |
lookup(String sName)
Lookup an OPToken by name
|
OPToken |
newIdentifier(String sValue)
Construct a new identifier OPToken instance with the given id.
|
OPToken |
newLiteral(String sValue, int nTypeCode)
Construct a new literal OPToken instance with the given parameters.
|
void |
setIgnoreCase(boolean fIgnore)
Use given boolean to decide whether to ignore case for keyword operations
|
public void setIgnoreCase(boolean fIgnore)
fIgnore - the boolean to use to control case interestpublic boolean isIgnoringCase()
public OPToken lookup(String sName)
sName - the name of the token to lookuppublic OPToken addToken(String sName, OPToken token)
sName - string identifier for this tokentoken - the token to addpublic OPToken addToken(String sName, OPToken token, String sASTName)
sName - string identifier for this tokentoken - the token to addsASTName - the token's led symbolpublic OPToken addToken(String sName, OPToken token, String sLedName, String sNudName)
sName - string identifier for this tokentoken - the token to addsLedName - the token's led symbolsNudName - the token's nud symbolpublic OPToken addToken(OPToken token)
token - the token to addpublic OPToken addToken(OPToken token, String sASTName)
token - the token to addsASTName - the token to addpublic void alias(String sName, String sInstalled)
sName - string identifier for token aliassInstalled - the name of a token already in the tablepublic void disable(String sName)
sName - string identifier for token to disablepublic void enable(String sName)
sName - string identifier for token to enablepublic OPToken newLiteral(String sValue, int nTypeCode)
sValue - string representation of the literalnTypeCode - the type code for this literal token