|
picceler
|
Represents a token produced by the lexer. More...
#include <lexer.h>
Public Types | |
| enum class | Type : uint8_t { IDENTIFIER , NUMBER , PLUS , MINUS , MULTIPLY , DIVIDE , STRING , L_PAREN , R_PAREN , L_BRACKET , R_BRACKET , L_BRACE , R_BRACE , COMMA , COLON , ARROW , ASSIGN , EQ , NE , LT , GT , LE , GE , TYPE , KW_DEF , KW_RETURN , KW_IF , EOF_TOKEN , UNKNOWN } |
| The type of the token. More... | |
Public Member Functions | |
| Token () | |
| Token (Type type, std::string value, Location location) | |
| Token (const Token &other) | |
| Token (Token &&other) noexcept | |
| ~Token ()=default | |
| Token & | operator= (const Token &other) |
| Token & | operator= (Token &&other) noexcept |
| std::string | typeToString () const |
| Converts the token type to a string representation. | |
| std::string | toString () const |
| Converts the token to a string representation. | |
| Type | type () const |
| const std::string & | value () const |
| size_t | line () const |
| size_t | column () const |
| Location | location () const |
Friends | |
| constexpr bool | operator== (const Token &lhs, const Token::Type &rhs) |
Represents a token produced by the lexer.
|
strong |
|
inline |
|
inline |
|
inlinenoexcept |
|
default |
|
inline |
|
inline |
|
inline |
|
inline |
Converts the token to a string representation.
|
inline |
| std::string picceler::Token::typeToString | ( | ) | const |
Converts the token type to a string representation.
|
inline |
|
friend |