forked from mathk/gst-thunder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIRVisitor.st
122 lines (86 loc) · 1.95 KB
/
IRVisitor.st
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
Object subclass: IRVisitor [
IRVisitor class >> on: aProgram [
^ self new
visitProgram: aProgram;
yourself
]
visitProgram: aProgram [
aProgram accept: self
]
visitFunction: aFunction [
aFunction variablesDo: [ :each |
each accept: self ].
aFunction instructionsDo: [ :each |
each accept: self ]
]
visitInteger: anInteger [
]
visitVariableDeclaration: aVariable [
]
visitVariable: aVariable [
]
visitMov: aMov [
aMov source accept: self.
aMov destination accept: self
]
visitAdd: anAdd [
anAdd source accept: self.
anAdd param accept: self.
anAdd destination accept: self
]
visitSub: aSub [
aSub source accept: self.
aSub param accept: self.
aSub destination accept: self
]
visitMul: aMul [
aMul source accept: self.
aMul param accept: self.
aMul destination accept: self
]
visitDiv: aDiv [
aDiv source accept: self.
aDiv param accept: self.
aDiv destination accept: self
]
visitMod: aMod [
aMod source accept: self.
aMod param accept: self.
aMod destination accept: self
]
visitAnd: anAnd [
anAnd source accept: self.
anAnd param accept: self.
anAnd destination accept: self
]
visitOr: anOr [
anOr source accept: self.
anOr param accept: self.
anOr destination accept: self
]
visitXor: aXor [
aXor source accept: self.
aXor param accept: self.
aXor destination accept: self
]
visitLsh: aLsh [
aLsh source accept: self.
aLsh param accept: self.
aLsh destination accept: self
]
visitRsh: aRsh [
aRsh source accept: self.
aRsh param accept: self.
aRsh destination accept: self
]
visitLoad: aLoad [
aLoad type accept: self.
aLoad source accept: self.
aLoad destination accept: self
]
visitStore: aStore [
aStore type accept: self.
aStore value accept: self.
aStore destination accept: self
]
]