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