@malloydata/malloy-tag 0.0.335 → 0.0.336

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 (59) hide show
  1. package/CONTEXT.md +83 -9
  2. package/dist/index.d.ts +3 -0
  3. package/dist/index.js +5 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/peggy/dist/peg-tag-parser.d.ts +11 -0
  6. package/dist/peggy/dist/peg-tag-parser.js +3130 -0
  7. package/dist/peggy/dist/peg-tag-parser.js.map +1 -0
  8. package/dist/peggy/index.d.ts +13 -0
  9. package/dist/peggy/index.js +117 -0
  10. package/dist/peggy/index.js.map +1 -0
  11. package/dist/peggy/interpreter.d.ts +32 -0
  12. package/dist/peggy/interpreter.js +208 -0
  13. package/dist/peggy/interpreter.js.map +1 -0
  14. package/dist/peggy/statements.d.ts +51 -0
  15. package/dist/peggy/statements.js +7 -0
  16. package/dist/peggy/statements.js.map +1 -0
  17. package/dist/schema.d.ts +41 -0
  18. package/dist/schema.js +573 -0
  19. package/dist/schema.js.map +1 -0
  20. package/dist/schema.spec.d.ts +1 -0
  21. package/dist/schema.spec.js +980 -0
  22. package/dist/schema.spec.js.map +1 -0
  23. package/dist/tags.d.ts +144 -37
  24. package/dist/tags.js +535 -344
  25. package/dist/tags.js.map +1 -1
  26. package/dist/tags.spec.js +524 -45
  27. package/dist/tags.spec.js.map +1 -1
  28. package/package.json +6 -8
  29. package/src/index.ts +3 -0
  30. package/src/motly-schema.motly +52 -0
  31. package/src/peggy/dist/peg-tag-parser.js +2790 -0
  32. package/src/peggy/index.ts +89 -0
  33. package/src/peggy/interpreter.ts +265 -0
  34. package/src/peggy/malloy-tag.peggy +224 -0
  35. package/src/peggy/statements.ts +49 -0
  36. package/src/schema.spec.ts +1280 -0
  37. package/src/schema.ts +852 -0
  38. package/src/tags.spec.ts +591 -46
  39. package/src/tags.ts +597 -398
  40. package/tsconfig.json +3 -2
  41. package/dist/lib/Malloy/MalloyTagLexer.d.ts +0 -42
  42. package/dist/lib/Malloy/MalloyTagLexer.js +0 -395
  43. package/dist/lib/Malloy/MalloyTagLexer.js.map +0 -1
  44. package/dist/lib/Malloy/MalloyTagParser.d.ts +0 -180
  45. package/dist/lib/Malloy/MalloyTagParser.js +0 -1077
  46. package/dist/lib/Malloy/MalloyTagParser.js.map +0 -1
  47. package/dist/lib/Malloy/MalloyTagVisitor.d.ts +0 -120
  48. package/dist/lib/Malloy/MalloyTagVisitor.js +0 -4
  49. package/dist/lib/Malloy/MalloyTagVisitor.js.map +0 -1
  50. package/scripts/build_parser.js +0 -98
  51. package/src/MalloyTag.g4 +0 -104
  52. package/src/lib/Malloy/MalloyTag.interp +0 -61
  53. package/src/lib/Malloy/MalloyTag.tokens +0 -32
  54. package/src/lib/Malloy/MalloyTagLexer.interp +0 -85
  55. package/src/lib/Malloy/MalloyTagLexer.tokens +0 -32
  56. package/src/lib/Malloy/MalloyTagLexer.ts +0 -386
  57. package/src/lib/Malloy/MalloyTagParser.ts +0 -1065
  58. package/src/lib/Malloy/MalloyTagVisitor.ts +0 -141
  59. package/src/lib/Malloy/_BUILD_DIGEST_ +0 -1
