@plurnk/plurnk-grammar 0.1.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,625 @@
1
+
2
+ import * as antlr from "antlr4ng";
3
+ import { Token } from "antlr4ng";
4
+
5
+ import { plurnkParserVisitor } from "./plurnkParserVisitor.ts";
6
+
7
+ // for running tests with parameters, TODO: discuss strategy for typed parameters in CI
8
+ // eslint-disable-next-line no-unused-vars
9
+ type int = number;
10
+
11
+
12
+ export class plurnkParser extends antlr.Parser {
13
+ public static readonly LBRACKET = 1;
14
+ public static readonly RBRACKET = 2;
15
+ public static readonly LPAREN = 3;
16
+ public static readonly RPAREN = 4;
17
+ public static readonly L_MARKER = 5;
18
+ public static readonly COLON = 6;
19
+ public static readonly SIGNAL_TEXT = 7;
20
+ public static readonly PATH_TEXT = 8;
21
+ public static readonly BODY_TEXT = 9;
22
+ public static readonly CLOSE_TAG = 10;
23
+ public static readonly TEXT = 11;
24
+ public static readonly OPEN_FIND = 12;
25
+ public static readonly OPEN_READ = 13;
26
+ public static readonly OPEN_EDIT = 14;
27
+ public static readonly OPEN_COPY = 15;
28
+ public static readonly OPEN_MOVE = 16;
29
+ public static readonly OPEN_SHOW = 17;
30
+ public static readonly OPEN_HIDE = 18;
31
+ public static readonly OPEN_SEND = 19;
32
+ public static readonly OPEN_EXEC = 20;
33
+ public static readonly OPENED_WS = 21;
34
+ public static readonly PS_WS = 22;
35
+ public static readonly PP_WS = 23;
36
+ public static readonly PL_WS = 24;
37
+ public static readonly BODY_COLON = 25;
38
+ public static readonly RULE_document = 0;
39
+ public static readonly RULE_statement = 1;
40
+ public static readonly RULE_openTag = 2;
41
+ public static readonly RULE_signal = 3;
42
+ public static readonly RULE_path = 4;
43
+ public static readonly RULE_lineMarker = 5;
44
+ public static readonly RULE_body = 6;
45
+
46
+ public static readonly literalNames = [
47
+ null, null, null, null, null, null, null, null, null, null, null,
48
+ null, null, null, null, null, null, null, null, null, null, null,
49
+ null, null, null, "':'"
50
+ ];
51
+
52
+ public static readonly symbolicNames = [
53
+ null, "LBRACKET", "RBRACKET", "LPAREN", "RPAREN", "L_MARKER", "COLON",
54
+ "SIGNAL_TEXT", "PATH_TEXT", "BODY_TEXT", "CLOSE_TAG", "TEXT", "OPEN_FIND",
55
+ "OPEN_READ", "OPEN_EDIT", "OPEN_COPY", "OPEN_MOVE", "OPEN_SHOW",
56
+ "OPEN_HIDE", "OPEN_SEND", "OPEN_EXEC", "OPENED_WS", "PS_WS", "PP_WS",
57
+ "PL_WS", "BODY_COLON"
58
+ ];
59
+ public static readonly ruleNames = [
60
+ "document", "statement", "openTag", "signal", "path", "lineMarker",
61
+ "body",
62
+ ];
63
+
64
+ public get grammarFileName(): string { return "plurnkParser.g4"; }
65
+ public get literalNames(): (string | null)[] { return plurnkParser.literalNames; }
66
+ public get symbolicNames(): (string | null)[] { return plurnkParser.symbolicNames; }
67
+ public get ruleNames(): string[] { return plurnkParser.ruleNames; }
68
+ public get serializedATN(): number[] { return plurnkParser._serializedATN; }
69
+
70
+ protected createFailedPredicateException(predicate?: string, message?: string): antlr.FailedPredicateException {
71
+ return new antlr.FailedPredicateException(this, predicate, message);
72
+ }
73
+
74
+ public constructor(input: antlr.TokenStream) {
75
+ super(input);
76
+ this.interpreter = new antlr.ParserATNSimulator(this, plurnkParser._ATN, plurnkParser.decisionsToDFA, new antlr.PredictionContextCache());
77
+ }
78
+ public document(): DocumentContext {
79
+ let localContext = new DocumentContext(this.context, this.state);
80
+ this.enterRule(localContext, 0, plurnkParser.RULE_document);
81
+ let _la: number;
82
+ try {
83
+ this.enterOuterAlt(localContext, 1);
84
+ {
85
+ this.state = 18;
86
+ this.errorHandler.sync(this);
87
+ _la = this.tokenStream.LA(1);
88
+ while ((((_la) & ~0x1F) === 0 && ((1 << _la) & 2095104) !== 0)) {
89
+ {
90
+ this.state = 16;
91
+ this.errorHandler.sync(this);
92
+ switch (this.tokenStream.LA(1)) {
93
+ case plurnkParser.OPEN_FIND:
94
+ case plurnkParser.OPEN_READ:
95
+ case plurnkParser.OPEN_EDIT:
96
+ case plurnkParser.OPEN_COPY:
97
+ case plurnkParser.OPEN_MOVE:
98
+ case plurnkParser.OPEN_SHOW:
99
+ case plurnkParser.OPEN_HIDE:
100
+ case plurnkParser.OPEN_SEND:
101
+ case plurnkParser.OPEN_EXEC:
102
+ {
103
+ this.state = 14;
104
+ this.statement();
105
+ }
106
+ break;
107
+ case plurnkParser.TEXT:
108
+ {
109
+ this.state = 15;
110
+ this.match(plurnkParser.TEXT);
111
+ }
112
+ break;
113
+ default:
114
+ throw new antlr.NoViableAltException(this);
115
+ }
116
+ }
117
+ this.state = 20;
118
+ this.errorHandler.sync(this);
119
+ _la = this.tokenStream.LA(1);
120
+ }
121
+ this.state = 21;
122
+ this.match(plurnkParser.EOF);
123
+ }
124
+ }
125
+ catch (re) {
126
+ if (re instanceof antlr.RecognitionException) {
127
+ this.errorHandler.reportError(this, re);
128
+ this.errorHandler.recover(this, re);
129
+ } else {
130
+ throw re;
131
+ }
132
+ }
133
+ finally {
134
+ this.exitRule();
135
+ }
136
+ return localContext;
137
+ }
138
+ public statement(): StatementContext {
139
+ let localContext = new StatementContext(this.context, this.state);
140
+ this.enterRule(localContext, 2, plurnkParser.RULE_statement);
141
+ let _la: number;
142
+ try {
143
+ this.enterOuterAlt(localContext, 1);
144
+ {
145
+ this.state = 23;
146
+ this.openTag();
147
+ this.state = 25;
148
+ this.errorHandler.sync(this);
149
+ _la = this.tokenStream.LA(1);
150
+ if (_la === 1) {
151
+ {
152
+ this.state = 24;
153
+ this.signal();
154
+ }
155
+ }
156
+
157
+ this.state = 28;
158
+ this.errorHandler.sync(this);
159
+ _la = this.tokenStream.LA(1);
160
+ if (_la === 3) {
161
+ {
162
+ this.state = 27;
163
+ this.path();
164
+ }
165
+ }
166
+
167
+ this.state = 31;
168
+ this.errorHandler.sync(this);
169
+ _la = this.tokenStream.LA(1);
170
+ if (_la === 5) {
171
+ {
172
+ this.state = 30;
173
+ this.lineMarker();
174
+ }
175
+ }
176
+
177
+ this.state = 33;
178
+ this.match(plurnkParser.COLON);
179
+ this.state = 35;
180
+ this.errorHandler.sync(this);
181
+ _la = this.tokenStream.LA(1);
182
+ if (_la === 9) {
183
+ {
184
+ this.state = 34;
185
+ this.body();
186
+ }
187
+ }
188
+
189
+ this.state = 37;
190
+ this.match(plurnkParser.CLOSE_TAG);
191
+ }
192
+ }
193
+ catch (re) {
194
+ if (re instanceof antlr.RecognitionException) {
195
+ this.errorHandler.reportError(this, re);
196
+ this.errorHandler.recover(this, re);
197
+ } else {
198
+ throw re;
199
+ }
200
+ }
201
+ finally {
202
+ this.exitRule();
203
+ }
204
+ return localContext;
205
+ }
206
+ public openTag(): OpenTagContext {
207
+ let localContext = new OpenTagContext(this.context, this.state);
208
+ this.enterRule(localContext, 4, plurnkParser.RULE_openTag);
209
+ let _la: number;
210
+ try {
211
+ this.enterOuterAlt(localContext, 1);
212
+ {
213
+ this.state = 39;
214
+ _la = this.tokenStream.LA(1);
215
+ if(!((((_la) & ~0x1F) === 0 && ((1 << _la) & 2093056) !== 0))) {
216
+ this.errorHandler.recoverInline(this);
217
+ }
218
+ else {
219
+ this.errorHandler.reportMatch(this);
220
+ this.consume();
221
+ }
222
+ }
223
+ }
224
+ catch (re) {
225
+ if (re instanceof antlr.RecognitionException) {
226
+ this.errorHandler.reportError(this, re);
227
+ this.errorHandler.recover(this, re);
228
+ } else {
229
+ throw re;
230
+ }
231
+ }
232
+ finally {
233
+ this.exitRule();
234
+ }
235
+ return localContext;
236
+ }
237
+ public signal(): SignalContext {
238
+ let localContext = new SignalContext(this.context, this.state);
239
+ this.enterRule(localContext, 6, plurnkParser.RULE_signal);
240
+ let _la: number;
241
+ try {
242
+ this.enterOuterAlt(localContext, 1);
243
+ {
244
+ this.state = 41;
245
+ this.match(plurnkParser.LBRACKET);
246
+ this.state = 43;
247
+ this.errorHandler.sync(this);
248
+ _la = this.tokenStream.LA(1);
249
+ if (_la === 7) {
250
+ {
251
+ this.state = 42;
252
+ this.match(plurnkParser.SIGNAL_TEXT);
253
+ }
254
+ }
255
+
256
+ this.state = 45;
257
+ this.match(plurnkParser.RBRACKET);
258
+ }
259
+ }
260
+ catch (re) {
261
+ if (re instanceof antlr.RecognitionException) {
262
+ this.errorHandler.reportError(this, re);
263
+ this.errorHandler.recover(this, re);
264
+ } else {
265
+ throw re;
266
+ }
267
+ }
268
+ finally {
269
+ this.exitRule();
270
+ }
271
+ return localContext;
272
+ }
273
+ public path(): PathContext {
274
+ let localContext = new PathContext(this.context, this.state);
275
+ this.enterRule(localContext, 8, plurnkParser.RULE_path);
276
+ let _la: number;
277
+ try {
278
+ this.enterOuterAlt(localContext, 1);
279
+ {
280
+ this.state = 47;
281
+ this.match(plurnkParser.LPAREN);
282
+ this.state = 49;
283
+ this.errorHandler.sync(this);
284
+ _la = this.tokenStream.LA(1);
285
+ if (_la === 8) {
286
+ {
287
+ this.state = 48;
288
+ this.match(plurnkParser.PATH_TEXT);
289
+ }
290
+ }
291
+
292
+ this.state = 51;
293
+ this.match(plurnkParser.RPAREN);
294
+ }
295
+ }
296
+ catch (re) {
297
+ if (re instanceof antlr.RecognitionException) {
298
+ this.errorHandler.reportError(this, re);
299
+ this.errorHandler.recover(this, re);
300
+ } else {
301
+ throw re;
302
+ }
303
+ }
304
+ finally {
305
+ this.exitRule();
306
+ }
307
+ return localContext;
308
+ }
309
+ public lineMarker(): LineMarkerContext {
310
+ let localContext = new LineMarkerContext(this.context, this.state);
311
+ this.enterRule(localContext, 10, plurnkParser.RULE_lineMarker);
312
+ try {
313
+ this.enterOuterAlt(localContext, 1);
314
+ {
315
+ this.state = 53;
316
+ this.match(plurnkParser.L_MARKER);
317
+ }
318
+ }
319
+ catch (re) {
320
+ if (re instanceof antlr.RecognitionException) {
321
+ this.errorHandler.reportError(this, re);
322
+ this.errorHandler.recover(this, re);
323
+ } else {
324
+ throw re;
325
+ }
326
+ }
327
+ finally {
328
+ this.exitRule();
329
+ }
330
+ return localContext;
331
+ }
332
+ public body(): BodyContext {
333
+ let localContext = new BodyContext(this.context, this.state);
334
+ this.enterRule(localContext, 12, plurnkParser.RULE_body);
335
+ let _la: number;
336
+ try {
337
+ this.enterOuterAlt(localContext, 1);
338
+ {
339
+ this.state = 56;
340
+ this.errorHandler.sync(this);
341
+ _la = this.tokenStream.LA(1);
342
+ do {
343
+ {
344
+ {
345
+ this.state = 55;
346
+ this.match(plurnkParser.BODY_TEXT);
347
+ }
348
+ }
349
+ this.state = 58;
350
+ this.errorHandler.sync(this);
351
+ _la = this.tokenStream.LA(1);
352
+ } while (_la === 9);
353
+ }
354
+ }
355
+ catch (re) {
356
+ if (re instanceof antlr.RecognitionException) {
357
+ this.errorHandler.reportError(this, re);
358
+ this.errorHandler.recover(this, re);
359
+ } else {
360
+ throw re;
361
+ }
362
+ }
363
+ finally {
364
+ this.exitRule();
365
+ }
366
+ return localContext;
367
+ }
368
+
369
+ public static readonly _serializedATN: number[] = [
370
+ 4,1,25,61,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,
371
+ 6,1,0,1,0,5,0,17,8,0,10,0,12,0,20,9,0,1,0,1,0,1,1,1,1,3,1,26,8,1,
372
+ 1,1,3,1,29,8,1,1,1,3,1,32,8,1,1,1,1,1,3,1,36,8,1,1,1,1,1,1,2,1,2,
373
+ 1,3,1,3,3,3,44,8,3,1,3,1,3,1,4,1,4,3,4,50,8,4,1,4,1,4,1,5,1,5,1,
374
+ 6,4,6,57,8,6,11,6,12,6,58,1,6,0,0,7,0,2,4,6,8,10,12,0,1,1,0,12,20,
375
+ 62,0,18,1,0,0,0,2,23,1,0,0,0,4,39,1,0,0,0,6,41,1,0,0,0,8,47,1,0,
376
+ 0,0,10,53,1,0,0,0,12,56,1,0,0,0,14,17,3,2,1,0,15,17,5,11,0,0,16,
377
+ 14,1,0,0,0,16,15,1,0,0,0,17,20,1,0,0,0,18,16,1,0,0,0,18,19,1,0,0,
378
+ 0,19,21,1,0,0,0,20,18,1,0,0,0,21,22,5,0,0,1,22,1,1,0,0,0,23,25,3,
379
+ 4,2,0,24,26,3,6,3,0,25,24,1,0,0,0,25,26,1,0,0,0,26,28,1,0,0,0,27,
380
+ 29,3,8,4,0,28,27,1,0,0,0,28,29,1,0,0,0,29,31,1,0,0,0,30,32,3,10,
381
+ 5,0,31,30,1,0,0,0,31,32,1,0,0,0,32,33,1,0,0,0,33,35,5,6,0,0,34,36,
382
+ 3,12,6,0,35,34,1,0,0,0,35,36,1,0,0,0,36,37,1,0,0,0,37,38,5,10,0,
383
+ 0,38,3,1,0,0,0,39,40,7,0,0,0,40,5,1,0,0,0,41,43,5,1,0,0,42,44,5,
384
+ 7,0,0,43,42,1,0,0,0,43,44,1,0,0,0,44,45,1,0,0,0,45,46,5,2,0,0,46,
385
+ 7,1,0,0,0,47,49,5,3,0,0,48,50,5,8,0,0,49,48,1,0,0,0,49,50,1,0,0,
386
+ 0,50,51,1,0,0,0,51,52,5,4,0,0,52,9,1,0,0,0,53,54,5,5,0,0,54,11,1,
387
+ 0,0,0,55,57,5,9,0,0,56,55,1,0,0,0,57,58,1,0,0,0,58,56,1,0,0,0,58,
388
+ 59,1,0,0,0,59,13,1,0,0,0,9,16,18,25,28,31,35,43,49,58
389
+ ];
390
+
391
+ private static __ATN: antlr.ATN;
392
+ public static get _ATN(): antlr.ATN {
393
+ if (!plurnkParser.__ATN) {
394
+ plurnkParser.__ATN = new antlr.ATNDeserializer().deserialize(plurnkParser._serializedATN);
395
+ }
396
+
397
+ return plurnkParser.__ATN;
398
+ }
399
+
400
+
401
+ private static readonly vocabulary = new antlr.Vocabulary(plurnkParser.literalNames, plurnkParser.symbolicNames, []);
402
+
403
+ public override get vocabulary(): antlr.Vocabulary {
404
+ return plurnkParser.vocabulary;
405
+ }
406
+
407
+ private static readonly decisionsToDFA = plurnkParser._ATN.decisionToState.map( (ds: antlr.DecisionState, index: number) => new antlr.DFA(ds, index) );
408
+ }
409
+
410
+ export class DocumentContext extends antlr.ParserRuleContext {
411
+ public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) {
412
+ super(parent, invokingState);
413
+ }
414
+ public EOF(): antlr.TerminalNode {
415
+ return this.getToken(plurnkParser.EOF, 0)!;
416
+ }
417
+ public statement(): StatementContext[];
418
+ public statement(i: number): StatementContext | null;
419
+ public statement(i?: number): StatementContext[] | StatementContext | null {
420
+ if (i === undefined) {
421
+ return this.getRuleContexts(StatementContext);
422
+ }
423
+
424
+ return this.getRuleContext(i, StatementContext);
425
+ }
426
+ public TEXT(): antlr.TerminalNode[];
427
+ public TEXT(i: number): antlr.TerminalNode | null;
428
+ public TEXT(i?: number): antlr.TerminalNode | null | antlr.TerminalNode[] {
429
+ if (i === undefined) {
430
+ return this.getTokens(plurnkParser.TEXT);
431
+ } else {
432
+ return this.getToken(plurnkParser.TEXT, i);
433
+ }
434
+ }
435
+ public override get ruleIndex(): number {
436
+ return plurnkParser.RULE_document;
437
+ }
438
+ public override accept<Result>(visitor: plurnkParserVisitor<Result>): Result | null {
439
+ if (visitor.visitDocument) {
440
+ return visitor.visitDocument(this);
441
+ } else {
442
+ return visitor.visitChildren(this);
443
+ }
444
+ }
445
+ }
446
+
447
+
448
+ export class StatementContext extends antlr.ParserRuleContext {
449
+ public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) {
450
+ super(parent, invokingState);
451
+ }
452
+ public openTag(): OpenTagContext {
453
+ return this.getRuleContext(0, OpenTagContext)!;
454
+ }
455
+ public COLON(): antlr.TerminalNode {
456
+ return this.getToken(plurnkParser.COLON, 0)!;
457
+ }
458
+ public CLOSE_TAG(): antlr.TerminalNode {
459
+ return this.getToken(plurnkParser.CLOSE_TAG, 0)!;
460
+ }
461
+ public signal(): SignalContext | null {
462
+ return this.getRuleContext(0, SignalContext);
463
+ }
464
+ public path(): PathContext | null {
465
+ return this.getRuleContext(0, PathContext);
466
+ }
467
+ public lineMarker(): LineMarkerContext | null {
468
+ return this.getRuleContext(0, LineMarkerContext);
469
+ }
470
+ public body(): BodyContext | null {
471
+ return this.getRuleContext(0, BodyContext);
472
+ }
473
+ public override get ruleIndex(): number {
474
+ return plurnkParser.RULE_statement;
475
+ }
476
+ public override accept<Result>(visitor: plurnkParserVisitor<Result>): Result | null {
477
+ if (visitor.visitStatement) {
478
+ return visitor.visitStatement(this);
479
+ } else {
480
+ return visitor.visitChildren(this);
481
+ }
482
+ }
483
+ }
484
+
485
+
486
+ export class OpenTagContext extends antlr.ParserRuleContext {
487
+ public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) {
488
+ super(parent, invokingState);
489
+ }
490
+ public OPEN_FIND(): antlr.TerminalNode | null {
491
+ return this.getToken(plurnkParser.OPEN_FIND, 0);
492
+ }
493
+ public OPEN_READ(): antlr.TerminalNode | null {
494
+ return this.getToken(plurnkParser.OPEN_READ, 0);
495
+ }
496
+ public OPEN_EDIT(): antlr.TerminalNode | null {
497
+ return this.getToken(plurnkParser.OPEN_EDIT, 0);
498
+ }
499
+ public OPEN_COPY(): antlr.TerminalNode | null {
500
+ return this.getToken(plurnkParser.OPEN_COPY, 0);
501
+ }
502
+ public OPEN_MOVE(): antlr.TerminalNode | null {
503
+ return this.getToken(plurnkParser.OPEN_MOVE, 0);
504
+ }
505
+ public OPEN_SHOW(): antlr.TerminalNode | null {
506
+ return this.getToken(plurnkParser.OPEN_SHOW, 0);
507
+ }
508
+ public OPEN_HIDE(): antlr.TerminalNode | null {
509
+ return this.getToken(plurnkParser.OPEN_HIDE, 0);
510
+ }
511
+ public OPEN_SEND(): antlr.TerminalNode | null {
512
+ return this.getToken(plurnkParser.OPEN_SEND, 0);
513
+ }
514
+ public OPEN_EXEC(): antlr.TerminalNode | null {
515
+ return this.getToken(plurnkParser.OPEN_EXEC, 0);
516
+ }
517
+ public override get ruleIndex(): number {
518
+ return plurnkParser.RULE_openTag;
519
+ }
520
+ public override accept<Result>(visitor: plurnkParserVisitor<Result>): Result | null {
521
+ if (visitor.visitOpenTag) {
522
+ return visitor.visitOpenTag(this);
523
+ } else {
524
+ return visitor.visitChildren(this);
525
+ }
526
+ }
527
+ }
528
+
529
+
530
+ export class SignalContext extends antlr.ParserRuleContext {
531
+ public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) {
532
+ super(parent, invokingState);
533
+ }
534
+ public LBRACKET(): antlr.TerminalNode {
535
+ return this.getToken(plurnkParser.LBRACKET, 0)!;
536
+ }
537
+ public RBRACKET(): antlr.TerminalNode {
538
+ return this.getToken(plurnkParser.RBRACKET, 0)!;
539
+ }
540
+ public SIGNAL_TEXT(): antlr.TerminalNode | null {
541
+ return this.getToken(plurnkParser.SIGNAL_TEXT, 0);
542
+ }
543
+ public override get ruleIndex(): number {
544
+ return plurnkParser.RULE_signal;
545
+ }
546
+ public override accept<Result>(visitor: plurnkParserVisitor<Result>): Result | null {
547
+ if (visitor.visitSignal) {
548
+ return visitor.visitSignal(this);
549
+ } else {
550
+ return visitor.visitChildren(this);
551
+ }
552
+ }
553
+ }
554
+
555
+
556
+ export class PathContext extends antlr.ParserRuleContext {
557
+ public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) {
558
+ super(parent, invokingState);
559
+ }
560
+ public LPAREN(): antlr.TerminalNode {
561
+ return this.getToken(plurnkParser.LPAREN, 0)!;
562
+ }
563
+ public RPAREN(): antlr.TerminalNode {
564
+ return this.getToken(plurnkParser.RPAREN, 0)!;
565
+ }
566
+ public PATH_TEXT(): antlr.TerminalNode | null {
567
+ return this.getToken(plurnkParser.PATH_TEXT, 0);
568
+ }
569
+ public override get ruleIndex(): number {
570
+ return plurnkParser.RULE_path;
571
+ }
572
+ public override accept<Result>(visitor: plurnkParserVisitor<Result>): Result | null {
573
+ if (visitor.visitPath) {
574
+ return visitor.visitPath(this);
575
+ } else {
576
+ return visitor.visitChildren(this);
577
+ }
578
+ }
579
+ }
580
+
581
+
582
+ export class LineMarkerContext extends antlr.ParserRuleContext {
583
+ public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) {
584
+ super(parent, invokingState);
585
+ }
586
+ public L_MARKER(): antlr.TerminalNode {
587
+ return this.getToken(plurnkParser.L_MARKER, 0)!;
588
+ }
589
+ public override get ruleIndex(): number {
590
+ return plurnkParser.RULE_lineMarker;
591
+ }
592
+ public override accept<Result>(visitor: plurnkParserVisitor<Result>): Result | null {
593
+ if (visitor.visitLineMarker) {
594
+ return visitor.visitLineMarker(this);
595
+ } else {
596
+ return visitor.visitChildren(this);
597
+ }
598
+ }
599
+ }
600
+
601
+
602
+ export class BodyContext extends antlr.ParserRuleContext {
603
+ public constructor(parent: antlr.ParserRuleContext | null, invokingState: number) {
604
+ super(parent, invokingState);
605
+ }
606
+ public BODY_TEXT(): antlr.TerminalNode[];
607
+ public BODY_TEXT(i: number): antlr.TerminalNode | null;
608
+ public BODY_TEXT(i?: number): antlr.TerminalNode | null | antlr.TerminalNode[] {
609
+ if (i === undefined) {
610
+ return this.getTokens(plurnkParser.BODY_TEXT);
611
+ } else {
612
+ return this.getToken(plurnkParser.BODY_TEXT, i);
613
+ }
614
+ }
615
+ public override get ruleIndex(): number {
616
+ return plurnkParser.RULE_body;
617
+ }
618
+ public override accept<Result>(visitor: plurnkParserVisitor<Result>): Result | null {
619
+ if (visitor.visitBody) {
620
+ return visitor.visitBody(this);
621
+ } else {
622
+ return visitor.visitChildren(this);
623
+ }
624
+ }
625
+ }
@@ -0,0 +1,65 @@
1
+
2
+ import { AbstractParseTreeVisitor } from "antlr4ng";
3
+
4
+
5
+ import { DocumentContext } from "./plurnkParser.ts";
6
+ import { StatementContext } from "./plurnkParser.ts";
7
+ import { OpenTagContext } from "./plurnkParser.ts";
8
+ import { SignalContext } from "./plurnkParser.ts";
9
+ import { PathContext } from "./plurnkParser.ts";
10
+ import { LineMarkerContext } from "./plurnkParser.ts";
11
+ import { BodyContext } from "./plurnkParser.ts";
12
+
13
+
14
+ /**
15
+ * This interface defines a complete generic visitor for a parse tree produced
16
+ * by `plurnkParser`.
17
+ *
18
+ * @param <Result> The return type of the visit operation. Use `void` for
19
+ * operations with no return type.
20
+ */
21
+ export class plurnkParserVisitor<Result> extends AbstractParseTreeVisitor<Result> {
22
+ /**
23
+ * Visit a parse tree produced by `plurnkParser.document`.
24
+ * @param ctx the parse tree
25
+ * @return the visitor result
26
+ */
27
+ visitDocument?: (ctx: DocumentContext) => Result;
28
+ /**
29
+ * Visit a parse tree produced by `plurnkParser.statement`.
30
+ * @param ctx the parse tree
31
+ * @return the visitor result
32
+ */
33
+ visitStatement?: (ctx: StatementContext) => Result;
34
+ /**
35
+ * Visit a parse tree produced by `plurnkParser.openTag`.
36
+ * @param ctx the parse tree
37
+ * @return the visitor result
38
+ */
39
+ visitOpenTag?: (ctx: OpenTagContext) => Result;
40
+ /**
41
+ * Visit a parse tree produced by `plurnkParser.signal`.
42
+ * @param ctx the parse tree
43
+ * @return the visitor result
44
+ */
45
+ visitSignal?: (ctx: SignalContext) => Result;
46
+ /**
47
+ * Visit a parse tree produced by `plurnkParser.path`.
48
+ * @param ctx the parse tree
49
+ * @return the visitor result
50
+ */
51
+ visitPath?: (ctx: PathContext) => Result;
52
+ /**
53
+ * Visit a parse tree produced by `plurnkParser.lineMarker`.
54
+ * @param ctx the parse tree
55
+ * @return the visitor result
56
+ */
57
+ visitLineMarker?: (ctx: LineMarkerContext) => Result;
58
+ /**
59
+ * Visit a parse tree produced by `plurnkParser.body`.
60
+ * @param ctx the parse tree
61
+ * @return the visitor result
62
+ */
63
+ visitBody?: (ctx: BodyContext) => Result;
64
+ }
65
+