#include <Token.h>
Public Methods | |
| Token () | |
| Default constructor. | |
| Token & | operator= (const Token &t) |
| Assingment. More... | |
| bool | operator== (TokenId t) const |
| Checks type type equality. | |
| bool | operator!= (TokenId t) const |
| Checks type type inequality. | |
| TokenId | getId () |
| Return the token type. | |
| int | asInt () |
| Returns the token value as an interger. | |
| float | asFloat () |
| Returns the token value as a float. | |
| double | asDouble () |
| Returns the token value as a double. | |
| string & | asString () |
| Returns the token value as a string. | |
Static Public Methods | |
| const string | lookup (TokenId type) |
| Find and return the token string representation. | |
Protected Attributes | |
| TokenId | id |
| The type or id of the token. | |
| double | value |
| Numeric value of the token. More... | |
| string | data |
| String value of the token. More... | |
Static Protected Attributes | |
| const string | stringTable [] |
| Mapping from TokenId to string. More... | |
Friends | |
| ostream & | operator<< (ostream &stream, const Token &token) |
| Writes a token. More... | |
|
|
Assingment.
|
|
||||||||||||
|
Writes a token.
|
|
|
String value of the token.
|
|
|
Initial value:
{
"nosym",
"eof",
"{", "}",
"[", "]",
"(", ")",
",", ":", ";",
"//", "/*", "*/",
"*", "-", "+", "/",
"#<directive>",
"<number>",
"<string>",
}
|
|
|
Numeric value of the token.
|