|
A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
|
One token: what it is, where it is, and what it holds. More...
#include <cpp/a11/flow/token.h>
Public Member Functions | |
| bool | IsWord () const |
| bool | EndsStatement () const |
| Whether this token ends a statement. | |
Public Attributes | |
| TokenKind | kind = TokenKind::kEnd |
| std::string_view | text |
| The source slice, exactly as written. | |
| size_t | start = 0 |
| size_t | end = 0 |
| int | line = 1 |
1-based, as a11.flow.lexer has always reported them. | |
| int | column = 1 |
| std::string | string_value |
A kString's value, with escapes resolved. | |
| std::vector< StringEscape > | string_escapes |
| Escape ranges before multiline indentation is removed. | |
| double | number = 0.0 |
A kNumber's value. | |
| long long | integer = 0 |
| bool | is_integer = false |
| absl::Duration | duration |
A kDuration's value. | |
One token: what it is, where it is, and what it holds.
text borrows the source, so a token lives no longer than the text it was lexed from – which is how every caller uses it: lex, use, discard.
|
inline |
Whether this token ends a statement.
|
inline |
| int a11::flow::Token::column = 1 |
| absl::Duration a11::flow::Token::duration |
A kDuration's value.
| size_t a11::flow::Token::end = 0 |
| long long a11::flow::Token::integer = 0 |
| bool a11::flow::Token::is_integer = false |
| TokenKind a11::flow::Token::kind = TokenKind::kEnd |
| int a11::flow::Token::line = 1 |
1-based, as a11.flow.lexer has always reported them.
| double a11::flow::Token::number = 0.0 |
A kNumber's value.
is_integer says whether it was written without a fractional part, which is what the counted forms of the grammar require.
| size_t a11::flow::Token::start = 0 |
| std::vector<StringEscape> a11::flow::Token::string_escapes |
Escape ranges before multiline indentation is removed.
| std::string a11::flow::Token::string_value |
A kString's value, with escapes resolved.
| std::string_view a11::flow::Token::text |
The source slice, exactly as written.