source: doc/proposals/modules-alvin/1_stitched_modules/parser/CMODLexer.py

stuck-waitfor-destruct
Last change on this file was 2cb10170, checked in by Alvin Zhang <alvin.zhang@…>, 3 weeks ago

stitched modules proposal

  • Property mode set to 100644
File size: 7.5 KB
Line 
1# Generated from parser/CMOD.g4 by ANTLR 4.13.2
2from antlr4 import *
3from io import StringIO
4import sys
5if sys.version_info[1] > 5:
6 from typing import TextIO
7else:
8 from typing.io import TextIO
9
10
11def serializedATN():
12 return [
13 4,0,28,218,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,
14 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,
15 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,
16 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,
17 26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,1,0,1,0,1,0,1,0,
18 1,0,1,0,1,0,1,1,1,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,3,1,3,1,4,1,4,
19 1,4,1,4,1,4,1,4,1,4,1,5,1,5,1,6,1,6,1,7,1,7,1,7,1,7,1,7,1,8,1,8,
20 1,8,1,8,1,8,1,9,1,9,1,9,1,9,1,9,1,9,1,10,1,10,1,10,1,10,1,11,1,11,
21 1,11,1,11,1,11,1,12,1,12,1,12,1,12,1,12,1,12,1,13,1,13,1,13,1,13,
22 1,13,1,13,1,13,1,14,1,14,1,14,1,14,1,14,1,14,1,14,1,15,1,15,1,16,
23 1,16,1,17,1,17,1,18,1,18,1,19,1,19,1,19,1,19,1,19,1,20,1,20,1,21,
24 1,21,1,22,1,22,1,22,5,22,158,8,22,10,22,12,22,161,9,22,1,23,1,23,
25 1,24,1,24,1,25,1,25,5,25,169,8,25,10,25,12,25,172,9,25,1,25,1,25,
26 1,26,1,26,1,27,4,27,179,8,27,11,27,12,27,180,1,27,1,27,1,28,1,28,
27 3,28,187,8,28,1,28,3,28,190,8,28,1,28,1,28,1,29,1,29,1,29,1,29,5,
28 29,198,8,29,10,29,12,29,201,9,29,1,29,1,29,1,29,1,29,1,29,1,30,1,
29 30,1,30,1,30,5,30,212,8,30,10,30,12,30,215,9,30,1,30,1,30,1,199,
30 0,31,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,
31 13,27,14,29,15,31,16,33,17,35,18,37,19,39,20,41,21,43,22,45,23,47,
32 0,49,0,51,24,53,0,55,25,57,26,59,27,61,28,1,0,5,4,0,36,36,65,90,
33 95,95,97,122,1,0,48,57,3,0,10,10,13,13,34,34,2,0,9,9,32,32,2,0,10,
34 10,13,13,222,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,
35 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,
36 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,
37 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,
38 1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,0,0,51,1,0,0,0,0,55,
39 1,0,0,0,0,57,1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,1,63,1,0,0,0,3,70,
40 1,0,0,0,5,72,1,0,0,0,7,79,1,0,0,0,9,81,1,0,0,0,11,88,1,0,0,0,13,
41 90,1,0,0,0,15,92,1,0,0,0,17,97,1,0,0,0,19,102,1,0,0,0,21,108,1,0,
42 0,0,23,112,1,0,0,0,25,117,1,0,0,0,27,123,1,0,0,0,29,130,1,0,0,0,
43 31,137,1,0,0,0,33,139,1,0,0,0,35,141,1,0,0,0,37,143,1,0,0,0,39,145,
44 1,0,0,0,41,150,1,0,0,0,43,152,1,0,0,0,45,154,1,0,0,0,47,162,1,0,
45 0,0,49,164,1,0,0,0,51,166,1,0,0,0,53,175,1,0,0,0,55,178,1,0,0,0,
46 57,189,1,0,0,0,59,193,1,0,0,0,61,207,1,0,0,0,63,64,5,109,0,0,64,
47 65,5,111,0,0,65,66,5,100,0,0,66,67,5,117,0,0,67,68,5,108,0,0,68,
48 69,5,101,0,0,69,2,1,0,0,0,70,71,5,59,0,0,71,4,1,0,0,0,72,73,5,105,
49 0,0,73,74,5,109,0,0,74,75,5,112,0,0,75,76,5,111,0,0,76,77,5,114,
50 0,0,77,78,5,116,0,0,78,6,1,0,0,0,79,80,5,47,0,0,80,8,1,0,0,0,81,
51 82,5,101,0,0,82,83,5,120,0,0,83,84,5,112,0,0,84,85,5,111,0,0,85,
52 86,5,114,0,0,86,87,5,116,0,0,87,10,1,0,0,0,88,89,5,40,0,0,89,12,
53 1,0,0,0,90,91,5,41,0,0,91,14,1,0,0,0,92,93,5,118,0,0,93,94,5,111,
54 0,0,94,95,5,105,0,0,95,96,5,100,0,0,96,16,1,0,0,0,97,98,5,99,0,0,
55 98,99,5,104,0,0,99,100,5,97,0,0,100,101,5,114,0,0,101,18,1,0,0,0,
56 102,103,5,115,0,0,103,104,5,104,0,0,104,105,5,111,0,0,105,106,5,
57 114,0,0,106,107,5,116,0,0,107,20,1,0,0,0,108,109,5,105,0,0,109,110,
58 5,110,0,0,110,111,5,116,0,0,111,22,1,0,0,0,112,113,5,108,0,0,113,
59 114,5,111,0,0,114,115,5,110,0,0,115,116,5,103,0,0,116,24,1,0,0,0,
60 117,118,5,102,0,0,118,119,5,108,0,0,119,120,5,111,0,0,120,121,5,
61 97,0,0,121,122,5,116,0,0,122,26,1,0,0,0,123,124,5,100,0,0,124,125,
62 5,111,0,0,125,126,5,117,0,0,126,127,5,98,0,0,127,128,5,108,0,0,128,
63 129,5,101,0,0,129,28,1,0,0,0,130,131,5,115,0,0,131,132,5,116,0,0,
64 132,133,5,114,0,0,133,134,5,117,0,0,134,135,5,99,0,0,135,136,5,116,
65 0,0,136,30,1,0,0,0,137,138,5,42,0,0,138,32,1,0,0,0,139,140,5,44,
66 0,0,140,34,1,0,0,0,141,142,5,123,0,0,142,36,1,0,0,0,143,144,5,125,
67 0,0,144,38,1,0,0,0,145,146,5,116,0,0,146,147,5,121,0,0,147,148,5,
68 112,0,0,148,149,5,101,0,0,149,40,1,0,0,0,150,151,5,61,0,0,151,42,
69 1,0,0,0,152,153,5,43,0,0,153,44,1,0,0,0,154,159,3,47,23,0,155,158,
70 3,47,23,0,156,158,3,49,24,0,157,155,1,0,0,0,157,156,1,0,0,0,158,
71 161,1,0,0,0,159,157,1,0,0,0,159,160,1,0,0,0,160,46,1,0,0,0,161,159,
72 1,0,0,0,162,163,7,0,0,0,163,48,1,0,0,0,164,165,7,1,0,0,165,50,1,
73 0,0,0,166,170,5,34,0,0,167,169,3,53,26,0,168,167,1,0,0,0,169,172,
74 1,0,0,0,170,168,1,0,0,0,170,171,1,0,0,0,171,173,1,0,0,0,172,170,
75 1,0,0,0,173,174,5,34,0,0,174,52,1,0,0,0,175,176,8,2,0,0,176,54,1,
76 0,0,0,177,179,7,3,0,0,178,177,1,0,0,0,179,180,1,0,0,0,180,178,1,
77 0,0,0,180,181,1,0,0,0,181,182,1,0,0,0,182,183,6,27,0,0,183,56,1,
78 0,0,0,184,186,5,13,0,0,185,187,5,10,0,0,186,185,1,0,0,0,186,187,
79 1,0,0,0,187,190,1,0,0,0,188,190,5,10,0,0,189,184,1,0,0,0,189,188,
80 1,0,0,0,190,191,1,0,0,0,191,192,6,28,0,0,192,58,1,0,0,0,193,194,
81 5,47,0,0,194,195,5,42,0,0,195,199,1,0,0,0,196,198,9,0,0,0,197,196,
82 1,0,0,0,198,201,1,0,0,0,199,200,1,0,0,0,199,197,1,0,0,0,200,202,
83 1,0,0,0,201,199,1,0,0,0,202,203,5,42,0,0,203,204,5,47,0,0,204,205,
84 1,0,0,0,205,206,6,29,0,0,206,60,1,0,0,0,207,208,5,47,0,0,208,209,
85 5,47,0,0,209,213,1,0,0,0,210,212,8,4,0,0,211,210,1,0,0,0,212,215,
86 1,0,0,0,213,211,1,0,0,0,213,214,1,0,0,0,214,216,1,0,0,0,215,213,
87 1,0,0,0,216,217,6,30,0,0,217,62,1,0,0,0,9,0,157,159,170,180,186,
88 189,199,213,1,0,1,0
89 ]
90
91class CMODLexer(Lexer):
92
93 atn = ATNDeserializer().deserialize(serializedATN())
94
95 decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]
96
97 T__0 = 1
98 T__1 = 2
99 T__2 = 3
100 T__3 = 4
101 T__4 = 5
102 T__5 = 6
103 T__6 = 7
104 T__7 = 8
105 T__8 = 9
106 T__9 = 10
107 T__10 = 11
108 T__11 = 12
109 T__12 = 13
110 T__13 = 14
111 T__14 = 15
112 T__15 = 16
113 T__16 = 17
114 T__17 = 18
115 T__18 = 19
116 T__19 = 20
117 T__20 = 21
118 T__21 = 22
119 Identifier = 23
120 StringLiteral = 24
121 Whitespace = 25
122 Newline = 26
123 BlockComment = 27
124 LineComment = 28
125
126 channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ]
127
128 modeNames = [ "DEFAULT_MODE" ]
129
130 literalNames = [ "<INVALID>",
131 "'module'", "';'", "'import'", "'/'", "'export'", "'('", "')'",
132 "'void'", "'char'", "'short'", "'int'", "'long'", "'float'",
133 "'double'", "'struct'", "'*'", "','", "'{'", "'}'", "'type'",
134 "'='", "'+'" ]
135
136 symbolicNames = [ "<INVALID>",
137 "Identifier", "StringLiteral", "Whitespace", "Newline", "BlockComment",
138 "LineComment" ]
139
140 ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6",
141 "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13",
142 "T__14", "T__15", "T__16", "T__17", "T__18", "T__19",
143 "T__20", "T__21", "Identifier", "Nondigit", "Digit", "StringLiteral",
144 "SChar", "Whitespace", "Newline", "BlockComment", "LineComment" ]
145
146 grammarFileName = "CMOD.g4"
147
148 def __init__(self, input=None, output:TextIO = sys.stdout):
149 super().__init__(input, output)
150 self.checkVersion("4.13.2")
151 self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
152 self._actions = None
153 self._predicates = None
154
155
Note: See TracBrowser for help on using the repository browser.