-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirstListener.py
More file actions
388 lines (260 loc) · 11.5 KB
/
firstListener.py
File metadata and controls
388 lines (260 loc) · 11.5 KB
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
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
# Generated from first.g4 by ANTLR 4.6
from antlr4 import *
if __name__ is not None and "." in __name__:
from .firstParser import firstParser
else:
from firstParser import firstParser
# This class defines a complete listener for a parse tree produced by firstParser.
class firstListener(ParseTreeListener):
# Enter a parse tree produced by firstParser#tokens.
def enterTokens(self, ctx:firstParser.TokensContext):
pass
# Exit a parse tree produced by firstParser#tokens.
def exitTokens(self, ctx:firstParser.TokensContext):
pass
# Enter a parse tree produced by firstParser#program.
def enterProgram(self, ctx:firstParser.ProgramContext):
pass
# Exit a parse tree produced by firstParser#program.
def exitProgram(self, ctx:firstParser.ProgramContext):
pass
# Enter a parse tree produced by firstParser#id_.
def enterId_(self, ctx:firstParser.Id_Context):
pass
# Exit a parse tree produced by firstParser#id_.
def exitId_(self, ctx:firstParser.Id_Context):
pass
# Enter a parse tree produced by firstParser#pgm_body.
def enterPgm_body(self, ctx:firstParser.Pgm_bodyContext):
pass
# Exit a parse tree produced by firstParser#pgm_body.
def exitPgm_body(self, ctx:firstParser.Pgm_bodyContext):
pass
# Enter a parse tree produced by firstParser#decl.
def enterDecl(self, ctx:firstParser.DeclContext):
pass
# Exit a parse tree produced by firstParser#decl.
def exitDecl(self, ctx:firstParser.DeclContext):
pass
# Enter a parse tree produced by firstParser#string_decl.
def enterString_decl(self, ctx:firstParser.String_declContext):
pass
# Exit a parse tree produced by firstParser#string_decl.
def exitString_decl(self, ctx:firstParser.String_declContext):
pass
# Enter a parse tree produced by firstParser#str_.
def enterStr_(self, ctx:firstParser.Str_Context):
pass
# Exit a parse tree produced by firstParser#str_.
def exitStr_(self, ctx:firstParser.Str_Context):
pass
# Enter a parse tree produced by firstParser#var_decl.
def enterVar_decl(self, ctx:firstParser.Var_declContext):
pass
# Exit a parse tree produced by firstParser#var_decl.
def exitVar_decl(self, ctx:firstParser.Var_declContext):
pass
# Enter a parse tree produced by firstParser#var_type.
def enterVar_type(self, ctx:firstParser.Var_typeContext):
pass
# Exit a parse tree produced by firstParser#var_type.
def exitVar_type(self, ctx:firstParser.Var_typeContext):
pass
# Enter a parse tree produced by firstParser#any_type.
def enterAny_type(self, ctx:firstParser.Any_typeContext):
pass
# Exit a parse tree produced by firstParser#any_type.
def exitAny_type(self, ctx:firstParser.Any_typeContext):
pass
# Enter a parse tree produced by firstParser#id_list.
def enterId_list(self, ctx:firstParser.Id_listContext):
pass
# Exit a parse tree produced by firstParser#id_list.
def exitId_list(self, ctx:firstParser.Id_listContext):
pass
# Enter a parse tree produced by firstParser#id_tail.
def enterId_tail(self, ctx:firstParser.Id_tailContext):
pass
# Exit a parse tree produced by firstParser#id_tail.
def exitId_tail(self, ctx:firstParser.Id_tailContext):
pass
# Enter a parse tree produced by firstParser#param_decl_list.
def enterParam_decl_list(self, ctx:firstParser.Param_decl_listContext):
pass
# Exit a parse tree produced by firstParser#param_decl_list.
def exitParam_decl_list(self, ctx:firstParser.Param_decl_listContext):
pass
# Enter a parse tree produced by firstParser#param_decl.
def enterParam_decl(self, ctx:firstParser.Param_declContext):
pass
# Exit a parse tree produced by firstParser#param_decl.
def exitParam_decl(self, ctx:firstParser.Param_declContext):
pass
# Enter a parse tree produced by firstParser#param_decl_tail.
def enterParam_decl_tail(self, ctx:firstParser.Param_decl_tailContext):
pass
# Exit a parse tree produced by firstParser#param_decl_tail.
def exitParam_decl_tail(self, ctx:firstParser.Param_decl_tailContext):
pass
# Enter a parse tree produced by firstParser#func_declarations.
def enterFunc_declarations(self, ctx:firstParser.Func_declarationsContext):
pass
# Exit a parse tree produced by firstParser#func_declarations.
def exitFunc_declarations(self, ctx:firstParser.Func_declarationsContext):
pass
# Enter a parse tree produced by firstParser#func_decl.
def enterFunc_decl(self, ctx:firstParser.Func_declContext):
pass
# Exit a parse tree produced by firstParser#func_decl.
def exitFunc_decl(self, ctx:firstParser.Func_declContext):
pass
# Enter a parse tree produced by firstParser#func_body.
def enterFunc_body(self, ctx:firstParser.Func_bodyContext):
pass
# Exit a parse tree produced by firstParser#func_body.
def exitFunc_body(self, ctx:firstParser.Func_bodyContext):
pass
# Enter a parse tree produced by firstParser#stmt_list.
def enterStmt_list(self, ctx:firstParser.Stmt_listContext):
pass
# Exit a parse tree produced by firstParser#stmt_list.
def exitStmt_list(self, ctx:firstParser.Stmt_listContext):
pass
# Enter a parse tree produced by firstParser#stmt.
def enterStmt(self, ctx:firstParser.StmtContext):
pass
# Exit a parse tree produced by firstParser#stmt.
def exitStmt(self, ctx:firstParser.StmtContext):
pass
# Enter a parse tree produced by firstParser#base_stmt.
def enterBase_stmt(self, ctx:firstParser.Base_stmtContext):
pass
# Exit a parse tree produced by firstParser#base_stmt.
def exitBase_stmt(self, ctx:firstParser.Base_stmtContext):
pass
# Enter a parse tree produced by firstParser#assign_stmt.
def enterAssign_stmt(self, ctx:firstParser.Assign_stmtContext):
pass
# Exit a parse tree produced by firstParser#assign_stmt.
def exitAssign_stmt(self, ctx:firstParser.Assign_stmtContext):
pass
# Enter a parse tree produced by firstParser#assign_expr.
def enterAssign_expr(self, ctx:firstParser.Assign_exprContext):
pass
# Exit a parse tree produced by firstParser#assign_expr.
def exitAssign_expr(self, ctx:firstParser.Assign_exprContext):
pass
# Enter a parse tree produced by firstParser#read_stmt.
def enterRead_stmt(self, ctx:firstParser.Read_stmtContext):
pass
# Exit a parse tree produced by firstParser#read_stmt.
def exitRead_stmt(self, ctx:firstParser.Read_stmtContext):
pass
# Enter a parse tree produced by firstParser#write_stmt.
def enterWrite_stmt(self, ctx:firstParser.Write_stmtContext):
pass
# Exit a parse tree produced by firstParser#write_stmt.
def exitWrite_stmt(self, ctx:firstParser.Write_stmtContext):
pass
# Enter a parse tree produced by firstParser#return_stmt.
def enterReturn_stmt(self, ctx:firstParser.Return_stmtContext):
pass
# Exit a parse tree produced by firstParser#return_stmt.
def exitReturn_stmt(self, ctx:firstParser.Return_stmtContext):
pass
# Enter a parse tree produced by firstParser#expr.
def enterExpr(self, ctx:firstParser.ExprContext):
pass
# Exit a parse tree produced by firstParser#expr.
def exitExpr(self, ctx:firstParser.ExprContext):
pass
# Enter a parse tree produced by firstParser#expr_prefix.
def enterExpr_prefix(self, ctx:firstParser.Expr_prefixContext):
pass
# Exit a parse tree produced by firstParser#expr_prefix.
def exitExpr_prefix(self, ctx:firstParser.Expr_prefixContext):
pass
# Enter a parse tree produced by firstParser#factor.
def enterFactor(self, ctx:firstParser.FactorContext):
pass
# Exit a parse tree produced by firstParser#factor.
def exitFactor(self, ctx:firstParser.FactorContext):
pass
# Enter a parse tree produced by firstParser#factor_prefix.
def enterFactor_prefix(self, ctx:firstParser.Factor_prefixContext):
pass
# Exit a parse tree produced by firstParser#factor_prefix.
def exitFactor_prefix(self, ctx:firstParser.Factor_prefixContext):
pass
# Enter a parse tree produced by firstParser#postfix_expr.
def enterPostfix_expr(self, ctx:firstParser.Postfix_exprContext):
pass
# Exit a parse tree produced by firstParser#postfix_expr.
def exitPostfix_expr(self, ctx:firstParser.Postfix_exprContext):
pass
# Enter a parse tree produced by firstParser#call_expr.
def enterCall_expr(self, ctx:firstParser.Call_exprContext):
pass
# Exit a parse tree produced by firstParser#call_expr.
def exitCall_expr(self, ctx:firstParser.Call_exprContext):
pass
# Enter a parse tree produced by firstParser#expr_list.
def enterExpr_list(self, ctx:firstParser.Expr_listContext):
pass
# Exit a parse tree produced by firstParser#expr_list.
def exitExpr_list(self, ctx:firstParser.Expr_listContext):
pass
# Enter a parse tree produced by firstParser#expr_list_tail.
def enterExpr_list_tail(self, ctx:firstParser.Expr_list_tailContext):
pass
# Exit a parse tree produced by firstParser#expr_list_tail.
def exitExpr_list_tail(self, ctx:firstParser.Expr_list_tailContext):
pass
# Enter a parse tree produced by firstParser#primary.
def enterPrimary(self, ctx:firstParser.PrimaryContext):
pass
# Exit a parse tree produced by firstParser#primary.
def exitPrimary(self, ctx:firstParser.PrimaryContext):
pass
# Enter a parse tree produced by firstParser#addop.
def enterAddop(self, ctx:firstParser.AddopContext):
pass
# Exit a parse tree produced by firstParser#addop.
def exitAddop(self, ctx:firstParser.AddopContext):
pass
# Enter a parse tree produced by firstParser#mulop.
def enterMulop(self, ctx:firstParser.MulopContext):
pass
# Exit a parse tree produced by firstParser#mulop.
def exitMulop(self, ctx:firstParser.MulopContext):
pass
# Enter a parse tree produced by firstParser#if_stmt.
def enterIf_stmt(self, ctx:firstParser.If_stmtContext):
pass
# Exit a parse tree produced by firstParser#if_stmt.
def exitIf_stmt(self, ctx:firstParser.If_stmtContext):
pass
# Enter a parse tree produced by firstParser#else_part.
def enterElse_part(self, ctx:firstParser.Else_partContext):
pass
# Exit a parse tree produced by firstParser#else_part.
def exitElse_part(self, ctx:firstParser.Else_partContext):
pass
# Enter a parse tree produced by firstParser#cond.
def enterCond(self, ctx:firstParser.CondContext):
pass
# Exit a parse tree produced by firstParser#cond.
def exitCond(self, ctx:firstParser.CondContext):
pass
# Enter a parse tree produced by firstParser#compop.
def enterCompop(self, ctx:firstParser.CompopContext):
pass
# Exit a parse tree produced by firstParser#compop.
def exitCompop(self, ctx:firstParser.CompopContext):
pass
# Enter a parse tree produced by firstParser#while_stmt.
def enterWhile_stmt(self, ctx:firstParser.While_stmtContext):
pass
# Exit a parse tree produced by firstParser#while_stmt.
def exitWhile_stmt(self, ctx:firstParser.While_stmtContext):
pass