-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathDIDLexer.py
204 lines (187 loc) · 11.5 KB
/
DIDLexer.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
# Generated from DIDLexer.g4 by ANTLR 4.9.3
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():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\33")
buf.write("\u012c\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\3\2\3\2\3\2\3\2\7\2B\n\2\f\2\16\2E\13\2\3\2\3\2")
buf.write("\3\2\3\2\3\2\3\3\3\3\3\3\3\3\7\3P\n\3\f\3\16\3S\13\3\3")
buf.write("\3\3\3\3\4\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3\6")
buf.write("\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3")
buf.write("\7\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\t")
buf.write("\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3")
buf.write("\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t")
buf.write("\3\t\3\t\3\t\3\t\3\t\3\t\3\t\5\t\u00a0\n\t\3\n\3\n\3\n")
buf.write("\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3")
buf.write("\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n")
buf.write("\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3")
buf.write("\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n")
buf.write("\3\n\5\n\u00dc\n\n\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\f")
buf.write("\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3\16")
buf.write("\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17")
buf.write("\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\22\3\22\3\23\3\23")
buf.write("\3\23\5\23\u0109\n\23\3\24\3\24\3\25\5\25\u010e\n\25\3")
buf.write("\25\3\25\7\25\u0112\n\25\f\25\16\25\u0115\13\25\3\25\5")
buf.write("\25\u0118\n\25\3\26\3\26\3\27\3\27\3\30\3\30\3\31\3\31")
buf.write("\3\32\3\32\3\32\3\33\3\33\3\34\3\34\3\35\3\35\3\36\3\36")
buf.write("\3C\2\37\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f")
buf.write("\27\r\31\16\33\17\35\20\37\21!\2#\2%\2\'\2)\22+\23-\24")
buf.write("/\25\61\26\63\27\65\30\67\319\32;\33\3\2\7\4\2\f\f\17")
buf.write("\17\5\2\13\f\17\17\"\"\4\2C\\c|\3\2\62;\5\2C\\aac|\2\u013f")
buf.write("\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13")
buf.write("\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3")
buf.write("\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2")
buf.write("\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2")
buf.write("-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65\3")
buf.write("\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\3=\3\2\2\2\5")
buf.write("K\3\2\2\2\7V\3\2\2\2\tZ\3\2\2\2\13_\3\2\2\2\re\3\2\2\2")
buf.write("\17u\3\2\2\2\21\u009f\3\2\2\2\23\u00db\3\2\2\2\25\u00dd")
buf.write("\3\2\2\2\27\u00e1\3\2\2\2\31\u00e5\3\2\2\2\33\u00ec\3")
buf.write("\2\2\2\35\u00f4\3\2\2\2\37\u00fc\3\2\2\2!\u0101\3\2\2")
buf.write("\2#\u0103\3\2\2\2%\u0108\3\2\2\2\'\u010a\3\2\2\2)\u010d")
buf.write("\3\2\2\2+\u0119\3\2\2\2-\u011b\3\2\2\2/\u011d\3\2\2\2")
buf.write("\61\u011f\3\2\2\2\63\u0121\3\2\2\2\65\u0124\3\2\2\2\67")
buf.write("\u0126\3\2\2\29\u0128\3\2\2\2;\u012a\3\2\2\2=>\7\61\2")
buf.write("\2>?\7,\2\2?C\3\2\2\2@B\13\2\2\2A@\3\2\2\2BE\3\2\2\2C")
buf.write("D\3\2\2\2CA\3\2\2\2DF\3\2\2\2EC\3\2\2\2FG\7,\2\2GH\7\61")
buf.write("\2\2HI\3\2\2\2IJ\b\2\2\2J\4\3\2\2\2KL\7\61\2\2LM\7\61")
buf.write("\2\2MQ\3\2\2\2NP\n\2\2\2ON\3\2\2\2PS\3\2\2\2QO\3\2\2\2")
buf.write("QR\3\2\2\2RT\3\2\2\2SQ\3\2\2\2TU\b\3\2\2U\6\3\2\2\2VW")
buf.write("\t\3\2\2WX\3\2\2\2XY\b\4\2\2Y\b\3\2\2\2Z[\7v\2\2[\\\7")
buf.write("{\2\2\\]\7r\2\2]^\7g\2\2^\n\3\2\2\2_`\7s\2\2`a\7w\2\2")
buf.write("ab\7g\2\2bc\7t\2\2cd\7{\2\2d\f\3\2\2\2ef\7e\2\2fg\7q\2")
buf.write("\2gh\7o\2\2hi\7r\2\2ij\7q\2\2jk\7u\2\2kl\7k\2\2lm\7v\2")
buf.write("\2mn\7g\2\2no\7a\2\2op\7s\2\2pq\7w\2\2qr\7g\2\2rs\7t\2")
buf.write("\2st\7{\2\2t\16\3\2\2\2uv\7q\2\2vw\7p\2\2wx\7g\2\2xy\7")
buf.write("y\2\2yz\7c\2\2z{\7{\2\2{\20\3\2\2\2|\u00a0\5\23\n\2}~")
buf.write("\7d\2\2~\177\7q\2\2\177\u0080\7q\2\2\u0080\u00a0\7n\2")
buf.write("\2\u0081\u0082\7v\2\2\u0082\u0083\7g\2\2\u0083\u0084\7")
buf.write("z\2\2\u0084\u00a0\7v\2\2\u0085\u0086\7p\2\2\u0086\u0087")
buf.write("\7w\2\2\u0087\u0088\7n\2\2\u0088\u00a0\7n\2\2\u0089\u008a")
buf.write("\7t\2\2\u008a\u008b\7g\2\2\u008b\u008c\7u\2\2\u008c\u008d")
buf.write("\7g\2\2\u008d\u008e\7t\2\2\u008e\u008f\7x\2\2\u008f\u0090")
buf.write("\7g\2\2\u0090\u00a0\7f\2\2\u0091\u0092\7g\2\2\u0092\u0093")
buf.write("\7o\2\2\u0093\u0094\7r\2\2\u0094\u0095\7v\2\2\u0095\u00a0")
buf.write("\7{\2\2\u0096\u0097\7r\2\2\u0097\u0098\7t\2\2\u0098\u0099")
buf.write("\7k\2\2\u0099\u009a\7p\2\2\u009a\u009b\7e\2\2\u009b\u009c")
buf.write("\7k\2\2\u009c\u009d\7r\2\2\u009d\u009e\7c\2\2\u009e\u00a0")
buf.write("\7n\2\2\u009f|\3\2\2\2\u009f}\3\2\2\2\u009f\u0081\3\2")
buf.write("\2\2\u009f\u0085\3\2\2\2\u009f\u0089\3\2\2\2\u009f\u0091")
buf.write("\3\2\2\2\u009f\u0096\3\2\2\2\u00a0\22\3\2\2\2\u00a1\u00a2")
buf.write("\7p\2\2\u00a2\u00a3\7c\2\2\u00a3\u00dc\7v\2\2\u00a4\u00a5")
buf.write("\7p\2\2\u00a5\u00a6\7c\2\2\u00a6\u00a7\7v\2\2\u00a7\u00dc")
buf.write("\7:\2\2\u00a8\u00a9\7p\2\2\u00a9\u00aa\7c\2\2\u00aa\u00ab")
buf.write("\7v\2\2\u00ab\u00ac\7\63\2\2\u00ac\u00dc\78\2\2\u00ad")
buf.write("\u00ae\7p\2\2\u00ae\u00af\7c\2\2\u00af\u00b0\7v\2\2\u00b0")
buf.write("\u00b1\7\65\2\2\u00b1\u00dc\7\64\2\2\u00b2\u00b3\7p\2")
buf.write("\2\u00b3\u00b4\7c\2\2\u00b4\u00b5\7v\2\2\u00b5\u00b6\7")
buf.write("8\2\2\u00b6\u00dc\7\66\2\2\u00b7\u00b8\7k\2\2\u00b8\u00b9")
buf.write("\7p\2\2\u00b9\u00dc\7v\2\2\u00ba\u00bb\7k\2\2\u00bb\u00bc")
buf.write("\7p\2\2\u00bc\u00bd\7v\2\2\u00bd\u00dc\7:\2\2\u00be\u00bf")
buf.write("\7k\2\2\u00bf\u00c0\7p\2\2\u00c0\u00c1\7v\2\2\u00c1\u00c2")
buf.write("\7\63\2\2\u00c2\u00dc\78\2\2\u00c3\u00c4\7k\2\2\u00c4")
buf.write("\u00c5\7p\2\2\u00c5\u00c6\7v\2\2\u00c6\u00c7\7\65\2\2")
buf.write("\u00c7\u00dc\7\64\2\2\u00c8\u00c9\7k\2\2\u00c9\u00ca\7")
buf.write("p\2\2\u00ca\u00cb\7v\2\2\u00cb\u00cc\78\2\2\u00cc\u00dc")
buf.write("\7\66\2\2\u00cd\u00ce\7h\2\2\u00ce\u00cf\7n\2\2\u00cf")
buf.write("\u00d0\7q\2\2\u00d0\u00d1\7c\2\2\u00d1\u00d2\7v\2\2\u00d2")
buf.write("\u00d3\7\65\2\2\u00d3\u00dc\7\64\2\2\u00d4\u00d5\7h\2")
buf.write("\2\u00d5\u00d6\7n\2\2\u00d6\u00d7\7q\2\2\u00d7\u00d8\7")
buf.write("c\2\2\u00d8\u00d9\7v\2\2\u00d9\u00da\78\2\2\u00da\u00dc")
buf.write("\7\66\2\2\u00db\u00a1\3\2\2\2\u00db\u00a4\3\2\2\2\u00db")
buf.write("\u00a8\3\2\2\2\u00db\u00ad\3\2\2\2\u00db\u00b2\3\2\2\2")
buf.write("\u00db\u00b7\3\2\2\2\u00db\u00ba\3\2\2\2\u00db\u00be\3")
buf.write("\2\2\2\u00db\u00c3\3\2\2\2\u00db\u00c8\3\2\2\2\u00db\u00cd")
buf.write("\3\2\2\2\u00db\u00d4\3\2\2\2\u00dc\24\3\2\2\2\u00dd\u00de")
buf.write("\7q\2\2\u00de\u00df\7r\2\2\u00df\u00e0\7v\2\2\u00e0\26")
buf.write("\3\2\2\2\u00e1\u00e2\7x\2\2\u00e2\u00e3\7g\2\2\u00e3\u00e4")
buf.write("\7e\2\2\u00e4\30\3\2\2\2\u00e5\u00e6\7t\2\2\u00e6\u00e7")
buf.write("\7g\2\2\u00e7\u00e8\7e\2\2\u00e8\u00e9\7q\2\2\u00e9\u00ea")
buf.write("\7t\2\2\u00ea\u00eb\7f\2\2\u00eb\32\3\2\2\2\u00ec\u00ed")
buf.write("\7x\2\2\u00ed\u00ee\7c\2\2\u00ee\u00ef\7t\2\2\u00ef\u00f0")
buf.write("\7k\2\2\u00f0\u00f1\7c\2\2\u00f1\u00f2\7p\2\2\u00f2\u00f3")
buf.write("\7v\2\2\u00f3\34\3\2\2\2\u00f4\u00f5\7u\2\2\u00f5\u00f6")
buf.write("\7g\2\2\u00f6\u00f7\7t\2\2\u00f7\u00f8\7x\2\2\u00f8\u00f9")
buf.write("\7k\2\2\u00f9\u00fa\7e\2\2\u00fa\u00fb\7g\2\2\u00fb\36")
buf.write("\3\2\2\2\u00fc\u00fd\7h\2\2\u00fd\u00fe\7w\2\2\u00fe\u00ff")
buf.write("\7p\2\2\u00ff\u0100\7e\2\2\u0100 \3\2\2\2\u0101\u0102")
buf.write("\t\4\2\2\u0102\"\3\2\2\2\u0103\u0104\t\5\2\2\u0104$\3")
buf.write("\2\2\2\u0105\u0109\5\'\24\2\u0106\u0109\7a\2\2\u0107\u0109")
buf.write("\5#\22\2\u0108\u0105\3\2\2\2\u0108\u0106\3\2\2\2\u0108")
buf.write("\u0107\3\2\2\2\u0109&\3\2\2\2\u010a\u010b\t\6\2\2\u010b")
buf.write("(\3\2\2\2\u010c\u010e\7$\2\2\u010d\u010c\3\2\2\2\u010d")
buf.write("\u010e\3\2\2\2\u010e\u010f\3\2\2\2\u010f\u0113\5\'\24")
buf.write("\2\u0110\u0112\5%\23\2\u0111\u0110\3\2\2\2\u0112\u0115")
buf.write("\3\2\2\2\u0113\u0111\3\2\2\2\u0113\u0114\3\2\2\2\u0114")
buf.write("\u0117\3\2\2\2\u0115\u0113\3\2\2\2\u0116\u0118\7$\2\2")
buf.write("\u0117\u0116\3\2\2\2\u0117\u0118\3\2\2\2\u0118*\3\2\2")
buf.write("\2\u0119\u011a\7*\2\2\u011a,\3\2\2\2\u011b\u011c\7+\2")
buf.write("\2\u011c.\3\2\2\2\u011d\u011e\7}\2\2\u011e\60\3\2\2\2")
buf.write("\u011f\u0120\7\177\2\2\u0120\62\3\2\2\2\u0121\u0122\7")
buf.write("/\2\2\u0122\u0123\7@\2\2\u0123\64\3\2\2\2\u0124\u0125")
buf.write("\7<\2\2\u0125\66\3\2\2\2\u0126\u0127\7=\2\2\u01278\3\2")
buf.write("\2\2\u0128\u0129\7?\2\2\u0129:\3\2\2\2\u012a\u012b\7.")
buf.write("\2\2\u012b<\3\2\2\2\13\2CQ\u009f\u00db\u0108\u010d\u0113")
buf.write("\u0117\3\b\2\2")
return buf.getvalue()
class DIDLexer(Lexer):
atn = ATNDeserializer().deserialize(serializedATN())
decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]
BlockComment = 1
LineComment = 2
S = 3
Type = 4
Query = 5
CompositeQuery = 6
Oneway = 7
PrimType = 8
NumType = 9
OPT = 10
VEC = 11
RECORD = 12
VARIANT = 13
Service = 14
FUNC = 15
Name = 16
LeftP = 17
RightP = 18
LeftB = 19
RightB = 20
Arrow = 21
Colon = 22
Semicolon = 23
Eq = 24
Comma = 25
channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ]
modeNames = [ "DEFAULT_MODE" ]
literalNames = [ "<INVALID>",
"'type'", "'query'", "'composite_query'", "'oneway'", "'opt'",
"'vec'", "'record'", "'variant'", "'service'", "'func'", "'('",
"')'", "'{'", "'}'", "'->'", "':'", "';'", "'='", "','" ]
symbolicNames = [ "<INVALID>",
"BlockComment", "LineComment", "S", "Type", "Query", "CompositeQuery",
"Oneway", "PrimType", "NumType", "OPT", "VEC", "RECORD", "VARIANT",
"Service", "FUNC", "Name", "LeftP", "RightP", "LeftB", "RightB",
"Arrow", "Colon", "Semicolon", "Eq", "Comma" ]
ruleNames = [ "BlockComment", "LineComment", "S", "Type", "Query", "CompositeQuery",
"Oneway", "PrimType", "NumType", "OPT", "VEC", "RECORD",
"VARIANT", "Service", "FUNC", "Letter", "DIGIT", "NameChar",
"NameStartChar", "Name", "LeftP", "RightP", "LeftB", "RightB",
"Arrow", "Colon", "Semicolon", "Eq", "Comma" ]
grammarFileName = "DIDLexer.g4"
def __init__(self, input=None, output:TextIO = sys.stdout):
super().__init__(input, output)
self.checkVersion("4.9.3")
self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
self._actions = None
self._predicates = None