-
Notifications
You must be signed in to change notification settings - Fork 0
/
Visitor.h
71 lines (67 loc) · 1.73 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef _VISITOR_H_
#define _VISITOR_H_
class Program;
class MainClass;
class ClassDeclSimple;
class ClassDeclExtends;
class VarDecl;
class MethodDecl;
class Argument;
class ArrayType;
class BoolType;
class IntType;
class IdentifierType;
class BinOpExpression;
class Block;
class If;
class While;
class Print;
class Assign;
class ArrayAssign;
class ArrayLookup;
class ArrayLength;
class Call;
class IntegerLiteral;
class True;
class False;
class IdentifierExp;
class This;
class NewArray;
class NewObject;
class Not;
class Identifier;
// AST Visitor
class Visitor {
public:
virtual void visit(Program* n) = 0;
virtual void visit(MainClass* n) = 0;
virtual void visit(ClassDeclSimple* n) = 0;
virtual void visit(ClassDeclExtends* n) = 0;
virtual void visit(VarDecl* n) = 0;
virtual void visit(MethodDecl* n) = 0;
virtual void visit(Argument* n) = 0;
virtual void visit(ArrayType* n) = 0;
virtual void visit(BoolType* n) = 0;
virtual void visit(IntType* n) = 0;
virtual void visit(IdentifierType* n) = 0;
virtual void visit(BinOpExpression* n) = 0;
virtual void visit(Block* n) = 0;
virtual void visit(If* n) = 0;
virtual void visit(While* n) = 0;
virtual void visit(Print* n) = 0;
virtual void visit(Assign* n) = 0;
virtual void visit(ArrayAssign* n) = 0;
virtual void visit(ArrayLookup* n) = 0;
virtual void visit(ArrayLength* n) = 0;
virtual void visit(Call* n) = 0;
virtual void visit(IntegerLiteral* n) = 0;
virtual void visit(True* n) = 0;
virtual void visit(False* n) = 0;
virtual void visit(IdentifierExp* n) = 0;
virtual void visit(This* n) = 0;
virtual void visit(NewArray* n) = 0;
virtual void visit(NewObject* n) = 0;
virtual void visit(Not* n) = 0;
virtual void visit(Identifier* n) = 0;
};
#endif