@@ -1,1077 +0,0 @@
1
- "use strict";
2
- // Generated from MalloyTag.g4 by ANTLR 4.9.0-SNAPSHOT
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
36
- Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.PropertiesContext = exports.ArrayValueContext = exports.ReferenceContext = exports.ArrayElementContext = exports.EqValueContext = exports.PropNameContext = exports.IdentifierContext = exports.StringContext = exports.TagEmptyContext = exports.TagDefContext = exports.TagUpdatePropertiesContext = exports.TagReplacePropertiesContext = exports.TagEqContext = exports.TagSpecContext = exports.TagLineContext = exports.MalloyTagParser = void 0;
38
- const ATN_1 = require("antlr4ts/atn/ATN");
39
- const ATNDeserializer_1 = require("antlr4ts/atn/ATNDeserializer");
40
- const FailedPredicateException_1 = require("antlr4ts/FailedPredicateException");
41
- const NoViableAltException_1 = require("antlr4ts/NoViableAltException");
42
- const Parser_1 = require("antlr4ts/Parser");
43
- const ParserRuleContext_1 = require("antlr4ts/ParserRuleContext");
44
- const ParserATNSimulator_1 = require("antlr4ts/atn/ParserATNSimulator");
45
- const RecognitionException_1 = require("antlr4ts/RecognitionException");
46
- const Token_1 = require("antlr4ts/Token");
47
- const VocabularyImpl_1 = require("antlr4ts/VocabularyImpl");
48
- const Utils = __importStar(require("antlr4ts/misc/Utils"));
49
- class MalloyTagParser extends Parser_1.Parser {
50
- // @Override
51
- // @NotNull
52
- get vocabulary() {
53
- return MalloyTagParser.VOCABULARY;
54
- }
55
- // tslint:enable:no-trailing-whitespace
56
- // @Override
57
- get grammarFileName() { return "MalloyTag.g4"; }
58
- // @Override
59
- get ruleNames() { return MalloyTagParser.ruleNames; }
60
- // @Override
61
- get serializedATN() { return MalloyTagParser._serializedATN; }
62
- createFailedPredicateException(predicate, message) {
63
- return new FailedPredicateException_1.FailedPredicateException(this, predicate, message);
64
- }
65
- constructor(input) {
66
- super(input);
67
- this._interp = new ParserATNSimulator_1.ParserATNSimulator(MalloyTagParser._ATN, this);
68
- }
69
- // @RuleVersion(0)
70
- tagLine() {
71
- let _localctx = new TagLineContext(this._ctx, this.state);
72
- this.enterRule(_localctx, 0, MalloyTagParser.RULE_tagLine);
73
- let _la;
74
- try {
75
- this.enterOuterAlt(_localctx, 1);
76
- {
77
- this.state = 23;
78
- this._errHandler.sync(this);
79
- _la = this._input.LA(1);
80
- while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << MalloyTagParser.MINUS_DOTTY) | (1 << MalloyTagParser.MINUS) | (1 << MalloyTagParser.BQ_STRING) | (1 << MalloyTagParser.BARE_STRING))) !== 0)) {
81
- {
82
- {
83
- this.state = 20;
84
- this.tagSpec();
85
- }
86
- }
87
- this.state = 25;
88
- this._errHandler.sync(this);
89
- _la = this._input.LA(1);
90
- }
91
- this.state = 26;
92
- this.match(MalloyTagParser.EOF);
93
- }
94
- }
95
- catch (re) {
96
- if (re instanceof RecognitionException_1.RecognitionException) {
97
- _localctx.exception = re;
98
- this._errHandler.reportError(this, re);
99
- this._errHandler.recover(this, re);
100
- }
101
- else {
102
- throw re;
103
- }
104
- }
105
- finally {
106
- this.exitRule();
107
- }
108
- return _localctx;
109
- }
110
- // @RuleVersion(0)
111
- tagSpec() {
112
- let _localctx = new TagSpecContext(this._ctx, this.state);
113
- this.enterRule(_localctx, 2, MalloyTagParser.RULE_tagSpec);
114
- let _la;
115
- try {
116
- this.state = 49;
117
- this._errHandler.sync(this);
118
- switch (this.interpreter.adaptivePredict(this._input, 4, this._ctx)) {
119
- case 1:
120
- _localctx = new TagEqContext(_localctx);
121
- this.enterOuterAlt(_localctx, 1);
122
- {
123
- this.state = 28;
124
- this.propName();
125
- this.state = 29;
126
- this.match(MalloyTagParser.EQ);
127
- this.state = 30;
128
- this.eqValue();
129
- this.state = 32;
130
- this._errHandler.sync(this);
131
- _la = this._input.LA(1);
132
- if (_la === MalloyTagParser.PR_BEG) {
133
- {
134
- this.state = 31;
135
- this.properties();
136
- }
137
- }
138
- }
139
- break;
140
- case 2:
141
- _localctx = new TagReplacePropertiesContext(_localctx);
142
- this.enterOuterAlt(_localctx, 2);
143
- {
144
- this.state = 34;
145
- this.propName();
146
- this.state = 35;
147
- this.match(MalloyTagParser.EQ);
148
- this.state = 37;
149
- this._errHandler.sync(this);
150
- _la = this._input.LA(1);
151
- if (_la === MalloyTagParser.DOTTY) {
152
- {
153
- this.state = 36;
154
- this.match(MalloyTagParser.DOTTY);
155
- }
156
- }
157
- this.state = 39;
158
- this.properties();
159
- }
160
- break;
161
- case 3:
162
- _localctx = new TagUpdatePropertiesContext(_localctx);
163
- this.enterOuterAlt(_localctx, 3);
164
- {
165
- this.state = 41;
166
- this.propName();
167
- this.state = 42;
168
- this.properties();
169
- }
170
- break;
171
- case 4:
172
- _localctx = new TagDefContext(_localctx);
173
- this.enterOuterAlt(_localctx, 4);
174
- {
175
- this.state = 45;
176
- this._errHandler.sync(this);
177
- _la = this._input.LA(1);
178
- if (_la === MalloyTagParser.MINUS) {
179
- {
180
- this.state = 44;
181
- this.match(MalloyTagParser.MINUS);
182
- }
183
- }
184
- this.state = 47;
185
- this.propName();
186
- }
187
- break;
188
- case 5:
189
- _localctx = new TagEmptyContext(_localctx);
190
- this.enterOuterAlt(_localctx, 5);
191
- {
192
- this.state = 48;
193
- this.match(MalloyTagParser.MINUS_DOTTY);
194
- }
195
- break;
196
- }
197
- }
198
- catch (re) {
199
- if (re instanceof RecognitionException_1.RecognitionException) {
200
- _localctx.exception = re;
201
- this._errHandler.reportError(this, re);
202
- this._errHandler.recover(this, re);
203
- }
204
- else {
205
- throw re;
206
- }
207
- }
208
- finally {
209
- this.exitRule();
210
- }
211
- return _localctx;
212
- }
213
- // @RuleVersion(0)
214
- string() {
215
- let _localctx = new StringContext(this._ctx, this.state);
216
- this.enterRule(_localctx, 4, MalloyTagParser.RULE_string);
217
- let _la;
218
- try {
219
- this.enterOuterAlt(_localctx, 1);
220
- {
221
- this.state = 51;
222
- _la = this._input.LA(1);
223
- if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << MalloyTagParser.SQ_STRING) | (1 << MalloyTagParser.DQ_STRING) | (1 << MalloyTagParser.NUMERIC_LITERAL) | (1 << MalloyTagParser.BARE_STRING))) !== 0))) {
224
- this._errHandler.recoverInline(this);
225
- }
226
- else {
227
- if (this._input.LA(1) === Token_1.Token.EOF) {
228
- this.matchedEOF = true;
229
- }
230
- this._errHandler.reportMatch(this);
231
- this.consume();
232
- }
233
- }
234
- }
235
- catch (re) {
236
- if (re instanceof RecognitionException_1.RecognitionException) {
237
- _localctx.exception = re;
238
- this._errHandler.reportError(this, re);
239
- this._errHandler.recover(this, re);
240
- }
241
- else {
242
- throw re;
243
- }
244
- }
245
- finally {
246
- this.exitRule();
247
- }
248
- return _localctx;
249
- }
250
- // @RuleVersion(0)
251
- identifier() {
252
- let _localctx = new IdentifierContext(this._ctx, this.state);
253
- this.enterRule(_localctx, 6, MalloyTagParser.RULE_identifier);
254
- let _la;
255
- try {
256
- this.enterOuterAlt(_localctx, 1);
257
- {
258
- this.state = 53;
259
- _la = this._input.LA(1);
260
- if (!(_la === MalloyTagParser.BQ_STRING || _la === MalloyTagParser.BARE_STRING)) {
261
- this._errHandler.recoverInline(this);
262
- }
263
- else {
264
- if (this._input.LA(1) === Token_1.Token.EOF) {
265
- this.matchedEOF = true;
266
- }
267
- this._errHandler.reportMatch(this);
268
- this.consume();
269
- }
270
- }
271
- }
272
- catch (re) {
273
- if (re instanceof RecognitionException_1.RecognitionException) {
274
- _localctx.exception = re;
275
- this._errHandler.reportError(this, re);
276
- this._errHandler.recover(this, re);
277
- }
278
- else {
279
- throw re;
280
- }
281
- }
282
- finally {
283
- this.exitRule();
284
- }
285
- return _localctx;
286
- }
287
- // @RuleVersion(0)
288
- propName() {
289
- let _localctx = new PropNameContext(this._ctx, this.state);
290
- this.enterRule(_localctx, 8, MalloyTagParser.RULE_propName);
291
- let _la;
292
- try {
293
- this.enterOuterAlt(_localctx, 1);
294
- {
295
- this.state = 55;
296
- this.identifier();
297
- this.state = 60;
298
- this._errHandler.sync(this);
299
- _la = this._input.LA(1);
300
- while (_la === MalloyTagParser.DOT) {
301
- {
302
- {
303
- this.state = 56;
304
- this.match(MalloyTagParser.DOT);
305
- this.state = 57;
306
- this.identifier();
307
- }
308
- }
309
- this.state = 62;
310
- this._errHandler.sync(this);
311
- _la = this._input.LA(1);
312
- }
313
- }
314
- }
315
- catch (re) {
316
- if (re instanceof RecognitionException_1.RecognitionException) {
317
- _localctx.exception = re;
318
- this._errHandler.reportError(this, re);
319
- this._errHandler.recover(this, re);
320
- }
321
- else {
322
- throw re;
323
- }
324
- }
325
- finally {
326
- this.exitRule();
327
- }
328
- return _localctx;
329
- }
330
- // @RuleVersion(0)
331
- eqValue() {
332
- let _localctx = new EqValueContext(this._ctx, this.state);
333
- this.enterRule(_localctx, 10, MalloyTagParser.RULE_eqValue);
334
- try {
335
- this.state = 66;
336
- this._errHandler.sync(this);
337
- switch (this._input.LA(1)) {
338
- case MalloyTagParser.SQ_STRING:
339
- case MalloyTagParser.DQ_STRING:
340
- case MalloyTagParser.NUMERIC_LITERAL:
341
- case MalloyTagParser.BARE_STRING:
342
- this.enterOuterAlt(_localctx, 1);
343
- {
344
- this.state = 63;
345
- this.string();
346
- }
347
- break;
348
- case MalloyTagParser.AR_BEG:
349
- this.enterOuterAlt(_localctx, 2);
350
- {
351
- this.state = 64;
352
- this.arrayValue();
353
- }
354
- break;
355
- case MalloyTagParser.RF_BEG:
356
- this.enterOuterAlt(_localctx, 3);
357
- {
358
- this.state = 65;
359
- this.reference();
360
- }
361
- break;
362
- default:
363
- throw new NoViableAltException_1.NoViableAltException(this);
364
- }
365
- }
366
- catch (re) {
367
- if (re instanceof RecognitionException_1.RecognitionException) {
368
- _localctx.exception = re;
369
- this._errHandler.reportError(this, re);
370
- this._errHandler.recover(this, re);
371
- }
372
- else {
373
- throw re;
374
- }
375
- }
376
- finally {
377
- this.exitRule();
378
- }
379
- return _localctx;
380
- }
381
- // @RuleVersion(0)
382
- arrayElement() {
383
- let _localctx = new ArrayElementContext(this._ctx, this.state);
384
- this.enterRule(_localctx, 12, MalloyTagParser.RULE_arrayElement);
385
- let _la;
386
- try {
387
- this.state = 75;
388
- this._errHandler.sync(this);
389
- switch (this._input.LA(1)) {
390
- case MalloyTagParser.SQ_STRING:
391
- case MalloyTagParser.DQ_STRING:
392
- case MalloyTagParser.NUMERIC_LITERAL:
393
- case MalloyTagParser.BARE_STRING:
394
- this.enterOuterAlt(_localctx, 1);
395
- {
396
- this.state = 68;
397
- this.string();
398
- this.state = 70;
399
- this._errHandler.sync(this);
400
- _la = this._input.LA(1);
401
- if (_la === MalloyTagParser.PR_BEG) {
402
- {
403
- this.state = 69;
404
- this.properties();
405
- }
406
- }
407
- }
408
- break;
409
- case MalloyTagParser.PR_BEG:
410
- this.enterOuterAlt(_localctx, 2);
411
- {
412
- this.state = 72;
413
- this.properties();
414
- }
415
- break;
416
- case MalloyTagParser.AR_BEG:
417
- this.enterOuterAlt(_localctx, 3);
418
- {
419
- this.state = 73;
420
- this.arrayValue();
421
- }
422
- break;
423
- case MalloyTagParser.RF_BEG:
424
- this.enterOuterAlt(_localctx, 4);
425
- {
426
- this.state = 74;
427
- this.reference();
428
- }
429
- break;
430
- default:
431
- throw new NoViableAltException_1.NoViableAltException(this);
432
- }
433
- }
434
- catch (re) {
435
- if (re instanceof RecognitionException_1.RecognitionException) {
436
- _localctx.exception = re;
437
- this._errHandler.reportError(this, re);
438
- this._errHandler.recover(this, re);
439
- }
440
- else {
441
- throw re;
442
- }
443
- }
444
- finally {
445
- this.exitRule();
446
- }
447
- return _localctx;
448
- }
449
- // @RuleVersion(0)
450
- reference() {
451
- let _localctx = new ReferenceContext(this._ctx, this.state);
452
- this.enterRule(_localctx, 14, MalloyTagParser.RULE_reference);
453
- try {
454
- this.enterOuterAlt(_localctx, 1);
455
- {
456
- this.state = 77;
457
- this.match(MalloyTagParser.RF_BEG);
458
- this.state = 78;
459
- this.propName();
460
- this.state = 79;
461
- this.match(MalloyTagParser.RF_END);
462
- }
463
- }
464
- catch (re) {
465
- if (re instanceof RecognitionException_1.RecognitionException) {
466
- _localctx.exception = re;
467
- this._errHandler.reportError(this, re);
468
- this._errHandler.recover(this, re);
469
- }
470
- else {
471
- throw re;
472
- }
473
- }
474
- finally {
475
- this.exitRule();
476
- }
477
- return _localctx;
478
- }
479
- // @RuleVersion(0)
480
- arrayValue() {
481
- let _localctx = new ArrayValueContext(this._ctx, this.state);
482
- this.enterRule(_localctx, 16, MalloyTagParser.RULE_arrayValue);
483
- let _la;
484
- try {
485
- let _alt;
486
- this.state = 97;
487
- this._errHandler.sync(this);
488
- switch (this.interpreter.adaptivePredict(this._input, 11, this._ctx)) {
489
- case 1:
490
- this.enterOuterAlt(_localctx, 1);
491
- {
492
- this.state = 81;
493
- this.match(MalloyTagParser.AR_BEG);
494
- this.state = 82;
495
- this.arrayElement();
496
- this.state = 87;
497
- this._errHandler.sync(this);
498
- _alt = this.interpreter.adaptivePredict(this._input, 9, this._ctx);
499
- while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) {
500
- if (_alt === 1) {
501
- {
502
- {
503
- this.state = 83;
504
- this.match(MalloyTagParser.COMMA);
505
- this.state = 84;
506
- this.arrayElement();
507
- }
508
- }
509
- }
510
- this.state = 89;
511
- this._errHandler.sync(this);
512
- _alt = this.interpreter.adaptivePredict(this._input, 9, this._ctx);
513
- }
514
- this.state = 91;
515
- this._errHandler.sync(this);
516
- _la = this._input.LA(1);
517
- if (_la === MalloyTagParser.COMMA) {
518
- {
519
- this.state = 90;
520
- this.match(MalloyTagParser.COMMA);
521
- }
522
- }
523
- this.state = 93;
524
- this.match(MalloyTagParser.AR_END);
525
- }
526
- break;
527
- case 2:
528
- this.enterOuterAlt(_localctx, 2);
529
- {
530
- this.state = 95;
531
- this.match(MalloyTagParser.AR_BEG);
532
- this.state = 96;
533
- this.match(MalloyTagParser.AR_END);
534
- }
535
- break;
536
- }
537
- }
538
- catch (re) {
539
- if (re instanceof RecognitionException_1.RecognitionException) {
540
- _localctx.exception = re;
541
- this._errHandler.reportError(this, re);
542
- this._errHandler.recover(this, re);
543
- }
544
- else {
545
- throw re;
546
- }
547
- }
548
- finally {
549
- this.exitRule();
550
- }
551
- return _localctx;
552
- }
553
- // @RuleVersion(0)
554
- properties() {
555
- let _localctx = new PropertiesContext(this._ctx, this.state);
556
- this.enterRule(_localctx, 18, MalloyTagParser.RULE_properties);
557
- let _la;
558
- try {
559
- this.enterOuterAlt(_localctx, 1);
560
- {
561
- this.state = 99;
562
- this.match(MalloyTagParser.PR_BEG);
563
- this.state = 107;
564
- this._errHandler.sync(this);
565
- switch (this._input.LA(1)) {
566
- case MalloyTagParser.DOTTY:
567
- {
568
- this.state = 100;
569
- this.match(MalloyTagParser.DOTTY);
570
- }
571
- break;
572
- case MalloyTagParser.MINUS_DOTTY:
573
- case MalloyTagParser.MINUS:
574
- case MalloyTagParser.PR_END:
575
- case MalloyTagParser.BQ_STRING:
576
- case MalloyTagParser.BARE_STRING:
577
- {
578
- {
579
- this.state = 104;
580
- this._errHandler.sync(this);
581
- _la = this._input.LA(1);
582
- while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << MalloyTagParser.MINUS_DOTTY) | (1 << MalloyTagParser.MINUS) | (1 << MalloyTagParser.BQ_STRING) | (1 << MalloyTagParser.BARE_STRING))) !== 0)) {
583
- {
584
- {
585
- this.state = 101;
586
- this.tagSpec();
587
- }
588
- }
589
- this.state = 106;
590
- this._errHandler.sync(this);
591
- _la = this._input.LA(1);
592
- }
593
- }
594
- }
595
- break;
596
- default:
597
- throw new NoViableAltException_1.NoViableAltException(this);
598
- }
599
- this.state = 109;
600
- this.match(MalloyTagParser.PR_END);
601
- }
602
- }
603
- catch (re) {
604
- if (re instanceof RecognitionException_1.RecognitionException) {
605
- _localctx.exception = re;
606
- this._errHandler.reportError(this, re);
607
- this._errHandler.recover(this, re);
608
- }
609
- else {
610
- throw re;
611
- }
612
- }
613
- finally {
614
- this.exitRule();
615
- }
616
- return _localctx;
617
- }
618
- static get _ATN() {
619
- if (!MalloyTagParser.__ATN) {
620
- MalloyTagParser.__ATN = new ATNDeserializer_1.ATNDeserializer().deserialize(Utils.toCharArray(MalloyTagParser._serializedATN));
621
- }
622
- return MalloyTagParser.__ATN;
623
- }
624
- }
625
- exports.MalloyTagParser = MalloyTagParser;
626
- MalloyTagParser.MINUS_DOTTY = 1;
627
- MalloyTagParser.DOTTY = 2;
628
- MalloyTagParser.DOT = 3;
629
- MalloyTagParser.MINUS = 4;
630
- MalloyTagParser.EQ = 5;
631
- MalloyTagParser.RF_BEG = 6;
632
- MalloyTagParser.RF_END = 7;
633
- MalloyTagParser.PR_BEG = 8;
634
- MalloyTagParser.PR_END = 9;
635
- MalloyTagParser.AR_BEG = 10;
636
- MalloyTagParser.COMMA = 11;
637
- MalloyTagParser.AR_END = 12;
638
- MalloyTagParser.SQ_STRING = 13;
639
- MalloyTagParser.DQ_STRING = 14;
640
- MalloyTagParser.BQ_STRING = 15;
641
- MalloyTagParser.NUMERIC_LITERAL = 16;
642
- MalloyTagParser.BARE_STRING = 17;
643
- MalloyTagParser.COMMENT = 18;
644
- MalloyTagParser.WHITE_SPACE = 19;
645
- MalloyTagParser.UNEXPECTED_CHAR = 20;
646
- MalloyTagParser.RULE_tagLine = 0;
647
- MalloyTagParser.RULE_tagSpec = 1;
648
- MalloyTagParser.RULE_string = 2;
649
- MalloyTagParser.RULE_identifier = 3;
650
- MalloyTagParser.RULE_propName = 4;
651
- MalloyTagParser.RULE_eqValue = 5;
652
- MalloyTagParser.RULE_arrayElement = 6;
653
- MalloyTagParser.RULE_reference = 7;
654
- MalloyTagParser.RULE_arrayValue = 8;
655
- MalloyTagParser.RULE_properties = 9;
656
- // tslint:disable:no-trailing-whitespace
657
- MalloyTagParser.ruleNames = [
658
- "tagLine", "tagSpec", "string", "identifier", "propName", "eqValue", "arrayElement",
659
- "reference", "arrayValue", "properties",
660
- ];
661
- MalloyTagParser._LITERAL_NAMES = [
662
- undefined, "'-...'", "'...'", "'.'", "'-'", "'='", "'$('", "')'", "'{'",
663
- "'}'", "'['", "','", "']'",
664
- ];
665
- MalloyTagParser._SYMBOLIC_NAMES = [
666
- undefined, "MINUS_DOTTY", "DOTTY", "DOT", "MINUS", "EQ", "RF_BEG", "RF_END",
667
- "PR_BEG", "PR_END", "AR_BEG", "COMMA", "AR_END", "SQ_STRING", "DQ_STRING",
668
- "BQ_STRING", "NUMERIC_LITERAL", "BARE_STRING", "COMMENT", "WHITE_SPACE",
669
- "UNEXPECTED_CHAR",
670
- ];
671
- MalloyTagParser.VOCABULARY = new VocabularyImpl_1.VocabularyImpl(MalloyTagParser._LITERAL_NAMES, MalloyTagParser._SYMBOLIC_NAMES, []);
672
- MalloyTagParser._serializedATN = "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03\x16r\x04\x02" +
673
- "\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04\x07" +
674
- "\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x03\x02\x07\x02\x18\n\x02" +
675
- "\f\x02\x0E\x02\x1B\v\x02\x03\x02\x03\x02\x03\x03\x03\x03\x03\x03\x03\x03" +
676
- "\x05\x03#\n\x03\x03\x03\x03\x03\x03\x03\x05\x03(\n\x03\x03\x03\x03\x03" +
677
- "\x03\x03\x03\x03\x03\x03\x03\x03\x05\x030\n\x03\x03\x03\x03\x03\x05\x03" +
678
- "4\n\x03\x03\x04\x03\x04\x03\x05\x03\x05\x03\x06\x03\x06\x03\x06\x07\x06" +
679
- "=\n\x06\f\x06\x0E\x06@\v\x06\x03\x07\x03\x07\x03\x07\x05\x07E\n\x07\x03" +
680
- "\b\x03\b\x05\bI\n\b\x03\b\x03\b\x03\b\x05\bN\n\b\x03\t\x03\t\x03\t\x03" +
681
- "\t\x03\n\x03\n\x03\n\x03\n\x07\nX\n\n\f\n\x0E\n[\v\n\x03\n\x05\n^\n\n" +
682
- "\x03\n\x03\n\x03\n\x03\n\x05\nd\n\n\x03\v\x03\v\x03\v\x07\vi\n\v\f\v\x0E" +
683
- "\vl\v\v\x05\vn\n\v\x03\v\x03\v\x03\v\x02\x02\x02\f\x02\x02\x04\x02\x06" +
684
- "\x02\b\x02\n\x02\f\x02\x0E\x02\x10\x02\x12\x02\x14\x02\x02\x04\x04\x02" +
685
- "\x0F\x10\x12\x13\x04\x02\x11\x11\x13\x13\x02{\x02\x19\x03\x02\x02\x02" +
686
- "\x043\x03\x02\x02\x02\x065\x03\x02\x02\x02\b7\x03\x02\x02\x02\n9\x03\x02" +
687
- "\x02\x02\fD\x03\x02\x02\x02\x0EM\x03\x02\x02\x02\x10O\x03\x02\x02\x02" +
688
- "\x12c\x03\x02\x02\x02\x14e\x03\x02\x02\x02\x16\x18\x05\x04\x03\x02\x17" +
689
- "\x16\x03\x02\x02\x02\x18\x1B\x03\x02\x02\x02\x19\x17\x03\x02\x02\x02\x19" +
690
- "\x1A\x03\x02\x02\x02\x1A\x1C\x03\x02\x02\x02\x1B\x19\x03\x02\x02\x02\x1C" +
691
- "\x1D\x07\x02\x02\x03\x1D\x03\x03\x02\x02\x02\x1E\x1F\x05\n\x06\x02\x1F" +
692
- " \x07\x07\x02\x02 \"\x05\f\x07\x02!#\x05\x14\v\x02\"!\x03\x02\x02\x02" +
693
- "\"#\x03\x02\x02\x02#4\x03\x02\x02\x02$%\x05\n\x06\x02%\'\x07\x07\x02\x02" +
694
- "&(\x07\x04\x02\x02\'&\x03\x02\x02\x02\'(\x03\x02\x02\x02()\x03\x02\x02" +
695
- "\x02)*\x05\x14\v\x02*4\x03\x02\x02\x02+,\x05\n\x06\x02,-\x05\x14\v\x02" +
696
- "-4\x03\x02\x02\x02.0\x07\x06\x02\x02/.\x03\x02\x02\x02/0\x03\x02\x02\x02" +
697
- "01\x03\x02\x02\x0214\x05\n\x06\x0224\x07\x03\x02\x023\x1E\x03\x02\x02" +
698
- "\x023$\x03\x02\x02\x023+\x03\x02\x02\x023/\x03\x02\x02\x0232\x03\x02\x02" +
699
- "\x024\x05\x03\x02\x02\x0256\t\x02\x02\x026\x07\x03\x02\x02\x0278\t\x03" +
700
- "\x02\x028\t\x03\x02\x02\x029>\x05\b\x05\x02:;\x07\x05\x02\x02;=\x05\b" +
701
- "\x05\x02<:\x03\x02\x02\x02=@\x03\x02\x02\x02><\x03\x02\x02\x02>?\x03\x02" +
702
- "\x02\x02?\v\x03\x02\x02\x02@>\x03\x02\x02\x02AE\x05\x06\x04\x02BE\x05" +
703
- "\x12\n\x02CE\x05\x10\t\x02DA\x03\x02\x02\x02DB\x03\x02\x02\x02DC\x03\x02" +
704
- "\x02\x02E\r\x03\x02\x02\x02FH\x05\x06\x04\x02GI\x05\x14\v\x02HG\x03\x02" +
705
- "\x02\x02HI\x03\x02\x02\x02IN\x03\x02\x02\x02JN\x05\x14\v\x02KN\x05\x12" +
706
- "\n\x02LN\x05\x10\t\x02MF\x03\x02\x02\x02MJ\x03\x02\x02\x02MK\x03\x02\x02" +
707
- "\x02ML\x03\x02\x02\x02N\x0F\x03\x02\x02\x02OP\x07\b\x02\x02PQ\x05\n\x06" +
708
- "\x02QR\x07\t\x02\x02R\x11\x03\x02\x02\x02ST\x07\f\x02\x02TY\x05\x0E\b" +
709
- "\x02UV\x07\r\x02\x02VX\x05\x0E\b\x02WU\x03\x02\x02\x02X[\x03\x02\x02\x02" +
710
- "YW\x03\x02\x02\x02YZ\x03\x02\x02\x02Z]\x03\x02\x02\x02[Y\x03\x02\x02\x02" +
711
- "\\^\x07\r\x02\x02]\\\x03\x02\x02\x02]^\x03\x02\x02\x02^_\x03\x02\x02\x02" +
712
- "_`\x07\x0E\x02\x02`d\x03\x02\x02\x02ab\x07\f\x02\x02bd\x07\x0E\x02\x02" +
713
- "cS\x03\x02\x02\x02ca\x03\x02\x02\x02d\x13\x03\x02\x02\x02em\x07\n\x02" +
714
- "\x02fn\x07\x04\x02\x02gi\x05\x04\x03\x02hg\x03\x02\x02\x02il\x03\x02\x02" +
715
- "\x02jh\x03\x02\x02\x02jk\x03\x02\x02\x02kn\x03\x02\x02\x02lj\x03\x02\x02" +
716
- "\x02mf\x03\x02\x02\x02mj\x03\x02\x02\x02no\x03\x02\x02\x02op\x07\v\x02" +
717
- "\x02p\x15\x03\x02\x02\x02\x10\x19\"\'/3>DHMY]cjm";
718
- class TagLineContext extends ParserRuleContext_1.ParserRuleContext {
719
- EOF() { return this.getToken(MalloyTagParser.EOF, 0); }
720
- tagSpec(i) {
721
- if (i === undefined) {
722
- return this.getRuleContexts(TagSpecContext);
723
- }
724
- else {
725
- return this.getRuleContext(i, TagSpecContext);
726
- }
727
- }
728
- constructor(parent, invokingState) {
729
- super(parent, invokingState);
730
- }
731
- // @Override
732
- get ruleIndex() { return MalloyTagParser.RULE_tagLine; }
733
- // @Override
734
- accept(visitor) {
735
- if (visitor.visitTagLine) {
736
- return visitor.visitTagLine(this);
737
- }
738
- else {
739
- return visitor.visitChildren(this);
740
- }
741
- }
742
- }
743
- exports.TagLineContext = TagLineContext;
744
- class TagSpecContext extends ParserRuleContext_1.ParserRuleContext {
745
- constructor(parent, invokingState) {
746
- super(parent, invokingState);
747
- }
748
- // @Override
749
- get ruleIndex() { return MalloyTagParser.RULE_tagSpec; }
750
- copyFrom(ctx) {
751
- super.copyFrom(ctx);
752
- }
753
- }
754
- exports.TagSpecContext = TagSpecContext;
755
- class TagEqContext extends TagSpecContext {
756
- propName() {
757
- return this.getRuleContext(0, PropNameContext);
758
- }
759
- EQ() { return this.getToken(MalloyTagParser.EQ, 0); }
760
- eqValue() {
761
- return this.getRuleContext(0, EqValueContext);
762
- }
763
- properties() {
764
- return this.tryGetRuleContext(0, PropertiesContext);
765
- }
766
- constructor(ctx) {
767
- super(ctx.parent, ctx.invokingState);
768
- this.copyFrom(ctx);
769
- }
770
- // @Override
771
- accept(visitor) {
772
- if (visitor.visitTagEq) {
773
- return visitor.visitTagEq(this);
774
- }
775
- else {
776
- return visitor.visitChildren(this);
777
- }
778
- }
779
- }
780
- exports.TagEqContext = TagEqContext;
781
- class TagReplacePropertiesContext extends TagSpecContext {
782
- propName() {
783
- return this.getRuleContext(0, PropNameContext);
784
- }
785
- EQ() { return this.getToken(MalloyTagParser.EQ, 0); }
786
- properties() {
787
- return this.getRuleContext(0, PropertiesContext);
788
- }
789
- DOTTY() { return this.tryGetToken(MalloyTagParser.DOTTY, 0); }
790
- constructor(ctx) {
791
- super(ctx.parent, ctx.invokingState);
792
- this.copyFrom(ctx);
793
- }
794
- // @Override
795
- accept(visitor) {
796
- if (visitor.visitTagReplaceProperties) {
797
- return visitor.visitTagReplaceProperties(this);
798
- }
799
- else {
800
- return visitor.visitChildren(this);
801
- }
802
- }
803
- }
804
- exports.TagReplacePropertiesContext = TagReplacePropertiesContext;
805
- class TagUpdatePropertiesContext extends TagSpecContext {
806
- propName() {
807
- return this.getRuleContext(0, PropNameContext);
808
- }
809
- properties() {
810
- return this.getRuleContext(0, PropertiesContext);
811
- }
812
- constructor(ctx) {
813
- super(ctx.parent, ctx.invokingState);
814
- this.copyFrom(ctx);
815
- }
816
- // @Override
817
- accept(visitor) {
818
- if (visitor.visitTagUpdateProperties) {
819
- return visitor.visitTagUpdateProperties(this);
820
- }
821
- else {
822
- return visitor.visitChildren(this);
823
- }
824
- }
825
- }
826
- exports.TagUpdatePropertiesContext = TagUpdatePropertiesContext;
827
- class TagDefContext extends TagSpecContext {
828
- propName() {
829
- return this.getRuleContext(0, PropNameContext);
830
- }
831
- MINUS() { return this.tryGetToken(MalloyTagParser.MINUS, 0); }
832
- constructor(ctx) {
833
- super(ctx.parent, ctx.invokingState);
834
- this.copyFrom(ctx);
835
- }
836
- // @Override
837
- accept(visitor) {
838
- if (visitor.visitTagDef) {
839
- return visitor.visitTagDef(this);
840
- }
841
- else {
842
- return visitor.visitChildren(this);
843
- }
844
- }
845
- }
846
- exports.TagDefContext = TagDefContext;
847
- class TagEmptyContext extends TagSpecContext {
848
- MINUS_DOTTY() { return this.getToken(MalloyTagParser.MINUS_DOTTY, 0); }
849
- constructor(ctx) {
850
- super(ctx.parent, ctx.invokingState);
851
- this.copyFrom(ctx);
852
- }
853
- // @Override
854
- accept(visitor) {
855
- if (visitor.visitTagEmpty) {
856
- return visitor.visitTagEmpty(this);
857
- }
858
- else {
859
- return visitor.visitChildren(this);
860
- }
861
- }
862
- }
863
- exports.TagEmptyContext = TagEmptyContext;
864
- class StringContext extends ParserRuleContext_1.ParserRuleContext {
865
- SQ_STRING() { return this.tryGetToken(MalloyTagParser.SQ_STRING, 0); }
866
- DQ_STRING() { return this.tryGetToken(MalloyTagParser.DQ_STRING, 0); }
867
- BARE_STRING() { return this.tryGetToken(MalloyTagParser.BARE_STRING, 0); }
868
- NUMERIC_LITERAL() { return this.tryGetToken(MalloyTagParser.NUMERIC_LITERAL, 0); }
869
- constructor(parent, invokingState) {
870
- super(parent, invokingState);
871
- }
872
- // @Override
873
- get ruleIndex() { return MalloyTagParser.RULE_string; }
874
- // @Override
875
- accept(visitor) {
876
- if (visitor.visitString) {
877
- return visitor.visitString(this);
878
- }
879
- else {
880
- return visitor.visitChildren(this);
881
- }
882
- }
883
- }
884
- exports.StringContext = StringContext;
885
- class IdentifierContext extends ParserRuleContext_1.ParserRuleContext {
886
- BQ_STRING() { return this.tryGetToken(MalloyTagParser.BQ_STRING, 0); }
887
- BARE_STRING() { return this.tryGetToken(MalloyTagParser.BARE_STRING, 0); }
888
- constructor(parent, invokingState) {
889
- super(parent, invokingState);
890
- }
891
- // @Override
892
- get ruleIndex() { return MalloyTagParser.RULE_identifier; }
893
- // @Override
894
- accept(visitor) {
895
- if (visitor.visitIdentifier) {
896
- return visitor.visitIdentifier(this);
897
- }
898
- else {
899
- return visitor.visitChildren(this);
900
- }
901
- }
902
- }
903
- exports.IdentifierContext = IdentifierContext;
904
- class PropNameContext extends ParserRuleContext_1.ParserRuleContext {
905
- identifier(i) {
906
- if (i === undefined) {
907
- return this.getRuleContexts(IdentifierContext);
908
- }
909
- else {
910
- return this.getRuleContext(i, IdentifierContext);
911
- }
912
- }
913
- DOT(i) {
914
- if (i === undefined) {
915
- return this.getTokens(MalloyTagParser.DOT);
916
- }
917
- else {
918
- return this.getToken(MalloyTagParser.DOT, i);
919
- }
920
- }
921
- constructor(parent, invokingState) {
922
- super(parent, invokingState);
923
- }
924
- // @Override
925
- get ruleIndex() { return MalloyTagParser.RULE_propName; }
926
- // @Override
927
- accept(visitor) {
928
- if (visitor.visitPropName) {
929
- return visitor.visitPropName(this);
930
- }
931
- else {
932
- return visitor.visitChildren(this);
933
- }
934
- }
935
- }
936
- exports.PropNameContext = PropNameContext;
937
- class EqValueContext extends ParserRuleContext_1.ParserRuleContext {
938
- string() {
939
- return this.tryGetRuleContext(0, StringContext);
940
- }
941
- arrayValue() {
942
- return this.tryGetRuleContext(0, ArrayValueContext);
943
- }
944
- reference() {
945
- return this.tryGetRuleContext(0, ReferenceContext);
946
- }
947
- constructor(parent, invokingState) {
948
- super(parent, invokingState);
949
- }
950
- // @Override
951
- get ruleIndex() { return MalloyTagParser.RULE_eqValue; }
952
- // @Override
953
- accept(visitor) {
954
- if (visitor.visitEqValue) {
955
- return visitor.visitEqValue(this);
956
- }
957
- else {
958
- return visitor.visitChildren(this);
959
- }
960
- }
961
- }
962
- exports.EqValueContext = EqValueContext;
963
- class ArrayElementContext extends ParserRuleContext_1.ParserRuleContext {
964
- string() {
965
- return this.tryGetRuleContext(0, StringContext);
966
- }
967
- properties() {
968
- return this.tryGetRuleContext(0, PropertiesContext);
969
- }
970
- arrayValue() {
971
- return this.tryGetRuleContext(0, ArrayValueContext);
972
- }
973
- reference() {
974
- return this.tryGetRuleContext(0, ReferenceContext);
975
- }
976
- constructor(parent, invokingState) {
977
- super(parent, invokingState);
978
- }
979
- // @Override
980
- get ruleIndex() { return MalloyTagParser.RULE_arrayElement; }
981
- // @Override
982
- accept(visitor) {
983
- if (visitor.visitArrayElement) {
984
- return visitor.visitArrayElement(this);
985
- }
986
- else {
987
- return visitor.visitChildren(this);
988
- }
989
- }
990
- }
991
- exports.ArrayElementContext = ArrayElementContext;
992
- class ReferenceContext extends ParserRuleContext_1.ParserRuleContext {
993
- RF_BEG() { return this.getToken(MalloyTagParser.RF_BEG, 0); }
994
- propName() {
995
- return this.getRuleContext(0, PropNameContext);
996
- }
997
- RF_END() { return this.getToken(MalloyTagParser.RF_END, 0); }
998
- constructor(parent, invokingState) {
999
- super(parent, invokingState);
1000
- }
1001
- // @Override
1002
- get ruleIndex() { return MalloyTagParser.RULE_reference; }
1003
- // @Override
1004
- accept(visitor) {
1005
- if (visitor.visitReference) {
1006
- return visitor.visitReference(this);
1007
- }
1008
- else {
1009
- return visitor.visitChildren(this);
1010
- }
1011
- }
1012
- }
1013
- exports.ReferenceContext = ReferenceContext;
1014
- class ArrayValueContext extends ParserRuleContext_1.ParserRuleContext {
1015
- AR_BEG() { return this.getToken(MalloyTagParser.AR_BEG, 0); }
1016
- arrayElement(i) {
1017
- if (i === undefined) {
1018
- return this.getRuleContexts(ArrayElementContext);
1019
- }
1020
- else {
1021
- return this.getRuleContext(i, ArrayElementContext);
1022
- }
1023
- }
1024
- AR_END() { return this.getToken(MalloyTagParser.AR_END, 0); }
1025
- COMMA(i) {
1026
- if (i === undefined) {
1027
- return this.getTokens(MalloyTagParser.COMMA);
1028
- }
1029
- else {
1030
- return this.getToken(MalloyTagParser.COMMA, i);
1031
- }
1032
- }
1033
- constructor(parent, invokingState) {
1034
- super(parent, invokingState);
1035
- }
1036
- // @Override
1037
- get ruleIndex() { return MalloyTagParser.RULE_arrayValue; }
1038
- // @Override
1039
- accept(visitor) {
1040
- if (visitor.visitArrayValue) {
1041
- return visitor.visitArrayValue(this);
1042
- }
1043
- else {
1044
- return visitor.visitChildren(this);
1045
- }
1046
- }
1047
- }
1048
- exports.ArrayValueContext = ArrayValueContext;
1049
- class PropertiesContext extends ParserRuleContext_1.ParserRuleContext {
1050
- PR_BEG() { return this.getToken(MalloyTagParser.PR_BEG, 0); }
1051
- PR_END() { return this.getToken(MalloyTagParser.PR_END, 0); }
1052
- DOTTY() { return this.tryGetToken(MalloyTagParser.DOTTY, 0); }
1053
- tagSpec(i) {
1054
- if (i === undefined) {
1055
- return this.getRuleContexts(TagSpecContext);
1056
- }
1057
- else {
1058
- return this.getRuleContext(i, TagSpecContext);
1059
- }
1060
- }
1061
- constructor(parent, invokingState) {
1062
- super(parent, invokingState);
1063
- }
1064
- // @Override
1065
- get ruleIndex() { return MalloyTagParser.RULE_properties; }
1066
- // @Override
1067
- accept(visitor) {
1068
- if (visitor.visitProperties) {
1069
- return visitor.visitProperties(this);
1070
- }
1071
- else {
1072
- return visitor.visitChildren(this);
1073
- }
1074
- }
1075
- }
1076
- exports.PropertiesContext = PropertiesContext;
1077
- //# sourceMappingURL=MalloyTagParser.js.map