24 std::vector<Token> tokens;
25 std::shared_ptr<Node> AST;
26 std::stack<Call*> currentCall;
33 void match(
int symbol);
40 std::shared_ptr<Node> parse_CODE();
47 std::shared_ptr<Node> parse_STATEMENT();
54 std::shared_ptr<Node> parse_IFPARAM();
61 std::shared_ptr<Node> parse_ELSE();
72 currentCall = std::stack<Call*>();
82 void setTokens(std::vector<Token> _tokens);
99 std::shared_ptr<Node>
getAST();
The Parser class is responsible for parsing a sequence of tokens and constructing an abstract syntax ...
Definition parser.h:21
Parser()
Constructs a Parser object with default values.
Definition parser.h:69
void parse()
Initiates the parsing process and builds the abstract syntax tree (AST).
Definition parser.cpp:151
void setTokens(std::vector< Token > _tokens)
Sets the tokens for the parser to process.
Definition parser.cpp:147
std::shared_ptr< Node > getAST()
Returns the root of the abstract syntax tree (AST).
Definition parser.cpp:155