java.lang.Object
provided.tokenFW.Token
Represents a token in the language.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute(ITokVisitor algo, Object... params)
Executes (accepts) the visitor, calling the case associated with this host's name value.Accessor for the lexeme of this tokengetName()
Accessor for the name of this tokentoString()
Return a string representation of the token: "[name] lexeme"
-
Field Details
-
_name
String _nameThe name of this token, which is its id. -
_lexeme
The _lexeme (lexical value) this token is representing.
-
-
Constructor Details
-
Token
Token constructor.- Parameters:
name
- The name associated with this token. This is the id value when it executes its visitors.lexeme
- _lexeme this token is representing.
-
-
Method Details
-
execute
Executes (accepts) the visitor, calling the case associated with this host's name value.- Parameters:
algo
- The visitor to executeparams
- The input parameters supplied to the algo when its appropriate case is called.- Returns:
- The return value from executing the appropriate case on the visitor.
-
getName
Accessor for the name of this token- Returns:
- The name of this token
-
getLexeme
Accessor for the lexeme of this token- Returns:
- The lexeme of this token
-
toString
Return a string representation of the token: "[name] lexeme"
-