-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsyntax.h
55 lines (49 loc) · 951 Bytes
/
syntax.h
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
#ifndef SYNT
#define SYNT
#include "lex.h"
#include "poliz.h"
#include <stack>
using namespace std;
class Parser{
Lex curr_lex;
type_of_lex c_type;
int c_val;
Scanner scan;
stack<int>st_int;
stack<type_of_lex>st_lex;
void P();
void SE();
void IN();
void UP();
void DE();
void CR();
void DR();
void CV();
void WH();
void E();
void E1();
void T();
void F();
void DS();
void dec(type_of_lex type);
void check_id();
void check_op();
void check_not();
void check_minus();
void eq_type();
void eq_bool();
void check_id_in_read();
void gl(){
curr_lex = scan.get_lex ();
c_type = curr_lex.get_type ();
c_val = curr_lex.get_value ();
}
public:
Poliz poliz;
Parser(const char *program):scan(program), poliz(1000){}
void analyze(){
gl();
Parser::P();
}
};
#endif