-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTigerLLKVisitor.java
More file actions
402 lines (401 loc) · 13.1 KB
/
TigerLLKVisitor.java
File metadata and controls
402 lines (401 loc) · 13.1 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
// Generated from TigerLLK.g4 by ANTLR 4.7.1
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
/**
* This interface defines a complete generic visitor for a parse tree produced
* by {@link TigerLLKParser}.
*
* @param <T> The return type of the visit operation. Use {@link Void} for
* operations with no return type.
*/
public interface TigerLLKVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link TigerLLKParser#hello}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitHello(TigerLLKParser.HelloContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#tigerprogram}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTigerprogram(TigerLLKParser.TigerprogramContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#declarationsegment}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitDeclarationsegment(TigerLLKParser.DeclarationsegmentContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#typedeclarationlist}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTypedeclarationlist(TigerLLKParser.TypedeclarationlistContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#vardeclarationlist}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitVardeclarationlist(TigerLLKParser.VardeclarationlistContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#functdeclarationlist}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitFunctdeclarationlist(TigerLLKParser.FunctdeclarationlistContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#typedeclaration}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTypedeclaration(TigerLLKParser.TypedeclarationContext ctx);
/**
* Visit a parse tree produced by the {@code IDtype}
* labeled alternative in {@link TigerLLKParser#type}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitIDtype(TigerLLKParser.IDtypeContext ctx);
/**
* Visit a parse tree produced by the {@code arrayType}
* labeled alternative in {@link TigerLLKParser#type}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitArrayType(TigerLLKParser.ArrayTypeContext ctx);
/**
* Visit a parse tree produced by the {@code recordType}
* labeled alternative in {@link TigerLLKParser#type}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitRecordType(TigerLLKParser.RecordTypeContext ctx);
/**
* Visit a parse tree produced by the {@code pointerType}
* labeled alternative in {@link TigerLLKParser#type}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitPointerType(TigerLLKParser.PointerTypeContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#fieldlist}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitFieldlist(TigerLLKParser.FieldlistContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#typeid}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTypeid(TigerLLKParser.TypeidContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#vardeclaration}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitVardeclaration(TigerLLKParser.VardeclarationContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#idlist}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitIdlist(TigerLLKParser.IdlistContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#itail}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitItail(TigerLLKParser.ItailContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#optionalinit}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitOptionalinit(TigerLLKParser.OptionalinitContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#functdeclaration}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitFunctdeclaration(TigerLLKParser.FunctdeclarationContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#paramlist}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitParamlist(TigerLLKParser.ParamlistContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#paramlisttail}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitParamlisttail(TigerLLKParser.ParamlisttailContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#rettype}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitRettype(TigerLLKParser.RettypeContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#param}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitParam(TigerLLKParser.ParamContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#statseq}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitStatseq(TigerLLKParser.StatseqContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#stail}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitStail(TigerLLKParser.StailContext ctx);
/**
* Visit a parse tree produced by the {@code letBlock}
* labeled alternative in {@link TigerLLKParser#stat}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitLetBlock(TigerLLKParser.LetBlockContext ctx);
/**
* Visit a parse tree produced by the {@code breakCommand}
* labeled alternative in {@link TigerLLKParser#stat}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitBreakCommand(TigerLLKParser.BreakCommandContext ctx);
/**
* Visit a parse tree produced by the {@code returnStatement}
* labeled alternative in {@link TigerLLKParser#stat}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitReturnStatement(TigerLLKParser.ReturnStatementContext ctx);
/**
* Visit a parse tree produced by the {@code callFunction}
* labeled alternative in {@link TigerLLKParser#stat}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitCallFunction(TigerLLKParser.CallFunctionContext ctx);
/**
* Visit a parse tree produced by the {@code assignElement}
* labeled alternative in {@link TigerLLKParser#stat}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitAssignElement(TigerLLKParser.AssignElementContext ctx);
/**
* Visit a parse tree produced by the {@code ifBlock}
* labeled alternative in {@link TigerLLKParser#stat}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitIfBlock(TigerLLKParser.IfBlockContext ctx);
/**
* Visit a parse tree produced by the {@code whileBlock}
* labeled alternative in {@link TigerLLKParser#stat}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitWhileBlock(TigerLLKParser.WhileBlockContext ctx);
/**
* Visit a parse tree produced by the {@code forBlock}
* labeled alternative in {@link TigerLLKParser#stat}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitForBlock(TigerLLKParser.ForBlockContext ctx);
/**
* Visit a parse tree produced by the {@code ifExitBlock}
* labeled alternative in {@link TigerLLKParser#statail}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitIfExitBlock(TigerLLKParser.IfExitBlockContext ctx);
/**
* Visit a parse tree produced by the {@code endBlock}
* labeled alternative in {@link TigerLLKParser#statail}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitEndBlock(TigerLLKParser.EndBlockContext ctx);
/**
* Visit a parse tree produced by the {@code function}
* labeled alternative in {@link TigerLLKParser#more}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitFunction(TigerLLKParser.FunctionContext ctx);
/**
* Visit a parse tree produced by the {@code multipleAssigment}
* labeled alternative in {@link TigerLLKParser#more}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitMultipleAssigment(TigerLLKParser.MultipleAssigmentContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#ltail}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitLtail(TigerLLKParser.LtailContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#expr}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitExpr(TigerLLKParser.ExprContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#and}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitAnd(TigerLLKParser.AndContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#le}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitLe(TigerLLKParser.LeContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#me}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitMe(TigerLLKParser.MeContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#lesser}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitLesser(TigerLLKParser.LesserContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#greater}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitGreater(TigerLLKParser.GreaterContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#noteq}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitNoteq(TigerLLKParser.NoteqContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#equal}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitEqual(TigerLLKParser.EqualContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#minus}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitMinus(TigerLLKParser.MinusContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#plus}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitPlus(TigerLLKParser.PlusContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#div}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitDiv(TigerLLKParser.DivContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#mult}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitMult(TigerLLKParser.MultContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#exp}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitExp(TigerLLKParser.ExpContext ctx);
/**
* Visit a parse tree produced by the {@code constant}
* labeled alternative in {@link TigerLLKParser#yeet}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitConstant(TigerLLKParser.ConstantContext ctx);
/**
* Visit a parse tree produced by the {@code varValue}
* labeled alternative in {@link TigerLLKParser#yeet}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitVarValue(TigerLLKParser.VarValueContext ctx);
/**
* Visit a parse tree produced by the {@code expression}
* labeled alternative in {@link TigerLLKParser#yeet}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitExpression(TigerLLKParser.ExpressionContext ctx);
/**
* Visit a parse tree produced by the {@code intLiteral}
* labeled alternative in {@link TigerLLKParser#consta}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitIntLiteral(TigerLLKParser.IntLiteralContext ctx);
/**
* Visit a parse tree produced by the {@code floatLiteral}
* labeled alternative in {@link TigerLLKParser#consta}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitFloatLiteral(TigerLLKParser.FloatLiteralContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#exprlist}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitExprlist(TigerLLKParser.ExprlistContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#exprlisttail}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitExprlisttail(TigerLLKParser.ExprlisttailContext ctx);
/**
* Visit a parse tree produced by {@link TigerLLKParser#lvalue}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitLvalue(TigerLLKParser.LvalueContext ctx);
/**
* Visit a parse tree produced by the {@code arrayAccess}
* labeled alternative in {@link TigerLLKParser#lvaluetail}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitArrayAccess(TigerLLKParser.ArrayAccessContext ctx);
/**
* Visit a parse tree produced by the {@code idAttribute}
* labeled alternative in {@link TigerLLKParser#lvaluetail}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitIdAttribute(TigerLLKParser.IdAttributeContext ctx);
/**
* Visit a parse tree produced by the {@code nullTail}
* labeled alternative in {@link TigerLLKParser#lvaluetail}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitNullTail(TigerLLKParser.NullTailContext ctx);
}