-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSTLLexer.py
146 lines (129 loc) · 6.92 KB
/
STLLexer.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
# Generated from stl.g4 by ANTLR 4.8
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys
def serializedATN():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2!")
buf.write("\u0097\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 \3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5")
buf.write("\3\6\3\6\3\7\3\7\3\b\3\b\3\t\3\t\3\n\3\n\3\13\3\13\3\f")
buf.write("\3\f\3\r\3\r\3\16\3\16\3\17\3\17\3\17\3\20\3\20\3\21\3")
buf.write("\21\3\21\3\22\3\22\3\23\3\23\3\23\3\24\3\24\3\24\3\24")
buf.write("\3\25\3\25\3\25\3\25\3\26\3\26\3\27\3\27\3\30\3\30\3\31")
buf.write("\3\31\3\32\3\32\3\32\3\32\3\33\3\33\3\33\3\34\3\34\3\34")
buf.write("\3\35\6\35\u0084\n\35\r\35\16\35\u0085\3\36\6\36\u0089")
buf.write("\n\36\r\36\16\36\u008a\3\36\3\36\3\37\3\37\7\37\u0091")
buf.write("\n\37\f\37\16\37\u0094\13\37\3 \3 \2\2!\3\3\5\4\7\5\t")
buf.write("\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20")
buf.write("\37\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33\65")
buf.write("\34\67\359\36;\37= ?!\3\2\t\7\2((``\u00a9\u00a9\u00e4")
buf.write("\u00e4\u02c8\u02c8\6\2XX\u00aa\u00aa\u00e4\u00e4\u02c8")
buf.write("\u02c8\5\2//\u00ae\u00ae\u00c4\u00c4\3\2\62;\5\2\13\f")
buf.write("\17\17\"\"\5\2C\\aac|\5\2\62;C\\c|\2\u0099\2\3\3\2\2\2")
buf.write("\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r")
buf.write("\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3")
buf.write("\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2")
buf.write("\2\2\2\37\3\2\2\2\2!\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+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2")
buf.write("\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29")
buf.write("\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\3A\3\2\2\2\5")
buf.write("C\3\2\2\2\7E\3\2\2\2\tG\3\2\2\2\13I\3\2\2\2\rK\3\2\2\2")
buf.write("\17M\3\2\2\2\21O\3\2\2\2\23Q\3\2\2\2\25S\3\2\2\2\27U\3")
buf.write("\2\2\2\31W\3\2\2\2\33Y\3\2\2\2\35[\3\2\2\2\37^\3\2\2\2")
buf.write("!`\3\2\2\2#c\3\2\2\2%e\3\2\2\2\'h\3\2\2\2)l\3\2\2\2+p")
buf.write("\3\2\2\2-r\3\2\2\2/t\3\2\2\2\61v\3\2\2\2\63x\3\2\2\2\65")
buf.write("|\3\2\2\2\67\177\3\2\2\29\u0083\3\2\2\2;\u0088\3\2\2\2")
buf.write("=\u008e\3\2\2\2?\u0095\3\2\2\2AB\7*\2\2B\4\3\2\2\2CD\7")
buf.write("+\2\2D\6\3\2\2\2EF\7}\2\2F\b\3\2\2\2GH\7\177\2\2H\n\3")
buf.write("\2\2\2IJ\7]\2\2J\f\3\2\2\2KL\7_\2\2L\16\3\2\2\2MN\7~\2")
buf.write("\2N\20\3\2\2\2OP\7/\2\2P\22\3\2\2\2QR\7-\2\2R\24\3\2\2")
buf.write("\2ST\7,\2\2T\26\3\2\2\2UV\7\61\2\2V\30\3\2\2\2WX\7\60")
buf.write("\2\2X\32\3\2\2\2YZ\7@\2\2Z\34\3\2\2\2[\\\7@\2\2\\]\7?")
buf.write("\2\2]\36\3\2\2\2^_\7>\2\2_ \3\2\2\2`a\7>\2\2ab\7?\2\2")
buf.write("b\"\3\2\2\2cd\7?\2\2d$\3\2\2\2ef\7#\2\2fg\7?\2\2g&\3\2")
buf.write("\2\2hi\7\u00e4\2\2ij\7\u2016\2\2jk\7\u0162\2\2k(\3\2\2")
buf.write("\2lm\7\u00e4\2\2mn\7\u2015\2\2no\7\u00a3\2\2o*\3\2\2\2")
buf.write("pq\7W\2\2q,\3\2\2\2rs\t\2\2\2s.\3\2\2\2tu\t\3\2\2u\60")
buf.write("\3\2\2\2vw\t\4\2\2w\62\3\2\2\2xy\7\u00e4\2\2yz\7\u2022")
buf.write("\2\2z{\7\u201b\2\2{\64\3\2\2\2|}\7/\2\2}~\7@\2\2~\66\3")
buf.write("\2\2\2\177\u0080\7?\2\2\u0080\u0081\7@\2\2\u00818\3\2")
buf.write("\2\2\u0082\u0084\t\5\2\2\u0083\u0082\3\2\2\2\u0084\u0085")
buf.write("\3\2\2\2\u0085\u0083\3\2\2\2\u0085\u0086\3\2\2\2\u0086")
buf.write(":\3\2\2\2\u0087\u0089\t\6\2\2\u0088\u0087\3\2\2\2\u0089")
buf.write("\u008a\3\2\2\2\u008a\u0088\3\2\2\2\u008a\u008b\3\2\2\2")
buf.write("\u008b\u008c\3\2\2\2\u008c\u008d\b\36\2\2\u008d<\3\2\2")
buf.write("\2\u008e\u0092\t\7\2\2\u008f\u0091\t\b\2\2\u0090\u008f")
buf.write("\3\2\2\2\u0091\u0094\3\2\2\2\u0092\u0090\3\2\2\2\u0092")
buf.write("\u0093\3\2\2\2\u0093>\3\2\2\2\u0094\u0092\3\2\2\2\u0095")
buf.write("\u0096\7.\2\2\u0096@\3\2\2\2\6\2\u0085\u008a\u0092\3\b")
buf.write("\2\2")
return buf.getvalue()
class stlLexer(Lexer):
atn = ATNDeserializer().deserialize(serializedATN())
decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]
OPEN_BRACKET = 1
CLOSE_BRACKET = 2
OPEN_CURLY = 3
CLOSE_CURLY = 4
OPEN_SQUARE = 5
CLOSE_SQUARE = 6
PIPELINE = 7
MINUS = 8
PLUS = 9
STAR = 10
FORWARD_SLASH = 11
DOT = 12
LARGER_THAN = 13
LARGER_THAN_OR_EQUAL = 14
SMALLER_THAN = 15
SMALLER_THAN_OR_EQUAL = 16
EQUALS = 17
UNEQUALS = 18
DIAMOND = 19
SQUARE = 20
UNTIL = 21
AND = 22
OR = 23
NEGATE = 24
ARROW = 25
SIGNLE_ARROW = 26
DOUBLE_ARROW = 27
DIGIT = 28
WHITE_SPACE = 29
SIGNAL = 30
COMMA = 31
channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ]
modeNames = [ "DEFAULT_MODE" ]
literalNames = [ "<INVALID>",
"'('", "')'", "'{'", "'}'", "'['", "']'", "'|'", "'-'", "'+'",
"'*'", "'/'", "'.'", "'>'", "'>='", "'<'", "'<='", "'='", "'!='",
"'\u00E2\u2014\u0160'", "'\u00E2\u2013\u00A1'", "'U'", "'\u00E2\u2020\u2019'",
"'->'", "'=>'", "','" ]
symbolicNames = [ "<INVALID>",
"OPEN_BRACKET", "CLOSE_BRACKET", "OPEN_CURLY", "CLOSE_CURLY",
"OPEN_SQUARE", "CLOSE_SQUARE", "PIPELINE", "MINUS", "PLUS",
"STAR", "FORWARD_SLASH", "DOT", "LARGER_THAN", "LARGER_THAN_OR_EQUAL",
"SMALLER_THAN", "SMALLER_THAN_OR_EQUAL", "EQUALS", "UNEQUALS",
"DIAMOND", "SQUARE", "UNTIL", "AND", "OR", "NEGATE", "ARROW",
"SIGNLE_ARROW", "DOUBLE_ARROW", "DIGIT", "WHITE_SPACE", "SIGNAL",
"COMMA" ]
ruleNames = [ "OPEN_BRACKET", "CLOSE_BRACKET", "OPEN_CURLY", "CLOSE_CURLY",
"OPEN_SQUARE", "CLOSE_SQUARE", "PIPELINE", "MINUS", "PLUS",
"STAR", "FORWARD_SLASH", "DOT", "LARGER_THAN", "LARGER_THAN_OR_EQUAL",
"SMALLER_THAN", "SMALLER_THAN_OR_EQUAL", "EQUALS", "UNEQUALS",
"DIAMOND", "SQUARE", "UNTIL", "AND", "OR", "NEGATE", "ARROW",
"SIGNLE_ARROW", "DOUBLE_ARROW", "DIGIT", "WHITE_SPACE",
"SIGNAL", "COMMA" ]
grammarFileName = "stl.g4"
def __init__(self, input=None, output:TextIO = sys.stdout):
super().__init__(input, output)
self.checkVersion("4.8")
self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
self._actions = None
self._predicates = None