@guardian-network/policy-dsl 0.3.2
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.
- package/README.md +82 -0
- package/dist/antlr/generated/grammar/LacLangLexer.d.ts +53 -0
- package/dist/antlr/generated/grammar/LacLangLexer.d.ts.map +1 -0
- package/dist/antlr/generated/grammar/LacLangLexer.js +322 -0
- package/dist/antlr/generated/grammar/LacLangLexer.js.map +1 -0
- package/dist/antlr/generated/grammar/LacLangListener.d.ts +39 -0
- package/dist/antlr/generated/grammar/LacLangListener.d.ts.map +1 -0
- package/dist/antlr/generated/grammar/LacLangListener.js +3 -0
- package/dist/antlr/generated/grammar/LacLangListener.js.map +1 -0
- package/dist/antlr/generated/grammar/LacLangParser.d.ts +231 -0
- package/dist/antlr/generated/grammar/LacLangParser.d.ts.map +1 -0
- package/dist/antlr/generated/grammar/LacLangParser.js +1399 -0
- package/dist/antlr/generated/grammar/LacLangParser.js.map +1 -0
- package/dist/antlr/index.d.ts +4 -0
- package/dist/antlr/index.d.ts.map +1 -0
- package/dist/antlr/index.js +20 -0
- package/dist/antlr/index.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/ir-generation/hashing.helper.d.ts +3 -0
- package/dist/ir-generation/hashing.helper.d.ts.map +1 -0
- package/dist/ir-generation/hashing.helper.js +12 -0
- package/dist/ir-generation/hashing.helper.js.map +1 -0
- package/dist/ir-generation/index.d.ts +3 -0
- package/dist/ir-generation/index.d.ts.map +1 -0
- package/dist/ir-generation/index.js +19 -0
- package/dist/ir-generation/index.js.map +1 -0
- package/dist/ir-generation/parsed-state-to-ir.transformer.d.ts +11 -0
- package/dist/ir-generation/parsed-state-to-ir.transformer.d.ts.map +1 -0
- package/dist/ir-generation/parsed-state-to-ir.transformer.js +30 -0
- package/dist/ir-generation/parsed-state-to-ir.transformer.js.map +1 -0
- package/dist/transpiler/Transpiler.d.ts +17 -0
- package/dist/transpiler/Transpiler.d.ts.map +1 -0
- package/dist/transpiler/Transpiler.js +43 -0
- package/dist/transpiler/Transpiler.js.map +1 -0
- package/dist/transpiler/errors/ErrorFactory.d.ts +22 -0
- package/dist/transpiler/errors/ErrorFactory.d.ts.map +1 -0
- package/dist/transpiler/errors/ErrorFactory.js +62 -0
- package/dist/transpiler/errors/ErrorFactory.js.map +1 -0
- package/dist/transpiler/errors/helpers.d.ts +3 -0
- package/dist/transpiler/errors/helpers.d.ts.map +1 -0
- package/dist/transpiler/errors/helpers.js +6 -0
- package/dist/transpiler/errors/helpers.js.map +1 -0
- package/dist/transpiler/errors/index.d.ts +2 -0
- package/dist/transpiler/errors/index.d.ts.map +1 -0
- package/dist/transpiler/errors/index.js +18 -0
- package/dist/transpiler/errors/index.js.map +1 -0
- package/dist/transpiler/errors/validation-errors.d.ts +57 -0
- package/dist/transpiler/errors/validation-errors.d.ts.map +1 -0
- package/dist/transpiler/errors/validation-errors.js +132 -0
- package/dist/transpiler/errors/validation-errors.js.map +1 -0
- package/dist/transpiler/helpers/formatter.d.ts +10 -0
- package/dist/transpiler/helpers/formatter.d.ts.map +1 -0
- package/dist/transpiler/helpers/formatter.js +140 -0
- package/dist/transpiler/helpers/formatter.js.map +1 -0
- package/dist/transpiler/helpers/index.d.ts +5 -0
- package/dist/transpiler/helpers/index.d.ts.map +1 -0
- package/dist/transpiler/helpers/index.js +21 -0
- package/dist/transpiler/helpers/index.js.map +1 -0
- package/dist/transpiler/helpers/resources.helper.d.ts +4 -0
- package/dist/transpiler/helpers/resources.helper.d.ts.map +1 -0
- package/dist/transpiler/helpers/resources.helper.js +50 -0
- package/dist/transpiler/helpers/resources.helper.js.map +1 -0
- package/dist/transpiler/helpers/types.d.ts +12 -0
- package/dist/transpiler/helpers/types.d.ts.map +1 -0
- package/dist/transpiler/helpers/types.js +3 -0
- package/dist/transpiler/helpers/types.js.map +1 -0
- package/dist/transpiler/helpers/validations.helper.d.ts +8 -0
- package/dist/transpiler/helpers/validations.helper.d.ts.map +1 -0
- package/dist/transpiler/helpers/validations.helper.js +41 -0
- package/dist/transpiler/helpers/validations.helper.js.map +1 -0
- package/dist/transpiler/index.d.ts +3 -0
- package/dist/transpiler/index.d.ts.map +1 -0
- package/dist/transpiler/index.js +21 -0
- package/dist/transpiler/index.js.map +1 -0
- package/dist/transpiler/listener.d.ts +17 -0
- package/dist/transpiler/listener.d.ts.map +1 -0
- package/dist/transpiler/listener.js +94 -0
- package/dist/transpiler/listener.js.map +1 -0
- package/dist/transpiler/state/LatentState.d.ts +30 -0
- package/dist/transpiler/state/LatentState.d.ts.map +1 -0
- package/dist/transpiler/state/LatentState.js +130 -0
- package/dist/transpiler/state/LatentState.js.map +1 -0
- package/dist/transpiler/state/index.d.ts +3 -0
- package/dist/transpiler/state/index.d.ts.map +1 -0
- package/dist/transpiler/state/index.js +19 -0
- package/dist/transpiler/state/index.js.map +1 -0
- package/dist/transpiler/state/types.d.ts +42 -0
- package/dist/transpiler/state/types.d.ts.map +1 -0
- package/dist/transpiler/state/types.js +3 -0
- package/dist/transpiler/state/types.js.map +1 -0
- package/package.json +79 -0
- package/src/antlr/generated/grammar/LacLang.interp +88 -0
- package/src/antlr/generated/grammar/LacLang.tokens +52 -0
- package/src/antlr/generated/grammar/LacLangLexer.interp +108 -0
- package/src/antlr/generated/grammar/LacLangLexer.tokens +52 -0
- package/src/antlr/generated/grammar/LacLangLexer.ts +331 -0
- package/src/antlr/generated/grammar/LacLangListener.ts +216 -0
- package/src/antlr/generated/grammar/LacLangParser.ts +1484 -0
- package/src/antlr/index.ts +3 -0
- package/src/index.ts +3 -0
- package/src/ir-generation/hashing.helper.ts +13 -0
- package/src/ir-generation/index.ts +2 -0
- package/src/ir-generation/parsed-state-to-ir.transformer.ts +50 -0
- package/src/transpiler/Transpiler.ts +58 -0
- package/src/transpiler/errors/ErrorFactory.ts +130 -0
- package/src/transpiler/errors/helpers.ts +4 -0
- package/src/transpiler/errors/index.ts +1 -0
- package/src/transpiler/errors/validation-errors.ts +157 -0
- package/src/transpiler/helpers/formatter.ts +173 -0
- package/src/transpiler/helpers/index.ts +4 -0
- package/src/transpiler/helpers/resources.helper.ts +83 -0
- package/src/transpiler/helpers/types.ts +23 -0
- package/src/transpiler/helpers/validations.helper.ts +69 -0
- package/src/transpiler/index.ts +2 -0
- package/src/transpiler/listener.ts +180 -0
- package/src/transpiler/state/LatentState.ts +202 -0
- package/src/transpiler/state/index.ts +2 -0
- package/src/transpiler/state/types.ts +50 -0
|
@@ -0,0 +1,1484 @@
|
|
|
1
|
+
// Generated from ./grammar/LacLang.g4 by ANTLR 4.9.0-SNAPSHOT
|
|
2
|
+
|
|
3
|
+
import { ATN } from 'antlr4ts/atn/ATN';
|
|
4
|
+
import { ATNDeserializer } from 'antlr4ts/atn/ATNDeserializer';
|
|
5
|
+
import { ParserATNSimulator } from 'antlr4ts/atn/ParserATNSimulator';
|
|
6
|
+
import { FailedPredicateException } from 'antlr4ts/FailedPredicateException';
|
|
7
|
+
import { NoViableAltException } from 'antlr4ts/NoViableAltException';
|
|
8
|
+
import { Parser } from 'antlr4ts/Parser';
|
|
9
|
+
import { ParserRuleContext } from 'antlr4ts/ParserRuleContext';
|
|
10
|
+
import { RecognitionException } from 'antlr4ts/RecognitionException';
|
|
11
|
+
//import { RuleVersion } from "antlr4ts/RuleVersion";
|
|
12
|
+
import { Token } from 'antlr4ts/Token';
|
|
13
|
+
import { TokenStream } from 'antlr4ts/TokenStream';
|
|
14
|
+
import { TerminalNode } from 'antlr4ts/tree/TerminalNode';
|
|
15
|
+
import { Vocabulary } from 'antlr4ts/Vocabulary';
|
|
16
|
+
import { VocabularyImpl } from 'antlr4ts/VocabularyImpl';
|
|
17
|
+
|
|
18
|
+
import * as Utils from 'antlr4ts/misc/Utils';
|
|
19
|
+
|
|
20
|
+
import { LacLangListener } from './LacLangListener';
|
|
21
|
+
|
|
22
|
+
export class LacLangParser extends Parser {
|
|
23
|
+
public static readonly T__0 = 1;
|
|
24
|
+
public static readonly T__1 = 2;
|
|
25
|
+
public static readonly T__2 = 3;
|
|
26
|
+
public static readonly T__3 = 4;
|
|
27
|
+
public static readonly T__4 = 5;
|
|
28
|
+
public static readonly T__5 = 6;
|
|
29
|
+
public static readonly T__6 = 7;
|
|
30
|
+
public static readonly T__7 = 8;
|
|
31
|
+
public static readonly T__8 = 9;
|
|
32
|
+
public static readonly T__9 = 10;
|
|
33
|
+
public static readonly T__10 = 11;
|
|
34
|
+
public static readonly T__11 = 12;
|
|
35
|
+
public static readonly T__12 = 13;
|
|
36
|
+
public static readonly T__13 = 14;
|
|
37
|
+
public static readonly T__14 = 15;
|
|
38
|
+
public static readonly T__15 = 16;
|
|
39
|
+
public static readonly T__16 = 17;
|
|
40
|
+
public static readonly T__17 = 18;
|
|
41
|
+
public static readonly T__18 = 19;
|
|
42
|
+
public static readonly T__19 = 20;
|
|
43
|
+
public static readonly T__20 = 21;
|
|
44
|
+
public static readonly WITH_KEYWORD = 22;
|
|
45
|
+
public static readonly ADDRESS_LITERAL = 23;
|
|
46
|
+
public static readonly BOOL_LITERAL = 24;
|
|
47
|
+
public static readonly NUMBER_LITERAL = 25;
|
|
48
|
+
public static readonly STRING_LITERAL = 26;
|
|
49
|
+
public static readonly BYTES_LITERAL = 27;
|
|
50
|
+
public static readonly IDENTIFIER = 28;
|
|
51
|
+
public static readonly WHITESPACE = 29;
|
|
52
|
+
public static readonly COMMENT = 30;
|
|
53
|
+
public static readonly RULE_program = 0;
|
|
54
|
+
public static readonly RULE_statement = 1;
|
|
55
|
+
public static readonly RULE_importStatement = 2;
|
|
56
|
+
public static readonly RULE_directive = 3;
|
|
57
|
+
public static readonly RULE_directiveIndentifier = 4;
|
|
58
|
+
public static readonly RULE_injectedOnlyDirective = 5;
|
|
59
|
+
public static readonly RULE_varDeclaration = 6;
|
|
60
|
+
public static readonly RULE_injectionModifier = 7;
|
|
61
|
+
public static readonly RULE_constantDeclaration = 8;
|
|
62
|
+
public static readonly RULE_artifactDeclaration = 9;
|
|
63
|
+
public static readonly RULE_instanceDeclaration = 10;
|
|
64
|
+
public static readonly RULE_evaluateStatement = 11;
|
|
65
|
+
public static readonly RULE_dataType = 12;
|
|
66
|
+
public static readonly RULE_constantsList = 13;
|
|
67
|
+
public static readonly RULE_argumentsList = 14;
|
|
68
|
+
public static readonly RULE_identifier_or_literal = 15;
|
|
69
|
+
public static readonly RULE_literal = 16;
|
|
70
|
+
// tslint:disable:no-trailing-whitespace
|
|
71
|
+
public static readonly ruleNames: string[] = [
|
|
72
|
+
'program',
|
|
73
|
+
'statement',
|
|
74
|
+
'importStatement',
|
|
75
|
+
'directive',
|
|
76
|
+
'directiveIndentifier',
|
|
77
|
+
'injectedOnlyDirective',
|
|
78
|
+
'varDeclaration',
|
|
79
|
+
'injectionModifier',
|
|
80
|
+
'constantDeclaration',
|
|
81
|
+
'artifactDeclaration',
|
|
82
|
+
'instanceDeclaration',
|
|
83
|
+
'evaluateStatement',
|
|
84
|
+
'dataType',
|
|
85
|
+
'constantsList',
|
|
86
|
+
'argumentsList',
|
|
87
|
+
'identifier_or_literal',
|
|
88
|
+
'literal',
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
private static readonly _LITERAL_NAMES: Array<string | undefined> = [
|
|
92
|
+
undefined,
|
|
93
|
+
"'import'",
|
|
94
|
+
"';'",
|
|
95
|
+
"'pragma'",
|
|
96
|
+
"'injected-only'",
|
|
97
|
+
"'var'",
|
|
98
|
+
"'inject'",
|
|
99
|
+
"'('",
|
|
100
|
+
"')'",
|
|
101
|
+
"'constant'",
|
|
102
|
+
"'='",
|
|
103
|
+
"'artifact'",
|
|
104
|
+
"'instance'",
|
|
105
|
+
"'of'",
|
|
106
|
+
"'takes'",
|
|
107
|
+
"'evaluate'",
|
|
108
|
+
"'bool'",
|
|
109
|
+
"'number'",
|
|
110
|
+
"'string'",
|
|
111
|
+
"'bytes'",
|
|
112
|
+
"'address'",
|
|
113
|
+
"','",
|
|
114
|
+
"'with'",
|
|
115
|
+
];
|
|
116
|
+
private static readonly _SYMBOLIC_NAMES: Array<string | undefined> = [
|
|
117
|
+
undefined,
|
|
118
|
+
undefined,
|
|
119
|
+
undefined,
|
|
120
|
+
undefined,
|
|
121
|
+
undefined,
|
|
122
|
+
undefined,
|
|
123
|
+
undefined,
|
|
124
|
+
undefined,
|
|
125
|
+
undefined,
|
|
126
|
+
undefined,
|
|
127
|
+
undefined,
|
|
128
|
+
undefined,
|
|
129
|
+
undefined,
|
|
130
|
+
undefined,
|
|
131
|
+
undefined,
|
|
132
|
+
undefined,
|
|
133
|
+
undefined,
|
|
134
|
+
undefined,
|
|
135
|
+
undefined,
|
|
136
|
+
undefined,
|
|
137
|
+
undefined,
|
|
138
|
+
undefined,
|
|
139
|
+
'WITH_KEYWORD',
|
|
140
|
+
'ADDRESS_LITERAL',
|
|
141
|
+
'BOOL_LITERAL',
|
|
142
|
+
'NUMBER_LITERAL',
|
|
143
|
+
'STRING_LITERAL',
|
|
144
|
+
'BYTES_LITERAL',
|
|
145
|
+
'IDENTIFIER',
|
|
146
|
+
'WHITESPACE',
|
|
147
|
+
'COMMENT',
|
|
148
|
+
];
|
|
149
|
+
public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(
|
|
150
|
+
LacLangParser._LITERAL_NAMES,
|
|
151
|
+
LacLangParser._SYMBOLIC_NAMES,
|
|
152
|
+
[],
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
// @Override
|
|
156
|
+
// @NotNull
|
|
157
|
+
public get vocabulary(): Vocabulary {
|
|
158
|
+
return LacLangParser.VOCABULARY;
|
|
159
|
+
}
|
|
160
|
+
// tslint:enable:no-trailing-whitespace
|
|
161
|
+
|
|
162
|
+
// @Override
|
|
163
|
+
public get grammarFileName(): string {
|
|
164
|
+
return 'LacLang.g4';
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// @Override
|
|
168
|
+
public get ruleNames(): string[] {
|
|
169
|
+
return LacLangParser.ruleNames;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// @Override
|
|
173
|
+
public get serializedATN(): string {
|
|
174
|
+
return LacLangParser._serializedATN;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
protected createFailedPredicateException(
|
|
178
|
+
predicate?: string,
|
|
179
|
+
message?: string,
|
|
180
|
+
): FailedPredicateException {
|
|
181
|
+
return new FailedPredicateException(this, predicate, message);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
constructor(input: TokenStream) {
|
|
185
|
+
super(input);
|
|
186
|
+
this._interp = new ParserATNSimulator(LacLangParser._ATN, this);
|
|
187
|
+
}
|
|
188
|
+
// @RuleVersion(0)
|
|
189
|
+
public program(): ProgramContext {
|
|
190
|
+
let _localctx: ProgramContext = new ProgramContext(this._ctx, this.state);
|
|
191
|
+
this.enterRule(_localctx, 0, LacLangParser.RULE_program);
|
|
192
|
+
try {
|
|
193
|
+
let _alt: number;
|
|
194
|
+
this.enterOuterAlt(_localctx, 1);
|
|
195
|
+
{
|
|
196
|
+
this.state = 37;
|
|
197
|
+
this._errHandler.sync(this);
|
|
198
|
+
_alt = this.interpreter.adaptivePredict(this._input, 0, this._ctx);
|
|
199
|
+
while (_alt !== 1 && _alt !== ATN.INVALID_ALT_NUMBER) {
|
|
200
|
+
if (_alt === 1 + 1) {
|
|
201
|
+
{
|
|
202
|
+
{
|
|
203
|
+
this.state = 34;
|
|
204
|
+
this.importStatement();
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
this.state = 39;
|
|
209
|
+
this._errHandler.sync(this);
|
|
210
|
+
_alt = this.interpreter.adaptivePredict(this._input, 0, this._ctx);
|
|
211
|
+
}
|
|
212
|
+
this.state = 43;
|
|
213
|
+
this._errHandler.sync(this);
|
|
214
|
+
_alt = this.interpreter.adaptivePredict(this._input, 1, this._ctx);
|
|
215
|
+
while (_alt !== 1 && _alt !== ATN.INVALID_ALT_NUMBER) {
|
|
216
|
+
if (_alt === 1 + 1) {
|
|
217
|
+
{
|
|
218
|
+
{
|
|
219
|
+
this.state = 40;
|
|
220
|
+
this.directive();
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
this.state = 45;
|
|
225
|
+
this._errHandler.sync(this);
|
|
226
|
+
_alt = this.interpreter.adaptivePredict(this._input, 1, this._ctx);
|
|
227
|
+
}
|
|
228
|
+
this.state = 49;
|
|
229
|
+
this._errHandler.sync(this);
|
|
230
|
+
_alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx);
|
|
231
|
+
while (_alt !== 1 && _alt !== ATN.INVALID_ALT_NUMBER) {
|
|
232
|
+
if (_alt === 1 + 1) {
|
|
233
|
+
{
|
|
234
|
+
{
|
|
235
|
+
this.state = 46;
|
|
236
|
+
this.statement();
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
this.state = 51;
|
|
241
|
+
this._errHandler.sync(this);
|
|
242
|
+
_alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx);
|
|
243
|
+
}
|
|
244
|
+
this.state = 52;
|
|
245
|
+
this.match(LacLangParser.EOF);
|
|
246
|
+
}
|
|
247
|
+
} catch (re) {
|
|
248
|
+
if (re instanceof RecognitionException) {
|
|
249
|
+
_localctx.exception = re;
|
|
250
|
+
this._errHandler.reportError(this, re);
|
|
251
|
+
this._errHandler.recover(this, re);
|
|
252
|
+
} else {
|
|
253
|
+
throw re;
|
|
254
|
+
}
|
|
255
|
+
} finally {
|
|
256
|
+
this.exitRule();
|
|
257
|
+
}
|
|
258
|
+
return _localctx;
|
|
259
|
+
}
|
|
260
|
+
// @RuleVersion(0)
|
|
261
|
+
public statement(): StatementContext {
|
|
262
|
+
let _localctx: StatementContext = new StatementContext(
|
|
263
|
+
this._ctx,
|
|
264
|
+
this.state,
|
|
265
|
+
);
|
|
266
|
+
this.enterRule(_localctx, 2, LacLangParser.RULE_statement);
|
|
267
|
+
try {
|
|
268
|
+
this.state = 59;
|
|
269
|
+
this._errHandler.sync(this);
|
|
270
|
+
switch (this._input.LA(1)) {
|
|
271
|
+
case LacLangParser.T__4:
|
|
272
|
+
this.enterOuterAlt(_localctx, 1);
|
|
273
|
+
{
|
|
274
|
+
this.state = 54;
|
|
275
|
+
this.varDeclaration();
|
|
276
|
+
}
|
|
277
|
+
break;
|
|
278
|
+
case LacLangParser.T__8:
|
|
279
|
+
this.enterOuterAlt(_localctx, 2);
|
|
280
|
+
{
|
|
281
|
+
this.state = 55;
|
|
282
|
+
this.constantDeclaration();
|
|
283
|
+
}
|
|
284
|
+
break;
|
|
285
|
+
case LacLangParser.T__10:
|
|
286
|
+
this.enterOuterAlt(_localctx, 3);
|
|
287
|
+
{
|
|
288
|
+
this.state = 56;
|
|
289
|
+
this.artifactDeclaration();
|
|
290
|
+
}
|
|
291
|
+
break;
|
|
292
|
+
case LacLangParser.T__11:
|
|
293
|
+
this.enterOuterAlt(_localctx, 4);
|
|
294
|
+
{
|
|
295
|
+
this.state = 57;
|
|
296
|
+
this.instanceDeclaration();
|
|
297
|
+
}
|
|
298
|
+
break;
|
|
299
|
+
case LacLangParser.T__14:
|
|
300
|
+
this.enterOuterAlt(_localctx, 5);
|
|
301
|
+
{
|
|
302
|
+
this.state = 58;
|
|
303
|
+
this.evaluateStatement();
|
|
304
|
+
}
|
|
305
|
+
break;
|
|
306
|
+
default:
|
|
307
|
+
throw new NoViableAltException(this);
|
|
308
|
+
}
|
|
309
|
+
} catch (re) {
|
|
310
|
+
if (re instanceof RecognitionException) {
|
|
311
|
+
_localctx.exception = re;
|
|
312
|
+
this._errHandler.reportError(this, re);
|
|
313
|
+
this._errHandler.recover(this, re);
|
|
314
|
+
} else {
|
|
315
|
+
throw re;
|
|
316
|
+
}
|
|
317
|
+
} finally {
|
|
318
|
+
this.exitRule();
|
|
319
|
+
}
|
|
320
|
+
return _localctx;
|
|
321
|
+
}
|
|
322
|
+
// @RuleVersion(0)
|
|
323
|
+
public importStatement(): ImportStatementContext {
|
|
324
|
+
let _localctx: ImportStatementContext = new ImportStatementContext(
|
|
325
|
+
this._ctx,
|
|
326
|
+
this.state,
|
|
327
|
+
);
|
|
328
|
+
this.enterRule(_localctx, 4, LacLangParser.RULE_importStatement);
|
|
329
|
+
try {
|
|
330
|
+
this.enterOuterAlt(_localctx, 1);
|
|
331
|
+
{
|
|
332
|
+
this.state = 61;
|
|
333
|
+
this.match(LacLangParser.T__0);
|
|
334
|
+
this.state = 62;
|
|
335
|
+
this.match(LacLangParser.STRING_LITERAL);
|
|
336
|
+
this.state = 63;
|
|
337
|
+
this.match(LacLangParser.T__1);
|
|
338
|
+
}
|
|
339
|
+
} catch (re) {
|
|
340
|
+
if (re instanceof RecognitionException) {
|
|
341
|
+
_localctx.exception = re;
|
|
342
|
+
this._errHandler.reportError(this, re);
|
|
343
|
+
this._errHandler.recover(this, re);
|
|
344
|
+
} else {
|
|
345
|
+
throw re;
|
|
346
|
+
}
|
|
347
|
+
} finally {
|
|
348
|
+
this.exitRule();
|
|
349
|
+
}
|
|
350
|
+
return _localctx;
|
|
351
|
+
}
|
|
352
|
+
// @RuleVersion(0)
|
|
353
|
+
public directive(): DirectiveContext {
|
|
354
|
+
let _localctx: DirectiveContext = new DirectiveContext(
|
|
355
|
+
this._ctx,
|
|
356
|
+
this.state,
|
|
357
|
+
);
|
|
358
|
+
this.enterRule(_localctx, 6, LacLangParser.RULE_directive);
|
|
359
|
+
try {
|
|
360
|
+
this.enterOuterAlt(_localctx, 1);
|
|
361
|
+
{
|
|
362
|
+
this.state = 65;
|
|
363
|
+
this.match(LacLangParser.T__2);
|
|
364
|
+
this.state = 66;
|
|
365
|
+
this.directiveIndentifier();
|
|
366
|
+
this.state = 67;
|
|
367
|
+
this.match(LacLangParser.T__1);
|
|
368
|
+
}
|
|
369
|
+
} catch (re) {
|
|
370
|
+
if (re instanceof RecognitionException) {
|
|
371
|
+
_localctx.exception = re;
|
|
372
|
+
this._errHandler.reportError(this, re);
|
|
373
|
+
this._errHandler.recover(this, re);
|
|
374
|
+
} else {
|
|
375
|
+
throw re;
|
|
376
|
+
}
|
|
377
|
+
} finally {
|
|
378
|
+
this.exitRule();
|
|
379
|
+
}
|
|
380
|
+
return _localctx;
|
|
381
|
+
}
|
|
382
|
+
// @RuleVersion(0)
|
|
383
|
+
public directiveIndentifier(): DirectiveIndentifierContext {
|
|
384
|
+
let _localctx: DirectiveIndentifierContext =
|
|
385
|
+
new DirectiveIndentifierContext(this._ctx, this.state);
|
|
386
|
+
this.enterRule(_localctx, 8, LacLangParser.RULE_directiveIndentifier);
|
|
387
|
+
try {
|
|
388
|
+
this.enterOuterAlt(_localctx, 1);
|
|
389
|
+
{
|
|
390
|
+
this.state = 69;
|
|
391
|
+
this.injectedOnlyDirective();
|
|
392
|
+
}
|
|
393
|
+
} catch (re) {
|
|
394
|
+
if (re instanceof RecognitionException) {
|
|
395
|
+
_localctx.exception = re;
|
|
396
|
+
this._errHandler.reportError(this, re);
|
|
397
|
+
this._errHandler.recover(this, re);
|
|
398
|
+
} else {
|
|
399
|
+
throw re;
|
|
400
|
+
}
|
|
401
|
+
} finally {
|
|
402
|
+
this.exitRule();
|
|
403
|
+
}
|
|
404
|
+
return _localctx;
|
|
405
|
+
}
|
|
406
|
+
// @RuleVersion(0)
|
|
407
|
+
public injectedOnlyDirective(): InjectedOnlyDirectiveContext {
|
|
408
|
+
let _localctx: InjectedOnlyDirectiveContext =
|
|
409
|
+
new InjectedOnlyDirectiveContext(this._ctx, this.state);
|
|
410
|
+
this.enterRule(_localctx, 10, LacLangParser.RULE_injectedOnlyDirective);
|
|
411
|
+
try {
|
|
412
|
+
this.enterOuterAlt(_localctx, 1);
|
|
413
|
+
{
|
|
414
|
+
this.state = 71;
|
|
415
|
+
this.match(LacLangParser.T__3);
|
|
416
|
+
}
|
|
417
|
+
} catch (re) {
|
|
418
|
+
if (re instanceof RecognitionException) {
|
|
419
|
+
_localctx.exception = re;
|
|
420
|
+
this._errHandler.reportError(this, re);
|
|
421
|
+
this._errHandler.recover(this, re);
|
|
422
|
+
} else {
|
|
423
|
+
throw re;
|
|
424
|
+
}
|
|
425
|
+
} finally {
|
|
426
|
+
this.exitRule();
|
|
427
|
+
}
|
|
428
|
+
return _localctx;
|
|
429
|
+
}
|
|
430
|
+
// @RuleVersion(0)
|
|
431
|
+
public varDeclaration(): VarDeclarationContext {
|
|
432
|
+
let _localctx: VarDeclarationContext = new VarDeclarationContext(
|
|
433
|
+
this._ctx,
|
|
434
|
+
this.state,
|
|
435
|
+
);
|
|
436
|
+
this.enterRule(_localctx, 12, LacLangParser.RULE_varDeclaration);
|
|
437
|
+
let _la: number;
|
|
438
|
+
try {
|
|
439
|
+
this.enterOuterAlt(_localctx, 1);
|
|
440
|
+
{
|
|
441
|
+
this.state = 73;
|
|
442
|
+
this.match(LacLangParser.T__4);
|
|
443
|
+
this.state = 75;
|
|
444
|
+
this._errHandler.sync(this);
|
|
445
|
+
_la = this._input.LA(1);
|
|
446
|
+
if (_la === LacLangParser.T__5) {
|
|
447
|
+
{
|
|
448
|
+
this.state = 74;
|
|
449
|
+
this.injectionModifier();
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
this.state = 77;
|
|
454
|
+
this.dataType();
|
|
455
|
+
this.state = 78;
|
|
456
|
+
this.match(LacLangParser.IDENTIFIER);
|
|
457
|
+
this.state = 79;
|
|
458
|
+
this.match(LacLangParser.T__1);
|
|
459
|
+
}
|
|
460
|
+
} catch (re) {
|
|
461
|
+
if (re instanceof RecognitionException) {
|
|
462
|
+
_localctx.exception = re;
|
|
463
|
+
this._errHandler.reportError(this, re);
|
|
464
|
+
this._errHandler.recover(this, re);
|
|
465
|
+
} else {
|
|
466
|
+
throw re;
|
|
467
|
+
}
|
|
468
|
+
} finally {
|
|
469
|
+
this.exitRule();
|
|
470
|
+
}
|
|
471
|
+
return _localctx;
|
|
472
|
+
}
|
|
473
|
+
// @RuleVersion(0)
|
|
474
|
+
public injectionModifier(): InjectionModifierContext {
|
|
475
|
+
let _localctx: InjectionModifierContext = new InjectionModifierContext(
|
|
476
|
+
this._ctx,
|
|
477
|
+
this.state,
|
|
478
|
+
);
|
|
479
|
+
this.enterRule(_localctx, 14, LacLangParser.RULE_injectionModifier);
|
|
480
|
+
try {
|
|
481
|
+
this.enterOuterAlt(_localctx, 1);
|
|
482
|
+
{
|
|
483
|
+
this.state = 81;
|
|
484
|
+
this.match(LacLangParser.T__5);
|
|
485
|
+
this.state = 82;
|
|
486
|
+
this.match(LacLangParser.T__6);
|
|
487
|
+
this.state = 83;
|
|
488
|
+
this.match(LacLangParser.STRING_LITERAL);
|
|
489
|
+
this.state = 84;
|
|
490
|
+
this.match(LacLangParser.T__7);
|
|
491
|
+
}
|
|
492
|
+
} catch (re) {
|
|
493
|
+
if (re instanceof RecognitionException) {
|
|
494
|
+
_localctx.exception = re;
|
|
495
|
+
this._errHandler.reportError(this, re);
|
|
496
|
+
this._errHandler.recover(this, re);
|
|
497
|
+
} else {
|
|
498
|
+
throw re;
|
|
499
|
+
}
|
|
500
|
+
} finally {
|
|
501
|
+
this.exitRule();
|
|
502
|
+
}
|
|
503
|
+
return _localctx;
|
|
504
|
+
}
|
|
505
|
+
// @RuleVersion(0)
|
|
506
|
+
public constantDeclaration(): ConstantDeclarationContext {
|
|
507
|
+
let _localctx: ConstantDeclarationContext = new ConstantDeclarationContext(
|
|
508
|
+
this._ctx,
|
|
509
|
+
this.state,
|
|
510
|
+
);
|
|
511
|
+
this.enterRule(_localctx, 16, LacLangParser.RULE_constantDeclaration);
|
|
512
|
+
try {
|
|
513
|
+
this.enterOuterAlt(_localctx, 1);
|
|
514
|
+
{
|
|
515
|
+
this.state = 86;
|
|
516
|
+
this.match(LacLangParser.T__8);
|
|
517
|
+
this.state = 87;
|
|
518
|
+
this.dataType();
|
|
519
|
+
this.state = 88;
|
|
520
|
+
this.match(LacLangParser.IDENTIFIER);
|
|
521
|
+
this.state = 89;
|
|
522
|
+
this.match(LacLangParser.T__9);
|
|
523
|
+
this.state = 90;
|
|
524
|
+
this.literal();
|
|
525
|
+
this.state = 91;
|
|
526
|
+
this.match(LacLangParser.T__1);
|
|
527
|
+
}
|
|
528
|
+
} catch (re) {
|
|
529
|
+
if (re instanceof RecognitionException) {
|
|
530
|
+
_localctx.exception = re;
|
|
531
|
+
this._errHandler.reportError(this, re);
|
|
532
|
+
this._errHandler.recover(this, re);
|
|
533
|
+
} else {
|
|
534
|
+
throw re;
|
|
535
|
+
}
|
|
536
|
+
} finally {
|
|
537
|
+
this.exitRule();
|
|
538
|
+
}
|
|
539
|
+
return _localctx;
|
|
540
|
+
}
|
|
541
|
+
// @RuleVersion(0)
|
|
542
|
+
public artifactDeclaration(): ArtifactDeclarationContext {
|
|
543
|
+
let _localctx: ArtifactDeclarationContext = new ArtifactDeclarationContext(
|
|
544
|
+
this._ctx,
|
|
545
|
+
this.state,
|
|
546
|
+
);
|
|
547
|
+
this.enterRule(_localctx, 18, LacLangParser.RULE_artifactDeclaration);
|
|
548
|
+
try {
|
|
549
|
+
this.enterOuterAlt(_localctx, 1);
|
|
550
|
+
{
|
|
551
|
+
this.state = 93;
|
|
552
|
+
this.match(LacLangParser.T__10);
|
|
553
|
+
this.state = 94;
|
|
554
|
+
this.match(LacLangParser.IDENTIFIER);
|
|
555
|
+
this.state = 95;
|
|
556
|
+
this.match(LacLangParser.T__9);
|
|
557
|
+
this.state = 96;
|
|
558
|
+
this.match(LacLangParser.ADDRESS_LITERAL);
|
|
559
|
+
this.state = 97;
|
|
560
|
+
this.match(LacLangParser.T__1);
|
|
561
|
+
}
|
|
562
|
+
} catch (re) {
|
|
563
|
+
if (re instanceof RecognitionException) {
|
|
564
|
+
_localctx.exception = re;
|
|
565
|
+
this._errHandler.reportError(this, re);
|
|
566
|
+
this._errHandler.recover(this, re);
|
|
567
|
+
} else {
|
|
568
|
+
throw re;
|
|
569
|
+
}
|
|
570
|
+
} finally {
|
|
571
|
+
this.exitRule();
|
|
572
|
+
}
|
|
573
|
+
return _localctx;
|
|
574
|
+
}
|
|
575
|
+
// @RuleVersion(0)
|
|
576
|
+
public instanceDeclaration(): InstanceDeclarationContext {
|
|
577
|
+
let _localctx: InstanceDeclarationContext = new InstanceDeclarationContext(
|
|
578
|
+
this._ctx,
|
|
579
|
+
this.state,
|
|
580
|
+
);
|
|
581
|
+
this.enterRule(_localctx, 20, LacLangParser.RULE_instanceDeclaration);
|
|
582
|
+
let _la: number;
|
|
583
|
+
try {
|
|
584
|
+
this.enterOuterAlt(_localctx, 1);
|
|
585
|
+
{
|
|
586
|
+
this.state = 99;
|
|
587
|
+
this.match(LacLangParser.T__11);
|
|
588
|
+
this.state = 100;
|
|
589
|
+
this.dataType();
|
|
590
|
+
this.state = 101;
|
|
591
|
+
this.match(LacLangParser.IDENTIFIER);
|
|
592
|
+
this.state = 102;
|
|
593
|
+
this.match(LacLangParser.T__12);
|
|
594
|
+
this.state = 103;
|
|
595
|
+
this.identifier_or_literal();
|
|
596
|
+
this.state = 104;
|
|
597
|
+
this.match(LacLangParser.T__13);
|
|
598
|
+
this.state = 105;
|
|
599
|
+
this.match(LacLangParser.T__6);
|
|
600
|
+
this.state = 107;
|
|
601
|
+
this._errHandler.sync(this);
|
|
602
|
+
_la = this._input.LA(1);
|
|
603
|
+
if (
|
|
604
|
+
(_la & ~0x1f) === 0 &&
|
|
605
|
+
((1 << _la) &
|
|
606
|
+
((1 << LacLangParser.ADDRESS_LITERAL) |
|
|
607
|
+
(1 << LacLangParser.BOOL_LITERAL) |
|
|
608
|
+
(1 << LacLangParser.NUMBER_LITERAL) |
|
|
609
|
+
(1 << LacLangParser.STRING_LITERAL) |
|
|
610
|
+
(1 << LacLangParser.BYTES_LITERAL) |
|
|
611
|
+
(1 << LacLangParser.IDENTIFIER))) !==
|
|
612
|
+
0
|
|
613
|
+
) {
|
|
614
|
+
{
|
|
615
|
+
this.state = 106;
|
|
616
|
+
this.argumentsList();
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
this.state = 109;
|
|
621
|
+
this.match(LacLangParser.T__7);
|
|
622
|
+
this.state = 116;
|
|
623
|
+
this._errHandler.sync(this);
|
|
624
|
+
_la = this._input.LA(1);
|
|
625
|
+
if (_la === LacLangParser.WITH_KEYWORD) {
|
|
626
|
+
{
|
|
627
|
+
this.state = 110;
|
|
628
|
+
this.match(LacLangParser.WITH_KEYWORD);
|
|
629
|
+
this.state = 111;
|
|
630
|
+
this.match(LacLangParser.T__6);
|
|
631
|
+
this.state = 113;
|
|
632
|
+
this._errHandler.sync(this);
|
|
633
|
+
_la = this._input.LA(1);
|
|
634
|
+
if (
|
|
635
|
+
(_la & ~0x1f) === 0 &&
|
|
636
|
+
((1 << _la) &
|
|
637
|
+
((1 << LacLangParser.ADDRESS_LITERAL) |
|
|
638
|
+
(1 << LacLangParser.BOOL_LITERAL) |
|
|
639
|
+
(1 << LacLangParser.NUMBER_LITERAL) |
|
|
640
|
+
(1 << LacLangParser.STRING_LITERAL) |
|
|
641
|
+
(1 << LacLangParser.BYTES_LITERAL) |
|
|
642
|
+
(1 << LacLangParser.IDENTIFIER))) !==
|
|
643
|
+
0
|
|
644
|
+
) {
|
|
645
|
+
{
|
|
646
|
+
this.state = 112;
|
|
647
|
+
this.constantsList();
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
this.state = 115;
|
|
652
|
+
this.match(LacLangParser.T__7);
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
this.state = 118;
|
|
657
|
+
this.match(LacLangParser.T__1);
|
|
658
|
+
}
|
|
659
|
+
} catch (re) {
|
|
660
|
+
if (re instanceof RecognitionException) {
|
|
661
|
+
_localctx.exception = re;
|
|
662
|
+
this._errHandler.reportError(this, re);
|
|
663
|
+
this._errHandler.recover(this, re);
|
|
664
|
+
} else {
|
|
665
|
+
throw re;
|
|
666
|
+
}
|
|
667
|
+
} finally {
|
|
668
|
+
this.exitRule();
|
|
669
|
+
}
|
|
670
|
+
return _localctx;
|
|
671
|
+
}
|
|
672
|
+
// @RuleVersion(0)
|
|
673
|
+
public evaluateStatement(): EvaluateStatementContext {
|
|
674
|
+
let _localctx: EvaluateStatementContext = new EvaluateStatementContext(
|
|
675
|
+
this._ctx,
|
|
676
|
+
this.state,
|
|
677
|
+
);
|
|
678
|
+
this.enterRule(_localctx, 22, LacLangParser.RULE_evaluateStatement);
|
|
679
|
+
try {
|
|
680
|
+
this.enterOuterAlt(_localctx, 1);
|
|
681
|
+
{
|
|
682
|
+
this.state = 120;
|
|
683
|
+
this.match(LacLangParser.T__14);
|
|
684
|
+
this.state = 121;
|
|
685
|
+
this.match(LacLangParser.IDENTIFIER);
|
|
686
|
+
this.state = 122;
|
|
687
|
+
this.match(LacLangParser.T__1);
|
|
688
|
+
}
|
|
689
|
+
} catch (re) {
|
|
690
|
+
if (re instanceof RecognitionException) {
|
|
691
|
+
_localctx.exception = re;
|
|
692
|
+
this._errHandler.reportError(this, re);
|
|
693
|
+
this._errHandler.recover(this, re);
|
|
694
|
+
} else {
|
|
695
|
+
throw re;
|
|
696
|
+
}
|
|
697
|
+
} finally {
|
|
698
|
+
this.exitRule();
|
|
699
|
+
}
|
|
700
|
+
return _localctx;
|
|
701
|
+
}
|
|
702
|
+
// @RuleVersion(0)
|
|
703
|
+
public dataType(): DataTypeContext {
|
|
704
|
+
let _localctx: DataTypeContext = new DataTypeContext(this._ctx, this.state);
|
|
705
|
+
this.enterRule(_localctx, 24, LacLangParser.RULE_dataType);
|
|
706
|
+
let _la: number;
|
|
707
|
+
try {
|
|
708
|
+
this.enterOuterAlt(_localctx, 1);
|
|
709
|
+
{
|
|
710
|
+
this.state = 124;
|
|
711
|
+
_la = this._input.LA(1);
|
|
712
|
+
if (
|
|
713
|
+
!(
|
|
714
|
+
(_la & ~0x1f) === 0 &&
|
|
715
|
+
((1 << _la) &
|
|
716
|
+
((1 << LacLangParser.T__15) |
|
|
717
|
+
(1 << LacLangParser.T__16) |
|
|
718
|
+
(1 << LacLangParser.T__17) |
|
|
719
|
+
(1 << LacLangParser.T__18) |
|
|
720
|
+
(1 << LacLangParser.T__19))) !==
|
|
721
|
+
0
|
|
722
|
+
)
|
|
723
|
+
) {
|
|
724
|
+
this._errHandler.recoverInline(this);
|
|
725
|
+
} else {
|
|
726
|
+
if (this._input.LA(1) === Token.EOF) {
|
|
727
|
+
this.matchedEOF = true;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
this._errHandler.reportMatch(this);
|
|
731
|
+
this.consume();
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
} catch (re) {
|
|
735
|
+
if (re instanceof RecognitionException) {
|
|
736
|
+
_localctx.exception = re;
|
|
737
|
+
this._errHandler.reportError(this, re);
|
|
738
|
+
this._errHandler.recover(this, re);
|
|
739
|
+
} else {
|
|
740
|
+
throw re;
|
|
741
|
+
}
|
|
742
|
+
} finally {
|
|
743
|
+
this.exitRule();
|
|
744
|
+
}
|
|
745
|
+
return _localctx;
|
|
746
|
+
}
|
|
747
|
+
// @RuleVersion(0)
|
|
748
|
+
public constantsList(): ConstantsListContext {
|
|
749
|
+
let _localctx: ConstantsListContext = new ConstantsListContext(
|
|
750
|
+
this._ctx,
|
|
751
|
+
this.state,
|
|
752
|
+
);
|
|
753
|
+
this.enterRule(_localctx, 26, LacLangParser.RULE_constantsList);
|
|
754
|
+
try {
|
|
755
|
+
this.enterOuterAlt(_localctx, 1);
|
|
756
|
+
{
|
|
757
|
+
this.state = 126;
|
|
758
|
+
this.argumentsList();
|
|
759
|
+
}
|
|
760
|
+
} catch (re) {
|
|
761
|
+
if (re instanceof RecognitionException) {
|
|
762
|
+
_localctx.exception = re;
|
|
763
|
+
this._errHandler.reportError(this, re);
|
|
764
|
+
this._errHandler.recover(this, re);
|
|
765
|
+
} else {
|
|
766
|
+
throw re;
|
|
767
|
+
}
|
|
768
|
+
} finally {
|
|
769
|
+
this.exitRule();
|
|
770
|
+
}
|
|
771
|
+
return _localctx;
|
|
772
|
+
}
|
|
773
|
+
// @RuleVersion(0)
|
|
774
|
+
public argumentsList(): ArgumentsListContext {
|
|
775
|
+
let _localctx: ArgumentsListContext = new ArgumentsListContext(
|
|
776
|
+
this._ctx,
|
|
777
|
+
this.state,
|
|
778
|
+
);
|
|
779
|
+
this.enterRule(_localctx, 28, LacLangParser.RULE_argumentsList);
|
|
780
|
+
let _la: number;
|
|
781
|
+
try {
|
|
782
|
+
this.enterOuterAlt(_localctx, 1);
|
|
783
|
+
{
|
|
784
|
+
this.state = 128;
|
|
785
|
+
this.identifier_or_literal();
|
|
786
|
+
this.state = 133;
|
|
787
|
+
this._errHandler.sync(this);
|
|
788
|
+
_la = this._input.LA(1);
|
|
789
|
+
while (_la === LacLangParser.T__20) {
|
|
790
|
+
{
|
|
791
|
+
{
|
|
792
|
+
this.state = 129;
|
|
793
|
+
this.match(LacLangParser.T__20);
|
|
794
|
+
this.state = 130;
|
|
795
|
+
this.identifier_or_literal();
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
this.state = 135;
|
|
799
|
+
this._errHandler.sync(this);
|
|
800
|
+
_la = this._input.LA(1);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
} catch (re) {
|
|
804
|
+
if (re instanceof RecognitionException) {
|
|
805
|
+
_localctx.exception = re;
|
|
806
|
+
this._errHandler.reportError(this, re);
|
|
807
|
+
this._errHandler.recover(this, re);
|
|
808
|
+
} else {
|
|
809
|
+
throw re;
|
|
810
|
+
}
|
|
811
|
+
} finally {
|
|
812
|
+
this.exitRule();
|
|
813
|
+
}
|
|
814
|
+
return _localctx;
|
|
815
|
+
}
|
|
816
|
+
// @RuleVersion(0)
|
|
817
|
+
public identifier_or_literal(): Identifier_or_literalContext {
|
|
818
|
+
let _localctx: Identifier_or_literalContext =
|
|
819
|
+
new Identifier_or_literalContext(this._ctx, this.state);
|
|
820
|
+
this.enterRule(_localctx, 30, LacLangParser.RULE_identifier_or_literal);
|
|
821
|
+
try {
|
|
822
|
+
this.state = 138;
|
|
823
|
+
this._errHandler.sync(this);
|
|
824
|
+
switch (this._input.LA(1)) {
|
|
825
|
+
case LacLangParser.IDENTIFIER:
|
|
826
|
+
this.enterOuterAlt(_localctx, 1);
|
|
827
|
+
{
|
|
828
|
+
this.state = 136;
|
|
829
|
+
this.match(LacLangParser.IDENTIFIER);
|
|
830
|
+
}
|
|
831
|
+
break;
|
|
832
|
+
case LacLangParser.ADDRESS_LITERAL:
|
|
833
|
+
case LacLangParser.BOOL_LITERAL:
|
|
834
|
+
case LacLangParser.NUMBER_LITERAL:
|
|
835
|
+
case LacLangParser.STRING_LITERAL:
|
|
836
|
+
case LacLangParser.BYTES_LITERAL:
|
|
837
|
+
this.enterOuterAlt(_localctx, 2);
|
|
838
|
+
{
|
|
839
|
+
this.state = 137;
|
|
840
|
+
this.literal();
|
|
841
|
+
}
|
|
842
|
+
break;
|
|
843
|
+
default:
|
|
844
|
+
throw new NoViableAltException(this);
|
|
845
|
+
}
|
|
846
|
+
} catch (re) {
|
|
847
|
+
if (re instanceof RecognitionException) {
|
|
848
|
+
_localctx.exception = re;
|
|
849
|
+
this._errHandler.reportError(this, re);
|
|
850
|
+
this._errHandler.recover(this, re);
|
|
851
|
+
} else {
|
|
852
|
+
throw re;
|
|
853
|
+
}
|
|
854
|
+
} finally {
|
|
855
|
+
this.exitRule();
|
|
856
|
+
}
|
|
857
|
+
return _localctx;
|
|
858
|
+
}
|
|
859
|
+
// @RuleVersion(0)
|
|
860
|
+
public literal(): LiteralContext {
|
|
861
|
+
let _localctx: LiteralContext = new LiteralContext(this._ctx, this.state);
|
|
862
|
+
this.enterRule(_localctx, 32, LacLangParser.RULE_literal);
|
|
863
|
+
let _la: number;
|
|
864
|
+
try {
|
|
865
|
+
this.enterOuterAlt(_localctx, 1);
|
|
866
|
+
{
|
|
867
|
+
this.state = 140;
|
|
868
|
+
_la = this._input.LA(1);
|
|
869
|
+
if (
|
|
870
|
+
!(
|
|
871
|
+
(_la & ~0x1f) === 0 &&
|
|
872
|
+
((1 << _la) &
|
|
873
|
+
((1 << LacLangParser.ADDRESS_LITERAL) |
|
|
874
|
+
(1 << LacLangParser.BOOL_LITERAL) |
|
|
875
|
+
(1 << LacLangParser.NUMBER_LITERAL) |
|
|
876
|
+
(1 << LacLangParser.STRING_LITERAL) |
|
|
877
|
+
(1 << LacLangParser.BYTES_LITERAL))) !==
|
|
878
|
+
0
|
|
879
|
+
)
|
|
880
|
+
) {
|
|
881
|
+
this._errHandler.recoverInline(this);
|
|
882
|
+
} else {
|
|
883
|
+
if (this._input.LA(1) === Token.EOF) {
|
|
884
|
+
this.matchedEOF = true;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
this._errHandler.reportMatch(this);
|
|
888
|
+
this.consume();
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
} catch (re) {
|
|
892
|
+
if (re instanceof RecognitionException) {
|
|
893
|
+
_localctx.exception = re;
|
|
894
|
+
this._errHandler.reportError(this, re);
|
|
895
|
+
this._errHandler.recover(this, re);
|
|
896
|
+
} else {
|
|
897
|
+
throw re;
|
|
898
|
+
}
|
|
899
|
+
} finally {
|
|
900
|
+
this.exitRule();
|
|
901
|
+
}
|
|
902
|
+
return _localctx;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
public static readonly _serializedATN: string =
|
|
906
|
+
'\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03 \x91\x04\x02' +
|
|
907
|
+
'\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04\x07' +
|
|
908
|
+
'\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r\t\r\x04' +
|
|
909
|
+
'\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t\x12\x03' +
|
|
910
|
+
'\x02\x07\x02&\n\x02\f\x02\x0E\x02)\v\x02\x03\x02\x07\x02,\n\x02\f\x02' +
|
|
911
|
+
'\x0E\x02/\v\x02\x03\x02\x07\x022\n\x02\f\x02\x0E\x025\v\x02\x03\x02\x03' +
|
|
912
|
+
'\x02\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x05\x03>\n\x03\x03\x04\x03' +
|
|
913
|
+
'\x04\x03\x04\x03\x04\x03\x05\x03\x05\x03\x05\x03\x05\x03\x06\x03\x06\x03' +
|
|
914
|
+
'\x07\x03\x07\x03\b\x03\b\x05\bN\n\b\x03\b\x03\b\x03\b\x03\b\x03\t\x03' +
|
|
915
|
+
'\t\x03\t\x03\t\x03\t\x03\n\x03\n\x03\n\x03\n\x03\n\x03\n\x03\n\x03\v\x03' +
|
|
916
|
+
'\v\x03\v\x03\v\x03\v\x03\v\x03\f\x03\f\x03\f\x03\f\x03\f\x03\f\x03\f\x03' +
|
|
917
|
+
'\f\x05\fn\n\f\x03\f\x03\f\x03\f\x03\f\x05\ft\n\f\x03\f\x05\fw\n\f\x03' +
|
|
918
|
+
'\f\x03\f\x03\r\x03\r\x03\r\x03\r\x03\x0E\x03\x0E\x03\x0F\x03\x0F\x03\x10' +
|
|
919
|
+
'\x03\x10\x03\x10\x07\x10\x86\n\x10\f\x10\x0E\x10\x89\v\x10\x03\x11\x03' +
|
|
920
|
+
"\x11\x05\x11\x8D\n\x11\x03\x12\x03\x12\x03\x12\x05'-3\x02\x02\x13\x02" +
|
|
921
|
+
'\x02\x04\x02\x06\x02\b\x02\n\x02\f\x02\x0E\x02\x10\x02\x12\x02\x14\x02' +
|
|
922
|
+
'\x16\x02\x18\x02\x1A\x02\x1C\x02\x1E\x02 \x02"\x02\x02\x04\x03\x02\x12' +
|
|
923
|
+
"\x16\x03\x02\x19\x1D\x02\x8C\x02'\x03\x02\x02\x02\x04=\x03\x02\x02\x02" +
|
|
924
|
+
'\x06?\x03\x02\x02\x02\bC\x03\x02\x02\x02\nG\x03\x02\x02\x02\fI\x03\x02' +
|
|
925
|
+
'\x02\x02\x0EK\x03\x02\x02\x02\x10S\x03\x02\x02\x02\x12X\x03\x02\x02\x02' +
|
|
926
|
+
'\x14_\x03\x02\x02\x02\x16e\x03\x02\x02\x02\x18z\x03\x02\x02\x02\x1A~\x03' +
|
|
927
|
+
'\x02\x02\x02\x1C\x80\x03\x02\x02\x02\x1E\x82\x03\x02\x02\x02 \x8C\x03' +
|
|
928
|
+
'\x02\x02\x02"\x8E\x03\x02\x02\x02$&\x05\x06\x04\x02%$\x03\x02\x02\x02' +
|
|
929
|
+
"&)\x03\x02\x02\x02'(\x03\x02\x02\x02'%\x03\x02\x02\x02(-\x03\x02\x02" +
|
|
930
|
+
"\x02)'\x03\x02\x02\x02*,\x05\b\x05\x02+*\x03\x02\x02\x02,/\x03\x02\x02" +
|
|
931
|
+
'\x02-.\x03\x02\x02\x02-+\x03\x02\x02\x02.3\x03\x02\x02\x02/-\x03\x02\x02' +
|
|
932
|
+
'\x0202\x05\x04\x03\x0210\x03\x02\x02\x0225\x03\x02\x02\x0234\x03\x02\x02' +
|
|
933
|
+
'\x0231\x03\x02\x02\x0246\x03\x02\x02\x0253\x03\x02\x02\x0267\x07\x02\x02' +
|
|
934
|
+
'\x037\x03\x03\x02\x02\x028>\x05\x0E\b\x029>\x05\x12\n\x02:>\x05\x14\v' +
|
|
935
|
+
'\x02;>\x05\x16\f\x02<>\x05\x18\r\x02=8\x03\x02\x02\x02=9\x03\x02\x02\x02' +
|
|
936
|
+
'=:\x03\x02\x02\x02=;\x03\x02\x02\x02=<\x03\x02\x02\x02>\x05\x03\x02\x02' +
|
|
937
|
+
'\x02?@\x07\x03\x02\x02@A\x07\x1C\x02\x02AB\x07\x04\x02\x02B\x07\x03\x02' +
|
|
938
|
+
'\x02\x02CD\x07\x05\x02\x02DE\x05\n\x06\x02EF\x07\x04\x02\x02F\t\x03\x02' +
|
|
939
|
+
'\x02\x02GH\x05\f\x07\x02H\v\x03\x02\x02\x02IJ\x07\x06\x02\x02J\r\x03\x02' +
|
|
940
|
+
'\x02\x02KM\x07\x07\x02\x02LN\x05\x10\t\x02ML\x03\x02\x02\x02MN\x03\x02' +
|
|
941
|
+
'\x02\x02NO\x03\x02\x02\x02OP\x05\x1A\x0E\x02PQ\x07\x1E\x02\x02QR\x07\x04' +
|
|
942
|
+
'\x02\x02R\x0F\x03\x02\x02\x02ST\x07\b\x02\x02TU\x07\t\x02\x02UV\x07\x1C' +
|
|
943
|
+
'\x02\x02VW\x07\n\x02\x02W\x11\x03\x02\x02\x02XY\x07\v\x02\x02YZ\x05\x1A' +
|
|
944
|
+
'\x0E\x02Z[\x07\x1E\x02\x02[\\\x07\f\x02\x02\\]\x05"\x12\x02]^\x07\x04' +
|
|
945
|
+
'\x02\x02^\x13\x03\x02\x02\x02_`\x07\r\x02\x02`a\x07\x1E\x02\x02ab\x07' +
|
|
946
|
+
'\f\x02\x02bc\x07\x19\x02\x02cd\x07\x04\x02\x02d\x15\x03\x02\x02\x02ef' +
|
|
947
|
+
'\x07\x0E\x02\x02fg\x05\x1A\x0E\x02gh\x07\x1E\x02\x02hi\x07\x0F\x02\x02' +
|
|
948
|
+
'ij\x05 \x11\x02jk\x07\x10\x02\x02km\x07\t\x02\x02ln\x05\x1E\x10\x02ml' +
|
|
949
|
+
'\x03\x02\x02\x02mn\x03\x02\x02\x02no\x03\x02\x02\x02ov\x07\n\x02\x02p' +
|
|
950
|
+
'q\x07\x18\x02\x02qs\x07\t\x02\x02rt\x05\x1C\x0F\x02sr\x03\x02\x02\x02' +
|
|
951
|
+
'st\x03\x02\x02\x02tu\x03\x02\x02\x02uw\x07\n\x02\x02vp\x03\x02\x02\x02' +
|
|
952
|
+
'vw\x03\x02\x02\x02wx\x03\x02\x02\x02xy\x07\x04\x02\x02y\x17\x03\x02\x02' +
|
|
953
|
+
'\x02z{\x07\x11\x02\x02{|\x07\x1E\x02\x02|}\x07\x04\x02\x02}\x19\x03\x02' +
|
|
954
|
+
'\x02\x02~\x7F\t\x02\x02\x02\x7F\x1B\x03\x02\x02\x02\x80\x81\x05\x1E\x10' +
|
|
955
|
+
'\x02\x81\x1D\x03\x02\x02\x02\x82\x87\x05 \x11\x02\x83\x84\x07\x17\x02' +
|
|
956
|
+
'\x02\x84\x86\x05 \x11\x02\x85\x83\x03\x02\x02\x02\x86\x89\x03\x02\x02' +
|
|
957
|
+
'\x02\x87\x85\x03\x02\x02\x02\x87\x88\x03\x02\x02\x02\x88\x1F\x03\x02\x02' +
|
|
958
|
+
'\x02\x89\x87\x03\x02\x02\x02\x8A\x8D\x07\x1E\x02\x02\x8B\x8D\x05"\x12' +
|
|
959
|
+
'\x02\x8C\x8A\x03\x02\x02\x02\x8C\x8B\x03\x02\x02\x02\x8D!\x03\x02\x02' +
|
|
960
|
+
"\x02\x8E\x8F\t\x03\x02\x02\x8F#\x03\x02\x02\x02\f'-3=Mmsv\x87\x8C";
|
|
961
|
+
public static __ATN: ATN;
|
|
962
|
+
public static get _ATN(): ATN {
|
|
963
|
+
if (!LacLangParser.__ATN) {
|
|
964
|
+
LacLangParser.__ATN = new ATNDeserializer().deserialize(
|
|
965
|
+
Utils.toCharArray(LacLangParser._serializedATN),
|
|
966
|
+
);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
return LacLangParser.__ATN;
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
export class ProgramContext extends ParserRuleContext {
|
|
974
|
+
public EOF(): TerminalNode {
|
|
975
|
+
return this.getToken(LacLangParser.EOF, 0);
|
|
976
|
+
}
|
|
977
|
+
public importStatement(): ImportStatementContext[];
|
|
978
|
+
public importStatement(i: number): ImportStatementContext;
|
|
979
|
+
public importStatement(
|
|
980
|
+
i?: number,
|
|
981
|
+
): ImportStatementContext | ImportStatementContext[] {
|
|
982
|
+
if (i === undefined) {
|
|
983
|
+
return this.getRuleContexts(ImportStatementContext);
|
|
984
|
+
} else {
|
|
985
|
+
return this.getRuleContext(i, ImportStatementContext);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
public directive(): DirectiveContext[];
|
|
989
|
+
public directive(i: number): DirectiveContext;
|
|
990
|
+
public directive(i?: number): DirectiveContext | DirectiveContext[] {
|
|
991
|
+
if (i === undefined) {
|
|
992
|
+
return this.getRuleContexts(DirectiveContext);
|
|
993
|
+
} else {
|
|
994
|
+
return this.getRuleContext(i, DirectiveContext);
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
public statement(): StatementContext[];
|
|
998
|
+
public statement(i: number): StatementContext;
|
|
999
|
+
public statement(i?: number): StatementContext | StatementContext[] {
|
|
1000
|
+
if (i === undefined) {
|
|
1001
|
+
return this.getRuleContexts(StatementContext);
|
|
1002
|
+
} else {
|
|
1003
|
+
return this.getRuleContext(i, StatementContext);
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number) {
|
|
1007
|
+
super(parent, invokingState);
|
|
1008
|
+
}
|
|
1009
|
+
// @Override
|
|
1010
|
+
public get ruleIndex(): number {
|
|
1011
|
+
return LacLangParser.RULE_program;
|
|
1012
|
+
}
|
|
1013
|
+
// @Override
|
|
1014
|
+
public enterRule(listener: LacLangListener): void {
|
|
1015
|
+
if (listener.enterProgram) {
|
|
1016
|
+
listener.enterProgram(this);
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
// @Override
|
|
1020
|
+
public exitRule(listener: LacLangListener): void {
|
|
1021
|
+
if (listener.exitProgram) {
|
|
1022
|
+
listener.exitProgram(this);
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
export class StatementContext extends ParserRuleContext {
|
|
1028
|
+
public varDeclaration(): VarDeclarationContext | undefined {
|
|
1029
|
+
return this.tryGetRuleContext(0, VarDeclarationContext);
|
|
1030
|
+
}
|
|
1031
|
+
public constantDeclaration(): ConstantDeclarationContext | undefined {
|
|
1032
|
+
return this.tryGetRuleContext(0, ConstantDeclarationContext);
|
|
1033
|
+
}
|
|
1034
|
+
public artifactDeclaration(): ArtifactDeclarationContext | undefined {
|
|
1035
|
+
return this.tryGetRuleContext(0, ArtifactDeclarationContext);
|
|
1036
|
+
}
|
|
1037
|
+
public instanceDeclaration(): InstanceDeclarationContext | undefined {
|
|
1038
|
+
return this.tryGetRuleContext(0, InstanceDeclarationContext);
|
|
1039
|
+
}
|
|
1040
|
+
public evaluateStatement(): EvaluateStatementContext | undefined {
|
|
1041
|
+
return this.tryGetRuleContext(0, EvaluateStatementContext);
|
|
1042
|
+
}
|
|
1043
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number) {
|
|
1044
|
+
super(parent, invokingState);
|
|
1045
|
+
}
|
|
1046
|
+
// @Override
|
|
1047
|
+
public get ruleIndex(): number {
|
|
1048
|
+
return LacLangParser.RULE_statement;
|
|
1049
|
+
}
|
|
1050
|
+
// @Override
|
|
1051
|
+
public enterRule(listener: LacLangListener): void {
|
|
1052
|
+
if (listener.enterStatement) {
|
|
1053
|
+
listener.enterStatement(this);
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
// @Override
|
|
1057
|
+
public exitRule(listener: LacLangListener): void {
|
|
1058
|
+
if (listener.exitStatement) {
|
|
1059
|
+
listener.exitStatement(this);
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
export class ImportStatementContext extends ParserRuleContext {
|
|
1065
|
+
public STRING_LITERAL(): TerminalNode {
|
|
1066
|
+
return this.getToken(LacLangParser.STRING_LITERAL, 0);
|
|
1067
|
+
}
|
|
1068
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number) {
|
|
1069
|
+
super(parent, invokingState);
|
|
1070
|
+
}
|
|
1071
|
+
// @Override
|
|
1072
|
+
public get ruleIndex(): number {
|
|
1073
|
+
return LacLangParser.RULE_importStatement;
|
|
1074
|
+
}
|
|
1075
|
+
// @Override
|
|
1076
|
+
public enterRule(listener: LacLangListener): void {
|
|
1077
|
+
if (listener.enterImportStatement) {
|
|
1078
|
+
listener.enterImportStatement(this);
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
// @Override
|
|
1082
|
+
public exitRule(listener: LacLangListener): void {
|
|
1083
|
+
if (listener.exitImportStatement) {
|
|
1084
|
+
listener.exitImportStatement(this);
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
export class DirectiveContext extends ParserRuleContext {
|
|
1090
|
+
public directiveIndentifier(): DirectiveIndentifierContext {
|
|
1091
|
+
return this.getRuleContext(0, DirectiveIndentifierContext);
|
|
1092
|
+
}
|
|
1093
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number) {
|
|
1094
|
+
super(parent, invokingState);
|
|
1095
|
+
}
|
|
1096
|
+
// @Override
|
|
1097
|
+
public get ruleIndex(): number {
|
|
1098
|
+
return LacLangParser.RULE_directive;
|
|
1099
|
+
}
|
|
1100
|
+
// @Override
|
|
1101
|
+
public enterRule(listener: LacLangListener): void {
|
|
1102
|
+
if (listener.enterDirective) {
|
|
1103
|
+
listener.enterDirective(this);
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
// @Override
|
|
1107
|
+
public exitRule(listener: LacLangListener): void {
|
|
1108
|
+
if (listener.exitDirective) {
|
|
1109
|
+
listener.exitDirective(this);
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
export class DirectiveIndentifierContext extends ParserRuleContext {
|
|
1115
|
+
public injectedOnlyDirective(): InjectedOnlyDirectiveContext {
|
|
1116
|
+
return this.getRuleContext(0, InjectedOnlyDirectiveContext);
|
|
1117
|
+
}
|
|
1118
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number) {
|
|
1119
|
+
super(parent, invokingState);
|
|
1120
|
+
}
|
|
1121
|
+
// @Override
|
|
1122
|
+
public get ruleIndex(): number {
|
|
1123
|
+
return LacLangParser.RULE_directiveIndentifier;
|
|
1124
|
+
}
|
|
1125
|
+
// @Override
|
|
1126
|
+
public enterRule(listener: LacLangListener): void {
|
|
1127
|
+
if (listener.enterDirectiveIndentifier) {
|
|
1128
|
+
listener.enterDirectiveIndentifier(this);
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
// @Override
|
|
1132
|
+
public exitRule(listener: LacLangListener): void {
|
|
1133
|
+
if (listener.exitDirectiveIndentifier) {
|
|
1134
|
+
listener.exitDirectiveIndentifier(this);
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
export class InjectedOnlyDirectiveContext extends ParserRuleContext {
|
|
1140
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number) {
|
|
1141
|
+
super(parent, invokingState);
|
|
1142
|
+
}
|
|
1143
|
+
// @Override
|
|
1144
|
+
public get ruleIndex(): number {
|
|
1145
|
+
return LacLangParser.RULE_injectedOnlyDirective;
|
|
1146
|
+
}
|
|
1147
|
+
// @Override
|
|
1148
|
+
public enterRule(listener: LacLangListener): void {
|
|
1149
|
+
if (listener.enterInjectedOnlyDirective) {
|
|
1150
|
+
listener.enterInjectedOnlyDirective(this);
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
// @Override
|
|
1154
|
+
public exitRule(listener: LacLangListener): void {
|
|
1155
|
+
if (listener.exitInjectedOnlyDirective) {
|
|
1156
|
+
listener.exitInjectedOnlyDirective(this);
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
export class VarDeclarationContext extends ParserRuleContext {
|
|
1162
|
+
public dataType(): DataTypeContext {
|
|
1163
|
+
return this.getRuleContext(0, DataTypeContext);
|
|
1164
|
+
}
|
|
1165
|
+
public IDENTIFIER(): TerminalNode {
|
|
1166
|
+
return this.getToken(LacLangParser.IDENTIFIER, 0);
|
|
1167
|
+
}
|
|
1168
|
+
public injectionModifier(): InjectionModifierContext | undefined {
|
|
1169
|
+
return this.tryGetRuleContext(0, InjectionModifierContext);
|
|
1170
|
+
}
|
|
1171
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number) {
|
|
1172
|
+
super(parent, invokingState);
|
|
1173
|
+
}
|
|
1174
|
+
// @Override
|
|
1175
|
+
public get ruleIndex(): number {
|
|
1176
|
+
return LacLangParser.RULE_varDeclaration;
|
|
1177
|
+
}
|
|
1178
|
+
// @Override
|
|
1179
|
+
public enterRule(listener: LacLangListener): void {
|
|
1180
|
+
if (listener.enterVarDeclaration) {
|
|
1181
|
+
listener.enterVarDeclaration(this);
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
// @Override
|
|
1185
|
+
public exitRule(listener: LacLangListener): void {
|
|
1186
|
+
if (listener.exitVarDeclaration) {
|
|
1187
|
+
listener.exitVarDeclaration(this);
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
export class InjectionModifierContext extends ParserRuleContext {
|
|
1193
|
+
public STRING_LITERAL(): TerminalNode {
|
|
1194
|
+
return this.getToken(LacLangParser.STRING_LITERAL, 0);
|
|
1195
|
+
}
|
|
1196
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number) {
|
|
1197
|
+
super(parent, invokingState);
|
|
1198
|
+
}
|
|
1199
|
+
// @Override
|
|
1200
|
+
public get ruleIndex(): number {
|
|
1201
|
+
return LacLangParser.RULE_injectionModifier;
|
|
1202
|
+
}
|
|
1203
|
+
// @Override
|
|
1204
|
+
public enterRule(listener: LacLangListener): void {
|
|
1205
|
+
if (listener.enterInjectionModifier) {
|
|
1206
|
+
listener.enterInjectionModifier(this);
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
// @Override
|
|
1210
|
+
public exitRule(listener: LacLangListener): void {
|
|
1211
|
+
if (listener.exitInjectionModifier) {
|
|
1212
|
+
listener.exitInjectionModifier(this);
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
export class ConstantDeclarationContext extends ParserRuleContext {
|
|
1218
|
+
public dataType(): DataTypeContext {
|
|
1219
|
+
return this.getRuleContext(0, DataTypeContext);
|
|
1220
|
+
}
|
|
1221
|
+
public IDENTIFIER(): TerminalNode {
|
|
1222
|
+
return this.getToken(LacLangParser.IDENTIFIER, 0);
|
|
1223
|
+
}
|
|
1224
|
+
public literal(): LiteralContext {
|
|
1225
|
+
return this.getRuleContext(0, LiteralContext);
|
|
1226
|
+
}
|
|
1227
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number) {
|
|
1228
|
+
super(parent, invokingState);
|
|
1229
|
+
}
|
|
1230
|
+
// @Override
|
|
1231
|
+
public get ruleIndex(): number {
|
|
1232
|
+
return LacLangParser.RULE_constantDeclaration;
|
|
1233
|
+
}
|
|
1234
|
+
// @Override
|
|
1235
|
+
public enterRule(listener: LacLangListener): void {
|
|
1236
|
+
if (listener.enterConstantDeclaration) {
|
|
1237
|
+
listener.enterConstantDeclaration(this);
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
// @Override
|
|
1241
|
+
public exitRule(listener: LacLangListener): void {
|
|
1242
|
+
if (listener.exitConstantDeclaration) {
|
|
1243
|
+
listener.exitConstantDeclaration(this);
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
export class ArtifactDeclarationContext extends ParserRuleContext {
|
|
1249
|
+
public IDENTIFIER(): TerminalNode {
|
|
1250
|
+
return this.getToken(LacLangParser.IDENTIFIER, 0);
|
|
1251
|
+
}
|
|
1252
|
+
public ADDRESS_LITERAL(): TerminalNode {
|
|
1253
|
+
return this.getToken(LacLangParser.ADDRESS_LITERAL, 0);
|
|
1254
|
+
}
|
|
1255
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number) {
|
|
1256
|
+
super(parent, invokingState);
|
|
1257
|
+
}
|
|
1258
|
+
// @Override
|
|
1259
|
+
public get ruleIndex(): number {
|
|
1260
|
+
return LacLangParser.RULE_artifactDeclaration;
|
|
1261
|
+
}
|
|
1262
|
+
// @Override
|
|
1263
|
+
public enterRule(listener: LacLangListener): void {
|
|
1264
|
+
if (listener.enterArtifactDeclaration) {
|
|
1265
|
+
listener.enterArtifactDeclaration(this);
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
// @Override
|
|
1269
|
+
public exitRule(listener: LacLangListener): void {
|
|
1270
|
+
if (listener.exitArtifactDeclaration) {
|
|
1271
|
+
listener.exitArtifactDeclaration(this);
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
export class InstanceDeclarationContext extends ParserRuleContext {
|
|
1277
|
+
public dataType(): DataTypeContext {
|
|
1278
|
+
return this.getRuleContext(0, DataTypeContext);
|
|
1279
|
+
}
|
|
1280
|
+
public IDENTIFIER(): TerminalNode {
|
|
1281
|
+
return this.getToken(LacLangParser.IDENTIFIER, 0);
|
|
1282
|
+
}
|
|
1283
|
+
public identifier_or_literal(): Identifier_or_literalContext {
|
|
1284
|
+
return this.getRuleContext(0, Identifier_or_literalContext);
|
|
1285
|
+
}
|
|
1286
|
+
public argumentsList(): ArgumentsListContext | undefined {
|
|
1287
|
+
return this.tryGetRuleContext(0, ArgumentsListContext);
|
|
1288
|
+
}
|
|
1289
|
+
public WITH_KEYWORD(): TerminalNode | undefined {
|
|
1290
|
+
return this.tryGetToken(LacLangParser.WITH_KEYWORD, 0);
|
|
1291
|
+
}
|
|
1292
|
+
public constantsList(): ConstantsListContext | undefined {
|
|
1293
|
+
return this.tryGetRuleContext(0, ConstantsListContext);
|
|
1294
|
+
}
|
|
1295
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number) {
|
|
1296
|
+
super(parent, invokingState);
|
|
1297
|
+
}
|
|
1298
|
+
// @Override
|
|
1299
|
+
public get ruleIndex(): number {
|
|
1300
|
+
return LacLangParser.RULE_instanceDeclaration;
|
|
1301
|
+
}
|
|
1302
|
+
// @Override
|
|
1303
|
+
public enterRule(listener: LacLangListener): void {
|
|
1304
|
+
if (listener.enterInstanceDeclaration) {
|
|
1305
|
+
listener.enterInstanceDeclaration(this);
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
// @Override
|
|
1309
|
+
public exitRule(listener: LacLangListener): void {
|
|
1310
|
+
if (listener.exitInstanceDeclaration) {
|
|
1311
|
+
listener.exitInstanceDeclaration(this);
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
export class EvaluateStatementContext extends ParserRuleContext {
|
|
1317
|
+
public IDENTIFIER(): TerminalNode {
|
|
1318
|
+
return this.getToken(LacLangParser.IDENTIFIER, 0);
|
|
1319
|
+
}
|
|
1320
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number) {
|
|
1321
|
+
super(parent, invokingState);
|
|
1322
|
+
}
|
|
1323
|
+
// @Override
|
|
1324
|
+
public get ruleIndex(): number {
|
|
1325
|
+
return LacLangParser.RULE_evaluateStatement;
|
|
1326
|
+
}
|
|
1327
|
+
// @Override
|
|
1328
|
+
public enterRule(listener: LacLangListener): void {
|
|
1329
|
+
if (listener.enterEvaluateStatement) {
|
|
1330
|
+
listener.enterEvaluateStatement(this);
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
// @Override
|
|
1334
|
+
public exitRule(listener: LacLangListener): void {
|
|
1335
|
+
if (listener.exitEvaluateStatement) {
|
|
1336
|
+
listener.exitEvaluateStatement(this);
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
export class DataTypeContext extends ParserRuleContext {
|
|
1342
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number) {
|
|
1343
|
+
super(parent, invokingState);
|
|
1344
|
+
}
|
|
1345
|
+
// @Override
|
|
1346
|
+
public get ruleIndex(): number {
|
|
1347
|
+
return LacLangParser.RULE_dataType;
|
|
1348
|
+
}
|
|
1349
|
+
// @Override
|
|
1350
|
+
public enterRule(listener: LacLangListener): void {
|
|
1351
|
+
if (listener.enterDataType) {
|
|
1352
|
+
listener.enterDataType(this);
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
// @Override
|
|
1356
|
+
public exitRule(listener: LacLangListener): void {
|
|
1357
|
+
if (listener.exitDataType) {
|
|
1358
|
+
listener.exitDataType(this);
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
export class ConstantsListContext extends ParserRuleContext {
|
|
1364
|
+
public argumentsList(): ArgumentsListContext {
|
|
1365
|
+
return this.getRuleContext(0, ArgumentsListContext);
|
|
1366
|
+
}
|
|
1367
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number) {
|
|
1368
|
+
super(parent, invokingState);
|
|
1369
|
+
}
|
|
1370
|
+
// @Override
|
|
1371
|
+
public get ruleIndex(): number {
|
|
1372
|
+
return LacLangParser.RULE_constantsList;
|
|
1373
|
+
}
|
|
1374
|
+
// @Override
|
|
1375
|
+
public enterRule(listener: LacLangListener): void {
|
|
1376
|
+
if (listener.enterConstantsList) {
|
|
1377
|
+
listener.enterConstantsList(this);
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
// @Override
|
|
1381
|
+
public exitRule(listener: LacLangListener): void {
|
|
1382
|
+
if (listener.exitConstantsList) {
|
|
1383
|
+
listener.exitConstantsList(this);
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
export class ArgumentsListContext extends ParserRuleContext {
|
|
1389
|
+
public identifier_or_literal(): Identifier_or_literalContext[];
|
|
1390
|
+
public identifier_or_literal(i: number): Identifier_or_literalContext;
|
|
1391
|
+
public identifier_or_literal(
|
|
1392
|
+
i?: number,
|
|
1393
|
+
): Identifier_or_literalContext | Identifier_or_literalContext[] {
|
|
1394
|
+
if (i === undefined) {
|
|
1395
|
+
return this.getRuleContexts(Identifier_or_literalContext);
|
|
1396
|
+
} else {
|
|
1397
|
+
return this.getRuleContext(i, Identifier_or_literalContext);
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number) {
|
|
1401
|
+
super(parent, invokingState);
|
|
1402
|
+
}
|
|
1403
|
+
// @Override
|
|
1404
|
+
public get ruleIndex(): number {
|
|
1405
|
+
return LacLangParser.RULE_argumentsList;
|
|
1406
|
+
}
|
|
1407
|
+
// @Override
|
|
1408
|
+
public enterRule(listener: LacLangListener): void {
|
|
1409
|
+
if (listener.enterArgumentsList) {
|
|
1410
|
+
listener.enterArgumentsList(this);
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
// @Override
|
|
1414
|
+
public exitRule(listener: LacLangListener): void {
|
|
1415
|
+
if (listener.exitArgumentsList) {
|
|
1416
|
+
listener.exitArgumentsList(this);
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
export class Identifier_or_literalContext extends ParserRuleContext {
|
|
1422
|
+
public IDENTIFIER(): TerminalNode | undefined {
|
|
1423
|
+
return this.tryGetToken(LacLangParser.IDENTIFIER, 0);
|
|
1424
|
+
}
|
|
1425
|
+
public literal(): LiteralContext | undefined {
|
|
1426
|
+
return this.tryGetRuleContext(0, LiteralContext);
|
|
1427
|
+
}
|
|
1428
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number) {
|
|
1429
|
+
super(parent, invokingState);
|
|
1430
|
+
}
|
|
1431
|
+
// @Override
|
|
1432
|
+
public get ruleIndex(): number {
|
|
1433
|
+
return LacLangParser.RULE_identifier_or_literal;
|
|
1434
|
+
}
|
|
1435
|
+
// @Override
|
|
1436
|
+
public enterRule(listener: LacLangListener): void {
|
|
1437
|
+
if (listener.enterIdentifier_or_literal) {
|
|
1438
|
+
listener.enterIdentifier_or_literal(this);
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
// @Override
|
|
1442
|
+
public exitRule(listener: LacLangListener): void {
|
|
1443
|
+
if (listener.exitIdentifier_or_literal) {
|
|
1444
|
+
listener.exitIdentifier_or_literal(this);
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
export class LiteralContext extends ParserRuleContext {
|
|
1450
|
+
public BOOL_LITERAL(): TerminalNode | undefined {
|
|
1451
|
+
return this.tryGetToken(LacLangParser.BOOL_LITERAL, 0);
|
|
1452
|
+
}
|
|
1453
|
+
public NUMBER_LITERAL(): TerminalNode | undefined {
|
|
1454
|
+
return this.tryGetToken(LacLangParser.NUMBER_LITERAL, 0);
|
|
1455
|
+
}
|
|
1456
|
+
public STRING_LITERAL(): TerminalNode | undefined {
|
|
1457
|
+
return this.tryGetToken(LacLangParser.STRING_LITERAL, 0);
|
|
1458
|
+
}
|
|
1459
|
+
public BYTES_LITERAL(): TerminalNode | undefined {
|
|
1460
|
+
return this.tryGetToken(LacLangParser.BYTES_LITERAL, 0);
|
|
1461
|
+
}
|
|
1462
|
+
public ADDRESS_LITERAL(): TerminalNode | undefined {
|
|
1463
|
+
return this.tryGetToken(LacLangParser.ADDRESS_LITERAL, 0);
|
|
1464
|
+
}
|
|
1465
|
+
constructor(parent: ParserRuleContext | undefined, invokingState: number) {
|
|
1466
|
+
super(parent, invokingState);
|
|
1467
|
+
}
|
|
1468
|
+
// @Override
|
|
1469
|
+
public get ruleIndex(): number {
|
|
1470
|
+
return LacLangParser.RULE_literal;
|
|
1471
|
+
}
|
|
1472
|
+
// @Override
|
|
1473
|
+
public enterRule(listener: LacLangListener): void {
|
|
1474
|
+
if (listener.enterLiteral) {
|
|
1475
|
+
listener.enterLiteral(this);
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
// @Override
|
|
1479
|
+
public exitRule(listener: LacLangListener): void {
|
|
1480
|
+
if (listener.exitLiteral) {
|
|
1481
|
+
listener.exitLiteral(this);
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
}
|