File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #include < vector>
2+ #include " wheel_parser/ast/nodes.hxx"
3+
4+ using std::move;
5+ using wheel_parser::ast::Node;
6+ using wheel_parser::ast::StatementNode;
7+ using wheel_parser::ast::FunctionDeclaration;
8+ using wheel_parser::ast::BlockStatement;
9+ using wheel_parser::ast::NodeKind;
10+
11+ Node::Node (NodeKind node_kind,
12+ const Token* token) noexcept : node_kind(node_kind), token(token) {}
13+
14+ StatementNode::StatementNode (NodeKind node_kind,
15+ const Token *token) noexcept : Node(node_kind, token) {}
16+
17+ FunctionDeclaration::FunctionDeclaration (const Token *token,
18+ SymbolID func_name,
19+ std::vector<SymbolID> func_params,
20+ StatementNode *func_body) noexcept :
21+ StatementNode(NodeKind::FunctionDeclaration, token),
22+ func_name(func_name), func_params(move(func_params)), func_body(func_body) {}
23+
24+ BlockStatement::BlockStatement (const Token *token,
25+ std::vector<StatementNode*> statements) noexcept :
26+ StatementNode(NodeKind::BlockStatement, token),
27+ statements(move(statements)){}
You can’t perform that action at this time.
0 commit comments