-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparser.out
3351 lines (2626 loc) · 146 KB
/
parser.out
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
Created by PLY version 3.11 (http://www.dabeaz.com/ply)
Unused terminals:
COMMENT
DOT
SEMICOLON
Grammar
Rule 0 S' -> language
Rule 1 language -> mathpy
Rule 2 mathpy -> PROGRAM ID COLON declarations subroutines blocks END
Rule 3 mathpy -> PROGRAM ID COLON declarations subroutines blocks END PROGRAM
Rule 4 mathpy -> PROGRAM ID COLON declarations subroutines blocks END PROGRAM ID
Rule 5 declarations -> type COLON COLON variables declarations
Rule 6 declarations -> empty
Rule 7 type -> INTEGER
Rule 8 type -> REAL
Rule 9 variables -> variables COMMA ID
Rule 10 variables -> variables COMMA ID LPAREN INT RPAREN
Rule 11 variables -> variables COMMA ID LPAREN INT COMMA INT RPAREN
Rule 12 variables -> ID
Rule 13 variables -> ID LPAREN INT RPAREN
Rule 14 variables -> ID LPAREN INT COMMA INT RPAREN
Rule 15 matrix -> ID
Rule 16 matrix -> ID LPAREN INT RPAREN
Rule 17 matrix -> ID LPAREN INT COMMA INT RPAREN
Rule 18 matrix -> ID LPAREN ID RPAREN
Rule 19 matrix -> ID LPAREN ID COMMA ID RPAREN
Rule 20 index -> arithmetic COMMA arithmetic
Rule 21 index -> arithmetic
Rule 22 subroutines -> subroutines SUBROUTINE id_subroutine LPAREN RPAREN blocks END
Rule 23 subroutines -> subroutines SUBROUTINE id_subroutine LPAREN RPAREN blocks END SUBROUTINE
Rule 24 subroutines -> subroutines SUBROUTINE id_subroutine LPAREN RPAREN blocks END SUBROUTINE ID
Rule 25 subroutines -> empty
Rule 26 id_subroutine -> ID
Rule 27 blocks -> blocks assignment
Rule 28 blocks -> blocks if comparison then_if blocks conditionals END IF
Rule 29 blocks -> blocks do blocks IF comparison then_if blocks exit END IF blocks END DO
Rule 30 blocks -> blocks do assignment_do COMMA arithmetic colon blocks END DO
Rule 31 blocks -> blocks do assignment_do COMMA arithmetic colon IF comparison then_if blocks exit END IF blocks END DO
Rule 32 blocks -> blocks ID LPAREN RPAREN
Rule 33 blocks -> blocks READ TIMES COMMA matrix
Rule 34 blocks -> blocks PRINT TIMES COMMA matrix
Rule 35 blocks -> blocks PRINT TIMES COMMA STRING
Rule 36 blocks -> empty
Rule 37 do -> DO
Rule 38 colon -> COLON
Rule 39 assignment_do -> ID ASSIGN arithmetic
Rule 40 exit -> EXIT
Rule 41 if -> IF
Rule 42 then_if -> THEN
Rule 43 conditionals -> else blocks
Rule 44 conditionals -> else IF comparison then_if blocks conditionals
Rule 45 conditionals -> else
Rule 46 else -> ELSE
Rule 47 else -> empty
Rule 48 assignment -> matrix ASSIGN arithmetic
Rule 49 arithmetic -> arithmetic PLUS term
Rule 50 arithmetic -> arithmetic MINUS term
Rule 51 arithmetic -> term
Rule 52 term -> term TIMES factor
Rule 53 term -> term DIVIDE factor
Rule 54 term -> factor
Rule 55 factor -> INT
Rule 56 factor -> FLOAT
Rule 57 factor -> matrix
Rule 58 factor -> LPAREN arithmetic RPAREN
Rule 59 comparison -> comparison OR comparisontwo
Rule 60 comparison -> comparisontwo
Rule 61 comparisontwo -> comparisontwo AND comparisonthree
Rule 62 comparisontwo -> comparisonthree
Rule 63 comparisonthree -> comparisonthree EQ comparisonfour
Rule 64 comparisonthree -> comparisonthree NEQ comparisonfour
Rule 65 comparisonthree -> comparisonthree LT comparisonfour
Rule 66 comparisonthree -> comparisonthree GT comparisonfour
Rule 67 comparisonthree -> comparisonthree LTE comparisonfour
Rule 68 comparisonthree -> comparisonthree GTE comparisonfour
Rule 69 comparisonthree -> comparisonfour
Rule 70 comparisonfour -> INT
Rule 71 comparisonfour -> FLOAT
Rule 72 comparisonfour -> matrix
Rule 73 comparisonfour -> LPAREN arithmetic RPAREN
Rule 74 comparisonfour -> LPAREN comparison RPAREN
Rule 75 empty -> <empty>
Terminals, with rules where they appear
AND : 61
ASSIGN : 39 48
COLON : 2 3 4 5 5 38
COMMA : 9 10 11 11 14 17 19 20 30 31 33 34 35
COMMENT :
DIVIDE : 53
DO : 29 30 31 37
DOT :
ELSE : 46
END : 2 3 4 22 23 24 28 29 29 30 31 31
EQ : 63
EXIT : 40
FLOAT : 56 71
GT : 66
GTE : 68
ID : 2 3 4 4 9 10 11 12 13 14 15 16 17 18 18 19 19 19 24 26 32 39
IF : 28 29 29 31 31 41 44
INT : 10 11 11 13 14 14 16 17 17 55 70
INTEGER : 7
LPAREN : 10 11 13 14 16 17 18 19 22 23 24 32 58 73 74
LT : 65
LTE : 67
MINUS : 50
NEQ : 64
OR : 59
PLUS : 49
PRINT : 34 35
PROGRAM : 2 3 3 4 4
READ : 33
REAL : 8
RPAREN : 10 11 13 14 16 17 18 19 22 23 24 32 58 73 74
SEMICOLON :
STRING : 35
SUBROUTINE : 22 23 23 24 24
THEN : 42
TIMES : 33 34 35 52
error :
Nonterminals, with rules where they appear
arithmetic : 20 20 21 30 31 39 48 49 50 58 73
assignment : 27
assignment_do : 30 31
blocks : 2 3 4 22 23 24 27 28 28 29 29 29 29 30 30 31 31 31 32 33 34 35 43 44
colon : 30 31
comparison : 28 29 31 44 59 74
comparisonfour : 63 64 65 66 67 68 69
comparisonthree : 61 62 63 64 65 66 67 68
comparisontwo : 59 60 61
conditionals : 28 44
declarations : 2 3 4 5
do : 29 30 31
else : 43 44 45
empty : 6 25 36 47
exit : 29 31
factor : 52 53 54
id_subroutine : 22 23 24
if : 28
index :
language : 0
mathpy : 1
matrix : 33 34 48 57 72
subroutines : 2 3 4 22 23 24
term : 49 50 51 52 53
then_if : 28 29 31 44
type : 5
variables : 5 9 10 11
Parsing method: LALR
state 0
(0) S' -> . language
(1) language -> . mathpy
(2) mathpy -> . PROGRAM ID COLON declarations subroutines blocks END
(3) mathpy -> . PROGRAM ID COLON declarations subroutines blocks END PROGRAM
(4) mathpy -> . PROGRAM ID COLON declarations subroutines blocks END PROGRAM ID
PROGRAM shift and go to state 3
language shift and go to state 1
mathpy shift and go to state 2
state 1
(0) S' -> language .
state 2
(1) language -> mathpy .
$end reduce using rule 1 (language -> mathpy .)
state 3
(2) mathpy -> PROGRAM . ID COLON declarations subroutines blocks END
(3) mathpy -> PROGRAM . ID COLON declarations subroutines blocks END PROGRAM
(4) mathpy -> PROGRAM . ID COLON declarations subroutines blocks END PROGRAM ID
ID shift and go to state 4
state 4
(2) mathpy -> PROGRAM ID . COLON declarations subroutines blocks END
(3) mathpy -> PROGRAM ID . COLON declarations subroutines blocks END PROGRAM
(4) mathpy -> PROGRAM ID . COLON declarations subroutines blocks END PROGRAM ID
COLON shift and go to state 5
state 5
(2) mathpy -> PROGRAM ID COLON . declarations subroutines blocks END
(3) mathpy -> PROGRAM ID COLON . declarations subroutines blocks END PROGRAM
(4) mathpy -> PROGRAM ID COLON . declarations subroutines blocks END PROGRAM ID
(5) declarations -> . type COLON COLON variables declarations
(6) declarations -> . empty
(7) type -> . INTEGER
(8) type -> . REAL
(75) empty -> .
INTEGER shift and go to state 9
REAL shift and go to state 10
SUBROUTINE reduce using rule 75 (empty -> .)
END reduce using rule 75 (empty -> .)
ID reduce using rule 75 (empty -> .)
READ reduce using rule 75 (empty -> .)
PRINT reduce using rule 75 (empty -> .)
IF reduce using rule 75 (empty -> .)
DO reduce using rule 75 (empty -> .)
declarations shift and go to state 6
type shift and go to state 7
empty shift and go to state 8
state 6
(2) mathpy -> PROGRAM ID COLON declarations . subroutines blocks END
(3) mathpy -> PROGRAM ID COLON declarations . subroutines blocks END PROGRAM
(4) mathpy -> PROGRAM ID COLON declarations . subroutines blocks END PROGRAM ID
(22) subroutines -> . subroutines SUBROUTINE id_subroutine LPAREN RPAREN blocks END
(23) subroutines -> . subroutines SUBROUTINE id_subroutine LPAREN RPAREN blocks END SUBROUTINE
(24) subroutines -> . subroutines SUBROUTINE id_subroutine LPAREN RPAREN blocks END SUBROUTINE ID
(25) subroutines -> . empty
(75) empty -> .
SUBROUTINE reduce using rule 75 (empty -> .)
END reduce using rule 75 (empty -> .)
ID reduce using rule 75 (empty -> .)
READ reduce using rule 75 (empty -> .)
PRINT reduce using rule 75 (empty -> .)
IF reduce using rule 75 (empty -> .)
DO reduce using rule 75 (empty -> .)
subroutines shift and go to state 11
empty shift and go to state 12
state 7
(5) declarations -> type . COLON COLON variables declarations
COLON shift and go to state 13
state 8
(6) declarations -> empty .
SUBROUTINE reduce using rule 6 (declarations -> empty .)
END reduce using rule 6 (declarations -> empty .)
ID reduce using rule 6 (declarations -> empty .)
READ reduce using rule 6 (declarations -> empty .)
PRINT reduce using rule 6 (declarations -> empty .)
IF reduce using rule 6 (declarations -> empty .)
DO reduce using rule 6 (declarations -> empty .)
state 9
(7) type -> INTEGER .
COLON reduce using rule 7 (type -> INTEGER .)
state 10
(8) type -> REAL .
COLON reduce using rule 8 (type -> REAL .)
state 11
(2) mathpy -> PROGRAM ID COLON declarations subroutines . blocks END
(3) mathpy -> PROGRAM ID COLON declarations subroutines . blocks END PROGRAM
(4) mathpy -> PROGRAM ID COLON declarations subroutines . blocks END PROGRAM ID
(22) subroutines -> subroutines . SUBROUTINE id_subroutine LPAREN RPAREN blocks END
(23) subroutines -> subroutines . SUBROUTINE id_subroutine LPAREN RPAREN blocks END SUBROUTINE
(24) subroutines -> subroutines . SUBROUTINE id_subroutine LPAREN RPAREN blocks END SUBROUTINE ID
(27) blocks -> . blocks assignment
(28) blocks -> . blocks if comparison then_if blocks conditionals END IF
(29) blocks -> . blocks do blocks IF comparison then_if blocks exit END IF blocks END DO
(30) blocks -> . blocks do assignment_do COMMA arithmetic colon blocks END DO
(31) blocks -> . blocks do assignment_do COMMA arithmetic colon IF comparison then_if blocks exit END IF blocks END DO
(32) blocks -> . blocks ID LPAREN RPAREN
(33) blocks -> . blocks READ TIMES COMMA matrix
(34) blocks -> . blocks PRINT TIMES COMMA matrix
(35) blocks -> . blocks PRINT TIMES COMMA STRING
(36) blocks -> . empty
(75) empty -> .
SUBROUTINE shift and go to state 15
END reduce using rule 75 (empty -> .)
ID reduce using rule 75 (empty -> .)
READ reduce using rule 75 (empty -> .)
PRINT reduce using rule 75 (empty -> .)
IF reduce using rule 75 (empty -> .)
DO reduce using rule 75 (empty -> .)
blocks shift and go to state 14
empty shift and go to state 16
state 12
(25) subroutines -> empty .
SUBROUTINE reduce using rule 25 (subroutines -> empty .)
END reduce using rule 25 (subroutines -> empty .)
ID reduce using rule 25 (subroutines -> empty .)
READ reduce using rule 25 (subroutines -> empty .)
PRINT reduce using rule 25 (subroutines -> empty .)
IF reduce using rule 25 (subroutines -> empty .)
DO reduce using rule 25 (subroutines -> empty .)
state 13
(5) declarations -> type COLON . COLON variables declarations
COLON shift and go to state 17
state 14
(2) mathpy -> PROGRAM ID COLON declarations subroutines blocks . END
(3) mathpy -> PROGRAM ID COLON declarations subroutines blocks . END PROGRAM
(4) mathpy -> PROGRAM ID COLON declarations subroutines blocks . END PROGRAM ID
(27) blocks -> blocks . assignment
(28) blocks -> blocks . if comparison then_if blocks conditionals END IF
(29) blocks -> blocks . do blocks IF comparison then_if blocks exit END IF blocks END DO
(30) blocks -> blocks . do assignment_do COMMA arithmetic colon blocks END DO
(31) blocks -> blocks . do assignment_do COMMA arithmetic colon IF comparison then_if blocks exit END IF blocks END DO
(32) blocks -> blocks . ID LPAREN RPAREN
(33) blocks -> blocks . READ TIMES COMMA matrix
(34) blocks -> blocks . PRINT TIMES COMMA matrix
(35) blocks -> blocks . PRINT TIMES COMMA STRING
(48) assignment -> . matrix ASSIGN arithmetic
(41) if -> . IF
(37) do -> . DO
(15) matrix -> . ID
(16) matrix -> . ID LPAREN INT RPAREN
(17) matrix -> . ID LPAREN INT COMMA INT RPAREN
(18) matrix -> . ID LPAREN ID RPAREN
(19) matrix -> . ID LPAREN ID COMMA ID RPAREN
END shift and go to state 19
ID shift and go to state 18
READ shift and go to state 25
PRINT shift and go to state 27
IF shift and go to state 22
DO shift and go to state 24
assignment shift and go to state 20
if shift and go to state 21
do shift and go to state 23
matrix shift and go to state 26
state 15
(22) subroutines -> subroutines SUBROUTINE . id_subroutine LPAREN RPAREN blocks END
(23) subroutines -> subroutines SUBROUTINE . id_subroutine LPAREN RPAREN blocks END SUBROUTINE
(24) subroutines -> subroutines SUBROUTINE . id_subroutine LPAREN RPAREN blocks END SUBROUTINE ID
(26) id_subroutine -> . ID
ID shift and go to state 29
id_subroutine shift and go to state 28
state 16
(36) blocks -> empty .
END reduce using rule 36 (blocks -> empty .)
ID reduce using rule 36 (blocks -> empty .)
READ reduce using rule 36 (blocks -> empty .)
PRINT reduce using rule 36 (blocks -> empty .)
IF reduce using rule 36 (blocks -> empty .)
DO reduce using rule 36 (blocks -> empty .)
ELSE reduce using rule 36 (blocks -> empty .)
EXIT reduce using rule 36 (blocks -> empty .)
state 17
(5) declarations -> type COLON COLON . variables declarations
(9) variables -> . variables COMMA ID
(10) variables -> . variables COMMA ID LPAREN INT RPAREN
(11) variables -> . variables COMMA ID LPAREN INT COMMA INT RPAREN
(12) variables -> . ID
(13) variables -> . ID LPAREN INT RPAREN
(14) variables -> . ID LPAREN INT COMMA INT RPAREN
ID shift and go to state 31
variables shift and go to state 30
state 18
(32) blocks -> blocks ID . LPAREN RPAREN
(15) matrix -> ID .
(16) matrix -> ID . LPAREN INT RPAREN
(17) matrix -> ID . LPAREN INT COMMA INT RPAREN
(18) matrix -> ID . LPAREN ID RPAREN
(19) matrix -> ID . LPAREN ID COMMA ID RPAREN
LPAREN shift and go to state 32
ASSIGN reduce using rule 15 (matrix -> ID .)
state 19
(2) mathpy -> PROGRAM ID COLON declarations subroutines blocks END .
(3) mathpy -> PROGRAM ID COLON declarations subroutines blocks END . PROGRAM
(4) mathpy -> PROGRAM ID COLON declarations subroutines blocks END . PROGRAM ID
$end reduce using rule 2 (mathpy -> PROGRAM ID COLON declarations subroutines blocks END .)
PROGRAM shift and go to state 33
state 20
(27) blocks -> blocks assignment .
END reduce using rule 27 (blocks -> blocks assignment .)
ID reduce using rule 27 (blocks -> blocks assignment .)
READ reduce using rule 27 (blocks -> blocks assignment .)
PRINT reduce using rule 27 (blocks -> blocks assignment .)
IF reduce using rule 27 (blocks -> blocks assignment .)
DO reduce using rule 27 (blocks -> blocks assignment .)
ELSE reduce using rule 27 (blocks -> blocks assignment .)
EXIT reduce using rule 27 (blocks -> blocks assignment .)
state 21
(28) blocks -> blocks if . comparison then_if blocks conditionals END IF
(59) comparison -> . comparison OR comparisontwo
(60) comparison -> . comparisontwo
(61) comparisontwo -> . comparisontwo AND comparisonthree
(62) comparisontwo -> . comparisonthree
(63) comparisonthree -> . comparisonthree EQ comparisonfour
(64) comparisonthree -> . comparisonthree NEQ comparisonfour
(65) comparisonthree -> . comparisonthree LT comparisonfour
(66) comparisonthree -> . comparisonthree GT comparisonfour
(67) comparisonthree -> . comparisonthree LTE comparisonfour
(68) comparisonthree -> . comparisonthree GTE comparisonfour
(69) comparisonthree -> . comparisonfour
(70) comparisonfour -> . INT
(71) comparisonfour -> . FLOAT
(72) comparisonfour -> . matrix
(73) comparisonfour -> . LPAREN arithmetic RPAREN
(74) comparisonfour -> . LPAREN comparison RPAREN
(15) matrix -> . ID
(16) matrix -> . ID LPAREN INT RPAREN
(17) matrix -> . ID LPAREN INT COMMA INT RPAREN
(18) matrix -> . ID LPAREN ID RPAREN
(19) matrix -> . ID LPAREN ID COMMA ID RPAREN
INT shift and go to state 38
FLOAT shift and go to state 39
LPAREN shift and go to state 41
ID shift and go to state 42
comparison shift and go to state 34
comparisontwo shift and go to state 35
comparisonthree shift and go to state 36
comparisonfour shift and go to state 37
matrix shift and go to state 40
state 22
(41) if -> IF .
INT reduce using rule 41 (if -> IF .)
FLOAT reduce using rule 41 (if -> IF .)
LPAREN reduce using rule 41 (if -> IF .)
ID reduce using rule 41 (if -> IF .)
state 23
(29) blocks -> blocks do . blocks IF comparison then_if blocks exit END IF blocks END DO
(30) blocks -> blocks do . assignment_do COMMA arithmetic colon blocks END DO
(31) blocks -> blocks do . assignment_do COMMA arithmetic colon IF comparison then_if blocks exit END IF blocks END DO
(27) blocks -> . blocks assignment
(28) blocks -> . blocks if comparison then_if blocks conditionals END IF
(29) blocks -> . blocks do blocks IF comparison then_if blocks exit END IF blocks END DO
(30) blocks -> . blocks do assignment_do COMMA arithmetic colon blocks END DO
(31) blocks -> . blocks do assignment_do COMMA arithmetic colon IF comparison then_if blocks exit END IF blocks END DO
(32) blocks -> . blocks ID LPAREN RPAREN
(33) blocks -> . blocks READ TIMES COMMA matrix
(34) blocks -> . blocks PRINT TIMES COMMA matrix
(35) blocks -> . blocks PRINT TIMES COMMA STRING
(36) blocks -> . empty
(39) assignment_do -> . ID ASSIGN arithmetic
(75) empty -> .
! shift/reduce conflict for ID resolved as shift
ID shift and go to state 45
IF reduce using rule 75 (empty -> .)
READ reduce using rule 75 (empty -> .)
PRINT reduce using rule 75 (empty -> .)
DO reduce using rule 75 (empty -> .)
! ID [ reduce using rule 75 (empty -> .) ]
blocks shift and go to state 43
assignment_do shift and go to state 44
empty shift and go to state 16
state 24
(37) do -> DO .
ID reduce using rule 37 (do -> DO .)
IF reduce using rule 37 (do -> DO .)
READ reduce using rule 37 (do -> DO .)
PRINT reduce using rule 37 (do -> DO .)
DO reduce using rule 37 (do -> DO .)
state 25
(33) blocks -> blocks READ . TIMES COMMA matrix
TIMES shift and go to state 46
state 26
(48) assignment -> matrix . ASSIGN arithmetic
ASSIGN shift and go to state 47
state 27
(34) blocks -> blocks PRINT . TIMES COMMA matrix
(35) blocks -> blocks PRINT . TIMES COMMA STRING
TIMES shift and go to state 48
state 28
(22) subroutines -> subroutines SUBROUTINE id_subroutine . LPAREN RPAREN blocks END
(23) subroutines -> subroutines SUBROUTINE id_subroutine . LPAREN RPAREN blocks END SUBROUTINE
(24) subroutines -> subroutines SUBROUTINE id_subroutine . LPAREN RPAREN blocks END SUBROUTINE ID
LPAREN shift and go to state 49
state 29
(26) id_subroutine -> ID .
LPAREN reduce using rule 26 (id_subroutine -> ID .)
state 30
(5) declarations -> type COLON COLON variables . declarations
(9) variables -> variables . COMMA ID
(10) variables -> variables . COMMA ID LPAREN INT RPAREN
(11) variables -> variables . COMMA ID LPAREN INT COMMA INT RPAREN
(5) declarations -> . type COLON COLON variables declarations
(6) declarations -> . empty
(7) type -> . INTEGER
(8) type -> . REAL
(75) empty -> .
COMMA shift and go to state 51
INTEGER shift and go to state 9
REAL shift and go to state 10
SUBROUTINE reduce using rule 75 (empty -> .)
END reduce using rule 75 (empty -> .)
ID reduce using rule 75 (empty -> .)
READ reduce using rule 75 (empty -> .)
PRINT reduce using rule 75 (empty -> .)
IF reduce using rule 75 (empty -> .)
DO reduce using rule 75 (empty -> .)
type shift and go to state 7
declarations shift and go to state 50
empty shift and go to state 8
state 31
(12) variables -> ID .
(13) variables -> ID . LPAREN INT RPAREN
(14) variables -> ID . LPAREN INT COMMA INT RPAREN
COMMA reduce using rule 12 (variables -> ID .)
INTEGER reduce using rule 12 (variables -> ID .)
REAL reduce using rule 12 (variables -> ID .)
SUBROUTINE reduce using rule 12 (variables -> ID .)
END reduce using rule 12 (variables -> ID .)
ID reduce using rule 12 (variables -> ID .)
READ reduce using rule 12 (variables -> ID .)
PRINT reduce using rule 12 (variables -> ID .)
IF reduce using rule 12 (variables -> ID .)
DO reduce using rule 12 (variables -> ID .)
LPAREN shift and go to state 52
state 32
(32) blocks -> blocks ID LPAREN . RPAREN
(16) matrix -> ID LPAREN . INT RPAREN
(17) matrix -> ID LPAREN . INT COMMA INT RPAREN
(18) matrix -> ID LPAREN . ID RPAREN
(19) matrix -> ID LPAREN . ID COMMA ID RPAREN
RPAREN shift and go to state 54
INT shift and go to state 55
ID shift and go to state 53
state 33
(3) mathpy -> PROGRAM ID COLON declarations subroutines blocks END PROGRAM .
(4) mathpy -> PROGRAM ID COLON declarations subroutines blocks END PROGRAM . ID
$end reduce using rule 3 (mathpy -> PROGRAM ID COLON declarations subroutines blocks END PROGRAM .)
ID shift and go to state 56
state 34
(28) blocks -> blocks if comparison . then_if blocks conditionals END IF
(59) comparison -> comparison . OR comparisontwo
(42) then_if -> . THEN
OR shift and go to state 58
THEN shift and go to state 59
then_if shift and go to state 57
state 35
(60) comparison -> comparisontwo .
(61) comparisontwo -> comparisontwo . AND comparisonthree
OR reduce using rule 60 (comparison -> comparisontwo .)
THEN reduce using rule 60 (comparison -> comparisontwo .)
RPAREN reduce using rule 60 (comparison -> comparisontwo .)
AND shift and go to state 60
state 36
(62) comparisontwo -> comparisonthree .
(63) comparisonthree -> comparisonthree . EQ comparisonfour
(64) comparisonthree -> comparisonthree . NEQ comparisonfour
(65) comparisonthree -> comparisonthree . LT comparisonfour
(66) comparisonthree -> comparisonthree . GT comparisonfour
(67) comparisonthree -> comparisonthree . LTE comparisonfour
(68) comparisonthree -> comparisonthree . GTE comparisonfour
AND reduce using rule 62 (comparisontwo -> comparisonthree .)
OR reduce using rule 62 (comparisontwo -> comparisonthree .)
THEN reduce using rule 62 (comparisontwo -> comparisonthree .)
RPAREN reduce using rule 62 (comparisontwo -> comparisonthree .)
EQ shift and go to state 61
NEQ shift and go to state 62
LT shift and go to state 63
GT shift and go to state 64
LTE shift and go to state 65
GTE shift and go to state 66
state 37
(69) comparisonthree -> comparisonfour .
EQ reduce using rule 69 (comparisonthree -> comparisonfour .)
NEQ reduce using rule 69 (comparisonthree -> comparisonfour .)
LT reduce using rule 69 (comparisonthree -> comparisonfour .)
GT reduce using rule 69 (comparisonthree -> comparisonfour .)
LTE reduce using rule 69 (comparisonthree -> comparisonfour .)
GTE reduce using rule 69 (comparisonthree -> comparisonfour .)
AND reduce using rule 69 (comparisonthree -> comparisonfour .)
OR reduce using rule 69 (comparisonthree -> comparisonfour .)
THEN reduce using rule 69 (comparisonthree -> comparisonfour .)
RPAREN reduce using rule 69 (comparisonthree -> comparisonfour .)
state 38
(70) comparisonfour -> INT .
EQ reduce using rule 70 (comparisonfour -> INT .)
NEQ reduce using rule 70 (comparisonfour -> INT .)
LT reduce using rule 70 (comparisonfour -> INT .)
GT reduce using rule 70 (comparisonfour -> INT .)
LTE reduce using rule 70 (comparisonfour -> INT .)
GTE reduce using rule 70 (comparisonfour -> INT .)
AND reduce using rule 70 (comparisonfour -> INT .)
OR reduce using rule 70 (comparisonfour -> INT .)
THEN reduce using rule 70 (comparisonfour -> INT .)
RPAREN reduce using rule 70 (comparisonfour -> INT .)
state 39
(71) comparisonfour -> FLOAT .
EQ reduce using rule 71 (comparisonfour -> FLOAT .)
NEQ reduce using rule 71 (comparisonfour -> FLOAT .)
LT reduce using rule 71 (comparisonfour -> FLOAT .)
GT reduce using rule 71 (comparisonfour -> FLOAT .)
LTE reduce using rule 71 (comparisonfour -> FLOAT .)
GTE reduce using rule 71 (comparisonfour -> FLOAT .)
AND reduce using rule 71 (comparisonfour -> FLOAT .)
OR reduce using rule 71 (comparisonfour -> FLOAT .)
THEN reduce using rule 71 (comparisonfour -> FLOAT .)
RPAREN reduce using rule 71 (comparisonfour -> FLOAT .)
state 40
(72) comparisonfour -> matrix .
EQ reduce using rule 72 (comparisonfour -> matrix .)
NEQ reduce using rule 72 (comparisonfour -> matrix .)
LT reduce using rule 72 (comparisonfour -> matrix .)
GT reduce using rule 72 (comparisonfour -> matrix .)
LTE reduce using rule 72 (comparisonfour -> matrix .)
GTE reduce using rule 72 (comparisonfour -> matrix .)
AND reduce using rule 72 (comparisonfour -> matrix .)
OR reduce using rule 72 (comparisonfour -> matrix .)
THEN reduce using rule 72 (comparisonfour -> matrix .)
RPAREN reduce using rule 72 (comparisonfour -> matrix .)
state 41
(73) comparisonfour -> LPAREN . arithmetic RPAREN
(74) comparisonfour -> LPAREN . comparison RPAREN
(49) arithmetic -> . arithmetic PLUS term
(50) arithmetic -> . arithmetic MINUS term
(51) arithmetic -> . term
(59) comparison -> . comparison OR comparisontwo
(60) comparison -> . comparisontwo
(52) term -> . term TIMES factor
(53) term -> . term DIVIDE factor
(54) term -> . factor
(61) comparisontwo -> . comparisontwo AND comparisonthree
(62) comparisontwo -> . comparisonthree
(55) factor -> . INT
(56) factor -> . FLOAT
(57) factor -> . matrix
(58) factor -> . LPAREN arithmetic RPAREN
(63) comparisonthree -> . comparisonthree EQ comparisonfour
(64) comparisonthree -> . comparisonthree NEQ comparisonfour
(65) comparisonthree -> . comparisonthree LT comparisonfour
(66) comparisonthree -> . comparisonthree GT comparisonfour
(67) comparisonthree -> . comparisonthree LTE comparisonfour
(68) comparisonthree -> . comparisonthree GTE comparisonfour
(69) comparisonthree -> . comparisonfour
(15) matrix -> . ID
(16) matrix -> . ID LPAREN INT RPAREN
(17) matrix -> . ID LPAREN INT COMMA INT RPAREN
(18) matrix -> . ID LPAREN ID RPAREN
(19) matrix -> . ID LPAREN ID COMMA ID RPAREN
(70) comparisonfour -> . INT
(71) comparisonfour -> . FLOAT
(72) comparisonfour -> . matrix
(73) comparisonfour -> . LPAREN arithmetic RPAREN
(74) comparisonfour -> . LPAREN comparison RPAREN
INT shift and go to state 72
FLOAT shift and go to state 73
LPAREN shift and go to state 67
ID shift and go to state 42
arithmetic shift and go to state 68
comparison shift and go to state 69
term shift and go to state 70
comparisontwo shift and go to state 35
factor shift and go to state 71
comparisonthree shift and go to state 36
matrix shift and go to state 74
comparisonfour shift and go to state 37
state 42
(15) matrix -> ID .
(16) matrix -> ID . LPAREN INT RPAREN
(17) matrix -> ID . LPAREN INT COMMA INT RPAREN
(18) matrix -> ID . LPAREN ID RPAREN
(19) matrix -> ID . LPAREN ID COMMA ID RPAREN
EQ reduce using rule 15 (matrix -> ID .)
NEQ reduce using rule 15 (matrix -> ID .)
LT reduce using rule 15 (matrix -> ID .)
GT reduce using rule 15 (matrix -> ID .)
LTE reduce using rule 15 (matrix -> ID .)
GTE reduce using rule 15 (matrix -> ID .)
AND reduce using rule 15 (matrix -> ID .)
OR reduce using rule 15 (matrix -> ID .)
THEN reduce using rule 15 (matrix -> ID .)
TIMES reduce using rule 15 (matrix -> ID .)
DIVIDE reduce using rule 15 (matrix -> ID .)
RPAREN reduce using rule 15 (matrix -> ID .)
PLUS reduce using rule 15 (matrix -> ID .)
MINUS reduce using rule 15 (matrix -> ID .)
END reduce using rule 15 (matrix -> ID .)
ID reduce using rule 15 (matrix -> ID .)
READ reduce using rule 15 (matrix -> ID .)
PRINT reduce using rule 15 (matrix -> ID .)
IF reduce using rule 15 (matrix -> ID .)
DO reduce using rule 15 (matrix -> ID .)
ELSE reduce using rule 15 (matrix -> ID .)
EXIT reduce using rule 15 (matrix -> ID .)
COLON reduce using rule 15 (matrix -> ID .)
COMMA reduce using rule 15 (matrix -> ID .)
LPAREN shift and go to state 75
state 43
(29) blocks -> blocks do blocks . IF comparison then_if blocks exit END IF blocks END DO
(27) blocks -> blocks . assignment
(28) blocks -> blocks . if comparison then_if blocks conditionals END IF
(29) blocks -> blocks . do blocks IF comparison then_if blocks exit END IF blocks END DO
(30) blocks -> blocks . do assignment_do COMMA arithmetic colon blocks END DO
(31) blocks -> blocks . do assignment_do COMMA arithmetic colon IF comparison then_if blocks exit END IF blocks END DO
(32) blocks -> blocks . ID LPAREN RPAREN
(33) blocks -> blocks . READ TIMES COMMA matrix
(34) blocks -> blocks . PRINT TIMES COMMA matrix
(35) blocks -> blocks . PRINT TIMES COMMA STRING
(48) assignment -> . matrix ASSIGN arithmetic
(41) if -> . IF
(37) do -> . DO
(15) matrix -> . ID
(16) matrix -> . ID LPAREN INT RPAREN
(17) matrix -> . ID LPAREN INT COMMA INT RPAREN
(18) matrix -> . ID LPAREN ID RPAREN
(19) matrix -> . ID LPAREN ID COMMA ID RPAREN
IF shift and go to state 76
ID shift and go to state 18
READ shift and go to state 25
PRINT shift and go to state 27
DO shift and go to state 24
do shift and go to state 23
assignment shift and go to state 20
if shift and go to state 21
matrix shift and go to state 26
state 44
(30) blocks -> blocks do assignment_do . COMMA arithmetic colon blocks END DO
(31) blocks -> blocks do assignment_do . COMMA arithmetic colon IF comparison then_if blocks exit END IF blocks END DO
COMMA shift and go to state 77
state 45
(39) assignment_do -> ID . ASSIGN arithmetic
ASSIGN shift and go to state 78
state 46
(33) blocks -> blocks READ TIMES . COMMA matrix
COMMA shift and go to state 79
state 47
(48) assignment -> matrix ASSIGN . arithmetic
(49) arithmetic -> . arithmetic PLUS term
(50) arithmetic -> . arithmetic MINUS term
(51) arithmetic -> . term
(52) term -> . term TIMES factor
(53) term -> . term DIVIDE factor
(54) term -> . factor
(55) factor -> . INT
(56) factor -> . FLOAT
(57) factor -> . matrix
(58) factor -> . LPAREN arithmetic RPAREN
(15) matrix -> . ID
(16) matrix -> . ID LPAREN INT RPAREN
(17) matrix -> . ID LPAREN INT COMMA INT RPAREN
(18) matrix -> . ID LPAREN ID RPAREN
(19) matrix -> . ID LPAREN ID COMMA ID RPAREN
INT shift and go to state 82
FLOAT shift and go to state 83
LPAREN shift and go to state 84
ID shift and go to state 42
matrix shift and go to state 80
arithmetic shift and go to state 81
term shift and go to state 70
factor shift and go to state 71
state 48
(34) blocks -> blocks PRINT TIMES . COMMA matrix
(35) blocks -> blocks PRINT TIMES . COMMA STRING
COMMA shift and go to state 85
state 49
(22) subroutines -> subroutines SUBROUTINE id_subroutine LPAREN . RPAREN blocks END
(23) subroutines -> subroutines SUBROUTINE id_subroutine LPAREN . RPAREN blocks END SUBROUTINE
(24) subroutines -> subroutines SUBROUTINE id_subroutine LPAREN . RPAREN blocks END SUBROUTINE ID
RPAREN shift and go to state 86
state 50
(5) declarations -> type COLON COLON variables declarations .
SUBROUTINE reduce using rule 5 (declarations -> type COLON COLON variables declarations .)
END reduce using rule 5 (declarations -> type COLON COLON variables declarations .)
ID reduce using rule 5 (declarations -> type COLON COLON variables declarations .)
READ reduce using rule 5 (declarations -> type COLON COLON variables declarations .)
PRINT reduce using rule 5 (declarations -> type COLON COLON variables declarations .)
IF reduce using rule 5 (declarations -> type COLON COLON variables declarations .)
DO reduce using rule 5 (declarations -> type COLON COLON variables declarations .)
state 51
(9) variables -> variables COMMA . ID
(10) variables -> variables COMMA . ID LPAREN INT RPAREN
(11) variables -> variables COMMA . ID LPAREN INT COMMA INT RPAREN
ID shift and go to state 87
state 52
(13) variables -> ID LPAREN . INT RPAREN
(14) variables -> ID LPAREN . INT COMMA INT RPAREN
INT shift and go to state 88
state 53
(18) matrix -> ID LPAREN ID . RPAREN
(19) matrix -> ID LPAREN ID . COMMA ID RPAREN
RPAREN shift and go to state 89
COMMA shift and go to state 90
state 54
(32) blocks -> blocks ID LPAREN RPAREN .
END reduce using rule 32 (blocks -> blocks ID LPAREN RPAREN .)
ID reduce using rule 32 (blocks -> blocks ID LPAREN RPAREN .)
READ reduce using rule 32 (blocks -> blocks ID LPAREN RPAREN .)
PRINT reduce using rule 32 (blocks -> blocks ID LPAREN RPAREN .)
IF reduce using rule 32 (blocks -> blocks ID LPAREN RPAREN .)
DO reduce using rule 32 (blocks -> blocks ID LPAREN RPAREN .)
ELSE reduce using rule 32 (blocks -> blocks ID LPAREN RPAREN .)
EXIT reduce using rule 32 (blocks -> blocks ID LPAREN RPAREN .)
state 55
(16) matrix -> ID LPAREN INT . RPAREN
(17) matrix -> ID LPAREN INT . COMMA INT RPAREN
RPAREN shift and go to state 91
COMMA shift and go to state 92
state 56
(4) mathpy -> PROGRAM ID COLON declarations subroutines blocks END PROGRAM ID .
$end reduce using rule 4 (mathpy -> PROGRAM ID COLON declarations subroutines blocks END PROGRAM ID .)