-
Notifications
You must be signed in to change notification settings - Fork 0
/
Parser.hpp
56 lines (44 loc) · 1.08 KB
/
Parser.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// Created by smith on 3/20/2019.
//
#ifndef __PARSER_HPP
#define __PARSER_HPP
#include "Token.hpp"
#include "Tokenizer.hpp"
#include "SymTab.hpp"
#include "ArithExpr.hpp"
#include "Statements.hpp"
#include<vector>
#include<iostream>
#include<map>
class Parser {
public:
Parser(Tokenizer &tokenizer) : tokenizer{tokenizer} {}
Statements *statements();
Statement *statement();
ForStatement *forStatement();
AssignmentStatement *assignStatement();
PrintStatement *printStatement();
IfStatement *ifStatement();
Function *function_Def();
Function *call_stmt();
ReturnStatement *return_stmt();
Array_ops *array_ops();
ExprNode *array_len();
ExprNode *subscription();
ExprNode *call();
ExprNode *test();
ExprNode *or_test();
ExprNode *and_test();
ExprNode *not_test();
ExprNode *rel_expr();
ExprNode *expr();
ExprNode *term();
ExprNode *factor();
ExprNode *primary();
ExprNode *id();
private:
Tokenizer &tokenizer;
void die(std::string where, std::string message, Token &token);
};
#endif