-
Notifications
You must be signed in to change notification settings - Fork 1
/
QuarkListener.py
342 lines (230 loc) · 9.68 KB
/
QuarkListener.py
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
# Generated from Quark.g4 by ANTLR 4.7.1
from antlr4 import *
if __name__ is not None and "." in __name__:
from .QuarkParser import QuarkParser
else:
from QuarkParser import QuarkParser
from Compiler import Compiler
c = Compiler()
quadruples = None
func_directory = None
type_directory = None
constants = None
# This class defines a complete listener for a parse tree produced by QuarkParser.
class QuarkListener(ParseTreeListener):
# Enter a parse tree produced by QuarkParser#function.
def enterFunction(self, ctx:QuarkParser.FunctionContext):
pass
# Exit a parse tree produced by QuarkParser#function.
def exitFunction(self, ctx:QuarkParser.FunctionContext):
pass
# Enter a parse tree produced by QuarkParser#params.
def enterParams(self, ctx:QuarkParser.ParamsContext):
pass
# Exit a parse tree produced by QuarkParser#params.
def exitParams(self, ctx:QuarkParser.ParamsContext):
pass
# Enter a parse tree produced by QuarkParser#moreparams.
def enterMoreparams(self, ctx:QuarkParser.MoreparamsContext):
pass
# Exit a parse tree produced by QuarkParser#moreparams.
def exitMoreparams(self, ctx:QuarkParser.MoreparamsContext):
pass
# Enter a parse tree produced by QuarkParser#moreTypes.
def enterMoreTypes(self, ctx:QuarkParser.MoreTypesContext):
pass
# Exit a parse tree produced by QuarkParser#moreTypes.
def exitMoreTypes(self, ctx:QuarkParser.MoreTypesContext):
pass
# Enter a parse tree produced by QuarkParser#UserType.
def enterUserType(self, ctx:QuarkParser.UserTypeContext):
pass
# Exit a parse tree produced by QuarkParser#UserType.
def exitUserType(self, ctx:QuarkParser.UserTypeContext):
pass
# Enter a parse tree produced by QuarkParser#Int.
def enterInt(self, ctx:QuarkParser.IntContext):
pass
# Exit a parse tree produced by QuarkParser#Int.
def exitInt(self, ctx:QuarkParser.IntContext):
pass
# Enter a parse tree produced by QuarkParser#Boolean.
def enterBoolean(self, ctx:QuarkParser.BooleanContext):
pass
# Exit a parse tree produced by QuarkParser#Boolean.
def exitBoolean(self, ctx:QuarkParser.BooleanContext):
pass
# Enter a parse tree produced by QuarkParser#Float.
def enterFloat(self, ctx:QuarkParser.FloatContext):
pass
# Exit a parse tree produced by QuarkParser#Float.
def exitFloat(self, ctx:QuarkParser.FloatContext):
pass
# Enter a parse tree produced by QuarkParser#String.
def enterString(self, ctx:QuarkParser.StringContext):
pass
# Exit a parse tree produced by QuarkParser#String.
def exitString(self, ctx:QuarkParser.StringContext):
pass
# Enter a parse tree produced by QuarkParser#None.
def enterNone(self, ctx:QuarkParser.NoneContext):
pass
# Exit a parse tree produced by QuarkParser#None.
def exitNone(self, ctx:QuarkParser.NoneContext):
pass
# Enter a parse tree produced by QuarkParser#Any.
def enterAny(self, ctx:QuarkParser.AnyContext):
pass
# Exit a parse tree produced by QuarkParser#Any.
def exitAny(self, ctx:QuarkParser.AnyContext):
pass
# Enter a parse tree produced by QuarkParser#ListOfType.
def enterListOfType(self, ctx:QuarkParser.ListOfTypeContext):
pass
# Exit a parse tree produced by QuarkParser#ListOfType.
def exitListOfType(self, ctx:QuarkParser.ListOfTypeContext):
pass
# Enter a parse tree produced by QuarkParser#typevalue.
def enterTypevalue(self, ctx:QuarkParser.TypevalueContext):
pass
# Exit a parse tree produced by QuarkParser#typevalue.
def exitTypevalue(self, ctx:QuarkParser.TypevalueContext):
pass
# Enter a parse tree produced by QuarkParser#typedef.
def enterTypedef(self, ctx:QuarkParser.TypedefContext):
pass
# Exit a parse tree produced by QuarkParser#typedef.
def exitTypedef(self, ctx:QuarkParser.TypedefContext):
pass
# Enter a parse tree produced by QuarkParser#typeset.
def enterTypeset(self, ctx:QuarkParser.TypesetContext):
pass
# Exit a parse tree produced by QuarkParser#typeset.
def exitTypeset(self, ctx:QuarkParser.TypesetContext):
pass
# Enter a parse tree produced by QuarkParser#cond.
def enterCond(self, ctx:QuarkParser.CondContext):
pass
# Exit a parse tree produced by QuarkParser#cond.
def exitCond(self, ctx:QuarkParser.CondContext):
pass
# Enter a parse tree produced by QuarkParser#expression.
def enterExpression(self, ctx:QuarkParser.ExpressionContext):
pass
# Exit a parse tree produced by QuarkParser#expression.
def exitExpression(self, ctx:QuarkParser.ExpressionContext):
pass
# Enter a parse tree produced by QuarkParser#comp.
def enterComp(self, ctx:QuarkParser.CompContext):
pass
# Exit a parse tree produced by QuarkParser#comp.
def exitComp(self, ctx:QuarkParser.CompContext):
pass
# Enter a parse tree produced by QuarkParser#exp.
def enterExp(self, ctx:QuarkParser.ExpContext):
pass
# Exit a parse tree produced by QuarkParser#exp.
def exitExp(self, ctx:QuarkParser.ExpContext):
pass
# Enter a parse tree produced by QuarkParser#term.
def enterTerm(self, ctx:QuarkParser.TermContext):
pass
# Exit a parse tree produced by QuarkParser#term.
def exitTerm(self, ctx:QuarkParser.TermContext):
pass
# Enter a parse tree produced by QuarkParser#Positive.
def enterPositive(self, ctx:QuarkParser.PositiveContext):
pass
# Exit a parse tree produced by QuarkParser#Positive.
def exitPositive(self, ctx:QuarkParser.PositiveContext):
pass
# Enter a parse tree produced by QuarkParser#Negative.
def enterNegative(self, ctx:QuarkParser.NegativeContext):
pass
# Exit a parse tree produced by QuarkParser#Negative.
def exitNegative(self, ctx:QuarkParser.NegativeContext):
pass
# Enter a parse tree produced by QuarkParser#Parens.
def enterParens(self, ctx:QuarkParser.ParensContext):
pass
# Exit a parse tree produced by QuarkParser#Parens.
def exitParens(self, ctx:QuarkParser.ParensContext):
pass
# Enter a parse tree produced by QuarkParser#True.
def enterTrue(self, ctx:QuarkParser.TrueContext):
pass
# Exit a parse tree produced by QuarkParser#True.
def exitTrue(self, ctx:QuarkParser.TrueContext):
pass
# Enter a parse tree produced by QuarkParser#False.
def enterFalse(self, ctx:QuarkParser.FalseContext):
pass
# Exit a parse tree produced by QuarkParser#False.
def exitFalse(self, ctx:QuarkParser.FalseContext):
pass
# Enter a parse tree produced by QuarkParser#StringLiteral.
def enterStringLiteral(self, ctx:QuarkParser.StringLiteralContext):
pass
# Exit a parse tree produced by QuarkParser#StringLiteral.
def exitStringLiteral(self, ctx:QuarkParser.StringLiteralContext):
pass
# Enter a parse tree produced by QuarkParser#ListLiteral.
def enterListLiteral(self, ctx:QuarkParser.ListLiteralContext):
pass
# Exit a parse tree produced by QuarkParser#ListLiteral.
def exitListLiteral(self, ctx:QuarkParser.ListLiteralContext):
pass
# Enter a parse tree produced by QuarkParser#EmptyList.
def enterEmptyList(self, ctx:QuarkParser.EmptyListContext):
pass
# Exit a parse tree produced by QuarkParser#EmptyList.
def exitEmptyList(self, ctx:QuarkParser.EmptyListContext):
pass
# Enter a parse tree produced by QuarkParser#varconst.
def enterVarconst(self, ctx:QuarkParser.VarconstContext):
pass
# Exit a parse tree produced by QuarkParser#varconst.
def exitVarconst(self, ctx:QuarkParser.VarconstContext):
pass
# Enter a parse tree produced by QuarkParser#block.
def enterBlock(self, ctx:QuarkParser.BlockContext):
pass
# Exit a parse tree produced by QuarkParser#block.
def exitBlock(self, ctx:QuarkParser.BlockContext):
pass
# Enter a parse tree produced by QuarkParser#statement.
def enterStatement(self, ctx:QuarkParser.StatementContext):
pass
# Exit a parse tree produced by QuarkParser#statement.
def exitStatement(self, ctx:QuarkParser.StatementContext):
pass
# Enter a parse tree produced by QuarkParser#func_call.
def enterFunc_call(self, ctx:QuarkParser.Func_callContext):
pass
# Exit a parse tree produced by QuarkParser#func_call.
def exitFunc_call(self, ctx:QuarkParser.Func_callContext):
pass
# Enter a parse tree produced by QuarkParser#assignment.
def enterAssignment(self, ctx:QuarkParser.AssignmentContext):
pass
# Exit a parse tree produced by QuarkParser#assignment.
def exitAssignment(self, ctx:QuarkParser.AssignmentContext):
pass
# Enter a parse tree produced by QuarkParser#main.
def enterMain(self, ctx:QuarkParser.MainContext):
pass
# Exit a parse tree produced by QuarkParser#main.
def exitMain(self, ctx:QuarkParser.MainContext):
pass
# Enter a parse tree produced by QuarkParser#things.
def enterThings(self, ctx:QuarkParser.ThingsContext):
pass
# Exit a parse tree produced by QuarkParser#things.
def exitThings(self, ctx:QuarkParser.ThingsContext):
pass
# Enter a parse tree produced by QuarkParser#morethings.
def enterMorethings(self, ctx:QuarkParser.MorethingsContext):
pass
# Exit a parse tree produced by QuarkParser#morethings.
def exitMorethings(self, ctx:QuarkParser.MorethingsContext):
pass