-
Notifications
You must be signed in to change notification settings - Fork 1
/
MiniJava_syntax.output
4007 lines (2544 loc) · 103 KB
/
MiniJava_syntax.output
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
Grammar
0 $accept: program $end
1 program: main_class class_decl_list
2 | main_class
3 main_class: CLASS ID O_BR PUBLIC STATIC VOID MAIN O_PAREN STRING O_SQ C_SQ ID C_PAREN O_BR statement C_BR C_BR
4 class_decl_list: class_decl_list class_decl
5 | class_decl
6 class_decl: CLASS ID O_BR var_decl_list method_decl_list C_BR
7 | CLASS ID EXTENDS ID O_BR var_decl_list method_decl_list C_BR
8 | CLASS ID O_BR var_decl_list C_BR
9 | CLASS ID EXTENDS ID O_BR var_decl_list C_BR
10 | CLASS ID O_BR method_decl_list C_BR
11 | CLASS ID EXTENDS ID O_BR method_decl_list C_BR
12 | CLASS ID O_BR C_BR
13 | CLASS ID EXTENDS ID O_BR C_BR
14 var_decl_list: var_decl_list var_decl
15 | var_decl
16 var_decl: INT ID SEMI
17 | BOOL ID SEMI
18 | ID ID SEMI
19 | INT type_bracket_list ID SEMI
20 | BOOL type_bracket_list ID SEMI
21 | ID type_bracket_list ID SEMI
22 var_decl_exp_list: var_decl_exp_list var_decl_exp SEMI
23 | var_decl_exp_list var_decl
24 | var_decl_exp SEMI
25 | var_decl
26 var_decl_exp: INT ID EQUAL full_exp
27 | BOOL ID EQUAL full_exp
28 | ID ID EQUAL full_exp
29 | INT type_bracket_list ID EQUAL NEW prime_type index
30 | BOOL type_bracket_list ID EQUAL NEW prime_type index
31 | ID type_bracket_list ID EQUAL NEW prime_type index
32 type_bracket_list: type_bracket_list O_SQ C_SQ
33 | O_SQ C_SQ
34 method_decl_list: method_decl_list method_decl
35 | method_decl
36 method_decl: PUBLIC type ID O_PAREN formal_list C_PAREN O_BR var_decl_list statement_list RETURN full_exp SEMI C_BR
37 | PUBLIC type ID O_PAREN C_PAREN O_BR var_decl_list statement_list RETURN full_exp SEMI C_BR
38 | PUBLIC type ID O_PAREN formal_list C_PAREN O_BR statement_list RETURN full_exp SEMI C_BR
39 | PUBLIC type ID O_PAREN C_PAREN O_BR statement_list RETURN full_exp SEMI C_BR
40 | PUBLIC type ID O_PAREN formal_list C_PAREN O_BR var_decl_list RETURN full_exp SEMI C_BR
41 | PUBLIC type ID O_PAREN C_PAREN O_BR var_decl_list RETURN full_exp SEMI C_BR
42 | PUBLIC type ID O_PAREN formal_list C_PAREN O_BR RETURN full_exp SEMI C_BR
43 | PUBLIC type ID O_PAREN C_PAREN O_BR RETURN full_exp SEMI C_BR
44 formal_list: type ID formal_rest_list
45 | type ID
46 formal_rest_list: formal_rest_list formal_rest
47 | formal_rest
48 formal_rest: COMMA type ID
49 type: prime_type
50 | type O_SQ C_SQ
51 prime_type: INT
52 | BOOL
53 | ID
54 statement_list: statement_list statement
55 | statement
56 statement: O_BR C_BR
57 | O_BR statement_list C_BR
58 | O_BR var_decl_exp_list C_BR
59 | O_BR var_decl_exp_list statement_list C_BR
60 | IF O_PAREN full_exp C_PAREN statement ELSE statement
61 | WHILE O_PAREN full_exp C_PAREN statement
62 | FOR O_PAREN var_decl_exp SEMI full_exp SEMI ID EQUAL full_exp C_PAREN statement
63 | PRINT_STATE O_PAREN full_exp C_PAREN SEMI
64 | PRINT_STATE O_PAREN STRING_LITERAL C_PAREN SEMI
65 | PRINT_STATE_LN O_PAREN full_exp C_PAREN SEMI
66 | PRINT_STATE_LN O_PAREN STRING_LITERAL C_PAREN SEMI
67 | ID EQUAL full_exp SEMI
68 | ID index EQUAL full_exp SEMI
69 | RETURN full_exp SEMI
70 index: O_SQ full_exp C_SQ
71 | index O_SQ full_exp C_SQ
72 full_exp: or_term
73 or_term: and_term
74 | or_term OR and_term
75 and_term: eq_term
76 | and_term AND eq_term
77 eq_term: gr_le_term
78 | eq_term EQEQ gr_le_term
79 | eq_term N_EQ gr_le_term
80 gr_le_term: add_term
81 | gr_le_term LESS add_term
82 | gr_le_term GREAT add_term
83 | gr_le_term L_EQ add_term
84 | gr_le_term G_EQ add_term
85 add_term: mul_term
86 | add_term PLUS mul_term
87 | add_term MINUS mul_term
88 mul_term: un_op
89 | mul_term DIV un_op
90 | mul_term MUL un_op
91 un_op: exp
92 | NOT un_op
93 | PLUS un_op
94 | MINUS un_op
95 exp: ID
96 | ID index
97 | ID DOT LENGTH
98 | ID index DOT LENGTH
99 | INTEGER_LITERAL
100 | TRUE
101 | FALSE
102 | object
103 | ID DOT ID O_PAREN exp_list C_PAREN
104 | object DOT ID O_PAREN exp_list C_PAREN
105 | ID DOT ID O_PAREN C_PAREN
106 | object DOT ID O_PAREN C_PAREN
107 | O_PAREN full_exp C_PAREN
108 object: THIS
109 | NEW ID O_PAREN C_PAREN
110 | NEW prime_type index
111 exp_rest_list: exp_rest_list exp_rest
112 | exp_rest
113 exp_list: full_exp exp_rest_list
114 | full_exp
115 exp_rest: COMMA full_exp
Terminals, with rules where they appear
$end (0) 0
error (256)
INTEGER_LITERAL <in_l> (258) 99
STRING_LITERAL <st_l> (259) 64 66
ID <id> (260) 3 6 7 8 9 10 11 12 13 16 17 18 19 20 21 26 27 28 29 30 31 36 37 38 39 40 41 42 43 44 45 48 53 62 67 68 95 96 97 98 103 104 105 106 109
THIS (261) 108
NEW (262) 29 30 31 109 110
EXTENDS (263) 7 9 11 13
RETURN (264) 36 37 38 39 40 41 42 43 69
LENGTH (265) 97 98
PRINT_STATE (266) 63 64
PRINT_STATE_LN (267) 65 66
IF (268) 60
ELSE (269) 60
FOR (270) 62
WHILE (271) 61
STRING (272) 3
CLASS (273) 3 6 7 8 9 10 11 12 13
MAIN (274) 3
STATIC (275) 3
VOID (276) 3
PUBLIC (277) 3 36 37 38 39 40 41 42 43
SEMI (278) 16 17 18 19 20 21 22 24 36 37 38 39 40 41 42 43 62 63 64 65 66 67 68 69
COMMA (279) 48 115
NOT (280) 92
PLUS (281) 86 93
MINUS (282) 87 94
EQUAL (283) 26 27 28 29 30 31 62 67 68
TRUE (284) 100
FALSE (285) 101
DOT (286) 97 98 103 104 105 106
O_PAREN (287) 3 36 37 38 39 40 41 42 43 60 61 62 63 64 65 66 103 104 105 106 107 109
C_PAREN (288) 3 36 37 38 39 40 41 42 43 60 61 62 63 64 65 66 103 104 105 106 107 109
O_BR (289) 3 6 7 8 9 10 11 12 13 36 37 38 39 40 41 42 43 56 57 58 59
C_BR (290) 3 6 7 8 9 10 11 12 13 36 37 38 39 40 41 42 43 56 57 58 59
O_SQ (291) 3 32 33 50 70 71
C_SQ (292) 3 32 33 50 70 71
INT (293) 16 19 26 29 51
BOOL (294) 17 20 27 30 52
AND (295) 76
OR (296) 74
G_EQ (297) 84
L_EQ (298) 83
EQEQ (299) 78
N_EQ (300) 79
GREAT (301) 82
LESS (302) 81
MUL (303) 90
DIV (304) 89
Nonterminals, with rules where they appear
$accept (50)
on left: 0
program <node> (51)
on left: 1 2
on right: 0
main_class <main> (52)
on left: 3
on right: 1 2
class_decl_list <cdl> (53)
on left: 4 5
on right: 1 4
class_decl <cd> (54)
on left: 6 7 8 9 10 11 12 13
on right: 4 5
var_decl_list <vdl> (55)
on left: 14 15
on right: 6 7 8 9 14 36 37 40 41
var_decl <vd> (56)
on left: 16 17 18 19 20 21
on right: 14 15 23 25
var_decl_exp_list <vdel> (57)
on left: 22 23 24 25
on right: 22 23 58 59
var_decl_exp <vde> (58)
on left: 26 27 28 29 30 31
on right: 22 24 62
type_bracket_list <tp_i> (59)
on left: 32 33
on right: 19 20 21 29 30 31 32
method_decl_list <mdl> (60)
on left: 34 35
on right: 6 7 10 11 34
method_decl <md> (61)
on left: 36 37 38 39 40 41 42 43
on right: 34 35
formal_list <fl> (62)
on left: 44 45
on right: 36 38 40 42
formal_rest_list <frl> (63)
on left: 46 47
on right: 44 46
formal_rest <fr> (64)
on left: 48
on right: 46 47
type <type> (65)
on left: 49 50
on right: 36 37 38 39 40 41 42 43 44 45 48 50
prime_type <prt> (66)
on left: 51 52 53
on right: 29 30 31 49 110
statement_list <sl> (67)
on left: 54 55
on right: 36 37 38 39 54 57 59
statement <s> (68)
on left: 56 57 58 59 60 61 62 63 64 65 66 67 68 69
on right: 3 54 55 60 61 62
index <i> (69)
on left: 70 71
on right: 29 30 31 68 71 96 98 110
full_exp <e> (70)
on left: 72
on right: 26 27 28 36 37 38 39 40 41 42 43 60 61 62 63 65 67 68 69 70 71 107 113 114 115
or_term <e> (71)
on left: 73 74
on right: 72 74
and_term <e> (72)
on left: 75 76
on right: 73 74 76
eq_term <e> (73)
on left: 77 78 79
on right: 75 76 78 79
gr_le_term <e> (74)
on left: 80 81 82 83 84
on right: 77 78 79 81 82 83 84
add_term <e> (75)
on left: 85 86 87
on right: 80 81 82 83 84 86 87
mul_term <e> (76)
on left: 88 89 90
on right: 85 86 87 89 90
un_op <e> (77)
on left: 91 92 93 94
on right: 88 89 90 92 93 94
exp <e> (78)
on left: 95 96 97 98 99 100 101 102 103 104 105 106 107
on right: 91
object <obj> (79)
on left: 108 109 110
on right: 102 104 106
exp_rest_list <erl> (80)
on left: 111 112
on right: 111 113
exp_list <el> (81)
on left: 113 114
on right: 103 104
exp_rest <er> (82)
on left: 115
on right: 111 112
State 0
0 $accept: • program $end
CLASS shift, and go to state 1
program go to state 2
main_class go to state 3
State 1
3 main_class: CLASS • ID O_BR PUBLIC STATIC VOID MAIN O_PAREN STRING O_SQ C_SQ ID C_PAREN O_BR statement C_BR C_BR
ID shift, and go to state 4
State 2
0 $accept: program • $end
$end shift, and go to state 5
State 3
1 program: main_class • class_decl_list
2 | main_class •
CLASS shift, and go to state 6
$default reduce using rule 2 (program)
class_decl_list go to state 7
class_decl go to state 8
State 4
3 main_class: CLASS ID • O_BR PUBLIC STATIC VOID MAIN O_PAREN STRING O_SQ C_SQ ID C_PAREN O_BR statement C_BR C_BR
O_BR shift, and go to state 9
State 5
0 $accept: program $end •
$default accept
State 6
6 class_decl: CLASS • ID O_BR var_decl_list method_decl_list C_BR
7 | CLASS • ID EXTENDS ID O_BR var_decl_list method_decl_list C_BR
8 | CLASS • ID O_BR var_decl_list C_BR
9 | CLASS • ID EXTENDS ID O_BR var_decl_list C_BR
10 | CLASS • ID O_BR method_decl_list C_BR
11 | CLASS • ID EXTENDS ID O_BR method_decl_list C_BR
12 | CLASS • ID O_BR C_BR
13 | CLASS • ID EXTENDS ID O_BR C_BR
ID shift, and go to state 10
State 7
1 program: main_class class_decl_list •
4 class_decl_list: class_decl_list • class_decl
CLASS shift, and go to state 6
$default reduce using rule 1 (program)
class_decl go to state 11
State 8
5 class_decl_list: class_decl •
$default reduce using rule 5 (class_decl_list)
State 9
3 main_class: CLASS ID O_BR • PUBLIC STATIC VOID MAIN O_PAREN STRING O_SQ C_SQ ID C_PAREN O_BR statement C_BR C_BR
PUBLIC shift, and go to state 12
State 10
6 class_decl: CLASS ID • O_BR var_decl_list method_decl_list C_BR
7 | CLASS ID • EXTENDS ID O_BR var_decl_list method_decl_list C_BR
8 | CLASS ID • O_BR var_decl_list C_BR
9 | CLASS ID • EXTENDS ID O_BR var_decl_list C_BR
10 | CLASS ID • O_BR method_decl_list C_BR
11 | CLASS ID • EXTENDS ID O_BR method_decl_list C_BR
12 | CLASS ID • O_BR C_BR
13 | CLASS ID • EXTENDS ID O_BR C_BR
EXTENDS shift, and go to state 13
O_BR shift, and go to state 14
State 11
4 class_decl_list: class_decl_list class_decl •
$default reduce using rule 4 (class_decl_list)
State 12
3 main_class: CLASS ID O_BR PUBLIC • STATIC VOID MAIN O_PAREN STRING O_SQ C_SQ ID C_PAREN O_BR statement C_BR C_BR
STATIC shift, and go to state 15
State 13
7 class_decl: CLASS ID EXTENDS • ID O_BR var_decl_list method_decl_list C_BR
9 | CLASS ID EXTENDS • ID O_BR var_decl_list C_BR
11 | CLASS ID EXTENDS • ID O_BR method_decl_list C_BR
13 | CLASS ID EXTENDS • ID O_BR C_BR
ID shift, and go to state 16
State 14
6 class_decl: CLASS ID O_BR • var_decl_list method_decl_list C_BR
8 | CLASS ID O_BR • var_decl_list C_BR
10 | CLASS ID O_BR • method_decl_list C_BR
12 | CLASS ID O_BR • C_BR
ID shift, and go to state 17
PUBLIC shift, and go to state 18
C_BR shift, and go to state 19
INT shift, and go to state 20
BOOL shift, and go to state 21
var_decl_list go to state 22
var_decl go to state 23
method_decl_list go to state 24
method_decl go to state 25
State 15
3 main_class: CLASS ID O_BR PUBLIC STATIC • VOID MAIN O_PAREN STRING O_SQ C_SQ ID C_PAREN O_BR statement C_BR C_BR
VOID shift, and go to state 26
State 16
7 class_decl: CLASS ID EXTENDS ID • O_BR var_decl_list method_decl_list C_BR
9 | CLASS ID EXTENDS ID • O_BR var_decl_list C_BR
11 | CLASS ID EXTENDS ID • O_BR method_decl_list C_BR
13 | CLASS ID EXTENDS ID • O_BR C_BR
O_BR shift, and go to state 27
State 17
18 var_decl: ID • ID SEMI
21 | ID • type_bracket_list ID SEMI
ID shift, and go to state 28
O_SQ shift, and go to state 29
type_bracket_list go to state 30
State 18
36 method_decl: PUBLIC • type ID O_PAREN formal_list C_PAREN O_BR var_decl_list statement_list RETURN full_exp SEMI C_BR
37 | PUBLIC • type ID O_PAREN C_PAREN O_BR var_decl_list statement_list RETURN full_exp SEMI C_BR
38 | PUBLIC • type ID O_PAREN formal_list C_PAREN O_BR statement_list RETURN full_exp SEMI C_BR
39 | PUBLIC • type ID O_PAREN C_PAREN O_BR statement_list RETURN full_exp SEMI C_BR
40 | PUBLIC • type ID O_PAREN formal_list C_PAREN O_BR var_decl_list RETURN full_exp SEMI C_BR
41 | PUBLIC • type ID O_PAREN C_PAREN O_BR var_decl_list RETURN full_exp SEMI C_BR
42 | PUBLIC • type ID O_PAREN formal_list C_PAREN O_BR RETURN full_exp SEMI C_BR
43 | PUBLIC • type ID O_PAREN C_PAREN O_BR RETURN full_exp SEMI C_BR
ID shift, and go to state 31
INT shift, and go to state 32
BOOL shift, and go to state 33
type go to state 34
prime_type go to state 35
State 19
12 class_decl: CLASS ID O_BR C_BR •
$default reduce using rule 12 (class_decl)
State 20
16 var_decl: INT • ID SEMI
19 | INT • type_bracket_list ID SEMI
ID shift, and go to state 36
O_SQ shift, and go to state 29
type_bracket_list go to state 37
State 21
17 var_decl: BOOL • ID SEMI
20 | BOOL • type_bracket_list ID SEMI
ID shift, and go to state 38
O_SQ shift, and go to state 29
type_bracket_list go to state 39
State 22
6 class_decl: CLASS ID O_BR var_decl_list • method_decl_list C_BR
8 | CLASS ID O_BR var_decl_list • C_BR
14 var_decl_list: var_decl_list • var_decl
ID shift, and go to state 17
PUBLIC shift, and go to state 18
C_BR shift, and go to state 40
INT shift, and go to state 20
BOOL shift, and go to state 21
var_decl go to state 41
method_decl_list go to state 42
method_decl go to state 25
State 23
15 var_decl_list: var_decl •
$default reduce using rule 15 (var_decl_list)
State 24
10 class_decl: CLASS ID O_BR method_decl_list • C_BR
34 method_decl_list: method_decl_list • method_decl
PUBLIC shift, and go to state 18
C_BR shift, and go to state 43
method_decl go to state 44
State 25
35 method_decl_list: method_decl •
$default reduce using rule 35 (method_decl_list)
State 26
3 main_class: CLASS ID O_BR PUBLIC STATIC VOID • MAIN O_PAREN STRING O_SQ C_SQ ID C_PAREN O_BR statement C_BR C_BR
MAIN shift, and go to state 45
State 27
7 class_decl: CLASS ID EXTENDS ID O_BR • var_decl_list method_decl_list C_BR
9 | CLASS ID EXTENDS ID O_BR • var_decl_list C_BR
11 | CLASS ID EXTENDS ID O_BR • method_decl_list C_BR
13 | CLASS ID EXTENDS ID O_BR • C_BR
ID shift, and go to state 17
PUBLIC shift, and go to state 18
C_BR shift, and go to state 46
INT shift, and go to state 20
BOOL shift, and go to state 21
var_decl_list go to state 47
var_decl go to state 23
method_decl_list go to state 48
method_decl go to state 25
State 28
18 var_decl: ID ID • SEMI
SEMI shift, and go to state 49
State 29
33 type_bracket_list: O_SQ • C_SQ
C_SQ shift, and go to state 50
State 30
21 var_decl: ID type_bracket_list • ID SEMI
32 type_bracket_list: type_bracket_list • O_SQ C_SQ
ID shift, and go to state 51
O_SQ shift, and go to state 52
State 31
53 prime_type: ID •
$default reduce using rule 53 (prime_type)
State 32
51 prime_type: INT •
$default reduce using rule 51 (prime_type)
State 33
52 prime_type: BOOL •
$default reduce using rule 52 (prime_type)
State 34
36 method_decl: PUBLIC type • ID O_PAREN formal_list C_PAREN O_BR var_decl_list statement_list RETURN full_exp SEMI C_BR
37 | PUBLIC type • ID O_PAREN C_PAREN O_BR var_decl_list statement_list RETURN full_exp SEMI C_BR
38 | PUBLIC type • ID O_PAREN formal_list C_PAREN O_BR statement_list RETURN full_exp SEMI C_BR
39 | PUBLIC type • ID O_PAREN C_PAREN O_BR statement_list RETURN full_exp SEMI C_BR
40 | PUBLIC type • ID O_PAREN formal_list C_PAREN O_BR var_decl_list RETURN full_exp SEMI C_BR
41 | PUBLIC type • ID O_PAREN C_PAREN O_BR var_decl_list RETURN full_exp SEMI C_BR
42 | PUBLIC type • ID O_PAREN formal_list C_PAREN O_BR RETURN full_exp SEMI C_BR
43 | PUBLIC type • ID O_PAREN C_PAREN O_BR RETURN full_exp SEMI C_BR
50 type: type • O_SQ C_SQ
ID shift, and go to state 53
O_SQ shift, and go to state 54
State 35
49 type: prime_type •
$default reduce using rule 49 (type)
State 36
16 var_decl: INT ID • SEMI
SEMI shift, and go to state 55
State 37
19 var_decl: INT type_bracket_list • ID SEMI
32 type_bracket_list: type_bracket_list • O_SQ C_SQ
ID shift, and go to state 56
O_SQ shift, and go to state 52
State 38
17 var_decl: BOOL ID • SEMI
SEMI shift, and go to state 57
State 39
20 var_decl: BOOL type_bracket_list • ID SEMI
32 type_bracket_list: type_bracket_list • O_SQ C_SQ
ID shift, and go to state 58
O_SQ shift, and go to state 52
State 40
8 class_decl: CLASS ID O_BR var_decl_list C_BR •
$default reduce using rule 8 (class_decl)
State 41
14 var_decl_list: var_decl_list var_decl •
$default reduce using rule 14 (var_decl_list)
State 42
6 class_decl: CLASS ID O_BR var_decl_list method_decl_list • C_BR
34 method_decl_list: method_decl_list • method_decl
PUBLIC shift, and go to state 18
C_BR shift, and go to state 59
method_decl go to state 44
State 43
10 class_decl: CLASS ID O_BR method_decl_list C_BR •
$default reduce using rule 10 (class_decl)
State 44
34 method_decl_list: method_decl_list method_decl •
$default reduce using rule 34 (method_decl_list)
State 45
3 main_class: CLASS ID O_BR PUBLIC STATIC VOID MAIN • O_PAREN STRING O_SQ C_SQ ID C_PAREN O_BR statement C_BR C_BR
O_PAREN shift, and go to state 60
State 46
13 class_decl: CLASS ID EXTENDS ID O_BR C_BR •
$default reduce using rule 13 (class_decl)
State 47
7 class_decl: CLASS ID EXTENDS ID O_BR var_decl_list • method_decl_list C_BR
9 | CLASS ID EXTENDS ID O_BR var_decl_list • C_BR
14 var_decl_list: var_decl_list • var_decl
ID shift, and go to state 17
PUBLIC shift, and go to state 18
C_BR shift, and go to state 61
INT shift, and go to state 20
BOOL shift, and go to state 21
var_decl go to state 41
method_decl_list go to state 62
method_decl go to state 25
State 48
11 class_decl: CLASS ID EXTENDS ID O_BR method_decl_list • C_BR
34 method_decl_list: method_decl_list • method_decl
PUBLIC shift, and go to state 18
C_BR shift, and go to state 63
method_decl go to state 44
State 49
18 var_decl: ID ID SEMI •
$default reduce using rule 18 (var_decl)
State 50
33 type_bracket_list: O_SQ C_SQ •
$default reduce using rule 33 (type_bracket_list)
State 51
21 var_decl: ID type_bracket_list ID • SEMI
SEMI shift, and go to state 64
State 52
32 type_bracket_list: type_bracket_list O_SQ • C_SQ
C_SQ shift, and go to state 65
State 53
36 method_decl: PUBLIC type ID • O_PAREN formal_list C_PAREN O_BR var_decl_list statement_list RETURN full_exp SEMI C_BR
37 | PUBLIC type ID • O_PAREN C_PAREN O_BR var_decl_list statement_list RETURN full_exp SEMI C_BR
38 | PUBLIC type ID • O_PAREN formal_list C_PAREN O_BR statement_list RETURN full_exp SEMI C_BR
39 | PUBLIC type ID • O_PAREN C_PAREN O_BR statement_list RETURN full_exp SEMI C_BR
40 | PUBLIC type ID • O_PAREN formal_list C_PAREN O_BR var_decl_list RETURN full_exp SEMI C_BR
41 | PUBLIC type ID • O_PAREN C_PAREN O_BR var_decl_list RETURN full_exp SEMI C_BR
42 | PUBLIC type ID • O_PAREN formal_list C_PAREN O_BR RETURN full_exp SEMI C_BR
43 | PUBLIC type ID • O_PAREN C_PAREN O_BR RETURN full_exp SEMI C_BR
O_PAREN shift, and go to state 66
State 54
50 type: type O_SQ • C_SQ
C_SQ shift, and go to state 67
State 55
16 var_decl: INT ID SEMI •
$default reduce using rule 16 (var_decl)
State 56
19 var_decl: INT type_bracket_list ID • SEMI
SEMI shift, and go to state 68
State 57
17 var_decl: BOOL ID SEMI •
$default reduce using rule 17 (var_decl)
State 58
20 var_decl: BOOL type_bracket_list ID • SEMI
SEMI shift, and go to state 69
State 59
6 class_decl: CLASS ID O_BR var_decl_list method_decl_list C_BR •
$default reduce using rule 6 (class_decl)
State 60
3 main_class: CLASS ID O_BR PUBLIC STATIC VOID MAIN O_PAREN • STRING O_SQ C_SQ ID C_PAREN O_BR statement C_BR C_BR
STRING shift, and go to state 70
State 61
9 class_decl: CLASS ID EXTENDS ID O_BR var_decl_list C_BR •
$default reduce using rule 9 (class_decl)
State 62
7 class_decl: CLASS ID EXTENDS ID O_BR var_decl_list method_decl_list • C_BR
34 method_decl_list: method_decl_list • method_decl
PUBLIC shift, and go to state 18
C_BR shift, and go to state 71
method_decl go to state 44
State 63
11 class_decl: CLASS ID EXTENDS ID O_BR method_decl_list C_BR •
$default reduce using rule 11 (class_decl)
State 64
21 var_decl: ID type_bracket_list ID SEMI •
$default reduce using rule 21 (var_decl)
State 65
32 type_bracket_list: type_bracket_list O_SQ C_SQ •
$default reduce using rule 32 (type_bracket_list)
State 66
36 method_decl: PUBLIC type ID O_PAREN • formal_list C_PAREN O_BR var_decl_list statement_list RETURN full_exp SEMI C_BR
37 | PUBLIC type ID O_PAREN • C_PAREN O_BR var_decl_list statement_list RETURN full_exp SEMI C_BR
38 | PUBLIC type ID O_PAREN • formal_list C_PAREN O_BR statement_list RETURN full_exp SEMI C_BR
39 | PUBLIC type ID O_PAREN • C_PAREN O_BR statement_list RETURN full_exp SEMI C_BR
40 | PUBLIC type ID O_PAREN • formal_list C_PAREN O_BR var_decl_list RETURN full_exp SEMI C_BR
41 | PUBLIC type ID O_PAREN • C_PAREN O_BR var_decl_list RETURN full_exp SEMI C_BR
42 | PUBLIC type ID O_PAREN • formal_list C_PAREN O_BR RETURN full_exp SEMI C_BR
43 | PUBLIC type ID O_PAREN • C_PAREN O_BR RETURN full_exp SEMI C_BR
ID shift, and go to state 31
C_PAREN shift, and go to state 72
INT shift, and go to state 32
BOOL shift, and go to state 33
formal_list go to state 73
type go to state 74
prime_type go to state 35
State 67
50 type: type O_SQ C_SQ •
$default reduce using rule 50 (type)
State 68
19 var_decl: INT type_bracket_list ID SEMI •
$default reduce using rule 19 (var_decl)
State 69
20 var_decl: BOOL type_bracket_list ID SEMI •
$default reduce using rule 20 (var_decl)
State 70
3 main_class: CLASS ID O_BR PUBLIC STATIC VOID MAIN O_PAREN STRING • O_SQ C_SQ ID C_PAREN O_BR statement C_BR C_BR
O_SQ shift, and go to state 75
State 71
7 class_decl: CLASS ID EXTENDS ID O_BR var_decl_list method_decl_list C_BR •
$default reduce using rule 7 (class_decl)
State 72
37 method_decl: PUBLIC type ID O_PAREN C_PAREN • O_BR var_decl_list statement_list RETURN full_exp SEMI C_BR
39 | PUBLIC type ID O_PAREN C_PAREN • O_BR statement_list RETURN full_exp SEMI C_BR
41 | PUBLIC type ID O_PAREN C_PAREN • O_BR var_decl_list RETURN full_exp SEMI C_BR
43 | PUBLIC type ID O_PAREN C_PAREN • O_BR RETURN full_exp SEMI C_BR
O_BR shift, and go to state 76
State 73
36 method_decl: PUBLIC type ID O_PAREN formal_list • C_PAREN O_BR var_decl_list statement_list RETURN full_exp SEMI C_BR
38 | PUBLIC type ID O_PAREN formal_list • C_PAREN O_BR statement_list RETURN full_exp SEMI C_BR
40 | PUBLIC type ID O_PAREN formal_list • C_PAREN O_BR var_decl_list RETURN full_exp SEMI C_BR
42 | PUBLIC type ID O_PAREN formal_list • C_PAREN O_BR RETURN full_exp SEMI C_BR
C_PAREN shift, and go to state 77
State 74
44 formal_list: type • ID formal_rest_list
45 | type • ID
50 type: type • O_SQ C_SQ
ID shift, and go to state 78
O_SQ shift, and go to state 54
State 75
3 main_class: CLASS ID O_BR PUBLIC STATIC VOID MAIN O_PAREN STRING O_SQ • C_SQ ID C_PAREN O_BR statement C_BR C_BR