#ifndef PARSER_H #define PARSER_H #include #include #include "Token.h" using namespace std; class Parser { public: Parser(vector tokens); virtual ~Parser(); void interpret(); string report_message; string error_message; protected: private: Token current_token; string tok_value; vector token_stream; int position_in_stream; bool read_next(); bool peek(string s); bool accept(string s); bool expect(string s); bool is_type(); void error(string s); void report(string s); void statement(); void add_expr(); void prim_expr(); void postfix_expr(); void rel_expr(); void eq_expr(); void expr(); }; #endif // PARSER_H