#ifndef PARSER_H #define PARSER_H #include #include "Token.h" #include "Expression.h" #include "Statement.h" using namespace std; class Parser { private: vector tokens; int currentIndex = 0; shared_ptr nextStatement(); shared_ptr matchFunctionDeclarationStatement(); shared_ptr matchBlockStatement(); shared_ptr matchReturnStatement(); shared_ptr matchInvalidStatement(); shared_ptr matchExpressionStatement(); shared_ptr term(); // +, - shared_ptr factor(); // *, /, % shared_ptr primary(); // integer, () shared_ptr matchInteger(); shared_ptr matchGrouping(); shared_ptr matchBinary(shared_ptr left); bool matchesTokenKinds(vector kinds); public: Parser(vector tokens); vector> getStatements(); }; #endif