pyfcstm 0.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyfcstm/__init__.py +0 -0
- pyfcstm/__main__.py +4 -0
- pyfcstm/config/__init__.py +0 -0
- pyfcstm/config/meta.py +20 -0
- pyfcstm/dsl/__init__.py +6 -0
- pyfcstm/dsl/error.py +226 -0
- pyfcstm/dsl/grammar/Grammar.g4 +190 -0
- pyfcstm/dsl/grammar/Grammar.interp +168 -0
- pyfcstm/dsl/grammar/Grammar.tokens +118 -0
- pyfcstm/dsl/grammar/GrammarLexer.interp +214 -0
- pyfcstm/dsl/grammar/GrammarLexer.py +523 -0
- pyfcstm/dsl/grammar/GrammarLexer.tokens +118 -0
- pyfcstm/dsl/grammar/GrammarListener.py +521 -0
- pyfcstm/dsl/grammar/GrammarParser.py +4373 -0
- pyfcstm/dsl/grammar/__init__.py +3 -0
- pyfcstm/dsl/listener.py +440 -0
- pyfcstm/dsl/node.py +1581 -0
- pyfcstm/dsl/parse.py +155 -0
- pyfcstm/entry/__init__.py +1 -0
- pyfcstm/entry/base.py +126 -0
- pyfcstm/entry/cli.py +12 -0
- pyfcstm/entry/dispatch.py +46 -0
- pyfcstm/entry/generate.py +83 -0
- pyfcstm/entry/plantuml.py +67 -0
- pyfcstm/model/__init__.py +3 -0
- pyfcstm/model/base.py +51 -0
- pyfcstm/model/expr.py +764 -0
- pyfcstm/model/model.py +1392 -0
- pyfcstm/render/__init__.py +3 -0
- pyfcstm/render/env.py +36 -0
- pyfcstm/render/expr.py +180 -0
- pyfcstm/render/func.py +77 -0
- pyfcstm/render/render.py +279 -0
- pyfcstm/utils/__init__.py +6 -0
- pyfcstm/utils/binary.py +38 -0
- pyfcstm/utils/doc.py +64 -0
- pyfcstm/utils/jinja2.py +121 -0
- pyfcstm/utils/json.py +125 -0
- pyfcstm/utils/text.py +91 -0
- pyfcstm/utils/validate.py +102 -0
- pyfcstm-0.0.1.dist-info/LICENSE +165 -0
- pyfcstm-0.0.1.dist-info/METADATA +205 -0
- pyfcstm-0.0.1.dist-info/RECORD +46 -0
- pyfcstm-0.0.1.dist-info/WHEEL +5 -0
- pyfcstm-0.0.1.dist-info/entry_points.txt +2 -0
- pyfcstm-0.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,4373 @@
|
|
1
|
+
# Generated from ./pyfcstm/dsl/grammar/Grammar.g4 by ANTLR 4.9.3
|
2
|
+
# encoding: utf-8
|
3
|
+
from antlr4 import *
|
4
|
+
from io import StringIO
|
5
|
+
import sys
|
6
|
+
|
7
|
+
if sys.version_info[1] > 5:
|
8
|
+
from typing import TextIO
|
9
|
+
else:
|
10
|
+
from typing.io import TextIO
|
11
|
+
|
12
|
+
|
13
|
+
def serializedATN():
|
14
|
+
with StringIO() as buf:
|
15
|
+
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3C")
|
16
|
+
buf.write("\u0234\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7")
|
17
|
+
buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16")
|
18
|
+
buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23")
|
19
|
+
buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31")
|
20
|
+
buf.write("\t\31\4\32\t\32\4\33\t\33\4\34\t\34\3\2\3\2\3\2\3\3\7")
|
21
|
+
buf.write("\3=\n\3\f\3\16\3@\13\3\3\3\3\3\3\3\3\4\3\4\3\4\3\4\3\4")
|
22
|
+
buf.write("\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5\3\5\7\5S\n\5\f\5\16\5")
|
23
|
+
buf.write("V\13\5\3\5\5\5Y\n\5\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3")
|
24
|
+
buf.write("\6\3\6\3\6\3\6\5\6g\n\6\3\6\3\6\3\6\3\6\7\6m\n\6\f\6\16")
|
25
|
+
buf.write("\6p\13\6\3\6\5\6s\n\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6")
|
26
|
+
buf.write("\3\6\3\6\3\6\3\6\3\6\3\6\5\6\u0083\n\6\3\6\3\6\3\6\3\6")
|
27
|
+
buf.write("\7\6\u0089\n\6\f\6\16\6\u008c\13\6\3\6\5\6\u008f\n\6\3")
|
28
|
+
buf.write("\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6")
|
29
|
+
buf.write("\5\6\u009f\n\6\3\6\3\6\3\6\3\6\7\6\u00a5\n\6\f\6\16\6")
|
30
|
+
buf.write("\u00a8\13\6\3\6\5\6\u00ab\n\6\5\6\u00ad\n\6\3\7\3\7\3")
|
31
|
+
buf.write("\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\5\7")
|
32
|
+
buf.write("\u00be\n\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7")
|
33
|
+
buf.write("\3\7\3\7\3\7\3\7\3\7\5\7\u00d0\n\7\3\7\3\7\3\7\3\7\3\7")
|
34
|
+
buf.write("\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\5\7\u00e0\n\7\3\7")
|
35
|
+
buf.write("\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\5")
|
36
|
+
buf.write("\7\u00f0\n\7\3\7\5\7\u00f3\n\7\3\b\3\b\5\b\u00f7\n\b\3")
|
37
|
+
buf.write("\b\3\b\7\b\u00fb\n\b\f\b\16\b\u00fe\13\b\3\b\3\b\3\b\3")
|
38
|
+
buf.write("\b\3\b\3\b\3\b\3\b\5\b\u0108\n\b\3\b\5\b\u010b\n\b\3\t")
|
39
|
+
buf.write("\3\t\5\t\u010f\n\t\3\t\3\t\7\t\u0113\n\t\f\t\16\t\u0116")
|
40
|
+
buf.write("\13\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\5\t\u0120\n\t\3")
|
41
|
+
buf.write("\t\5\t\u0123\n\t\3\n\3\n\5\n\u0127\n\n\3\n\5\n\u012a\n")
|
42
|
+
buf.write("\n\3\n\3\n\7\n\u012e\n\n\f\n\16\n\u0131\13\n\3\n\3\n\3")
|
43
|
+
buf.write("\n\5\n\u0136\n\n\3\n\3\n\3\n\3\n\3\n\5\n\u013d\n\n\3\n")
|
44
|
+
buf.write("\3\n\5\n\u0141\n\n\3\n\5\n\u0144\n\n\3\13\3\13\3\13\3")
|
45
|
+
buf.write("\13\5\13\u014a\n\13\3\13\3\13\7\13\u014e\n\13\f\13\16")
|
46
|
+
buf.write("\13\u0151\13\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13")
|
47
|
+
buf.write("\3\13\3\13\3\13\3\13\5\13\u015f\n\13\3\13\5\13\u0162\n")
|
48
|
+
buf.write("\13\3\f\3\f\3\f\3\f\3\f\3\r\3\r\5\r\u016b\n\r\3\16\3\16")
|
49
|
+
buf.write("\3\16\3\16\3\16\3\16\3\16\3\16\5\16\u0175\n\16\3\17\7")
|
50
|
+
buf.write("\17\u0178\n\17\f\17\16\17\u017b\13\17\3\17\3\17\3\20\7")
|
51
|
+
buf.write("\20\u0180\n\20\f\20\16\20\u0183\13\20\3\20\3\20\3\21\3")
|
52
|
+
buf.write("\21\5\21\u0189\n\21\3\22\3\22\3\22\3\22\3\22\3\23\3\23")
|
53
|
+
buf.write("\3\23\3\23\3\23\3\24\3\24\3\24\3\24\3\24\3\25\3\25\5\25")
|
54
|
+
buf.write("\u019c\n\25\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3")
|
55
|
+
buf.write("\26\3\26\3\26\3\26\3\26\3\26\5\26\u01ac\n\26\3\26\3\26")
|
56
|
+
buf.write("\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26")
|
57
|
+
buf.write("\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\7\26\u01c3\n")
|
58
|
+
buf.write("\26\f\26\16\26\u01c6\13\26\3\27\3\27\3\27\3\27\3\27\3")
|
59
|
+
buf.write("\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27")
|
60
|
+
buf.write("\3\27\3\27\3\27\3\27\3\27\3\27\3\27\5\27\u01df\n\27\3")
|
61
|
+
buf.write("\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27")
|
62
|
+
buf.write("\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\7\27")
|
63
|
+
buf.write("\u01f6\n\27\f\27\16\27\u01f9\13\27\3\30\3\30\3\30\3\30")
|
64
|
+
buf.write("\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30")
|
65
|
+
buf.write("\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\5\30\u0213")
|
66
|
+
buf.write("\n\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\7\30")
|
67
|
+
buf.write("\u021e\n\30\f\30\16\30\u0221\13\30\3\31\3\31\3\32\3\32")
|
68
|
+
buf.write("\3\33\3\33\3\34\5\34\u022a\n\34\3\34\3\34\3\34\7\34\u022f")
|
69
|
+
buf.write("\n\34\f\34\16\34\u0232\13\34\3\34\2\5*,.\35\2\4\6\b\n")
|
70
|
+
buf.write('\f\16\20\22\24\26\30\32\34\36 "$&(*,.\60\62\64\66\2\20')
|
71
|
+
buf.write('\3\2\4\5\3\2\r\16\3\2\31\32\3\2\37 \4\2\24\24"#\4\2\33')
|
72
|
+
buf.write("\33$$\4\2\23\23))\3\2*-\3\2./\3\2\60\61\3\2\62\63\3\2")
|
73
|
+
buf.write("8:\3\2;<\3\2\64\66\2\u027d\28\3\2\2\2\4>\3\2\2\2\6D\3")
|
74
|
+
buf.write("\2\2\2\bX\3\2\2\2\n\u00ac\3\2\2\2\f\u00f2\3\2\2\2\16\u010a")
|
75
|
+
buf.write("\3\2\2\2\20\u0122\3\2\2\2\22\u0143\3\2\2\2\24\u0161\3")
|
76
|
+
buf.write("\2\2\2\26\u0163\3\2\2\2\30\u016a\3\2\2\2\32\u0174\3\2")
|
77
|
+
buf.write("\2\2\34\u0179\3\2\2\2\36\u0181\3\2\2\2 \u0188\3\2\2\2")
|
78
|
+
buf.write('"\u018a\3\2\2\2$\u018f\3\2\2\2&\u0194\3\2\2\2(\u019b')
|
79
|
+
buf.write("\3\2\2\2*\u01ab\3\2\2\2,\u01de\3\2\2\2.\u0212\3\2\2\2")
|
80
|
+
buf.write("\60\u0222\3\2\2\2\62\u0224\3\2\2\2\64\u0226\3\2\2\2\66")
|
81
|
+
buf.write("\u0229\3\2\2\289\5.\30\29:\7\2\2\3:\3\3\2\2\2;=\5\6\4")
|
82
|
+
buf.write("\2<;\3\2\2\2=@\3\2\2\2><\3\2\2\2>?\3\2\2\2?A\3\2\2\2@")
|
83
|
+
buf.write(">\3\2\2\2AB\5\b\5\2BC\7\2\2\3C\5\3\2\2\2DE\7\3\2\2EF\t")
|
84
|
+
buf.write("\2\2\2FG\7>\2\2GH\7\6\2\2HI\5*\26\2IJ\7\7\2\2J\7\3\2\2")
|
85
|
+
buf.write("\2KL\7\b\2\2LM\7>\2\2MY\7\7\2\2NO\7\b\2\2OP\7>\2\2PT\7")
|
86
|
+
buf.write("\t\2\2QS\5\32\16\2RQ\3\2\2\2SV\3\2\2\2TR\3\2\2\2TU\3\2")
|
87
|
+
buf.write("\2\2UW\3\2\2\2VT\3\2\2\2WY\7\n\2\2XK\3\2\2\2XN\3\2\2\2")
|
88
|
+
buf.write("Y\t\3\2\2\2Z[\7\13\2\2[\\\7\f\2\2\\f\7>\2\2]g\3\2\2\2")
|
89
|
+
buf.write("^_\t\3\2\2_g\5\66\34\2`a\7\r\2\2ab\7\17\2\2bc\7\20\2\2")
|
90
|
+
buf.write("cd\5.\30\2de\7\21\2\2eg\3\2\2\2f]\3\2\2\2f^\3\2\2\2f`")
|
91
|
+
buf.write("\3\2\2\2gr\3\2\2\2hs\7\7\2\2ij\7\22\2\2jn\7\t\2\2km\5")
|
92
|
+
buf.write("\30\r\2lk\3\2\2\2mp\3\2\2\2nl\3\2\2\2no\3\2\2\2oq\3\2")
|
93
|
+
buf.write("\2\2pn\3\2\2\2qs\7\n\2\2rh\3\2\2\2ri\3\2\2\2s\u00ad\3")
|
94
|
+
buf.write("\2\2\2tu\7>\2\2uv\7\f\2\2v\u0082\7>\2\2w\u0083\3\2\2\2")
|
95
|
+
buf.write("xy\7\16\2\2y\u0083\7>\2\2z{\7\r\2\2{\u0083\5\66\34\2|")
|
96
|
+
buf.write("}\7\r\2\2}~\7\17\2\2~\177\7\20\2\2\177\u0080\5.\30\2\u0080")
|
97
|
+
buf.write("\u0081\7\21\2\2\u0081\u0083\3\2\2\2\u0082w\3\2\2\2\u0082")
|
98
|
+
buf.write("x\3\2\2\2\u0082z\3\2\2\2\u0082|\3\2\2\2\u0083\u008e\3")
|
99
|
+
buf.write("\2\2\2\u0084\u008f\7\7\2\2\u0085\u0086\7\22\2\2\u0086")
|
100
|
+
buf.write("\u008a\7\t\2\2\u0087\u0089\5\30\r\2\u0088\u0087\3\2\2")
|
101
|
+
buf.write("\2\u0089\u008c\3\2\2\2\u008a\u0088\3\2\2\2\u008a\u008b")
|
102
|
+
buf.write("\3\2\2\2\u008b\u008d\3\2\2\2\u008c\u008a\3\2\2\2\u008d")
|
103
|
+
buf.write("\u008f\7\n\2\2\u008e\u0084\3\2\2\2\u008e\u0085\3\2\2\2")
|
104
|
+
buf.write("\u008f\u00ad\3\2\2\2\u0090\u0091\7>\2\2\u0091\u0092\7")
|
105
|
+
buf.write("\f\2\2\u0092\u009e\7\13\2\2\u0093\u009f\3\2\2\2\u0094")
|
106
|
+
buf.write("\u0095\7\16\2\2\u0095\u009f\7>\2\2\u0096\u0097\7\r\2\2")
|
107
|
+
buf.write("\u0097\u009f\5\66\34\2\u0098\u0099\7\r\2\2\u0099\u009a")
|
108
|
+
buf.write("\7\17\2\2\u009a\u009b\7\20\2\2\u009b\u009c\5.\30\2\u009c")
|
109
|
+
buf.write("\u009d\7\21\2\2\u009d\u009f\3\2\2\2\u009e\u0093\3\2\2")
|
110
|
+
buf.write("\2\u009e\u0094\3\2\2\2\u009e\u0096\3\2\2\2\u009e\u0098")
|
111
|
+
buf.write("\3\2\2\2\u009f\u00aa\3\2\2\2\u00a0\u00ab\7\7\2\2\u00a1")
|
112
|
+
buf.write("\u00a2\7\22\2\2\u00a2\u00a6\7\t\2\2\u00a3\u00a5\5\30\r")
|
113
|
+
buf.write("\2\u00a4\u00a3\3\2\2\2\u00a5\u00a8\3\2\2\2\u00a6\u00a4")
|
114
|
+
buf.write("\3\2\2\2\u00a6\u00a7\3\2\2\2\u00a7\u00a9\3\2\2\2\u00a8")
|
115
|
+
buf.write("\u00a6\3\2\2\2\u00a9\u00ab\7\n\2\2\u00aa\u00a0\3\2\2\2")
|
116
|
+
buf.write("\u00aa\u00a1\3\2\2\2\u00ab\u00ad\3\2\2\2\u00acZ\3\2\2")
|
117
|
+
buf.write("\2\u00act\3\2\2\2\u00ac\u0090\3\2\2\2\u00ad\13\3\2\2\2")
|
118
|
+
buf.write("\u00ae\u00af\7\23\2\2\u00af\u00b0\7>\2\2\u00b0\u00b1\7")
|
119
|
+
buf.write("\f\2\2\u00b1\u00bd\7>\2\2\u00b2\u00be\3\2\2\2\u00b3\u00b4")
|
120
|
+
buf.write("\7\16\2\2\u00b4\u00be\7>\2\2\u00b5\u00b6\7\r\2\2\u00b6")
|
121
|
+
buf.write("\u00be\5\66\34\2\u00b7\u00b8\7\r\2\2\u00b8\u00b9\7\17")
|
122
|
+
buf.write("\2\2\u00b9\u00ba\7\20\2\2\u00ba\u00bb\5.\30\2\u00bb\u00bc")
|
123
|
+
buf.write("\7\21\2\2\u00bc\u00be\3\2\2\2\u00bd\u00b2\3\2\2\2\u00bd")
|
124
|
+
buf.write("\u00b3\3\2\2\2\u00bd\u00b5\3\2\2\2\u00bd\u00b7\3\2\2\2")
|
125
|
+
buf.write("\u00be\u00bf\3\2\2\2\u00bf\u00f3\7\7\2\2\u00c0\u00c1\7")
|
126
|
+
buf.write("\23\2\2\u00c1\u00c2\7>\2\2\u00c2\u00c3\7\f\2\2\u00c3\u00cf")
|
127
|
+
buf.write("\7\13\2\2\u00c4\u00d0\3\2\2\2\u00c5\u00c6\7\16\2\2\u00c6")
|
128
|
+
buf.write("\u00d0\7>\2\2\u00c7\u00c8\7\r\2\2\u00c8\u00d0\5\66\34")
|
129
|
+
buf.write("\2\u00c9\u00ca\7\r\2\2\u00ca\u00cb\7\17\2\2\u00cb\u00cc")
|
130
|
+
buf.write("\7\20\2\2\u00cc\u00cd\5.\30\2\u00cd\u00ce\7\21\2\2\u00ce")
|
131
|
+
buf.write("\u00d0\3\2\2\2\u00cf\u00c4\3\2\2\2\u00cf\u00c5\3\2\2\2")
|
132
|
+
buf.write("\u00cf\u00c7\3\2\2\2\u00cf\u00c9\3\2\2\2\u00d0\u00d1\3")
|
133
|
+
buf.write("\2\2\2\u00d1\u00f3\7\7\2\2\u00d2\u00d3\7\23\2\2\u00d3")
|
134
|
+
buf.write("\u00d4\7\24\2\2\u00d4\u00d5\7\f\2\2\u00d5\u00df\7>\2\2")
|
135
|
+
buf.write("\u00d6\u00e0\3\2\2\2\u00d7\u00d8\t\3\2\2\u00d8\u00e0\5")
|
136
|
+
buf.write("\66\34\2\u00d9\u00da\7\r\2\2\u00da\u00db\7\17\2\2\u00db")
|
137
|
+
buf.write("\u00dc\7\20\2\2\u00dc\u00dd\5.\30\2\u00dd\u00de\7\21\2")
|
138
|
+
buf.write("\2\u00de\u00e0\3\2\2\2\u00df\u00d6\3\2\2\2\u00df\u00d7")
|
139
|
+
buf.write("\3\2\2\2\u00df\u00d9\3\2\2\2\u00e0\u00e1\3\2\2\2\u00e1")
|
140
|
+
buf.write("\u00f3\7\7\2\2\u00e2\u00e3\7\23\2\2\u00e3\u00e4\7\24\2")
|
141
|
+
buf.write("\2\u00e4\u00e5\7\f\2\2\u00e5\u00ef\7\13\2\2\u00e6\u00f0")
|
142
|
+
buf.write("\3\2\2\2\u00e7\u00e8\t\3\2\2\u00e8\u00f0\5\66\34\2\u00e9")
|
143
|
+
buf.write("\u00ea\7\r\2\2\u00ea\u00eb\7\17\2\2\u00eb\u00ec\7\20\2")
|
144
|
+
buf.write("\2\u00ec\u00ed\5.\30\2\u00ed\u00ee\7\21\2\2\u00ee\u00f0")
|
145
|
+
buf.write("\3\2\2\2\u00ef\u00e6\3\2\2\2\u00ef\u00e7\3\2\2\2\u00ef")
|
146
|
+
buf.write("\u00e9\3\2\2\2\u00f0\u00f1\3\2\2\2\u00f1\u00f3\7\7\2\2")
|
147
|
+
buf.write("\u00f2\u00ae\3\2\2\2\u00f2\u00c0\3\2\2\2\u00f2\u00d2\3")
|
148
|
+
buf.write("\2\2\2\u00f2\u00e2\3\2\2\2\u00f3\r\3\2\2\2\u00f4\u00f6")
|
149
|
+
buf.write("\7\25\2\2\u00f5\u00f7\7>\2\2\u00f6\u00f5\3\2\2\2\u00f6")
|
150
|
+
buf.write("\u00f7\3\2\2\2\u00f7\u00f8\3\2\2\2\u00f8\u00fc\7\t\2\2")
|
151
|
+
buf.write("\u00f9\u00fb\5\30\r\2\u00fa\u00f9\3\2\2\2\u00fb\u00fe")
|
152
|
+
buf.write("\3\2\2\2\u00fc\u00fa\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fd")
|
153
|
+
buf.write("\u00ff\3\2\2\2\u00fe\u00fc\3\2\2\2\u00ff\u010b\7\n\2\2")
|
154
|
+
buf.write("\u0100\u0101\7\25\2\2\u0101\u0102\7\26\2\2\u0102\u0103")
|
155
|
+
buf.write("\7>\2\2\u0103\u010b\7\7\2\2\u0104\u0105\7\25\2\2\u0105")
|
156
|
+
buf.write("\u0107\7\26\2\2\u0106\u0108\7>\2\2\u0107\u0106\3\2\2\2")
|
157
|
+
buf.write("\u0107\u0108\3\2\2\2\u0108\u0109\3\2\2\2\u0109\u010b\7")
|
158
|
+
buf.write("A\2\2\u010a\u00f4\3\2\2\2\u010a\u0100\3\2\2\2\u010a\u0104")
|
159
|
+
buf.write("\3\2\2\2\u010b\17\3\2\2\2\u010c\u010e\7\27\2\2\u010d\u010f")
|
160
|
+
buf.write("\7>\2\2\u010e\u010d\3\2\2\2\u010e\u010f\3\2\2\2\u010f")
|
161
|
+
buf.write("\u0110\3\2\2\2\u0110\u0114\7\t\2\2\u0111\u0113\5\30\r")
|
162
|
+
buf.write("\2\u0112\u0111\3\2\2\2\u0113\u0116\3\2\2\2\u0114\u0112")
|
163
|
+
buf.write("\3\2\2\2\u0114\u0115\3\2\2\2\u0115\u0117\3\2\2\2\u0116")
|
164
|
+
buf.write("\u0114\3\2\2\2\u0117\u0123\7\n\2\2\u0118\u0119\7\27\2")
|
165
|
+
buf.write("\2\u0119\u011a\7\26\2\2\u011a\u011b\7>\2\2\u011b\u0123")
|
166
|
+
buf.write("\7\7\2\2\u011c\u011d\7\27\2\2\u011d\u011f\7\26\2\2\u011e")
|
167
|
+
buf.write("\u0120\7>\2\2\u011f\u011e\3\2\2\2\u011f\u0120\3\2\2\2")
|
168
|
+
buf.write("\u0120\u0121\3\2\2\2\u0121\u0123\7A\2\2\u0122\u010c\3")
|
169
|
+
buf.write("\2\2\2\u0122\u0118\3\2\2\2\u0122\u011c\3\2\2\2\u0123\21")
|
170
|
+
buf.write("\3\2\2\2\u0124\u0126\7\30\2\2\u0125\u0127\t\4\2\2\u0126")
|
171
|
+
buf.write("\u0125\3\2\2\2\u0126\u0127\3\2\2\2\u0127\u0129\3\2\2\2")
|
172
|
+
buf.write("\u0128\u012a\7>\2\2\u0129\u0128\3\2\2\2\u0129\u012a\3")
|
173
|
+
buf.write("\2\2\2\u012a\u012b\3\2\2\2\u012b\u012f\7\t\2\2\u012c\u012e")
|
174
|
+
buf.write("\5\30\r\2\u012d\u012c\3\2\2\2\u012e\u0131\3\2\2\2\u012f")
|
175
|
+
buf.write("\u012d\3\2\2\2\u012f\u0130\3\2\2\2\u0130\u0132\3\2\2\2")
|
176
|
+
buf.write("\u0131\u012f\3\2\2\2\u0132\u0144\7\n\2\2\u0133\u0135\7")
|
177
|
+
buf.write("\30\2\2\u0134\u0136\t\4\2\2\u0135\u0134\3\2\2\2\u0135")
|
178
|
+
buf.write("\u0136\3\2\2\2\u0136\u0137\3\2\2\2\u0137\u0138\7\26\2")
|
179
|
+
buf.write("\2\u0138\u0139\7>\2\2\u0139\u0144\7\7\2\2\u013a\u013c")
|
180
|
+
buf.write("\7\30\2\2\u013b\u013d\t\4\2\2\u013c\u013b\3\2\2\2\u013c")
|
181
|
+
buf.write("\u013d\3\2\2\2\u013d\u013e\3\2\2\2\u013e\u0140\7\26\2")
|
182
|
+
buf.write("\2\u013f\u0141\7>\2\2\u0140\u013f\3\2\2\2\u0140\u0141")
|
183
|
+
buf.write("\3\2\2\2\u0141\u0142\3\2\2\2\u0142\u0144\7A\2\2\u0143")
|
184
|
+
buf.write("\u0124\3\2\2\2\u0143\u0133\3\2\2\2\u0143\u013a\3\2\2\2")
|
185
|
+
buf.write("\u0144\23\3\2\2\2\u0145\u0146\7\33\2\2\u0146\u0147\7\30")
|
186
|
+
buf.write("\2\2\u0147\u0149\t\4\2\2\u0148\u014a\7>\2\2\u0149\u0148")
|
187
|
+
buf.write("\3\2\2\2\u0149\u014a\3\2\2\2\u014a\u014b\3\2\2\2\u014b")
|
188
|
+
buf.write("\u014f\7\t\2\2\u014c\u014e\5\30\r\2\u014d\u014c\3\2\2")
|
189
|
+
buf.write("\2\u014e\u0151\3\2\2\2\u014f\u014d\3\2\2\2\u014f\u0150")
|
190
|
+
buf.write("\3\2\2\2\u0150\u0152\3\2\2\2\u0151\u014f\3\2\2\2\u0152")
|
191
|
+
buf.write("\u0162\7\n\2\2\u0153\u0154\7\33\2\2\u0154\u0155\7\30\2")
|
192
|
+
buf.write("\2\u0155\u0156\t\4\2\2\u0156\u0157\7\26\2\2\u0157\u0158")
|
193
|
+
buf.write("\7>\2\2\u0158\u0162\7\7\2\2\u0159\u015a\7\33\2\2\u015a")
|
194
|
+
buf.write("\u015b\7\30\2\2\u015b\u015c\t\4\2\2\u015c\u015e\7\26\2")
|
195
|
+
buf.write("\2\u015d\u015f\7>\2\2\u015e\u015d\3\2\2\2\u015e\u015f")
|
196
|
+
buf.write("\3\2\2\2\u015f\u0160\3\2\2\2\u0160\u0162\7A\2\2\u0161")
|
197
|
+
buf.write("\u0145\3\2\2\2\u0161\u0153\3\2\2\2\u0161\u0159\3\2\2\2")
|
198
|
+
buf.write("\u0162\25\3\2\2\2\u0163\u0164\7>\2\2\u0164\u0165\7\6\2")
|
199
|
+
buf.write("\2\u0165\u0166\5,\27\2\u0166\u0167\7\7\2\2\u0167\27\3")
|
200
|
+
buf.write("\2\2\2\u0168\u016b\5\26\f\2\u0169\u016b\7\7\2\2\u016a")
|
201
|
+
buf.write("\u0168\3\2\2\2\u016a\u0169\3\2\2\2\u016b\31\3\2\2\2\u016c")
|
202
|
+
buf.write("\u0175\5\b\5\2\u016d\u0175\5\n\6\2\u016e\u0175\5\f\7\2")
|
203
|
+
buf.write("\u016f\u0175\5\16\b\2\u0170\u0175\5\22\n\2\u0171\u0175")
|
204
|
+
buf.write("\5\20\t\2\u0172\u0175\5\24\13\2\u0173\u0175\7\7\2\2\u0174")
|
205
|
+
buf.write("\u016c\3\2\2\2\u0174\u016d\3\2\2\2\u0174\u016e\3\2\2\2")
|
206
|
+
buf.write("\u0174\u016f\3\2\2\2\u0174\u0170\3\2\2\2\u0174\u0171\3")
|
207
|
+
buf.write("\2\2\2\u0174\u0172\3\2\2\2\u0174\u0173\3\2\2\2\u0175\33")
|
208
|
+
buf.write("\3\2\2\2\u0176\u0178\5&\24\2\u0177\u0176\3\2\2\2\u0178")
|
209
|
+
buf.write("\u017b\3\2\2\2\u0179\u0177\3\2\2\2\u0179\u017a\3\2\2\2")
|
210
|
+
buf.write("\u017a\u017c\3\2\2\2\u017b\u0179\3\2\2\2\u017c\u017d\7")
|
211
|
+
buf.write("\2\2\3\u017d\35\3\2\2\2\u017e\u0180\5 \21\2\u017f\u017e")
|
212
|
+
buf.write("\3\2\2\2\u0180\u0183\3\2\2\2\u0181\u017f\3\2\2\2\u0181")
|
213
|
+
buf.write("\u0182\3\2\2\2\u0182\u0184\3\2\2\2\u0183\u0181\3\2\2\2")
|
214
|
+
buf.write('\u0184\u0185\7\2\2\3\u0185\37\3\2\2\2\u0186\u0189\5"')
|
215
|
+
buf.write("\22\2\u0187\u0189\5$\23\2\u0188\u0186\3\2\2\2\u0188\u0187")
|
216
|
+
buf.write("\3\2\2\2\u0189!\3\2\2\2\u018a\u018b\7>\2\2\u018b\u018c")
|
217
|
+
buf.write("\7\34\2\2\u018c\u018d\5*\26\2\u018d\u018e\7\7\2\2\u018e")
|
218
|
+
buf.write("#\3\2\2\2\u018f\u0190\7>\2\2\u0190\u0191\7\6\2\2\u0191")
|
219
|
+
buf.write("\u0192\5*\26\2\u0192\u0193\7\7\2\2\u0193%\3\2\2\2\u0194")
|
220
|
+
buf.write("\u0195\7>\2\2\u0195\u0196\7\34\2\2\u0196\u0197\5,\27\2")
|
221
|
+
buf.write("\u0197\u0198\7\7\2\2\u0198'\3\2\2\2\u0199\u019c\5,\27")
|
222
|
+
buf.write("\2\u019a\u019c\5.\30\2\u019b\u0199\3\2\2\2\u019b\u019a")
|
223
|
+
buf.write("\3\2\2\2\u019c)\3\2\2\2\u019d\u019e\b\26\1\2\u019e\u019f")
|
224
|
+
buf.write("\7\35\2\2\u019f\u01a0\5*\26\2\u01a0\u01a1\7\36\2\2\u01a1")
|
225
|
+
buf.write("\u01ac\3\2\2\2\u01a2\u01ac\5\60\31\2\u01a3\u01ac\5\64")
|
226
|
+
buf.write("\33\2\u01a4\u01a5\t\5\2\2\u01a5\u01ac\5*\26\13\u01a6\u01a7")
|
227
|
+
buf.write("\7=\2\2\u01a7\u01a8\7\35\2\2\u01a8\u01a9\5*\26\2\u01a9")
|
228
|
+
buf.write("\u01aa\7\36\2\2\u01aa\u01ac\3\2\2\2\u01ab\u019d\3\2\2")
|
229
|
+
buf.write("\2\u01ab\u01a2\3\2\2\2\u01ab\u01a3\3\2\2\2\u01ab\u01a4")
|
230
|
+
buf.write("\3\2\2\2\u01ab\u01a6\3\2\2\2\u01ac\u01c4\3\2\2\2\u01ad")
|
231
|
+
buf.write("\u01ae\f\n\2\2\u01ae\u01af\7!\2\2\u01af\u01c3\5*\26\n")
|
232
|
+
buf.write("\u01b0\u01b1\f\t\2\2\u01b1\u01b2\t\6\2\2\u01b2\u01c3\5")
|
233
|
+
buf.write("*\26\n\u01b3\u01b4\f\b\2\2\u01b4\u01b5\t\5\2\2\u01b5\u01c3")
|
234
|
+
buf.write("\5*\26\t\u01b6\u01b7\f\7\2\2\u01b7\u01b8\t\7\2\2\u01b8")
|
235
|
+
buf.write("\u01c3\5*\26\b\u01b9\u01ba\f\6\2\2\u01ba\u01bb\7%\2\2")
|
236
|
+
buf.write("\u01bb\u01c3\5*\26\7\u01bc\u01bd\f\5\2\2\u01bd\u01be\7")
|
237
|
+
buf.write("&\2\2\u01be\u01c3\5*\26\6\u01bf\u01c0\f\4\2\2\u01c0\u01c1")
|
238
|
+
buf.write("\7'\2\2\u01c1\u01c3\5*\26\5\u01c2\u01ad\3\2\2\2\u01c2")
|
239
|
+
buf.write("\u01b0\3\2\2\2\u01c2\u01b3\3\2\2\2\u01c2\u01b6\3\2\2\2")
|
240
|
+
buf.write("\u01c2\u01b9\3\2\2\2\u01c2\u01bc\3\2\2\2\u01c2\u01bf\3")
|
241
|
+
buf.write("\2\2\2\u01c3\u01c6\3\2\2\2\u01c4\u01c2\3\2\2\2\u01c4\u01c5")
|
242
|
+
buf.write("\3\2\2\2\u01c5+\3\2\2\2\u01c6\u01c4\3\2\2\2\u01c7\u01c8")
|
243
|
+
buf.write("\b\27\1\2\u01c8\u01c9\7\35\2\2\u01c9\u01ca\5,\27\2\u01ca")
|
244
|
+
buf.write("\u01cb\7\36\2\2\u01cb\u01df\3\2\2\2\u01cc\u01df\5\60\31")
|
245
|
+
buf.write("\2\u01cd\u01df\7>\2\2\u01ce\u01df\5\64\33\2\u01cf\u01d0")
|
246
|
+
buf.write("\t\5\2\2\u01d0\u01df\5,\27\f\u01d1\u01d2\7=\2\2\u01d2")
|
247
|
+
buf.write("\u01d3\7\35\2\2\u01d3\u01d4\5,\27\2\u01d4\u01d5\7\36\2")
|
248
|
+
buf.write("\2\u01d5\u01df\3\2\2\2\u01d6\u01d7\7\35\2\2\u01d7\u01d8")
|
249
|
+
buf.write("\5.\30\2\u01d8\u01d9\7\36\2\2\u01d9\u01da\7(\2\2\u01da")
|
250
|
+
buf.write("\u01db\5,\27\2\u01db\u01dc\7\r\2\2\u01dc\u01dd\5,\27\3")
|
251
|
+
buf.write("\u01dd\u01df\3\2\2\2\u01de\u01c7\3\2\2\2\u01de\u01cc\3")
|
252
|
+
buf.write("\2\2\2\u01de\u01cd\3\2\2\2\u01de\u01ce\3\2\2\2\u01de\u01cf")
|
253
|
+
buf.write("\3\2\2\2\u01de\u01d1\3\2\2\2\u01de\u01d6\3\2\2\2\u01df")
|
254
|
+
buf.write("\u01f7\3\2\2\2\u01e0\u01e1\f\13\2\2\u01e1\u01e2\7!\2\2")
|
255
|
+
buf.write("\u01e2\u01f6\5,\27\13\u01e3\u01e4\f\n\2\2\u01e4\u01e5")
|
256
|
+
buf.write("\t\6\2\2\u01e5\u01f6\5,\27\13\u01e6\u01e7\f\t\2\2\u01e7")
|
257
|
+
buf.write("\u01e8\t\5\2\2\u01e8\u01f6\5,\27\n\u01e9\u01ea\f\b\2\2")
|
258
|
+
buf.write("\u01ea\u01eb\t\7\2\2\u01eb\u01f6\5,\27\t\u01ec\u01ed\f")
|
259
|
+
buf.write("\7\2\2\u01ed\u01ee\7%\2\2\u01ee\u01f6\5,\27\b\u01ef\u01f0")
|
260
|
+
buf.write("\f\6\2\2\u01f0\u01f1\7&\2\2\u01f1\u01f6\5,\27\7\u01f2")
|
261
|
+
buf.write("\u01f3\f\5\2\2\u01f3\u01f4\7'\2\2\u01f4\u01f6\5,\27\6")
|
262
|
+
buf.write("\u01f5\u01e0\3\2\2\2\u01f5\u01e3\3\2\2\2\u01f5\u01e6\3")
|
263
|
+
buf.write("\2\2\2\u01f5\u01e9\3\2\2\2\u01f5\u01ec\3\2\2\2\u01f5\u01ef")
|
264
|
+
buf.write("\3\2\2\2\u01f5\u01f2\3\2\2\2\u01f6\u01f9\3\2\2\2\u01f7")
|
265
|
+
buf.write("\u01f5\3\2\2\2\u01f7\u01f8\3\2\2\2\u01f8-\3\2\2\2\u01f9")
|
266
|
+
buf.write("\u01f7\3\2\2\2\u01fa\u01fb\b\30\1\2\u01fb\u01fc\7\35\2")
|
267
|
+
buf.write("\2\u01fc\u01fd\5.\30\2\u01fd\u01fe\7\36\2\2\u01fe\u0213")
|
268
|
+
buf.write("\3\2\2\2\u01ff\u0213\5\62\32\2\u0200\u0201\t\b\2\2\u0201")
|
269
|
+
buf.write("\u0213\5.\30\t\u0202\u0203\5,\27\2\u0203\u0204\t\t\2\2")
|
270
|
+
buf.write("\u0204\u0205\5,\27\2\u0205\u0213\3\2\2\2\u0206\u0207\5")
|
271
|
+
buf.write(",\27\2\u0207\u0208\t\n\2\2\u0208\u0209\5,\27\2\u0209\u0213")
|
272
|
+
buf.write("\3\2\2\2\u020a\u020b\7\35\2\2\u020b\u020c\5.\30\2\u020c")
|
273
|
+
buf.write("\u020d\7\36\2\2\u020d\u020e\7(\2\2\u020e\u020f\5.\30\2")
|
274
|
+
buf.write("\u020f\u0210\7\r\2\2\u0210\u0211\5.\30\3\u0211\u0213\3")
|
275
|
+
buf.write("\2\2\2\u0212\u01fa\3\2\2\2\u0212\u01ff\3\2\2\2\u0212\u0200")
|
276
|
+
buf.write("\3\2\2\2\u0212\u0202\3\2\2\2\u0212\u0206\3\2\2\2\u0212")
|
277
|
+
buf.write("\u020a\3\2\2\2\u0213\u021f\3\2\2\2\u0214\u0215\f\6\2\2")
|
278
|
+
buf.write("\u0215\u0216\t\n\2\2\u0216\u021e\5.\30\7\u0217\u0218\f")
|
279
|
+
buf.write("\5\2\2\u0218\u0219\t\13\2\2\u0219\u021e\5.\30\6\u021a")
|
280
|
+
buf.write("\u021b\f\4\2\2\u021b\u021c\t\f\2\2\u021c\u021e\5.\30\5")
|
281
|
+
buf.write("\u021d\u0214\3\2\2\2\u021d\u0217\3\2\2\2\u021d\u021a\3")
|
282
|
+
buf.write("\2\2\2\u021e\u0221\3\2\2\2\u021f\u021d\3\2\2\2\u021f\u0220")
|
283
|
+
buf.write("\3\2\2\2\u0220/\3\2\2\2\u0221\u021f\3\2\2\2\u0222\u0223")
|
284
|
+
buf.write("\t\r\2\2\u0223\61\3\2\2\2\u0224\u0225\t\16\2\2\u0225\63")
|
285
|
+
buf.write("\3\2\2\2\u0226\u0227\t\17\2\2\u0227\65\3\2\2\2\u0228\u022a")
|
286
|
+
buf.write('\7"\2\2\u0229\u0228\3\2\2\2\u0229\u022a\3\2\2\2\u022a')
|
287
|
+
buf.write("\u022b\3\2\2\2\u022b\u0230\7>\2\2\u022c\u022d\7\67\2\2")
|
288
|
+
buf.write("\u022d\u022f\7>\2\2\u022e\u022c\3\2\2\2\u022f\u0232\3")
|
289
|
+
buf.write("\2\2\2\u0230\u022e\3\2\2\2\u0230\u0231\3\2\2\2\u0231\67")
|
290
|
+
buf.write("\3\2\2\2\u0232\u0230\3\2\2\28>TXfnr\u0082\u008a\u008e")
|
291
|
+
buf.write("\u009e\u00a6\u00aa\u00ac\u00bd\u00cf\u00df\u00ef\u00f2")
|
292
|
+
buf.write("\u00f6\u00fc\u0107\u010a\u010e\u0114\u011f\u0122\u0126")
|
293
|
+
buf.write("\u0129\u012f\u0135\u013c\u0140\u0143\u0149\u014f\u015e")
|
294
|
+
buf.write("\u0161\u016a\u0174\u0179\u0181\u0188\u019b\u01ab\u01c2")
|
295
|
+
buf.write("\u01c4\u01de\u01f5\u01f7\u0212\u021d\u021f\u0229\u0230")
|
296
|
+
return buf.getvalue()
|
297
|
+
|
298
|
+
|
299
|
+
class GrammarParser(Parser):
|
300
|
+
grammarFileName = "Grammar.g4"
|
301
|
+
|
302
|
+
atn = ATNDeserializer().deserialize(serializedATN())
|
303
|
+
|
304
|
+
decisionsToDFA = [DFA(ds, i) for i, ds in enumerate(atn.decisionToState)]
|
305
|
+
|
306
|
+
sharedContextCache = PredictionContextCache()
|
307
|
+
|
308
|
+
literalNames = [
|
309
|
+
"<INVALID>",
|
310
|
+
"'def'",
|
311
|
+
"'int'",
|
312
|
+
"'float'",
|
313
|
+
"'='",
|
314
|
+
"';'",
|
315
|
+
"'state'",
|
316
|
+
"'{'",
|
317
|
+
"'}'",
|
318
|
+
"'[*]'",
|
319
|
+
"'->'",
|
320
|
+
"':'",
|
321
|
+
"'::'",
|
322
|
+
"'if'",
|
323
|
+
"'['",
|
324
|
+
"']'",
|
325
|
+
"'effect'",
|
326
|
+
"'!'",
|
327
|
+
"'*'",
|
328
|
+
"'enter'",
|
329
|
+
"'abstract'",
|
330
|
+
"'exit'",
|
331
|
+
"'during'",
|
332
|
+
"'before'",
|
333
|
+
"'after'",
|
334
|
+
"'>>'",
|
335
|
+
"':='",
|
336
|
+
"'('",
|
337
|
+
"')'",
|
338
|
+
"'+'",
|
339
|
+
"'-'",
|
340
|
+
"'**'",
|
341
|
+
"'/'",
|
342
|
+
"'%'",
|
343
|
+
"'<<'",
|
344
|
+
"'&'",
|
345
|
+
"'^'",
|
346
|
+
"'|'",
|
347
|
+
"'?'",
|
348
|
+
"'not'",
|
349
|
+
"'<'",
|
350
|
+
"'>'",
|
351
|
+
"'<='",
|
352
|
+
"'>='",
|
353
|
+
"'=='",
|
354
|
+
"'!='",
|
355
|
+
"'&&'",
|
356
|
+
"'and'",
|
357
|
+
"'||'",
|
358
|
+
"'or'",
|
359
|
+
"'pi'",
|
360
|
+
"'E'",
|
361
|
+
"'tau'",
|
362
|
+
"'.'",
|
363
|
+
]
|
364
|
+
|
365
|
+
symbolicNames = [
|
366
|
+
"<INVALID>",
|
367
|
+
"<INVALID>",
|
368
|
+
"<INVALID>",
|
369
|
+
"<INVALID>",
|
370
|
+
"<INVALID>",
|
371
|
+
"<INVALID>",
|
372
|
+
"<INVALID>",
|
373
|
+
"<INVALID>",
|
374
|
+
"<INVALID>",
|
375
|
+
"<INVALID>",
|
376
|
+
"<INVALID>",
|
377
|
+
"<INVALID>",
|
378
|
+
"<INVALID>",
|
379
|
+
"<INVALID>",
|
380
|
+
"<INVALID>",
|
381
|
+
"<INVALID>",
|
382
|
+
"<INVALID>",
|
383
|
+
"<INVALID>",
|
384
|
+
"<INVALID>",
|
385
|
+
"<INVALID>",
|
386
|
+
"<INVALID>",
|
387
|
+
"<INVALID>",
|
388
|
+
"<INVALID>",
|
389
|
+
"<INVALID>",
|
390
|
+
"<INVALID>",
|
391
|
+
"<INVALID>",
|
392
|
+
"<INVALID>",
|
393
|
+
"<INVALID>",
|
394
|
+
"<INVALID>",
|
395
|
+
"<INVALID>",
|
396
|
+
"<INVALID>",
|
397
|
+
"<INVALID>",
|
398
|
+
"<INVALID>",
|
399
|
+
"<INVALID>",
|
400
|
+
"<INVALID>",
|
401
|
+
"<INVALID>",
|
402
|
+
"<INVALID>",
|
403
|
+
"<INVALID>",
|
404
|
+
"<INVALID>",
|
405
|
+
"<INVALID>",
|
406
|
+
"<INVALID>",
|
407
|
+
"<INVALID>",
|
408
|
+
"<INVALID>",
|
409
|
+
"<INVALID>",
|
410
|
+
"<INVALID>",
|
411
|
+
"<INVALID>",
|
412
|
+
"<INVALID>",
|
413
|
+
"<INVALID>",
|
414
|
+
"<INVALID>",
|
415
|
+
"<INVALID>",
|
416
|
+
"<INVALID>",
|
417
|
+
"<INVALID>",
|
418
|
+
"<INVALID>",
|
419
|
+
"<INVALID>",
|
420
|
+
"FLOAT",
|
421
|
+
"INT",
|
422
|
+
"HEX_INT",
|
423
|
+
"TRUE",
|
424
|
+
"FALSE",
|
425
|
+
"UFUNC_NAME",
|
426
|
+
"ID",
|
427
|
+
"STRING",
|
428
|
+
"WS",
|
429
|
+
"MULTILINE_COMMENT",
|
430
|
+
"LINE_COMMENT",
|
431
|
+
"PYTHON_COMMENT",
|
432
|
+
]
|
433
|
+
|
434
|
+
RULE_condition = 0
|
435
|
+
RULE_state_machine_dsl = 1
|
436
|
+
RULE_def_assignment = 2
|
437
|
+
RULE_state_definition = 3
|
438
|
+
RULE_transition_definition = 4
|
439
|
+
RULE_transition_force_definition = 5
|
440
|
+
RULE_enter_definition = 6
|
441
|
+
RULE_exit_definition = 7
|
442
|
+
RULE_during_definition = 8
|
443
|
+
RULE_during_aspect_definition = 9
|
444
|
+
RULE_operation_assignment = 10
|
445
|
+
RULE_operational_statement = 11
|
446
|
+
RULE_state_inner_statement = 12
|
447
|
+
RULE_operation_program = 13
|
448
|
+
RULE_preamble_program = 14
|
449
|
+
RULE_preamble_statement = 15
|
450
|
+
RULE_initial_assignment = 16
|
451
|
+
RULE_constant_definition = 17
|
452
|
+
RULE_operational_assignment = 18
|
453
|
+
RULE_generic_expression = 19
|
454
|
+
RULE_init_expression = 20
|
455
|
+
RULE_num_expression = 21
|
456
|
+
RULE_cond_expression = 22
|
457
|
+
RULE_num_literal = 23
|
458
|
+
RULE_bool_literal = 24
|
459
|
+
RULE_math_const = 25
|
460
|
+
RULE_chain_id = 26
|
461
|
+
|
462
|
+
ruleNames = [
|
463
|
+
"condition",
|
464
|
+
"state_machine_dsl",
|
465
|
+
"def_assignment",
|
466
|
+
"state_definition",
|
467
|
+
"transition_definition",
|
468
|
+
"transition_force_definition",
|
469
|
+
"enter_definition",
|
470
|
+
"exit_definition",
|
471
|
+
"during_definition",
|
472
|
+
"during_aspect_definition",
|
473
|
+
"operation_assignment",
|
474
|
+
"operational_statement",
|
475
|
+
"state_inner_statement",
|
476
|
+
"operation_program",
|
477
|
+
"preamble_program",
|
478
|
+
"preamble_statement",
|
479
|
+
"initial_assignment",
|
480
|
+
"constant_definition",
|
481
|
+
"operational_assignment",
|
482
|
+
"generic_expression",
|
483
|
+
"init_expression",
|
484
|
+
"num_expression",
|
485
|
+
"cond_expression",
|
486
|
+
"num_literal",
|
487
|
+
"bool_literal",
|
488
|
+
"math_const",
|
489
|
+
"chain_id",
|
490
|
+
]
|
491
|
+
|
492
|
+
EOF = Token.EOF
|
493
|
+
T__0 = 1
|
494
|
+
T__1 = 2
|
495
|
+
T__2 = 3
|
496
|
+
T__3 = 4
|
497
|
+
T__4 = 5
|
498
|
+
T__5 = 6
|
499
|
+
T__6 = 7
|
500
|
+
T__7 = 8
|
501
|
+
T__8 = 9
|
502
|
+
T__9 = 10
|
503
|
+
T__10 = 11
|
504
|
+
T__11 = 12
|
505
|
+
T__12 = 13
|
506
|
+
T__13 = 14
|
507
|
+
T__14 = 15
|
508
|
+
T__15 = 16
|
509
|
+
T__16 = 17
|
510
|
+
T__17 = 18
|
511
|
+
T__18 = 19
|
512
|
+
T__19 = 20
|
513
|
+
T__20 = 21
|
514
|
+
T__21 = 22
|
515
|
+
T__22 = 23
|
516
|
+
T__23 = 24
|
517
|
+
T__24 = 25
|
518
|
+
T__25 = 26
|
519
|
+
T__26 = 27
|
520
|
+
T__27 = 28
|
521
|
+
T__28 = 29
|
522
|
+
T__29 = 30
|
523
|
+
T__30 = 31
|
524
|
+
T__31 = 32
|
525
|
+
T__32 = 33
|
526
|
+
T__33 = 34
|
527
|
+
T__34 = 35
|
528
|
+
T__35 = 36
|
529
|
+
T__36 = 37
|
530
|
+
T__37 = 38
|
531
|
+
T__38 = 39
|
532
|
+
T__39 = 40
|
533
|
+
T__40 = 41
|
534
|
+
T__41 = 42
|
535
|
+
T__42 = 43
|
536
|
+
T__43 = 44
|
537
|
+
T__44 = 45
|
538
|
+
T__45 = 46
|
539
|
+
T__46 = 47
|
540
|
+
T__47 = 48
|
541
|
+
T__48 = 49
|
542
|
+
T__49 = 50
|
543
|
+
T__50 = 51
|
544
|
+
T__51 = 52
|
545
|
+
T__52 = 53
|
546
|
+
FLOAT = 54
|
547
|
+
INT = 55
|
548
|
+
HEX_INT = 56
|
549
|
+
TRUE = 57
|
550
|
+
FALSE = 58
|
551
|
+
UFUNC_NAME = 59
|
552
|
+
ID = 60
|
553
|
+
STRING = 61
|
554
|
+
WS = 62
|
555
|
+
MULTILINE_COMMENT = 63
|
556
|
+
LINE_COMMENT = 64
|
557
|
+
PYTHON_COMMENT = 65
|
558
|
+
|
559
|
+
def __init__(self, input: TokenStream, output: TextIO = sys.stdout):
|
560
|
+
super().__init__(input, output)
|
561
|
+
self.checkVersion("4.9.3")
|
562
|
+
self._interp = ParserATNSimulator(
|
563
|
+
self, self.atn, self.decisionsToDFA, self.sharedContextCache
|
564
|
+
)
|
565
|
+
self._predicates = None
|
566
|
+
|
567
|
+
class ConditionContext(ParserRuleContext):
|
568
|
+
__slots__ = "parser"
|
569
|
+
|
570
|
+
def __init__(
|
571
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
572
|
+
):
|
573
|
+
super().__init__(parent, invokingState)
|
574
|
+
self.parser = parser
|
575
|
+
|
576
|
+
def cond_expression(self):
|
577
|
+
return self.getTypedRuleContext(GrammarParser.Cond_expressionContext, 0)
|
578
|
+
|
579
|
+
def EOF(self):
|
580
|
+
return self.getToken(GrammarParser.EOF, 0)
|
581
|
+
|
582
|
+
def getRuleIndex(self):
|
583
|
+
return GrammarParser.RULE_condition
|
584
|
+
|
585
|
+
def enterRule(self, listener: ParseTreeListener):
|
586
|
+
if hasattr(listener, "enterCondition"):
|
587
|
+
listener.enterCondition(self)
|
588
|
+
|
589
|
+
def exitRule(self, listener: ParseTreeListener):
|
590
|
+
if hasattr(listener, "exitCondition"):
|
591
|
+
listener.exitCondition(self)
|
592
|
+
|
593
|
+
def condition(self):
|
594
|
+
localctx = GrammarParser.ConditionContext(self, self._ctx, self.state)
|
595
|
+
self.enterRule(localctx, 0, self.RULE_condition)
|
596
|
+
try:
|
597
|
+
self.enterOuterAlt(localctx, 1)
|
598
|
+
self.state = 54
|
599
|
+
self.cond_expression(0)
|
600
|
+
self.state = 55
|
601
|
+
self.match(GrammarParser.EOF)
|
602
|
+
except RecognitionException as re:
|
603
|
+
localctx.exception = re
|
604
|
+
self._errHandler.reportError(self, re)
|
605
|
+
self._errHandler.recover(self, re)
|
606
|
+
finally:
|
607
|
+
self.exitRule()
|
608
|
+
return localctx
|
609
|
+
|
610
|
+
class State_machine_dslContext(ParserRuleContext):
|
611
|
+
__slots__ = "parser"
|
612
|
+
|
613
|
+
def __init__(
|
614
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
615
|
+
):
|
616
|
+
super().__init__(parent, invokingState)
|
617
|
+
self.parser = parser
|
618
|
+
|
619
|
+
def state_definition(self):
|
620
|
+
return self.getTypedRuleContext(GrammarParser.State_definitionContext, 0)
|
621
|
+
|
622
|
+
def EOF(self):
|
623
|
+
return self.getToken(GrammarParser.EOF, 0)
|
624
|
+
|
625
|
+
def def_assignment(self, i: int = None):
|
626
|
+
if i is None:
|
627
|
+
return self.getTypedRuleContexts(GrammarParser.Def_assignmentContext)
|
628
|
+
else:
|
629
|
+
return self.getTypedRuleContext(GrammarParser.Def_assignmentContext, i)
|
630
|
+
|
631
|
+
def getRuleIndex(self):
|
632
|
+
return GrammarParser.RULE_state_machine_dsl
|
633
|
+
|
634
|
+
def enterRule(self, listener: ParseTreeListener):
|
635
|
+
if hasattr(listener, "enterState_machine_dsl"):
|
636
|
+
listener.enterState_machine_dsl(self)
|
637
|
+
|
638
|
+
def exitRule(self, listener: ParseTreeListener):
|
639
|
+
if hasattr(listener, "exitState_machine_dsl"):
|
640
|
+
listener.exitState_machine_dsl(self)
|
641
|
+
|
642
|
+
def state_machine_dsl(self):
|
643
|
+
localctx = GrammarParser.State_machine_dslContext(self, self._ctx, self.state)
|
644
|
+
self.enterRule(localctx, 2, self.RULE_state_machine_dsl)
|
645
|
+
self._la = 0 # Token type
|
646
|
+
try:
|
647
|
+
self.enterOuterAlt(localctx, 1)
|
648
|
+
self.state = 60
|
649
|
+
self._errHandler.sync(self)
|
650
|
+
_la = self._input.LA(1)
|
651
|
+
while _la == GrammarParser.T__0:
|
652
|
+
self.state = 57
|
653
|
+
self.def_assignment()
|
654
|
+
self.state = 62
|
655
|
+
self._errHandler.sync(self)
|
656
|
+
_la = self._input.LA(1)
|
657
|
+
|
658
|
+
self.state = 63
|
659
|
+
self.state_definition()
|
660
|
+
self.state = 64
|
661
|
+
self.match(GrammarParser.EOF)
|
662
|
+
except RecognitionException as re:
|
663
|
+
localctx.exception = re
|
664
|
+
self._errHandler.reportError(self, re)
|
665
|
+
self._errHandler.recover(self, re)
|
666
|
+
finally:
|
667
|
+
self.exitRule()
|
668
|
+
return localctx
|
669
|
+
|
670
|
+
class Def_assignmentContext(ParserRuleContext):
|
671
|
+
__slots__ = "parser"
|
672
|
+
|
673
|
+
def __init__(
|
674
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
675
|
+
):
|
676
|
+
super().__init__(parent, invokingState)
|
677
|
+
self.parser = parser
|
678
|
+
self.deftype = None # Token
|
679
|
+
|
680
|
+
def ID(self):
|
681
|
+
return self.getToken(GrammarParser.ID, 0)
|
682
|
+
|
683
|
+
def init_expression(self):
|
684
|
+
return self.getTypedRuleContext(GrammarParser.Init_expressionContext, 0)
|
685
|
+
|
686
|
+
def getRuleIndex(self):
|
687
|
+
return GrammarParser.RULE_def_assignment
|
688
|
+
|
689
|
+
def enterRule(self, listener: ParseTreeListener):
|
690
|
+
if hasattr(listener, "enterDef_assignment"):
|
691
|
+
listener.enterDef_assignment(self)
|
692
|
+
|
693
|
+
def exitRule(self, listener: ParseTreeListener):
|
694
|
+
if hasattr(listener, "exitDef_assignment"):
|
695
|
+
listener.exitDef_assignment(self)
|
696
|
+
|
697
|
+
def def_assignment(self):
|
698
|
+
localctx = GrammarParser.Def_assignmentContext(self, self._ctx, self.state)
|
699
|
+
self.enterRule(localctx, 4, self.RULE_def_assignment)
|
700
|
+
self._la = 0 # Token type
|
701
|
+
try:
|
702
|
+
self.enterOuterAlt(localctx, 1)
|
703
|
+
self.state = 66
|
704
|
+
self.match(GrammarParser.T__0)
|
705
|
+
self.state = 67
|
706
|
+
localctx.deftype = self._input.LT(1)
|
707
|
+
_la = self._input.LA(1)
|
708
|
+
if not (_la == GrammarParser.T__1 or _la == GrammarParser.T__2):
|
709
|
+
localctx.deftype = self._errHandler.recoverInline(self)
|
710
|
+
else:
|
711
|
+
self._errHandler.reportMatch(self)
|
712
|
+
self.consume()
|
713
|
+
self.state = 68
|
714
|
+
self.match(GrammarParser.ID)
|
715
|
+
self.state = 69
|
716
|
+
self.match(GrammarParser.T__3)
|
717
|
+
self.state = 70
|
718
|
+
self.init_expression(0)
|
719
|
+
self.state = 71
|
720
|
+
self.match(GrammarParser.T__4)
|
721
|
+
except RecognitionException as re:
|
722
|
+
localctx.exception = re
|
723
|
+
self._errHandler.reportError(self, re)
|
724
|
+
self._errHandler.recover(self, re)
|
725
|
+
finally:
|
726
|
+
self.exitRule()
|
727
|
+
return localctx
|
728
|
+
|
729
|
+
class State_definitionContext(ParserRuleContext):
|
730
|
+
__slots__ = "parser"
|
731
|
+
|
732
|
+
def __init__(
|
733
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
734
|
+
):
|
735
|
+
super().__init__(parent, invokingState)
|
736
|
+
self.parser = parser
|
737
|
+
|
738
|
+
def getRuleIndex(self):
|
739
|
+
return GrammarParser.RULE_state_definition
|
740
|
+
|
741
|
+
def copyFrom(self, ctx: ParserRuleContext):
|
742
|
+
super().copyFrom(ctx)
|
743
|
+
|
744
|
+
class LeafStateDefinitionContext(State_definitionContext):
|
745
|
+
def __init__(
|
746
|
+
self, parser, ctx: ParserRuleContext
|
747
|
+
): # actually a GrammarParser.State_definitionContext
|
748
|
+
super().__init__(parser)
|
749
|
+
self.state_id = None # Token
|
750
|
+
self.copyFrom(ctx)
|
751
|
+
|
752
|
+
def ID(self):
|
753
|
+
return self.getToken(GrammarParser.ID, 0)
|
754
|
+
|
755
|
+
def enterRule(self, listener: ParseTreeListener):
|
756
|
+
if hasattr(listener, "enterLeafStateDefinition"):
|
757
|
+
listener.enterLeafStateDefinition(self)
|
758
|
+
|
759
|
+
def exitRule(self, listener: ParseTreeListener):
|
760
|
+
if hasattr(listener, "exitLeafStateDefinition"):
|
761
|
+
listener.exitLeafStateDefinition(self)
|
762
|
+
|
763
|
+
class CompositeStateDefinitionContext(State_definitionContext):
|
764
|
+
def __init__(
|
765
|
+
self, parser, ctx: ParserRuleContext
|
766
|
+
): # actually a GrammarParser.State_definitionContext
|
767
|
+
super().__init__(parser)
|
768
|
+
self.state_id = None # Token
|
769
|
+
self.copyFrom(ctx)
|
770
|
+
|
771
|
+
def ID(self):
|
772
|
+
return self.getToken(GrammarParser.ID, 0)
|
773
|
+
|
774
|
+
def state_inner_statement(self, i: int = None):
|
775
|
+
if i is None:
|
776
|
+
return self.getTypedRuleContexts(
|
777
|
+
GrammarParser.State_inner_statementContext
|
778
|
+
)
|
779
|
+
else:
|
780
|
+
return self.getTypedRuleContext(
|
781
|
+
GrammarParser.State_inner_statementContext, i
|
782
|
+
)
|
783
|
+
|
784
|
+
def enterRule(self, listener: ParseTreeListener):
|
785
|
+
if hasattr(listener, "enterCompositeStateDefinition"):
|
786
|
+
listener.enterCompositeStateDefinition(self)
|
787
|
+
|
788
|
+
def exitRule(self, listener: ParseTreeListener):
|
789
|
+
if hasattr(listener, "exitCompositeStateDefinition"):
|
790
|
+
listener.exitCompositeStateDefinition(self)
|
791
|
+
|
792
|
+
def state_definition(self):
|
793
|
+
localctx = GrammarParser.State_definitionContext(self, self._ctx, self.state)
|
794
|
+
self.enterRule(localctx, 6, self.RULE_state_definition)
|
795
|
+
self._la = 0 # Token type
|
796
|
+
try:
|
797
|
+
self.state = 86
|
798
|
+
self._errHandler.sync(self)
|
799
|
+
la_ = self._interp.adaptivePredict(self._input, 2, self._ctx)
|
800
|
+
if la_ == 1:
|
801
|
+
localctx = GrammarParser.LeafStateDefinitionContext(self, localctx)
|
802
|
+
self.enterOuterAlt(localctx, 1)
|
803
|
+
self.state = 73
|
804
|
+
self.match(GrammarParser.T__5)
|
805
|
+
self.state = 74
|
806
|
+
localctx.state_id = self.match(GrammarParser.ID)
|
807
|
+
self.state = 75
|
808
|
+
self.match(GrammarParser.T__4)
|
809
|
+
pass
|
810
|
+
|
811
|
+
elif la_ == 2:
|
812
|
+
localctx = GrammarParser.CompositeStateDefinitionContext(self, localctx)
|
813
|
+
self.enterOuterAlt(localctx, 2)
|
814
|
+
self.state = 76
|
815
|
+
self.match(GrammarParser.T__5)
|
816
|
+
self.state = 77
|
817
|
+
localctx.state_id = self.match(GrammarParser.ID)
|
818
|
+
self.state = 78
|
819
|
+
self.match(GrammarParser.T__6)
|
820
|
+
self.state = 82
|
821
|
+
self._errHandler.sync(self)
|
822
|
+
_la = self._input.LA(1)
|
823
|
+
while ((_la) & ~0x3F) == 0 and (
|
824
|
+
(1 << _la)
|
825
|
+
& (
|
826
|
+
(1 << GrammarParser.T__4)
|
827
|
+
| (1 << GrammarParser.T__5)
|
828
|
+
| (1 << GrammarParser.T__8)
|
829
|
+
| (1 << GrammarParser.T__16)
|
830
|
+
| (1 << GrammarParser.T__18)
|
831
|
+
| (1 << GrammarParser.T__20)
|
832
|
+
| (1 << GrammarParser.T__21)
|
833
|
+
| (1 << GrammarParser.T__24)
|
834
|
+
| (1 << GrammarParser.ID)
|
835
|
+
)
|
836
|
+
) != 0:
|
837
|
+
self.state = 79
|
838
|
+
self.state_inner_statement()
|
839
|
+
self.state = 84
|
840
|
+
self._errHandler.sync(self)
|
841
|
+
_la = self._input.LA(1)
|
842
|
+
|
843
|
+
self.state = 85
|
844
|
+
self.match(GrammarParser.T__7)
|
845
|
+
pass
|
846
|
+
|
847
|
+
except RecognitionException as re:
|
848
|
+
localctx.exception = re
|
849
|
+
self._errHandler.reportError(self, re)
|
850
|
+
self._errHandler.recover(self, re)
|
851
|
+
finally:
|
852
|
+
self.exitRule()
|
853
|
+
return localctx
|
854
|
+
|
855
|
+
class Transition_definitionContext(ParserRuleContext):
|
856
|
+
__slots__ = "parser"
|
857
|
+
|
858
|
+
def __init__(
|
859
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
860
|
+
):
|
861
|
+
super().__init__(parent, invokingState)
|
862
|
+
self.parser = parser
|
863
|
+
|
864
|
+
def getRuleIndex(self):
|
865
|
+
return GrammarParser.RULE_transition_definition
|
866
|
+
|
867
|
+
def copyFrom(self, ctx: ParserRuleContext):
|
868
|
+
super().copyFrom(ctx)
|
869
|
+
|
870
|
+
class NormalTransitionDefinitionContext(Transition_definitionContext):
|
871
|
+
def __init__(
|
872
|
+
self, parser, ctx: ParserRuleContext
|
873
|
+
): # actually a GrammarParser.Transition_definitionContext
|
874
|
+
super().__init__(parser)
|
875
|
+
self.from_state = None # Token
|
876
|
+
self.to_state = None # Token
|
877
|
+
self.from_id = None # Token
|
878
|
+
self.copyFrom(ctx)
|
879
|
+
|
880
|
+
def ID(self, i: int = None):
|
881
|
+
if i is None:
|
882
|
+
return self.getTokens(GrammarParser.ID)
|
883
|
+
else:
|
884
|
+
return self.getToken(GrammarParser.ID, i)
|
885
|
+
|
886
|
+
def chain_id(self):
|
887
|
+
return self.getTypedRuleContext(GrammarParser.Chain_idContext, 0)
|
888
|
+
|
889
|
+
def cond_expression(self):
|
890
|
+
return self.getTypedRuleContext(GrammarParser.Cond_expressionContext, 0)
|
891
|
+
|
892
|
+
def operational_statement(self, i: int = None):
|
893
|
+
if i is None:
|
894
|
+
return self.getTypedRuleContexts(
|
895
|
+
GrammarParser.Operational_statementContext
|
896
|
+
)
|
897
|
+
else:
|
898
|
+
return self.getTypedRuleContext(
|
899
|
+
GrammarParser.Operational_statementContext, i
|
900
|
+
)
|
901
|
+
|
902
|
+
def enterRule(self, listener: ParseTreeListener):
|
903
|
+
if hasattr(listener, "enterNormalTransitionDefinition"):
|
904
|
+
listener.enterNormalTransitionDefinition(self)
|
905
|
+
|
906
|
+
def exitRule(self, listener: ParseTreeListener):
|
907
|
+
if hasattr(listener, "exitNormalTransitionDefinition"):
|
908
|
+
listener.exitNormalTransitionDefinition(self)
|
909
|
+
|
910
|
+
class EntryTransitionDefinitionContext(Transition_definitionContext):
|
911
|
+
def __init__(
|
912
|
+
self, parser, ctx: ParserRuleContext
|
913
|
+
): # actually a GrammarParser.Transition_definitionContext
|
914
|
+
super().__init__(parser)
|
915
|
+
self.to_state = None # Token
|
916
|
+
self.copyFrom(ctx)
|
917
|
+
|
918
|
+
def ID(self):
|
919
|
+
return self.getToken(GrammarParser.ID, 0)
|
920
|
+
|
921
|
+
def chain_id(self):
|
922
|
+
return self.getTypedRuleContext(GrammarParser.Chain_idContext, 0)
|
923
|
+
|
924
|
+
def cond_expression(self):
|
925
|
+
return self.getTypedRuleContext(GrammarParser.Cond_expressionContext, 0)
|
926
|
+
|
927
|
+
def operational_statement(self, i: int = None):
|
928
|
+
if i is None:
|
929
|
+
return self.getTypedRuleContexts(
|
930
|
+
GrammarParser.Operational_statementContext
|
931
|
+
)
|
932
|
+
else:
|
933
|
+
return self.getTypedRuleContext(
|
934
|
+
GrammarParser.Operational_statementContext, i
|
935
|
+
)
|
936
|
+
|
937
|
+
def enterRule(self, listener: ParseTreeListener):
|
938
|
+
if hasattr(listener, "enterEntryTransitionDefinition"):
|
939
|
+
listener.enterEntryTransitionDefinition(self)
|
940
|
+
|
941
|
+
def exitRule(self, listener: ParseTreeListener):
|
942
|
+
if hasattr(listener, "exitEntryTransitionDefinition"):
|
943
|
+
listener.exitEntryTransitionDefinition(self)
|
944
|
+
|
945
|
+
class ExitTransitionDefinitionContext(Transition_definitionContext):
|
946
|
+
def __init__(
|
947
|
+
self, parser, ctx: ParserRuleContext
|
948
|
+
): # actually a GrammarParser.Transition_definitionContext
|
949
|
+
super().__init__(parser)
|
950
|
+
self.from_state = None # Token
|
951
|
+
self.from_id = None # Token
|
952
|
+
self.copyFrom(ctx)
|
953
|
+
|
954
|
+
def ID(self, i: int = None):
|
955
|
+
if i is None:
|
956
|
+
return self.getTokens(GrammarParser.ID)
|
957
|
+
else:
|
958
|
+
return self.getToken(GrammarParser.ID, i)
|
959
|
+
|
960
|
+
def chain_id(self):
|
961
|
+
return self.getTypedRuleContext(GrammarParser.Chain_idContext, 0)
|
962
|
+
|
963
|
+
def cond_expression(self):
|
964
|
+
return self.getTypedRuleContext(GrammarParser.Cond_expressionContext, 0)
|
965
|
+
|
966
|
+
def operational_statement(self, i: int = None):
|
967
|
+
if i is None:
|
968
|
+
return self.getTypedRuleContexts(
|
969
|
+
GrammarParser.Operational_statementContext
|
970
|
+
)
|
971
|
+
else:
|
972
|
+
return self.getTypedRuleContext(
|
973
|
+
GrammarParser.Operational_statementContext, i
|
974
|
+
)
|
975
|
+
|
976
|
+
def enterRule(self, listener: ParseTreeListener):
|
977
|
+
if hasattr(listener, "enterExitTransitionDefinition"):
|
978
|
+
listener.enterExitTransitionDefinition(self)
|
979
|
+
|
980
|
+
def exitRule(self, listener: ParseTreeListener):
|
981
|
+
if hasattr(listener, "exitExitTransitionDefinition"):
|
982
|
+
listener.exitExitTransitionDefinition(self)
|
983
|
+
|
984
|
+
def transition_definition(self):
|
985
|
+
localctx = GrammarParser.Transition_definitionContext(
|
986
|
+
self, self._ctx, self.state
|
987
|
+
)
|
988
|
+
self.enterRule(localctx, 8, self.RULE_transition_definition)
|
989
|
+
self._la = 0 # Token type
|
990
|
+
try:
|
991
|
+
self.state = 170
|
992
|
+
self._errHandler.sync(self)
|
993
|
+
la_ = self._interp.adaptivePredict(self._input, 12, self._ctx)
|
994
|
+
if la_ == 1:
|
995
|
+
localctx = GrammarParser.EntryTransitionDefinitionContext(
|
996
|
+
self, localctx
|
997
|
+
)
|
998
|
+
self.enterOuterAlt(localctx, 1)
|
999
|
+
self.state = 88
|
1000
|
+
self.match(GrammarParser.T__8)
|
1001
|
+
self.state = 89
|
1002
|
+
self.match(GrammarParser.T__9)
|
1003
|
+
self.state = 90
|
1004
|
+
localctx.to_state = self.match(GrammarParser.ID)
|
1005
|
+
self.state = 100
|
1006
|
+
self._errHandler.sync(self)
|
1007
|
+
la_ = self._interp.adaptivePredict(self._input, 3, self._ctx)
|
1008
|
+
if la_ == 1:
|
1009
|
+
pass
|
1010
|
+
|
1011
|
+
elif la_ == 2:
|
1012
|
+
self.state = 92
|
1013
|
+
_la = self._input.LA(1)
|
1014
|
+
if not (_la == GrammarParser.T__10 or _la == GrammarParser.T__11):
|
1015
|
+
self._errHandler.recoverInline(self)
|
1016
|
+
else:
|
1017
|
+
self._errHandler.reportMatch(self)
|
1018
|
+
self.consume()
|
1019
|
+
self.state = 93
|
1020
|
+
self.chain_id()
|
1021
|
+
pass
|
1022
|
+
|
1023
|
+
elif la_ == 3:
|
1024
|
+
self.state = 94
|
1025
|
+
self.match(GrammarParser.T__10)
|
1026
|
+
self.state = 95
|
1027
|
+
self.match(GrammarParser.T__12)
|
1028
|
+
self.state = 96
|
1029
|
+
self.match(GrammarParser.T__13)
|
1030
|
+
self.state = 97
|
1031
|
+
self.cond_expression(0)
|
1032
|
+
self.state = 98
|
1033
|
+
self.match(GrammarParser.T__14)
|
1034
|
+
pass
|
1035
|
+
|
1036
|
+
self.state = 112
|
1037
|
+
self._errHandler.sync(self)
|
1038
|
+
token = self._input.LA(1)
|
1039
|
+
if token in [GrammarParser.T__4]:
|
1040
|
+
self.state = 102
|
1041
|
+
self.match(GrammarParser.T__4)
|
1042
|
+
pass
|
1043
|
+
elif token in [GrammarParser.T__15]:
|
1044
|
+
self.state = 103
|
1045
|
+
self.match(GrammarParser.T__15)
|
1046
|
+
self.state = 104
|
1047
|
+
self.match(GrammarParser.T__6)
|
1048
|
+
self.state = 108
|
1049
|
+
self._errHandler.sync(self)
|
1050
|
+
_la = self._input.LA(1)
|
1051
|
+
while _la == GrammarParser.T__4 or _la == GrammarParser.ID:
|
1052
|
+
self.state = 105
|
1053
|
+
self.operational_statement()
|
1054
|
+
self.state = 110
|
1055
|
+
self._errHandler.sync(self)
|
1056
|
+
_la = self._input.LA(1)
|
1057
|
+
|
1058
|
+
self.state = 111
|
1059
|
+
self.match(GrammarParser.T__7)
|
1060
|
+
pass
|
1061
|
+
else:
|
1062
|
+
raise NoViableAltException(self)
|
1063
|
+
|
1064
|
+
pass
|
1065
|
+
|
1066
|
+
elif la_ == 2:
|
1067
|
+
localctx = GrammarParser.NormalTransitionDefinitionContext(
|
1068
|
+
self, localctx
|
1069
|
+
)
|
1070
|
+
self.enterOuterAlt(localctx, 2)
|
1071
|
+
self.state = 114
|
1072
|
+
localctx.from_state = self.match(GrammarParser.ID)
|
1073
|
+
self.state = 115
|
1074
|
+
self.match(GrammarParser.T__9)
|
1075
|
+
self.state = 116
|
1076
|
+
localctx.to_state = self.match(GrammarParser.ID)
|
1077
|
+
self.state = 128
|
1078
|
+
self._errHandler.sync(self)
|
1079
|
+
la_ = self._interp.adaptivePredict(self._input, 6, self._ctx)
|
1080
|
+
if la_ == 1:
|
1081
|
+
pass
|
1082
|
+
|
1083
|
+
elif la_ == 2:
|
1084
|
+
self.state = 118
|
1085
|
+
self.match(GrammarParser.T__11)
|
1086
|
+
self.state = 119
|
1087
|
+
localctx.from_id = self.match(GrammarParser.ID)
|
1088
|
+
pass
|
1089
|
+
|
1090
|
+
elif la_ == 3:
|
1091
|
+
self.state = 120
|
1092
|
+
self.match(GrammarParser.T__10)
|
1093
|
+
self.state = 121
|
1094
|
+
self.chain_id()
|
1095
|
+
pass
|
1096
|
+
|
1097
|
+
elif la_ == 4:
|
1098
|
+
self.state = 122
|
1099
|
+
self.match(GrammarParser.T__10)
|
1100
|
+
self.state = 123
|
1101
|
+
self.match(GrammarParser.T__12)
|
1102
|
+
self.state = 124
|
1103
|
+
self.match(GrammarParser.T__13)
|
1104
|
+
self.state = 125
|
1105
|
+
self.cond_expression(0)
|
1106
|
+
self.state = 126
|
1107
|
+
self.match(GrammarParser.T__14)
|
1108
|
+
pass
|
1109
|
+
|
1110
|
+
self.state = 140
|
1111
|
+
self._errHandler.sync(self)
|
1112
|
+
token = self._input.LA(1)
|
1113
|
+
if token in [GrammarParser.T__4]:
|
1114
|
+
self.state = 130
|
1115
|
+
self.match(GrammarParser.T__4)
|
1116
|
+
pass
|
1117
|
+
elif token in [GrammarParser.T__15]:
|
1118
|
+
self.state = 131
|
1119
|
+
self.match(GrammarParser.T__15)
|
1120
|
+
self.state = 132
|
1121
|
+
self.match(GrammarParser.T__6)
|
1122
|
+
self.state = 136
|
1123
|
+
self._errHandler.sync(self)
|
1124
|
+
_la = self._input.LA(1)
|
1125
|
+
while _la == GrammarParser.T__4 or _la == GrammarParser.ID:
|
1126
|
+
self.state = 133
|
1127
|
+
self.operational_statement()
|
1128
|
+
self.state = 138
|
1129
|
+
self._errHandler.sync(self)
|
1130
|
+
_la = self._input.LA(1)
|
1131
|
+
|
1132
|
+
self.state = 139
|
1133
|
+
self.match(GrammarParser.T__7)
|
1134
|
+
pass
|
1135
|
+
else:
|
1136
|
+
raise NoViableAltException(self)
|
1137
|
+
|
1138
|
+
pass
|
1139
|
+
|
1140
|
+
elif la_ == 3:
|
1141
|
+
localctx = GrammarParser.ExitTransitionDefinitionContext(self, localctx)
|
1142
|
+
self.enterOuterAlt(localctx, 3)
|
1143
|
+
self.state = 142
|
1144
|
+
localctx.from_state = self.match(GrammarParser.ID)
|
1145
|
+
self.state = 143
|
1146
|
+
self.match(GrammarParser.T__9)
|
1147
|
+
self.state = 144
|
1148
|
+
self.match(GrammarParser.T__8)
|
1149
|
+
self.state = 156
|
1150
|
+
self._errHandler.sync(self)
|
1151
|
+
la_ = self._interp.adaptivePredict(self._input, 9, self._ctx)
|
1152
|
+
if la_ == 1:
|
1153
|
+
pass
|
1154
|
+
|
1155
|
+
elif la_ == 2:
|
1156
|
+
self.state = 146
|
1157
|
+
self.match(GrammarParser.T__11)
|
1158
|
+
self.state = 147
|
1159
|
+
localctx.from_id = self.match(GrammarParser.ID)
|
1160
|
+
pass
|
1161
|
+
|
1162
|
+
elif la_ == 3:
|
1163
|
+
self.state = 148
|
1164
|
+
self.match(GrammarParser.T__10)
|
1165
|
+
self.state = 149
|
1166
|
+
self.chain_id()
|
1167
|
+
pass
|
1168
|
+
|
1169
|
+
elif la_ == 4:
|
1170
|
+
self.state = 150
|
1171
|
+
self.match(GrammarParser.T__10)
|
1172
|
+
self.state = 151
|
1173
|
+
self.match(GrammarParser.T__12)
|
1174
|
+
self.state = 152
|
1175
|
+
self.match(GrammarParser.T__13)
|
1176
|
+
self.state = 153
|
1177
|
+
self.cond_expression(0)
|
1178
|
+
self.state = 154
|
1179
|
+
self.match(GrammarParser.T__14)
|
1180
|
+
pass
|
1181
|
+
|
1182
|
+
self.state = 168
|
1183
|
+
self._errHandler.sync(self)
|
1184
|
+
token = self._input.LA(1)
|
1185
|
+
if token in [GrammarParser.T__4]:
|
1186
|
+
self.state = 158
|
1187
|
+
self.match(GrammarParser.T__4)
|
1188
|
+
pass
|
1189
|
+
elif token in [GrammarParser.T__15]:
|
1190
|
+
self.state = 159
|
1191
|
+
self.match(GrammarParser.T__15)
|
1192
|
+
self.state = 160
|
1193
|
+
self.match(GrammarParser.T__6)
|
1194
|
+
self.state = 164
|
1195
|
+
self._errHandler.sync(self)
|
1196
|
+
_la = self._input.LA(1)
|
1197
|
+
while _la == GrammarParser.T__4 or _la == GrammarParser.ID:
|
1198
|
+
self.state = 161
|
1199
|
+
self.operational_statement()
|
1200
|
+
self.state = 166
|
1201
|
+
self._errHandler.sync(self)
|
1202
|
+
_la = self._input.LA(1)
|
1203
|
+
|
1204
|
+
self.state = 167
|
1205
|
+
self.match(GrammarParser.T__7)
|
1206
|
+
pass
|
1207
|
+
else:
|
1208
|
+
raise NoViableAltException(self)
|
1209
|
+
|
1210
|
+
pass
|
1211
|
+
|
1212
|
+
except RecognitionException as re:
|
1213
|
+
localctx.exception = re
|
1214
|
+
self._errHandler.reportError(self, re)
|
1215
|
+
self._errHandler.recover(self, re)
|
1216
|
+
finally:
|
1217
|
+
self.exitRule()
|
1218
|
+
return localctx
|
1219
|
+
|
1220
|
+
class Transition_force_definitionContext(ParserRuleContext):
|
1221
|
+
__slots__ = "parser"
|
1222
|
+
|
1223
|
+
def __init__(
|
1224
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
1225
|
+
):
|
1226
|
+
super().__init__(parent, invokingState)
|
1227
|
+
self.parser = parser
|
1228
|
+
|
1229
|
+
def getRuleIndex(self):
|
1230
|
+
return GrammarParser.RULE_transition_force_definition
|
1231
|
+
|
1232
|
+
def copyFrom(self, ctx: ParserRuleContext):
|
1233
|
+
super().copyFrom(ctx)
|
1234
|
+
|
1235
|
+
class NormalForceTransitionDefinitionContext(Transition_force_definitionContext):
|
1236
|
+
def __init__(
|
1237
|
+
self, parser, ctx: ParserRuleContext
|
1238
|
+
): # actually a GrammarParser.Transition_force_definitionContext
|
1239
|
+
super().__init__(parser)
|
1240
|
+
self.from_state = None # Token
|
1241
|
+
self.to_state = None # Token
|
1242
|
+
self.from_id = None # Token
|
1243
|
+
self.copyFrom(ctx)
|
1244
|
+
|
1245
|
+
def ID(self, i: int = None):
|
1246
|
+
if i is None:
|
1247
|
+
return self.getTokens(GrammarParser.ID)
|
1248
|
+
else:
|
1249
|
+
return self.getToken(GrammarParser.ID, i)
|
1250
|
+
|
1251
|
+
def chain_id(self):
|
1252
|
+
return self.getTypedRuleContext(GrammarParser.Chain_idContext, 0)
|
1253
|
+
|
1254
|
+
def cond_expression(self):
|
1255
|
+
return self.getTypedRuleContext(GrammarParser.Cond_expressionContext, 0)
|
1256
|
+
|
1257
|
+
def enterRule(self, listener: ParseTreeListener):
|
1258
|
+
if hasattr(listener, "enterNormalForceTransitionDefinition"):
|
1259
|
+
listener.enterNormalForceTransitionDefinition(self)
|
1260
|
+
|
1261
|
+
def exitRule(self, listener: ParseTreeListener):
|
1262
|
+
if hasattr(listener, "exitNormalForceTransitionDefinition"):
|
1263
|
+
listener.exitNormalForceTransitionDefinition(self)
|
1264
|
+
|
1265
|
+
class ExitAllForceTransitionDefinitionContext(Transition_force_definitionContext):
|
1266
|
+
def __init__(
|
1267
|
+
self, parser, ctx: ParserRuleContext
|
1268
|
+
): # actually a GrammarParser.Transition_force_definitionContext
|
1269
|
+
super().__init__(parser)
|
1270
|
+
self.copyFrom(ctx)
|
1271
|
+
|
1272
|
+
def chain_id(self):
|
1273
|
+
return self.getTypedRuleContext(GrammarParser.Chain_idContext, 0)
|
1274
|
+
|
1275
|
+
def cond_expression(self):
|
1276
|
+
return self.getTypedRuleContext(GrammarParser.Cond_expressionContext, 0)
|
1277
|
+
|
1278
|
+
def enterRule(self, listener: ParseTreeListener):
|
1279
|
+
if hasattr(listener, "enterExitAllForceTransitionDefinition"):
|
1280
|
+
listener.enterExitAllForceTransitionDefinition(self)
|
1281
|
+
|
1282
|
+
def exitRule(self, listener: ParseTreeListener):
|
1283
|
+
if hasattr(listener, "exitExitAllForceTransitionDefinition"):
|
1284
|
+
listener.exitExitAllForceTransitionDefinition(self)
|
1285
|
+
|
1286
|
+
class NormalAllForceTransitionDefinitionContext(Transition_force_definitionContext):
|
1287
|
+
def __init__(
|
1288
|
+
self, parser, ctx: ParserRuleContext
|
1289
|
+
): # actually a GrammarParser.Transition_force_definitionContext
|
1290
|
+
super().__init__(parser)
|
1291
|
+
self.to_state = None # Token
|
1292
|
+
self.copyFrom(ctx)
|
1293
|
+
|
1294
|
+
def ID(self):
|
1295
|
+
return self.getToken(GrammarParser.ID, 0)
|
1296
|
+
|
1297
|
+
def chain_id(self):
|
1298
|
+
return self.getTypedRuleContext(GrammarParser.Chain_idContext, 0)
|
1299
|
+
|
1300
|
+
def cond_expression(self):
|
1301
|
+
return self.getTypedRuleContext(GrammarParser.Cond_expressionContext, 0)
|
1302
|
+
|
1303
|
+
def enterRule(self, listener: ParseTreeListener):
|
1304
|
+
if hasattr(listener, "enterNormalAllForceTransitionDefinition"):
|
1305
|
+
listener.enterNormalAllForceTransitionDefinition(self)
|
1306
|
+
|
1307
|
+
def exitRule(self, listener: ParseTreeListener):
|
1308
|
+
if hasattr(listener, "exitNormalAllForceTransitionDefinition"):
|
1309
|
+
listener.exitNormalAllForceTransitionDefinition(self)
|
1310
|
+
|
1311
|
+
class ExitForceTransitionDefinitionContext(Transition_force_definitionContext):
|
1312
|
+
def __init__(
|
1313
|
+
self, parser, ctx: ParserRuleContext
|
1314
|
+
): # actually a GrammarParser.Transition_force_definitionContext
|
1315
|
+
super().__init__(parser)
|
1316
|
+
self.from_state = None # Token
|
1317
|
+
self.from_id = None # Token
|
1318
|
+
self.copyFrom(ctx)
|
1319
|
+
|
1320
|
+
def ID(self, i: int = None):
|
1321
|
+
if i is None:
|
1322
|
+
return self.getTokens(GrammarParser.ID)
|
1323
|
+
else:
|
1324
|
+
return self.getToken(GrammarParser.ID, i)
|
1325
|
+
|
1326
|
+
def chain_id(self):
|
1327
|
+
return self.getTypedRuleContext(GrammarParser.Chain_idContext, 0)
|
1328
|
+
|
1329
|
+
def cond_expression(self):
|
1330
|
+
return self.getTypedRuleContext(GrammarParser.Cond_expressionContext, 0)
|
1331
|
+
|
1332
|
+
def enterRule(self, listener: ParseTreeListener):
|
1333
|
+
if hasattr(listener, "enterExitForceTransitionDefinition"):
|
1334
|
+
listener.enterExitForceTransitionDefinition(self)
|
1335
|
+
|
1336
|
+
def exitRule(self, listener: ParseTreeListener):
|
1337
|
+
if hasattr(listener, "exitExitForceTransitionDefinition"):
|
1338
|
+
listener.exitExitForceTransitionDefinition(self)
|
1339
|
+
|
1340
|
+
def transition_force_definition(self):
|
1341
|
+
localctx = GrammarParser.Transition_force_definitionContext(
|
1342
|
+
self, self._ctx, self.state
|
1343
|
+
)
|
1344
|
+
self.enterRule(localctx, 10, self.RULE_transition_force_definition)
|
1345
|
+
self._la = 0 # Token type
|
1346
|
+
try:
|
1347
|
+
self.state = 240
|
1348
|
+
self._errHandler.sync(self)
|
1349
|
+
la_ = self._interp.adaptivePredict(self._input, 17, self._ctx)
|
1350
|
+
if la_ == 1:
|
1351
|
+
localctx = GrammarParser.NormalForceTransitionDefinitionContext(
|
1352
|
+
self, localctx
|
1353
|
+
)
|
1354
|
+
self.enterOuterAlt(localctx, 1)
|
1355
|
+
self.state = 172
|
1356
|
+
self.match(GrammarParser.T__16)
|
1357
|
+
self.state = 173
|
1358
|
+
localctx.from_state = self.match(GrammarParser.ID)
|
1359
|
+
self.state = 174
|
1360
|
+
self.match(GrammarParser.T__9)
|
1361
|
+
self.state = 175
|
1362
|
+
localctx.to_state = self.match(GrammarParser.ID)
|
1363
|
+
self.state = 187
|
1364
|
+
self._errHandler.sync(self)
|
1365
|
+
la_ = self._interp.adaptivePredict(self._input, 13, self._ctx)
|
1366
|
+
if la_ == 1:
|
1367
|
+
pass
|
1368
|
+
|
1369
|
+
elif la_ == 2:
|
1370
|
+
self.state = 177
|
1371
|
+
self.match(GrammarParser.T__11)
|
1372
|
+
self.state = 178
|
1373
|
+
localctx.from_id = self.match(GrammarParser.ID)
|
1374
|
+
pass
|
1375
|
+
|
1376
|
+
elif la_ == 3:
|
1377
|
+
self.state = 179
|
1378
|
+
self.match(GrammarParser.T__10)
|
1379
|
+
self.state = 180
|
1380
|
+
self.chain_id()
|
1381
|
+
pass
|
1382
|
+
|
1383
|
+
elif la_ == 4:
|
1384
|
+
self.state = 181
|
1385
|
+
self.match(GrammarParser.T__10)
|
1386
|
+
self.state = 182
|
1387
|
+
self.match(GrammarParser.T__12)
|
1388
|
+
self.state = 183
|
1389
|
+
self.match(GrammarParser.T__13)
|
1390
|
+
self.state = 184
|
1391
|
+
self.cond_expression(0)
|
1392
|
+
self.state = 185
|
1393
|
+
self.match(GrammarParser.T__14)
|
1394
|
+
pass
|
1395
|
+
|
1396
|
+
self.state = 189
|
1397
|
+
self.match(GrammarParser.T__4)
|
1398
|
+
pass
|
1399
|
+
|
1400
|
+
elif la_ == 2:
|
1401
|
+
localctx = GrammarParser.ExitForceTransitionDefinitionContext(
|
1402
|
+
self, localctx
|
1403
|
+
)
|
1404
|
+
self.enterOuterAlt(localctx, 2)
|
1405
|
+
self.state = 190
|
1406
|
+
self.match(GrammarParser.T__16)
|
1407
|
+
self.state = 191
|
1408
|
+
localctx.from_state = self.match(GrammarParser.ID)
|
1409
|
+
self.state = 192
|
1410
|
+
self.match(GrammarParser.T__9)
|
1411
|
+
self.state = 193
|
1412
|
+
self.match(GrammarParser.T__8)
|
1413
|
+
self.state = 205
|
1414
|
+
self._errHandler.sync(self)
|
1415
|
+
la_ = self._interp.adaptivePredict(self._input, 14, self._ctx)
|
1416
|
+
if la_ == 1:
|
1417
|
+
pass
|
1418
|
+
|
1419
|
+
elif la_ == 2:
|
1420
|
+
self.state = 195
|
1421
|
+
self.match(GrammarParser.T__11)
|
1422
|
+
self.state = 196
|
1423
|
+
localctx.from_id = self.match(GrammarParser.ID)
|
1424
|
+
pass
|
1425
|
+
|
1426
|
+
elif la_ == 3:
|
1427
|
+
self.state = 197
|
1428
|
+
self.match(GrammarParser.T__10)
|
1429
|
+
self.state = 198
|
1430
|
+
self.chain_id()
|
1431
|
+
pass
|
1432
|
+
|
1433
|
+
elif la_ == 4:
|
1434
|
+
self.state = 199
|
1435
|
+
self.match(GrammarParser.T__10)
|
1436
|
+
self.state = 200
|
1437
|
+
self.match(GrammarParser.T__12)
|
1438
|
+
self.state = 201
|
1439
|
+
self.match(GrammarParser.T__13)
|
1440
|
+
self.state = 202
|
1441
|
+
self.cond_expression(0)
|
1442
|
+
self.state = 203
|
1443
|
+
self.match(GrammarParser.T__14)
|
1444
|
+
pass
|
1445
|
+
|
1446
|
+
self.state = 207
|
1447
|
+
self.match(GrammarParser.T__4)
|
1448
|
+
pass
|
1449
|
+
|
1450
|
+
elif la_ == 3:
|
1451
|
+
localctx = GrammarParser.NormalAllForceTransitionDefinitionContext(
|
1452
|
+
self, localctx
|
1453
|
+
)
|
1454
|
+
self.enterOuterAlt(localctx, 3)
|
1455
|
+
self.state = 208
|
1456
|
+
self.match(GrammarParser.T__16)
|
1457
|
+
self.state = 209
|
1458
|
+
self.match(GrammarParser.T__17)
|
1459
|
+
self.state = 210
|
1460
|
+
self.match(GrammarParser.T__9)
|
1461
|
+
self.state = 211
|
1462
|
+
localctx.to_state = self.match(GrammarParser.ID)
|
1463
|
+
self.state = 221
|
1464
|
+
self._errHandler.sync(self)
|
1465
|
+
la_ = self._interp.adaptivePredict(self._input, 15, self._ctx)
|
1466
|
+
if la_ == 1:
|
1467
|
+
pass
|
1468
|
+
|
1469
|
+
elif la_ == 2:
|
1470
|
+
self.state = 213
|
1471
|
+
_la = self._input.LA(1)
|
1472
|
+
if not (_la == GrammarParser.T__10 or _la == GrammarParser.T__11):
|
1473
|
+
self._errHandler.recoverInline(self)
|
1474
|
+
else:
|
1475
|
+
self._errHandler.reportMatch(self)
|
1476
|
+
self.consume()
|
1477
|
+
self.state = 214
|
1478
|
+
self.chain_id()
|
1479
|
+
pass
|
1480
|
+
|
1481
|
+
elif la_ == 3:
|
1482
|
+
self.state = 215
|
1483
|
+
self.match(GrammarParser.T__10)
|
1484
|
+
self.state = 216
|
1485
|
+
self.match(GrammarParser.T__12)
|
1486
|
+
self.state = 217
|
1487
|
+
self.match(GrammarParser.T__13)
|
1488
|
+
self.state = 218
|
1489
|
+
self.cond_expression(0)
|
1490
|
+
self.state = 219
|
1491
|
+
self.match(GrammarParser.T__14)
|
1492
|
+
pass
|
1493
|
+
|
1494
|
+
self.state = 223
|
1495
|
+
self.match(GrammarParser.T__4)
|
1496
|
+
pass
|
1497
|
+
|
1498
|
+
elif la_ == 4:
|
1499
|
+
localctx = GrammarParser.ExitAllForceTransitionDefinitionContext(
|
1500
|
+
self, localctx
|
1501
|
+
)
|
1502
|
+
self.enterOuterAlt(localctx, 4)
|
1503
|
+
self.state = 224
|
1504
|
+
self.match(GrammarParser.T__16)
|
1505
|
+
self.state = 225
|
1506
|
+
self.match(GrammarParser.T__17)
|
1507
|
+
self.state = 226
|
1508
|
+
self.match(GrammarParser.T__9)
|
1509
|
+
self.state = 227
|
1510
|
+
self.match(GrammarParser.T__8)
|
1511
|
+
self.state = 237
|
1512
|
+
self._errHandler.sync(self)
|
1513
|
+
la_ = self._interp.adaptivePredict(self._input, 16, self._ctx)
|
1514
|
+
if la_ == 1:
|
1515
|
+
pass
|
1516
|
+
|
1517
|
+
elif la_ == 2:
|
1518
|
+
self.state = 229
|
1519
|
+
_la = self._input.LA(1)
|
1520
|
+
if not (_la == GrammarParser.T__10 or _la == GrammarParser.T__11):
|
1521
|
+
self._errHandler.recoverInline(self)
|
1522
|
+
else:
|
1523
|
+
self._errHandler.reportMatch(self)
|
1524
|
+
self.consume()
|
1525
|
+
self.state = 230
|
1526
|
+
self.chain_id()
|
1527
|
+
pass
|
1528
|
+
|
1529
|
+
elif la_ == 3:
|
1530
|
+
self.state = 231
|
1531
|
+
self.match(GrammarParser.T__10)
|
1532
|
+
self.state = 232
|
1533
|
+
self.match(GrammarParser.T__12)
|
1534
|
+
self.state = 233
|
1535
|
+
self.match(GrammarParser.T__13)
|
1536
|
+
self.state = 234
|
1537
|
+
self.cond_expression(0)
|
1538
|
+
self.state = 235
|
1539
|
+
self.match(GrammarParser.T__14)
|
1540
|
+
pass
|
1541
|
+
|
1542
|
+
self.state = 239
|
1543
|
+
self.match(GrammarParser.T__4)
|
1544
|
+
pass
|
1545
|
+
|
1546
|
+
except RecognitionException as re:
|
1547
|
+
localctx.exception = re
|
1548
|
+
self._errHandler.reportError(self, re)
|
1549
|
+
self._errHandler.recover(self, re)
|
1550
|
+
finally:
|
1551
|
+
self.exitRule()
|
1552
|
+
return localctx
|
1553
|
+
|
1554
|
+
class Enter_definitionContext(ParserRuleContext):
|
1555
|
+
__slots__ = "parser"
|
1556
|
+
|
1557
|
+
def __init__(
|
1558
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
1559
|
+
):
|
1560
|
+
super().__init__(parent, invokingState)
|
1561
|
+
self.parser = parser
|
1562
|
+
|
1563
|
+
def getRuleIndex(self):
|
1564
|
+
return GrammarParser.RULE_enter_definition
|
1565
|
+
|
1566
|
+
def copyFrom(self, ctx: ParserRuleContext):
|
1567
|
+
super().copyFrom(ctx)
|
1568
|
+
|
1569
|
+
class EnterOperationsContext(Enter_definitionContext):
|
1570
|
+
def __init__(
|
1571
|
+
self, parser, ctx: ParserRuleContext
|
1572
|
+
): # actually a GrammarParser.Enter_definitionContext
|
1573
|
+
super().__init__(parser)
|
1574
|
+
self.func_name = None # Token
|
1575
|
+
self.copyFrom(ctx)
|
1576
|
+
|
1577
|
+
def operational_statement(self, i: int = None):
|
1578
|
+
if i is None:
|
1579
|
+
return self.getTypedRuleContexts(
|
1580
|
+
GrammarParser.Operational_statementContext
|
1581
|
+
)
|
1582
|
+
else:
|
1583
|
+
return self.getTypedRuleContext(
|
1584
|
+
GrammarParser.Operational_statementContext, i
|
1585
|
+
)
|
1586
|
+
|
1587
|
+
def ID(self):
|
1588
|
+
return self.getToken(GrammarParser.ID, 0)
|
1589
|
+
|
1590
|
+
def enterRule(self, listener: ParseTreeListener):
|
1591
|
+
if hasattr(listener, "enterEnterOperations"):
|
1592
|
+
listener.enterEnterOperations(self)
|
1593
|
+
|
1594
|
+
def exitRule(self, listener: ParseTreeListener):
|
1595
|
+
if hasattr(listener, "exitEnterOperations"):
|
1596
|
+
listener.exitEnterOperations(self)
|
1597
|
+
|
1598
|
+
class EnterAbstractFuncContext(Enter_definitionContext):
|
1599
|
+
def __init__(
|
1600
|
+
self, parser, ctx: ParserRuleContext
|
1601
|
+
): # actually a GrammarParser.Enter_definitionContext
|
1602
|
+
super().__init__(parser)
|
1603
|
+
self.func_name = None # Token
|
1604
|
+
self.raw_doc = None # Token
|
1605
|
+
self.copyFrom(ctx)
|
1606
|
+
|
1607
|
+
def ID(self):
|
1608
|
+
return self.getToken(GrammarParser.ID, 0)
|
1609
|
+
|
1610
|
+
def MULTILINE_COMMENT(self):
|
1611
|
+
return self.getToken(GrammarParser.MULTILINE_COMMENT, 0)
|
1612
|
+
|
1613
|
+
def enterRule(self, listener: ParseTreeListener):
|
1614
|
+
if hasattr(listener, "enterEnterAbstractFunc"):
|
1615
|
+
listener.enterEnterAbstractFunc(self)
|
1616
|
+
|
1617
|
+
def exitRule(self, listener: ParseTreeListener):
|
1618
|
+
if hasattr(listener, "exitEnterAbstractFunc"):
|
1619
|
+
listener.exitEnterAbstractFunc(self)
|
1620
|
+
|
1621
|
+
def enter_definition(self):
|
1622
|
+
localctx = GrammarParser.Enter_definitionContext(self, self._ctx, self.state)
|
1623
|
+
self.enterRule(localctx, 12, self.RULE_enter_definition)
|
1624
|
+
self._la = 0 # Token type
|
1625
|
+
try:
|
1626
|
+
self.state = 264
|
1627
|
+
self._errHandler.sync(self)
|
1628
|
+
la_ = self._interp.adaptivePredict(self._input, 21, self._ctx)
|
1629
|
+
if la_ == 1:
|
1630
|
+
localctx = GrammarParser.EnterOperationsContext(self, localctx)
|
1631
|
+
self.enterOuterAlt(localctx, 1)
|
1632
|
+
self.state = 242
|
1633
|
+
self.match(GrammarParser.T__18)
|
1634
|
+
self.state = 244
|
1635
|
+
self._errHandler.sync(self)
|
1636
|
+
_la = self._input.LA(1)
|
1637
|
+
if _la == GrammarParser.ID:
|
1638
|
+
self.state = 243
|
1639
|
+
localctx.func_name = self.match(GrammarParser.ID)
|
1640
|
+
|
1641
|
+
self.state = 246
|
1642
|
+
self.match(GrammarParser.T__6)
|
1643
|
+
self.state = 250
|
1644
|
+
self._errHandler.sync(self)
|
1645
|
+
_la = self._input.LA(1)
|
1646
|
+
while _la == GrammarParser.T__4 or _la == GrammarParser.ID:
|
1647
|
+
self.state = 247
|
1648
|
+
self.operational_statement()
|
1649
|
+
self.state = 252
|
1650
|
+
self._errHandler.sync(self)
|
1651
|
+
_la = self._input.LA(1)
|
1652
|
+
|
1653
|
+
self.state = 253
|
1654
|
+
self.match(GrammarParser.T__7)
|
1655
|
+
pass
|
1656
|
+
|
1657
|
+
elif la_ == 2:
|
1658
|
+
localctx = GrammarParser.EnterAbstractFuncContext(self, localctx)
|
1659
|
+
self.enterOuterAlt(localctx, 2)
|
1660
|
+
self.state = 254
|
1661
|
+
self.match(GrammarParser.T__18)
|
1662
|
+
self.state = 255
|
1663
|
+
self.match(GrammarParser.T__19)
|
1664
|
+
self.state = 256
|
1665
|
+
localctx.func_name = self.match(GrammarParser.ID)
|
1666
|
+
self.state = 257
|
1667
|
+
self.match(GrammarParser.T__4)
|
1668
|
+
pass
|
1669
|
+
|
1670
|
+
elif la_ == 3:
|
1671
|
+
localctx = GrammarParser.EnterAbstractFuncContext(self, localctx)
|
1672
|
+
self.enterOuterAlt(localctx, 3)
|
1673
|
+
self.state = 258
|
1674
|
+
self.match(GrammarParser.T__18)
|
1675
|
+
self.state = 259
|
1676
|
+
self.match(GrammarParser.T__19)
|
1677
|
+
self.state = 261
|
1678
|
+
self._errHandler.sync(self)
|
1679
|
+
_la = self._input.LA(1)
|
1680
|
+
if _la == GrammarParser.ID:
|
1681
|
+
self.state = 260
|
1682
|
+
localctx.func_name = self.match(GrammarParser.ID)
|
1683
|
+
|
1684
|
+
self.state = 263
|
1685
|
+
localctx.raw_doc = self.match(GrammarParser.MULTILINE_COMMENT)
|
1686
|
+
pass
|
1687
|
+
|
1688
|
+
except RecognitionException as re:
|
1689
|
+
localctx.exception = re
|
1690
|
+
self._errHandler.reportError(self, re)
|
1691
|
+
self._errHandler.recover(self, re)
|
1692
|
+
finally:
|
1693
|
+
self.exitRule()
|
1694
|
+
return localctx
|
1695
|
+
|
1696
|
+
class Exit_definitionContext(ParserRuleContext):
|
1697
|
+
__slots__ = "parser"
|
1698
|
+
|
1699
|
+
def __init__(
|
1700
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
1701
|
+
):
|
1702
|
+
super().__init__(parent, invokingState)
|
1703
|
+
self.parser = parser
|
1704
|
+
|
1705
|
+
def getRuleIndex(self):
|
1706
|
+
return GrammarParser.RULE_exit_definition
|
1707
|
+
|
1708
|
+
def copyFrom(self, ctx: ParserRuleContext):
|
1709
|
+
super().copyFrom(ctx)
|
1710
|
+
|
1711
|
+
class ExitOperationsContext(Exit_definitionContext):
|
1712
|
+
def __init__(
|
1713
|
+
self, parser, ctx: ParserRuleContext
|
1714
|
+
): # actually a GrammarParser.Exit_definitionContext
|
1715
|
+
super().__init__(parser)
|
1716
|
+
self.func_name = None # Token
|
1717
|
+
self.copyFrom(ctx)
|
1718
|
+
|
1719
|
+
def operational_statement(self, i: int = None):
|
1720
|
+
if i is None:
|
1721
|
+
return self.getTypedRuleContexts(
|
1722
|
+
GrammarParser.Operational_statementContext
|
1723
|
+
)
|
1724
|
+
else:
|
1725
|
+
return self.getTypedRuleContext(
|
1726
|
+
GrammarParser.Operational_statementContext, i
|
1727
|
+
)
|
1728
|
+
|
1729
|
+
def ID(self):
|
1730
|
+
return self.getToken(GrammarParser.ID, 0)
|
1731
|
+
|
1732
|
+
def enterRule(self, listener: ParseTreeListener):
|
1733
|
+
if hasattr(listener, "enterExitOperations"):
|
1734
|
+
listener.enterExitOperations(self)
|
1735
|
+
|
1736
|
+
def exitRule(self, listener: ParseTreeListener):
|
1737
|
+
if hasattr(listener, "exitExitOperations"):
|
1738
|
+
listener.exitExitOperations(self)
|
1739
|
+
|
1740
|
+
class ExitAbstractFuncContext(Exit_definitionContext):
|
1741
|
+
def __init__(
|
1742
|
+
self, parser, ctx: ParserRuleContext
|
1743
|
+
): # actually a GrammarParser.Exit_definitionContext
|
1744
|
+
super().__init__(parser)
|
1745
|
+
self.func_name = None # Token
|
1746
|
+
self.raw_doc = None # Token
|
1747
|
+
self.copyFrom(ctx)
|
1748
|
+
|
1749
|
+
def ID(self):
|
1750
|
+
return self.getToken(GrammarParser.ID, 0)
|
1751
|
+
|
1752
|
+
def MULTILINE_COMMENT(self):
|
1753
|
+
return self.getToken(GrammarParser.MULTILINE_COMMENT, 0)
|
1754
|
+
|
1755
|
+
def enterRule(self, listener: ParseTreeListener):
|
1756
|
+
if hasattr(listener, "enterExitAbstractFunc"):
|
1757
|
+
listener.enterExitAbstractFunc(self)
|
1758
|
+
|
1759
|
+
def exitRule(self, listener: ParseTreeListener):
|
1760
|
+
if hasattr(listener, "exitExitAbstractFunc"):
|
1761
|
+
listener.exitExitAbstractFunc(self)
|
1762
|
+
|
1763
|
+
def exit_definition(self):
|
1764
|
+
localctx = GrammarParser.Exit_definitionContext(self, self._ctx, self.state)
|
1765
|
+
self.enterRule(localctx, 14, self.RULE_exit_definition)
|
1766
|
+
self._la = 0 # Token type
|
1767
|
+
try:
|
1768
|
+
self.state = 288
|
1769
|
+
self._errHandler.sync(self)
|
1770
|
+
la_ = self._interp.adaptivePredict(self._input, 25, self._ctx)
|
1771
|
+
if la_ == 1:
|
1772
|
+
localctx = GrammarParser.ExitOperationsContext(self, localctx)
|
1773
|
+
self.enterOuterAlt(localctx, 1)
|
1774
|
+
self.state = 266
|
1775
|
+
self.match(GrammarParser.T__20)
|
1776
|
+
self.state = 268
|
1777
|
+
self._errHandler.sync(self)
|
1778
|
+
_la = self._input.LA(1)
|
1779
|
+
if _la == GrammarParser.ID:
|
1780
|
+
self.state = 267
|
1781
|
+
localctx.func_name = self.match(GrammarParser.ID)
|
1782
|
+
|
1783
|
+
self.state = 270
|
1784
|
+
self.match(GrammarParser.T__6)
|
1785
|
+
self.state = 274
|
1786
|
+
self._errHandler.sync(self)
|
1787
|
+
_la = self._input.LA(1)
|
1788
|
+
while _la == GrammarParser.T__4 or _la == GrammarParser.ID:
|
1789
|
+
self.state = 271
|
1790
|
+
self.operational_statement()
|
1791
|
+
self.state = 276
|
1792
|
+
self._errHandler.sync(self)
|
1793
|
+
_la = self._input.LA(1)
|
1794
|
+
|
1795
|
+
self.state = 277
|
1796
|
+
self.match(GrammarParser.T__7)
|
1797
|
+
pass
|
1798
|
+
|
1799
|
+
elif la_ == 2:
|
1800
|
+
localctx = GrammarParser.ExitAbstractFuncContext(self, localctx)
|
1801
|
+
self.enterOuterAlt(localctx, 2)
|
1802
|
+
self.state = 278
|
1803
|
+
self.match(GrammarParser.T__20)
|
1804
|
+
self.state = 279
|
1805
|
+
self.match(GrammarParser.T__19)
|
1806
|
+
self.state = 280
|
1807
|
+
localctx.func_name = self.match(GrammarParser.ID)
|
1808
|
+
self.state = 281
|
1809
|
+
self.match(GrammarParser.T__4)
|
1810
|
+
pass
|
1811
|
+
|
1812
|
+
elif la_ == 3:
|
1813
|
+
localctx = GrammarParser.ExitAbstractFuncContext(self, localctx)
|
1814
|
+
self.enterOuterAlt(localctx, 3)
|
1815
|
+
self.state = 282
|
1816
|
+
self.match(GrammarParser.T__20)
|
1817
|
+
self.state = 283
|
1818
|
+
self.match(GrammarParser.T__19)
|
1819
|
+
self.state = 285
|
1820
|
+
self._errHandler.sync(self)
|
1821
|
+
_la = self._input.LA(1)
|
1822
|
+
if _la == GrammarParser.ID:
|
1823
|
+
self.state = 284
|
1824
|
+
localctx.func_name = self.match(GrammarParser.ID)
|
1825
|
+
|
1826
|
+
self.state = 287
|
1827
|
+
localctx.raw_doc = self.match(GrammarParser.MULTILINE_COMMENT)
|
1828
|
+
pass
|
1829
|
+
|
1830
|
+
except RecognitionException as re:
|
1831
|
+
localctx.exception = re
|
1832
|
+
self._errHandler.reportError(self, re)
|
1833
|
+
self._errHandler.recover(self, re)
|
1834
|
+
finally:
|
1835
|
+
self.exitRule()
|
1836
|
+
return localctx
|
1837
|
+
|
1838
|
+
class During_definitionContext(ParserRuleContext):
|
1839
|
+
__slots__ = "parser"
|
1840
|
+
|
1841
|
+
def __init__(
|
1842
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
1843
|
+
):
|
1844
|
+
super().__init__(parent, invokingState)
|
1845
|
+
self.parser = parser
|
1846
|
+
|
1847
|
+
def getRuleIndex(self):
|
1848
|
+
return GrammarParser.RULE_during_definition
|
1849
|
+
|
1850
|
+
def copyFrom(self, ctx: ParserRuleContext):
|
1851
|
+
super().copyFrom(ctx)
|
1852
|
+
|
1853
|
+
class DuringOperationsContext(During_definitionContext):
|
1854
|
+
def __init__(
|
1855
|
+
self, parser, ctx: ParserRuleContext
|
1856
|
+
): # actually a GrammarParser.During_definitionContext
|
1857
|
+
super().__init__(parser)
|
1858
|
+
self.aspect = None # Token
|
1859
|
+
self.func_name = None # Token
|
1860
|
+
self.copyFrom(ctx)
|
1861
|
+
|
1862
|
+
def operational_statement(self, i: int = None):
|
1863
|
+
if i is None:
|
1864
|
+
return self.getTypedRuleContexts(
|
1865
|
+
GrammarParser.Operational_statementContext
|
1866
|
+
)
|
1867
|
+
else:
|
1868
|
+
return self.getTypedRuleContext(
|
1869
|
+
GrammarParser.Operational_statementContext, i
|
1870
|
+
)
|
1871
|
+
|
1872
|
+
def ID(self):
|
1873
|
+
return self.getToken(GrammarParser.ID, 0)
|
1874
|
+
|
1875
|
+
def enterRule(self, listener: ParseTreeListener):
|
1876
|
+
if hasattr(listener, "enterDuringOperations"):
|
1877
|
+
listener.enterDuringOperations(self)
|
1878
|
+
|
1879
|
+
def exitRule(self, listener: ParseTreeListener):
|
1880
|
+
if hasattr(listener, "exitDuringOperations"):
|
1881
|
+
listener.exitDuringOperations(self)
|
1882
|
+
|
1883
|
+
class DuringAbstractFuncContext(During_definitionContext):
|
1884
|
+
def __init__(
|
1885
|
+
self, parser, ctx: ParserRuleContext
|
1886
|
+
): # actually a GrammarParser.During_definitionContext
|
1887
|
+
super().__init__(parser)
|
1888
|
+
self.aspect = None # Token
|
1889
|
+
self.func_name = None # Token
|
1890
|
+
self.raw_doc = None # Token
|
1891
|
+
self.copyFrom(ctx)
|
1892
|
+
|
1893
|
+
def ID(self):
|
1894
|
+
return self.getToken(GrammarParser.ID, 0)
|
1895
|
+
|
1896
|
+
def MULTILINE_COMMENT(self):
|
1897
|
+
return self.getToken(GrammarParser.MULTILINE_COMMENT, 0)
|
1898
|
+
|
1899
|
+
def enterRule(self, listener: ParseTreeListener):
|
1900
|
+
if hasattr(listener, "enterDuringAbstractFunc"):
|
1901
|
+
listener.enterDuringAbstractFunc(self)
|
1902
|
+
|
1903
|
+
def exitRule(self, listener: ParseTreeListener):
|
1904
|
+
if hasattr(listener, "exitDuringAbstractFunc"):
|
1905
|
+
listener.exitDuringAbstractFunc(self)
|
1906
|
+
|
1907
|
+
def during_definition(self):
|
1908
|
+
localctx = GrammarParser.During_definitionContext(self, self._ctx, self.state)
|
1909
|
+
self.enterRule(localctx, 16, self.RULE_during_definition)
|
1910
|
+
self._la = 0 # Token type
|
1911
|
+
try:
|
1912
|
+
self.state = 321
|
1913
|
+
self._errHandler.sync(self)
|
1914
|
+
la_ = self._interp.adaptivePredict(self._input, 32, self._ctx)
|
1915
|
+
if la_ == 1:
|
1916
|
+
localctx = GrammarParser.DuringOperationsContext(self, localctx)
|
1917
|
+
self.enterOuterAlt(localctx, 1)
|
1918
|
+
self.state = 290
|
1919
|
+
self.match(GrammarParser.T__21)
|
1920
|
+
self.state = 292
|
1921
|
+
self._errHandler.sync(self)
|
1922
|
+
_la = self._input.LA(1)
|
1923
|
+
if _la == GrammarParser.T__22 or _la == GrammarParser.T__23:
|
1924
|
+
self.state = 291
|
1925
|
+
localctx.aspect = self._input.LT(1)
|
1926
|
+
_la = self._input.LA(1)
|
1927
|
+
if not (_la == GrammarParser.T__22 or _la == GrammarParser.T__23):
|
1928
|
+
localctx.aspect = self._errHandler.recoverInline(self)
|
1929
|
+
else:
|
1930
|
+
self._errHandler.reportMatch(self)
|
1931
|
+
self.consume()
|
1932
|
+
|
1933
|
+
self.state = 295
|
1934
|
+
self._errHandler.sync(self)
|
1935
|
+
_la = self._input.LA(1)
|
1936
|
+
if _la == GrammarParser.ID:
|
1937
|
+
self.state = 294
|
1938
|
+
localctx.func_name = self.match(GrammarParser.ID)
|
1939
|
+
|
1940
|
+
self.state = 297
|
1941
|
+
self.match(GrammarParser.T__6)
|
1942
|
+
self.state = 301
|
1943
|
+
self._errHandler.sync(self)
|
1944
|
+
_la = self._input.LA(1)
|
1945
|
+
while _la == GrammarParser.T__4 or _la == GrammarParser.ID:
|
1946
|
+
self.state = 298
|
1947
|
+
self.operational_statement()
|
1948
|
+
self.state = 303
|
1949
|
+
self._errHandler.sync(self)
|
1950
|
+
_la = self._input.LA(1)
|
1951
|
+
|
1952
|
+
self.state = 304
|
1953
|
+
self.match(GrammarParser.T__7)
|
1954
|
+
pass
|
1955
|
+
|
1956
|
+
elif la_ == 2:
|
1957
|
+
localctx = GrammarParser.DuringAbstractFuncContext(self, localctx)
|
1958
|
+
self.enterOuterAlt(localctx, 2)
|
1959
|
+
self.state = 305
|
1960
|
+
self.match(GrammarParser.T__21)
|
1961
|
+
self.state = 307
|
1962
|
+
self._errHandler.sync(self)
|
1963
|
+
_la = self._input.LA(1)
|
1964
|
+
if _la == GrammarParser.T__22 or _la == GrammarParser.T__23:
|
1965
|
+
self.state = 306
|
1966
|
+
localctx.aspect = self._input.LT(1)
|
1967
|
+
_la = self._input.LA(1)
|
1968
|
+
if not (_la == GrammarParser.T__22 or _la == GrammarParser.T__23):
|
1969
|
+
localctx.aspect = self._errHandler.recoverInline(self)
|
1970
|
+
else:
|
1971
|
+
self._errHandler.reportMatch(self)
|
1972
|
+
self.consume()
|
1973
|
+
|
1974
|
+
self.state = 309
|
1975
|
+
self.match(GrammarParser.T__19)
|
1976
|
+
self.state = 310
|
1977
|
+
localctx.func_name = self.match(GrammarParser.ID)
|
1978
|
+
self.state = 311
|
1979
|
+
self.match(GrammarParser.T__4)
|
1980
|
+
pass
|
1981
|
+
|
1982
|
+
elif la_ == 3:
|
1983
|
+
localctx = GrammarParser.DuringAbstractFuncContext(self, localctx)
|
1984
|
+
self.enterOuterAlt(localctx, 3)
|
1985
|
+
self.state = 312
|
1986
|
+
self.match(GrammarParser.T__21)
|
1987
|
+
self.state = 314
|
1988
|
+
self._errHandler.sync(self)
|
1989
|
+
_la = self._input.LA(1)
|
1990
|
+
if _la == GrammarParser.T__22 or _la == GrammarParser.T__23:
|
1991
|
+
self.state = 313
|
1992
|
+
localctx.aspect = self._input.LT(1)
|
1993
|
+
_la = self._input.LA(1)
|
1994
|
+
if not (_la == GrammarParser.T__22 or _la == GrammarParser.T__23):
|
1995
|
+
localctx.aspect = self._errHandler.recoverInline(self)
|
1996
|
+
else:
|
1997
|
+
self._errHandler.reportMatch(self)
|
1998
|
+
self.consume()
|
1999
|
+
|
2000
|
+
self.state = 316
|
2001
|
+
self.match(GrammarParser.T__19)
|
2002
|
+
self.state = 318
|
2003
|
+
self._errHandler.sync(self)
|
2004
|
+
_la = self._input.LA(1)
|
2005
|
+
if _la == GrammarParser.ID:
|
2006
|
+
self.state = 317
|
2007
|
+
localctx.func_name = self.match(GrammarParser.ID)
|
2008
|
+
|
2009
|
+
self.state = 320
|
2010
|
+
localctx.raw_doc = self.match(GrammarParser.MULTILINE_COMMENT)
|
2011
|
+
pass
|
2012
|
+
|
2013
|
+
except RecognitionException as re:
|
2014
|
+
localctx.exception = re
|
2015
|
+
self._errHandler.reportError(self, re)
|
2016
|
+
self._errHandler.recover(self, re)
|
2017
|
+
finally:
|
2018
|
+
self.exitRule()
|
2019
|
+
return localctx
|
2020
|
+
|
2021
|
+
class During_aspect_definitionContext(ParserRuleContext):
|
2022
|
+
__slots__ = "parser"
|
2023
|
+
|
2024
|
+
def __init__(
|
2025
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
2026
|
+
):
|
2027
|
+
super().__init__(parent, invokingState)
|
2028
|
+
self.parser = parser
|
2029
|
+
|
2030
|
+
def getRuleIndex(self):
|
2031
|
+
return GrammarParser.RULE_during_aspect_definition
|
2032
|
+
|
2033
|
+
def copyFrom(self, ctx: ParserRuleContext):
|
2034
|
+
super().copyFrom(ctx)
|
2035
|
+
|
2036
|
+
class DuringAspectAbstractFuncContext(During_aspect_definitionContext):
|
2037
|
+
def __init__(
|
2038
|
+
self, parser, ctx: ParserRuleContext
|
2039
|
+
): # actually a GrammarParser.During_aspect_definitionContext
|
2040
|
+
super().__init__(parser)
|
2041
|
+
self.aspect = None # Token
|
2042
|
+
self.func_name = None # Token
|
2043
|
+
self.raw_doc = None # Token
|
2044
|
+
self.copyFrom(ctx)
|
2045
|
+
|
2046
|
+
def ID(self):
|
2047
|
+
return self.getToken(GrammarParser.ID, 0)
|
2048
|
+
|
2049
|
+
def MULTILINE_COMMENT(self):
|
2050
|
+
return self.getToken(GrammarParser.MULTILINE_COMMENT, 0)
|
2051
|
+
|
2052
|
+
def enterRule(self, listener: ParseTreeListener):
|
2053
|
+
if hasattr(listener, "enterDuringAspectAbstractFunc"):
|
2054
|
+
listener.enterDuringAspectAbstractFunc(self)
|
2055
|
+
|
2056
|
+
def exitRule(self, listener: ParseTreeListener):
|
2057
|
+
if hasattr(listener, "exitDuringAspectAbstractFunc"):
|
2058
|
+
listener.exitDuringAspectAbstractFunc(self)
|
2059
|
+
|
2060
|
+
class DuringAspectOperationsContext(During_aspect_definitionContext):
|
2061
|
+
def __init__(
|
2062
|
+
self, parser, ctx: ParserRuleContext
|
2063
|
+
): # actually a GrammarParser.During_aspect_definitionContext
|
2064
|
+
super().__init__(parser)
|
2065
|
+
self.aspect = None # Token
|
2066
|
+
self.func_name = None # Token
|
2067
|
+
self.copyFrom(ctx)
|
2068
|
+
|
2069
|
+
def operational_statement(self, i: int = None):
|
2070
|
+
if i is None:
|
2071
|
+
return self.getTypedRuleContexts(
|
2072
|
+
GrammarParser.Operational_statementContext
|
2073
|
+
)
|
2074
|
+
else:
|
2075
|
+
return self.getTypedRuleContext(
|
2076
|
+
GrammarParser.Operational_statementContext, i
|
2077
|
+
)
|
2078
|
+
|
2079
|
+
def ID(self):
|
2080
|
+
return self.getToken(GrammarParser.ID, 0)
|
2081
|
+
|
2082
|
+
def enterRule(self, listener: ParseTreeListener):
|
2083
|
+
if hasattr(listener, "enterDuringAspectOperations"):
|
2084
|
+
listener.enterDuringAspectOperations(self)
|
2085
|
+
|
2086
|
+
def exitRule(self, listener: ParseTreeListener):
|
2087
|
+
if hasattr(listener, "exitDuringAspectOperations"):
|
2088
|
+
listener.exitDuringAspectOperations(self)
|
2089
|
+
|
2090
|
+
def during_aspect_definition(self):
|
2091
|
+
localctx = GrammarParser.During_aspect_definitionContext(
|
2092
|
+
self, self._ctx, self.state
|
2093
|
+
)
|
2094
|
+
self.enterRule(localctx, 18, self.RULE_during_aspect_definition)
|
2095
|
+
self._la = 0 # Token type
|
2096
|
+
try:
|
2097
|
+
self.state = 351
|
2098
|
+
self._errHandler.sync(self)
|
2099
|
+
la_ = self._interp.adaptivePredict(self._input, 36, self._ctx)
|
2100
|
+
if la_ == 1:
|
2101
|
+
localctx = GrammarParser.DuringAspectOperationsContext(self, localctx)
|
2102
|
+
self.enterOuterAlt(localctx, 1)
|
2103
|
+
self.state = 323
|
2104
|
+
self.match(GrammarParser.T__24)
|
2105
|
+
self.state = 324
|
2106
|
+
self.match(GrammarParser.T__21)
|
2107
|
+
self.state = 325
|
2108
|
+
localctx.aspect = self._input.LT(1)
|
2109
|
+
_la = self._input.LA(1)
|
2110
|
+
if not (_la == GrammarParser.T__22 or _la == GrammarParser.T__23):
|
2111
|
+
localctx.aspect = self._errHandler.recoverInline(self)
|
2112
|
+
else:
|
2113
|
+
self._errHandler.reportMatch(self)
|
2114
|
+
self.consume()
|
2115
|
+
self.state = 327
|
2116
|
+
self._errHandler.sync(self)
|
2117
|
+
_la = self._input.LA(1)
|
2118
|
+
if _la == GrammarParser.ID:
|
2119
|
+
self.state = 326
|
2120
|
+
localctx.func_name = self.match(GrammarParser.ID)
|
2121
|
+
|
2122
|
+
self.state = 329
|
2123
|
+
self.match(GrammarParser.T__6)
|
2124
|
+
self.state = 333
|
2125
|
+
self._errHandler.sync(self)
|
2126
|
+
_la = self._input.LA(1)
|
2127
|
+
while _la == GrammarParser.T__4 or _la == GrammarParser.ID:
|
2128
|
+
self.state = 330
|
2129
|
+
self.operational_statement()
|
2130
|
+
self.state = 335
|
2131
|
+
self._errHandler.sync(self)
|
2132
|
+
_la = self._input.LA(1)
|
2133
|
+
|
2134
|
+
self.state = 336
|
2135
|
+
self.match(GrammarParser.T__7)
|
2136
|
+
pass
|
2137
|
+
|
2138
|
+
elif la_ == 2:
|
2139
|
+
localctx = GrammarParser.DuringAspectAbstractFuncContext(self, localctx)
|
2140
|
+
self.enterOuterAlt(localctx, 2)
|
2141
|
+
self.state = 337
|
2142
|
+
self.match(GrammarParser.T__24)
|
2143
|
+
self.state = 338
|
2144
|
+
self.match(GrammarParser.T__21)
|
2145
|
+
self.state = 339
|
2146
|
+
localctx.aspect = self._input.LT(1)
|
2147
|
+
_la = self._input.LA(1)
|
2148
|
+
if not (_la == GrammarParser.T__22 or _la == GrammarParser.T__23):
|
2149
|
+
localctx.aspect = self._errHandler.recoverInline(self)
|
2150
|
+
else:
|
2151
|
+
self._errHandler.reportMatch(self)
|
2152
|
+
self.consume()
|
2153
|
+
self.state = 340
|
2154
|
+
self.match(GrammarParser.T__19)
|
2155
|
+
self.state = 341
|
2156
|
+
localctx.func_name = self.match(GrammarParser.ID)
|
2157
|
+
self.state = 342
|
2158
|
+
self.match(GrammarParser.T__4)
|
2159
|
+
pass
|
2160
|
+
|
2161
|
+
elif la_ == 3:
|
2162
|
+
localctx = GrammarParser.DuringAspectAbstractFuncContext(self, localctx)
|
2163
|
+
self.enterOuterAlt(localctx, 3)
|
2164
|
+
self.state = 343
|
2165
|
+
self.match(GrammarParser.T__24)
|
2166
|
+
self.state = 344
|
2167
|
+
self.match(GrammarParser.T__21)
|
2168
|
+
self.state = 345
|
2169
|
+
localctx.aspect = self._input.LT(1)
|
2170
|
+
_la = self._input.LA(1)
|
2171
|
+
if not (_la == GrammarParser.T__22 or _la == GrammarParser.T__23):
|
2172
|
+
localctx.aspect = self._errHandler.recoverInline(self)
|
2173
|
+
else:
|
2174
|
+
self._errHandler.reportMatch(self)
|
2175
|
+
self.consume()
|
2176
|
+
self.state = 346
|
2177
|
+
self.match(GrammarParser.T__19)
|
2178
|
+
self.state = 348
|
2179
|
+
self._errHandler.sync(self)
|
2180
|
+
_la = self._input.LA(1)
|
2181
|
+
if _la == GrammarParser.ID:
|
2182
|
+
self.state = 347
|
2183
|
+
localctx.func_name = self.match(GrammarParser.ID)
|
2184
|
+
|
2185
|
+
self.state = 350
|
2186
|
+
localctx.raw_doc = self.match(GrammarParser.MULTILINE_COMMENT)
|
2187
|
+
pass
|
2188
|
+
|
2189
|
+
except RecognitionException as re:
|
2190
|
+
localctx.exception = re
|
2191
|
+
self._errHandler.reportError(self, re)
|
2192
|
+
self._errHandler.recover(self, re)
|
2193
|
+
finally:
|
2194
|
+
self.exitRule()
|
2195
|
+
return localctx
|
2196
|
+
|
2197
|
+
class Operation_assignmentContext(ParserRuleContext):
|
2198
|
+
__slots__ = "parser"
|
2199
|
+
|
2200
|
+
def __init__(
|
2201
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
2202
|
+
):
|
2203
|
+
super().__init__(parent, invokingState)
|
2204
|
+
self.parser = parser
|
2205
|
+
|
2206
|
+
def ID(self):
|
2207
|
+
return self.getToken(GrammarParser.ID, 0)
|
2208
|
+
|
2209
|
+
def num_expression(self):
|
2210
|
+
return self.getTypedRuleContext(GrammarParser.Num_expressionContext, 0)
|
2211
|
+
|
2212
|
+
def getRuleIndex(self):
|
2213
|
+
return GrammarParser.RULE_operation_assignment
|
2214
|
+
|
2215
|
+
def enterRule(self, listener: ParseTreeListener):
|
2216
|
+
if hasattr(listener, "enterOperation_assignment"):
|
2217
|
+
listener.enterOperation_assignment(self)
|
2218
|
+
|
2219
|
+
def exitRule(self, listener: ParseTreeListener):
|
2220
|
+
if hasattr(listener, "exitOperation_assignment"):
|
2221
|
+
listener.exitOperation_assignment(self)
|
2222
|
+
|
2223
|
+
def operation_assignment(self):
|
2224
|
+
localctx = GrammarParser.Operation_assignmentContext(
|
2225
|
+
self, self._ctx, self.state
|
2226
|
+
)
|
2227
|
+
self.enterRule(localctx, 20, self.RULE_operation_assignment)
|
2228
|
+
try:
|
2229
|
+
self.enterOuterAlt(localctx, 1)
|
2230
|
+
self.state = 353
|
2231
|
+
self.match(GrammarParser.ID)
|
2232
|
+
self.state = 354
|
2233
|
+
self.match(GrammarParser.T__3)
|
2234
|
+
self.state = 355
|
2235
|
+
self.num_expression(0)
|
2236
|
+
self.state = 356
|
2237
|
+
self.match(GrammarParser.T__4)
|
2238
|
+
except RecognitionException as re:
|
2239
|
+
localctx.exception = re
|
2240
|
+
self._errHandler.reportError(self, re)
|
2241
|
+
self._errHandler.recover(self, re)
|
2242
|
+
finally:
|
2243
|
+
self.exitRule()
|
2244
|
+
return localctx
|
2245
|
+
|
2246
|
+
class Operational_statementContext(ParserRuleContext):
|
2247
|
+
__slots__ = "parser"
|
2248
|
+
|
2249
|
+
def __init__(
|
2250
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
2251
|
+
):
|
2252
|
+
super().__init__(parent, invokingState)
|
2253
|
+
self.parser = parser
|
2254
|
+
|
2255
|
+
def operation_assignment(self):
|
2256
|
+
return self.getTypedRuleContext(
|
2257
|
+
GrammarParser.Operation_assignmentContext, 0
|
2258
|
+
)
|
2259
|
+
|
2260
|
+
def getRuleIndex(self):
|
2261
|
+
return GrammarParser.RULE_operational_statement
|
2262
|
+
|
2263
|
+
def enterRule(self, listener: ParseTreeListener):
|
2264
|
+
if hasattr(listener, "enterOperational_statement"):
|
2265
|
+
listener.enterOperational_statement(self)
|
2266
|
+
|
2267
|
+
def exitRule(self, listener: ParseTreeListener):
|
2268
|
+
if hasattr(listener, "exitOperational_statement"):
|
2269
|
+
listener.exitOperational_statement(self)
|
2270
|
+
|
2271
|
+
def operational_statement(self):
|
2272
|
+
localctx = GrammarParser.Operational_statementContext(
|
2273
|
+
self, self._ctx, self.state
|
2274
|
+
)
|
2275
|
+
self.enterRule(localctx, 22, self.RULE_operational_statement)
|
2276
|
+
try:
|
2277
|
+
self.state = 360
|
2278
|
+
self._errHandler.sync(self)
|
2279
|
+
token = self._input.LA(1)
|
2280
|
+
if token in [GrammarParser.ID]:
|
2281
|
+
self.enterOuterAlt(localctx, 1)
|
2282
|
+
self.state = 358
|
2283
|
+
self.operation_assignment()
|
2284
|
+
pass
|
2285
|
+
elif token in [GrammarParser.T__4]:
|
2286
|
+
self.enterOuterAlt(localctx, 2)
|
2287
|
+
self.state = 359
|
2288
|
+
self.match(GrammarParser.T__4)
|
2289
|
+
pass
|
2290
|
+
else:
|
2291
|
+
raise NoViableAltException(self)
|
2292
|
+
|
2293
|
+
except RecognitionException as re:
|
2294
|
+
localctx.exception = re
|
2295
|
+
self._errHandler.reportError(self, re)
|
2296
|
+
self._errHandler.recover(self, re)
|
2297
|
+
finally:
|
2298
|
+
self.exitRule()
|
2299
|
+
return localctx
|
2300
|
+
|
2301
|
+
class State_inner_statementContext(ParserRuleContext):
|
2302
|
+
__slots__ = "parser"
|
2303
|
+
|
2304
|
+
def __init__(
|
2305
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
2306
|
+
):
|
2307
|
+
super().__init__(parent, invokingState)
|
2308
|
+
self.parser = parser
|
2309
|
+
|
2310
|
+
def state_definition(self):
|
2311
|
+
return self.getTypedRuleContext(GrammarParser.State_definitionContext, 0)
|
2312
|
+
|
2313
|
+
def transition_definition(self):
|
2314
|
+
return self.getTypedRuleContext(
|
2315
|
+
GrammarParser.Transition_definitionContext, 0
|
2316
|
+
)
|
2317
|
+
|
2318
|
+
def transition_force_definition(self):
|
2319
|
+
return self.getTypedRuleContext(
|
2320
|
+
GrammarParser.Transition_force_definitionContext, 0
|
2321
|
+
)
|
2322
|
+
|
2323
|
+
def enter_definition(self):
|
2324
|
+
return self.getTypedRuleContext(GrammarParser.Enter_definitionContext, 0)
|
2325
|
+
|
2326
|
+
def during_definition(self):
|
2327
|
+
return self.getTypedRuleContext(GrammarParser.During_definitionContext, 0)
|
2328
|
+
|
2329
|
+
def exit_definition(self):
|
2330
|
+
return self.getTypedRuleContext(GrammarParser.Exit_definitionContext, 0)
|
2331
|
+
|
2332
|
+
def during_aspect_definition(self):
|
2333
|
+
return self.getTypedRuleContext(
|
2334
|
+
GrammarParser.During_aspect_definitionContext, 0
|
2335
|
+
)
|
2336
|
+
|
2337
|
+
def getRuleIndex(self):
|
2338
|
+
return GrammarParser.RULE_state_inner_statement
|
2339
|
+
|
2340
|
+
def enterRule(self, listener: ParseTreeListener):
|
2341
|
+
if hasattr(listener, "enterState_inner_statement"):
|
2342
|
+
listener.enterState_inner_statement(self)
|
2343
|
+
|
2344
|
+
def exitRule(self, listener: ParseTreeListener):
|
2345
|
+
if hasattr(listener, "exitState_inner_statement"):
|
2346
|
+
listener.exitState_inner_statement(self)
|
2347
|
+
|
2348
|
+
def state_inner_statement(self):
|
2349
|
+
localctx = GrammarParser.State_inner_statementContext(
|
2350
|
+
self, self._ctx, self.state
|
2351
|
+
)
|
2352
|
+
self.enterRule(localctx, 24, self.RULE_state_inner_statement)
|
2353
|
+
try:
|
2354
|
+
self.state = 370
|
2355
|
+
self._errHandler.sync(self)
|
2356
|
+
token = self._input.LA(1)
|
2357
|
+
if token in [GrammarParser.T__5]:
|
2358
|
+
self.enterOuterAlt(localctx, 1)
|
2359
|
+
self.state = 362
|
2360
|
+
self.state_definition()
|
2361
|
+
pass
|
2362
|
+
elif token in [GrammarParser.T__8, GrammarParser.ID]:
|
2363
|
+
self.enterOuterAlt(localctx, 2)
|
2364
|
+
self.state = 363
|
2365
|
+
self.transition_definition()
|
2366
|
+
pass
|
2367
|
+
elif token in [GrammarParser.T__16]:
|
2368
|
+
self.enterOuterAlt(localctx, 3)
|
2369
|
+
self.state = 364
|
2370
|
+
self.transition_force_definition()
|
2371
|
+
pass
|
2372
|
+
elif token in [GrammarParser.T__18]:
|
2373
|
+
self.enterOuterAlt(localctx, 4)
|
2374
|
+
self.state = 365
|
2375
|
+
self.enter_definition()
|
2376
|
+
pass
|
2377
|
+
elif token in [GrammarParser.T__21]:
|
2378
|
+
self.enterOuterAlt(localctx, 5)
|
2379
|
+
self.state = 366
|
2380
|
+
self.during_definition()
|
2381
|
+
pass
|
2382
|
+
elif token in [GrammarParser.T__20]:
|
2383
|
+
self.enterOuterAlt(localctx, 6)
|
2384
|
+
self.state = 367
|
2385
|
+
self.exit_definition()
|
2386
|
+
pass
|
2387
|
+
elif token in [GrammarParser.T__24]:
|
2388
|
+
self.enterOuterAlt(localctx, 7)
|
2389
|
+
self.state = 368
|
2390
|
+
self.during_aspect_definition()
|
2391
|
+
pass
|
2392
|
+
elif token in [GrammarParser.T__4]:
|
2393
|
+
self.enterOuterAlt(localctx, 8)
|
2394
|
+
self.state = 369
|
2395
|
+
self.match(GrammarParser.T__4)
|
2396
|
+
pass
|
2397
|
+
else:
|
2398
|
+
raise NoViableAltException(self)
|
2399
|
+
|
2400
|
+
except RecognitionException as re:
|
2401
|
+
localctx.exception = re
|
2402
|
+
self._errHandler.reportError(self, re)
|
2403
|
+
self._errHandler.recover(self, re)
|
2404
|
+
finally:
|
2405
|
+
self.exitRule()
|
2406
|
+
return localctx
|
2407
|
+
|
2408
|
+
class Operation_programContext(ParserRuleContext):
|
2409
|
+
__slots__ = "parser"
|
2410
|
+
|
2411
|
+
def __init__(
|
2412
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
2413
|
+
):
|
2414
|
+
super().__init__(parent, invokingState)
|
2415
|
+
self.parser = parser
|
2416
|
+
|
2417
|
+
def EOF(self):
|
2418
|
+
return self.getToken(GrammarParser.EOF, 0)
|
2419
|
+
|
2420
|
+
def operational_assignment(self, i: int = None):
|
2421
|
+
if i is None:
|
2422
|
+
return self.getTypedRuleContexts(
|
2423
|
+
GrammarParser.Operational_assignmentContext
|
2424
|
+
)
|
2425
|
+
else:
|
2426
|
+
return self.getTypedRuleContext(
|
2427
|
+
GrammarParser.Operational_assignmentContext, i
|
2428
|
+
)
|
2429
|
+
|
2430
|
+
def getRuleIndex(self):
|
2431
|
+
return GrammarParser.RULE_operation_program
|
2432
|
+
|
2433
|
+
def enterRule(self, listener: ParseTreeListener):
|
2434
|
+
if hasattr(listener, "enterOperation_program"):
|
2435
|
+
listener.enterOperation_program(self)
|
2436
|
+
|
2437
|
+
def exitRule(self, listener: ParseTreeListener):
|
2438
|
+
if hasattr(listener, "exitOperation_program"):
|
2439
|
+
listener.exitOperation_program(self)
|
2440
|
+
|
2441
|
+
def operation_program(self):
|
2442
|
+
localctx = GrammarParser.Operation_programContext(self, self._ctx, self.state)
|
2443
|
+
self.enterRule(localctx, 26, self.RULE_operation_program)
|
2444
|
+
self._la = 0 # Token type
|
2445
|
+
try:
|
2446
|
+
self.enterOuterAlt(localctx, 1)
|
2447
|
+
self.state = 375
|
2448
|
+
self._errHandler.sync(self)
|
2449
|
+
_la = self._input.LA(1)
|
2450
|
+
while _la == GrammarParser.ID:
|
2451
|
+
self.state = 372
|
2452
|
+
self.operational_assignment()
|
2453
|
+
self.state = 377
|
2454
|
+
self._errHandler.sync(self)
|
2455
|
+
_la = self._input.LA(1)
|
2456
|
+
|
2457
|
+
self.state = 378
|
2458
|
+
self.match(GrammarParser.EOF)
|
2459
|
+
except RecognitionException as re:
|
2460
|
+
localctx.exception = re
|
2461
|
+
self._errHandler.reportError(self, re)
|
2462
|
+
self._errHandler.recover(self, re)
|
2463
|
+
finally:
|
2464
|
+
self.exitRule()
|
2465
|
+
return localctx
|
2466
|
+
|
2467
|
+
class Preamble_programContext(ParserRuleContext):
|
2468
|
+
__slots__ = "parser"
|
2469
|
+
|
2470
|
+
def __init__(
|
2471
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
2472
|
+
):
|
2473
|
+
super().__init__(parent, invokingState)
|
2474
|
+
self.parser = parser
|
2475
|
+
|
2476
|
+
def EOF(self):
|
2477
|
+
return self.getToken(GrammarParser.EOF, 0)
|
2478
|
+
|
2479
|
+
def preamble_statement(self, i: int = None):
|
2480
|
+
if i is None:
|
2481
|
+
return self.getTypedRuleContexts(
|
2482
|
+
GrammarParser.Preamble_statementContext
|
2483
|
+
)
|
2484
|
+
else:
|
2485
|
+
return self.getTypedRuleContext(
|
2486
|
+
GrammarParser.Preamble_statementContext, i
|
2487
|
+
)
|
2488
|
+
|
2489
|
+
def getRuleIndex(self):
|
2490
|
+
return GrammarParser.RULE_preamble_program
|
2491
|
+
|
2492
|
+
def enterRule(self, listener: ParseTreeListener):
|
2493
|
+
if hasattr(listener, "enterPreamble_program"):
|
2494
|
+
listener.enterPreamble_program(self)
|
2495
|
+
|
2496
|
+
def exitRule(self, listener: ParseTreeListener):
|
2497
|
+
if hasattr(listener, "exitPreamble_program"):
|
2498
|
+
listener.exitPreamble_program(self)
|
2499
|
+
|
2500
|
+
def preamble_program(self):
|
2501
|
+
localctx = GrammarParser.Preamble_programContext(self, self._ctx, self.state)
|
2502
|
+
self.enterRule(localctx, 28, self.RULE_preamble_program)
|
2503
|
+
self._la = 0 # Token type
|
2504
|
+
try:
|
2505
|
+
self.enterOuterAlt(localctx, 1)
|
2506
|
+
self.state = 383
|
2507
|
+
self._errHandler.sync(self)
|
2508
|
+
_la = self._input.LA(1)
|
2509
|
+
while _la == GrammarParser.ID:
|
2510
|
+
self.state = 380
|
2511
|
+
self.preamble_statement()
|
2512
|
+
self.state = 385
|
2513
|
+
self._errHandler.sync(self)
|
2514
|
+
_la = self._input.LA(1)
|
2515
|
+
|
2516
|
+
self.state = 386
|
2517
|
+
self.match(GrammarParser.EOF)
|
2518
|
+
except RecognitionException as re:
|
2519
|
+
localctx.exception = re
|
2520
|
+
self._errHandler.reportError(self, re)
|
2521
|
+
self._errHandler.recover(self, re)
|
2522
|
+
finally:
|
2523
|
+
self.exitRule()
|
2524
|
+
return localctx
|
2525
|
+
|
2526
|
+
class Preamble_statementContext(ParserRuleContext):
|
2527
|
+
__slots__ = "parser"
|
2528
|
+
|
2529
|
+
def __init__(
|
2530
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
2531
|
+
):
|
2532
|
+
super().__init__(parent, invokingState)
|
2533
|
+
self.parser = parser
|
2534
|
+
|
2535
|
+
def initial_assignment(self):
|
2536
|
+
return self.getTypedRuleContext(GrammarParser.Initial_assignmentContext, 0)
|
2537
|
+
|
2538
|
+
def constant_definition(self):
|
2539
|
+
return self.getTypedRuleContext(GrammarParser.Constant_definitionContext, 0)
|
2540
|
+
|
2541
|
+
def getRuleIndex(self):
|
2542
|
+
return GrammarParser.RULE_preamble_statement
|
2543
|
+
|
2544
|
+
def enterRule(self, listener: ParseTreeListener):
|
2545
|
+
if hasattr(listener, "enterPreamble_statement"):
|
2546
|
+
listener.enterPreamble_statement(self)
|
2547
|
+
|
2548
|
+
def exitRule(self, listener: ParseTreeListener):
|
2549
|
+
if hasattr(listener, "exitPreamble_statement"):
|
2550
|
+
listener.exitPreamble_statement(self)
|
2551
|
+
|
2552
|
+
def preamble_statement(self):
|
2553
|
+
localctx = GrammarParser.Preamble_statementContext(self, self._ctx, self.state)
|
2554
|
+
self.enterRule(localctx, 30, self.RULE_preamble_statement)
|
2555
|
+
try:
|
2556
|
+
self.state = 390
|
2557
|
+
self._errHandler.sync(self)
|
2558
|
+
la_ = self._interp.adaptivePredict(self._input, 41, self._ctx)
|
2559
|
+
if la_ == 1:
|
2560
|
+
self.enterOuterAlt(localctx, 1)
|
2561
|
+
self.state = 388
|
2562
|
+
self.initial_assignment()
|
2563
|
+
pass
|
2564
|
+
|
2565
|
+
elif la_ == 2:
|
2566
|
+
self.enterOuterAlt(localctx, 2)
|
2567
|
+
self.state = 389
|
2568
|
+
self.constant_definition()
|
2569
|
+
pass
|
2570
|
+
|
2571
|
+
except RecognitionException as re:
|
2572
|
+
localctx.exception = re
|
2573
|
+
self._errHandler.reportError(self, re)
|
2574
|
+
self._errHandler.recover(self, re)
|
2575
|
+
finally:
|
2576
|
+
self.exitRule()
|
2577
|
+
return localctx
|
2578
|
+
|
2579
|
+
class Initial_assignmentContext(ParserRuleContext):
|
2580
|
+
__slots__ = "parser"
|
2581
|
+
|
2582
|
+
def __init__(
|
2583
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
2584
|
+
):
|
2585
|
+
super().__init__(parent, invokingState)
|
2586
|
+
self.parser = parser
|
2587
|
+
|
2588
|
+
def ID(self):
|
2589
|
+
return self.getToken(GrammarParser.ID, 0)
|
2590
|
+
|
2591
|
+
def init_expression(self):
|
2592
|
+
return self.getTypedRuleContext(GrammarParser.Init_expressionContext, 0)
|
2593
|
+
|
2594
|
+
def getRuleIndex(self):
|
2595
|
+
return GrammarParser.RULE_initial_assignment
|
2596
|
+
|
2597
|
+
def enterRule(self, listener: ParseTreeListener):
|
2598
|
+
if hasattr(listener, "enterInitial_assignment"):
|
2599
|
+
listener.enterInitial_assignment(self)
|
2600
|
+
|
2601
|
+
def exitRule(self, listener: ParseTreeListener):
|
2602
|
+
if hasattr(listener, "exitInitial_assignment"):
|
2603
|
+
listener.exitInitial_assignment(self)
|
2604
|
+
|
2605
|
+
def initial_assignment(self):
|
2606
|
+
localctx = GrammarParser.Initial_assignmentContext(self, self._ctx, self.state)
|
2607
|
+
self.enterRule(localctx, 32, self.RULE_initial_assignment)
|
2608
|
+
try:
|
2609
|
+
self.enterOuterAlt(localctx, 1)
|
2610
|
+
self.state = 392
|
2611
|
+
self.match(GrammarParser.ID)
|
2612
|
+
self.state = 393
|
2613
|
+
self.match(GrammarParser.T__25)
|
2614
|
+
self.state = 394
|
2615
|
+
self.init_expression(0)
|
2616
|
+
self.state = 395
|
2617
|
+
self.match(GrammarParser.T__4)
|
2618
|
+
except RecognitionException as re:
|
2619
|
+
localctx.exception = re
|
2620
|
+
self._errHandler.reportError(self, re)
|
2621
|
+
self._errHandler.recover(self, re)
|
2622
|
+
finally:
|
2623
|
+
self.exitRule()
|
2624
|
+
return localctx
|
2625
|
+
|
2626
|
+
class Constant_definitionContext(ParserRuleContext):
|
2627
|
+
__slots__ = "parser"
|
2628
|
+
|
2629
|
+
def __init__(
|
2630
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
2631
|
+
):
|
2632
|
+
super().__init__(parent, invokingState)
|
2633
|
+
self.parser = parser
|
2634
|
+
|
2635
|
+
def ID(self):
|
2636
|
+
return self.getToken(GrammarParser.ID, 0)
|
2637
|
+
|
2638
|
+
def init_expression(self):
|
2639
|
+
return self.getTypedRuleContext(GrammarParser.Init_expressionContext, 0)
|
2640
|
+
|
2641
|
+
def getRuleIndex(self):
|
2642
|
+
return GrammarParser.RULE_constant_definition
|
2643
|
+
|
2644
|
+
def enterRule(self, listener: ParseTreeListener):
|
2645
|
+
if hasattr(listener, "enterConstant_definition"):
|
2646
|
+
listener.enterConstant_definition(self)
|
2647
|
+
|
2648
|
+
def exitRule(self, listener: ParseTreeListener):
|
2649
|
+
if hasattr(listener, "exitConstant_definition"):
|
2650
|
+
listener.exitConstant_definition(self)
|
2651
|
+
|
2652
|
+
def constant_definition(self):
|
2653
|
+
localctx = GrammarParser.Constant_definitionContext(self, self._ctx, self.state)
|
2654
|
+
self.enterRule(localctx, 34, self.RULE_constant_definition)
|
2655
|
+
try:
|
2656
|
+
self.enterOuterAlt(localctx, 1)
|
2657
|
+
self.state = 397
|
2658
|
+
self.match(GrammarParser.ID)
|
2659
|
+
self.state = 398
|
2660
|
+
self.match(GrammarParser.T__3)
|
2661
|
+
self.state = 399
|
2662
|
+
self.init_expression(0)
|
2663
|
+
self.state = 400
|
2664
|
+
self.match(GrammarParser.T__4)
|
2665
|
+
except RecognitionException as re:
|
2666
|
+
localctx.exception = re
|
2667
|
+
self._errHandler.reportError(self, re)
|
2668
|
+
self._errHandler.recover(self, re)
|
2669
|
+
finally:
|
2670
|
+
self.exitRule()
|
2671
|
+
return localctx
|
2672
|
+
|
2673
|
+
class Operational_assignmentContext(ParserRuleContext):
|
2674
|
+
__slots__ = "parser"
|
2675
|
+
|
2676
|
+
def __init__(
|
2677
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
2678
|
+
):
|
2679
|
+
super().__init__(parent, invokingState)
|
2680
|
+
self.parser = parser
|
2681
|
+
|
2682
|
+
def ID(self):
|
2683
|
+
return self.getToken(GrammarParser.ID, 0)
|
2684
|
+
|
2685
|
+
def num_expression(self):
|
2686
|
+
return self.getTypedRuleContext(GrammarParser.Num_expressionContext, 0)
|
2687
|
+
|
2688
|
+
def getRuleIndex(self):
|
2689
|
+
return GrammarParser.RULE_operational_assignment
|
2690
|
+
|
2691
|
+
def enterRule(self, listener: ParseTreeListener):
|
2692
|
+
if hasattr(listener, "enterOperational_assignment"):
|
2693
|
+
listener.enterOperational_assignment(self)
|
2694
|
+
|
2695
|
+
def exitRule(self, listener: ParseTreeListener):
|
2696
|
+
if hasattr(listener, "exitOperational_assignment"):
|
2697
|
+
listener.exitOperational_assignment(self)
|
2698
|
+
|
2699
|
+
def operational_assignment(self):
|
2700
|
+
localctx = GrammarParser.Operational_assignmentContext(
|
2701
|
+
self, self._ctx, self.state
|
2702
|
+
)
|
2703
|
+
self.enterRule(localctx, 36, self.RULE_operational_assignment)
|
2704
|
+
try:
|
2705
|
+
self.enterOuterAlt(localctx, 1)
|
2706
|
+
self.state = 402
|
2707
|
+
self.match(GrammarParser.ID)
|
2708
|
+
self.state = 403
|
2709
|
+
self.match(GrammarParser.T__25)
|
2710
|
+
self.state = 404
|
2711
|
+
self.num_expression(0)
|
2712
|
+
self.state = 405
|
2713
|
+
self.match(GrammarParser.T__4)
|
2714
|
+
except RecognitionException as re:
|
2715
|
+
localctx.exception = re
|
2716
|
+
self._errHandler.reportError(self, re)
|
2717
|
+
self._errHandler.recover(self, re)
|
2718
|
+
finally:
|
2719
|
+
self.exitRule()
|
2720
|
+
return localctx
|
2721
|
+
|
2722
|
+
class Generic_expressionContext(ParserRuleContext):
|
2723
|
+
__slots__ = "parser"
|
2724
|
+
|
2725
|
+
def __init__(
|
2726
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
2727
|
+
):
|
2728
|
+
super().__init__(parent, invokingState)
|
2729
|
+
self.parser = parser
|
2730
|
+
|
2731
|
+
def num_expression(self):
|
2732
|
+
return self.getTypedRuleContext(GrammarParser.Num_expressionContext, 0)
|
2733
|
+
|
2734
|
+
def cond_expression(self):
|
2735
|
+
return self.getTypedRuleContext(GrammarParser.Cond_expressionContext, 0)
|
2736
|
+
|
2737
|
+
def getRuleIndex(self):
|
2738
|
+
return GrammarParser.RULE_generic_expression
|
2739
|
+
|
2740
|
+
def enterRule(self, listener: ParseTreeListener):
|
2741
|
+
if hasattr(listener, "enterGeneric_expression"):
|
2742
|
+
listener.enterGeneric_expression(self)
|
2743
|
+
|
2744
|
+
def exitRule(self, listener: ParseTreeListener):
|
2745
|
+
if hasattr(listener, "exitGeneric_expression"):
|
2746
|
+
listener.exitGeneric_expression(self)
|
2747
|
+
|
2748
|
+
def generic_expression(self):
|
2749
|
+
localctx = GrammarParser.Generic_expressionContext(self, self._ctx, self.state)
|
2750
|
+
self.enterRule(localctx, 38, self.RULE_generic_expression)
|
2751
|
+
try:
|
2752
|
+
self.state = 409
|
2753
|
+
self._errHandler.sync(self)
|
2754
|
+
la_ = self._interp.adaptivePredict(self._input, 42, self._ctx)
|
2755
|
+
if la_ == 1:
|
2756
|
+
self.enterOuterAlt(localctx, 1)
|
2757
|
+
self.state = 407
|
2758
|
+
self.num_expression(0)
|
2759
|
+
pass
|
2760
|
+
|
2761
|
+
elif la_ == 2:
|
2762
|
+
self.enterOuterAlt(localctx, 2)
|
2763
|
+
self.state = 408
|
2764
|
+
self.cond_expression(0)
|
2765
|
+
pass
|
2766
|
+
|
2767
|
+
except RecognitionException as re:
|
2768
|
+
localctx.exception = re
|
2769
|
+
self._errHandler.reportError(self, re)
|
2770
|
+
self._errHandler.recover(self, re)
|
2771
|
+
finally:
|
2772
|
+
self.exitRule()
|
2773
|
+
return localctx
|
2774
|
+
|
2775
|
+
class Init_expressionContext(ParserRuleContext):
|
2776
|
+
__slots__ = "parser"
|
2777
|
+
|
2778
|
+
def __init__(
|
2779
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
2780
|
+
):
|
2781
|
+
super().__init__(parent, invokingState)
|
2782
|
+
self.parser = parser
|
2783
|
+
|
2784
|
+
def getRuleIndex(self):
|
2785
|
+
return GrammarParser.RULE_init_expression
|
2786
|
+
|
2787
|
+
def copyFrom(self, ctx: ParserRuleContext):
|
2788
|
+
super().copyFrom(ctx)
|
2789
|
+
|
2790
|
+
class FuncExprInitContext(Init_expressionContext):
|
2791
|
+
def __init__(
|
2792
|
+
self, parser, ctx: ParserRuleContext
|
2793
|
+
): # actually a GrammarParser.Init_expressionContext
|
2794
|
+
super().__init__(parser)
|
2795
|
+
self.function = None # Token
|
2796
|
+
self.copyFrom(ctx)
|
2797
|
+
|
2798
|
+
def init_expression(self):
|
2799
|
+
return self.getTypedRuleContext(GrammarParser.Init_expressionContext, 0)
|
2800
|
+
|
2801
|
+
def UFUNC_NAME(self):
|
2802
|
+
return self.getToken(GrammarParser.UFUNC_NAME, 0)
|
2803
|
+
|
2804
|
+
def enterRule(self, listener: ParseTreeListener):
|
2805
|
+
if hasattr(listener, "enterFuncExprInit"):
|
2806
|
+
listener.enterFuncExprInit(self)
|
2807
|
+
|
2808
|
+
def exitRule(self, listener: ParseTreeListener):
|
2809
|
+
if hasattr(listener, "exitFuncExprInit"):
|
2810
|
+
listener.exitFuncExprInit(self)
|
2811
|
+
|
2812
|
+
class UnaryExprInitContext(Init_expressionContext):
|
2813
|
+
def __init__(
|
2814
|
+
self, parser, ctx: ParserRuleContext
|
2815
|
+
): # actually a GrammarParser.Init_expressionContext
|
2816
|
+
super().__init__(parser)
|
2817
|
+
self.op = None # Token
|
2818
|
+
self.copyFrom(ctx)
|
2819
|
+
|
2820
|
+
def init_expression(self):
|
2821
|
+
return self.getTypedRuleContext(GrammarParser.Init_expressionContext, 0)
|
2822
|
+
|
2823
|
+
def enterRule(self, listener: ParseTreeListener):
|
2824
|
+
if hasattr(listener, "enterUnaryExprInit"):
|
2825
|
+
listener.enterUnaryExprInit(self)
|
2826
|
+
|
2827
|
+
def exitRule(self, listener: ParseTreeListener):
|
2828
|
+
if hasattr(listener, "exitUnaryExprInit"):
|
2829
|
+
listener.exitUnaryExprInit(self)
|
2830
|
+
|
2831
|
+
class BinaryExprInitContext(Init_expressionContext):
|
2832
|
+
def __init__(
|
2833
|
+
self, parser, ctx: ParserRuleContext
|
2834
|
+
): # actually a GrammarParser.Init_expressionContext
|
2835
|
+
super().__init__(parser)
|
2836
|
+
self.op = None # Token
|
2837
|
+
self.copyFrom(ctx)
|
2838
|
+
|
2839
|
+
def init_expression(self, i: int = None):
|
2840
|
+
if i is None:
|
2841
|
+
return self.getTypedRuleContexts(GrammarParser.Init_expressionContext)
|
2842
|
+
else:
|
2843
|
+
return self.getTypedRuleContext(GrammarParser.Init_expressionContext, i)
|
2844
|
+
|
2845
|
+
def enterRule(self, listener: ParseTreeListener):
|
2846
|
+
if hasattr(listener, "enterBinaryExprInit"):
|
2847
|
+
listener.enterBinaryExprInit(self)
|
2848
|
+
|
2849
|
+
def exitRule(self, listener: ParseTreeListener):
|
2850
|
+
if hasattr(listener, "exitBinaryExprInit"):
|
2851
|
+
listener.exitBinaryExprInit(self)
|
2852
|
+
|
2853
|
+
class LiteralExprInitContext(Init_expressionContext):
|
2854
|
+
def __init__(
|
2855
|
+
self, parser, ctx: ParserRuleContext
|
2856
|
+
): # actually a GrammarParser.Init_expressionContext
|
2857
|
+
super().__init__(parser)
|
2858
|
+
self.copyFrom(ctx)
|
2859
|
+
|
2860
|
+
def num_literal(self):
|
2861
|
+
return self.getTypedRuleContext(GrammarParser.Num_literalContext, 0)
|
2862
|
+
|
2863
|
+
def enterRule(self, listener: ParseTreeListener):
|
2864
|
+
if hasattr(listener, "enterLiteralExprInit"):
|
2865
|
+
listener.enterLiteralExprInit(self)
|
2866
|
+
|
2867
|
+
def exitRule(self, listener: ParseTreeListener):
|
2868
|
+
if hasattr(listener, "exitLiteralExprInit"):
|
2869
|
+
listener.exitLiteralExprInit(self)
|
2870
|
+
|
2871
|
+
class MathConstExprInitContext(Init_expressionContext):
|
2872
|
+
def __init__(
|
2873
|
+
self, parser, ctx: ParserRuleContext
|
2874
|
+
): # actually a GrammarParser.Init_expressionContext
|
2875
|
+
super().__init__(parser)
|
2876
|
+
self.copyFrom(ctx)
|
2877
|
+
|
2878
|
+
def math_const(self):
|
2879
|
+
return self.getTypedRuleContext(GrammarParser.Math_constContext, 0)
|
2880
|
+
|
2881
|
+
def enterRule(self, listener: ParseTreeListener):
|
2882
|
+
if hasattr(listener, "enterMathConstExprInit"):
|
2883
|
+
listener.enterMathConstExprInit(self)
|
2884
|
+
|
2885
|
+
def exitRule(self, listener: ParseTreeListener):
|
2886
|
+
if hasattr(listener, "exitMathConstExprInit"):
|
2887
|
+
listener.exitMathConstExprInit(self)
|
2888
|
+
|
2889
|
+
class ParenExprInitContext(Init_expressionContext):
|
2890
|
+
def __init__(
|
2891
|
+
self, parser, ctx: ParserRuleContext
|
2892
|
+
): # actually a GrammarParser.Init_expressionContext
|
2893
|
+
super().__init__(parser)
|
2894
|
+
self.copyFrom(ctx)
|
2895
|
+
|
2896
|
+
def init_expression(self):
|
2897
|
+
return self.getTypedRuleContext(GrammarParser.Init_expressionContext, 0)
|
2898
|
+
|
2899
|
+
def enterRule(self, listener: ParseTreeListener):
|
2900
|
+
if hasattr(listener, "enterParenExprInit"):
|
2901
|
+
listener.enterParenExprInit(self)
|
2902
|
+
|
2903
|
+
def exitRule(self, listener: ParseTreeListener):
|
2904
|
+
if hasattr(listener, "exitParenExprInit"):
|
2905
|
+
listener.exitParenExprInit(self)
|
2906
|
+
|
2907
|
+
def init_expression(self, _p: int = 0):
|
2908
|
+
_parentctx = self._ctx
|
2909
|
+
_parentState = self.state
|
2910
|
+
localctx = GrammarParser.Init_expressionContext(self, self._ctx, _parentState)
|
2911
|
+
_prevctx = localctx
|
2912
|
+
_startState = 40
|
2913
|
+
self.enterRecursionRule(localctx, 40, self.RULE_init_expression, _p)
|
2914
|
+
self._la = 0 # Token type
|
2915
|
+
try:
|
2916
|
+
self.enterOuterAlt(localctx, 1)
|
2917
|
+
self.state = 425
|
2918
|
+
self._errHandler.sync(self)
|
2919
|
+
token = self._input.LA(1)
|
2920
|
+
if token in [GrammarParser.T__26]:
|
2921
|
+
localctx = GrammarParser.ParenExprInitContext(self, localctx)
|
2922
|
+
self._ctx = localctx
|
2923
|
+
_prevctx = localctx
|
2924
|
+
|
2925
|
+
self.state = 412
|
2926
|
+
self.match(GrammarParser.T__26)
|
2927
|
+
self.state = 413
|
2928
|
+
self.init_expression(0)
|
2929
|
+
self.state = 414
|
2930
|
+
self.match(GrammarParser.T__27)
|
2931
|
+
pass
|
2932
|
+
elif token in [
|
2933
|
+
GrammarParser.FLOAT,
|
2934
|
+
GrammarParser.INT,
|
2935
|
+
GrammarParser.HEX_INT,
|
2936
|
+
]:
|
2937
|
+
localctx = GrammarParser.LiteralExprInitContext(self, localctx)
|
2938
|
+
self._ctx = localctx
|
2939
|
+
_prevctx = localctx
|
2940
|
+
self.state = 416
|
2941
|
+
self.num_literal()
|
2942
|
+
pass
|
2943
|
+
elif token in [
|
2944
|
+
GrammarParser.T__49,
|
2945
|
+
GrammarParser.T__50,
|
2946
|
+
GrammarParser.T__51,
|
2947
|
+
]:
|
2948
|
+
localctx = GrammarParser.MathConstExprInitContext(self, localctx)
|
2949
|
+
self._ctx = localctx
|
2950
|
+
_prevctx = localctx
|
2951
|
+
self.state = 417
|
2952
|
+
self.math_const()
|
2953
|
+
pass
|
2954
|
+
elif token in [GrammarParser.T__28, GrammarParser.T__29]:
|
2955
|
+
localctx = GrammarParser.UnaryExprInitContext(self, localctx)
|
2956
|
+
self._ctx = localctx
|
2957
|
+
_prevctx = localctx
|
2958
|
+
self.state = 418
|
2959
|
+
localctx.op = self._input.LT(1)
|
2960
|
+
_la = self._input.LA(1)
|
2961
|
+
if not (_la == GrammarParser.T__28 or _la == GrammarParser.T__29):
|
2962
|
+
localctx.op = self._errHandler.recoverInline(self)
|
2963
|
+
else:
|
2964
|
+
self._errHandler.reportMatch(self)
|
2965
|
+
self.consume()
|
2966
|
+
self.state = 419
|
2967
|
+
self.init_expression(9)
|
2968
|
+
pass
|
2969
|
+
elif token in [GrammarParser.UFUNC_NAME]:
|
2970
|
+
localctx = GrammarParser.FuncExprInitContext(self, localctx)
|
2971
|
+
self._ctx = localctx
|
2972
|
+
_prevctx = localctx
|
2973
|
+
self.state = 420
|
2974
|
+
localctx.function = self.match(GrammarParser.UFUNC_NAME)
|
2975
|
+
self.state = 421
|
2976
|
+
self.match(GrammarParser.T__26)
|
2977
|
+
self.state = 422
|
2978
|
+
self.init_expression(0)
|
2979
|
+
self.state = 423
|
2980
|
+
self.match(GrammarParser.T__27)
|
2981
|
+
pass
|
2982
|
+
else:
|
2983
|
+
raise NoViableAltException(self)
|
2984
|
+
|
2985
|
+
self._ctx.stop = self._input.LT(-1)
|
2986
|
+
self.state = 450
|
2987
|
+
self._errHandler.sync(self)
|
2988
|
+
_alt = self._interp.adaptivePredict(self._input, 45, self._ctx)
|
2989
|
+
while _alt != 2 and _alt != ATN.INVALID_ALT_NUMBER:
|
2990
|
+
if _alt == 1:
|
2991
|
+
if self._parseListeners is not None:
|
2992
|
+
self.triggerExitRuleEvent()
|
2993
|
+
_prevctx = localctx
|
2994
|
+
self.state = 448
|
2995
|
+
self._errHandler.sync(self)
|
2996
|
+
la_ = self._interp.adaptivePredict(self._input, 44, self._ctx)
|
2997
|
+
if la_ == 1:
|
2998
|
+
localctx = GrammarParser.BinaryExprInitContext(
|
2999
|
+
self,
|
3000
|
+
GrammarParser.Init_expressionContext(
|
3001
|
+
self, _parentctx, _parentState
|
3002
|
+
),
|
3003
|
+
)
|
3004
|
+
self.pushNewRecursionContext(
|
3005
|
+
localctx, _startState, self.RULE_init_expression
|
3006
|
+
)
|
3007
|
+
self.state = 427
|
3008
|
+
if not self.precpred(self._ctx, 8):
|
3009
|
+
from antlr4.error.Errors import FailedPredicateException
|
3010
|
+
|
3011
|
+
raise FailedPredicateException(
|
3012
|
+
self, "self.precpred(self._ctx, 8)"
|
3013
|
+
)
|
3014
|
+
self.state = 428
|
3015
|
+
localctx.op = self.match(GrammarParser.T__30)
|
3016
|
+
self.state = 429
|
3017
|
+
self.init_expression(8)
|
3018
|
+
pass
|
3019
|
+
|
3020
|
+
elif la_ == 2:
|
3021
|
+
localctx = GrammarParser.BinaryExprInitContext(
|
3022
|
+
self,
|
3023
|
+
GrammarParser.Init_expressionContext(
|
3024
|
+
self, _parentctx, _parentState
|
3025
|
+
),
|
3026
|
+
)
|
3027
|
+
self.pushNewRecursionContext(
|
3028
|
+
localctx, _startState, self.RULE_init_expression
|
3029
|
+
)
|
3030
|
+
self.state = 430
|
3031
|
+
if not self.precpred(self._ctx, 7):
|
3032
|
+
from antlr4.error.Errors import FailedPredicateException
|
3033
|
+
|
3034
|
+
raise FailedPredicateException(
|
3035
|
+
self, "self.precpred(self._ctx, 7)"
|
3036
|
+
)
|
3037
|
+
self.state = 431
|
3038
|
+
localctx.op = self._input.LT(1)
|
3039
|
+
_la = self._input.LA(1)
|
3040
|
+
if not (
|
3041
|
+
((_la) & ~0x3F) == 0
|
3042
|
+
and (
|
3043
|
+
(1 << _la)
|
3044
|
+
& (
|
3045
|
+
(1 << GrammarParser.T__17)
|
3046
|
+
| (1 << GrammarParser.T__31)
|
3047
|
+
| (1 << GrammarParser.T__32)
|
3048
|
+
)
|
3049
|
+
)
|
3050
|
+
!= 0
|
3051
|
+
):
|
3052
|
+
localctx.op = self._errHandler.recoverInline(self)
|
3053
|
+
else:
|
3054
|
+
self._errHandler.reportMatch(self)
|
3055
|
+
self.consume()
|
3056
|
+
self.state = 432
|
3057
|
+
self.init_expression(8)
|
3058
|
+
pass
|
3059
|
+
|
3060
|
+
elif la_ == 3:
|
3061
|
+
localctx = GrammarParser.BinaryExprInitContext(
|
3062
|
+
self,
|
3063
|
+
GrammarParser.Init_expressionContext(
|
3064
|
+
self, _parentctx, _parentState
|
3065
|
+
),
|
3066
|
+
)
|
3067
|
+
self.pushNewRecursionContext(
|
3068
|
+
localctx, _startState, self.RULE_init_expression
|
3069
|
+
)
|
3070
|
+
self.state = 433
|
3071
|
+
if not self.precpred(self._ctx, 6):
|
3072
|
+
from antlr4.error.Errors import FailedPredicateException
|
3073
|
+
|
3074
|
+
raise FailedPredicateException(
|
3075
|
+
self, "self.precpred(self._ctx, 6)"
|
3076
|
+
)
|
3077
|
+
self.state = 434
|
3078
|
+
localctx.op = self._input.LT(1)
|
3079
|
+
_la = self._input.LA(1)
|
3080
|
+
if not (
|
3081
|
+
_la == GrammarParser.T__28 or _la == GrammarParser.T__29
|
3082
|
+
):
|
3083
|
+
localctx.op = self._errHandler.recoverInline(self)
|
3084
|
+
else:
|
3085
|
+
self._errHandler.reportMatch(self)
|
3086
|
+
self.consume()
|
3087
|
+
self.state = 435
|
3088
|
+
self.init_expression(7)
|
3089
|
+
pass
|
3090
|
+
|
3091
|
+
elif la_ == 4:
|
3092
|
+
localctx = GrammarParser.BinaryExprInitContext(
|
3093
|
+
self,
|
3094
|
+
GrammarParser.Init_expressionContext(
|
3095
|
+
self, _parentctx, _parentState
|
3096
|
+
),
|
3097
|
+
)
|
3098
|
+
self.pushNewRecursionContext(
|
3099
|
+
localctx, _startState, self.RULE_init_expression
|
3100
|
+
)
|
3101
|
+
self.state = 436
|
3102
|
+
if not self.precpred(self._ctx, 5):
|
3103
|
+
from antlr4.error.Errors import FailedPredicateException
|
3104
|
+
|
3105
|
+
raise FailedPredicateException(
|
3106
|
+
self, "self.precpred(self._ctx, 5)"
|
3107
|
+
)
|
3108
|
+
self.state = 437
|
3109
|
+
localctx.op = self._input.LT(1)
|
3110
|
+
_la = self._input.LA(1)
|
3111
|
+
if not (
|
3112
|
+
_la == GrammarParser.T__24 or _la == GrammarParser.T__33
|
3113
|
+
):
|
3114
|
+
localctx.op = self._errHandler.recoverInline(self)
|
3115
|
+
else:
|
3116
|
+
self._errHandler.reportMatch(self)
|
3117
|
+
self.consume()
|
3118
|
+
self.state = 438
|
3119
|
+
self.init_expression(6)
|
3120
|
+
pass
|
3121
|
+
|
3122
|
+
elif la_ == 5:
|
3123
|
+
localctx = GrammarParser.BinaryExprInitContext(
|
3124
|
+
self,
|
3125
|
+
GrammarParser.Init_expressionContext(
|
3126
|
+
self, _parentctx, _parentState
|
3127
|
+
),
|
3128
|
+
)
|
3129
|
+
self.pushNewRecursionContext(
|
3130
|
+
localctx, _startState, self.RULE_init_expression
|
3131
|
+
)
|
3132
|
+
self.state = 439
|
3133
|
+
if not self.precpred(self._ctx, 4):
|
3134
|
+
from antlr4.error.Errors import FailedPredicateException
|
3135
|
+
|
3136
|
+
raise FailedPredicateException(
|
3137
|
+
self, "self.precpred(self._ctx, 4)"
|
3138
|
+
)
|
3139
|
+
self.state = 440
|
3140
|
+
localctx.op = self.match(GrammarParser.T__34)
|
3141
|
+
self.state = 441
|
3142
|
+
self.init_expression(5)
|
3143
|
+
pass
|
3144
|
+
|
3145
|
+
elif la_ == 6:
|
3146
|
+
localctx = GrammarParser.BinaryExprInitContext(
|
3147
|
+
self,
|
3148
|
+
GrammarParser.Init_expressionContext(
|
3149
|
+
self, _parentctx, _parentState
|
3150
|
+
),
|
3151
|
+
)
|
3152
|
+
self.pushNewRecursionContext(
|
3153
|
+
localctx, _startState, self.RULE_init_expression
|
3154
|
+
)
|
3155
|
+
self.state = 442
|
3156
|
+
if not self.precpred(self._ctx, 3):
|
3157
|
+
from antlr4.error.Errors import FailedPredicateException
|
3158
|
+
|
3159
|
+
raise FailedPredicateException(
|
3160
|
+
self, "self.precpred(self._ctx, 3)"
|
3161
|
+
)
|
3162
|
+
self.state = 443
|
3163
|
+
localctx.op = self.match(GrammarParser.T__35)
|
3164
|
+
self.state = 444
|
3165
|
+
self.init_expression(4)
|
3166
|
+
pass
|
3167
|
+
|
3168
|
+
elif la_ == 7:
|
3169
|
+
localctx = GrammarParser.BinaryExprInitContext(
|
3170
|
+
self,
|
3171
|
+
GrammarParser.Init_expressionContext(
|
3172
|
+
self, _parentctx, _parentState
|
3173
|
+
),
|
3174
|
+
)
|
3175
|
+
self.pushNewRecursionContext(
|
3176
|
+
localctx, _startState, self.RULE_init_expression
|
3177
|
+
)
|
3178
|
+
self.state = 445
|
3179
|
+
if not self.precpred(self._ctx, 2):
|
3180
|
+
from antlr4.error.Errors import FailedPredicateException
|
3181
|
+
|
3182
|
+
raise FailedPredicateException(
|
3183
|
+
self, "self.precpred(self._ctx, 2)"
|
3184
|
+
)
|
3185
|
+
self.state = 446
|
3186
|
+
localctx.op = self.match(GrammarParser.T__36)
|
3187
|
+
self.state = 447
|
3188
|
+
self.init_expression(3)
|
3189
|
+
pass
|
3190
|
+
|
3191
|
+
self.state = 452
|
3192
|
+
self._errHandler.sync(self)
|
3193
|
+
_alt = self._interp.adaptivePredict(self._input, 45, self._ctx)
|
3194
|
+
|
3195
|
+
except RecognitionException as re:
|
3196
|
+
localctx.exception = re
|
3197
|
+
self._errHandler.reportError(self, re)
|
3198
|
+
self._errHandler.recover(self, re)
|
3199
|
+
finally:
|
3200
|
+
self.unrollRecursionContexts(_parentctx)
|
3201
|
+
return localctx
|
3202
|
+
|
3203
|
+
class Num_expressionContext(ParserRuleContext):
|
3204
|
+
__slots__ = "parser"
|
3205
|
+
|
3206
|
+
def __init__(
|
3207
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
3208
|
+
):
|
3209
|
+
super().__init__(parent, invokingState)
|
3210
|
+
self.parser = parser
|
3211
|
+
|
3212
|
+
def getRuleIndex(self):
|
3213
|
+
return GrammarParser.RULE_num_expression
|
3214
|
+
|
3215
|
+
def copyFrom(self, ctx: ParserRuleContext):
|
3216
|
+
super().copyFrom(ctx)
|
3217
|
+
|
3218
|
+
class UnaryExprNumContext(Num_expressionContext):
|
3219
|
+
def __init__(
|
3220
|
+
self, parser, ctx: ParserRuleContext
|
3221
|
+
): # actually a GrammarParser.Num_expressionContext
|
3222
|
+
super().__init__(parser)
|
3223
|
+
self.op = None # Token
|
3224
|
+
self.copyFrom(ctx)
|
3225
|
+
|
3226
|
+
def num_expression(self):
|
3227
|
+
return self.getTypedRuleContext(GrammarParser.Num_expressionContext, 0)
|
3228
|
+
|
3229
|
+
def enterRule(self, listener: ParseTreeListener):
|
3230
|
+
if hasattr(listener, "enterUnaryExprNum"):
|
3231
|
+
listener.enterUnaryExprNum(self)
|
3232
|
+
|
3233
|
+
def exitRule(self, listener: ParseTreeListener):
|
3234
|
+
if hasattr(listener, "exitUnaryExprNum"):
|
3235
|
+
listener.exitUnaryExprNum(self)
|
3236
|
+
|
3237
|
+
class FuncExprNumContext(Num_expressionContext):
|
3238
|
+
def __init__(
|
3239
|
+
self, parser, ctx: ParserRuleContext
|
3240
|
+
): # actually a GrammarParser.Num_expressionContext
|
3241
|
+
super().__init__(parser)
|
3242
|
+
self.function = None # Token
|
3243
|
+
self.copyFrom(ctx)
|
3244
|
+
|
3245
|
+
def num_expression(self):
|
3246
|
+
return self.getTypedRuleContext(GrammarParser.Num_expressionContext, 0)
|
3247
|
+
|
3248
|
+
def UFUNC_NAME(self):
|
3249
|
+
return self.getToken(GrammarParser.UFUNC_NAME, 0)
|
3250
|
+
|
3251
|
+
def enterRule(self, listener: ParseTreeListener):
|
3252
|
+
if hasattr(listener, "enterFuncExprNum"):
|
3253
|
+
listener.enterFuncExprNum(self)
|
3254
|
+
|
3255
|
+
def exitRule(self, listener: ParseTreeListener):
|
3256
|
+
if hasattr(listener, "exitFuncExprNum"):
|
3257
|
+
listener.exitFuncExprNum(self)
|
3258
|
+
|
3259
|
+
class ConditionalCStyleExprNumContext(Num_expressionContext):
|
3260
|
+
def __init__(
|
3261
|
+
self, parser, ctx: ParserRuleContext
|
3262
|
+
): # actually a GrammarParser.Num_expressionContext
|
3263
|
+
super().__init__(parser)
|
3264
|
+
self.copyFrom(ctx)
|
3265
|
+
|
3266
|
+
def cond_expression(self):
|
3267
|
+
return self.getTypedRuleContext(GrammarParser.Cond_expressionContext, 0)
|
3268
|
+
|
3269
|
+
def num_expression(self, i: int = None):
|
3270
|
+
if i is None:
|
3271
|
+
return self.getTypedRuleContexts(GrammarParser.Num_expressionContext)
|
3272
|
+
else:
|
3273
|
+
return self.getTypedRuleContext(GrammarParser.Num_expressionContext, i)
|
3274
|
+
|
3275
|
+
def enterRule(self, listener: ParseTreeListener):
|
3276
|
+
if hasattr(listener, "enterConditionalCStyleExprNum"):
|
3277
|
+
listener.enterConditionalCStyleExprNum(self)
|
3278
|
+
|
3279
|
+
def exitRule(self, listener: ParseTreeListener):
|
3280
|
+
if hasattr(listener, "exitConditionalCStyleExprNum"):
|
3281
|
+
listener.exitConditionalCStyleExprNum(self)
|
3282
|
+
|
3283
|
+
class BinaryExprNumContext(Num_expressionContext):
|
3284
|
+
def __init__(
|
3285
|
+
self, parser, ctx: ParserRuleContext
|
3286
|
+
): # actually a GrammarParser.Num_expressionContext
|
3287
|
+
super().__init__(parser)
|
3288
|
+
self.op = None # Token
|
3289
|
+
self.copyFrom(ctx)
|
3290
|
+
|
3291
|
+
def num_expression(self, i: int = None):
|
3292
|
+
if i is None:
|
3293
|
+
return self.getTypedRuleContexts(GrammarParser.Num_expressionContext)
|
3294
|
+
else:
|
3295
|
+
return self.getTypedRuleContext(GrammarParser.Num_expressionContext, i)
|
3296
|
+
|
3297
|
+
def enterRule(self, listener: ParseTreeListener):
|
3298
|
+
if hasattr(listener, "enterBinaryExprNum"):
|
3299
|
+
listener.enterBinaryExprNum(self)
|
3300
|
+
|
3301
|
+
def exitRule(self, listener: ParseTreeListener):
|
3302
|
+
if hasattr(listener, "exitBinaryExprNum"):
|
3303
|
+
listener.exitBinaryExprNum(self)
|
3304
|
+
|
3305
|
+
class LiteralExprNumContext(Num_expressionContext):
|
3306
|
+
def __init__(
|
3307
|
+
self, parser, ctx: ParserRuleContext
|
3308
|
+
): # actually a GrammarParser.Num_expressionContext
|
3309
|
+
super().__init__(parser)
|
3310
|
+
self.copyFrom(ctx)
|
3311
|
+
|
3312
|
+
def num_literal(self):
|
3313
|
+
return self.getTypedRuleContext(GrammarParser.Num_literalContext, 0)
|
3314
|
+
|
3315
|
+
def enterRule(self, listener: ParseTreeListener):
|
3316
|
+
if hasattr(listener, "enterLiteralExprNum"):
|
3317
|
+
listener.enterLiteralExprNum(self)
|
3318
|
+
|
3319
|
+
def exitRule(self, listener: ParseTreeListener):
|
3320
|
+
if hasattr(listener, "exitLiteralExprNum"):
|
3321
|
+
listener.exitLiteralExprNum(self)
|
3322
|
+
|
3323
|
+
class MathConstExprNumContext(Num_expressionContext):
|
3324
|
+
def __init__(
|
3325
|
+
self, parser, ctx: ParserRuleContext
|
3326
|
+
): # actually a GrammarParser.Num_expressionContext
|
3327
|
+
super().__init__(parser)
|
3328
|
+
self.copyFrom(ctx)
|
3329
|
+
|
3330
|
+
def math_const(self):
|
3331
|
+
return self.getTypedRuleContext(GrammarParser.Math_constContext, 0)
|
3332
|
+
|
3333
|
+
def enterRule(self, listener: ParseTreeListener):
|
3334
|
+
if hasattr(listener, "enterMathConstExprNum"):
|
3335
|
+
listener.enterMathConstExprNum(self)
|
3336
|
+
|
3337
|
+
def exitRule(self, listener: ParseTreeListener):
|
3338
|
+
if hasattr(listener, "exitMathConstExprNum"):
|
3339
|
+
listener.exitMathConstExprNum(self)
|
3340
|
+
|
3341
|
+
class ParenExprNumContext(Num_expressionContext):
|
3342
|
+
def __init__(
|
3343
|
+
self, parser, ctx: ParserRuleContext
|
3344
|
+
): # actually a GrammarParser.Num_expressionContext
|
3345
|
+
super().__init__(parser)
|
3346
|
+
self.copyFrom(ctx)
|
3347
|
+
|
3348
|
+
def num_expression(self):
|
3349
|
+
return self.getTypedRuleContext(GrammarParser.Num_expressionContext, 0)
|
3350
|
+
|
3351
|
+
def enterRule(self, listener: ParseTreeListener):
|
3352
|
+
if hasattr(listener, "enterParenExprNum"):
|
3353
|
+
listener.enterParenExprNum(self)
|
3354
|
+
|
3355
|
+
def exitRule(self, listener: ParseTreeListener):
|
3356
|
+
if hasattr(listener, "exitParenExprNum"):
|
3357
|
+
listener.exitParenExprNum(self)
|
3358
|
+
|
3359
|
+
class IdExprNumContext(Num_expressionContext):
|
3360
|
+
def __init__(
|
3361
|
+
self, parser, ctx: ParserRuleContext
|
3362
|
+
): # actually a GrammarParser.Num_expressionContext
|
3363
|
+
super().__init__(parser)
|
3364
|
+
self.copyFrom(ctx)
|
3365
|
+
|
3366
|
+
def ID(self):
|
3367
|
+
return self.getToken(GrammarParser.ID, 0)
|
3368
|
+
|
3369
|
+
def enterRule(self, listener: ParseTreeListener):
|
3370
|
+
if hasattr(listener, "enterIdExprNum"):
|
3371
|
+
listener.enterIdExprNum(self)
|
3372
|
+
|
3373
|
+
def exitRule(self, listener: ParseTreeListener):
|
3374
|
+
if hasattr(listener, "exitIdExprNum"):
|
3375
|
+
listener.exitIdExprNum(self)
|
3376
|
+
|
3377
|
+
def num_expression(self, _p: int = 0):
|
3378
|
+
_parentctx = self._ctx
|
3379
|
+
_parentState = self.state
|
3380
|
+
localctx = GrammarParser.Num_expressionContext(self, self._ctx, _parentState)
|
3381
|
+
_prevctx = localctx
|
3382
|
+
_startState = 42
|
3383
|
+
self.enterRecursionRule(localctx, 42, self.RULE_num_expression, _p)
|
3384
|
+
self._la = 0 # Token type
|
3385
|
+
try:
|
3386
|
+
self.enterOuterAlt(localctx, 1)
|
3387
|
+
self.state = 476
|
3388
|
+
self._errHandler.sync(self)
|
3389
|
+
la_ = self._interp.adaptivePredict(self._input, 46, self._ctx)
|
3390
|
+
if la_ == 1:
|
3391
|
+
localctx = GrammarParser.ParenExprNumContext(self, localctx)
|
3392
|
+
self._ctx = localctx
|
3393
|
+
_prevctx = localctx
|
3394
|
+
|
3395
|
+
self.state = 454
|
3396
|
+
self.match(GrammarParser.T__26)
|
3397
|
+
self.state = 455
|
3398
|
+
self.num_expression(0)
|
3399
|
+
self.state = 456
|
3400
|
+
self.match(GrammarParser.T__27)
|
3401
|
+
pass
|
3402
|
+
|
3403
|
+
elif la_ == 2:
|
3404
|
+
localctx = GrammarParser.LiteralExprNumContext(self, localctx)
|
3405
|
+
self._ctx = localctx
|
3406
|
+
_prevctx = localctx
|
3407
|
+
self.state = 458
|
3408
|
+
self.num_literal()
|
3409
|
+
pass
|
3410
|
+
|
3411
|
+
elif la_ == 3:
|
3412
|
+
localctx = GrammarParser.IdExprNumContext(self, localctx)
|
3413
|
+
self._ctx = localctx
|
3414
|
+
_prevctx = localctx
|
3415
|
+
self.state = 459
|
3416
|
+
self.match(GrammarParser.ID)
|
3417
|
+
pass
|
3418
|
+
|
3419
|
+
elif la_ == 4:
|
3420
|
+
localctx = GrammarParser.MathConstExprNumContext(self, localctx)
|
3421
|
+
self._ctx = localctx
|
3422
|
+
_prevctx = localctx
|
3423
|
+
self.state = 460
|
3424
|
+
self.math_const()
|
3425
|
+
pass
|
3426
|
+
|
3427
|
+
elif la_ == 5:
|
3428
|
+
localctx = GrammarParser.UnaryExprNumContext(self, localctx)
|
3429
|
+
self._ctx = localctx
|
3430
|
+
_prevctx = localctx
|
3431
|
+
self.state = 461
|
3432
|
+
localctx.op = self._input.LT(1)
|
3433
|
+
_la = self._input.LA(1)
|
3434
|
+
if not (_la == GrammarParser.T__28 or _la == GrammarParser.T__29):
|
3435
|
+
localctx.op = self._errHandler.recoverInline(self)
|
3436
|
+
else:
|
3437
|
+
self._errHandler.reportMatch(self)
|
3438
|
+
self.consume()
|
3439
|
+
self.state = 462
|
3440
|
+
self.num_expression(10)
|
3441
|
+
pass
|
3442
|
+
|
3443
|
+
elif la_ == 6:
|
3444
|
+
localctx = GrammarParser.FuncExprNumContext(self, localctx)
|
3445
|
+
self._ctx = localctx
|
3446
|
+
_prevctx = localctx
|
3447
|
+
self.state = 463
|
3448
|
+
localctx.function = self.match(GrammarParser.UFUNC_NAME)
|
3449
|
+
self.state = 464
|
3450
|
+
self.match(GrammarParser.T__26)
|
3451
|
+
self.state = 465
|
3452
|
+
self.num_expression(0)
|
3453
|
+
self.state = 466
|
3454
|
+
self.match(GrammarParser.T__27)
|
3455
|
+
pass
|
3456
|
+
|
3457
|
+
elif la_ == 7:
|
3458
|
+
localctx = GrammarParser.ConditionalCStyleExprNumContext(self, localctx)
|
3459
|
+
self._ctx = localctx
|
3460
|
+
_prevctx = localctx
|
3461
|
+
self.state = 468
|
3462
|
+
self.match(GrammarParser.T__26)
|
3463
|
+
self.state = 469
|
3464
|
+
self.cond_expression(0)
|
3465
|
+
self.state = 470
|
3466
|
+
self.match(GrammarParser.T__27)
|
3467
|
+
self.state = 471
|
3468
|
+
self.match(GrammarParser.T__37)
|
3469
|
+
self.state = 472
|
3470
|
+
self.num_expression(0)
|
3471
|
+
self.state = 473
|
3472
|
+
self.match(GrammarParser.T__10)
|
3473
|
+
self.state = 474
|
3474
|
+
self.num_expression(1)
|
3475
|
+
pass
|
3476
|
+
|
3477
|
+
self._ctx.stop = self._input.LT(-1)
|
3478
|
+
self.state = 501
|
3479
|
+
self._errHandler.sync(self)
|
3480
|
+
_alt = self._interp.adaptivePredict(self._input, 48, self._ctx)
|
3481
|
+
while _alt != 2 and _alt != ATN.INVALID_ALT_NUMBER:
|
3482
|
+
if _alt == 1:
|
3483
|
+
if self._parseListeners is not None:
|
3484
|
+
self.triggerExitRuleEvent()
|
3485
|
+
_prevctx = localctx
|
3486
|
+
self.state = 499
|
3487
|
+
self._errHandler.sync(self)
|
3488
|
+
la_ = self._interp.adaptivePredict(self._input, 47, self._ctx)
|
3489
|
+
if la_ == 1:
|
3490
|
+
localctx = GrammarParser.BinaryExprNumContext(
|
3491
|
+
self,
|
3492
|
+
GrammarParser.Num_expressionContext(
|
3493
|
+
self, _parentctx, _parentState
|
3494
|
+
),
|
3495
|
+
)
|
3496
|
+
self.pushNewRecursionContext(
|
3497
|
+
localctx, _startState, self.RULE_num_expression
|
3498
|
+
)
|
3499
|
+
self.state = 478
|
3500
|
+
if not self.precpred(self._ctx, 9):
|
3501
|
+
from antlr4.error.Errors import FailedPredicateException
|
3502
|
+
|
3503
|
+
raise FailedPredicateException(
|
3504
|
+
self, "self.precpred(self._ctx, 9)"
|
3505
|
+
)
|
3506
|
+
self.state = 479
|
3507
|
+
localctx.op = self.match(GrammarParser.T__30)
|
3508
|
+
self.state = 480
|
3509
|
+
self.num_expression(9)
|
3510
|
+
pass
|
3511
|
+
|
3512
|
+
elif la_ == 2:
|
3513
|
+
localctx = GrammarParser.BinaryExprNumContext(
|
3514
|
+
self,
|
3515
|
+
GrammarParser.Num_expressionContext(
|
3516
|
+
self, _parentctx, _parentState
|
3517
|
+
),
|
3518
|
+
)
|
3519
|
+
self.pushNewRecursionContext(
|
3520
|
+
localctx, _startState, self.RULE_num_expression
|
3521
|
+
)
|
3522
|
+
self.state = 481
|
3523
|
+
if not self.precpred(self._ctx, 8):
|
3524
|
+
from antlr4.error.Errors import FailedPredicateException
|
3525
|
+
|
3526
|
+
raise FailedPredicateException(
|
3527
|
+
self, "self.precpred(self._ctx, 8)"
|
3528
|
+
)
|
3529
|
+
self.state = 482
|
3530
|
+
localctx.op = self._input.LT(1)
|
3531
|
+
_la = self._input.LA(1)
|
3532
|
+
if not (
|
3533
|
+
((_la) & ~0x3F) == 0
|
3534
|
+
and (
|
3535
|
+
(1 << _la)
|
3536
|
+
& (
|
3537
|
+
(1 << GrammarParser.T__17)
|
3538
|
+
| (1 << GrammarParser.T__31)
|
3539
|
+
| (1 << GrammarParser.T__32)
|
3540
|
+
)
|
3541
|
+
)
|
3542
|
+
!= 0
|
3543
|
+
):
|
3544
|
+
localctx.op = self._errHandler.recoverInline(self)
|
3545
|
+
else:
|
3546
|
+
self._errHandler.reportMatch(self)
|
3547
|
+
self.consume()
|
3548
|
+
self.state = 483
|
3549
|
+
self.num_expression(9)
|
3550
|
+
pass
|
3551
|
+
|
3552
|
+
elif la_ == 3:
|
3553
|
+
localctx = GrammarParser.BinaryExprNumContext(
|
3554
|
+
self,
|
3555
|
+
GrammarParser.Num_expressionContext(
|
3556
|
+
self, _parentctx, _parentState
|
3557
|
+
),
|
3558
|
+
)
|
3559
|
+
self.pushNewRecursionContext(
|
3560
|
+
localctx, _startState, self.RULE_num_expression
|
3561
|
+
)
|
3562
|
+
self.state = 484
|
3563
|
+
if not self.precpred(self._ctx, 7):
|
3564
|
+
from antlr4.error.Errors import FailedPredicateException
|
3565
|
+
|
3566
|
+
raise FailedPredicateException(
|
3567
|
+
self, "self.precpred(self._ctx, 7)"
|
3568
|
+
)
|
3569
|
+
self.state = 485
|
3570
|
+
localctx.op = self._input.LT(1)
|
3571
|
+
_la = self._input.LA(1)
|
3572
|
+
if not (
|
3573
|
+
_la == GrammarParser.T__28 or _la == GrammarParser.T__29
|
3574
|
+
):
|
3575
|
+
localctx.op = self._errHandler.recoverInline(self)
|
3576
|
+
else:
|
3577
|
+
self._errHandler.reportMatch(self)
|
3578
|
+
self.consume()
|
3579
|
+
self.state = 486
|
3580
|
+
self.num_expression(8)
|
3581
|
+
pass
|
3582
|
+
|
3583
|
+
elif la_ == 4:
|
3584
|
+
localctx = GrammarParser.BinaryExprNumContext(
|
3585
|
+
self,
|
3586
|
+
GrammarParser.Num_expressionContext(
|
3587
|
+
self, _parentctx, _parentState
|
3588
|
+
),
|
3589
|
+
)
|
3590
|
+
self.pushNewRecursionContext(
|
3591
|
+
localctx, _startState, self.RULE_num_expression
|
3592
|
+
)
|
3593
|
+
self.state = 487
|
3594
|
+
if not self.precpred(self._ctx, 6):
|
3595
|
+
from antlr4.error.Errors import FailedPredicateException
|
3596
|
+
|
3597
|
+
raise FailedPredicateException(
|
3598
|
+
self, "self.precpred(self._ctx, 6)"
|
3599
|
+
)
|
3600
|
+
self.state = 488
|
3601
|
+
localctx.op = self._input.LT(1)
|
3602
|
+
_la = self._input.LA(1)
|
3603
|
+
if not (
|
3604
|
+
_la == GrammarParser.T__24 or _la == GrammarParser.T__33
|
3605
|
+
):
|
3606
|
+
localctx.op = self._errHandler.recoverInline(self)
|
3607
|
+
else:
|
3608
|
+
self._errHandler.reportMatch(self)
|
3609
|
+
self.consume()
|
3610
|
+
self.state = 489
|
3611
|
+
self.num_expression(7)
|
3612
|
+
pass
|
3613
|
+
|
3614
|
+
elif la_ == 5:
|
3615
|
+
localctx = GrammarParser.BinaryExprNumContext(
|
3616
|
+
self,
|
3617
|
+
GrammarParser.Num_expressionContext(
|
3618
|
+
self, _parentctx, _parentState
|
3619
|
+
),
|
3620
|
+
)
|
3621
|
+
self.pushNewRecursionContext(
|
3622
|
+
localctx, _startState, self.RULE_num_expression
|
3623
|
+
)
|
3624
|
+
self.state = 490
|
3625
|
+
if not self.precpred(self._ctx, 5):
|
3626
|
+
from antlr4.error.Errors import FailedPredicateException
|
3627
|
+
|
3628
|
+
raise FailedPredicateException(
|
3629
|
+
self, "self.precpred(self._ctx, 5)"
|
3630
|
+
)
|
3631
|
+
self.state = 491
|
3632
|
+
localctx.op = self.match(GrammarParser.T__34)
|
3633
|
+
self.state = 492
|
3634
|
+
self.num_expression(6)
|
3635
|
+
pass
|
3636
|
+
|
3637
|
+
elif la_ == 6:
|
3638
|
+
localctx = GrammarParser.BinaryExprNumContext(
|
3639
|
+
self,
|
3640
|
+
GrammarParser.Num_expressionContext(
|
3641
|
+
self, _parentctx, _parentState
|
3642
|
+
),
|
3643
|
+
)
|
3644
|
+
self.pushNewRecursionContext(
|
3645
|
+
localctx, _startState, self.RULE_num_expression
|
3646
|
+
)
|
3647
|
+
self.state = 493
|
3648
|
+
if not self.precpred(self._ctx, 4):
|
3649
|
+
from antlr4.error.Errors import FailedPredicateException
|
3650
|
+
|
3651
|
+
raise FailedPredicateException(
|
3652
|
+
self, "self.precpred(self._ctx, 4)"
|
3653
|
+
)
|
3654
|
+
self.state = 494
|
3655
|
+
localctx.op = self.match(GrammarParser.T__35)
|
3656
|
+
self.state = 495
|
3657
|
+
self.num_expression(5)
|
3658
|
+
pass
|
3659
|
+
|
3660
|
+
elif la_ == 7:
|
3661
|
+
localctx = GrammarParser.BinaryExprNumContext(
|
3662
|
+
self,
|
3663
|
+
GrammarParser.Num_expressionContext(
|
3664
|
+
self, _parentctx, _parentState
|
3665
|
+
),
|
3666
|
+
)
|
3667
|
+
self.pushNewRecursionContext(
|
3668
|
+
localctx, _startState, self.RULE_num_expression
|
3669
|
+
)
|
3670
|
+
self.state = 496
|
3671
|
+
if not self.precpred(self._ctx, 3):
|
3672
|
+
from antlr4.error.Errors import FailedPredicateException
|
3673
|
+
|
3674
|
+
raise FailedPredicateException(
|
3675
|
+
self, "self.precpred(self._ctx, 3)"
|
3676
|
+
)
|
3677
|
+
self.state = 497
|
3678
|
+
localctx.op = self.match(GrammarParser.T__36)
|
3679
|
+
self.state = 498
|
3680
|
+
self.num_expression(4)
|
3681
|
+
pass
|
3682
|
+
|
3683
|
+
self.state = 503
|
3684
|
+
self._errHandler.sync(self)
|
3685
|
+
_alt = self._interp.adaptivePredict(self._input, 48, self._ctx)
|
3686
|
+
|
3687
|
+
except RecognitionException as re:
|
3688
|
+
localctx.exception = re
|
3689
|
+
self._errHandler.reportError(self, re)
|
3690
|
+
self._errHandler.recover(self, re)
|
3691
|
+
finally:
|
3692
|
+
self.unrollRecursionContexts(_parentctx)
|
3693
|
+
return localctx
|
3694
|
+
|
3695
|
+
class Cond_expressionContext(ParserRuleContext):
|
3696
|
+
__slots__ = "parser"
|
3697
|
+
|
3698
|
+
def __init__(
|
3699
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
3700
|
+
):
|
3701
|
+
super().__init__(parent, invokingState)
|
3702
|
+
self.parser = parser
|
3703
|
+
|
3704
|
+
def getRuleIndex(self):
|
3705
|
+
return GrammarParser.RULE_cond_expression
|
3706
|
+
|
3707
|
+
def copyFrom(self, ctx: ParserRuleContext):
|
3708
|
+
super().copyFrom(ctx)
|
3709
|
+
|
3710
|
+
class BinaryExprFromCondCondContext(Cond_expressionContext):
|
3711
|
+
def __init__(
|
3712
|
+
self, parser, ctx: ParserRuleContext
|
3713
|
+
): # actually a GrammarParser.Cond_expressionContext
|
3714
|
+
super().__init__(parser)
|
3715
|
+
self.op = None # Token
|
3716
|
+
self.copyFrom(ctx)
|
3717
|
+
|
3718
|
+
def cond_expression(self, i: int = None):
|
3719
|
+
if i is None:
|
3720
|
+
return self.getTypedRuleContexts(GrammarParser.Cond_expressionContext)
|
3721
|
+
else:
|
3722
|
+
return self.getTypedRuleContext(GrammarParser.Cond_expressionContext, i)
|
3723
|
+
|
3724
|
+
def enterRule(self, listener: ParseTreeListener):
|
3725
|
+
if hasattr(listener, "enterBinaryExprFromCondCond"):
|
3726
|
+
listener.enterBinaryExprFromCondCond(self)
|
3727
|
+
|
3728
|
+
def exitRule(self, listener: ParseTreeListener):
|
3729
|
+
if hasattr(listener, "exitBinaryExprFromCondCond"):
|
3730
|
+
listener.exitBinaryExprFromCondCond(self)
|
3731
|
+
|
3732
|
+
class BinaryExprCondContext(Cond_expressionContext):
|
3733
|
+
def __init__(
|
3734
|
+
self, parser, ctx: ParserRuleContext
|
3735
|
+
): # actually a GrammarParser.Cond_expressionContext
|
3736
|
+
super().__init__(parser)
|
3737
|
+
self.op = None # Token
|
3738
|
+
self.copyFrom(ctx)
|
3739
|
+
|
3740
|
+
def cond_expression(self, i: int = None):
|
3741
|
+
if i is None:
|
3742
|
+
return self.getTypedRuleContexts(GrammarParser.Cond_expressionContext)
|
3743
|
+
else:
|
3744
|
+
return self.getTypedRuleContext(GrammarParser.Cond_expressionContext, i)
|
3745
|
+
|
3746
|
+
def enterRule(self, listener: ParseTreeListener):
|
3747
|
+
if hasattr(listener, "enterBinaryExprCond"):
|
3748
|
+
listener.enterBinaryExprCond(self)
|
3749
|
+
|
3750
|
+
def exitRule(self, listener: ParseTreeListener):
|
3751
|
+
if hasattr(listener, "exitBinaryExprCond"):
|
3752
|
+
listener.exitBinaryExprCond(self)
|
3753
|
+
|
3754
|
+
class BinaryExprFromNumCondContext(Cond_expressionContext):
|
3755
|
+
def __init__(
|
3756
|
+
self, parser, ctx: ParserRuleContext
|
3757
|
+
): # actually a GrammarParser.Cond_expressionContext
|
3758
|
+
super().__init__(parser)
|
3759
|
+
self.op = None # Token
|
3760
|
+
self.copyFrom(ctx)
|
3761
|
+
|
3762
|
+
def num_expression(self, i: int = None):
|
3763
|
+
if i is None:
|
3764
|
+
return self.getTypedRuleContexts(GrammarParser.Num_expressionContext)
|
3765
|
+
else:
|
3766
|
+
return self.getTypedRuleContext(GrammarParser.Num_expressionContext, i)
|
3767
|
+
|
3768
|
+
def enterRule(self, listener: ParseTreeListener):
|
3769
|
+
if hasattr(listener, "enterBinaryExprFromNumCond"):
|
3770
|
+
listener.enterBinaryExprFromNumCond(self)
|
3771
|
+
|
3772
|
+
def exitRule(self, listener: ParseTreeListener):
|
3773
|
+
if hasattr(listener, "exitBinaryExprFromNumCond"):
|
3774
|
+
listener.exitBinaryExprFromNumCond(self)
|
3775
|
+
|
3776
|
+
class UnaryExprCondContext(Cond_expressionContext):
|
3777
|
+
def __init__(
|
3778
|
+
self, parser, ctx: ParserRuleContext
|
3779
|
+
): # actually a GrammarParser.Cond_expressionContext
|
3780
|
+
super().__init__(parser)
|
3781
|
+
self.op = None # Token
|
3782
|
+
self.copyFrom(ctx)
|
3783
|
+
|
3784
|
+
def cond_expression(self):
|
3785
|
+
return self.getTypedRuleContext(GrammarParser.Cond_expressionContext, 0)
|
3786
|
+
|
3787
|
+
def enterRule(self, listener: ParseTreeListener):
|
3788
|
+
if hasattr(listener, "enterUnaryExprCond"):
|
3789
|
+
listener.enterUnaryExprCond(self)
|
3790
|
+
|
3791
|
+
def exitRule(self, listener: ParseTreeListener):
|
3792
|
+
if hasattr(listener, "exitUnaryExprCond"):
|
3793
|
+
listener.exitUnaryExprCond(self)
|
3794
|
+
|
3795
|
+
class ParenExprCondContext(Cond_expressionContext):
|
3796
|
+
def __init__(
|
3797
|
+
self, parser, ctx: ParserRuleContext
|
3798
|
+
): # actually a GrammarParser.Cond_expressionContext
|
3799
|
+
super().__init__(parser)
|
3800
|
+
self.copyFrom(ctx)
|
3801
|
+
|
3802
|
+
def cond_expression(self):
|
3803
|
+
return self.getTypedRuleContext(GrammarParser.Cond_expressionContext, 0)
|
3804
|
+
|
3805
|
+
def enterRule(self, listener: ParseTreeListener):
|
3806
|
+
if hasattr(listener, "enterParenExprCond"):
|
3807
|
+
listener.enterParenExprCond(self)
|
3808
|
+
|
3809
|
+
def exitRule(self, listener: ParseTreeListener):
|
3810
|
+
if hasattr(listener, "exitParenExprCond"):
|
3811
|
+
listener.exitParenExprCond(self)
|
3812
|
+
|
3813
|
+
class LiteralExprCondContext(Cond_expressionContext):
|
3814
|
+
def __init__(
|
3815
|
+
self, parser, ctx: ParserRuleContext
|
3816
|
+
): # actually a GrammarParser.Cond_expressionContext
|
3817
|
+
super().__init__(parser)
|
3818
|
+
self.copyFrom(ctx)
|
3819
|
+
|
3820
|
+
def bool_literal(self):
|
3821
|
+
return self.getTypedRuleContext(GrammarParser.Bool_literalContext, 0)
|
3822
|
+
|
3823
|
+
def enterRule(self, listener: ParseTreeListener):
|
3824
|
+
if hasattr(listener, "enterLiteralExprCond"):
|
3825
|
+
listener.enterLiteralExprCond(self)
|
3826
|
+
|
3827
|
+
def exitRule(self, listener: ParseTreeListener):
|
3828
|
+
if hasattr(listener, "exitLiteralExprCond"):
|
3829
|
+
listener.exitLiteralExprCond(self)
|
3830
|
+
|
3831
|
+
class ConditionalCStyleCondNumContext(Cond_expressionContext):
|
3832
|
+
def __init__(
|
3833
|
+
self, parser, ctx: ParserRuleContext
|
3834
|
+
): # actually a GrammarParser.Cond_expressionContext
|
3835
|
+
super().__init__(parser)
|
3836
|
+
self.copyFrom(ctx)
|
3837
|
+
|
3838
|
+
def cond_expression(self, i: int = None):
|
3839
|
+
if i is None:
|
3840
|
+
return self.getTypedRuleContexts(GrammarParser.Cond_expressionContext)
|
3841
|
+
else:
|
3842
|
+
return self.getTypedRuleContext(GrammarParser.Cond_expressionContext, i)
|
3843
|
+
|
3844
|
+
def enterRule(self, listener: ParseTreeListener):
|
3845
|
+
if hasattr(listener, "enterConditionalCStyleCondNum"):
|
3846
|
+
listener.enterConditionalCStyleCondNum(self)
|
3847
|
+
|
3848
|
+
def exitRule(self, listener: ParseTreeListener):
|
3849
|
+
if hasattr(listener, "exitConditionalCStyleCondNum"):
|
3850
|
+
listener.exitConditionalCStyleCondNum(self)
|
3851
|
+
|
3852
|
+
def cond_expression(self, _p: int = 0):
|
3853
|
+
_parentctx = self._ctx
|
3854
|
+
_parentState = self.state
|
3855
|
+
localctx = GrammarParser.Cond_expressionContext(self, self._ctx, _parentState)
|
3856
|
+
_prevctx = localctx
|
3857
|
+
_startState = 44
|
3858
|
+
self.enterRecursionRule(localctx, 44, self.RULE_cond_expression, _p)
|
3859
|
+
self._la = 0 # Token type
|
3860
|
+
try:
|
3861
|
+
self.enterOuterAlt(localctx, 1)
|
3862
|
+
self.state = 528
|
3863
|
+
self._errHandler.sync(self)
|
3864
|
+
la_ = self._interp.adaptivePredict(self._input, 49, self._ctx)
|
3865
|
+
if la_ == 1:
|
3866
|
+
localctx = GrammarParser.ParenExprCondContext(self, localctx)
|
3867
|
+
self._ctx = localctx
|
3868
|
+
_prevctx = localctx
|
3869
|
+
|
3870
|
+
self.state = 505
|
3871
|
+
self.match(GrammarParser.T__26)
|
3872
|
+
self.state = 506
|
3873
|
+
self.cond_expression(0)
|
3874
|
+
self.state = 507
|
3875
|
+
self.match(GrammarParser.T__27)
|
3876
|
+
pass
|
3877
|
+
|
3878
|
+
elif la_ == 2:
|
3879
|
+
localctx = GrammarParser.LiteralExprCondContext(self, localctx)
|
3880
|
+
self._ctx = localctx
|
3881
|
+
_prevctx = localctx
|
3882
|
+
self.state = 509
|
3883
|
+
self.bool_literal()
|
3884
|
+
pass
|
3885
|
+
|
3886
|
+
elif la_ == 3:
|
3887
|
+
localctx = GrammarParser.UnaryExprCondContext(self, localctx)
|
3888
|
+
self._ctx = localctx
|
3889
|
+
_prevctx = localctx
|
3890
|
+
self.state = 510
|
3891
|
+
localctx.op = self._input.LT(1)
|
3892
|
+
_la = self._input.LA(1)
|
3893
|
+
if not (_la == GrammarParser.T__16 or _la == GrammarParser.T__38):
|
3894
|
+
localctx.op = self._errHandler.recoverInline(self)
|
3895
|
+
else:
|
3896
|
+
self._errHandler.reportMatch(self)
|
3897
|
+
self.consume()
|
3898
|
+
self.state = 511
|
3899
|
+
self.cond_expression(7)
|
3900
|
+
pass
|
3901
|
+
|
3902
|
+
elif la_ == 4:
|
3903
|
+
localctx = GrammarParser.BinaryExprFromNumCondContext(self, localctx)
|
3904
|
+
self._ctx = localctx
|
3905
|
+
_prevctx = localctx
|
3906
|
+
self.state = 512
|
3907
|
+
self.num_expression(0)
|
3908
|
+
self.state = 513
|
3909
|
+
localctx.op = self._input.LT(1)
|
3910
|
+
_la = self._input.LA(1)
|
3911
|
+
if not (
|
3912
|
+
((_la) & ~0x3F) == 0
|
3913
|
+
and (
|
3914
|
+
(1 << _la)
|
3915
|
+
& (
|
3916
|
+
(1 << GrammarParser.T__39)
|
3917
|
+
| (1 << GrammarParser.T__40)
|
3918
|
+
| (1 << GrammarParser.T__41)
|
3919
|
+
| (1 << GrammarParser.T__42)
|
3920
|
+
)
|
3921
|
+
)
|
3922
|
+
!= 0
|
3923
|
+
):
|
3924
|
+
localctx.op = self._errHandler.recoverInline(self)
|
3925
|
+
else:
|
3926
|
+
self._errHandler.reportMatch(self)
|
3927
|
+
self.consume()
|
3928
|
+
self.state = 514
|
3929
|
+
self.num_expression(0)
|
3930
|
+
pass
|
3931
|
+
|
3932
|
+
elif la_ == 5:
|
3933
|
+
localctx = GrammarParser.BinaryExprFromNumCondContext(self, localctx)
|
3934
|
+
self._ctx = localctx
|
3935
|
+
_prevctx = localctx
|
3936
|
+
self.state = 516
|
3937
|
+
self.num_expression(0)
|
3938
|
+
self.state = 517
|
3939
|
+
localctx.op = self._input.LT(1)
|
3940
|
+
_la = self._input.LA(1)
|
3941
|
+
if not (_la == GrammarParser.T__43 or _la == GrammarParser.T__44):
|
3942
|
+
localctx.op = self._errHandler.recoverInline(self)
|
3943
|
+
else:
|
3944
|
+
self._errHandler.reportMatch(self)
|
3945
|
+
self.consume()
|
3946
|
+
self.state = 518
|
3947
|
+
self.num_expression(0)
|
3948
|
+
pass
|
3949
|
+
|
3950
|
+
elif la_ == 6:
|
3951
|
+
localctx = GrammarParser.ConditionalCStyleCondNumContext(self, localctx)
|
3952
|
+
self._ctx = localctx
|
3953
|
+
_prevctx = localctx
|
3954
|
+
self.state = 520
|
3955
|
+
self.match(GrammarParser.T__26)
|
3956
|
+
self.state = 521
|
3957
|
+
self.cond_expression(0)
|
3958
|
+
self.state = 522
|
3959
|
+
self.match(GrammarParser.T__27)
|
3960
|
+
self.state = 523
|
3961
|
+
self.match(GrammarParser.T__37)
|
3962
|
+
self.state = 524
|
3963
|
+
self.cond_expression(0)
|
3964
|
+
self.state = 525
|
3965
|
+
self.match(GrammarParser.T__10)
|
3966
|
+
self.state = 526
|
3967
|
+
self.cond_expression(1)
|
3968
|
+
pass
|
3969
|
+
|
3970
|
+
self._ctx.stop = self._input.LT(-1)
|
3971
|
+
self.state = 541
|
3972
|
+
self._errHandler.sync(self)
|
3973
|
+
_alt = self._interp.adaptivePredict(self._input, 51, self._ctx)
|
3974
|
+
while _alt != 2 and _alt != ATN.INVALID_ALT_NUMBER:
|
3975
|
+
if _alt == 1:
|
3976
|
+
if self._parseListeners is not None:
|
3977
|
+
self.triggerExitRuleEvent()
|
3978
|
+
_prevctx = localctx
|
3979
|
+
self.state = 539
|
3980
|
+
self._errHandler.sync(self)
|
3981
|
+
la_ = self._interp.adaptivePredict(self._input, 50, self._ctx)
|
3982
|
+
if la_ == 1:
|
3983
|
+
localctx = GrammarParser.BinaryExprFromCondCondContext(
|
3984
|
+
self,
|
3985
|
+
GrammarParser.Cond_expressionContext(
|
3986
|
+
self, _parentctx, _parentState
|
3987
|
+
),
|
3988
|
+
)
|
3989
|
+
self.pushNewRecursionContext(
|
3990
|
+
localctx, _startState, self.RULE_cond_expression
|
3991
|
+
)
|
3992
|
+
self.state = 530
|
3993
|
+
if not self.precpred(self._ctx, 4):
|
3994
|
+
from antlr4.error.Errors import FailedPredicateException
|
3995
|
+
|
3996
|
+
raise FailedPredicateException(
|
3997
|
+
self, "self.precpred(self._ctx, 4)"
|
3998
|
+
)
|
3999
|
+
self.state = 531
|
4000
|
+
localctx.op = self._input.LT(1)
|
4001
|
+
_la = self._input.LA(1)
|
4002
|
+
if not (
|
4003
|
+
_la == GrammarParser.T__43 or _la == GrammarParser.T__44
|
4004
|
+
):
|
4005
|
+
localctx.op = self._errHandler.recoverInline(self)
|
4006
|
+
else:
|
4007
|
+
self._errHandler.reportMatch(self)
|
4008
|
+
self.consume()
|
4009
|
+
self.state = 532
|
4010
|
+
self.cond_expression(5)
|
4011
|
+
pass
|
4012
|
+
|
4013
|
+
elif la_ == 2:
|
4014
|
+
localctx = GrammarParser.BinaryExprCondContext(
|
4015
|
+
self,
|
4016
|
+
GrammarParser.Cond_expressionContext(
|
4017
|
+
self, _parentctx, _parentState
|
4018
|
+
),
|
4019
|
+
)
|
4020
|
+
self.pushNewRecursionContext(
|
4021
|
+
localctx, _startState, self.RULE_cond_expression
|
4022
|
+
)
|
4023
|
+
self.state = 533
|
4024
|
+
if not self.precpred(self._ctx, 3):
|
4025
|
+
from antlr4.error.Errors import FailedPredicateException
|
4026
|
+
|
4027
|
+
raise FailedPredicateException(
|
4028
|
+
self, "self.precpred(self._ctx, 3)"
|
4029
|
+
)
|
4030
|
+
self.state = 534
|
4031
|
+
localctx.op = self._input.LT(1)
|
4032
|
+
_la = self._input.LA(1)
|
4033
|
+
if not (
|
4034
|
+
_la == GrammarParser.T__45 or _la == GrammarParser.T__46
|
4035
|
+
):
|
4036
|
+
localctx.op = self._errHandler.recoverInline(self)
|
4037
|
+
else:
|
4038
|
+
self._errHandler.reportMatch(self)
|
4039
|
+
self.consume()
|
4040
|
+
self.state = 535
|
4041
|
+
self.cond_expression(4)
|
4042
|
+
pass
|
4043
|
+
|
4044
|
+
elif la_ == 3:
|
4045
|
+
localctx = GrammarParser.BinaryExprCondContext(
|
4046
|
+
self,
|
4047
|
+
GrammarParser.Cond_expressionContext(
|
4048
|
+
self, _parentctx, _parentState
|
4049
|
+
),
|
4050
|
+
)
|
4051
|
+
self.pushNewRecursionContext(
|
4052
|
+
localctx, _startState, self.RULE_cond_expression
|
4053
|
+
)
|
4054
|
+
self.state = 536
|
4055
|
+
if not self.precpred(self._ctx, 2):
|
4056
|
+
from antlr4.error.Errors import FailedPredicateException
|
4057
|
+
|
4058
|
+
raise FailedPredicateException(
|
4059
|
+
self, "self.precpred(self._ctx, 2)"
|
4060
|
+
)
|
4061
|
+
self.state = 537
|
4062
|
+
localctx.op = self._input.LT(1)
|
4063
|
+
_la = self._input.LA(1)
|
4064
|
+
if not (
|
4065
|
+
_la == GrammarParser.T__47 or _la == GrammarParser.T__48
|
4066
|
+
):
|
4067
|
+
localctx.op = self._errHandler.recoverInline(self)
|
4068
|
+
else:
|
4069
|
+
self._errHandler.reportMatch(self)
|
4070
|
+
self.consume()
|
4071
|
+
self.state = 538
|
4072
|
+
self.cond_expression(3)
|
4073
|
+
pass
|
4074
|
+
|
4075
|
+
self.state = 543
|
4076
|
+
self._errHandler.sync(self)
|
4077
|
+
_alt = self._interp.adaptivePredict(self._input, 51, self._ctx)
|
4078
|
+
|
4079
|
+
except RecognitionException as re:
|
4080
|
+
localctx.exception = re
|
4081
|
+
self._errHandler.reportError(self, re)
|
4082
|
+
self._errHandler.recover(self, re)
|
4083
|
+
finally:
|
4084
|
+
self.unrollRecursionContexts(_parentctx)
|
4085
|
+
return localctx
|
4086
|
+
|
4087
|
+
class Num_literalContext(ParserRuleContext):
|
4088
|
+
__slots__ = "parser"
|
4089
|
+
|
4090
|
+
def __init__(
|
4091
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
4092
|
+
):
|
4093
|
+
super().__init__(parent, invokingState)
|
4094
|
+
self.parser = parser
|
4095
|
+
|
4096
|
+
def INT(self):
|
4097
|
+
return self.getToken(GrammarParser.INT, 0)
|
4098
|
+
|
4099
|
+
def FLOAT(self):
|
4100
|
+
return self.getToken(GrammarParser.FLOAT, 0)
|
4101
|
+
|
4102
|
+
def HEX_INT(self):
|
4103
|
+
return self.getToken(GrammarParser.HEX_INT, 0)
|
4104
|
+
|
4105
|
+
def getRuleIndex(self):
|
4106
|
+
return GrammarParser.RULE_num_literal
|
4107
|
+
|
4108
|
+
def enterRule(self, listener: ParseTreeListener):
|
4109
|
+
if hasattr(listener, "enterNum_literal"):
|
4110
|
+
listener.enterNum_literal(self)
|
4111
|
+
|
4112
|
+
def exitRule(self, listener: ParseTreeListener):
|
4113
|
+
if hasattr(listener, "exitNum_literal"):
|
4114
|
+
listener.exitNum_literal(self)
|
4115
|
+
|
4116
|
+
def num_literal(self):
|
4117
|
+
localctx = GrammarParser.Num_literalContext(self, self._ctx, self.state)
|
4118
|
+
self.enterRule(localctx, 46, self.RULE_num_literal)
|
4119
|
+
self._la = 0 # Token type
|
4120
|
+
try:
|
4121
|
+
self.enterOuterAlt(localctx, 1)
|
4122
|
+
self.state = 544
|
4123
|
+
_la = self._input.LA(1)
|
4124
|
+
if not (
|
4125
|
+
((_la) & ~0x3F) == 0
|
4126
|
+
and (
|
4127
|
+
(1 << _la)
|
4128
|
+
& (
|
4129
|
+
(1 << GrammarParser.FLOAT)
|
4130
|
+
| (1 << GrammarParser.INT)
|
4131
|
+
| (1 << GrammarParser.HEX_INT)
|
4132
|
+
)
|
4133
|
+
)
|
4134
|
+
!= 0
|
4135
|
+
):
|
4136
|
+
self._errHandler.recoverInline(self)
|
4137
|
+
else:
|
4138
|
+
self._errHandler.reportMatch(self)
|
4139
|
+
self.consume()
|
4140
|
+
except RecognitionException as re:
|
4141
|
+
localctx.exception = re
|
4142
|
+
self._errHandler.reportError(self, re)
|
4143
|
+
self._errHandler.recover(self, re)
|
4144
|
+
finally:
|
4145
|
+
self.exitRule()
|
4146
|
+
return localctx
|
4147
|
+
|
4148
|
+
class Bool_literalContext(ParserRuleContext):
|
4149
|
+
__slots__ = "parser"
|
4150
|
+
|
4151
|
+
def __init__(
|
4152
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
4153
|
+
):
|
4154
|
+
super().__init__(parent, invokingState)
|
4155
|
+
self.parser = parser
|
4156
|
+
|
4157
|
+
def TRUE(self):
|
4158
|
+
return self.getToken(GrammarParser.TRUE, 0)
|
4159
|
+
|
4160
|
+
def FALSE(self):
|
4161
|
+
return self.getToken(GrammarParser.FALSE, 0)
|
4162
|
+
|
4163
|
+
def getRuleIndex(self):
|
4164
|
+
return GrammarParser.RULE_bool_literal
|
4165
|
+
|
4166
|
+
def enterRule(self, listener: ParseTreeListener):
|
4167
|
+
if hasattr(listener, "enterBool_literal"):
|
4168
|
+
listener.enterBool_literal(self)
|
4169
|
+
|
4170
|
+
def exitRule(self, listener: ParseTreeListener):
|
4171
|
+
if hasattr(listener, "exitBool_literal"):
|
4172
|
+
listener.exitBool_literal(self)
|
4173
|
+
|
4174
|
+
def bool_literal(self):
|
4175
|
+
localctx = GrammarParser.Bool_literalContext(self, self._ctx, self.state)
|
4176
|
+
self.enterRule(localctx, 48, self.RULE_bool_literal)
|
4177
|
+
self._la = 0 # Token type
|
4178
|
+
try:
|
4179
|
+
self.enterOuterAlt(localctx, 1)
|
4180
|
+
self.state = 546
|
4181
|
+
_la = self._input.LA(1)
|
4182
|
+
if not (_la == GrammarParser.TRUE or _la == GrammarParser.FALSE):
|
4183
|
+
self._errHandler.recoverInline(self)
|
4184
|
+
else:
|
4185
|
+
self._errHandler.reportMatch(self)
|
4186
|
+
self.consume()
|
4187
|
+
except RecognitionException as re:
|
4188
|
+
localctx.exception = re
|
4189
|
+
self._errHandler.reportError(self, re)
|
4190
|
+
self._errHandler.recover(self, re)
|
4191
|
+
finally:
|
4192
|
+
self.exitRule()
|
4193
|
+
return localctx
|
4194
|
+
|
4195
|
+
class Math_constContext(ParserRuleContext):
|
4196
|
+
__slots__ = "parser"
|
4197
|
+
|
4198
|
+
def __init__(
|
4199
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
4200
|
+
):
|
4201
|
+
super().__init__(parent, invokingState)
|
4202
|
+
self.parser = parser
|
4203
|
+
|
4204
|
+
def getRuleIndex(self):
|
4205
|
+
return GrammarParser.RULE_math_const
|
4206
|
+
|
4207
|
+
def enterRule(self, listener: ParseTreeListener):
|
4208
|
+
if hasattr(listener, "enterMath_const"):
|
4209
|
+
listener.enterMath_const(self)
|
4210
|
+
|
4211
|
+
def exitRule(self, listener: ParseTreeListener):
|
4212
|
+
if hasattr(listener, "exitMath_const"):
|
4213
|
+
listener.exitMath_const(self)
|
4214
|
+
|
4215
|
+
def math_const(self):
|
4216
|
+
localctx = GrammarParser.Math_constContext(self, self._ctx, self.state)
|
4217
|
+
self.enterRule(localctx, 50, self.RULE_math_const)
|
4218
|
+
self._la = 0 # Token type
|
4219
|
+
try:
|
4220
|
+
self.enterOuterAlt(localctx, 1)
|
4221
|
+
self.state = 548
|
4222
|
+
_la = self._input.LA(1)
|
4223
|
+
if not (
|
4224
|
+
((_la) & ~0x3F) == 0
|
4225
|
+
and (
|
4226
|
+
(1 << _la)
|
4227
|
+
& (
|
4228
|
+
(1 << GrammarParser.T__49)
|
4229
|
+
| (1 << GrammarParser.T__50)
|
4230
|
+
| (1 << GrammarParser.T__51)
|
4231
|
+
)
|
4232
|
+
)
|
4233
|
+
!= 0
|
4234
|
+
):
|
4235
|
+
self._errHandler.recoverInline(self)
|
4236
|
+
else:
|
4237
|
+
self._errHandler.reportMatch(self)
|
4238
|
+
self.consume()
|
4239
|
+
except RecognitionException as re:
|
4240
|
+
localctx.exception = re
|
4241
|
+
self._errHandler.reportError(self, re)
|
4242
|
+
self._errHandler.recover(self, re)
|
4243
|
+
finally:
|
4244
|
+
self.exitRule()
|
4245
|
+
return localctx
|
4246
|
+
|
4247
|
+
class Chain_idContext(ParserRuleContext):
|
4248
|
+
__slots__ = "parser"
|
4249
|
+
|
4250
|
+
def __init__(
|
4251
|
+
self, parser, parent: ParserRuleContext = None, invokingState: int = -1
|
4252
|
+
):
|
4253
|
+
super().__init__(parent, invokingState)
|
4254
|
+
self.parser = parser
|
4255
|
+
self.isabs = None # Token
|
4256
|
+
|
4257
|
+
def ID(self, i: int = None):
|
4258
|
+
if i is None:
|
4259
|
+
return self.getTokens(GrammarParser.ID)
|
4260
|
+
else:
|
4261
|
+
return self.getToken(GrammarParser.ID, i)
|
4262
|
+
|
4263
|
+
def getRuleIndex(self):
|
4264
|
+
return GrammarParser.RULE_chain_id
|
4265
|
+
|
4266
|
+
def enterRule(self, listener: ParseTreeListener):
|
4267
|
+
if hasattr(listener, "enterChain_id"):
|
4268
|
+
listener.enterChain_id(self)
|
4269
|
+
|
4270
|
+
def exitRule(self, listener: ParseTreeListener):
|
4271
|
+
if hasattr(listener, "exitChain_id"):
|
4272
|
+
listener.exitChain_id(self)
|
4273
|
+
|
4274
|
+
def chain_id(self):
|
4275
|
+
localctx = GrammarParser.Chain_idContext(self, self._ctx, self.state)
|
4276
|
+
self.enterRule(localctx, 52, self.RULE_chain_id)
|
4277
|
+
self._la = 0 # Token type
|
4278
|
+
try:
|
4279
|
+
self.enterOuterAlt(localctx, 1)
|
4280
|
+
self.state = 551
|
4281
|
+
self._errHandler.sync(self)
|
4282
|
+
_la = self._input.LA(1)
|
4283
|
+
if _la == GrammarParser.T__31:
|
4284
|
+
self.state = 550
|
4285
|
+
localctx.isabs = self.match(GrammarParser.T__31)
|
4286
|
+
|
4287
|
+
self.state = 553
|
4288
|
+
self.match(GrammarParser.ID)
|
4289
|
+
self.state = 558
|
4290
|
+
self._errHandler.sync(self)
|
4291
|
+
_la = self._input.LA(1)
|
4292
|
+
while _la == GrammarParser.T__52:
|
4293
|
+
self.state = 554
|
4294
|
+
self.match(GrammarParser.T__52)
|
4295
|
+
self.state = 555
|
4296
|
+
self.match(GrammarParser.ID)
|
4297
|
+
self.state = 560
|
4298
|
+
self._errHandler.sync(self)
|
4299
|
+
_la = self._input.LA(1)
|
4300
|
+
|
4301
|
+
except RecognitionException as re:
|
4302
|
+
localctx.exception = re
|
4303
|
+
self._errHandler.reportError(self, re)
|
4304
|
+
self._errHandler.recover(self, re)
|
4305
|
+
finally:
|
4306
|
+
self.exitRule()
|
4307
|
+
return localctx
|
4308
|
+
|
4309
|
+
def sempred(self, localctx: RuleContext, ruleIndex: int, predIndex: int):
|
4310
|
+
if self._predicates == None:
|
4311
|
+
self._predicates = dict()
|
4312
|
+
self._predicates[20] = self.init_expression_sempred
|
4313
|
+
self._predicates[21] = self.num_expression_sempred
|
4314
|
+
self._predicates[22] = self.cond_expression_sempred
|
4315
|
+
pred = self._predicates.get(ruleIndex, None)
|
4316
|
+
if pred is None:
|
4317
|
+
raise Exception("No predicate with index:" + str(ruleIndex))
|
4318
|
+
else:
|
4319
|
+
return pred(localctx, predIndex)
|
4320
|
+
|
4321
|
+
def init_expression_sempred(self, localctx: Init_expressionContext, predIndex: int):
|
4322
|
+
if predIndex == 0:
|
4323
|
+
return self.precpred(self._ctx, 8)
|
4324
|
+
|
4325
|
+
if predIndex == 1:
|
4326
|
+
return self.precpred(self._ctx, 7)
|
4327
|
+
|
4328
|
+
if predIndex == 2:
|
4329
|
+
return self.precpred(self._ctx, 6)
|
4330
|
+
|
4331
|
+
if predIndex == 3:
|
4332
|
+
return self.precpred(self._ctx, 5)
|
4333
|
+
|
4334
|
+
if predIndex == 4:
|
4335
|
+
return self.precpred(self._ctx, 4)
|
4336
|
+
|
4337
|
+
if predIndex == 5:
|
4338
|
+
return self.precpred(self._ctx, 3)
|
4339
|
+
|
4340
|
+
if predIndex == 6:
|
4341
|
+
return self.precpred(self._ctx, 2)
|
4342
|
+
|
4343
|
+
def num_expression_sempred(self, localctx: Num_expressionContext, predIndex: int):
|
4344
|
+
if predIndex == 7:
|
4345
|
+
return self.precpred(self._ctx, 9)
|
4346
|
+
|
4347
|
+
if predIndex == 8:
|
4348
|
+
return self.precpred(self._ctx, 8)
|
4349
|
+
|
4350
|
+
if predIndex == 9:
|
4351
|
+
return self.precpred(self._ctx, 7)
|
4352
|
+
|
4353
|
+
if predIndex == 10:
|
4354
|
+
return self.precpred(self._ctx, 6)
|
4355
|
+
|
4356
|
+
if predIndex == 11:
|
4357
|
+
return self.precpred(self._ctx, 5)
|
4358
|
+
|
4359
|
+
if predIndex == 12:
|
4360
|
+
return self.precpred(self._ctx, 4)
|
4361
|
+
|
4362
|
+
if predIndex == 13:
|
4363
|
+
return self.precpred(self._ctx, 3)
|
4364
|
+
|
4365
|
+
def cond_expression_sempred(self, localctx: Cond_expressionContext, predIndex: int):
|
4366
|
+
if predIndex == 14:
|
4367
|
+
return self.precpred(self._ctx, 4)
|
4368
|
+
|
4369
|
+
if predIndex == 15:
|
4370
|
+
return self.precpred(self._ctx, 3)
|
4371
|
+
|
4372
|
+
if predIndex == 16:
|
4373
|
+
return self.precpred(self._ctx, 2)
|