Wrapper around the tokenizer to provide a context for parsing. More...
#include <parser.hpp>
Public Member Functions | |
| TCALC_INLINE auto & | tokenizer () const noexcept |
| Get tokenizer. | |
| TCALC_INLINE auto & | current () const noexcept |
| Get current token. | |
| error::Result< void > | eat (token::TokenType type) |
| Eat the current token and get the next one. | |
| error::Result< void > | eat () |
| Eat the current token and get the next one. | |
Static Public Member Functions | |
| static error::Result< ParserContext > | create (std::string_view input) |
| Create a new parser context. | |
Wrapper around the tokenizer to provide a context for parsing.
|
static |
Create a new parser context.
| input | The input string to parse. |
|
inlinenoexcept |
Get current token.
| error::Result< void > tcalc::ast::ParserContext::eat | ( | ) |
Eat the current token and get the next one.
| error::Result< void > tcalc::ast::ParserContext::eat | ( | token::TokenType | type | ) |
Eat the current token and get the next one.
| type | The type of token to eat. |
|
inlinenoexcept |
Get tokenizer.