17#ifndef A11_FLOW_TOKEN_H_
18#define A11_FLOW_TOKEN_H_
24#include <absl/time/time.h>
Definition boundary.cc:32
TokenKind KindFromName(std::string_view name)
The kind a name from [KindName] refers to, or kBad if it is not one.
@ kBad
Something the language has no meaning for.
std::string_view KindName(TokenKind kind)
The name of a kind, as a11.flow.lexer spells it.
@ kCarry
What a repeat carries.
TokenKind
What kind of thing a token is.
Definition token.h:36
@ kRange
.. – the range between two bounds, either of which may be left out.
@ kEnd
One past the last token, so lookahead never runs off the end.
@ kWord
A bare word. What it means is the grammar's business, not the lexer's.
@ kNewline
The end of a statement. One per run of blank lines, never leading.
@ kSpread
... or ... – everything the thing after it holds, spread in here.
One token: what it is, where it is, and what it holds.
Definition token.h:87
size_t start
Definition token.h:91
int line
1-based, as a11.flow.lexer has always reported them.
Definition token.h:94
bool IsWord() const
Definition token.h:106
int column
Definition token.h:95
bool is_integer
Definition token.h:102
std::string_view text
The source slice, exactly as written.
Definition token.h:90
bool EndsStatement() const
Whether a line break, a } or the end of the file is here: the three ways a statement can end.
Definition token.h:110
size_t end
Definition token.h:92
std::string string_value
A kString's value, with escapes resolved.
Definition token.h:98
double number
A kNumber's value.
Definition token.h:101
absl::Duration duration
A kDuration's value.
Definition token.h:104
TokenKind kind
Definition token.h:88