-
Notifications
You must be signed in to change notification settings - Fork 0
/
Visitor.h
50 lines (44 loc) · 1.21 KB
/
Visitor.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
#pragma once
#include <memory>
using namespace std;
class Block;
class Global;
class Assignment;
class CallStatement;
class IfStatement;
class WhileLoop;
class Return;
class FunctionExpr;
class BinaryExpr;
class UnaryExpr;
class FieldDeref;
class IndexExpr;
class Call;
class RecordExpr;
class Identifier;
class IntConst;
class StrConst;
class BoolConst;
class NoneConst;
class Visitor {
public:
virtual void visit(Block& exp) = 0;
virtual void visit(Global& exp) = 0;
virtual void visit(Assignment& exp) = 0;
virtual void visit(CallStatement& exp) = 0;
virtual void visit(IfStatement& exp) = 0;
virtual void visit(WhileLoop& exp) = 0;
virtual void visit(Return& exp) = 0;
virtual void visit(FunctionExpr& exp) = 0;
virtual void visit(BinaryExpr& exp) = 0;
virtual void visit(UnaryExpr& exp) = 0;
virtual void visit(FieldDeref& exp) = 0;
virtual void visit(IndexExpr& exp) = 0;
virtual void visit(Call& exp) = 0;
virtual void visit(RecordExpr& exp) = 0;
virtual void visit(Identifier& exp) = 0;
virtual void visit(IntConst& exp) = 0;
virtual void visit(StrConst& exp) = 0;
virtual void visit(BoolConst& exp) = 0;
virtual void visit(NoneConst& exp) = 0;
};