-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser.h
More file actions
47 lines (43 loc) · 731 Bytes
/
parser.h
File metadata and controls
47 lines (43 loc) · 731 Bytes
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
#ifndef __parse_h__
#define __parse_h__
#include <string>
class Lexer;
class Token;
class Env;
class Stmt;
class Type;
class Expr;
class Access;
class Id;
class Parser{
public:
Parser(Lexer *lexer);
~Parser();
void program();
protected:
void move();
void error(std::string e);
void match(int t);
Stmt* block();
Type * type();
void decls();
Type * dims(Type *p);
Stmt * stmts();
Stmt * stmt();
Stmt * assign();
Expr * Bool();
Expr * join();
Expr * equality();
Expr * rel();
Expr * expr();
Expr * term();
Expr * unary();
Expr * factor();
Access * offset(Id *a);
private:
Lexer *lex;
Token *look;
Env *top;
int used;
};
#endif