-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathParser.java
executable file
·1413 lines (1224 loc) · 73.2 KB
/
Parser.java
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
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//----------------------------------------------------
// The following code was generated by CUP v0.11b 20160615 (GIT 4ac7450)
//----------------------------------------------------
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.lang.Thread;
import java.io.*;
import java.io.IOException;
import java_cup.runtime.XMLElement;
/** CUP v0.11b 20160615 (GIT 4ac7450) generated parser.
*/
@SuppressWarnings({"rawtypes"})
public class Parser extends java_cup.runtime.lr_parser {
public final Class getSymbolContainer() {
return sym.class;
}
/** Default constructor. */
@Deprecated
public Parser() {super();}
/** Constructor which sets the default scanner. */
@Deprecated
public Parser(java_cup.runtime.Scanner s) {super(s);}
/** Constructor which sets the default scanner. */
public Parser(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf) {super(s,sf);}
/** Production table. */
protected static final short _production_table[][] =
unpackFromStrings(new String[] {
"\000\121\000\002\042\004\000\002\002\004\000\002\042" +
"\004\000\002\042\003\000\002\041\006\000\002\010\005" +
"\000\002\010\003\000\002\010\003\000\002\010\003\000" +
"\002\011\003\000\002\011\003\000\002\011\003\000\002" +
"\011\003\000\002\011\003\000\002\011\003\000\002\013" +
"\006\000\002\013\004\000\002\037\004\000\002\037\004" +
"\000\002\037\004\000\002\037\004\000\002\005\005\000" +
"\002\005\003\000\002\040\003\000\002\040\003\000\002" +
"\030\003\000\002\030\003\000\002\007\003\000\002\007" +
"\003\000\002\007\003\000\002\021\011\000\002\020\013" +
"\000\002\022\015\000\002\060\002\000\002\014\013\000" +
"\002\015\003\000\002\015\003\000\002\015\003\000\002" +
"\046\006\000\002\061\002\000\002\016\014\000\002\043" +
"\011\000\002\024\004\000\002\024\003\000\002\025\010" +
"\000\002\003\012\000\002\044\003\000\002\044\003\000" +
"\002\045\006\000\002\045\004\000\002\004\006\000\002" +
"\004\007\000\002\047\003\000\002\047\003\000\002\050" +
"\005\000\002\050\003\000\002\051\003\000\002\051\003" +
"\000\002\051\003\000\002\027\005\000\002\027\004\000" +
"\002\026\005\000\002\026\003\000\002\026\003\000\002" +
"\026\005\000\002\033\003\000\002\033\003\000\002\036" +
"\006\000\002\035\006\000\002\032\003\000\002\056\004" +
"\000\002\056\005\000\002\034\003\000\002\057\005\000" +
"\002\057\005\000\002\057\005\000\002\057\005\000\002" +
"\057\005\000\002\057\003\000\002\057\003\000\002\002" +
"\002" });
/** Access to production table. */
public short[][] production_table() {return _production_table;}
/** Parse-action table. */
protected static final short[][] _action_table =
unpackFromStrings(new String[] {
"\000\265\000\010\002\uffb1\016\007\077\004\001\002\000" +
"\004\074\252\001\002\000\004\002\251\001\002\000\010" +
"\002\uffb1\016\007\077\004\001\002\000\004\034\013\001" +
"\002\000\010\002\uffb1\016\007\077\004\001\002\000\004" +
"\002\ufffe\001\002\000\004\002\001\001\002\000\034\006" +
"\053\011\031\017\030\021\021\025\036\026\023\027\044" +
"\035\uffb1\052\046\055\027\074\041\077\035\100\045\001" +
"\002\000\004\031\ufff8\001\002\000\006\030\uffe4\035\uffe4" +
"\001\002\000\006\030\ufffa\035\ufffa\001\002\000\016\031" +
"\uffb9\045\114\053\113\054\115\056\112\060\116\001\002" +
"\000\004\031\247\001\002\000\004\032\241\001\002\000" +
"\004\031\ufff3\001\002\000\004\032\236\001\002\000\004" +
"\035\235\001\002\000\004\031\ufff5\001\002\000\006\030" +
"\uffe8\035\uffe8\001\002\000\004\074\234\001\002\000\004" +
"\032\215\001\002\000\004\032\165\001\002\000\004\074" +
"\160\001\002\000\006\030\uffe5\035\uffe5\001\002\000\006" +
"\030\ufff9\035\ufff9\001\002\000\004\074\155\001\002\000" +
"\004\034\145\001\002\000\006\030\uffe7\035\uffe7\001\002" +
"\000\006\030\uffe6\035\uffe6\001\002\000\030\024\127\031" +
"\uffb2\032\125\045\uffb2\046\126\052\073\053\uffb2\054\uffb2" +
"\055\072\056\uffb2\060\uffb2\001\002\000\006\030\ufffb\035" +
"\ufffb\001\002\000\004\031\ufff4\001\002\000\004\032\106" +
"\001\002\000\020\031\uffb3\033\uffb3\045\uffb3\053\uffb3\054" +
"\uffb3\056\uffb3\060\uffb3\001\002\000\004\074\105\001\002" +
"\000\010\031\uffbc\074\103\100\045\001\002\000\004\031" +
"\ufff7\001\002\000\004\031\100\001\002\000\004\031\uffeb" +
"\001\002\000\004\032\055\001\002\000\004\031\ufff6\001" +
"\002\000\004\077\035\001\002\000\004\031\057\001\002" +
"\000\010\014\060\015\061\074\063\001\002\000\006\031" +
"\uffc3\033\uffc3\001\002\000\006\031\uffc2\033\uffc2\001\002" +
"\000\004\031\067\001\002\000\004\047\064\001\002\000" +
"\006\074\065\100\066\001\002\000\006\031\uffc4\033\uffc4" +
"\001\002\000\006\031\uffc1\033\uffc1\001\002\000\010\052" +
"\046\055\027\074\071\001\002\000\004\033\074\001\002" +
"\000\006\052\073\055\072\001\002\000\006\031\uffee\033" +
"\uffee\001\002\000\006\031\ufff0\033\ufff0\001\002\000\004" +
"\034\075\001\002\000\034\006\053\011\031\017\030\021" +
"\021\025\036\026\023\027\044\035\uffb1\052\046\055\027" +
"\074\041\077\035\100\045\001\002\000\004\035\077\001" +
"\002\000\006\030\uffe1\035\uffe1\001\002\000\036\006\053" +
"\011\031\017\030\021\021\025\036\026\023\027\044\030" +
"\uffb1\035\uffb1\052\046\055\027\074\041\077\035\100\045" +
"\001\002\000\006\030\ufffc\035\ufffc\001\002\000\004\031" +
"\104\001\002\000\020\031\uffb2\033\uffb2\045\uffb2\053\uffb2" +
"\054\uffb2\056\uffb2\060\uffb2\001\002\000\010\031\uffba\074" +
"\uffba\100\uffba\001\002\000\006\031\uffef\033\uffef\001\002" +
"\000\010\074\103\075\110\100\045\001\002\000\004\033" +
"\124\001\002\000\004\033\uffc0\001\002\000\016\033\uffbf" +
"\045\114\053\113\054\115\056\112\060\116\001\002\000" +
"\006\074\103\100\045\001\002\000\006\074\103\100\045" +
"\001\002\000\006\074\103\100\045\001\002\000\006\074" +
"\103\100\045\001\002\000\006\074\103\100\045\001\002" +
"\000\020\031\uffb5\033\uffb5\045\114\053\uffb5\054\uffb5\056" +
"\uffb5\060\uffb5\001\002\000\020\031\uffb7\033\uffb7\045\114" +
"\053\uffb7\054\uffb7\056\112\060\116\001\002\000\020\031" +
"\uffb4\033\uffb4\045\114\053\uffb4\054\uffb4\056\uffb4\060\uffb4" +
"\001\002\000\020\031\uffb8\033\uffb8\045\114\053\uffb8\054" +
"\uffb8\056\112\060\116\001\002\000\020\031\uffb6\033\uffb6" +
"\045\114\053\uffb6\054\uffb6\056\uffb6\060\uffb6\001\002\000" +
"\004\031\uffbe\001\002\000\012\033\uffb1\074\140\075\136" +
"\100\141\001\002\000\010\074\103\075\131\100\045\001" +
"\002\000\004\074\uffc5\001\002\000\004\031\uffec\001\002" +
"\000\004\031\uffea\001\002\000\016\031\uffe9\045\114\053" +
"\113\054\115\056\112\060\116\001\002\000\006\033\uffcd" +
"\043\143\001\002\000\006\033\uffca\043\uffca\001\002\000" +
"\004\033\uffcc\001\002\000\006\033\uffc8\043\uffc8\001\002" +
"\000\004\033\142\001\002\000\006\033\uffc7\043\uffc7\001" +
"\002\000\006\033\uffc9\043\uffc9\001\002\000\004\031\uffcf" +
"\001\002\000\010\074\140\075\136\100\141\001\002\000" +
"\006\033\uffcb\043\uffcb\001\002\000\034\006\053\011\031" +
"\017\030\021\021\025\036\026\023\027\044\035\uffb1\052" +
"\046\055\027\074\041\077\035\100\045\001\002\000\004" +
"\035\147\001\002\000\004\021\150\001\002\000\004\032" +
"\151\001\002\000\010\014\060\015\061\074\063\001\002" +
"\000\004\033\153\001\002\000\004\031\154\001\002\000" +
"\006\030\uffe2\035\uffe2\001\002\000\006\031\ufff1\046\156" +
"\001\002\000\010\074\103\075\131\100\045\001\002\000" +
"\004\031\ufff2\001\002\000\006\024\162\032\161\001\002" +
"\000\012\033\uffb1\074\140\075\136\100\141\001\002\000" +
"\004\074\uffc6\001\002\000\004\033\164\001\002\000\004" +
"\031\uffce\001\002\000\010\014\060\015\061\074\063\001" +
"\002\000\004\033\167\001\002\000\004\034\170\001\002" +
"\000\034\006\053\011\031\017\030\021\021\025\036\026" +
"\023\027\044\035\uffb1\052\046\055\027\074\041\077\035" +
"\100\045\001\002\000\004\035\172\001\002\000\010\012" +
"\uffe0\030\uffe0\035\uffe0\001\002\000\010\012\175\030\uffb1" +
"\035\uffb1\001\002\000\006\030\uffdd\035\uffdd\001\002\000" +
"\006\011\201\034\202\001\002\000\006\030\uffdf\035\uffdf" +
"\001\002\000\006\030\uffde\035\uffde\001\002\000\006\030" +
"\uffdc\035\uffdc\001\002\000\004\032\205\001\002\000\034" +
"\006\053\011\031\017\030\021\021\025\036\026\023\027" +
"\044\035\uffb1\052\046\055\027\074\041\077\035\100\045" +
"\001\002\000\004\035\204\001\002\000\006\030\uffdb\035" +
"\uffdb\001\002\000\010\014\060\015\061\074\063\001\002" +
"\000\004\033\207\001\002\000\004\034\210\001\002\000" +
"\034\006\053\011\031\017\030\021\021\025\036\026\023" +
"\027\044\035\uffb1\052\046\055\027\074\041\077\035\100" +
"\045\001\002\000\004\035\212\001\002\000\010\012\uffda" +
"\030\uffda\035\uffda\001\002\000\010\012\175\030\uffb1\035" +
"\uffb1\001\002\000\006\030\uffd9\035\uffd9\001\002\000\004" +
"\074\216\001\002\000\004\033\217\001\002\000\004\034" +
"\220\001\002\000\006\020\223\035\uffb1\001\002\000\004" +
"\035\233\001\002\000\004\035\uffd6\001\002\000\004\100" +
"\226\001\002\000\006\020\223\035\uffb1\001\002\000\004" +
"\035\uffd7\001\002\000\004\042\227\001\002\000\034\006" +
"\053\011\031\017\030\021\021\025\036\026\023\027\044" +
"\030\uffb1\052\046\055\027\074\041\077\035\100\045\001" +
"\002\000\004\030\231\001\002\000\004\031\232\001\002" +
"\000\006\020\uffd5\035\uffd5\001\002\000\006\030\uffd8\035" +
"\uffd8\001\002\000\006\031\uffed\033\uffed\001\002\000\010" +
"\002\ufffd\016\ufffd\077\ufffd\001\002\000\006\074\103\100" +
"\045\001\002\000\016\033\240\045\114\053\113\054\115" +
"\056\112\060\116\001\002\000\004\031\uffbd\001\002\000" +
"\010\014\060\015\061\074\063\001\002\000\004\033\243" +
"\001\002\000\004\034\244\001\002\000\034\006\053\011" +
"\031\017\030\021\021\025\036\026\023\027\044\035\uffb1" +
"\052\046\055\027\074\041\077\035\100\045\001\002\000" +
"\004\035\246\001\002\000\006\030\uffe3\035\uffe3\001\002" +
"\000\010\031\uffbb\074\uffbb\100\uffbb\001\002\000\004\002" +
"\uffff\001\002\000\004\002\000\001\002\000\004\032\253" +
"\001\002\000\006\033\uffb1\077\255\001\002\000\006\033" +
"\uffd3\043\265\001\002\000\004\074\264\001\002\000\004" +
"\033\260\001\002\000\004\033\uffd2\001\002\000\004\034" +
"\261\001\002\000\034\006\053\011\031\017\030\021\021" +
"\025\036\026\023\027\044\035\uffb1\052\046\055\027\074" +
"\041\077\035\100\045\001\002\000\004\035\263\001\002" +
"\000\010\002\uffd4\016\uffd4\077\uffd4\001\002\000\006\033" +
"\uffd0\043\uffd0\001\002\000\004\077\266\001\002\000\004" +
"\074\267\001\002\000\006\033\uffd1\043\uffd1\001\002" });
/** Access to parse-action table. */
public short[][] action_table() {return _action_table;}
/** <code>reduce_goto</code> table. */
protected static final short[][] _reduce_table =
unpackFromStrings(new String[] {
"\000\265\000\012\002\010\003\007\041\005\042\004\001" +
"\001\000\002\001\001\000\002\001\001\000\012\002\010" +
"\003\007\041\005\042\247\001\001\000\002\001\001\000" +
"\012\002\010\003\007\041\005\042\011\001\001\000\002" +
"\001\001\000\002\001\001\000\054\002\033\004\047\005" +
"\013\007\015\010\023\011\050\013\021\014\025\020\014" +
"\021\037\022\032\027\031\030\041\032\053\034\017\035" +
"\024\036\042\037\051\043\036\056\046\057\016\001\001" +
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\002\001\001\000\002\001\001\000\002\001" +
"\001\000\002\001\001\000\002\001\001\000\002\001\001" +
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\002\001\001\000\002\001\001\000\002\001" +
"\001\000\002\001\001\000\002\001\001\000\002\001\001" +
"\000\002\001\001\000\006\034\101\057\016\001\001\000" +
"\002\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\002\001\001\000\004\013\055\001\001\000" +
"\002\001\001\000\004\026\061\001\001\000\002\001\001" +
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001\000\002\001\001\000\004" +
"\037\067\001\001\000\002\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001\000\002\001\001\000\054" +
"\002\033\004\047\005\013\007\015\010\075\011\050\013" +
"\021\014\025\020\014\021\037\022\032\027\031\030\041" +
"\032\053\034\017\035\024\036\042\037\051\043\036\056" +
"\046\057\016\001\001\000\002\001\001\000\002\001\001" +
"\000\054\002\033\004\047\005\013\007\015\010\100\011" +
"\050\013\021\014\025\020\014\021\037\022\032\027\031" +
"\030\041\032\053\034\017\035\024\036\042\037\051\043" +
"\036\056\046\057\016\001\001\000\002\001\001\000\002" +
"\001\001\000\002\001\001\000\002\001\001\000\002\001" +
"\001\000\006\033\106\057\110\001\001\000\002\001\001" +
"\000\002\001\001\000\002\001\001\000\004\057\122\001" +
"\001\000\004\057\121\001\001\000\004\057\120\001\001" +
"\000\004\057\117\001\001\000\004\057\116\001\001\000" +
"\002\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\002\001\001\000\002\001\001\000\012\002" +
"\134\047\136\050\132\051\133\001\001\000\006\040\127" +
"\057\131\001\001\000\002\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\002\001\001\000\002\001\001\000\002\001" +
"\001\000\002\001\001\000\002\001\001\000\002\001\001" +
"\000\004\051\143\001\001\000\002\001\001\000\054\002" +
"\033\004\047\005\013\007\015\010\145\011\050\013\021" +
"\014\025\020\014\021\037\022\032\027\031\030\041\032" +
"\053\034\017\035\024\036\042\037\051\043\036\056\046" +
"\057\016\001\001\000\002\001\001\000\002\001\001\000" +
"\002\001\001\000\004\026\151\001\001\000\002\001\001" +
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
"\006\040\156\057\131\001\001\000\002\001\001\000\002" +
"\001\001\000\012\002\134\047\162\050\132\051\133\001" +
"\001\000\002\001\001\000\002\001\001\000\002\001\001" +
"\000\004\026\165\001\001\000\002\001\001\000\002\001" +
"\001\000\054\002\033\004\047\005\013\007\015\010\170" +
"\011\050\013\021\014\025\020\014\021\037\022\032\027" +
"\031\030\041\032\053\034\017\035\024\036\042\037\051" +
"\043\036\056\046\057\016\001\001\000\002\001\001\000" +
"\004\060\172\001\001\000\012\002\177\015\175\016\173" +
"\046\176\001\001\000\002\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\054\002\033\004\047\005\013\007\015\010" +
"\202\011\050\013\021\014\025\020\014\021\037\022\032" +
"\027\031\030\041\032\053\034\017\035\024\036\042\037" +
"\051\043\036\056\046\057\016\001\001\000\002\001\001" +
"\000\002\001\001\000\004\026\205\001\001\000\002\001" +
"\001\000\002\001\001\000\054\002\033\004\047\005\013" +
"\007\015\010\210\011\050\013\021\014\025\020\014\021" +
"\037\022\032\027\031\030\041\032\053\034\017\035\024" +
"\036\042\037\051\043\036\056\046\057\016\001\001\000" +
"\002\001\001\000\004\061\212\001\001\000\012\002\177" +
"\015\213\016\173\046\176\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001\000\002\001\001\000\010" +
"\002\221\024\220\025\223\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001\000\010\002\221\024\224" +
"\025\223\001\001\000\002\001\001\000\002\001\001\000" +
"\054\002\033\004\047\005\013\007\015\010\227\011\050" +
"\013\021\014\025\020\014\021\037\022\032\027\031\030" +
"\041\032\053\034\017\035\024\036\042\037\051\043\036" +
"\056\046\057\016\001\001\000\002\001\001\000\002\001" +
"\001\000\002\001\001\000\002\001\001\000\002\001\001" +
"\000\002\001\001\000\004\057\236\001\001\000\002\001" +
"\001\000\002\001\001\000\004\026\241\001\001\000\002" +
"\001\001\000\002\001\001\000\054\002\033\004\047\005" +
"\013\007\015\010\244\011\050\013\021\014\025\020\014" +
"\021\037\022\032\027\031\030\041\032\053\034\017\035" +
"\024\036\042\037\051\043\036\056\046\057\016\001\001" +
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001\000\002\001\001\000\010" +
"\002\256\044\255\045\253\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\054\002\033\004\047\005\013\007\015\010" +
"\261\011\050\013\021\014\025\020\014\021\037\022\032" +
"\027\031\030\041\032\053\034\017\035\024\036\042\037" +
"\051\043\036\056\046\057\016\001\001\000\002\001\001" +
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001" });
/** Access to <code>reduce_goto</code> table. */
public short[][] reduce_table() {return _reduce_table;}
/** Instance of action encapsulation class. */
protected CUP$Parser$actions action_obj;
/** Action encapsulation object initializer. */
protected void init_actions()
{
action_obj = new CUP$Parser$actions(this);
}
/** Invoke a user supplied parse action. */
public java_cup.runtime.Symbol do_action(
int act_num,
java_cup.runtime.lr_parser parser,
java.util.Stack stack,
int top)
throws java.lang.Exception
{
/* call code in generated class */
return action_obj.CUP$Parser$do_action(act_num, parser, stack, top);
}
/** Indicates start state. */
public int start_state() {return 0;}
/** Indicates start production. */
public int start_production() {return 1;}
/** <code>EOF</code> Symbol index. */
public int EOF_sym() {return 0;}
/** <code>error</code> Symbol index. */
public int error_sym() {return 1;}
/** User initialization code. */
public void user_init() throws java.lang.Exception
{
/* s.init(); */
}
/** Scan to get the next Symbol. */
public java_cup.runtime.Symbol scan()
throws java.lang.Exception
{
return s.next_token();
}
Lexer s;
Parser(Lexer s) { this.s = s;}
/** Cup generated class to encapsulate user supplied action code.*/
@SuppressWarnings({"rawtypes", "unchecked", "unused"})
class CUP$Parser$actions {
Map<String, Tuple<Integer, Object>> sourceTypes = new HashMap();
Map<String, ArrayList<Integer>> sourceSignatures = new HashMap();
public String regularName(Integer type){
if(type == Constants.TypeInt) return "Integer";
if(type == Constants.TypeString) return "String";
return "";
}
public String argTypeWriter(ArrayList<Integer> list){
String type = "";
for(int i = 0; i < list.size() - 1; i++){
type += regularName(list.get(i)) + ", ";
}
type += regularName(list.get(list.size() - 1));
return type;
}
public void argCheck(ArrayList<Integer> arg1, ArrayList<Integer> arg2, String funcName){
if(arg1 == null || arg2 == null) {
System.out.println("Function \'" + funcName + "\' doesn't exist in the current context." );
return;
}
if(arg1.size() != arg2.size())
System.out.println("Method signature mismatch! \'" + funcName + "\' defined with " + arg1.size() + " arguments. You've provided " + arg2.size() + " arguments.");
else{
boolean isCorrect = true;
Integer provided = 0;
Integer expected = 0;
for(int i = 0; i < arg1.size(); i++){
if(!arg1.get(i).equals(arg2.get(i))) {
expected = arg1.get(i); provided = arg2.get(i);
isCorrect =false; break;
}
}
if(isCorrect)
System.out.println("Method call with name \'" + funcName + "\' was ok!");
else
System.out.println("Method call mismatch! Expected arg type: \'" + regularName(expected) + "\', provided: \'" + regularName(provided));
}
}
public void ClearScreen(Double SleepTime) throws IOException, InterruptedException
{
try {
for (int j = 0; j < SleepTime+1 ; j++)
{
// The main thread sleeps for the 1000 milliseconds, which is 1 sec
// whenever the loop runs
Thread.sleep(1000);
// displaying the value of the variable
System.out.println(j);
}
// System.out.print("\033[H\033[2J");
// System.out.flush();
System.out.println();
System.out.println();
System.out.println();
System.out.println();
System.out.println();
System.out.println();
System.out.println();
}
catch (Exception expn)
{
System.out.println(expn);
}
}
private final Parser parser;
/** Constructor */
CUP$Parser$actions(Parser parser) {
this.parser = parser;
}
/** Method 0 with the actual generated action code for actions 0 to 300. */
public final java_cup.runtime.Symbol CUP$Parser$do_action_part00000000(
int CUP$Parser$act_num,
java_cup.runtime.lr_parser CUP$Parser$parser,
java.util.Stack CUP$Parser$stack,
int CUP$Parser$top)
throws java.lang.Exception
{
/* Symbol object for return from actions */
java_cup.runtime.Symbol CUP$Parser$result;
/* select the action based on the action number */
switch (CUP$Parser$act_num)
{
/*. . . . . . . . . . . . . . . . . . . .*/
case 0: // Code ::= MethodDeclare Code
{
Object RESULT =null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("Code",32, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 1: // $START ::= Code EOF
{
Object RESULT =null;
int start_valleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)).left;
int start_valright = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)).right;
Object start_val = (Object)((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-1)).value;
RESULT = start_val;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("$START",0, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
/* ACCEPT */
CUP$Parser$parser.done_parsing();
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 2: // Code ::= EntryBlock Code
{
Object RESULT =null;
System.out.println("Entry Block");
CUP$Parser$result = parser.getSymbolFactory().newSymbol("Code",32, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 3: // Code ::= empty
{
Object RESULT =null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("Code",32, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 4: // EntryBlock ::= EntryPoint OBLOCK Statements CBLOCK
{
Object RESULT =null;
System.out.println(">> Code entry point");
CUP$Parser$result = parser.getSymbolFactory().newSymbol("EntryBlock",31, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-3)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 5: // Statements ::= Statement SEMICOLON Statements
{
Object RESULT =null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("Statements",6, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 6: // Statements ::= ConditionalStatement
{
Object RESULT =null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("Statements",6, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 7: // Statements ::= Loop
{
Object RESULT =null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("Statements",6, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 8: // Statements ::= empty
{
Object RESULT =null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("Statements",6, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 9: // Statement ::= Assignment
{
Object RESULT =null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("Statement",7, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 10: // Statement ::= MethodCall
{
Object RESULT =null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("Statement",7, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 11: // Statement ::= CalculationStatement
{
Object RESULT =null;
System.out.println("This is Calc Statement");
CUP$Parser$result = parser.getSymbolFactory().newSymbol("Statement",7, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 12: // Statement ::= ClearStatement
{
Object RESULT =null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("Statement",7, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 13: // Statement ::= PrintlnStatement
{
Object RESULT =null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("Statement",7, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 14: // Statement ::= Declaration
{
Object RESULT =null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("Statement",7, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 15: // Declaration ::= Type Identifier ASSIGN AssignmentVal
{
Object RESULT =null;
int tleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-3)).left;
int tright = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-3)).right;
Integer t = (Integer)((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-3)).value;
int ileft = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)).left;
int iright = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)).right;
String i = (String)((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-2)).value;
int vleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).left;
int vright = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).right;
TypeValuePair v = (TypeValuePair)((java_cup.runtime.Symbol) CUP$Parser$stack.peek()).value;
if (sourceTypes.containsKey(i)){
System.out.println(i + " was already declared");
}
else
{
sourceTypes.put(i, new Tuple(v.Type, v.Value));
System.out.println(">> New variable declared with name \'" + i + "\' with value \'" + v.Value + "\'!");
}
CUP$Parser$result = parser.getSymbolFactory().newSymbol("Declaration",9, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-3)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 16: // Declaration ::= Type Identifier
{
Object RESULT =null;
int tleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)).left;
int tright = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)).right;
Integer t = (Integer)((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-1)).value;
int ileft = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).left;
int iright = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).right;
String i = (String)((java_cup.runtime.Symbol) CUP$Parser$stack.peek()).value;
if (sourceTypes.containsKey(i)){
System.out.println(i + " was already declared");
}
else {
sourceTypes.put(i, new Tuple(t, null));
System.out.println("New Declaration without assignment");
}
CUP$Parser$result = parser.getSymbolFactory().newSymbol("Declaration",9, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 17: // UpdateaAssignment ::= Identifier PLUSPLUS
{
Object RESULT =null;
int ileft = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)).left;
int iright = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)).right;
String i = (String)((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-1)).value;
System.out.println("Variable \'" + i + "\' incremented.");
CUP$Parser$result = parser.getSymbolFactory().newSymbol("UpdateaAssignment",29, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 18: // UpdateaAssignment ::= PLUSPLUS Identifier
{
Object RESULT =null;
int ileft = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)).left;
int iright = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)).right;
Object i = (Object)((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-1)).value;
System.out.println("Variable \'" + i + "\' incremented.");
CUP$Parser$result = parser.getSymbolFactory().newSymbol("UpdateaAssignment",29, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 19: // UpdateaAssignment ::= Identifier MINUSMINUS
{
Object RESULT =null;
int ileft = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)).left;
int iright = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)).right;
String i = (String)((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-1)).value;
System.out.println("Variable \'" + i + "\' decremented.");
CUP$Parser$result = parser.getSymbolFactory().newSymbol("UpdateaAssignment",29, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 20: // UpdateaAssignment ::= MINUSMINUS Identifier
{
Object RESULT =null;
int ileft = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).left;
int iright = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).right;
String i = (String)((java_cup.runtime.Symbol) CUP$Parser$stack.peek()).value;
System.out.println("Variable \'" + i + "\' decremented.");
CUP$Parser$result = parser.getSymbolFactory().newSymbol("UpdateaAssignment",29, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 21: // Assignment ::= Identifier ASSIGN AssignmentVal
{
Object RESULT =null;
int ileft = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)).left;
int iright = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)).right;
String i = (String)((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-2)).value;
int bleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).left;
int bright = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).right;
TypeValuePair b = (TypeValuePair)((java_cup.runtime.Symbol) CUP$Parser$stack.peek()).value;
System.out.println("Assigning Value \'" + b.Value +"\' to \'" + i + "\'!");
if(!sourceTypes.get(i).getElement0().equals(b.Type)){
System.out.println("error: Type '" + regularName(b.Type) + "' doesn't match type '" + regularName(sourceTypes.get(i).getElement0()) + "'.");
}
else{
System.out.println("Assignment was ok.");
sourceTypes.get(i).setElement1((Object)b.Value);
}
CUP$Parser$result = parser.getSymbolFactory().newSymbol("Assignment",3, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 22: // Assignment ::= UpdateaAssignment
{
Object RESULT =null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("Assignment",3, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 23: // AssignmentVal ::= StringConst
{
TypeValuePair RESULT =null;
int ileft = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).left;
int iright = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).right;
String i = (String)((java_cup.runtime.Symbol) CUP$Parser$stack.peek()).value;
RESULT = new TypeValuePair(i, Constants.TypeString);
CUP$Parser$result = parser.getSymbolFactory().newSymbol("AssignmentVal",30, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 24: // AssignmentVal ::= expr
{
TypeValuePair RESULT =null;
int ileft = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).left;
int iright = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).right;
Double i = (Double)((java_cup.runtime.Symbol) CUP$Parser$stack.peek()).value;
RESULT = new TypeValuePair("" + i, Constants.TypeInt);
CUP$Parser$result = parser.getSymbolFactory().newSymbol("AssignmentVal",30, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 25: // ConditionalStatement ::= IfStatement
{
Object RESULT =null;
System.out.println("ConditionalStatement statement");
CUP$Parser$result = parser.getSymbolFactory().newSymbol("ConditionalStatement",22, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 26: // ConditionalStatement ::= SwitchStatement
{
Object RESULT =null;
System.out.println("New switch statement");
CUP$Parser$result = parser.getSymbolFactory().newSymbol("ConditionalStatement",22, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 27: // Loop ::= WhileStatement
{
Object RESULT =null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("Loop",5, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 28: // Loop ::= ForStatement
{
Object RESULT =null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("Loop",5, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 29: // Loop ::= DoStatement
{
Object RESULT =null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("Loop",5, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 30: // WhileStatement ::= WHILE OPAR Condition CPAR OBLOCK Statements CBLOCK
{
Object RESULT =null;
System.out.println("This is While Statement");
CUP$Parser$result = parser.getSymbolFactory().newSymbol("WhileStatement",15, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-6)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 31: // DoStatement ::= DO OBLOCK Statements CBLOCK WHILE OPAR Condition CPAR SEMICOLON
{
Object RESULT =null;
System.out.println("Do Statement");
CUP$Parser$result = parser.getSymbolFactory().newSymbol("DoStatement",14, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-8)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 32: // ForStatement ::= FOR OPAR Declaration SEMICOLON Condition SEMICOLON UpdateaAssignment CPAR OBLOCK Statements CBLOCK
{
Object RESULT =null;
System.out.println("for");
CUP$Parser$result = parser.getSymbolFactory().newSymbol("ForStatement",16, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-10)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 33: // NT$0 ::=
{
Object RESULT =null;
System.out.println("If statement");
CUP$Parser$result = parser.getSymbolFactory().newSymbol("NT$0",46, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 34: // IfStatement ::= IF OPAR Condition CPAR OBLOCK Statements CBLOCK NT$0 ElseStatement
{
Object RESULT =null;
// propagate RESULT from NT$0
RESULT = (Object) ((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-1)).value;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("IfStatement",10, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-8)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 35: // ElseStatement ::= OneElseStatement
{
Object RESULT =null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("ElseStatement",11, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 36: // ElseStatement ::= ElseIfStatement
{
Object RESULT =null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("ElseStatement",11, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 37: // ElseStatement ::= empty
{
Object RESULT =null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("ElseStatement",11, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 38: // OneElseStatement ::= ELSE OBLOCK Statements CBLOCK
{
Object RESULT =null;
System.out.println("also else statement");
CUP$Parser$result = parser.getSymbolFactory().newSymbol("OneElseStatement",36, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-3)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 39: // NT$1 ::=
{
Object RESULT =null;
System.out.println("also elsif statement/statements");
CUP$Parser$result = parser.getSymbolFactory().newSymbol("NT$1",47, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 40: // ElseIfStatement ::= ELSE IF OPAR Condition CPAR OBLOCK Statements CBLOCK NT$1 ElseStatement
{
Object RESULT =null;
// propagate RESULT from NT$1
RESULT = (Object) ((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-1)).value;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("ElseIfStatement",12, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-9)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 41: // SwitchStatement ::= SWITCH OPAR Identifier CPAR OBLOCK SwitchCases CBLOCK
{
Object RESULT =null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("SwitchStatement",33, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-6)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 42: // SwitchCases ::= SwitchCase SwitchCases
{
Object RESULT =null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("SwitchCases",18, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 43: // SwitchCases ::= empty
{
Object RESULT =null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("SwitchCases",18, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 44: // SwitchCase ::= CASE NumValue COLON Statements BREAK SEMICOLON
{
Object RESULT =null;
System.out.println(" final switch statement");
CUP$Parser$result = parser.getSymbolFactory().newSymbol("SwitchCase",19, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-5)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 45: // MethodDeclare ::= Type Identifier OPAR MethodSignature CPAR OBLOCK Statements CBLOCK
{
Object RESULT =null;
int ileft = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-6)).left;
int iright = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-6)).right;
String i = (String)((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-6)).value;
int sleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-4)).left;
int sright = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-4)).right;
ArrayList<Integer> s = (ArrayList<Integer>)((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-4)).value;
if(s == null) sourceSignatures.put(i, null);
else sourceSignatures.put(i, s);
System.out.println(">> Method " + i.toString() + " Declared! with arg types: " + argTypeWriter(s));
System.out.println("Method Declared");
CUP$Parser$result = parser.getSymbolFactory().newSymbol("MethodDeclare",1, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-7)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 46: // MethodSignature ::= Signature
{
ArrayList<Integer> RESULT =null;
int sleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).left;
int sright = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).right;
ArrayList<Integer> s = (ArrayList<Integer>)((java_cup.runtime.Symbol) CUP$Parser$stack.peek()).value;
RESULT = s;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("MethodSignature",34, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 47: // MethodSignature ::= empty
{
ArrayList<Integer> RESULT =null;
RESULT = null;
CUP$Parser$result = parser.getSymbolFactory().newSymbol("MethodSignature",34, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT);
}
return CUP$Parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 48: // Signature ::= Signature COMMA Type Identifier
{
ArrayList<Integer> RESULT =null;
int sleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-3)).left;
int sright = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-3)).right;
ArrayList<Integer> s = (ArrayList<Integer>)((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-3)).value;
int tleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)).left;
int tright = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)).right;
Integer t = (Integer)((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-1)).value;