-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLilaListener.py
240 lines (161 loc) · 6.77 KB
/
LilaListener.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
# Generated from Lila.g4 by ANTLR 4.7.2
from antlr4 import *
if __name__ is not None and "." in __name__:
from .LilaParser import LilaParser
else:
from LilaParser import LilaParser
from IntermediateGenerator import IntermediateGenerator, Quadruple
from Classes import Semantic, Function, Operand, VirtualAddress
gen = IntermediateGenerator()
# This class defines a complete listener for a parse tree produced by LilaParser.
class LilaListener(ParseTreeListener):
# Enter a parse tree produced by LilaParser#programa.
def enterPrograma(self, ctx:LilaParser.ProgramaContext):
pass
# Exit a parse tree produced by LilaParser#programa.
def exitPrograma(self, ctx:LilaParser.ProgramaContext):
pass
# Enter a parse tree produced by LilaParser#data.
def enterData(self, ctx:LilaParser.DataContext):
pass
# Exit a parse tree produced by LilaParser#data.
def exitData(self, ctx:LilaParser.DataContext):
pass
# Enter a parse tree produced by LilaParser#data2.
def enterData2(self, ctx:LilaParser.Data2Context):
pass
# Exit a parse tree produced by LilaParser#data2.
def exitData2(self, ctx:LilaParser.Data2Context):
pass
# Enter a parse tree produced by LilaParser#main.
def enterMain(self, ctx:LilaParser.MainContext):
pass
# Exit a parse tree produced by LilaParser#main.
def exitMain(self, ctx:LilaParser.MainContext):
pass
# Enter a parse tree produced by LilaParser#array.
def enterArray(self, ctx:LilaParser.ArrayContext):
pass
# Exit a parse tree produced by LilaParser#array.
def exitArray(self, ctx:LilaParser.ArrayContext):
pass
# Enter a parse tree produced by LilaParser#tipo.
def enterTipo(self, ctx:LilaParser.TipoContext):
pass
# Exit a parse tree produced by LilaParser#tipo.
def exitTipo(self, ctx:LilaParser.TipoContext):
pass
# Enter a parse tree produced by LilaParser#funciones.
def enterFunciones(self, ctx:LilaParser.FuncionesContext):
pass
# Exit a parse tree produced by LilaParser#funciones.
def exitFunciones(self, ctx:LilaParser.FuncionesContext):
pass
# Enter a parse tree produced by LilaParser#params.
def enterParams(self, ctx:LilaParser.ParamsContext):
pass
# Exit a parse tree produced by LilaParser#params.
def exitParams(self, ctx:LilaParser.ParamsContext):
pass
# Enter a parse tree produced by LilaParser#estatuto.
def enterEstatuto(self, ctx:LilaParser.EstatutoContext):
pass
# Exit a parse tree produced by LilaParser#estatuto.
def exitEstatuto(self, ctx:LilaParser.EstatutoContext):
pass
# Enter a parse tree produced by LilaParser#condicion.
def enterCondicion(self, ctx:LilaParser.CondicionContext):
pass
# Exit a parse tree produced by LilaParser#condicion.
def exitCondicion(self, ctx:LilaParser.CondicionContext):
pass
# Enter a parse tree produced by LilaParser#bloque.
def enterBloque(self, ctx:LilaParser.BloqueContext):
pass
# Exit a parse tree produced by LilaParser#bloque.
def exitBloque(self, ctx:LilaParser.BloqueContext):
pass
# Enter a parse tree produced by LilaParser#display.
def enterDisplay(self, ctx:LilaParser.DisplayContext):
pass
# Exit a parse tree produced by LilaParser#display.
def exitDisplay(self, ctx:LilaParser.DisplayContext):
pass
# Enter a parse tree produced by LilaParser#asignacion.
def enterAsignacion(self, ctx:LilaParser.AsignacionContext):
pass
# Exit a parse tree produced by LilaParser#asignacion.
def exitAsignacion(self, ctx:LilaParser.AsignacionContext):
pass
# Enter a parse tree produced by LilaParser#sreturn.
def enterSreturn(self, ctx:LilaParser.SreturnContext):
pass
# Exit a parse tree produced by LilaParser#sreturn.
def exitSreturn(self, ctx:LilaParser.SreturnContext):
pass
# Enter a parse tree produced by LilaParser#arr.
def enterArr(self, ctx:LilaParser.ArrContext):
pass
# Exit a parse tree produced by LilaParser#arr.
def exitArr(self, ctx:LilaParser.ArrContext):
pass
# Enter a parse tree produced by LilaParser#expresion.
def enterExpresion(self, ctx:LilaParser.ExpresionContext):
pass
# Exit a parse tree produced by LilaParser#expresion.
def exitExpresion(self, ctx:LilaParser.ExpresionContext):
pass
# Enter a parse tree produced by LilaParser#comparacion.
def enterComparacion(self, ctx:LilaParser.ComparacionContext):
pass
# Exit a parse tree produced by LilaParser#comparacion.
def exitComparacion(self, ctx:LilaParser.ComparacionContext):
pass
# Enter a parse tree produced by LilaParser#exp.
def enterExp(self, ctx:LilaParser.ExpContext):
pass
# Exit a parse tree produced by LilaParser#exp.
def exitExp(self, ctx:LilaParser.ExpContext):
pass
# Enter a parse tree produced by LilaParser#termino.
def enterTermino(self, ctx:LilaParser.TerminoContext):
pass
# Exit a parse tree produced by LilaParser#termino.
def exitTermino(self, ctx:LilaParser.TerminoContext):
pass
# Enter a parse tree produced by LilaParser#factor.
def enterFactor(self, ctx:LilaParser.FactorContext):
pass
# Exit a parse tree produced by LilaParser#factor.
def exitFactor(self, ctx:LilaParser.FactorContext):
pass
# Enter a parse tree produced by LilaParser#var_cte.
def enterVar_cte(self, ctx:LilaParser.Var_cteContext):
pass
# Exit a parse tree produced by LilaParser#var_cte.
def exitVar_cte(self, ctx:LilaParser.Var_cteContext):
pass
# Enter a parse tree produced by LilaParser#swhile.
def enterSwhile(self, ctx:LilaParser.SwhileContext):
pass
# Exit a parse tree produced by LilaParser#swhile.
def exitSwhile(self, ctx:LilaParser.SwhileContext):
pass
# Enter a parse tree produced by LilaParser#invocacion.
def enterInvocacion(self, ctx:LilaParser.InvocacionContext):
pass
# Exit a parse tree produced by LilaParser#invocacion.
def exitInvocacion(self, ctx:LilaParser.InvocacionContext):
pass
# Enter a parse tree produced by LilaParser#getinput.
def enterGetinput(self, ctx:LilaParser.GetinputContext):
pass
# Exit a parse tree produced by LilaParser#getinput.
def exitGetinput(self, ctx:LilaParser.GetinputContext):
pass
# Enter a parse tree produced by LilaParser#especiales.
def enterEspeciales(self, ctx:LilaParser.EspecialesContext):
pass
# Exit a parse tree produced by LilaParser#especiales.
def exitEspeciales(self, ctx:LilaParser.EspecialesContext):
pass