forked from frankchn/cs143
/
y.output
4543 lines (3375 loc) · 126 KB
/
y.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: DeclList
2 DeclList: DeclList Decl
3 | Decl
4 Decl: VariableDecl
5 | FunctionDecl
6 | ClassDecl
7 | InterfaceDecl
8 VariableDecl: Variable ';'
9 | Variable '=' Expr ';'
10 Variable: Type Identifier
11 Type: T_Int
12 | T_Double
13 | T_Bool
14 | T_String
15 | Identifier
16 | Type T_Dims
17 Identifier: T_Identifier
18 FunctionDecl: Type Identifier '(' OptFormals ')' StmtBlock
19 | T_Void Identifier '(' OptFormals ')' StmtBlock
20 OptFormals: Formals
21 | /* empty */
22 Formals: Variable
23 | Formals ',' Variable
24 ClassDecl: T_Class Identifier ImplementsDecl '{' FieldList '}'
25 | T_Class Identifier T_Extends Identifier ImplementsDecl '{' FieldList '}'
26 ImplementsDecl: T_Implements ImplementsList
27 | /* empty */
28 ImplementsList: Identifier
29 | ImplementsList ',' Identifier
30 FieldList: FieldList Field
31 | /* empty */
32 Field: VariableDecl
33 | FunctionDecl
34 InterfaceDecl: T_Interface Identifier '{' PrototypeList '}'
35 PrototypeList: PrototypeList Prototype
36 | /* empty */
37 Prototype: Type Identifier '(' OptFormals ')' ';'
38 | T_Void Identifier '(' OptFormals ')' ';'
39 StmtBlock: '{' VarDeclList StmtList '}'
40 | '{' StmtList '}'
41 | '{' VarDeclList '}'
42 | '{' '}'
43 | '{' error '}'
44 VarDeclList: VarDeclList VariableDecl
45 | VariableDecl
46 StmtList: StmtList Stmt
47 | Stmt
48 Stmt: PrintStmt
49 | ';'
50 | Expr ';'
51 | IfStmt
52 | WhileStmt
53 | ForStmt
54 | BreakStmt
55 | ReturnStmt
56 | SwitchStmt
57 | StmtBlock
58 | error ';'
59 SwitchStmt: T_Switch '(' Expr ')' '{' CaseStatements DefaultStatement '}'
60 | T_Switch '(' Expr ')' '{' DefaultStatement '}'
61 | T_Switch '(' Expr ')' '{' error '}'
62 CaseStatements: CaseStatements CaseStatement
63 | CaseStatement
64 CaseStatement: T_Case Expr ':' OptStmtList
65 DefaultStatement: T_Default ':' OptStmtList
66 | /* empty */
67 OptStmtList: StmtList
68 | /* empty */
69 IfStmt: T_If '(' Expr ')' Stmt T_Else Stmt
70 | T_If '(' Expr ')' Stmt
71 WhileStmt: T_While '(' Expr ')' Stmt
72 PrintStmt: T_Print '(' ExprList ')' ';'
73 ForStmt: T_For '(' ';' Expr ';' ')' Stmt
74 | T_For '(' Expr ';' Expr ';' ')' Stmt
75 | T_For '(' ';' Expr ';' Expr ')' Stmt
76 | T_For '(' Expr ';' Expr ';' Expr ')' Stmt
77 ReturnStmt: T_Return ';'
78 | T_Return Expr ';'
79 BreakStmt: T_Break ';'
80 ExprList: ExprList ',' Expr
81 | Expr
82 Expr: LValue '=' Expr
83 | LValue
84 | T_StringConstant
85 | T_IntConstant
86 | T_DoubleConstant
87 | T_BoolConstant
88 | T_Null
89 | T_This
90 | Call
91 | '(' Expr ')'
92 | Expr '+' Expr
93 | Expr '-' Expr
94 | Expr '*' Expr
95 | Expr '/' Expr
96 | Expr '%' Expr
97 | '-' Expr
98 | Expr '<' Expr
99 | Expr T_LessEqual Expr
100 | Expr '>' Expr
101 | Expr T_GreaterEqual Expr
102 | Expr T_Equal Expr
103 | Expr T_NotEqual Expr
104 | Expr T_And Expr
105 | Expr T_Or Expr
106 | '!' Expr
107 | LValue T_Increment
108 | LValue T_Decrement
109 | T_ReadInteger '(' ')'
110 | T_ReadLine '(' ')'
111 | T_New Identifier
112 | T_NewArray '(' Expr ',' Type ')'
113 Call: Identifier '(' OptActuals ')'
114 | Expr '.' Identifier '(' OptActuals ')'
115 OptActuals: Actuals
116 | /* empty */
117 Actuals: Expr
118 | Actuals ',' Expr
119 LValue: Identifier
120 | Expr '.' Identifier
121 | Expr '[' Expr ']'
Terminals, with rules where they appear
$end (0) 0
'!' (33) 106
'%' (37) 96
'(' (40) 18 19 37 38 59 60 61 69 70 71 72 73 74 75 76 91 109 110 112
113 114
')' (41) 18 19 37 38 59 60 61 69 70 71 72 73 74 75 76 91 109 110 112
113 114
'*' (42) 94
'+' (43) 92
',' (44) 23 29 80 112 118
'-' (45) 93 97
'.' (46) 114 120
'/' (47) 95
':' (58) 64 65
';' (59) 8 9 37 38 49 50 58 72 73 74 75 76 77 78 79
'<' (60) 98
'=' (61) 9 82
'>' (62) 100
'[' (91) 121
']' (93) 121
'{' (123) 24 25 34 39 40 41 42 43 59 60 61
'}' (125) 24 25 34 39 40 41 42 43 59 60 61
error (256) 43 58 61
T_Void (258) 19 38
T_Bool (259) 13
T_Int (260) 11
T_Double (261) 12
T_String (262) 14
T_Class (263) 24 25
T_LessEqual (264) 99
T_GreaterEqual (265) 101
T_Equal (266) 102
T_NotEqual (267) 103
T_Dims (268) 16
T_And (269) 104
T_Or (270) 105
T_Null (271) 88
T_Extends (272) 25
T_This (273) 89
T_Interface (274) 34
T_Implements (275) 26
T_While (276) 71
T_For (277) 73 74 75 76
T_If (278) 69 70
T_Else (279) 69
T_Return (280) 77 78
T_Break (281) 79
T_New (282) 111
T_NewArray (283) 112
T_Print (284) 72
T_ReadInteger (285) 109
T_ReadLine (286) 110
T_Increment (287) 107
T_Decrement (288) 108
T_Switch (289) 59 60 61
T_Case (290) 64
T_Default (291) 65
T_Identifier (292) 17
T_StringConstant (293) 84
T_IntConstant (294) 85
T_DoubleConstant (295) 86
T_BoolConstant (296) 87
T_UnaryMinus (297)
T_NoElse (298)
Nonterminals, with rules where they appear
$accept (63)
on left: 0
Program (64)
on left: 1, on right: 0
DeclList (65)
on left: 2 3, on right: 1 2
Decl (66)
on left: 4 5 6 7, on right: 2 3
VariableDecl (67)
on left: 8 9, on right: 4 32 44 45
Variable (68)
on left: 10, on right: 8 9 22 23
Type (69)
on left: 11 12 13 14 15 16, on right: 10 16 18 37 112
Identifier (70)
on left: 17, on right: 10 15 18 19 24 25 28 29 34 37 38 111 113
114 119 120
FunctionDecl (71)
on left: 18 19, on right: 5 33
OptFormals (72)
on left: 20 21, on right: 18 19 37 38
Formals (73)
on left: 22 23, on right: 20 23
ClassDecl (74)
on left: 24 25, on right: 6
ImplementsDecl (75)
on left: 26 27, on right: 24 25
ImplementsList (76)
on left: 28 29, on right: 26 29
FieldList (77)
on left: 30 31, on right: 24 25 30
Field (78)
on left: 32 33, on right: 30
InterfaceDecl (79)
on left: 34, on right: 7
PrototypeList (80)
on left: 35 36, on right: 34 35
Prototype (81)
on left: 37 38, on right: 35
StmtBlock (82)
on left: 39 40 41 42 43, on right: 18 19 57
VarDeclList (83)
on left: 44 45, on right: 39 41 44
StmtList (84)
on left: 46 47, on right: 39 40 46 67
Stmt (85)
on left: 48 49 50 51 52 53 54 55 56 57 58, on right: 46 47 69 70
71 73 74 75 76
SwitchStmt (86)
on left: 59 60 61, on right: 56
CaseStatements (87)
on left: 62 63, on right: 59 62
CaseStatement (88)
on left: 64, on right: 62 63
DefaultStatement (89)
on left: 65 66, on right: 59 60
OptStmtList (90)
on left: 67 68, on right: 64 65
IfStmt (91)
on left: 69 70, on right: 51
WhileStmt (92)
on left: 71, on right: 52
PrintStmt (93)
on left: 72, on right: 48
ForStmt (94)
on left: 73 74 75 76, on right: 53
ReturnStmt (95)
on left: 77 78, on right: 55
BreakStmt (96)
on left: 79, on right: 54
ExprList (97)
on left: 80 81, on right: 72 80
Expr (98)
on left: 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,
on right: 9 50 59 60 61 64 69 70 71 73 74 75 76 78 80 81 82 91
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 112 114 117
118 120 121
Call (99)
on left: 113 114, on right: 90
OptActuals (100)
on left: 115 116, on right: 113 114
Actuals (101)
on left: 117 118, on right: 115 118
LValue (102)
on left: 119 120 121, on right: 82 83 107 108
state 0
0 $accept: . Program $end
T_Void shift, and go to state 1
T_Bool shift, and go to state 2
T_Int shift, and go to state 3
T_Double shift, and go to state 4
T_String shift, and go to state 5
T_Class shift, and go to state 6
T_Interface shift, and go to state 7
T_Identifier shift, and go to state 8
Program go to state 9
DeclList go to state 10
Decl go to state 11
VariableDecl go to state 12
Variable go to state 13
Type go to state 14
Identifier go to state 15
FunctionDecl go to state 16
ClassDecl go to state 17
InterfaceDecl go to state 18
state 1
19 FunctionDecl: T_Void . Identifier '(' OptFormals ')' StmtBlock
T_Identifier shift, and go to state 8
Identifier go to state 19
state 2
13 Type: T_Bool .
$default reduce using rule 13 (Type)
state 3
11 Type: T_Int .
$default reduce using rule 11 (Type)
state 4
12 Type: T_Double .
$default reduce using rule 12 (Type)
state 5
14 Type: T_String .
$default reduce using rule 14 (Type)
state 6
24 ClassDecl: T_Class . Identifier ImplementsDecl '{' FieldList '}'
25 | T_Class . Identifier T_Extends Identifier ImplementsDecl '{' FieldList '}'
T_Identifier shift, and go to state 8
Identifier go to state 20
state 7
34 InterfaceDecl: T_Interface . Identifier '{' PrototypeList '}'
T_Identifier shift, and go to state 8
Identifier go to state 21
state 8
17 Identifier: T_Identifier .
$default reduce using rule 17 (Identifier)
state 9
0 $accept: Program . $end
$end shift, and go to state 22
state 10
1 Program: DeclList .
2 DeclList: DeclList . Decl
T_Void shift, and go to state 1
T_Bool shift, and go to state 2
T_Int shift, and go to state 3
T_Double shift, and go to state 4
T_String shift, and go to state 5
T_Class shift, and go to state 6
T_Interface shift, and go to state 7
T_Identifier shift, and go to state 8
$default reduce using rule 1 (Program)
Decl go to state 23
VariableDecl go to state 12
Variable go to state 13
Type go to state 14
Identifier go to state 15
FunctionDecl go to state 16
ClassDecl go to state 17
InterfaceDecl go to state 18
state 11
3 DeclList: Decl .
$default reduce using rule 3 (DeclList)
state 12
4 Decl: VariableDecl .
$default reduce using rule 4 (Decl)
state 13
8 VariableDecl: Variable . ';'
9 | Variable . '=' Expr ';'
'=' shift, and go to state 24
';' shift, and go to state 25
state 14
10 Variable: Type . Identifier
16 Type: Type . T_Dims
18 FunctionDecl: Type . Identifier '(' OptFormals ')' StmtBlock
T_Dims shift, and go to state 26
T_Identifier shift, and go to state 8
Identifier go to state 27
state 15
15 Type: Identifier .
$default reduce using rule 15 (Type)
state 16
5 Decl: FunctionDecl .
$default reduce using rule 5 (Decl)
state 17
6 Decl: ClassDecl .
$default reduce using rule 6 (Decl)
state 18
7 Decl: InterfaceDecl .
$default reduce using rule 7 (Decl)
state 19
19 FunctionDecl: T_Void Identifier . '(' OptFormals ')' StmtBlock
'(' shift, and go to state 28
state 20
24 ClassDecl: T_Class Identifier . ImplementsDecl '{' FieldList '}'
25 | T_Class Identifier . T_Extends Identifier ImplementsDecl '{' FieldList '}'
T_Extends shift, and go to state 29
T_Implements shift, and go to state 30
$default reduce using rule 27 (ImplementsDecl)
ImplementsDecl go to state 31
state 21
34 InterfaceDecl: T_Interface Identifier . '{' PrototypeList '}'
'{' shift, and go to state 32
state 22
0 $accept: Program $end .
$default accept
state 23
2 DeclList: DeclList Decl .
$default reduce using rule 2 (DeclList)
state 24
9 VariableDecl: Variable '=' . Expr ';'
T_Null shift, and go to state 33
T_This shift, and go to state 34
T_New shift, and go to state 35
T_NewArray shift, and go to state 36
T_ReadInteger shift, and go to state 37
T_ReadLine shift, and go to state 38
T_Identifier shift, and go to state 8
T_StringConstant shift, and go to state 39
T_IntConstant shift, and go to state 40
T_DoubleConstant shift, and go to state 41
T_BoolConstant shift, and go to state 42
'-' shift, and go to state 43
'!' shift, and go to state 44
'(' shift, and go to state 45
Identifier go to state 46
Expr go to state 47
Call go to state 48
LValue go to state 49
state 25
8 VariableDecl: Variable ';' .
$default reduce using rule 8 (VariableDecl)
state 26
16 Type: Type T_Dims .
$default reduce using rule 16 (Type)
state 27
10 Variable: Type Identifier .
18 FunctionDecl: Type Identifier . '(' OptFormals ')' StmtBlock
'(' shift, and go to state 50
$default reduce using rule 10 (Variable)
state 28
19 FunctionDecl: T_Void Identifier '(' . OptFormals ')' StmtBlock
T_Bool shift, and go to state 2
T_Int shift, and go to state 3
T_Double shift, and go to state 4
T_String shift, and go to state 5
T_Identifier shift, and go to state 8
$default reduce using rule 21 (OptFormals)
Variable go to state 51
Type go to state 52
Identifier go to state 15
OptFormals go to state 53
Formals go to state 54
state 29
25 ClassDecl: T_Class Identifier T_Extends . Identifier ImplementsDecl '{' FieldList '}'
T_Identifier shift, and go to state 8
Identifier go to state 55
state 30
26 ImplementsDecl: T_Implements . ImplementsList
T_Identifier shift, and go to state 8
Identifier go to state 56
ImplementsList go to state 57
state 31
24 ClassDecl: T_Class Identifier ImplementsDecl . '{' FieldList '}'
'{' shift, and go to state 58
state 32
34 InterfaceDecl: T_Interface Identifier '{' . PrototypeList '}'
$default reduce using rule 36 (PrototypeList)
PrototypeList go to state 59
state 33
88 Expr: T_Null .
$default reduce using rule 88 (Expr)
state 34
89 Expr: T_This .
$default reduce using rule 89 (Expr)
state 35
111 Expr: T_New . Identifier
T_Identifier shift, and go to state 8
Identifier go to state 60
state 36
112 Expr: T_NewArray . '(' Expr ',' Type ')'
'(' shift, and go to state 61
state 37
109 Expr: T_ReadInteger . '(' ')'
'(' shift, and go to state 62
state 38
110 Expr: T_ReadLine . '(' ')'
'(' shift, and go to state 63
state 39
84 Expr: T_StringConstant .
$default reduce using rule 84 (Expr)
state 40
85 Expr: T_IntConstant .
$default reduce using rule 85 (Expr)
state 41
86 Expr: T_DoubleConstant .
$default reduce using rule 86 (Expr)
state 42
87 Expr: T_BoolConstant .
$default reduce using rule 87 (Expr)
state 43
97 Expr: '-' . Expr
T_Null shift, and go to state 33
T_This shift, and go to state 34
T_New shift, and go to state 35
T_NewArray shift, and go to state 36
T_ReadInteger shift, and go to state 37
T_ReadLine shift, and go to state 38
T_Identifier shift, and go to state 8
T_StringConstant shift, and go to state 39
T_IntConstant shift, and go to state 40
T_DoubleConstant shift, and go to state 41
T_BoolConstant shift, and go to state 42
'-' shift, and go to state 43
'!' shift, and go to state 44
'(' shift, and go to state 45
Identifier go to state 46
Expr go to state 64
Call go to state 48
LValue go to state 49
state 44
106 Expr: '!' . Expr
T_Null shift, and go to state 33
T_This shift, and go to state 34
T_New shift, and go to state 35
T_NewArray shift, and go to state 36
T_ReadInteger shift, and go to state 37
T_ReadLine shift, and go to state 38
T_Identifier shift, and go to state 8
T_StringConstant shift, and go to state 39
T_IntConstant shift, and go to state 40
T_DoubleConstant shift, and go to state 41
T_BoolConstant shift, and go to state 42
'-' shift, and go to state 43
'!' shift, and go to state 44
'(' shift, and go to state 45
Identifier go to state 46
Expr go to state 65
Call go to state 48
LValue go to state 49
state 45
91 Expr: '(' . Expr ')'
T_Null shift, and go to state 33
T_This shift, and go to state 34
T_New shift, and go to state 35
T_NewArray shift, and go to state 36
T_ReadInteger shift, and go to state 37
T_ReadLine shift, and go to state 38
T_Identifier shift, and go to state 8
T_StringConstant shift, and go to state 39
T_IntConstant shift, and go to state 40
T_DoubleConstant shift, and go to state 41
T_BoolConstant shift, and go to state 42
'-' shift, and go to state 43
'!' shift, and go to state 44
'(' shift, and go to state 45
Identifier go to state 46
Expr go to state 66
Call go to state 48
LValue go to state 49
state 46
113 Call: Identifier . '(' OptActuals ')'
119 LValue: Identifier .
'(' shift, and go to state 67
$default reduce using rule 119 (LValue)
state 47
9 VariableDecl: Variable '=' Expr . ';'
92 Expr: Expr . '+' Expr
93 | Expr . '-' Expr
94 | Expr . '*' Expr
95 | Expr . '/' Expr
96 | Expr . '%' Expr
98 | Expr . '<' Expr
99 | Expr . T_LessEqual Expr
100 | Expr . '>' Expr
101 | Expr . T_GreaterEqual Expr
102 | Expr . T_Equal Expr
103 | Expr . T_NotEqual Expr
104 | Expr . T_And Expr
105 | Expr . T_Or Expr
114 Call: Expr . '.' Identifier '(' OptActuals ')'
120 LValue: Expr . '.' Identifier
121 | Expr . '[' Expr ']'
T_LessEqual shift, and go to state 68
T_GreaterEqual shift, and go to state 69
T_Equal shift, and go to state 70
T_NotEqual shift, and go to state 71
T_And shift, and go to state 72
T_Or shift, and go to state 73
'<' shift, and go to state 74
'>' shift, and go to state 75
'+' shift, and go to state 76
'-' shift, and go to state 77
'*' shift, and go to state 78
'/' shift, and go to state 79
'%' shift, and go to state 80
'[' shift, and go to state 81
'.' shift, and go to state 82
';' shift, and go to state 83
state 48
90 Expr: Call .
$default reduce using rule 90 (Expr)
state 49
82 Expr: LValue . '=' Expr
83 | LValue .
107 | LValue . T_Increment
108 | LValue . T_Decrement
T_Increment shift, and go to state 84
T_Decrement shift, and go to state 85
'=' shift, and go to state 86
$default reduce using rule 83 (Expr)
state 50
18 FunctionDecl: Type Identifier '(' . OptFormals ')' StmtBlock
T_Bool shift, and go to state 2
T_Int shift, and go to state 3
T_Double shift, and go to state 4
T_String shift, and go to state 5
T_Identifier shift, and go to state 8
$default reduce using rule 21 (OptFormals)
Variable go to state 51
Type go to state 52
Identifier go to state 15
OptFormals go to state 87
Formals go to state 54
state 51
22 Formals: Variable .
$default reduce using rule 22 (Formals)
state 52
10 Variable: Type . Identifier
16 Type: Type . T_Dims
T_Dims shift, and go to state 26
T_Identifier shift, and go to state 8
Identifier go to state 88
state 53
19 FunctionDecl: T_Void Identifier '(' OptFormals . ')' StmtBlock
')' shift, and go to state 89
state 54
20 OptFormals: Formals .
23 Formals: Formals . ',' Variable
',' shift, and go to state 90
$default reduce using rule 20 (OptFormals)
state 55
25 ClassDecl: T_Class Identifier T_Extends Identifier . ImplementsDecl '{' FieldList '}'
T_Implements shift, and go to state 30
$default reduce using rule 27 (ImplementsDecl)
ImplementsDecl go to state 91
state 56
28 ImplementsList: Identifier .
$default reduce using rule 28 (ImplementsList)
state 57
26 ImplementsDecl: T_Implements ImplementsList .
29 ImplementsList: ImplementsList . ',' Identifier
',' shift, and go to state 92
$default reduce using rule 26 (ImplementsDecl)
state 58
24 ClassDecl: T_Class Identifier ImplementsDecl '{' . FieldList '}'
$default reduce using rule 31 (FieldList)
FieldList go to state 93
state 59
34 InterfaceDecl: T_Interface Identifier '{' PrototypeList . '}'
35 PrototypeList: PrototypeList . Prototype
T_Void shift, and go to state 94
T_Bool shift, and go to state 2
T_Int shift, and go to state 3
T_Double shift, and go to state 4
T_String shift, and go to state 5
T_Identifier shift, and go to state 8
'}' shift, and go to state 95
Type go to state 96
Identifier go to state 15
Prototype go to state 97
state 60
111 Expr: T_New Identifier .
$default reduce using rule 111 (Expr)
state 61
112 Expr: T_NewArray '(' . Expr ',' Type ')'
T_Null shift, and go to state 33
T_This shift, and go to state 34
T_New shift, and go to state 35
T_NewArray shift, and go to state 36
T_ReadInteger shift, and go to state 37
T_ReadLine shift, and go to state 38
T_Identifier shift, and go to state 8
T_StringConstant shift, and go to state 39
T_IntConstant shift, and go to state 40
T_DoubleConstant shift, and go to state 41
T_BoolConstant shift, and go to state 42
'-' shift, and go to state 43
'!' shift, and go to state 44