TokenNode
INCLUDE FILE
#include "TokenNode.h"
class TokenNode
Represents a token corresponding to punctuation or keyword in the instruction notation.
DEFINITION
class TokenNode;
constructor TokenNode
Initialize a TokenNode with a specific token.
DEFINITION
| TokenNode | ( | const Token & token | ); |
| PARAMETER | DESCRIPTION |
|---|---|
token |
The token corresponding to the punctuation or keyword in the instruction notation. |
method as_symbolconst
Get the symbol corresponding to the token.
DEFINITION
| Symbol as_symbol | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
Symbol |
The symbol corresponding to the token. |
method get_locationconst virtual
Get the location of the node in the source code.
Subclasses must implement this method.
DEFINITION
| virtual const Location & get_location | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
const Location & |
The location of the node. |
method typeconst virtual
Get the type of the node.
Subclasses must implement this method.
DEFINITION
| virtual Type type | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
Type |
The type of the node. |
member node_typeprivate
The type of the node, which can be KEYWORD or PUNCTUATION.
DEFINITION
Type node_type;
member tokenprivate
The token corresponding to the punctuation or keyword in the instruction notation.
DEFINITION
Token token;