forked from pcpratts2/pinac
-
Notifications
You must be signed in to change notification settings - Fork 14
/
InterpParser.cs
851 lines (663 loc) · 26.2 KB
/
InterpParser.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
// $ANTLR 3.1.3 Mar 18, 2009 10:09:25 Interp.g 2009-10-26 20:33:39
using System.Collections.Generic;
using System;
using Antlr.Runtime;
using IList = System.Collections.IList;
using ArrayList = System.Collections.ArrayList;
using Stack = Antlr.Runtime.Collections.StackList;
using Antlr.Runtime.Tree;
public class InterpParser : Parser
{
public static readonly string[] tokenNames = new string[]
{
"<invalid>",
"<EOR>",
"<DOWN>",
"<UP>",
"ASSIGNMENT",
"END_OF_STATEMENT",
"VARIABLE",
"INT_LITERAL",
"TYPE",
"Declaration1",
"Function",
"PLUS",
"WHITESPACE",
"'print'"
};
public const int INT_LITERAL = 7;
public const int VARIABLE = 6;
public const int Function = 10;
public const int Declaration1 = 9;
public const int T__13 = 13;
public const int WHITESPACE = 12;
public const int PLUS = 11;
public const int ASSIGNMENT = 4;
public const int EOF = -1;
public const int END_OF_STATEMENT = 5;
public const int TYPE = 8;
// delegates
// delegators
public InterpParser(ITokenStream input)
: this(input, new RecognizerSharedState()) {
}
public InterpParser(ITokenStream input, RecognizerSharedState state)
: base(input, state) {
InitializeCyclicDFAs();
}
protected ITreeAdaptor adaptor = new CommonTreeAdaptor();
public ITreeAdaptor TreeAdaptor
{
get { return this.adaptor; }
set {
this.adaptor = value;
}
}
override public string[] TokenNames {
get { return InterpParser.tokenNames; }
}
override public string GrammarFileName {
get { return "Interp.g"; }
}
public class program_return : ParserRuleReturnScope
{
public List<Element> ret;
private object tree;
override public object Tree
{
get { return tree; }
set { tree = (object) value; }
}
};
// $ANTLR start "program"
// Interp.g:41:1: program returns [List<Element> ret] : ( expr )+ ;
public InterpParser.program_return program() // throws RecognitionException [1]
{
InterpParser.program_return retval = new InterpParser.program_return();
retval.Start = input.LT(1);
object root_0 = null;
InterpParser.expr_return expr1 = null;
retval.ret = new List<Element>();
try
{
// Interp.g:49:3: ( ( expr )+ )
// Interp.g:49:5: ( expr )+
{
root_0 = (object)adaptor.GetNilNode();
// Interp.g:49:5: ( expr )+
int cnt1 = 0;
do
{
int alt1 = 2;
int LA1_0 = input.LA(1);
if ( (LA1_0 == VARIABLE || LA1_0 == 13) )
{
alt1 = 1;
}
switch (alt1)
{
case 1 :
// Interp.g:49:6: expr
{
PushFollow(FOLLOW_expr_in_program91);
expr1 = expr();
state.followingStackPointer--;
adaptor.AddChild(root_0, expr1.Tree);
retval.ret.Add(((expr1 != null) ? expr1.ret : null));
}
break;
default:
if ( cnt1 >= 1 ) goto loop1;
EarlyExitException eee1 =
new EarlyExitException(1, input);
throw eee1;
}
cnt1++;
} while (true);
loop1:
; // Stops C# compiler whining that label 'loop1' has no statements
}
retval.Stop = input.LT(-1);
retval.Tree = (object)adaptor.RulePostProcessing(root_0);
adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
}
catch (RecognitionException re)
{
ReportError(re);
Recover(input,re);
// Conversion of the second argument necessary, but harmless
retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);
}
finally
{
}
return retval;
}
// $ANTLR end "program"
public class expr_return : ParserRuleReturnScope
{
public Element ret;
private object tree;
override public object Tree
{
get { return tree; }
set { tree = (object) value; }
}
};
// $ANTLR start "expr"
// Interp.g:53:1: expr returns [Element ret] : ( assignment | print );
public InterpParser.expr_return expr() // throws RecognitionException [1]
{
InterpParser.expr_return retval = new InterpParser.expr_return();
retval.Start = input.LT(1);
object root_0 = null;
InterpParser.assignment_return assignment2 = null;
InterpParser.print_return print3 = null;
try
{
// Interp.g:56:3: ( assignment | print )
int alt2 = 2;
int LA2_0 = input.LA(1);
if ( (LA2_0 == VARIABLE) )
{
alt2 = 1;
}
else if ( (LA2_0 == 13) )
{
alt2 = 2;
}
else
{
NoViableAltException nvae_d2s0 =
new NoViableAltException("", 2, 0, input);
throw nvae_d2s0;
}
switch (alt2)
{
case 1 :
// Interp.g:56:5: assignment
{
root_0 = (object)adaptor.GetNilNode();
PushFollow(FOLLOW_assignment_in_expr115);
assignment2 = assignment();
state.followingStackPointer--;
adaptor.AddChild(root_0, assignment2.Tree);
retval.ret = ((assignment2 != null) ? assignment2.ret : null);
}
break;
case 2 :
// Interp.g:57:5: print
{
root_0 = (object)adaptor.GetNilNode();
PushFollow(FOLLOW_print_in_expr123);
print3 = print();
state.followingStackPointer--;
adaptor.AddChild(root_0, print3.Tree);
retval.ret = ((print3 != null) ? print3.ret : null);
}
break;
}
retval.Stop = input.LT(-1);
retval.Tree = (object)adaptor.RulePostProcessing(root_0);
adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
}
catch (RecognitionException re)
{
ReportError(re);
Recover(input,re);
// Conversion of the second argument necessary, but harmless
retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);
}
finally
{
}
return retval;
}
// $ANTLR end "expr"
public class assignment_return : ParserRuleReturnScope
{
public AssignmentOperationElement ret;
private object tree;
override public object Tree
{
get { return tree; }
set { tree = (object) value; }
}
};
// $ANTLR start "assignment"
// Interp.g:62:1: assignment returns [AssignmentOperationElement ret] : variable ASSIGNMENT ( var_or_int_literal | addition ) END_OF_STATEMENT ;
public InterpParser.assignment_return assignment() // throws RecognitionException [1]
{
InterpParser.assignment_return retval = new InterpParser.assignment_return();
retval.Start = input.LT(1);
object root_0 = null;
IToken ASSIGNMENT5 = null;
IToken END_OF_STATEMENT8 = null;
InterpParser.variable_return variable4 = null;
InterpParser.var_or_int_literal_return var_or_int_literal6 = null;
InterpParser.addition_return addition7 = null;
object ASSIGNMENT5_tree=null;
object END_OF_STATEMENT8_tree=null;
retval.ret = new AssignmentOperationElement();
try
{
// Interp.g:73:3: ( variable ASSIGNMENT ( var_or_int_literal | addition ) END_OF_STATEMENT )
// Interp.g:73:5: variable ASSIGNMENT ( var_or_int_literal | addition ) END_OF_STATEMENT
{
root_0 = (object)adaptor.GetNilNode();
PushFollow(FOLLOW_variable_in_assignment151);
variable4 = variable();
state.followingStackPointer--;
adaptor.AddChild(root_0, variable4.Tree);
retval.ret.setLhs(((variable4 != null) ? variable4.ret : null));
ASSIGNMENT5=(IToken)Match(input,ASSIGNMENT,FOLLOW_ASSIGNMENT_in_assignment162);
ASSIGNMENT5_tree = (object)adaptor.Create(ASSIGNMENT5);
adaptor.AddChild(root_0, ASSIGNMENT5_tree);
// Interp.g:77:4: ( var_or_int_literal | addition )
int alt3 = 2;
int LA3_0 = input.LA(1);
if ( (LA3_0 == VARIABLE) )
{
int LA3_1 = input.LA(2);
if ( (LA3_1 == PLUS) )
{
alt3 = 2;
}
else if ( (LA3_1 == END_OF_STATEMENT) )
{
alt3 = 1;
}
else
{
NoViableAltException nvae_d3s1 =
new NoViableAltException("", 3, 1, input);
throw nvae_d3s1;
}
}
else if ( (LA3_0 == INT_LITERAL) )
{
int LA3_2 = input.LA(2);
if ( (LA3_2 == PLUS) )
{
alt3 = 2;
}
else if ( (LA3_2 == END_OF_STATEMENT) )
{
alt3 = 1;
}
else
{
NoViableAltException nvae_d3s2 =
new NoViableAltException("", 3, 2, input);
throw nvae_d3s2;
}
}
else
{
NoViableAltException nvae_d3s0 =
new NoViableAltException("", 3, 0, input);
throw nvae_d3s0;
}
switch (alt3)
{
case 1 :
// Interp.g:77:5: var_or_int_literal
{
PushFollow(FOLLOW_var_or_int_literal_in_assignment173);
var_or_int_literal6 = var_or_int_literal();
state.followingStackPointer--;
adaptor.AddChild(root_0, var_or_int_literal6.Tree);
retval.ret.setRhs(((var_or_int_literal6 != null) ? var_or_int_literal6.ret : null));
}
break;
case 2 :
// Interp.g:78:7: addition
{
PushFollow(FOLLOW_addition_in_assignment184);
addition7 = addition();
state.followingStackPointer--;
adaptor.AddChild(root_0, addition7.Tree);
retval.ret.setRhs(((addition7 != null) ? addition7.ret : null));
}
break;
}
END_OF_STATEMENT8=(IToken)Match(input,END_OF_STATEMENT,FOLLOW_END_OF_STATEMENT_in_assignment194);
END_OF_STATEMENT8_tree = (object)adaptor.Create(END_OF_STATEMENT8);
adaptor.AddChild(root_0, END_OF_STATEMENT8_tree);
}
retval.Stop = input.LT(-1);
retval.Tree = (object)adaptor.RulePostProcessing(root_0);
adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
}
catch (RecognitionException re)
{
ReportError(re);
Recover(input,re);
// Conversion of the second argument necessary, but harmless
retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);
}
finally
{
}
return retval;
}
// $ANTLR end "assignment"
public class var_or_int_literal_return : ParserRuleReturnScope
{
public Element ret;
private object tree;
override public object Tree
{
get { return tree; }
set { tree = (object) value; }
}
};
// $ANTLR start "var_or_int_literal"
// Interp.g:83:1: var_or_int_literal returns [Element ret] : ( variable | int_literal ) ;
public InterpParser.var_or_int_literal_return var_or_int_literal() // throws RecognitionException [1]
{
InterpParser.var_or_int_literal_return retval = new InterpParser.var_or_int_literal_return();
retval.Start = input.LT(1);
object root_0 = null;
InterpParser.variable_return variable9 = null;
InterpParser.int_literal_return int_literal10 = null;
try
{
// Interp.g:85:3: ( ( variable | int_literal ) )
// Interp.g:85:6: ( variable | int_literal )
{
root_0 = (object)adaptor.GetNilNode();
// Interp.g:85:6: ( variable | int_literal )
int alt4 = 2;
int LA4_0 = input.LA(1);
if ( (LA4_0 == VARIABLE) )
{
alt4 = 1;
}
else if ( (LA4_0 == INT_LITERAL) )
{
alt4 = 2;
}
else
{
NoViableAltException nvae_d4s0 =
new NoViableAltException("", 4, 0, input);
throw nvae_d4s0;
}
switch (alt4)
{
case 1 :
// Interp.g:85:7: variable
{
PushFollow(FOLLOW_variable_in_var_or_int_literal214);
variable9 = variable();
state.followingStackPointer--;
adaptor.AddChild(root_0, variable9.Tree);
retval.ret = ((variable9 != null) ? variable9.ret : null);
}
break;
case 2 :
// Interp.g:87:4: int_literal
{
PushFollow(FOLLOW_int_literal_in_var_or_int_literal227);
int_literal10 = int_literal();
state.followingStackPointer--;
adaptor.AddChild(root_0, int_literal10.Tree);
retval.ret = ((int_literal10 != null) ? int_literal10.ret : null);
}
break;
}
}
retval.Stop = input.LT(-1);
retval.Tree = (object)adaptor.RulePostProcessing(root_0);
adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
}
catch (RecognitionException re)
{
ReportError(re);
Recover(input,re);
// Conversion of the second argument necessary, but harmless
retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);
}
finally
{
}
return retval;
}
// $ANTLR end "var_or_int_literal"
public class variable_return : ParserRuleReturnScope
{
public VariableElement ret;
private object tree;
override public object Tree
{
get { return tree; }
set { tree = (object) value; }
}
};
// $ANTLR start "variable"
// Interp.g:91:1: variable returns [VariableElement ret] : VARIABLE ;
public InterpParser.variable_return variable() // throws RecognitionException [1]
{
InterpParser.variable_return retval = new InterpParser.variable_return();
retval.Start = input.LT(1);
object root_0 = null;
IToken VARIABLE11 = null;
object VARIABLE11_tree=null;
retval.ret = new VariableElement();
try
{
// Interp.g:99:3: ( VARIABLE )
// Interp.g:99:5: VARIABLE
{
root_0 = (object)adaptor.GetNilNode();
VARIABLE11=(IToken)Match(input,VARIABLE,FOLLOW_VARIABLE_in_variable257);
VARIABLE11_tree = (object)adaptor.Create(VARIABLE11);
adaptor.AddChild(root_0, VARIABLE11_tree);
retval.ret.setText(((VARIABLE11 != null) ? VARIABLE11.Text : null));
}
retval.Stop = input.LT(-1);
retval.Tree = (object)adaptor.RulePostProcessing(root_0);
adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
}
catch (RecognitionException re)
{
ReportError(re);
Recover(input,re);
// Conversion of the second argument necessary, but harmless
retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);
}
finally
{
}
return retval;
}
// $ANTLR end "variable"
public class int_literal_return : ParserRuleReturnScope
{
public IntegerElement ret;
private object tree;
override public object Tree
{
get { return tree; }
set { tree = (object) value; }
}
};
// $ANTLR start "int_literal"
// Interp.g:103:1: int_literal returns [IntegerElement ret] : INT_LITERAL ;
public InterpParser.int_literal_return int_literal() // throws RecognitionException [1]
{
InterpParser.int_literal_return retval = new InterpParser.int_literal_return();
retval.Start = input.LT(1);
object root_0 = null;
IToken INT_LITERAL12 = null;
object INT_LITERAL12_tree=null;
retval.ret = new IntegerElement();
try
{
// Interp.g:111:2: ( INT_LITERAL )
// Interp.g:111:4: INT_LITERAL
{
root_0 = (object)adaptor.GetNilNode();
INT_LITERAL12=(IToken)Match(input,INT_LITERAL,FOLLOW_INT_LITERAL_in_int_literal285);
INT_LITERAL12_tree = (object)adaptor.Create(INT_LITERAL12);
adaptor.AddChild(root_0, INT_LITERAL12_tree);
retval.ret.setText(((INT_LITERAL12 != null) ? INT_LITERAL12.Text : null));
}
retval.Stop = input.LT(-1);
retval.Tree = (object)adaptor.RulePostProcessing(root_0);
adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
}
catch (RecognitionException re)
{
ReportError(re);
Recover(input,re);
// Conversion of the second argument necessary, but harmless
retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);
}
finally
{
}
return retval;
}
// $ANTLR end "int_literal"
public class addition_return : ParserRuleReturnScope
{
public AdditionOperationElement ret;
private object tree;
override public object Tree
{
get { return tree; }
set { tree = (object) value; }
}
};
// $ANTLR start "addition"
// Interp.g:115:1: addition returns [AdditionOperationElement ret] : el1= var_or_int_literal '+' el2= var_or_int_literal ;
public InterpParser.addition_return addition() // throws RecognitionException [1]
{
InterpParser.addition_return retval = new InterpParser.addition_return();
retval.Start = input.LT(1);
object root_0 = null;
IToken char_literal13 = null;
InterpParser.var_or_int_literal_return el1 = null;
InterpParser.var_or_int_literal_return el2 = null;
object char_literal13_tree=null;
retval.ret = new AdditionOperationElement();
try
{
// Interp.g:123:3: (el1= var_or_int_literal '+' el2= var_or_int_literal )
// Interp.g:123:5: el1= var_or_int_literal '+' el2= var_or_int_literal
{
root_0 = (object)adaptor.GetNilNode();
PushFollow(FOLLOW_var_or_int_literal_in_addition315);
el1 = var_or_int_literal();
state.followingStackPointer--;
adaptor.AddChild(root_0, el1.Tree);
retval.ret.setLhs(((el1 != null) ? el1.ret : null));
char_literal13=(IToken)Match(input,PLUS,FOLLOW_PLUS_in_addition327);
char_literal13_tree = (object)adaptor.Create(char_literal13);
adaptor.AddChild(root_0, char_literal13_tree);
PushFollow(FOLLOW_var_or_int_literal_in_addition341);
el2 = var_or_int_literal();
state.followingStackPointer--;
adaptor.AddChild(root_0, el2.Tree);
retval.ret.setRhs(((el2 != null) ? el2.ret : null));
}
retval.Stop = input.LT(-1);
retval.Tree = (object)adaptor.RulePostProcessing(root_0);
adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
}
catch (RecognitionException re)
{
ReportError(re);
Recover(input,re);
// Conversion of the second argument necessary, but harmless
retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);
}
finally
{
}
return retval;
}
// $ANTLR end "addition"
public class print_return : ParserRuleReturnScope
{
public PrintOperationElement ret;
private object tree;
override public object Tree
{
get { return tree; }
set { tree = (object) value; }
}
};
// $ANTLR start "print"
// Interp.g:131:1: print returns [PrintOperationElement ret] : 'print' var_or_int_literal END_OF_STATEMENT ;
public InterpParser.print_return print() // throws RecognitionException [1]
{
InterpParser.print_return retval = new InterpParser.print_return();
retval.Start = input.LT(1);
object root_0 = null;
IToken string_literal14 = null;
IToken END_OF_STATEMENT16 = null;
InterpParser.var_or_int_literal_return var_or_int_literal15 = null;
object string_literal14_tree=null;
object END_OF_STATEMENT16_tree=null;
retval.ret = new PrintOperationElement();
try
{
// Interp.g:139:2: ( 'print' var_or_int_literal END_OF_STATEMENT )
// Interp.g:139:4: 'print' var_or_int_literal END_OF_STATEMENT
{
root_0 = (object)adaptor.GetNilNode();
string_literal14=(IToken)Match(input,13,FOLLOW_13_in_print369);
string_literal14_tree = (object)adaptor.Create(string_literal14);
adaptor.AddChild(root_0, string_literal14_tree);
PushFollow(FOLLOW_var_or_int_literal_in_print371);
var_or_int_literal15 = var_or_int_literal();
state.followingStackPointer--;
adaptor.AddChild(root_0, var_or_int_literal15.Tree);
retval.ret.setChildElement(((var_or_int_literal15 != null) ? var_or_int_literal15.ret : null));
END_OF_STATEMENT16=(IToken)Match(input,END_OF_STATEMENT,FOLLOW_END_OF_STATEMENT_in_print381);
END_OF_STATEMENT16_tree = (object)adaptor.Create(END_OF_STATEMENT16);
adaptor.AddChild(root_0, END_OF_STATEMENT16_tree);
}
retval.Stop = input.LT(-1);
retval.Tree = (object)adaptor.RulePostProcessing(root_0);
adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
}
catch (RecognitionException re)
{
ReportError(re);
Recover(input,re);
// Conversion of the second argument necessary, but harmless
retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);
}
finally
{
}
return retval;
}
// $ANTLR end "print"
// Delegated rules
private void InitializeCyclicDFAs()
{
}
public static readonly BitSet FOLLOW_expr_in_program91 = new BitSet(new ulong[]{0x0000000000002042UL});
public static readonly BitSet FOLLOW_assignment_in_expr115 = new BitSet(new ulong[]{0x0000000000000002UL});
public static readonly BitSet FOLLOW_print_in_expr123 = new BitSet(new ulong[]{0x0000000000000002UL});
public static readonly BitSet FOLLOW_variable_in_assignment151 = new BitSet(new ulong[]{0x0000000000000010UL});
public static readonly BitSet FOLLOW_ASSIGNMENT_in_assignment162 = new BitSet(new ulong[]{0x00000000000000C0UL});
public static readonly BitSet FOLLOW_var_or_int_literal_in_assignment173 = new BitSet(new ulong[]{0x0000000000000020UL});
public static readonly BitSet FOLLOW_addition_in_assignment184 = new BitSet(new ulong[]{0x0000000000000020UL});
public static readonly BitSet FOLLOW_END_OF_STATEMENT_in_assignment194 = new BitSet(new ulong[]{0x0000000000000002UL});
public static readonly BitSet FOLLOW_variable_in_var_or_int_literal214 = new BitSet(new ulong[]{0x0000000000000002UL});
public static readonly BitSet FOLLOW_int_literal_in_var_or_int_literal227 = new BitSet(new ulong[]{0x0000000000000002UL});
public static readonly BitSet FOLLOW_VARIABLE_in_variable257 = new BitSet(new ulong[]{0x0000000000000002UL});
public static readonly BitSet FOLLOW_INT_LITERAL_in_int_literal285 = new BitSet(new ulong[]{0x0000000000000002UL});
public static readonly BitSet FOLLOW_var_or_int_literal_in_addition315 = new BitSet(new ulong[]{0x0000000000000800UL});
public static readonly BitSet FOLLOW_PLUS_in_addition327 = new BitSet(new ulong[]{0x00000000000000C0UL});
public static readonly BitSet FOLLOW_var_or_int_literal_in_addition341 = new BitSet(new ulong[]{0x0000000000000002UL});
public static readonly BitSet FOLLOW_13_in_print369 = new BitSet(new ulong[]{0x00000000000000C0UL});
public static readonly BitSet FOLLOW_var_or_int_literal_in_print371 = new BitSet(new ulong[]{0x0000000000000020UL});
public static readonly BitSet FOLLOW_END_OF_STATEMENT_in_print381 = new BitSet(new ulong[]{0x0000000000000002UL});
}