tagset-parser 0.0.0

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.
@@ -0,0 +1,837 @@
1
+ import * as antlr from "antlr4ng";
2
+ export class TagSetParser extends antlr.Parser {
3
+ static SET = 1;
4
+ static ITEM = 2;
5
+ static AMP = 3;
6
+ static COMMA = 4;
7
+ static COLON = 5;
8
+ static QUOTED_STRING = 6;
9
+ static WORD = 7;
10
+ static NL = 8;
11
+ static WS = 9;
12
+ static RULE_program = 0;
13
+ static RULE_line = 1;
14
+ static RULE_setDecl = 2;
15
+ static RULE_labelPart = 3;
16
+ static RULE_itemDecl = 4;
17
+ static RULE_sugarDecl = 5;
18
+ static RULE_pattern = 6;
19
+ static RULE_valueList = 7;
20
+ static RULE_valueItem = 8;
21
+ static literalNames = [
22
+ null, "'set'", "'item'", "'&'", "','", "':'"
23
+ ];
24
+ static symbolicNames = [
25
+ null, "SET", "ITEM", "AMP", "COMMA", "COLON", "QUOTED_STRING", "WORD",
26
+ "NL", "WS"
27
+ ];
28
+ static ruleNames = [
29
+ "program", "line", "setDecl", "labelPart", "itemDecl", "sugarDecl",
30
+ "pattern", "valueList", "valueItem",
31
+ ];
32
+ get grammarFileName() { return "TagSet.g4"; }
33
+ get literalNames() { return TagSetParser.literalNames; }
34
+ get symbolicNames() { return TagSetParser.symbolicNames; }
35
+ get ruleNames() { return TagSetParser.ruleNames; }
36
+ get serializedATN() { return TagSetParser._serializedATN; }
37
+ createFailedPredicateException(predicate, message) {
38
+ return new antlr.FailedPredicateException(this, predicate, message);
39
+ }
40
+ constructor(input) {
41
+ super(input);
42
+ this.interpreter = new antlr.ParserATNSimulator(this, TagSetParser._ATN, TagSetParser.decisionsToDFA, new antlr.PredictionContextCache());
43
+ }
44
+ program() {
45
+ let localContext = new ProgramContext(this.context, this.state);
46
+ this.enterRule(localContext, 0, TagSetParser.RULE_program);
47
+ let _la;
48
+ try {
49
+ this.enterOuterAlt(localContext, 1);
50
+ {
51
+ this.state = 22;
52
+ this.errorHandler.sync(this);
53
+ _la = this.tokenStream.LA(1);
54
+ while ((((_la) & ~0x1F) === 0 && ((1 << _la) & 390) !== 0)) {
55
+ {
56
+ this.state = 20;
57
+ this.errorHandler.sync(this);
58
+ switch (this.tokenStream.LA(1)) {
59
+ case TagSetParser.NL:
60
+ {
61
+ this.state = 18;
62
+ this.match(TagSetParser.NL);
63
+ }
64
+ break;
65
+ case TagSetParser.SET:
66
+ case TagSetParser.ITEM:
67
+ case TagSetParser.WORD:
68
+ {
69
+ this.state = 19;
70
+ this.line();
71
+ }
72
+ break;
73
+ default:
74
+ throw new antlr.NoViableAltException(this);
75
+ }
76
+ }
77
+ this.state = 24;
78
+ this.errorHandler.sync(this);
79
+ _la = this.tokenStream.LA(1);
80
+ }
81
+ this.state = 25;
82
+ this.match(TagSetParser.EOF);
83
+ }
84
+ }
85
+ catch (re) {
86
+ if (re instanceof antlr.RecognitionException) {
87
+ this.errorHandler.reportError(this, re);
88
+ this.errorHandler.recover(this, re);
89
+ }
90
+ else {
91
+ throw re;
92
+ }
93
+ }
94
+ finally {
95
+ this.exitRule();
96
+ }
97
+ return localContext;
98
+ }
99
+ line() {
100
+ let localContext = new LineContext(this.context, this.state);
101
+ this.enterRule(localContext, 2, TagSetParser.RULE_line);
102
+ try {
103
+ this.enterOuterAlt(localContext, 1);
104
+ {
105
+ this.state = 30;
106
+ this.errorHandler.sync(this);
107
+ switch (this.tokenStream.LA(1)) {
108
+ case TagSetParser.SET:
109
+ {
110
+ this.state = 27;
111
+ this.setDecl();
112
+ }
113
+ break;
114
+ case TagSetParser.ITEM:
115
+ {
116
+ this.state = 28;
117
+ this.itemDecl();
118
+ }
119
+ break;
120
+ case TagSetParser.WORD:
121
+ {
122
+ this.state = 29;
123
+ this.sugarDecl();
124
+ }
125
+ break;
126
+ default:
127
+ throw new antlr.NoViableAltException(this);
128
+ }
129
+ this.state = 33;
130
+ this.errorHandler.sync(this);
131
+ switch (this.interpreter.adaptivePredict(this.tokenStream, 3, this.context)) {
132
+ case 1:
133
+ {
134
+ this.state = 32;
135
+ this.match(TagSetParser.NL);
136
+ }
137
+ break;
138
+ }
139
+ }
140
+ }
141
+ catch (re) {
142
+ if (re instanceof antlr.RecognitionException) {
143
+ this.errorHandler.reportError(this, re);
144
+ this.errorHandler.recover(this, re);
145
+ }
146
+ else {
147
+ throw re;
148
+ }
149
+ }
150
+ finally {
151
+ this.exitRule();
152
+ }
153
+ return localContext;
154
+ }
155
+ setDecl() {
156
+ let localContext = new SetDeclContext(this.context, this.state);
157
+ this.enterRule(localContext, 4, TagSetParser.RULE_setDecl);
158
+ try {
159
+ let alternative;
160
+ this.enterOuterAlt(localContext, 1);
161
+ {
162
+ this.state = 35;
163
+ this.match(TagSetParser.SET);
164
+ this.state = 36;
165
+ this.match(TagSetParser.WORD);
166
+ this.state = 38;
167
+ this.errorHandler.sync(this);
168
+ alternative = 1;
169
+ do {
170
+ switch (alternative) {
171
+ case 1:
172
+ {
173
+ {
174
+ this.state = 37;
175
+ this.labelPart();
176
+ }
177
+ }
178
+ break;
179
+ default:
180
+ throw new antlr.NoViableAltException(this);
181
+ }
182
+ this.state = 40;
183
+ this.errorHandler.sync(this);
184
+ alternative = this.interpreter.adaptivePredict(this.tokenStream, 4, this.context);
185
+ } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER);
186
+ }
187
+ }
188
+ catch (re) {
189
+ if (re instanceof antlr.RecognitionException) {
190
+ this.errorHandler.reportError(this, re);
191
+ this.errorHandler.recover(this, re);
192
+ }
193
+ else {
194
+ throw re;
195
+ }
196
+ }
197
+ finally {
198
+ this.exitRule();
199
+ }
200
+ return localContext;
201
+ }
202
+ labelPart() {
203
+ let localContext = new LabelPartContext(this.context, this.state);
204
+ this.enterRule(localContext, 6, TagSetParser.RULE_labelPart);
205
+ let _la;
206
+ try {
207
+ this.enterOuterAlt(localContext, 1);
208
+ {
209
+ this.state = 42;
210
+ _la = this.tokenStream.LA(1);
211
+ if (!(_la === 6 || _la === 7)) {
212
+ this.errorHandler.recoverInline(this);
213
+ }
214
+ else {
215
+ this.errorHandler.reportMatch(this);
216
+ this.consume();
217
+ }
218
+ }
219
+ }
220
+ catch (re) {
221
+ if (re instanceof antlr.RecognitionException) {
222
+ this.errorHandler.reportError(this, re);
223
+ this.errorHandler.recover(this, re);
224
+ }
225
+ else {
226
+ throw re;
227
+ }
228
+ }
229
+ finally {
230
+ this.exitRule();
231
+ }
232
+ return localContext;
233
+ }
234
+ itemDecl() {
235
+ let localContext = new ItemDeclContext(this.context, this.state);
236
+ this.enterRule(localContext, 8, TagSetParser.RULE_itemDecl);
237
+ try {
238
+ this.enterOuterAlt(localContext, 1);
239
+ {
240
+ this.state = 44;
241
+ this.match(TagSetParser.ITEM);
242
+ this.state = 45;
243
+ this.pattern();
244
+ this.state = 46;
245
+ this.valueList();
246
+ }
247
+ }
248
+ catch (re) {
249
+ if (re instanceof antlr.RecognitionException) {
250
+ this.errorHandler.reportError(this, re);
251
+ this.errorHandler.recover(this, re);
252
+ }
253
+ else {
254
+ throw re;
255
+ }
256
+ }
257
+ finally {
258
+ this.exitRule();
259
+ }
260
+ return localContext;
261
+ }
262
+ sugarDecl() {
263
+ let localContext = new SugarDeclContext(this.context, this.state);
264
+ this.enterRule(localContext, 10, TagSetParser.RULE_sugarDecl);
265
+ let _la;
266
+ try {
267
+ this.enterOuterAlt(localContext, 1);
268
+ {
269
+ this.state = 48;
270
+ this.match(TagSetParser.WORD);
271
+ this.state = 53;
272
+ this.errorHandler.sync(this);
273
+ _la = this.tokenStream.LA(1);
274
+ while (_la === 4) {
275
+ {
276
+ {
277
+ this.state = 49;
278
+ this.match(TagSetParser.COMMA);
279
+ this.state = 50;
280
+ this.match(TagSetParser.WORD);
281
+ }
282
+ }
283
+ this.state = 55;
284
+ this.errorHandler.sync(this);
285
+ _la = this.tokenStream.LA(1);
286
+ }
287
+ this.state = 56;
288
+ this.match(TagSetParser.COLON);
289
+ this.state = 57;
290
+ this.valueList();
291
+ }
292
+ }
293
+ catch (re) {
294
+ if (re instanceof antlr.RecognitionException) {
295
+ this.errorHandler.reportError(this, re);
296
+ this.errorHandler.recover(this, re);
297
+ }
298
+ else {
299
+ throw re;
300
+ }
301
+ }
302
+ finally {
303
+ this.exitRule();
304
+ }
305
+ return localContext;
306
+ }
307
+ pattern() {
308
+ let localContext = new PatternContext(this.context, this.state);
309
+ this.enterRule(localContext, 12, TagSetParser.RULE_pattern);
310
+ let _la;
311
+ try {
312
+ this.enterOuterAlt(localContext, 1);
313
+ {
314
+ this.state = 59;
315
+ this.match(TagSetParser.WORD);
316
+ this.state = 64;
317
+ this.errorHandler.sync(this);
318
+ _la = this.tokenStream.LA(1);
319
+ while (_la === 3) {
320
+ {
321
+ {
322
+ this.state = 60;
323
+ this.match(TagSetParser.AMP);
324
+ this.state = 61;
325
+ this.match(TagSetParser.WORD);
326
+ }
327
+ }
328
+ this.state = 66;
329
+ this.errorHandler.sync(this);
330
+ _la = this.tokenStream.LA(1);
331
+ }
332
+ }
333
+ }
334
+ catch (re) {
335
+ if (re instanceof antlr.RecognitionException) {
336
+ this.errorHandler.reportError(this, re);
337
+ this.errorHandler.recover(this, re);
338
+ }
339
+ else {
340
+ throw re;
341
+ }
342
+ }
343
+ finally {
344
+ this.exitRule();
345
+ }
346
+ return localContext;
347
+ }
348
+ valueList() {
349
+ let localContext = new ValueListContext(this.context, this.state);
350
+ this.enterRule(localContext, 14, TagSetParser.RULE_valueList);
351
+ let _la;
352
+ try {
353
+ this.enterOuterAlt(localContext, 1);
354
+ {
355
+ this.state = 67;
356
+ this.valueItem();
357
+ this.state = 72;
358
+ this.errorHandler.sync(this);
359
+ _la = this.tokenStream.LA(1);
360
+ while (_la === 4) {
361
+ {
362
+ {
363
+ this.state = 68;
364
+ this.match(TagSetParser.COMMA);
365
+ this.state = 69;
366
+ this.valueItem();
367
+ }
368
+ }
369
+ this.state = 74;
370
+ this.errorHandler.sync(this);
371
+ _la = this.tokenStream.LA(1);
372
+ }
373
+ }
374
+ }
375
+ catch (re) {
376
+ if (re instanceof antlr.RecognitionException) {
377
+ this.errorHandler.reportError(this, re);
378
+ this.errorHandler.recover(this, re);
379
+ }
380
+ else {
381
+ throw re;
382
+ }
383
+ }
384
+ finally {
385
+ this.exitRule();
386
+ }
387
+ return localContext;
388
+ }
389
+ valueItem() {
390
+ let localContext = new ValueItemContext(this.context, this.state);
391
+ this.enterRule(localContext, 16, TagSetParser.RULE_valueItem);
392
+ let _la;
393
+ try {
394
+ let alternative;
395
+ this.enterOuterAlt(localContext, 1);
396
+ {
397
+ this.state = 76;
398
+ this.errorHandler.sync(this);
399
+ alternative = 1;
400
+ do {
401
+ switch (alternative) {
402
+ case 1:
403
+ {
404
+ {
405
+ this.state = 75;
406
+ _la = this.tokenStream.LA(1);
407
+ if (!(_la === 6 || _la === 7)) {
408
+ this.errorHandler.recoverInline(this);
409
+ }
410
+ else {
411
+ this.errorHandler.reportMatch(this);
412
+ this.consume();
413
+ }
414
+ }
415
+ }
416
+ break;
417
+ default:
418
+ throw new antlr.NoViableAltException(this);
419
+ }
420
+ this.state = 78;
421
+ this.errorHandler.sync(this);
422
+ alternative = this.interpreter.adaptivePredict(this.tokenStream, 8, this.context);
423
+ } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER);
424
+ }
425
+ }
426
+ catch (re) {
427
+ if (re instanceof antlr.RecognitionException) {
428
+ this.errorHandler.reportError(this, re);
429
+ this.errorHandler.recover(this, re);
430
+ }
431
+ else {
432
+ throw re;
433
+ }
434
+ }
435
+ finally {
436
+ this.exitRule();
437
+ }
438
+ return localContext;
439
+ }
440
+ static _serializedATN = [
441
+ 4, 1, 9, 81, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6,
442
+ 2, 7, 7, 7, 2, 8, 7, 8, 1, 0, 1, 0, 5, 0, 21, 8, 0, 10, 0, 12, 0, 24, 9, 0, 1, 0, 1, 0, 1, 1,
443
+ 1, 1, 1, 1, 3, 1, 31, 8, 1, 1, 1, 3, 1, 34, 8, 1, 1, 2, 1, 2, 1, 2, 4, 2, 39, 8, 2, 11, 2, 12,
444
+ 2, 40, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 5, 5, 52, 8, 5, 10, 5, 12, 5, 55,
445
+ 9, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 5, 6, 63, 8, 6, 10, 6, 12, 6, 66, 9, 6, 1, 7, 1, 7,
446
+ 1, 7, 5, 7, 71, 8, 7, 10, 7, 12, 7, 74, 9, 7, 1, 8, 4, 8, 77, 8, 8, 11, 8, 12, 8, 78, 1, 8,
447
+ 0, 0, 9, 0, 2, 4, 6, 8, 10, 12, 14, 16, 0, 1, 1, 0, 6, 7, 81, 0, 22, 1, 0, 0, 0, 2, 30, 1, 0,
448
+ 0, 0, 4, 35, 1, 0, 0, 0, 6, 42, 1, 0, 0, 0, 8, 44, 1, 0, 0, 0, 10, 48, 1, 0, 0, 0, 12, 59, 1,
449
+ 0, 0, 0, 14, 67, 1, 0, 0, 0, 16, 76, 1, 0, 0, 0, 18, 21, 5, 8, 0, 0, 19, 21, 3, 2, 1, 0, 20,
450
+ 18, 1, 0, 0, 0, 20, 19, 1, 0, 0, 0, 21, 24, 1, 0, 0, 0, 22, 20, 1, 0, 0, 0, 22, 23, 1, 0, 0,
451
+ 0, 23, 25, 1, 0, 0, 0, 24, 22, 1, 0, 0, 0, 25, 26, 5, 0, 0, 1, 26, 1, 1, 0, 0, 0, 27, 31, 3,
452
+ 4, 2, 0, 28, 31, 3, 8, 4, 0, 29, 31, 3, 10, 5, 0, 30, 27, 1, 0, 0, 0, 30, 28, 1, 0, 0, 0, 30,
453
+ 29, 1, 0, 0, 0, 31, 33, 1, 0, 0, 0, 32, 34, 5, 8, 0, 0, 33, 32, 1, 0, 0, 0, 33, 34, 1, 0, 0,
454
+ 0, 34, 3, 1, 0, 0, 0, 35, 36, 5, 1, 0, 0, 36, 38, 5, 7, 0, 0, 37, 39, 3, 6, 3, 0, 38, 37, 1,
455
+ 0, 0, 0, 39, 40, 1, 0, 0, 0, 40, 38, 1, 0, 0, 0, 40, 41, 1, 0, 0, 0, 41, 5, 1, 0, 0, 0, 42,
456
+ 43, 7, 0, 0, 0, 43, 7, 1, 0, 0, 0, 44, 45, 5, 2, 0, 0, 45, 46, 3, 12, 6, 0, 46, 47, 3, 14,
457
+ 7, 0, 47, 9, 1, 0, 0, 0, 48, 53, 5, 7, 0, 0, 49, 50, 5, 4, 0, 0, 50, 52, 5, 7, 0, 0, 51, 49,
458
+ 1, 0, 0, 0, 52, 55, 1, 0, 0, 0, 53, 51, 1, 0, 0, 0, 53, 54, 1, 0, 0, 0, 54, 56, 1, 0, 0, 0,
459
+ 55, 53, 1, 0, 0, 0, 56, 57, 5, 5, 0, 0, 57, 58, 3, 14, 7, 0, 58, 11, 1, 0, 0, 0, 59, 64, 5,
460
+ 7, 0, 0, 60, 61, 5, 3, 0, 0, 61, 63, 5, 7, 0, 0, 62, 60, 1, 0, 0, 0, 63, 66, 1, 0, 0, 0, 64,
461
+ 62, 1, 0, 0, 0, 64, 65, 1, 0, 0, 0, 65, 13, 1, 0, 0, 0, 66, 64, 1, 0, 0, 0, 67, 72, 3, 16,
462
+ 8, 0, 68, 69, 5, 4, 0, 0, 69, 71, 3, 16, 8, 0, 70, 68, 1, 0, 0, 0, 71, 74, 1, 0, 0, 0, 72,
463
+ 70, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 15, 1, 0, 0, 0, 74, 72, 1, 0, 0, 0, 75, 77, 7, 0, 0,
464
+ 0, 76, 75, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 76, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 79, 17,
465
+ 1, 0, 0, 0, 9, 20, 22, 30, 33, 40, 53, 64, 72, 78
466
+ ];
467
+ static __ATN;
468
+ static get _ATN() {
469
+ if (!TagSetParser.__ATN) {
470
+ TagSetParser.__ATN = new antlr.ATNDeserializer().deserialize(TagSetParser._serializedATN);
471
+ }
472
+ return TagSetParser.__ATN;
473
+ }
474
+ static vocabulary = new antlr.Vocabulary(TagSetParser.literalNames, TagSetParser.symbolicNames, []);
475
+ get vocabulary() {
476
+ return TagSetParser.vocabulary;
477
+ }
478
+ static decisionsToDFA = TagSetParser._ATN.decisionToState.map((ds, index) => new antlr.DFA(ds, index));
479
+ }
480
+ export class ProgramContext extends antlr.ParserRuleContext {
481
+ constructor(parent, invokingState) {
482
+ super(parent, invokingState);
483
+ }
484
+ EOF() {
485
+ return this.getToken(TagSetParser.EOF, 0);
486
+ }
487
+ NL(i) {
488
+ if (i === undefined) {
489
+ return this.getTokens(TagSetParser.NL);
490
+ }
491
+ else {
492
+ return this.getToken(TagSetParser.NL, i);
493
+ }
494
+ }
495
+ line(i) {
496
+ if (i === undefined) {
497
+ return this.getRuleContexts(LineContext);
498
+ }
499
+ return this.getRuleContext(i, LineContext);
500
+ }
501
+ get ruleIndex() {
502
+ return TagSetParser.RULE_program;
503
+ }
504
+ enterRule(listener) {
505
+ if (listener.enterProgram) {
506
+ listener.enterProgram(this);
507
+ }
508
+ }
509
+ exitRule(listener) {
510
+ if (listener.exitProgram) {
511
+ listener.exitProgram(this);
512
+ }
513
+ }
514
+ accept(visitor) {
515
+ if (visitor.visitProgram) {
516
+ return visitor.visitProgram(this);
517
+ }
518
+ else {
519
+ return visitor.visitChildren(this);
520
+ }
521
+ }
522
+ }
523
+ export class LineContext extends antlr.ParserRuleContext {
524
+ constructor(parent, invokingState) {
525
+ super(parent, invokingState);
526
+ }
527
+ setDecl() {
528
+ return this.getRuleContext(0, SetDeclContext);
529
+ }
530
+ itemDecl() {
531
+ return this.getRuleContext(0, ItemDeclContext);
532
+ }
533
+ sugarDecl() {
534
+ return this.getRuleContext(0, SugarDeclContext);
535
+ }
536
+ NL() {
537
+ return this.getToken(TagSetParser.NL, 0);
538
+ }
539
+ get ruleIndex() {
540
+ return TagSetParser.RULE_line;
541
+ }
542
+ enterRule(listener) {
543
+ if (listener.enterLine) {
544
+ listener.enterLine(this);
545
+ }
546
+ }
547
+ exitRule(listener) {
548
+ if (listener.exitLine) {
549
+ listener.exitLine(this);
550
+ }
551
+ }
552
+ accept(visitor) {
553
+ if (visitor.visitLine) {
554
+ return visitor.visitLine(this);
555
+ }
556
+ else {
557
+ return visitor.visitChildren(this);
558
+ }
559
+ }
560
+ }
561
+ export class SetDeclContext extends antlr.ParserRuleContext {
562
+ constructor(parent, invokingState) {
563
+ super(parent, invokingState);
564
+ }
565
+ SET() {
566
+ return this.getToken(TagSetParser.SET, 0);
567
+ }
568
+ WORD() {
569
+ return this.getToken(TagSetParser.WORD, 0);
570
+ }
571
+ labelPart(i) {
572
+ if (i === undefined) {
573
+ return this.getRuleContexts(LabelPartContext);
574
+ }
575
+ return this.getRuleContext(i, LabelPartContext);
576
+ }
577
+ get ruleIndex() {
578
+ return TagSetParser.RULE_setDecl;
579
+ }
580
+ enterRule(listener) {
581
+ if (listener.enterSetDecl) {
582
+ listener.enterSetDecl(this);
583
+ }
584
+ }
585
+ exitRule(listener) {
586
+ if (listener.exitSetDecl) {
587
+ listener.exitSetDecl(this);
588
+ }
589
+ }
590
+ accept(visitor) {
591
+ if (visitor.visitSetDecl) {
592
+ return visitor.visitSetDecl(this);
593
+ }
594
+ else {
595
+ return visitor.visitChildren(this);
596
+ }
597
+ }
598
+ }
599
+ export class LabelPartContext extends antlr.ParserRuleContext {
600
+ constructor(parent, invokingState) {
601
+ super(parent, invokingState);
602
+ }
603
+ WORD() {
604
+ return this.getToken(TagSetParser.WORD, 0);
605
+ }
606
+ QUOTED_STRING() {
607
+ return this.getToken(TagSetParser.QUOTED_STRING, 0);
608
+ }
609
+ get ruleIndex() {
610
+ return TagSetParser.RULE_labelPart;
611
+ }
612
+ enterRule(listener) {
613
+ if (listener.enterLabelPart) {
614
+ listener.enterLabelPart(this);
615
+ }
616
+ }
617
+ exitRule(listener) {
618
+ if (listener.exitLabelPart) {
619
+ listener.exitLabelPart(this);
620
+ }
621
+ }
622
+ accept(visitor) {
623
+ if (visitor.visitLabelPart) {
624
+ return visitor.visitLabelPart(this);
625
+ }
626
+ else {
627
+ return visitor.visitChildren(this);
628
+ }
629
+ }
630
+ }
631
+ export class ItemDeclContext extends antlr.ParserRuleContext {
632
+ constructor(parent, invokingState) {
633
+ super(parent, invokingState);
634
+ }
635
+ ITEM() {
636
+ return this.getToken(TagSetParser.ITEM, 0);
637
+ }
638
+ pattern() {
639
+ return this.getRuleContext(0, PatternContext);
640
+ }
641
+ valueList() {
642
+ return this.getRuleContext(0, ValueListContext);
643
+ }
644
+ get ruleIndex() {
645
+ return TagSetParser.RULE_itemDecl;
646
+ }
647
+ enterRule(listener) {
648
+ if (listener.enterItemDecl) {
649
+ listener.enterItemDecl(this);
650
+ }
651
+ }
652
+ exitRule(listener) {
653
+ if (listener.exitItemDecl) {
654
+ listener.exitItemDecl(this);
655
+ }
656
+ }
657
+ accept(visitor) {
658
+ if (visitor.visitItemDecl) {
659
+ return visitor.visitItemDecl(this);
660
+ }
661
+ else {
662
+ return visitor.visitChildren(this);
663
+ }
664
+ }
665
+ }
666
+ export class SugarDeclContext extends antlr.ParserRuleContext {
667
+ constructor(parent, invokingState) {
668
+ super(parent, invokingState);
669
+ }
670
+ WORD(i) {
671
+ if (i === undefined) {
672
+ return this.getTokens(TagSetParser.WORD);
673
+ }
674
+ else {
675
+ return this.getToken(TagSetParser.WORD, i);
676
+ }
677
+ }
678
+ COLON() {
679
+ return this.getToken(TagSetParser.COLON, 0);
680
+ }
681
+ valueList() {
682
+ return this.getRuleContext(0, ValueListContext);
683
+ }
684
+ COMMA(i) {
685
+ if (i === undefined) {
686
+ return this.getTokens(TagSetParser.COMMA);
687
+ }
688
+ else {
689
+ return this.getToken(TagSetParser.COMMA, i);
690
+ }
691
+ }
692
+ get ruleIndex() {
693
+ return TagSetParser.RULE_sugarDecl;
694
+ }
695
+ enterRule(listener) {
696
+ if (listener.enterSugarDecl) {
697
+ listener.enterSugarDecl(this);
698
+ }
699
+ }
700
+ exitRule(listener) {
701
+ if (listener.exitSugarDecl) {
702
+ listener.exitSugarDecl(this);
703
+ }
704
+ }
705
+ accept(visitor) {
706
+ if (visitor.visitSugarDecl) {
707
+ return visitor.visitSugarDecl(this);
708
+ }
709
+ else {
710
+ return visitor.visitChildren(this);
711
+ }
712
+ }
713
+ }
714
+ export class PatternContext extends antlr.ParserRuleContext {
715
+ constructor(parent, invokingState) {
716
+ super(parent, invokingState);
717
+ }
718
+ WORD(i) {
719
+ if (i === undefined) {
720
+ return this.getTokens(TagSetParser.WORD);
721
+ }
722
+ else {
723
+ return this.getToken(TagSetParser.WORD, i);
724
+ }
725
+ }
726
+ AMP(i) {
727
+ if (i === undefined) {
728
+ return this.getTokens(TagSetParser.AMP);
729
+ }
730
+ else {
731
+ return this.getToken(TagSetParser.AMP, i);
732
+ }
733
+ }
734
+ get ruleIndex() {
735
+ return TagSetParser.RULE_pattern;
736
+ }
737
+ enterRule(listener) {
738
+ if (listener.enterPattern) {
739
+ listener.enterPattern(this);
740
+ }
741
+ }
742
+ exitRule(listener) {
743
+ if (listener.exitPattern) {
744
+ listener.exitPattern(this);
745
+ }
746
+ }
747
+ accept(visitor) {
748
+ if (visitor.visitPattern) {
749
+ return visitor.visitPattern(this);
750
+ }
751
+ else {
752
+ return visitor.visitChildren(this);
753
+ }
754
+ }
755
+ }
756
+ export class ValueListContext extends antlr.ParserRuleContext {
757
+ constructor(parent, invokingState) {
758
+ super(parent, invokingState);
759
+ }
760
+ valueItem(i) {
761
+ if (i === undefined) {
762
+ return this.getRuleContexts(ValueItemContext);
763
+ }
764
+ return this.getRuleContext(i, ValueItemContext);
765
+ }
766
+ COMMA(i) {
767
+ if (i === undefined) {
768
+ return this.getTokens(TagSetParser.COMMA);
769
+ }
770
+ else {
771
+ return this.getToken(TagSetParser.COMMA, i);
772
+ }
773
+ }
774
+ get ruleIndex() {
775
+ return TagSetParser.RULE_valueList;
776
+ }
777
+ enterRule(listener) {
778
+ if (listener.enterValueList) {
779
+ listener.enterValueList(this);
780
+ }
781
+ }
782
+ exitRule(listener) {
783
+ if (listener.exitValueList) {
784
+ listener.exitValueList(this);
785
+ }
786
+ }
787
+ accept(visitor) {
788
+ if (visitor.visitValueList) {
789
+ return visitor.visitValueList(this);
790
+ }
791
+ else {
792
+ return visitor.visitChildren(this);
793
+ }
794
+ }
795
+ }
796
+ export class ValueItemContext extends antlr.ParserRuleContext {
797
+ constructor(parent, invokingState) {
798
+ super(parent, invokingState);
799
+ }
800
+ WORD(i) {
801
+ if (i === undefined) {
802
+ return this.getTokens(TagSetParser.WORD);
803
+ }
804
+ else {
805
+ return this.getToken(TagSetParser.WORD, i);
806
+ }
807
+ }
808
+ QUOTED_STRING(i) {
809
+ if (i === undefined) {
810
+ return this.getTokens(TagSetParser.QUOTED_STRING);
811
+ }
812
+ else {
813
+ return this.getToken(TagSetParser.QUOTED_STRING, i);
814
+ }
815
+ }
816
+ get ruleIndex() {
817
+ return TagSetParser.RULE_valueItem;
818
+ }
819
+ enterRule(listener) {
820
+ if (listener.enterValueItem) {
821
+ listener.enterValueItem(this);
822
+ }
823
+ }
824
+ exitRule(listener) {
825
+ if (listener.exitValueItem) {
826
+ listener.exitValueItem(this);
827
+ }
828
+ }
829
+ accept(visitor) {
830
+ if (visitor.visitValueItem) {
831
+ return visitor.visitValueItem(this);
832
+ }
833
+ else {
834
+ return visitor.visitChildren(this);
835
+ }
836
+ }
837
+ }