1#ifndef PARSER_TOKEN_STREAM_H
2#define PARSER_TOKEN_STREAM_H
11namespace downward::cli::parser {
32 Token(
const std::string& content, TokenType type);
36 std::vector<Token> tokens;
40 explicit TokenStream(std::vector<Token>&& tokens);
42 bool has_tokens(
int n)
const;
43 Token peek(
const utils::Context& context,
int n = 0)
const;
44 Token pop(
const utils::Context& context);
45 Token pop(
const utils::Context& context, TokenType expected_type);
47 int get_position()
const;
49 std::string str(
int from,
int to)
const;
52extern std::string token_type_name(TokenType token_type);
53extern std::ostream& operator<<(std::ostream& out, TokenType token_type);
54extern std::ostream& operator<<(std::ostream& out,
const Token& token);
58struct hash<downward::cli::parser::TokenType> {
59 size_t operator()(
const downward::cli::parser::TokenType& t)
const