File tree Expand file tree Collapse file tree
wheel_parser/include/wheel_parser Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #include " wheel_lexer/kind.hxx"
12#if !defined(PARSER_HXX)
23#define PARSER_HXX
4+
5+ #include < string_view>
36#include " config.hxx"
47#include < wheel_lexer/lexer.hxx>
58#include < wheel_lexer/token.hxx>
9+ #include < wheel_memory/allocator.hxx>
10+ #include " wheel_parser/ast/nodes.hxx"
11+ #include " wheel_parser/ast/symbol.hxx"
612
7- using namespace wheel_lexer ;
13+ using wheel_lexer::Token;
14+ using wheel_lexer::TokenKind;
15+ using wheel_lexer::Lexer;
16+ using wheel_memory::Arena;
17+ using wheel_parser::ast::VariableDeclaration;
18+ using wheel_parser::ast::StringInterner;
19+ using std::string_view;
820
921WHEEL_PARSER_NAMESPACE
1022 class WheelParser {
23+ private:
24+ Lexer &m_lexer;
25+ Arena &m_arena;
26+ Token m_current_token;
27+ StringInterner &m_interner;
28+
29+ private:
30+ void next_token () noexcept {
31+ m_current_token = m_lexer.next_token ();
32+ }
33+
34+ bool str_matches (string_view str) noexcept ;
35+ bool token_matches (TokenKind token_kind) noexcept ;
36+
37+ const Token &consume () noexcept ;
38+ const Token *copy_token () const noexcept ;
39+
1140 public:
12- WheelParser ();
41+ explicit WheelParser (Lexer &lexer, Arena &arena, StringInterner &interner) noexcept ;
42+ VariableDeclaration *parse_variable_declaration () noexcept ;
43+ void parse () noexcept ;
1344 };
1445
1546WHEEL_PARSER_END_NAMESPACE
You can’t perform that action at this time.
0 commit comments