-
Notifications
You must be signed in to change notification settings - Fork 1
/
y.output
3386 lines (2394 loc) · 88.5 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
Useless nonterminals:
Logic
Aop
IDD
AopLogic
Useless rules:
#48 Logic : LOGIC_AND;
#49 Logic : LOGIC_OR;
#50 Logic : '<';
#51 Logic : '>';
#52 Logic : GTE;
#53 Logic : LTE;
#54 Logic : EQU;
#55 Logic : NEQ;
#56 Aop : '+';
#57 Aop : '-';
#58 Aop : '*';
#59 Aop : '/';
#60 Aop : '%';
#65 IDD : ID IDDRight;
#69 AopLogic : Aop;
#70 AopLogic : Logic;
Conflict in state 72 between rule 93 and token IN resolved as reduce.
Conflict in state 72 between rule 93 and token LTE resolved as reduce.
Conflict in state 72 between rule 93 and token GTE resolved as reduce.
Conflict in state 72 between rule 93 and token EQU resolved as reduce.
Conflict in state 72 between rule 93 and token NEQ resolved as reduce.
Conflict in state 72 between rule 93 and token LOGIC_AND resolved as reduce.
Conflict in state 72 between rule 93 and token LOGIC_OR resolved as reduce.
Conflict in state 72 between rule 93 and token '>' resolved as reduce.
Conflict in state 72 between rule 93 and token '<' resolved as reduce.
Conflict in state 72 between rule 93 and token '+' resolved as reduce.
Conflict in state 72 between rule 93 and token '-' resolved as reduce.
Conflict in state 72 between rule 93 and token '*' resolved as reduce.
Conflict in state 72 between rule 93 and token '/' resolved as reduce.
Conflict in state 72 between rule 93 and token '%' resolved as reduce.
Conflict in state 111 between rule 94 and token IN resolved as reduce.
Conflict in state 111 between rule 94 and token LTE resolved as shift.
Conflict in state 111 between rule 94 and token GTE resolved as shift.
Conflict in state 111 between rule 94 and token EQU resolved as shift.
Conflict in state 111 between rule 94 and token NEQ resolved as shift.
Conflict in state 111 between rule 94 and token LOGIC_AND resolved as shift.
Conflict in state 111 between rule 94 and token LOGIC_OR resolved as shift.
Conflict in state 111 between rule 94 and token '>' resolved as shift.
Conflict in state 111 between rule 94 and token '<' resolved as shift.
Conflict in state 111 between rule 94 and token '+' resolved as shift.
Conflict in state 111 between rule 94 and token '-' resolved as shift.
Conflict in state 111 between rule 94 and token '*' resolved as shift.
Conflict in state 111 between rule 94 and token '/' resolved as shift.
Conflict in state 111 between rule 94 and token '%' resolved as shift.
Conflict in state 114 between rule 82 and token IN resolved as reduce.
Conflict in state 114 between rule 82 and token LTE resolved as reduce.
Conflict in state 114 between rule 82 and token GTE resolved as reduce.
Conflict in state 114 between rule 82 and token EQU resolved as reduce.
Conflict in state 114 between rule 82 and token NEQ resolved as reduce.
Conflict in state 114 between rule 82 and token LOGIC_AND resolved as reduce.
Conflict in state 114 between rule 82 and token LOGIC_OR resolved as reduce.
Conflict in state 114 between rule 82 and token '>' resolved as reduce.
Conflict in state 114 between rule 82 and token '<' resolved as reduce.
Conflict in state 114 between rule 82 and token '+' resolved as shift.
Conflict in state 114 between rule 82 and token '-' resolved as shift.
Conflict in state 114 between rule 82 and token '*' resolved as shift.
Conflict in state 114 between rule 82 and token '/' resolved as shift.
Conflict in state 114 between rule 82 and token '%' resolved as shift.
Conflict in state 115 between rule 81 and token IN resolved as reduce.
Conflict in state 115 between rule 81 and token LTE resolved as reduce.
Conflict in state 115 between rule 81 and token GTE resolved as reduce.
Conflict in state 115 between rule 81 and token EQU resolved as reduce.
Conflict in state 115 between rule 81 and token NEQ resolved as reduce.
Conflict in state 115 between rule 81 and token LOGIC_AND resolved as reduce.
Conflict in state 115 between rule 81 and token LOGIC_OR resolved as reduce.
Conflict in state 115 between rule 81 and token '>' resolved as reduce.
Conflict in state 115 between rule 81 and token '<' resolved as reduce.
Conflict in state 115 between rule 81 and token '+' resolved as shift.
Conflict in state 115 between rule 81 and token '-' resolved as shift.
Conflict in state 115 between rule 81 and token '*' resolved as shift.
Conflict in state 115 between rule 81 and token '/' resolved as shift.
Conflict in state 115 between rule 81 and token '%' resolved as shift.
Conflict in state 116 between rule 83 and token IN resolved as reduce.
Conflict in state 116 between rule 83 and token LTE resolved as shift.
Conflict in state 116 between rule 83 and token GTE resolved as shift.
Conflict in state 116 between rule 83 and token EQU resolved as reduce.
Conflict in state 116 between rule 83 and token NEQ resolved as reduce.
Conflict in state 116 between rule 83 and token LOGIC_AND resolved as reduce.
Conflict in state 116 between rule 83 and token LOGIC_OR resolved as reduce.
Conflict in state 116 between rule 83 and token '>' resolved as shift.
Conflict in state 116 between rule 83 and token '<' resolved as shift.
Conflict in state 116 between rule 83 and token '+' resolved as shift.
Conflict in state 116 between rule 83 and token '-' resolved as shift.
Conflict in state 116 between rule 83 and token '*' resolved as shift.
Conflict in state 116 between rule 83 and token '/' resolved as shift.
Conflict in state 116 between rule 83 and token '%' resolved as shift.
Conflict in state 117 between rule 84 and token IN resolved as reduce.
Conflict in state 117 between rule 84 and token LTE resolved as shift.
Conflict in state 117 between rule 84 and token GTE resolved as shift.
Conflict in state 117 between rule 84 and token EQU resolved as reduce.
Conflict in state 117 between rule 84 and token NEQ resolved as reduce.
Conflict in state 117 between rule 84 and token LOGIC_AND resolved as reduce.
Conflict in state 117 between rule 84 and token LOGIC_OR resolved as reduce.
Conflict in state 117 between rule 84 and token '>' resolved as shift.
Conflict in state 117 between rule 84 and token '<' resolved as shift.
Conflict in state 117 between rule 84 and token '+' resolved as shift.
Conflict in state 117 between rule 84 and token '-' resolved as shift.
Conflict in state 117 between rule 84 and token '*' resolved as shift.
Conflict in state 117 between rule 84 and token '/' resolved as shift.
Conflict in state 117 between rule 84 and token '%' resolved as shift.
Conflict in state 118 between rule 77 and token IN resolved as reduce.
Conflict in state 118 between rule 77 and token LTE resolved as shift.
Conflict in state 118 between rule 77 and token GTE resolved as shift.
Conflict in state 118 between rule 77 and token EQU resolved as shift.
Conflict in state 118 between rule 77 and token NEQ resolved as shift.
Conflict in state 118 between rule 77 and token LOGIC_AND resolved as reduce.
Conflict in state 118 between rule 77 and token LOGIC_OR resolved as reduce.
Conflict in state 118 between rule 77 and token '>' resolved as shift.
Conflict in state 118 between rule 77 and token '<' resolved as shift.
Conflict in state 118 between rule 77 and token '+' resolved as shift.
Conflict in state 118 between rule 77 and token '-' resolved as shift.
Conflict in state 118 between rule 77 and token '*' resolved as shift.
Conflict in state 118 between rule 77 and token '/' resolved as shift.
Conflict in state 118 between rule 77 and token '%' resolved as shift.
Conflict in state 119 between rule 78 and token IN resolved as reduce.
Conflict in state 119 between rule 78 and token LTE resolved as shift.
Conflict in state 119 between rule 78 and token GTE resolved as shift.
Conflict in state 119 between rule 78 and token EQU resolved as shift.
Conflict in state 119 between rule 78 and token NEQ resolved as shift.
Conflict in state 119 between rule 78 and token LOGIC_AND resolved as shift.
Conflict in state 119 between rule 78 and token LOGIC_OR resolved as reduce.
Conflict in state 119 between rule 78 and token '>' resolved as shift.
Conflict in state 119 between rule 78 and token '<' resolved as shift.
Conflict in state 119 between rule 78 and token '+' resolved as shift.
Conflict in state 119 between rule 78 and token '-' resolved as shift.
Conflict in state 119 between rule 78 and token '*' resolved as shift.
Conflict in state 119 between rule 78 and token '/' resolved as shift.
Conflict in state 119 between rule 78 and token '%' resolved as shift.
Conflict in state 120 between rule 80 and token IN resolved as reduce.
Conflict in state 120 between rule 80 and token LTE resolved as reduce.
Conflict in state 120 between rule 80 and token GTE resolved as reduce.
Conflict in state 120 between rule 80 and token EQU resolved as reduce.
Conflict in state 120 between rule 80 and token NEQ resolved as reduce.
Conflict in state 120 between rule 80 and token LOGIC_AND resolved as reduce.
Conflict in state 120 between rule 80 and token LOGIC_OR resolved as reduce.
Conflict in state 120 between rule 80 and token '>' resolved as reduce.
Conflict in state 120 between rule 80 and token '<' resolved as reduce.
Conflict in state 120 between rule 80 and token '+' resolved as shift.
Conflict in state 120 between rule 80 and token '-' resolved as shift.
Conflict in state 120 between rule 80 and token '*' resolved as shift.
Conflict in state 120 between rule 80 and token '/' resolved as shift.
Conflict in state 120 between rule 80 and token '%' resolved as shift.
Conflict in state 121 between rule 79 and token IN resolved as reduce.
Conflict in state 121 between rule 79 and token LTE resolved as reduce.
Conflict in state 121 between rule 79 and token GTE resolved as reduce.
Conflict in state 121 between rule 79 and token EQU resolved as reduce.
Conflict in state 121 between rule 79 and token NEQ resolved as reduce.
Conflict in state 121 between rule 79 and token LOGIC_AND resolved as reduce.
Conflict in state 121 between rule 79 and token LOGIC_OR resolved as reduce.
Conflict in state 121 between rule 79 and token '>' resolved as reduce.
Conflict in state 121 between rule 79 and token '<' resolved as reduce.
Conflict in state 121 between rule 79 and token '+' resolved as shift.
Conflict in state 121 between rule 79 and token '-' resolved as shift.
Conflict in state 121 between rule 79 and token '*' resolved as shift.
Conflict in state 121 between rule 79 and token '/' resolved as shift.
Conflict in state 121 between rule 79 and token '%' resolved as shift.
Conflict in state 122 between rule 72 and token IN resolved as reduce.
Conflict in state 122 between rule 72 and token LTE resolved as reduce.
Conflict in state 122 between rule 72 and token GTE resolved as reduce.
Conflict in state 122 between rule 72 and token EQU resolved as reduce.
Conflict in state 122 between rule 72 and token NEQ resolved as reduce.
Conflict in state 122 between rule 72 and token LOGIC_AND resolved as reduce.
Conflict in state 122 between rule 72 and token LOGIC_OR resolved as reduce.
Conflict in state 122 between rule 72 and token '>' resolved as reduce.
Conflict in state 122 between rule 72 and token '<' resolved as reduce.
Conflict in state 122 between rule 72 and token '+' resolved as reduce.
Conflict in state 122 between rule 72 and token '-' resolved as reduce.
Conflict in state 122 between rule 72 and token '*' resolved as shift.
Conflict in state 122 between rule 72 and token '/' resolved as shift.
Conflict in state 122 between rule 72 and token '%' resolved as shift.
Conflict in state 123 between rule 73 and token IN resolved as reduce.
Conflict in state 123 between rule 73 and token LTE resolved as reduce.
Conflict in state 123 between rule 73 and token GTE resolved as reduce.
Conflict in state 123 between rule 73 and token EQU resolved as reduce.
Conflict in state 123 between rule 73 and token NEQ resolved as reduce.
Conflict in state 123 between rule 73 and token LOGIC_AND resolved as reduce.
Conflict in state 123 between rule 73 and token LOGIC_OR resolved as reduce.
Conflict in state 123 between rule 73 and token '>' resolved as reduce.
Conflict in state 123 between rule 73 and token '<' resolved as reduce.
Conflict in state 123 between rule 73 and token '+' resolved as reduce.
Conflict in state 123 between rule 73 and token '-' resolved as reduce.
Conflict in state 123 between rule 73 and token '*' resolved as shift.
Conflict in state 123 between rule 73 and token '/' resolved as shift.
Conflict in state 123 between rule 73 and token '%' resolved as shift.
Conflict in state 124 between rule 74 and token IN resolved as reduce.
Conflict in state 124 between rule 74 and token LTE resolved as reduce.
Conflict in state 124 between rule 74 and token GTE resolved as reduce.
Conflict in state 124 between rule 74 and token EQU resolved as reduce.
Conflict in state 124 between rule 74 and token NEQ resolved as reduce.
Conflict in state 124 between rule 74 and token LOGIC_AND resolved as reduce.
Conflict in state 124 between rule 74 and token LOGIC_OR resolved as reduce.
Conflict in state 124 between rule 74 and token '>' resolved as reduce.
Conflict in state 124 between rule 74 and token '<' resolved as reduce.
Conflict in state 124 between rule 74 and token '+' resolved as reduce.
Conflict in state 124 between rule 74 and token '-' resolved as reduce.
Conflict in state 124 between rule 74 and token '*' resolved as reduce.
Conflict in state 124 between rule 74 and token '/' resolved as reduce.
Conflict in state 124 between rule 74 and token '%' resolved as reduce.
Conflict in state 125 between rule 75 and token IN resolved as reduce.
Conflict in state 125 between rule 75 and token LTE resolved as reduce.
Conflict in state 125 between rule 75 and token GTE resolved as reduce.
Conflict in state 125 between rule 75 and token EQU resolved as reduce.
Conflict in state 125 between rule 75 and token NEQ resolved as reduce.
Conflict in state 125 between rule 75 and token LOGIC_AND resolved as reduce.
Conflict in state 125 between rule 75 and token LOGIC_OR resolved as reduce.
Conflict in state 125 between rule 75 and token '>' resolved as reduce.
Conflict in state 125 between rule 75 and token '<' resolved as reduce.
Conflict in state 125 between rule 75 and token '+' resolved as reduce.
Conflict in state 125 between rule 75 and token '-' resolved as reduce.
Conflict in state 125 between rule 75 and token '*' resolved as reduce.
Conflict in state 125 between rule 75 and token '/' resolved as reduce.
Conflict in state 125 between rule 75 and token '%' resolved as reduce.
Conflict in state 126 between rule 76 and token IN resolved as reduce.
Conflict in state 126 between rule 76 and token LTE resolved as reduce.
Conflict in state 126 between rule 76 and token GTE resolved as reduce.
Conflict in state 126 between rule 76 and token EQU resolved as reduce.
Conflict in state 126 between rule 76 and token NEQ resolved as reduce.
Conflict in state 126 between rule 76 and token LOGIC_AND resolved as reduce.
Conflict in state 126 between rule 76 and token LOGIC_OR resolved as reduce.
Conflict in state 126 between rule 76 and token '>' resolved as reduce.
Conflict in state 126 between rule 76 and token '<' resolved as reduce.
Conflict in state 126 between rule 76 and token '+' resolved as reduce.
Conflict in state 126 between rule 76 and token '-' resolved as reduce.
Conflict in state 126 between rule 76 and token '*' resolved as reduce.
Conflict in state 126 between rule 76 and token '/' resolved as reduce.
Conflict in state 126 between rule 76 and token '%' resolved as reduce.
Conflict in state 135 between rule 34 and token ELSE resolved as shift.
Conflict in state 156 between rule 43 and token IN resolved as reduce.
Conflict in state 156 between rule 43 and token LTE resolved as shift.
Conflict in state 156 between rule 43 and token GTE resolved as shift.
Conflict in state 156 between rule 43 and token EQU resolved as shift.
Conflict in state 156 between rule 43 and token NEQ resolved as shift.
Conflict in state 156 between rule 43 and token LOGIC_AND resolved as shift.
Conflict in state 156 between rule 43 and token LOGIC_OR resolved as shift.
Conflict in state 156 between rule 43 and token '>' resolved as shift.
Conflict in state 156 between rule 43 and token '<' resolved as shift.
Conflict in state 156 between rule 43 and token '+' resolved as shift.
Conflict in state 156 between rule 43 and token '-' resolved as shift.
Conflict in state 156 between rule 43 and token '*' resolved as shift.
Conflict in state 156 between rule 43 and token '/' resolved as shift.
Conflict in state 156 between rule 43 and token '%' resolved as shift.
Grammar
rule 1 Program -> PROGRAM ID ';' DecList '{' SList '}' '.'
rule 2 DecList -> Dec DecList
rule 3 DecList -> /* empty */
rule 4 Dec -> VarDecs
rule 5 Dec -> FuncDecs
rule 6 FuncDecs -> FuncDec FuncDecs
rule 7 FuncDecs -> FuncDec END
rule 8 VarDecs -> VarDec VarDecs
rule 9 VarDecs -> VarDec END
rule 10 VarDec -> VAR Type IDDList ';'
rule 11 Type -> INT
rule 12 Type -> DOUBLE
rule 13 Type -> BOOL
rule 14 Type -> CHAR
rule 15 IDDim -> ID
rule 16 IDDim -> IDDim '[' IntNumber ']'
rule 17 IDDList -> IDDim ','
rule 18 IDDList -> IDDim
rule 19 IDList -> ID ',' IDList
rule 20 IDList -> ID
rule 21 FuncDec -> DEF Type ID '(' ArgsList ')' '{' SList '}' ';'
rule 22 ArgsList -> ArgList
rule 23 ArgsList -> /* empty */
rule 24 ArgList -> Arg ';' ArgList
rule 25 ArgList -> Arg
rule 26 Arg -> Type IDList
rule 27 SList -> Stmt ';' SList
rule 28 SList -> /* empty */
rule 29 Stmt -> Exp
rule 30 Stmt -> VarDecs
rule 31 Stmt -> FOR LValue '=' Exp '(' TO
rule 32 Stmt -> DOWN TO ')' Exp DO Block
rule 33 Stmt -> WHILE Exp DO Block
rule 34 Stmt -> IF Exp THEN Block
rule 35 Stmt -> IF Exp THEN Block ELSE Block
rule 36 Stmt -> SWITCH Exp OF '{' Cases '}'
rule 37 Stmt -> BREAK
rule 38 Stmt -> REPEAT Block UNTIL Exp
rule 39 Stmt -> CONTINUE
rule 40 Stmt -> RETURN Exp
rule 41 Stmt -> WRITE ExpPlus
rule 42 Stmt -> READ '(' LValue ')'
rule 43 Range -> Exp RANGE_DOTS Exp
rule 44 Cases -> Case Cases '.'
rule 45 Cases -> Case END
rule 46 Case -> CASE Exp ':' Block
rule 47 Case -> CASE Range ':' Block
rule 61 ExpList -> ExpPlus
rule 62 ExpList -> /* empty */
rule 63 ExpPlus -> Exp ',' ExpPlus
rule 64 ExpPlus -> Exp
rule 66 IDDRight -> '[' Exp ']' IDDRight
rule 67 IDDRight -> /* empty */
rule 68 LValue -> ID IDDRight
rule 71 Exp -> ExpRight
rule 72 Exp -> Exp '+' Exp
rule 73 Exp -> Exp '-' Exp
rule 74 Exp -> Exp '*' Exp
rule 75 Exp -> Exp '/' Exp
rule 76 Exp -> Exp '%' Exp
rule 77 Exp -> Exp LOGIC_AND Exp
rule 78 Exp -> Exp LOGIC_OR Exp
rule 79 Exp -> Exp '<' Exp
rule 80 Exp -> Exp '>' Exp
rule 81 Exp -> Exp GTE Exp
rule 82 Exp -> Exp LTE Exp
rule 83 Exp -> Exp EQU Exp
rule 84 Exp -> Exp NEQ Exp
rule 85 Exp -> Exp IN Range
rule 86 ExpRight -> IntNumber
rule 87 ExpRight -> RealNumber
rule 88 ExpRight -> LValue
rule 89 ExpRight -> CHARACTER
rule 90 ExpRight -> STRING
rule 91 ExpRight -> TRUE
rule 92 ExpRight -> FALSE
rule 93 ExpRight -> '-' Exp
rule 94 ExpRight -> LValue '=' Exp
rule 95 ExpRight -> '(' Exp ')'
rule 96 ExpRight -> '(' ID '(' ExpList ')' ')'
rule 97 Block -> Stmt
rule 98 Block -> '{' SList '}'
Terminals, with rules where they appear
$ (-1)
'%' (37) 60 76
'(' (40) 21 31 42 95 96
')' (41) 21 32 42 95 96
'*' (42) 58 74
'+' (43) 56 72
',' (44) 17 19 63
'-' (45) 57 73 93
'.' (46) 1 44
'/' (47) 59 75
':' (58) 46 47
';' (59) 1 10 21 24 27
'<' (60) 50 79
'=' (61) 31 94
'>' (62) 51 80
'[' (91) 16 66
']' (93) 16 66
'{' (123) 1 21 36 98
'}' (125) 1 21 36 98
error (256)
CHAR (258) 14
INT (259) 11
DOUBLE (260) 12
PROGRAM (261) 1
BOOL (262) 13
FOR (263) 31
TO (264) 31 32
DOWN (265) 32
WHILE (266) 33
IF (267) 34 35
THEN (268) 34 35
ELSE (269) 35
SWITCH (270) 36
CASE (271) 46 47
OF (272) 36
BREAK (273) 37
REPEAT (274) 38
CONTINUE (275) 39
RETURN (276) 40
WRITE (277) 41
READ (278) 42
TRUE (279) 91
FALSE (280) 92
IN (281) 85
END (282) 7 9 45
ID (283) 1 15 19 20 21 65 68 96
IntNumber (284) 16 86
RealNumber (285) 87
STRING (286) 90
CHARACTER (287) 89
LTE (288) 53 82
GTE (289) 52 81
EQU (290) 54 83
NEQ (291) 55 84
RANGE_DOTS (292) 43
LOGIC_AND (293) 48 77
LOGIC_OR (294) 49 78
UNTIL (295) 38
DO (296) 32 33
VAR (297) 10
DEF (298) 21
IFX (299)
NEG (300)
Nonterminals, with rules where they appear
Program (64)
on left: 1
DecList (65)
on left: 2 3, on right: 1 2
Dec (66)
on left: 4 5, on right: 2
FuncDecs (67)
on left: 6 7, on right: 5 6
VarDecs (68)
on left: 8 9, on right: 4 8 30
VarDec (69)
on left: 10, on right: 8 9
Type (70)
on left: 11 12 13 14, on right: 10 21 26
IDDim (71)
on left: 15 16, on right: 16 17 18
IDDList (72)
on left: 17 18, on right: 10
IDList (73)
on left: 19 20, on right: 19 26
FuncDec (74)
on left: 21, on right: 6 7
ArgsList (75)
on left: 22 23, on right: 21
ArgList (76)
on left: 24 25, on right: 22 24
Arg (77)
on left: 26, on right: 24 25
SList (78)
on left: 27 28, on right: 1 21 27 98
Stmt (79)
on left: 29 30 31 32 33 34 35 36 37 38 39 40 41 42,
on right: 27 97
Range (80)
on left: 43, on right: 47 85
Cases (81)
on left: 44 45, on right: 36 44
Case (82)
on left: 46 47, on right: 44 45
ExpList (83)
on left: 61 62, on right: 96
ExpPlus (84)
on left: 63 64, on right: 41 61 63
IDDRight (85)
on left: 66 67, on right: 65 66 68
LValue (86)
on left: 68, on right: 31 42 88 94
Exp (87)
on left: 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85,
on right: 29 31 32 33 34 35 36 38 40 43 46 63 64 66 72 73 74 75
76 77 78 79 80 81 82 83 84 85 93 94 95
ExpRight (88)
on left: 86 87 88 89 90 91 92 93 94 95 96, on right: 71
Block (89)
on left: 97 98, on right: 32 33 34 35 38 46 47
state 0
PROGRAM shift, and go to state 1
Program go to state 175
state 1
Program -> PROGRAM . ID ';' DecList '{' SList '}' '.' (rule 1)
ID shift, and go to state 2
state 2
Program -> PROGRAM ID . ';' DecList '{' SList '}' '.' (rule 1)
';' shift, and go to state 3
state 3
Program -> PROGRAM ID ';' . DecList '{' SList '}' '.' (rule 1)
VAR shift, and go to state 4
DEF shift, and go to state 5
$default reduce using rule 3 (DecList)
DecList go to state 6
Dec go to state 7
FuncDecs go to state 8
VarDecs go to state 9
VarDec go to state 10
FuncDec go to state 11
state 4
VarDec -> VAR . Type IDDList ';' (rule 10)
CHAR shift, and go to state 12
INT shift, and go to state 13
DOUBLE shift, and go to state 14
BOOL shift, and go to state 15
Type go to state 16
state 5
FuncDec -> DEF . Type ID '(' ArgsList ')' '{' SList '}' ';' (rule 21)
CHAR shift, and go to state 12
INT shift, and go to state 13
DOUBLE shift, and go to state 14
BOOL shift, and go to state 15
Type go to state 17
state 6
Program -> PROGRAM ID ';' DecList . '{' SList '}' '.' (rule 1)
'{' shift, and go to state 18
state 7
DecList -> Dec . DecList (rule 2)
VAR shift, and go to state 4
DEF shift, and go to state 5
$default reduce using rule 3 (DecList)
DecList go to state 19
Dec go to state 7
FuncDecs go to state 8
VarDecs go to state 9
VarDec go to state 10
FuncDec go to state 11
state 8
Dec -> FuncDecs . (rule 5)
$default reduce using rule 5 (Dec)
state 9
Dec -> VarDecs . (rule 4)
$default reduce using rule 4 (Dec)
state 10
VarDecs -> VarDec . VarDecs (rule 8)
VarDecs -> VarDec . END (rule 9)
END shift, and go to state 20
VAR shift, and go to state 4
VarDecs go to state 21
VarDec go to state 10
state 11
FuncDecs -> FuncDec . FuncDecs (rule 6)
FuncDecs -> FuncDec . END (rule 7)
END shift, and go to state 22
DEF shift, and go to state 5
FuncDecs go to state 23
FuncDec go to state 11
state 12
Type -> CHAR . (rule 14)
$default reduce using rule 14 (Type)
state 13
Type -> INT . (rule 11)
$default reduce using rule 11 (Type)
state 14
Type -> DOUBLE . (rule 12)
$default reduce using rule 12 (Type)
state 15
Type -> BOOL . (rule 13)
$default reduce using rule 13 (Type)
state 16
VarDec -> VAR Type . IDDList ';' (rule 10)
ID shift, and go to state 24
IDDim go to state 25
IDDList go to state 26
state 17
FuncDec -> DEF Type . ID '(' ArgsList ')' '{' SList '}' ';' (rule 21)
ID shift, and go to state 27
state 18
Program -> PROGRAM ID ';' DecList '{' . SList '}' '.' (rule 1)
FOR shift, and go to state 28
DOWN shift, and go to state 29
WHILE shift, and go to state 30
IF shift, and go to state 31
SWITCH shift, and go to state 32
BREAK shift, and go to state 33
REPEAT shift, and go to state 34
CONTINUE shift, and go to state 35
RETURN shift, and go to state 36
WRITE shift, and go to state 37
READ shift, and go to state 38
TRUE shift, and go to state 39
FALSE shift, and go to state 40
ID shift, and go to state 41
IntNumber shift, and go to state 42
RealNumber shift, and go to state 43
STRING shift, and go to state 44
CHARACTER shift, and go to state 45
VAR shift, and go to state 4
'-' shift, and go to state 46
'(' shift, and go to state 47
$default reduce using rule 28 (SList)
VarDecs go to state 48
VarDec go to state 10
SList go to state 49
Stmt go to state 50
LValue go to state 51
Exp go to state 52
ExpRight go to state 53
state 19
DecList -> Dec DecList . (rule 2)
$default reduce using rule 2 (DecList)
state 20
VarDecs -> VarDec END . (rule 9)
$default reduce using rule 9 (VarDecs)
state 21
VarDecs -> VarDec VarDecs . (rule 8)
$default reduce using rule 8 (VarDecs)
state 22
FuncDecs -> FuncDec END . (rule 7)
$default reduce using rule 7 (FuncDecs)
state 23
FuncDecs -> FuncDec FuncDecs . (rule 6)
$default reduce using rule 6 (FuncDecs)
state 24
IDDim -> ID . (rule 15)
$default reduce using rule 15 (IDDim)
state 25
IDDim -> IDDim . '[' IntNumber ']' (rule 16)
IDDList -> IDDim . ',' (rule 17)
IDDList -> IDDim . (rule 18)
'[' shift, and go to state 54
',' shift, and go to state 55
$default reduce using rule 18 (IDDList)
state 26
VarDec -> VAR Type IDDList . ';' (rule 10)
';' shift, and go to state 56
state 27
FuncDec -> DEF Type ID . '(' ArgsList ')' '{' SList '}' ';' (rule 21)
'(' shift, and go to state 57
state 28
Stmt -> FOR . LValue '=' Exp '(' TO (rule 31)
ID shift, and go to state 41
LValue go to state 58
state 29
Stmt -> DOWN . TO ')' Exp DO Block (rule 32)
TO shift, and go to state 59
state 30
Stmt -> WHILE . Exp DO Block (rule 33)
TRUE shift, and go to state 39
FALSE shift, and go to state 40
ID shift, and go to state 41
IntNumber shift, and go to state 42
RealNumber shift, and go to state 43
STRING shift, and go to state 44
CHARACTER shift, and go to state 45
'-' shift, and go to state 46
'(' shift, and go to state 47
LValue go to state 51
Exp go to state 60
ExpRight go to state 53
state 31
Stmt -> IF . Exp THEN Block (rule 34)
Stmt -> IF . Exp THEN Block ELSE Block (rule 35)
TRUE shift, and go to state 39
FALSE shift, and go to state 40
ID shift, and go to state 41
IntNumber shift, and go to state 42
RealNumber shift, and go to state 43
STRING shift, and go to state 44
CHARACTER shift, and go to state 45
'-' shift, and go to state 46
'(' shift, and go to state 47
LValue go to state 51
Exp go to state 61
ExpRight go to state 53
state 32
Stmt -> SWITCH . Exp OF '{' Cases '}' (rule 36)
TRUE shift, and go to state 39
FALSE shift, and go to state 40
ID shift, and go to state 41
IntNumber shift, and go to state 42
RealNumber shift, and go to state 43
STRING shift, and go to state 44
CHARACTER shift, and go to state 45
'-' shift, and go to state 46
'(' shift, and go to state 47
LValue go to state 51
Exp go to state 62
ExpRight go to state 53
state 33
Stmt -> BREAK . (rule 37)
$default reduce using rule 37 (Stmt)
state 34
Stmt -> REPEAT . Block UNTIL Exp (rule 38)
FOR shift, and go to state 28
DOWN shift, and go to state 29
WHILE shift, and go to state 30
IF shift, and go to state 31
SWITCH shift, and go to state 32
BREAK shift, and go to state 33
REPEAT shift, and go to state 34
CONTINUE shift, and go to state 35
RETURN shift, and go to state 36
WRITE shift, and go to state 37
READ shift, and go to state 38
TRUE shift, and go to state 39
FALSE shift, and go to state 40
ID shift, and go to state 41
IntNumber shift, and go to state 42
RealNumber shift, and go to state 43
STRING shift, and go to state 44
CHARACTER shift, and go to state 45
VAR shift, and go to state 4
'-' shift, and go to state 46
'{' shift, and go to state 63
'(' shift, and go to state 47
VarDecs go to state 48
VarDec go to state 10
Stmt go to state 64
LValue go to state 51
Exp go to state 52
ExpRight go to state 53
Block go to state 65
state 35
Stmt -> CONTINUE . (rule 39)
$default reduce using rule 39 (Stmt)
state 36
Stmt -> RETURN . Exp (rule 40)
TRUE shift, and go to state 39
FALSE shift, and go to state 40
ID shift, and go to state 41
IntNumber shift, and go to state 42
RealNumber shift, and go to state 43
STRING shift, and go to state 44
CHARACTER shift, and go to state 45
'-' shift, and go to state 46
'(' shift, and go to state 47
LValue go to state 51
Exp go to state 66
ExpRight go to state 53
state 37
Stmt -> WRITE . ExpPlus (rule 41)
TRUE shift, and go to state 39
FALSE shift, and go to state 40
ID shift, and go to state 41
IntNumber shift, and go to state 42
RealNumber shift, and go to state 43
STRING shift, and go to state 44
CHARACTER shift, and go to state 45
'-' shift, and go to state 46
'(' shift, and go to state 47
ExpPlus go to state 67
LValue go to state 51
Exp go to state 68
ExpRight go to state 53
state 38
Stmt -> READ . '(' LValue ')' (rule 42)
'(' shift, and go to state 69
state 39
ExpRight -> TRUE . (rule 91)
$default reduce using rule 91 (ExpRight)
state 40
ExpRight -> FALSE . (rule 92)
$default reduce using rule 92 (ExpRight)
state 41
LValue -> ID . IDDRight (rule 68)
'[' shift, and go to state 70
$default reduce using rule 67 (IDDRight)
IDDRight go to state 71
state 42
ExpRight -> IntNumber . (rule 86)
$default reduce using rule 86 (ExpRight)
state 43
ExpRight -> RealNumber . (rule 87)
$default reduce using rule 87 (ExpRight)
state 44
ExpRight -> STRING . (rule 90)
$default reduce using rule 90 (ExpRight)
state 45