-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmisterLexer.py
250 lines (234 loc) · 13.8 KB
/
misterLexer.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
# Generated from java-escape by ANTLR 4.5
from antlr4 import *
from io import StringIO
def serializedATN():
with StringIO() as buf:
buf.write("\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2\63")
buf.write("\u0158\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7")
buf.write("\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r")
buf.write("\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23")
buf.write("\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30")
buf.write("\4\31\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36")
buf.write("\t\36\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%")
buf.write("\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4,\t,\4-\t-\4.")
buf.write("\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\3\2")
buf.write("\3\2\3\2\3\2\3\2\3\2\3\2\3\3\3\3\3\3\3\4\3\4\3\4\3\4\3")
buf.write("\4\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3\6\3\6")
buf.write("\3\6\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3")
buf.write("\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n")
buf.write("\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13")
buf.write("\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3")
buf.write("\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3")
buf.write("\17\3\17\3\17\3\17\3\17\3\17\3\17\3\20\3\20\3\20\3\20")
buf.write("\3\20\3\20\3\20\3\20\3\21\3\21\3\21\3\21\3\21\3\21\3\21")
buf.write("\3\22\3\22\3\22\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23")
buf.write("\3\23\3\23\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\25")
buf.write("\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\26\3\26\3\26\3\27")
buf.write("\3\27\3\30\3\30\3\30\3\31\3\31\3\31\3\32\3\32\3\33\3\33")
buf.write("\3\34\3\34\3\35\3\35\3\36\3\36\3\37\3\37\3 \3 \3 \3!\3")
buf.write("!\3!\3\"\3\"\3\"\3#\3#\3$\3$\3%\3%\3&\3&\3\'\3\'\3(\3")
buf.write("(\3)\3)\3*\3*\3+\3+\3,\3,\3-\3-\3.\3.\7.\u012e\n.\f.\16")
buf.write(".\u0131\13.\3/\5/\u0134\n/\3/\6/\u0137\n/\r/\16/\u0138")
buf.write("\3\60\5\60\u013c\n\60\3\60\6\60\u013f\n\60\r\60\16\60")
buf.write("\u0140\3\60\3\60\6\60\u0145\n\60\r\60\16\60\u0146\3\61")
buf.write("\3\61\3\61\7\61\u014c\n\61\f\61\16\61\u014f\13\61\3\61")
buf.write("\3\61\3\62\3\62\3\62\3\62\3\63\3\63\2\2\64\3\3\5\4\7\5")
buf.write("\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35")
buf.write("\20\37\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33")
buf.write("\65\34\67\359\36;\37= ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.[")
buf.write("/]\60_\61a\62c\63e\2\3\2\6\4\2C\\c|\5\2\62;C\\c|\4\2$")
buf.write("$^^\5\2\13\f\17\17\"\"\u015e\2\3\3\2\2\2\2\5\3\2\2\2\2")
buf.write("\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3")
buf.write("\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2")
buf.write("\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2")
buf.write("\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2")
buf.write("\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63")
buf.write("\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2")
buf.write("\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2")
buf.write("\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3")
buf.write("\2\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y")
buf.write("\3\2\2\2\2[\3\2\2\2\2]\3\2\2\2\2_\3\2\2\2\2a\3\2\2\2\2")
buf.write("c\3\2\2\2\3g\3\2\2\2\5n\3\2\2\2\7q\3\2\2\2\tv\3\2\2\2")
buf.write("\13\177\3\2\2\2\r\u0084\3\2\2\2\17\u008d\3\2\2\2\21\u0095")
buf.write("\3\2\2\2\23\u009c\3\2\2\2\25\u00a4\3\2\2\2\27\u00aa\3")
buf.write("\2\2\2\31\u00b3\3\2\2\2\33\u00b9\3\2\2\2\35\u00bf\3\2")
buf.write("\2\2\37\u00c9\3\2\2\2!\u00d1\3\2\2\2#\u00d8\3\2\2\2%\u00dd")
buf.write("\3\2\2\2\'\u00e5\3\2\2\2)\u00ed\3\2\2\2+\u00f5\3\2\2\2")
buf.write("-\u00f8\3\2\2\2/\u00fa\3\2\2\2\61\u00fd\3\2\2\2\63\u0100")
buf.write("\3\2\2\2\65\u0102\3\2\2\2\67\u0104\3\2\2\29\u0106\3\2")
buf.write("\2\2;\u0108\3\2\2\2=\u010a\3\2\2\2?\u010c\3\2\2\2A\u010f")
buf.write("\3\2\2\2C\u0112\3\2\2\2E\u0115\3\2\2\2G\u0117\3\2\2\2")
buf.write("I\u0119\3\2\2\2K\u011b\3\2\2\2M\u011d\3\2\2\2O\u011f\3")
buf.write("\2\2\2Q\u0121\3\2\2\2S\u0123\3\2\2\2U\u0125\3\2\2\2W\u0127")
buf.write("\3\2\2\2Y\u0129\3\2\2\2[\u012b\3\2\2\2]\u0133\3\2\2\2")
buf.write("_\u013b\3\2\2\2a\u0148\3\2\2\2c\u0152\3\2\2\2e\u0156\3")
buf.write("\2\2\2gh\7K\2\2hi\7P\2\2ij\7K\2\2jk\7E\2\2kl\7K\2\2lm")
buf.write("\7Q\2\2m\4\3\2\2\2no\7U\2\2op\7K\2\2p\6\3\2\2\2qr\7U\2")
buf.write("\2rs\7K\2\2st\7P\2\2tu\7Q\2\2u\b\3\2\2\2vw\7O\2\2wx\7")
buf.write("K\2\2xy\7G\2\2yz\7P\2\2z{\7V\2\2{|\7T\2\2|}\7C\2\2}~\7")
buf.write("U\2\2~\n\3\2\2\2\177\u0080\7N\2\2\u0080\u0081\7G\2\2\u0081")
buf.write("\u0082\7G\2\2\u0082\u0083\7T\2\2\u0083\f\3\2\2\2\u0084")
buf.write("\u0085\7K\2\2\u0085\u0086\7O\2\2\u0086\u0087\7R\2\2\u0087")
buf.write("\u0088\7T\2\2\u0088\u0089\7K\2\2\u0089\u008a\7O\2\2\u008a")
buf.write("\u008b\7K\2\2\u008b\u008c\7T\2\2\u008c\16\3\2\2\2\u008d")
buf.write("\u008e\7H\2\2\u008e\u008f\7W\2\2\u008f\u0090\7P\2\2\u0090")
buf.write("\u0091\7E\2\2\u0091\u0092\7K\2\2\u0092\u0093\7Q\2\2\u0093")
buf.write("\u0094\7P\2\2\u0094\20\3\2\2\2\u0095\u0096\7G\2\2\u0096")
buf.write("\u0097\7P\2\2\u0097\u0098\7V\2\2\u0098\u0099\7G\2\2\u0099")
buf.write("\u009a\7T\2\2\u009a\u009b\7Q\2\2\u009b\22\3\2\2\2\u009c")
buf.write("\u009d\7F\2\2\u009d\u009e\7G\2\2\u009e\u009f\7E\2\2\u009f")
buf.write("\u00a0\7K\2\2\u00a0\u00a1\7O\2\2\u00a1\u00a2\7C\2\2\u00a2")
buf.write("\u00a3\7N\2\2\u00a3\24\3\2\2\2\u00a4\u00a5\7V\2\2\u00a5")
buf.write("\u00a6\7G\2\2\u00a6\u00a7\7Z\2\2\u00a7\u00a8\7V\2\2\u00a8")
buf.write("\u00a9\7Q\2\2\u00a9\26\3\2\2\2\u00aa\u00ab\7T\2\2\u00ab")
buf.write("\u00ac\7G\2\2\u00ac\u00ad\7V\2\2\u00ad\u00ae\7Q\2\2\u00ae")
buf.write("\u00af\7T\2\2\u00af\u00b0\7P\2\2\u00b0\u00b1\7C\2\2\u00b1")
buf.write("\u00b2\7T\2\2\u00b2\30\3\2\2\2\u00b3\u00b4\7N\2\2\u00b4")
buf.write("\u00b5\7K\2\2\u00b5\u00b6\7U\2\2\u00b6\u00b7\7V\2\2\u00b7")
buf.write("\u00b8\7C\2\2\u00b8\32\3\2\2\2\u00b9\u00ba\7E\2\2\u00ba")
buf.write("\u00bb\7N\2\2\u00bb\u00bc\7C\2\2\u00bc\u00bd\7U\2\2\u00bd")
buf.write("\u00be\7G\2\2\u00be\34\3\2\2\2\u00bf\u00c0\7C\2\2\u00c0")
buf.write("\u00c1\7V\2\2\u00c1\u00c2\7T\2\2\u00c2\u00c3\7K\2\2\u00c3")
buf.write("\u00c4\7D\2\2\u00c4\u00c5\7W\2\2\u00c5\u00c6\7V\2\2\u00c6")
buf.write("\u00c7\7Q\2\2\u00c7\u00c8\7U\2\2\u00c8\36\3\2\2\2\u00c9")
buf.write("\u00ca\7O\2\2\u00ca\u00cb\7G\2\2\u00cb\u00cc\7V\2\2\u00cc")
buf.write("\u00cd\7Q\2\2\u00cd\u00ce\7F\2\2\u00ce\u00cf\7Q\2\2\u00cf")
buf.write("\u00d0\7U\2\2\u00d0 \3\2\2\2\u00d1\u00d2\7J\2\2\u00d2")
buf.write("\u00d3\7G\2\2\u00d3\u00d4\7T\2\2\u00d4\u00d5\7G\2\2\u00d5")
buf.write("\u00d6\7F\2\2\u00d6\u00d7\7C\2\2\u00d7\"\3\2\2\2\u00d8")
buf.write("\u00d9\7P\2\2\u00d9\u00da\7C\2\2\u00da\u00db\7F\2\2\u00db")
buf.write("\u00dc\7C\2\2\u00dc$\3\2\2\2\u00dd\u00de\7R\2\2\u00de")
buf.write("\u00df\7T\2\2\u00df\u00e0\7K\2\2\u00e0\u00e1\7X\2\2\u00e1")
buf.write("\u00e2\7C\2\2\u00e2\u00e3\7F\2\2\u00e3\u00e4\7Q\2\2\u00e4")
buf.write("&\3\2\2\2\u00e5\u00e6\7R\2\2\u00e6\u00e7\7W\2\2\u00e7")
buf.write("\u00e8\7D\2\2\u00e8\u00e9\7N\2\2\u00e9\u00ea\7K\2\2\u00ea")
buf.write("\u00eb\7E\2\2\u00eb\u00ec\7Q\2\2\u00ec(\3\2\2\2\u00ed")
buf.write("\u00ee\7C\2\2\u00ee\u00ef\7U\2\2\u00ef\u00f0\7K\2\2\u00f0")
buf.write("\u00f1\7I\2\2\u00f1\u00f2\7P\2\2\u00f2\u00f3\7C\2\2\u00f3")
buf.write("\u00f4\7T\2\2\u00f4*\3\2\2\2\u00f5\u00f6\7(\2\2\u00f6")
buf.write("\u00f7\7(\2\2\u00f7,\3\2\2\2\u00f8\u00f9\7(\2\2\u00f9")
buf.write(".\3\2\2\2\u00fa\u00fb\7~\2\2\u00fb\u00fc\7~\2\2\u00fc")
buf.write("\60\3\2\2\2\u00fd\u00fe\7?\2\2\u00fe\u00ff\7?\2\2\u00ff")
buf.write("\62\3\2\2\2\u0100\u0101\7?\2\2\u0101\64\3\2\2\2\u0102")
buf.write("\u0103\7.\2\2\u0103\66\3\2\2\2\u0104\u0105\7-\2\2\u0105")
buf.write("8\3\2\2\2\u0106\u0107\7/\2\2\u0107:\3\2\2\2\u0108\u0109")
buf.write("\7\61\2\2\u0109<\3\2\2\2\u010a\u010b\7,\2\2\u010b>\3\2")
buf.write("\2\2\u010c\u010d\7#\2\2\u010d\u010e\7?\2\2\u010e@\3\2")
buf.write("\2\2\u010f\u0110\7@\2\2\u0110\u0111\7?\2\2\u0111B\3\2")
buf.write("\2\2\u0112\u0113\7>\2\2\u0113\u0114\7?\2\2\u0114D\3\2")
buf.write("\2\2\u0115\u0116\7>\2\2\u0116F\3\2\2\2\u0117\u0118\7@")
buf.write("\2\2\u0118H\3\2\2\2\u0119\u011a\7*\2\2\u011aJ\3\2\2\2")
buf.write("\u011b\u011c\7+\2\2\u011cL\3\2\2\2\u011d\u011e\7}\2\2")
buf.write("\u011eN\3\2\2\2\u011f\u0120\7\177\2\2\u0120P\3\2\2\2\u0121")
buf.write("\u0122\7]\2\2\u0122R\3\2\2\2\u0123\u0124\7_\2\2\u0124")
buf.write("T\3\2\2\2\u0125\u0126\7=\2\2\u0126V\3\2\2\2\u0127\u0128")
buf.write("\7<\2\2\u0128X\3\2\2\2\u0129\u012a\7\60\2\2\u012aZ\3\2")
buf.write("\2\2\u012b\u012f\t\2\2\2\u012c\u012e\t\3\2\2\u012d\u012c")
buf.write("\3\2\2\2\u012e\u0131\3\2\2\2\u012f\u012d\3\2\2\2\u012f")
buf.write("\u0130\3\2\2\2\u0130\\\3\2\2\2\u0131\u012f\3\2\2\2\u0132")
buf.write("\u0134\7/\2\2\u0133\u0132\3\2\2\2\u0133\u0134\3\2\2\2")
buf.write("\u0134\u0136\3\2\2\2\u0135\u0137\5e\63\2\u0136\u0135\3")
buf.write("\2\2\2\u0137\u0138\3\2\2\2\u0138\u0136\3\2\2\2\u0138\u0139")
buf.write("\3\2\2\2\u0139^\3\2\2\2\u013a\u013c\7/\2\2\u013b\u013a")
buf.write("\3\2\2\2\u013b\u013c\3\2\2\2\u013c\u013e\3\2\2\2\u013d")
buf.write("\u013f\5e\63\2\u013e\u013d\3\2\2\2\u013f\u0140\3\2\2\2")
buf.write("\u0140\u013e\3\2\2\2\u0140\u0141\3\2\2\2\u0141\u0142\3")
buf.write("\2\2\2\u0142\u0144\7\60\2\2\u0143\u0145\5e\63\2\u0144")
buf.write("\u0143\3\2\2\2\u0145\u0146\3\2\2\2\u0146\u0144\3\2\2\2")
buf.write("\u0146\u0147\3\2\2\2\u0147`\3\2\2\2\u0148\u014d\7$\2\2")
buf.write("\u0149\u014c\5c\62\2\u014a\u014c\n\4\2\2\u014b\u0149\3")
buf.write("\2\2\2\u014b\u014a\3\2\2\2\u014c\u014f\3\2\2\2\u014d\u014b")
buf.write("\3\2\2\2\u014d\u014e\3\2\2\2\u014e\u0150\3\2\2\2\u014f")
buf.write("\u014d\3\2\2\2\u0150\u0151\7$\2\2\u0151b\3\2\2\2\u0152")
buf.write("\u0153\t\5\2\2\u0153\u0154\3\2\2\2\u0154\u0155\b\62\2")
buf.write("\2\u0155d\3\2\2\2\u0156\u0157\4\62;\2\u0157f\3\2\2\2\13")
buf.write("\2\u012f\u0133\u0138\u013b\u0140\u0146\u014b\u014d\3\b")
buf.write("\2\2")
return buf.getvalue()
class misterLexer(Lexer):
atn = ATNDeserializer().deserialize(serializedATN())
decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]
INICIO = 1
SI = 2
SINO = 3
MIENTRAS = 4
LEER = 5
IMPRIMIR = 6
FUNCION = 7
ENTERO = 8
DECIMAL = 9
TEXTO = 10
RETORNAR = 11
LISTA = 12
CLASE = 13
ATRIBUTOS = 14
METODOS = 15
HEREDA = 16
NADA = 17
PRIVADO = 18
PUBLICO = 19
ASIGNAR = 20
Y = 21
REFERENCIA = 22
O = 23
IDENTICO = 24
IGUAL = 25
COMA = 26
SUMA = 27
RESTA = 28
DIVISION = 29
MULTIPLICACION = 30
DIFERENTE = 31
MAYORIGUAL = 32
MENORIGUAL = 33
MENOR = 34
MAYOR = 35
PARENTESIS1 = 36
PARENTESIS2 = 37
LLAVE1 = 38
LLAVE2 = 39
CORCHETE1 = 40
CORCHETE2 = 41
PUNTOYCOMA = 42
DOSPUNTOS = 43
PUNTO = 44
ID = 45
CTENTERO = 46
CTEDECIMAL = 47
CTETEXTO = 48
WS = 49
modeNames = [ u"DEFAULT_MODE" ]
literalNames = [ u"<INVALID>",
"'INICIO'", "'SI'", "'SINO'", "'MIENTRAS'", "'LEER'", "'IMPRIMIR'",
"'FUNCION'", "'ENTERO'", "'DECIMAL'", "'TEXTO'", "'RETORNAR'",
"'LISTA'", "'CLASE'", "'ATRIBUTOS'", "'METODOS'", "'HEREDA'",
"'NADA'", "'PRIVADO'", "'PUBLICO'", "'ASIGNAR'", "'&&'", "'&'",
"'||'", "'=='", "'='", "','", "'+'", "'-'", "'/'", "'*'", "'!='",
"'>='", "'<='", "'<'", "'>'", "'('", "')'", "'{'", "'}'", "'['",
"']'", "';'", "':'", "'.'" ]
symbolicNames = [ u"<INVALID>",
"INICIO", "SI", "SINO", "MIENTRAS", "LEER", "IMPRIMIR", "FUNCION",
"ENTERO", "DECIMAL", "TEXTO", "RETORNAR", "LISTA", "CLASE",
"ATRIBUTOS", "METODOS", "HEREDA", "NADA", "PRIVADO", "PUBLICO",
"ASIGNAR", "Y", "REFERENCIA", "O", "IDENTICO", "IGUAL", "COMA",
"SUMA", "RESTA", "DIVISION", "MULTIPLICACION", "DIFERENTE",
"MAYORIGUAL", "MENORIGUAL", "MENOR", "MAYOR", "PARENTESIS1",
"PARENTESIS2", "LLAVE1", "LLAVE2", "CORCHETE1", "CORCHETE2",
"PUNTOYCOMA", "DOSPUNTOS", "PUNTO", "ID", "CTENTERO", "CTEDECIMAL",
"CTETEXTO", "WS" ]
ruleNames = [ "INICIO", "SI", "SINO", "MIENTRAS", "LEER", "IMPRIMIR",
"FUNCION", "ENTERO", "DECIMAL", "TEXTO", "RETORNAR", "LISTA",
"CLASE", "ATRIBUTOS", "METODOS", "HEREDA", "NADA", "PRIVADO",
"PUBLICO", "ASIGNAR", "Y", "REFERENCIA", "O", "IDENTICO",
"IGUAL", "COMA", "SUMA", "RESTA", "DIVISION", "MULTIPLICACION",
"DIFERENTE", "MAYORIGUAL", "MENORIGUAL", "MENOR", "MAYOR",
"PARENTESIS1", "PARENTESIS2", "LLAVE1", "LLAVE2", "CORCHETE1",
"CORCHETE2", "PUNTOYCOMA", "DOSPUNTOS", "PUNTO", "ID",
"CTENTERO", "CTEDECIMAL", "CTETEXTO", "WS", "DIGIT" ]
grammarFileName = "mister.g4"
def __init__(self, input=None):
super().__init__(input)
self.checkVersion("4.5")
self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
self._actions = None
self._predicates = None