forked from csaroff/MiniJava-Compiler
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMinijavaListener.java
More file actions
426 lines (425 loc) · 16.6 KB
/
Copy pathMinijavaListener.java
File metadata and controls
426 lines (425 loc) · 16.6 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
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
// Generated from Minijava.g4 by ANTLR 4.4
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.tree.ParseTreeListener;
/**
* This interface defines a complete listener for a parse tree produced by
* {@link MinijavaParser}.
*/
public interface MinijavaListener extends ParseTreeListener {
/**
* Enter a parse tree produced by the {@code thisExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void enterThisExpression(@NotNull MinijavaParser.ThisExpressionContext ctx);
/**
* Exit a parse tree produced by the {@code thisExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void exitThisExpression(@NotNull MinijavaParser.ThisExpressionContext ctx);
/**
* Enter a parse tree produced by the {@code variableAssignmentStatement}
* labeled alternative in {@link MinijavaParser#statement}.
* @param ctx the parse tree
*/
void enterVariableAssignmentStatement(@NotNull MinijavaParser.VariableAssignmentStatementContext ctx);
/**
* Exit a parse tree produced by the {@code variableAssignmentStatement}
* labeled alternative in {@link MinijavaParser#statement}.
* @param ctx the parse tree
*/
void exitVariableAssignmentStatement(@NotNull MinijavaParser.VariableAssignmentStatementContext ctx);
/**
* Enter a parse tree produced by the {@code powExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void enterPowExpression(@NotNull MinijavaParser.PowExpressionContext ctx);
/**
* Exit a parse tree produced by the {@code powExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void exitPowExpression(@NotNull MinijavaParser.PowExpressionContext ctx);
/**
* Enter a parse tree produced by the {@code addExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void enterAddExpression(@NotNull MinijavaParser.AddExpressionContext ctx);
/**
* Exit a parse tree produced by the {@code addExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void exitAddExpression(@NotNull MinijavaParser.AddExpressionContext ctx);
/**
* Enter a parse tree produced by the {@code arrayInstantiationExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void enterArrayInstantiationExpression(@NotNull MinijavaParser.ArrayInstantiationExpressionContext ctx);
/**
* Exit a parse tree produced by the {@code arrayInstantiationExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void exitArrayInstantiationExpression(@NotNull MinijavaParser.ArrayInstantiationExpressionContext ctx);
/**
* Enter a parse tree produced by {@link MinijavaParser#elseBlock}.
* @param ctx the parse tree
*/
void enterElseBlock(@NotNull MinijavaParser.ElseBlockContext ctx);
/**
* Exit a parse tree produced by {@link MinijavaParser#elseBlock}.
* @param ctx the parse tree
*/
void exitElseBlock(@NotNull MinijavaParser.ElseBlockContext ctx);
/**
* Enter a parse tree produced by {@link MinijavaParser#type}.
* @param ctx the parse tree
*/
void enterType(@NotNull MinijavaParser.TypeContext ctx);
/**
* Exit a parse tree produced by {@link MinijavaParser#type}.
* @param ctx the parse tree
*/
void exitType(@NotNull MinijavaParser.TypeContext ctx);
/**
* Enter a parse tree produced by the {@code andExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void enterAndExpression(@NotNull MinijavaParser.AndExpressionContext ctx);
/**
* Exit a parse tree produced by the {@code andExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void exitAndExpression(@NotNull MinijavaParser.AndExpressionContext ctx);
/**
* Enter a parse tree produced by the {@code ltExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void enterLtExpression(@NotNull MinijavaParser.LtExpressionContext ctx);
/**
* Exit a parse tree produced by the {@code ltExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void exitLtExpression(@NotNull MinijavaParser.LtExpressionContext ctx);
/**
* Enter a parse tree produced by {@link MinijavaParser#parameter}.
* @param ctx the parse tree
*/
void enterParameter(@NotNull MinijavaParser.ParameterContext ctx);
/**
* Exit a parse tree produced by {@link MinijavaParser#parameter}.
* @param ctx the parse tree
*/
void exitParameter(@NotNull MinijavaParser.ParameterContext ctx);
/**
* Enter a parse tree produced by the {@code arrayAccessExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void enterArrayAccessExpression(@NotNull MinijavaParser.ArrayAccessExpressionContext ctx);
/**
* Exit a parse tree produced by the {@code arrayAccessExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void exitArrayAccessExpression(@NotNull MinijavaParser.ArrayAccessExpressionContext ctx);
/**
* Enter a parse tree produced by the {@code nestedStatement}
* labeled alternative in {@link MinijavaParser#statement}.
* @param ctx the parse tree
*/
void enterNestedStatement(@NotNull MinijavaParser.NestedStatementContext ctx);
/**
* Exit a parse tree produced by the {@code nestedStatement}
* labeled alternative in {@link MinijavaParser#statement}.
* @param ctx the parse tree
*/
void exitNestedStatement(@NotNull MinijavaParser.NestedStatementContext ctx);
/**
* Enter a parse tree produced by {@link MinijavaParser#mainClass}.
* @param ctx the parse tree
*/
void enterMainClass(@NotNull MinijavaParser.MainClassContext ctx);
/**
* Exit a parse tree produced by {@link MinijavaParser#mainClass}.
* @param ctx the parse tree
*/
void exitMainClass(@NotNull MinijavaParser.MainClassContext ctx);
/**
* Enter a parse tree produced by {@link MinijavaParser#parameterList}.
* @param ctx the parse tree
*/
void enterParameterList(@NotNull MinijavaParser.ParameterListContext ctx);
/**
* Exit a parse tree produced by {@link MinijavaParser#parameterList}.
* @param ctx the parse tree
*/
void exitParameterList(@NotNull MinijavaParser.ParameterListContext ctx);
/**
* Enter a parse tree produced by {@link MinijavaParser#fieldDeclaration}.
* @param ctx the parse tree
*/
void enterFieldDeclaration(@NotNull MinijavaParser.FieldDeclarationContext ctx);
/**
* Exit a parse tree produced by {@link MinijavaParser#fieldDeclaration}.
* @param ctx the parse tree
*/
void exitFieldDeclaration(@NotNull MinijavaParser.FieldDeclarationContext ctx);
/**
* Enter a parse tree produced by the {@code methodCallExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void enterMethodCallExpression(@NotNull MinijavaParser.MethodCallExpressionContext ctx);
/**
* Exit a parse tree produced by the {@code methodCallExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void exitMethodCallExpression(@NotNull MinijavaParser.MethodCallExpressionContext ctx);
/**
* Enter a parse tree produced by {@link MinijavaParser#localDeclaration}.
* @param ctx the parse tree
*/
void enterLocalDeclaration(@NotNull MinijavaParser.LocalDeclarationContext ctx);
/**
* Exit a parse tree produced by {@link MinijavaParser#localDeclaration}.
* @param ctx the parse tree
*/
void exitLocalDeclaration(@NotNull MinijavaParser.LocalDeclarationContext ctx);
/**
* Enter a parse tree produced by the {@code ifElseStatement}
* labeled alternative in {@link MinijavaParser#statement}.
* @param ctx the parse tree
*/
void enterIfElseStatement(@NotNull MinijavaParser.IfElseStatementContext ctx);
/**
* Exit a parse tree produced by the {@code ifElseStatement}
* labeled alternative in {@link MinijavaParser#statement}.
* @param ctx the parse tree
*/
void exitIfElseStatement(@NotNull MinijavaParser.IfElseStatementContext ctx);
/**
* Enter a parse tree produced by {@link MinijavaParser#methodDeclaration}.
* @param ctx the parse tree
*/
void enterMethodDeclaration(@NotNull MinijavaParser.MethodDeclarationContext ctx);
/**
* Exit a parse tree produced by {@link MinijavaParser#methodDeclaration}.
* @param ctx the parse tree
*/
void exitMethodDeclaration(@NotNull MinijavaParser.MethodDeclarationContext ctx);
/**
* Enter a parse tree produced by {@link MinijavaParser#varDeclaration}.
* @param ctx the parse tree
*/
void enterVarDeclaration(@NotNull MinijavaParser.VarDeclarationContext ctx);
/**
* Exit a parse tree produced by {@link MinijavaParser#varDeclaration}.
* @param ctx the parse tree
*/
void exitVarDeclaration(@NotNull MinijavaParser.VarDeclarationContext ctx);
/**
* Enter a parse tree produced by {@link MinijavaParser#whileBlock}.
* @param ctx the parse tree
*/
void enterWhileBlock(@NotNull MinijavaParser.WhileBlockContext ctx);
/**
* Exit a parse tree produced by {@link MinijavaParser#whileBlock}.
* @param ctx the parse tree
*/
void exitWhileBlock(@NotNull MinijavaParser.WhileBlockContext ctx);
/**
* Enter a parse tree produced by the {@code intLitExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void enterIntLitExpression(@NotNull MinijavaParser.IntLitExpressionContext ctx);
/**
* Exit a parse tree produced by the {@code intLitExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void exitIntLitExpression(@NotNull MinijavaParser.IntLitExpressionContext ctx);
/**
* Enter a parse tree produced by the {@code booleanLitExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void enterBooleanLitExpression(@NotNull MinijavaParser.BooleanLitExpressionContext ctx);
/**
* Exit a parse tree produced by the {@code booleanLitExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void exitBooleanLitExpression(@NotNull MinijavaParser.BooleanLitExpressionContext ctx);
/**
* Enter a parse tree produced by {@link MinijavaParser#ifBlock}.
* @param ctx the parse tree
*/
void enterIfBlock(@NotNull MinijavaParser.IfBlockContext ctx);
/**
* Exit a parse tree produced by {@link MinijavaParser#ifBlock}.
* @param ctx the parse tree
*/
void exitIfBlock(@NotNull MinijavaParser.IfBlockContext ctx);
/**
* Enter a parse tree produced by the {@code subExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void enterSubExpression(@NotNull MinijavaParser.SubExpressionContext ctx);
/**
* Exit a parse tree produced by the {@code subExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void exitSubExpression(@NotNull MinijavaParser.SubExpressionContext ctx);
/**
* Enter a parse tree produced by the {@code mulExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void enterMulExpression(@NotNull MinijavaParser.MulExpressionContext ctx);
/**
* Exit a parse tree produced by the {@code mulExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void exitMulExpression(@NotNull MinijavaParser.MulExpressionContext ctx);
/**
* Enter a parse tree produced by the {@code identifierExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void enterIdentifierExpression(@NotNull MinijavaParser.IdentifierExpressionContext ctx);
/**
* Exit a parse tree produced by the {@code identifierExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void exitIdentifierExpression(@NotNull MinijavaParser.IdentifierExpressionContext ctx);
/**
* Enter a parse tree produced by the {@code notExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void enterNotExpression(@NotNull MinijavaParser.NotExpressionContext ctx);
/**
* Exit a parse tree produced by the {@code notExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void exitNotExpression(@NotNull MinijavaParser.NotExpressionContext ctx);
/**
* Enter a parse tree produced by {@link MinijavaParser#classDeclaration}.
* @param ctx the parse tree
*/
void enterClassDeclaration(@NotNull MinijavaParser.ClassDeclarationContext ctx);
/**
* Exit a parse tree produced by {@link MinijavaParser#classDeclaration}.
* @param ctx the parse tree
*/
void exitClassDeclaration(@NotNull MinijavaParser.ClassDeclarationContext ctx);
/**
* Enter a parse tree produced by the {@code arrayAssignmentStatement}
* labeled alternative in {@link MinijavaParser#statement}.
* @param ctx the parse tree
*/
void enterArrayAssignmentStatement(@NotNull MinijavaParser.ArrayAssignmentStatementContext ctx);
/**
* Exit a parse tree produced by the {@code arrayAssignmentStatement}
* labeled alternative in {@link MinijavaParser#statement}.
* @param ctx the parse tree
*/
void exitArrayAssignmentStatement(@NotNull MinijavaParser.ArrayAssignmentStatementContext ctx);
/**
* Enter a parse tree produced by the {@code printStatement}
* labeled alternative in {@link MinijavaParser#statement}.
* @param ctx the parse tree
*/
void enterPrintStatement(@NotNull MinijavaParser.PrintStatementContext ctx);
/**
* Exit a parse tree produced by the {@code printStatement}
* labeled alternative in {@link MinijavaParser#statement}.
* @param ctx the parse tree
*/
void exitPrintStatement(@NotNull MinijavaParser.PrintStatementContext ctx);
/**
* Enter a parse tree produced by {@link MinijavaParser#goal}.
* @param ctx the parse tree
*/
void enterGoal(@NotNull MinijavaParser.GoalContext ctx);
/**
* Exit a parse tree produced by {@link MinijavaParser#goal}.
* @param ctx the parse tree
*/
void exitGoal(@NotNull MinijavaParser.GoalContext ctx);
/**
* Enter a parse tree produced by {@link MinijavaParser#methodBody}.
* @param ctx the parse tree
*/
void enterMethodBody(@NotNull MinijavaParser.MethodBodyContext ctx);
/**
* Exit a parse tree produced by {@link MinijavaParser#methodBody}.
* @param ctx the parse tree
*/
void exitMethodBody(@NotNull MinijavaParser.MethodBodyContext ctx);
/**
* Enter a parse tree produced by the {@code whileStatement}
* labeled alternative in {@link MinijavaParser#statement}.
* @param ctx the parse tree
*/
void enterWhileStatement(@NotNull MinijavaParser.WhileStatementContext ctx);
/**
* Exit a parse tree produced by the {@code whileStatement}
* labeled alternative in {@link MinijavaParser#statement}.
* @param ctx the parse tree
*/
void exitWhileStatement(@NotNull MinijavaParser.WhileStatementContext ctx);
/**
* Enter a parse tree produced by the {@code parenExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void enterParenExpression(@NotNull MinijavaParser.ParenExpressionContext ctx);
/**
* Exit a parse tree produced by the {@code parenExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void exitParenExpression(@NotNull MinijavaParser.ParenExpressionContext ctx);
/**
* Enter a parse tree produced by the {@code objectInstantiationExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void enterObjectInstantiationExpression(@NotNull MinijavaParser.ObjectInstantiationExpressionContext ctx);
/**
* Exit a parse tree produced by the {@code objectInstantiationExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void exitObjectInstantiationExpression(@NotNull MinijavaParser.ObjectInstantiationExpressionContext ctx);
/**
* Enter a parse tree produced by the {@code arrayLengthExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void enterArrayLengthExpression(@NotNull MinijavaParser.ArrayLengthExpressionContext ctx);
/**
* Exit a parse tree produced by the {@code arrayLengthExpression}
* labeled alternative in {@link MinijavaParser#expression}.
* @param ctx the parse tree
*/
void exitArrayLengthExpression(@NotNull MinijavaParser.ArrayLengthExpressionContext ctx);
}