-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyGrammarLexer.py
162 lines (147 loc) · 7.66 KB
/
MyGrammarLexer.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
# Generated from MyGrammar.g4 by ANTLR 4.12.0
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
from typing import TextIO
else:
from typing.io import TextIO
def serializedATN():
return [
4,0,34,207,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,
2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,
13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,
19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,
26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,
32,2,33,7,33,1,0,1,0,1,1,1,1,1,1,1,1,1,2,1,2,1,2,1,3,1,3,1,3,1,3,
1,4,1,4,1,5,1,5,1,6,1,6,1,7,1,7,1,8,1,8,1,9,1,9,1,10,1,10,1,11,1,
11,1,11,1,12,1,12,1,12,1,13,1,13,1,14,1,14,1,15,1,15,1,16,1,16,1,
17,1,17,1,18,1,18,1,19,1,19,1,20,1,20,1,21,1,21,1,21,1,21,1,21,1,
21,1,21,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,
22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,
22,1,22,3,22,152,8,22,1,23,1,23,1,24,1,24,1,25,1,25,1,25,1,26,1,
26,1,26,1,26,1,26,1,27,1,27,1,27,1,27,1,27,1,27,1,28,1,28,1,28,1,
28,1,28,1,28,1,28,1,29,1,29,1,29,1,29,1,29,1,30,1,30,1,30,1,30,1,
30,1,31,4,31,190,8,31,11,31,12,31,191,1,32,1,32,5,32,196,8,32,10,
32,12,32,199,9,32,1,33,4,33,202,8,33,11,33,12,33,203,1,33,1,33,0,
0,34,1,1,3,2,5,3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,21,11,23,12,25,
13,27,14,29,15,31,16,33,17,35,18,37,19,39,20,41,21,43,22,45,23,47,
24,49,25,51,26,53,27,55,28,57,29,59,30,61,31,63,32,65,33,67,34,1,
0,4,1,0,48,57,3,0,65,90,95,95,97,122,4,0,48,57,65,90,95,95,97,122,
3,0,9,10,12,13,32,32,214,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,
1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,
1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,
1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,0,0,0,0,37,
1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,0,0,47,
1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0,0,0,57,
1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,67,
1,0,0,0,1,69,1,0,0,0,3,71,1,0,0,0,5,75,1,0,0,0,7,78,1,0,0,0,9,82,
1,0,0,0,11,84,1,0,0,0,13,86,1,0,0,0,15,88,1,0,0,0,17,90,1,0,0,0,
19,92,1,0,0,0,21,94,1,0,0,0,23,96,1,0,0,0,25,99,1,0,0,0,27,102,1,
0,0,0,29,104,1,0,0,0,31,106,1,0,0,0,33,108,1,0,0,0,35,110,1,0,0,
0,37,112,1,0,0,0,39,114,1,0,0,0,41,116,1,0,0,0,43,118,1,0,0,0,45,
151,1,0,0,0,47,153,1,0,0,0,49,155,1,0,0,0,51,157,1,0,0,0,53,160,
1,0,0,0,55,165,1,0,0,0,57,171,1,0,0,0,59,178,1,0,0,0,61,183,1,0,
0,0,63,189,1,0,0,0,65,193,1,0,0,0,67,201,1,0,0,0,69,70,5,94,0,0,
70,2,1,0,0,0,71,72,5,97,0,0,72,73,5,110,0,0,73,74,5,100,0,0,74,4,
1,0,0,0,75,76,5,111,0,0,76,77,5,114,0,0,77,6,1,0,0,0,78,79,5,110,
0,0,79,80,5,111,0,0,80,81,5,116,0,0,81,8,1,0,0,0,82,83,5,61,0,0,
83,10,1,0,0,0,84,85,5,62,0,0,85,12,1,0,0,0,86,87,5,60,0,0,87,14,
1,0,0,0,88,89,5,43,0,0,89,16,1,0,0,0,90,91,5,42,0,0,91,18,1,0,0,
0,92,93,5,45,0,0,93,20,1,0,0,0,94,95,5,47,0,0,95,22,1,0,0,0,96,97,
5,43,0,0,97,98,5,43,0,0,98,24,1,0,0,0,99,100,5,45,0,0,100,101,5,
45,0,0,101,26,1,0,0,0,102,103,5,44,0,0,103,28,1,0,0,0,104,105,5,
59,0,0,105,30,1,0,0,0,106,107,5,40,0,0,107,32,1,0,0,0,108,109,5,
41,0,0,109,34,1,0,0,0,110,111,5,123,0,0,111,36,1,0,0,0,112,113,5,
125,0,0,113,38,1,0,0,0,114,115,5,91,0,0,115,40,1,0,0,0,116,117,5,
93,0,0,117,42,1,0,0,0,118,119,5,114,0,0,119,120,5,101,0,0,120,121,
5,116,0,0,121,122,5,117,0,0,122,123,5,114,0,0,123,124,5,110,0,0,
124,44,1,0,0,0,125,126,5,105,0,0,126,127,5,110,0,0,127,152,5,116,
0,0,128,129,5,108,0,0,129,130,5,105,0,0,130,131,5,115,0,0,131,152,
5,116,0,0,132,133,5,101,0,0,133,134,5,108,0,0,134,135,5,101,0,0,
135,136,5,109,0,0,136,137,5,101,0,0,137,138,5,110,0,0,138,152,5,
116,0,0,139,140,5,100,0,0,140,141,5,101,0,0,141,152,5,102,0,0,142,
143,5,113,0,0,143,144,5,117,0,0,144,145,5,101,0,0,145,146,5,117,
0,0,146,152,5,101,0,0,147,148,5,116,0,0,148,149,5,114,0,0,149,150,
5,101,0,0,150,152,5,101,0,0,151,125,1,0,0,0,151,128,1,0,0,0,151,
132,1,0,0,0,151,139,1,0,0,0,151,142,1,0,0,0,151,147,1,0,0,0,152,
46,1,0,0,0,153,154,5,38,0,0,154,48,1,0,0,0,155,156,5,46,0,0,156,
50,1,0,0,0,157,158,5,105,0,0,158,159,5,102,0,0,159,52,1,0,0,0,160,
161,5,101,0,0,161,162,5,108,0,0,162,163,5,115,0,0,163,164,5,101,
0,0,164,54,1,0,0,0,165,166,5,119,0,0,166,167,5,104,0,0,167,168,5,
105,0,0,168,169,5,108,0,0,169,170,5,101,0,0,170,56,1,0,0,0,171,172,
5,115,0,0,172,173,5,119,0,0,173,174,5,105,0,0,174,175,5,116,0,0,
175,176,5,99,0,0,176,177,5,104,0,0,177,58,1,0,0,0,178,179,5,99,0,
0,179,180,5,97,0,0,180,181,5,115,0,0,181,182,5,101,0,0,182,60,1,
0,0,0,183,184,5,109,0,0,184,185,5,97,0,0,185,186,5,105,0,0,186,187,
5,110,0,0,187,62,1,0,0,0,188,190,7,0,0,0,189,188,1,0,0,0,190,191,
1,0,0,0,191,189,1,0,0,0,191,192,1,0,0,0,192,64,1,0,0,0,193,197,7,
1,0,0,194,196,7,2,0,0,195,194,1,0,0,0,196,199,1,0,0,0,197,195,1,
0,0,0,197,198,1,0,0,0,198,66,1,0,0,0,199,197,1,0,0,0,200,202,7,3,
0,0,201,200,1,0,0,0,202,203,1,0,0,0,203,201,1,0,0,0,203,204,1,0,
0,0,204,205,1,0,0,0,205,206,6,33,0,0,206,68,1,0,0,0,5,0,151,191,
197,203,1,6,0,0
]
class MyGrammarLexer(Lexer):
atn = ATNDeserializer().deserialize(serializedATN())
decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]
ZERO = 1
AND = 2
OR = 3
NOT = 4
EQ = 5
GREATER = 6
LESS = 7
COMBINATION = 8
INTERSECTION = 9
SET = 10
SSET = 11
INCREMENT = 12
DECREMENT = 13
COMMA = 14
SEMI = 15
LPAREN = 16
RPAREN = 17
LCURLY = 18
RCURLY = 19
LSQUARE = 20
RSQUARE = 21
RETURN = 22
TYPE = 23
LINK = 24
DOT = 25
IF = 26
ELSE = 27
WHILE = 28
SWITCH = 29
CASE = 30
MAIN = 31
INT = 32
ID = 33
WS = 34
channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ]
modeNames = [ "DEFAULT_MODE" ]
literalNames = [ "<INVALID>",
"'^'", "'and'", "'or'", "'not'", "'='", "'>'", "'<'", "'+'",
"'*'", "'-'", "'/'", "'++'", "'--'", "','", "';'", "'('", "')'",
"'{'", "'}'", "'['", "']'", "'return'", "'&'", "'.'", "'if'",
"'else'", "'while'", "'switch'", "'case'", "'main'" ]
symbolicNames = [ "<INVALID>",
"ZERO", "AND", "OR", "NOT", "EQ", "GREATER", "LESS", "COMBINATION",
"INTERSECTION", "SET", "SSET", "INCREMENT", "DECREMENT", "COMMA",
"SEMI", "LPAREN", "RPAREN", "LCURLY", "RCURLY", "LSQUARE", "RSQUARE",
"RETURN", "TYPE", "LINK", "DOT", "IF", "ELSE", "WHILE", "SWITCH",
"CASE", "MAIN", "INT", "ID", "WS" ]
ruleNames = [ "ZERO", "AND", "OR", "NOT", "EQ", "GREATER", "LESS", "COMBINATION",
"INTERSECTION", "SET", "SSET", "INCREMENT", "DECREMENT",
"COMMA", "SEMI", "LPAREN", "RPAREN", "LCURLY", "RCURLY",
"LSQUARE", "RSQUARE", "RETURN", "TYPE", "LINK", "DOT",
"IF", "ELSE", "WHILE", "SWITCH", "CASE", "MAIN", "INT",
"ID", "WS" ]
grammarFileName = "MyGrammar.g4"
def __init__(self, input=None, output:TextIO = sys.stdout):
super().__init__(input, output)
self.checkVersion("4.12.0")
self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
self._actions = None
self._predicates = None