public class Token
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
_lexeme
The _lexeme (lexical value) this token is representing.
|
(package private) java.lang.String |
_name
The name of this token, which is its id.
|
| Constructor and Description |
|---|
Token(java.lang.String name,
java.lang.String lexeme)
Token constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
execute(ITokVisitor algo,
java.lang.Object... params)
Executes (accepts) the visitor, calling the case associated with this host's name value.
|
java.lang.String |
getLexeme()
Accessor for the lexeme of this token
|
java.lang.String |
getName()
Accessor for the name of this token
|
java.lang.String |
toString()
Return a string representation of the token: "[name] lexeme"
|
java.lang.String _name
private java.lang.String _lexeme
public Token(java.lang.String name,
java.lang.String lexeme)
name - The name associated with this token. This is the id value when it executes its visitors.lexeme - _lexeme this token is representing.public java.lang.Object execute(ITokVisitor algo, java.lang.Object... params)
algo - The visitor to executeparams - The input parameters supplied to the algo when its appropriate case is called.public java.lang.String getName()
public java.lang.String getLexeme()
public java.lang.String toString()
toString in class java.lang.Object