|
Yume
|
A categorized token in source code, created by the tokenizer. These tokens are consumed by the lexer. More...
#include <token.hpp>

Public Types | |
| enum struct | Type { Word , Skip , Symbol , Literal , Number , Char , Separator , EndOfFile } |
| using | Payload = optional< Atom > |
Public Member Functions | |
| auto | is_a (const std::pair< Type, Atom > &type_atom) const -> bool |
| constexpr | Token (Type type) |
| constexpr | Token (Type type, Payload payload) noexcept |
| constexpr | Token (Type type, Payload payload, int i, Loc loc) noexcept |
Static Public Member Functions | |
| static auto constexpr | type_name (Type type) -> const char * |
Public Attributes | |
| Type | type |
| Payload | payload |
| int | index = -1 |
| Loc | loc {} |
Friends | |
| auto | operator<< (llvm::raw_ostream &os, const Token &token) -> llvm::raw_ostream & |
A categorized token in source code, created by the tokenizer. These tokens are consumed by the lexer.
Each token has a type, an associated payload (usually the text the token was created from) and a location Loc
| using yume::Token::Payload = optional<Atom> |
|
strong |
|
inlineexplicitconstexpr |
|
inlinestaticconstexpr |
Definition at line 91 of file token.hpp.
References type.
Referenced by yume::ast::parser::Parser::consume(), yume::ast::parser::Parser::expect(), and yume::ast::parser::Parser::try_peek().
|
friend |
| Type yume::Token::type |
Definition at line 107 of file token.hpp.
Referenced by is_a(), and type_name().