|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Structure representing a lexical token. More...
#include <parse_utils.H>
Public Member Functions | |
| Token ()=default | |
| Default constructor. | |
| Token (TokenType t, std::string v, SourceLocation loc) | |
| Construct with all fields. | |
| bool | is_eof () const |
| Check if this is an end-of-file token. | |
| std::string | to_string () const |
| String representation for debugging. | |
Public Attributes | |
| TokenType | type = TokenType::UNKNOWN |
| Type of the token. | |
| std::string | value |
| String value/content. | |
| SourceLocation | location |
| Where token appeared. | |
Structure representing a lexical token.
Definition at line 1506 of file parse_utils.H.
|
default |
Default constructor.
|
inline |
Construct with all fields.
Definition at line 1516 of file parse_utils.H.
|
inline |
Check if this is an end-of-file token.
Definition at line 1520 of file parse_utils.H.
References Aleph::END_OF_FILE, and type.
|
inline |
String representation for debugging.
Definition at line 1523 of file parse_utils.H.
References location, Aleph::SourceLocation::to_string(), Aleph::token_type_to_string(), type, and value.
| SourceLocation Aleph::Token::location |
| TokenType Aleph::Token::type = TokenType::UNKNOWN |
Type of the token.
Definition at line 1508 of file parse_utils.H.
Referenced by is_eof(), and to_string().
| std::string Aleph::Token::value |