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