-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser.out
More file actions
3444 lines (2928 loc) · 126 KB
/
parser.out
File metadata and controls
3444 lines (2928 loc) · 126 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
Created by PLY version 3.4 (http://www.dabeaz.com/ply)
Grammar
Rule 0 S' -> program
Rule 1 program -> declaration program
Rule 2 program -> declaration
Rule 3 declaration -> fun_declaration
Rule 4 declaration -> var_declaration
Rule 5 fun_declaration -> fun_type NAME LPAR formal_pars RPAR block SEMICOLON
Rule 6 fun_declaration -> fun_type NAME LPAR RPAR block SEMICOLON
Rule 7 fun_type -> VOID
Rule 8 fun_type -> INT
Rule 9 fun_type -> CHAR
Rule 10 fun_type -> BOOLEAN
Rule 11 type -> INT
Rule 12 type -> CHAR
Rule 13 type -> BOOLEAN
Rule 14 type -> type LBRACK exp RBRACK
Rule 15 formal_pars -> formal_pars COMMA formal_par
Rule 16 formal_pars -> formal_par
Rule 17 formal_par -> type NAME
Rule 18 block -> LBRACE var_declarations statements RBRACE
Rule 19 block -> LBRACE var_declarations RBRACE
Rule 20 var_declarations -> var_declaration var_declarations
Rule 21 var_declarations -> empty
Rule 22 var_declaration -> type NAME SEMICOLON
Rule 23 statements -> statements SEMICOLON statement
Rule 24 statements -> statement
Rule 25 statement -> block
Rule 26 statement -> RETURN exp
Rule 27 statement -> WRITE exp
Rule 28 statement -> READ lexp
Rule 29 statement -> NAME LPAR RPAR
Rule 30 statement -> NAME LPAR pars RPAR
Rule 31 statement -> WHILE LPAR exp RPAR statement
Rule 32 statement -> IF LPAR exp RPAR statement
Rule 33 statement -> IF LPAR exp RPAR statement ELSE statement
Rule 34 statement -> lexp ASSIGN exp
Rule 35 lexp -> var
Rule 36 lexp -> lexp LBRACK exp RBRACK
Rule 37 exp -> lexp
Rule 38 exp -> LENGTH lexp
Rule 39 exp -> unop exp
Rule 40 exp -> LPAR exp RPAR
Rule 41 exp -> exp AND exp
Rule 42 exp -> exp OR exp
Rule 43 exp -> NAME LPAR RPAR
Rule 44 exp -> NAME LPAR pars RPAR
Rule 45 exp -> NUMBER
Rule 46 exp -> QCHAR
Rule 47 exp -> exp MINUS exp
Rule 48 exp -> exp PLUS exp
Rule 49 exp -> exp TIMES exp
Rule 50 exp -> exp DIVIDE exp
Rule 51 exp -> exp EQUAL exp
Rule 52 exp -> exp NEQUAL exp
Rule 53 exp -> exp GREATER exp
Rule 54 exp -> exp LESS exp
Rule 55 exp -> exp GREATEREQ exp
Rule 56 exp -> exp LESSEQ exp
Rule 57 unop -> MINUS
Rule 58 unop -> NOT
Rule 59 pars -> pars COMMA exp
Rule 60 pars -> exp
Rule 61 var -> NAME
Rule 62 exp -> TRUE
Rule 63 exp -> FALSE
Rule 64 empty -> <empty>
Terminals, with rules where they appear
AND : 41
ASSIGN : 34
BOOLEAN : 10 13
CHAR : 9 12
COMMA : 15 59
DIVIDE : 50
ELSE : 33
EQUAL : 51
FALSE : 63
GREATER : 53
GREATEREQ : 55
IF : 32 33
INT : 8 11
LBRACE : 18 19
LBRACK : 14 36
LENGTH : 38
LESS : 54
LESSEQ : 56
LPAR : 5 6 29 30 31 32 33 40 43 44
MINUS : 47 57
NAME : 5 6 17 22 29 30 43 44 61
NEQUAL : 52
NOT : 58
NUMBER : 45
OR : 42
PLUS : 48
QCHAR : 46
RBRACE : 18 19
RBRACK : 14 36
READ : 28
RETURN : 26
RPAR : 5 6 29 30 31 32 33 40 43 44
SEMICOLON : 5 6 22 23
TIMES : 49
TRUE : 62
VOID : 7
WHILE : 31
WRITE : 27
error :
Nonterminals, with rules where they appear
block : 5 6 25
declaration : 1 2
empty : 21
exp : 14 26 27 31 32 33 34 36 39 40 41 41 42 42 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 59 60
formal_par : 15 16
formal_pars : 5 15
fun_declaration : 3
fun_type : 5 6
lexp : 28 34 36 37 38
pars : 30 44 59
program : 1 0
statement : 23 24 31 32 33 33
statements : 18 23
type : 14 17 22
unop : 39
var : 35
var_declaration : 4 20
var_declarations : 18 19 20
Parsing method: LALR
state 0
(0) S' -> . program
(1) program -> . declaration program
(2) program -> . declaration
(3) declaration -> . fun_declaration
(4) declaration -> . var_declaration
(5) fun_declaration -> . fun_type NAME LPAR formal_pars RPAR block SEMICOLON
(6) fun_declaration -> . fun_type NAME LPAR RPAR block SEMICOLON
(22) var_declaration -> . type NAME SEMICOLON
(7) fun_type -> . VOID
(8) fun_type -> . INT
(9) fun_type -> . CHAR
(10) fun_type -> . BOOLEAN
(11) type -> . INT
(12) type -> . CHAR
(13) type -> . BOOLEAN
(14) type -> . type LBRACK exp RBRACK
VOID shift and go to state 5
INT shift and go to state 4
CHAR shift and go to state 6
BOOLEAN shift and go to state 1
fun_type shift and go to state 2
var_declaration shift and go to state 3
fun_declaration shift and go to state 7
program shift and go to state 8
declaration shift and go to state 9
type shift and go to state 10
state 1
(10) fun_type -> BOOLEAN .
(13) type -> BOOLEAN .
! reduce/reduce conflict for NAME resolved using rule 10 (fun_type -> BOOLEAN .)
NAME reduce using rule 10 (fun_type -> BOOLEAN .)
LBRACK reduce using rule 13 (type -> BOOLEAN .)
! NAME [ reduce using rule 13 (type -> BOOLEAN .) ]
state 2
(5) fun_declaration -> fun_type . NAME LPAR formal_pars RPAR block SEMICOLON
(6) fun_declaration -> fun_type . NAME LPAR RPAR block SEMICOLON
NAME shift and go to state 11
state 3
(4) declaration -> var_declaration .
VOID reduce using rule 4 (declaration -> var_declaration .)
INT reduce using rule 4 (declaration -> var_declaration .)
CHAR reduce using rule 4 (declaration -> var_declaration .)
BOOLEAN reduce using rule 4 (declaration -> var_declaration .)
$end reduce using rule 4 (declaration -> var_declaration .)
state 4
(8) fun_type -> INT .
(11) type -> INT .
! reduce/reduce conflict for NAME resolved using rule 8 (fun_type -> INT .)
NAME reduce using rule 8 (fun_type -> INT .)
LBRACK reduce using rule 11 (type -> INT .)
! NAME [ reduce using rule 11 (type -> INT .) ]
state 5
(7) fun_type -> VOID .
NAME reduce using rule 7 (fun_type -> VOID .)
state 6
(9) fun_type -> CHAR .
(12) type -> CHAR .
! reduce/reduce conflict for NAME resolved using rule 9 (fun_type -> CHAR .)
NAME reduce using rule 9 (fun_type -> CHAR .)
LBRACK reduce using rule 12 (type -> CHAR .)
! NAME [ reduce using rule 12 (type -> CHAR .) ]
state 7
(3) declaration -> fun_declaration .
VOID reduce using rule 3 (declaration -> fun_declaration .)
INT reduce using rule 3 (declaration -> fun_declaration .)
CHAR reduce using rule 3 (declaration -> fun_declaration .)
BOOLEAN reduce using rule 3 (declaration -> fun_declaration .)
$end reduce using rule 3 (declaration -> fun_declaration .)
state 8
(0) S' -> program .
state 9
(1) program -> declaration . program
(2) program -> declaration .
(1) program -> . declaration program
(2) program -> . declaration
(3) declaration -> . fun_declaration
(4) declaration -> . var_declaration
(5) fun_declaration -> . fun_type NAME LPAR formal_pars RPAR block SEMICOLON
(6) fun_declaration -> . fun_type NAME LPAR RPAR block SEMICOLON
(22) var_declaration -> . type NAME SEMICOLON
(7) fun_type -> . VOID
(8) fun_type -> . INT
(9) fun_type -> . CHAR
(10) fun_type -> . BOOLEAN
(11) type -> . INT
(12) type -> . CHAR
(13) type -> . BOOLEAN
(14) type -> . type LBRACK exp RBRACK
$end reduce using rule 2 (program -> declaration .)
VOID shift and go to state 5
INT shift and go to state 4
CHAR shift and go to state 6
BOOLEAN shift and go to state 1
fun_type shift and go to state 2
var_declaration shift and go to state 3
fun_declaration shift and go to state 7
program shift and go to state 12
declaration shift and go to state 9
type shift and go to state 10
state 10
(22) var_declaration -> type . NAME SEMICOLON
(14) type -> type . LBRACK exp RBRACK
NAME shift and go to state 13
LBRACK shift and go to state 14
state 11
(5) fun_declaration -> fun_type NAME . LPAR formal_pars RPAR block SEMICOLON
(6) fun_declaration -> fun_type NAME . LPAR RPAR block SEMICOLON
LPAR shift and go to state 15
state 12
(1) program -> declaration program .
$end reduce using rule 1 (program -> declaration program .)
state 13
(22) var_declaration -> type NAME . SEMICOLON
SEMICOLON shift and go to state 16
state 14
(14) type -> type LBRACK . exp RBRACK
(37) exp -> . lexp
(38) exp -> . LENGTH lexp
(39) exp -> . unop exp
(40) exp -> . LPAR exp RPAR
(41) exp -> . exp AND exp
(42) exp -> . exp OR exp
(43) exp -> . NAME LPAR RPAR
(44) exp -> . NAME LPAR pars RPAR
(45) exp -> . NUMBER
(46) exp -> . QCHAR
(47) exp -> . exp MINUS exp
(48) exp -> . exp PLUS exp
(49) exp -> . exp TIMES exp
(50) exp -> . exp DIVIDE exp
(51) exp -> . exp EQUAL exp
(52) exp -> . exp NEQUAL exp
(53) exp -> . exp GREATER exp
(54) exp -> . exp LESS exp
(55) exp -> . exp GREATEREQ exp
(56) exp -> . exp LESSEQ exp
(62) exp -> . TRUE
(63) exp -> . FALSE
(35) lexp -> . var
(36) lexp -> . lexp LBRACK exp RBRACK
(57) unop -> . MINUS
(58) unop -> . NOT
(61) var -> . NAME
LENGTH shift and go to state 27
LPAR shift and go to state 18
NAME shift and go to state 26
NUMBER shift and go to state 24
QCHAR shift and go to state 19
TRUE shift and go to state 20
FALSE shift and go to state 25
MINUS shift and go to state 21
NOT shift and go to state 29
unop shift and go to state 17
lexp shift and go to state 22
exp shift and go to state 28
var shift and go to state 23
state 15
(5) fun_declaration -> fun_type NAME LPAR . formal_pars RPAR block SEMICOLON
(6) fun_declaration -> fun_type NAME LPAR . RPAR block SEMICOLON
(15) formal_pars -> . formal_pars COMMA formal_par
(16) formal_pars -> . formal_par
(17) formal_par -> . type NAME
(11) type -> . INT
(12) type -> . CHAR
(13) type -> . BOOLEAN
(14) type -> . type LBRACK exp RBRACK
RPAR shift and go to state 31
INT shift and go to state 30
CHAR shift and go to state 32
BOOLEAN shift and go to state 33
formal_pars shift and go to state 35
formal_par shift and go to state 34
type shift and go to state 36
state 16
(22) var_declaration -> type NAME SEMICOLON .
VOID reduce using rule 22 (var_declaration -> type NAME SEMICOLON .)
INT reduce using rule 22 (var_declaration -> type NAME SEMICOLON .)
CHAR reduce using rule 22 (var_declaration -> type NAME SEMICOLON .)
BOOLEAN reduce using rule 22 (var_declaration -> type NAME SEMICOLON .)
$end reduce using rule 22 (var_declaration -> type NAME SEMICOLON .)
RBRACE reduce using rule 22 (var_declaration -> type NAME SEMICOLON .)
RETURN reduce using rule 22 (var_declaration -> type NAME SEMICOLON .)
WRITE reduce using rule 22 (var_declaration -> type NAME SEMICOLON .)
READ reduce using rule 22 (var_declaration -> type NAME SEMICOLON .)
NAME reduce using rule 22 (var_declaration -> type NAME SEMICOLON .)
WHILE reduce using rule 22 (var_declaration -> type NAME SEMICOLON .)
IF reduce using rule 22 (var_declaration -> type NAME SEMICOLON .)
LBRACE reduce using rule 22 (var_declaration -> type NAME SEMICOLON .)
state 17
(39) exp -> unop . exp
(37) exp -> . lexp
(38) exp -> . LENGTH lexp
(39) exp -> . unop exp
(40) exp -> . LPAR exp RPAR
(41) exp -> . exp AND exp
(42) exp -> . exp OR exp
(43) exp -> . NAME LPAR RPAR
(44) exp -> . NAME LPAR pars RPAR
(45) exp -> . NUMBER
(46) exp -> . QCHAR
(47) exp -> . exp MINUS exp
(48) exp -> . exp PLUS exp
(49) exp -> . exp TIMES exp
(50) exp -> . exp DIVIDE exp
(51) exp -> . exp EQUAL exp
(52) exp -> . exp NEQUAL exp
(53) exp -> . exp GREATER exp
(54) exp -> . exp LESS exp
(55) exp -> . exp GREATEREQ exp
(56) exp -> . exp LESSEQ exp
(62) exp -> . TRUE
(63) exp -> . FALSE
(35) lexp -> . var
(36) lexp -> . lexp LBRACK exp RBRACK
(57) unop -> . MINUS
(58) unop -> . NOT
(61) var -> . NAME
LENGTH shift and go to state 27
LPAR shift and go to state 18
NAME shift and go to state 26
NUMBER shift and go to state 24
QCHAR shift and go to state 19
TRUE shift and go to state 20
FALSE shift and go to state 25
MINUS shift and go to state 21
NOT shift and go to state 29
unop shift and go to state 17
var shift and go to state 23
lexp shift and go to state 22
exp shift and go to state 37
state 18
(40) exp -> LPAR . exp RPAR
(37) exp -> . lexp
(38) exp -> . LENGTH lexp
(39) exp -> . unop exp
(40) exp -> . LPAR exp RPAR
(41) exp -> . exp AND exp
(42) exp -> . exp OR exp
(43) exp -> . NAME LPAR RPAR
(44) exp -> . NAME LPAR pars RPAR
(45) exp -> . NUMBER
(46) exp -> . QCHAR
(47) exp -> . exp MINUS exp
(48) exp -> . exp PLUS exp
(49) exp -> . exp TIMES exp
(50) exp -> . exp DIVIDE exp
(51) exp -> . exp EQUAL exp
(52) exp -> . exp NEQUAL exp
(53) exp -> . exp GREATER exp
(54) exp -> . exp LESS exp
(55) exp -> . exp GREATEREQ exp
(56) exp -> . exp LESSEQ exp
(62) exp -> . TRUE
(63) exp -> . FALSE
(35) lexp -> . var
(36) lexp -> . lexp LBRACK exp RBRACK
(57) unop -> . MINUS
(58) unop -> . NOT
(61) var -> . NAME
LENGTH shift and go to state 27
LPAR shift and go to state 18
NAME shift and go to state 26
NUMBER shift and go to state 24
QCHAR shift and go to state 19
TRUE shift and go to state 20
FALSE shift and go to state 25
MINUS shift and go to state 21
NOT shift and go to state 29
unop shift and go to state 17
var shift and go to state 23
lexp shift and go to state 22
exp shift and go to state 38
state 19
(46) exp -> QCHAR .
AND reduce using rule 46 (exp -> QCHAR .)
OR reduce using rule 46 (exp -> QCHAR .)
MINUS reduce using rule 46 (exp -> QCHAR .)
PLUS reduce using rule 46 (exp -> QCHAR .)
TIMES reduce using rule 46 (exp -> QCHAR .)
DIVIDE reduce using rule 46 (exp -> QCHAR .)
EQUAL reduce using rule 46 (exp -> QCHAR .)
NEQUAL reduce using rule 46 (exp -> QCHAR .)
GREATER reduce using rule 46 (exp -> QCHAR .)
LESS reduce using rule 46 (exp -> QCHAR .)
GREATEREQ reduce using rule 46 (exp -> QCHAR .)
LESSEQ reduce using rule 46 (exp -> QCHAR .)
RBRACK reduce using rule 46 (exp -> QCHAR .)
RPAR reduce using rule 46 (exp -> QCHAR .)
COMMA reduce using rule 46 (exp -> QCHAR .)
RBRACE reduce using rule 46 (exp -> QCHAR .)
SEMICOLON reduce using rule 46 (exp -> QCHAR .)
ELSE reduce using rule 46 (exp -> QCHAR .)
state 20
(62) exp -> TRUE .
AND reduce using rule 62 (exp -> TRUE .)
OR reduce using rule 62 (exp -> TRUE .)
MINUS reduce using rule 62 (exp -> TRUE .)
PLUS reduce using rule 62 (exp -> TRUE .)
TIMES reduce using rule 62 (exp -> TRUE .)
DIVIDE reduce using rule 62 (exp -> TRUE .)
EQUAL reduce using rule 62 (exp -> TRUE .)
NEQUAL reduce using rule 62 (exp -> TRUE .)
GREATER reduce using rule 62 (exp -> TRUE .)
LESS reduce using rule 62 (exp -> TRUE .)
GREATEREQ reduce using rule 62 (exp -> TRUE .)
LESSEQ reduce using rule 62 (exp -> TRUE .)
RBRACK reduce using rule 62 (exp -> TRUE .)
RPAR reduce using rule 62 (exp -> TRUE .)
COMMA reduce using rule 62 (exp -> TRUE .)
RBRACE reduce using rule 62 (exp -> TRUE .)
SEMICOLON reduce using rule 62 (exp -> TRUE .)
ELSE reduce using rule 62 (exp -> TRUE .)
state 21
(57) unop -> MINUS .
LENGTH reduce using rule 57 (unop -> MINUS .)
LPAR reduce using rule 57 (unop -> MINUS .)
NAME reduce using rule 57 (unop -> MINUS .)
NUMBER reduce using rule 57 (unop -> MINUS .)
QCHAR reduce using rule 57 (unop -> MINUS .)
TRUE reduce using rule 57 (unop -> MINUS .)
FALSE reduce using rule 57 (unop -> MINUS .)
MINUS reduce using rule 57 (unop -> MINUS .)
NOT reduce using rule 57 (unop -> MINUS .)
state 22
(37) exp -> lexp .
(36) lexp -> lexp . LBRACK exp RBRACK
AND reduce using rule 37 (exp -> lexp .)
OR reduce using rule 37 (exp -> lexp .)
MINUS reduce using rule 37 (exp -> lexp .)
PLUS reduce using rule 37 (exp -> lexp .)
TIMES reduce using rule 37 (exp -> lexp .)
DIVIDE reduce using rule 37 (exp -> lexp .)
EQUAL reduce using rule 37 (exp -> lexp .)
NEQUAL reduce using rule 37 (exp -> lexp .)
GREATER reduce using rule 37 (exp -> lexp .)
LESS reduce using rule 37 (exp -> lexp .)
GREATEREQ reduce using rule 37 (exp -> lexp .)
LESSEQ reduce using rule 37 (exp -> lexp .)
RBRACK reduce using rule 37 (exp -> lexp .)
RPAR reduce using rule 37 (exp -> lexp .)
COMMA reduce using rule 37 (exp -> lexp .)
RBRACE reduce using rule 37 (exp -> lexp .)
SEMICOLON reduce using rule 37 (exp -> lexp .)
ELSE reduce using rule 37 (exp -> lexp .)
LBRACK shift and go to state 39
state 23
(35) lexp -> var .
LBRACK reduce using rule 35 (lexp -> var .)
RBRACK reduce using rule 35 (lexp -> var .)
AND reduce using rule 35 (lexp -> var .)
OR reduce using rule 35 (lexp -> var .)
MINUS reduce using rule 35 (lexp -> var .)
PLUS reduce using rule 35 (lexp -> var .)
TIMES reduce using rule 35 (lexp -> var .)
DIVIDE reduce using rule 35 (lexp -> var .)
EQUAL reduce using rule 35 (lexp -> var .)
NEQUAL reduce using rule 35 (lexp -> var .)
GREATER reduce using rule 35 (lexp -> var .)
LESS reduce using rule 35 (lexp -> var .)
GREATEREQ reduce using rule 35 (lexp -> var .)
LESSEQ reduce using rule 35 (lexp -> var .)
RPAR reduce using rule 35 (lexp -> var .)
COMMA reduce using rule 35 (lexp -> var .)
RBRACE reduce using rule 35 (lexp -> var .)
SEMICOLON reduce using rule 35 (lexp -> var .)
ELSE reduce using rule 35 (lexp -> var .)
ASSIGN reduce using rule 35 (lexp -> var .)
state 24
(45) exp -> NUMBER .
AND reduce using rule 45 (exp -> NUMBER .)
OR reduce using rule 45 (exp -> NUMBER .)
MINUS reduce using rule 45 (exp -> NUMBER .)
PLUS reduce using rule 45 (exp -> NUMBER .)
TIMES reduce using rule 45 (exp -> NUMBER .)
DIVIDE reduce using rule 45 (exp -> NUMBER .)
EQUAL reduce using rule 45 (exp -> NUMBER .)
NEQUAL reduce using rule 45 (exp -> NUMBER .)
GREATER reduce using rule 45 (exp -> NUMBER .)
LESS reduce using rule 45 (exp -> NUMBER .)
GREATEREQ reduce using rule 45 (exp -> NUMBER .)
LESSEQ reduce using rule 45 (exp -> NUMBER .)
RBRACK reduce using rule 45 (exp -> NUMBER .)
RPAR reduce using rule 45 (exp -> NUMBER .)
COMMA reduce using rule 45 (exp -> NUMBER .)
RBRACE reduce using rule 45 (exp -> NUMBER .)
SEMICOLON reduce using rule 45 (exp -> NUMBER .)
ELSE reduce using rule 45 (exp -> NUMBER .)
state 25
(63) exp -> FALSE .
AND reduce using rule 63 (exp -> FALSE .)
OR reduce using rule 63 (exp -> FALSE .)
MINUS reduce using rule 63 (exp -> FALSE .)
PLUS reduce using rule 63 (exp -> FALSE .)
TIMES reduce using rule 63 (exp -> FALSE .)
DIVIDE reduce using rule 63 (exp -> FALSE .)
EQUAL reduce using rule 63 (exp -> FALSE .)
NEQUAL reduce using rule 63 (exp -> FALSE .)
GREATER reduce using rule 63 (exp -> FALSE .)
LESS reduce using rule 63 (exp -> FALSE .)
GREATEREQ reduce using rule 63 (exp -> FALSE .)
LESSEQ reduce using rule 63 (exp -> FALSE .)
RBRACK reduce using rule 63 (exp -> FALSE .)
RPAR reduce using rule 63 (exp -> FALSE .)
COMMA reduce using rule 63 (exp -> FALSE .)
RBRACE reduce using rule 63 (exp -> FALSE .)
SEMICOLON reduce using rule 63 (exp -> FALSE .)
ELSE reduce using rule 63 (exp -> FALSE .)
state 26
(43) exp -> NAME . LPAR RPAR
(44) exp -> NAME . LPAR pars RPAR
(61) var -> NAME .
LPAR shift and go to state 40
LBRACK reduce using rule 61 (var -> NAME .)
AND reduce using rule 61 (var -> NAME .)
OR reduce using rule 61 (var -> NAME .)
MINUS reduce using rule 61 (var -> NAME .)
PLUS reduce using rule 61 (var -> NAME .)
TIMES reduce using rule 61 (var -> NAME .)
DIVIDE reduce using rule 61 (var -> NAME .)
EQUAL reduce using rule 61 (var -> NAME .)
NEQUAL reduce using rule 61 (var -> NAME .)
GREATER reduce using rule 61 (var -> NAME .)
LESS reduce using rule 61 (var -> NAME .)
GREATEREQ reduce using rule 61 (var -> NAME .)
LESSEQ reduce using rule 61 (var -> NAME .)
RBRACK reduce using rule 61 (var -> NAME .)
RPAR reduce using rule 61 (var -> NAME .)
COMMA reduce using rule 61 (var -> NAME .)
RBRACE reduce using rule 61 (var -> NAME .)
SEMICOLON reduce using rule 61 (var -> NAME .)
ELSE reduce using rule 61 (var -> NAME .)
state 27
(38) exp -> LENGTH . lexp
(35) lexp -> . var
(36) lexp -> . lexp LBRACK exp RBRACK
(61) var -> . NAME
NAME shift and go to state 42
var shift and go to state 23
lexp shift and go to state 41
state 28
(14) type -> type LBRACK exp . RBRACK
(41) exp -> exp . AND exp
(42) exp -> exp . OR exp
(47) exp -> exp . MINUS exp
(48) exp -> exp . PLUS exp
(49) exp -> exp . TIMES exp
(50) exp -> exp . DIVIDE exp
(51) exp -> exp . EQUAL exp
(52) exp -> exp . NEQUAL exp
(53) exp -> exp . GREATER exp
(54) exp -> exp . LESS exp
(55) exp -> exp . GREATEREQ exp
(56) exp -> exp . LESSEQ exp
RBRACK shift and go to state 47
AND shift and go to state 43
OR shift and go to state 54
MINUS shift and go to state 49
PLUS shift and go to state 52
TIMES shift and go to state 53
DIVIDE shift and go to state 44
EQUAL shift and go to state 46
NEQUAL shift and go to state 48
GREATER shift and go to state 55
LESS shift and go to state 45
GREATEREQ shift and go to state 50
LESSEQ shift and go to state 51
state 29
(58) unop -> NOT .
LENGTH reduce using rule 58 (unop -> NOT .)
LPAR reduce using rule 58 (unop -> NOT .)
NAME reduce using rule 58 (unop -> NOT .)
NUMBER reduce using rule 58 (unop -> NOT .)
QCHAR reduce using rule 58 (unop -> NOT .)
TRUE reduce using rule 58 (unop -> NOT .)
FALSE reduce using rule 58 (unop -> NOT .)
MINUS reduce using rule 58 (unop -> NOT .)
NOT reduce using rule 58 (unop -> NOT .)
state 30
(11) type -> INT .
NAME reduce using rule 11 (type -> INT .)
LBRACK reduce using rule 11 (type -> INT .)
state 31
(6) fun_declaration -> fun_type NAME LPAR RPAR . block SEMICOLON
(18) block -> . LBRACE var_declarations statements RBRACE
(19) block -> . LBRACE var_declarations RBRACE
LBRACE shift and go to state 56
block shift and go to state 57
state 32
(12) type -> CHAR .
NAME reduce using rule 12 (type -> CHAR .)
LBRACK reduce using rule 12 (type -> CHAR .)
state 33
(13) type -> BOOLEAN .
NAME reduce using rule 13 (type -> BOOLEAN .)
LBRACK reduce using rule 13 (type -> BOOLEAN .)
state 34
(16) formal_pars -> formal_par .
RPAR reduce using rule 16 (formal_pars -> formal_par .)
COMMA reduce using rule 16 (formal_pars -> formal_par .)
state 35
(5) fun_declaration -> fun_type NAME LPAR formal_pars . RPAR block SEMICOLON
(15) formal_pars -> formal_pars . COMMA formal_par
RPAR shift and go to state 58
COMMA shift and go to state 59
state 36
(17) formal_par -> type . NAME
(14) type -> type . LBRACK exp RBRACK
NAME shift and go to state 60
LBRACK shift and go to state 14
state 37
(39) exp -> unop exp .
(41) exp -> exp . AND exp
(42) exp -> exp . OR exp
(47) exp -> exp . MINUS exp
(48) exp -> exp . PLUS exp
(49) exp -> exp . TIMES exp
(50) exp -> exp . DIVIDE exp
(51) exp -> exp . EQUAL exp
(52) exp -> exp . NEQUAL exp
(53) exp -> exp . GREATER exp
(54) exp -> exp . LESS exp
(55) exp -> exp . GREATEREQ exp
(56) exp -> exp . LESSEQ exp
! shift/reduce conflict for AND resolved as shift
! shift/reduce conflict for OR resolved as shift
! shift/reduce conflict for MINUS resolved as shift
! shift/reduce conflict for PLUS resolved as shift
! shift/reduce conflict for TIMES resolved as shift
! shift/reduce conflict for DIVIDE resolved as shift
! shift/reduce conflict for EQUAL resolved as shift
! shift/reduce conflict for NEQUAL resolved as shift
! shift/reduce conflict for GREATER resolved as shift
! shift/reduce conflict for LESS resolved as shift
! shift/reduce conflict for GREATEREQ resolved as shift
! shift/reduce conflict for LESSEQ resolved as shift
RBRACK reduce using rule 39 (exp -> unop exp .)
RPAR reduce using rule 39 (exp -> unop exp .)
COMMA reduce using rule 39 (exp -> unop exp .)
RBRACE reduce using rule 39 (exp -> unop exp .)
SEMICOLON reduce using rule 39 (exp -> unop exp .)
ELSE reduce using rule 39 (exp -> unop exp .)
AND shift and go to state 43
OR shift and go to state 54
MINUS shift and go to state 49
PLUS shift and go to state 52
TIMES shift and go to state 53
DIVIDE shift and go to state 44
EQUAL shift and go to state 46
NEQUAL shift and go to state 48
GREATER shift and go to state 55
LESS shift and go to state 45
GREATEREQ shift and go to state 50
LESSEQ shift and go to state 51
! AND [ reduce using rule 39 (exp -> unop exp .) ]
! OR [ reduce using rule 39 (exp -> unop exp .) ]
! MINUS [ reduce using rule 39 (exp -> unop exp .) ]
! PLUS [ reduce using rule 39 (exp -> unop exp .) ]
! TIMES [ reduce using rule 39 (exp -> unop exp .) ]
! DIVIDE [ reduce using rule 39 (exp -> unop exp .) ]
! EQUAL [ reduce using rule 39 (exp -> unop exp .) ]
! NEQUAL [ reduce using rule 39 (exp -> unop exp .) ]
! GREATER [ reduce using rule 39 (exp -> unop exp .) ]
! LESS [ reduce using rule 39 (exp -> unop exp .) ]
! GREATEREQ [ reduce using rule 39 (exp -> unop exp .) ]
! LESSEQ [ reduce using rule 39 (exp -> unop exp .) ]
state 38
(40) exp -> LPAR exp . RPAR
(41) exp -> exp . AND exp
(42) exp -> exp . OR exp
(47) exp -> exp . MINUS exp
(48) exp -> exp . PLUS exp
(49) exp -> exp . TIMES exp
(50) exp -> exp . DIVIDE exp
(51) exp -> exp . EQUAL exp
(52) exp -> exp . NEQUAL exp
(53) exp -> exp . GREATER exp
(54) exp -> exp . LESS exp
(55) exp -> exp . GREATEREQ exp
(56) exp -> exp . LESSEQ exp
RPAR shift and go to state 61
AND shift and go to state 43
OR shift and go to state 54
MINUS shift and go to state 49
PLUS shift and go to state 52
TIMES shift and go to state 53
DIVIDE shift and go to state 44
EQUAL shift and go to state 46
NEQUAL shift and go to state 48
GREATER shift and go to state 55
LESS shift and go to state 45
GREATEREQ shift and go to state 50
LESSEQ shift and go to state 51
state 39
(36) lexp -> lexp LBRACK . exp RBRACK
(37) exp -> . lexp
(38) exp -> . LENGTH lexp
(39) exp -> . unop exp
(40) exp -> . LPAR exp RPAR
(41) exp -> . exp AND exp
(42) exp -> . exp OR exp
(43) exp -> . NAME LPAR RPAR
(44) exp -> . NAME LPAR pars RPAR
(45) exp -> . NUMBER
(46) exp -> . QCHAR
(47) exp -> . exp MINUS exp
(48) exp -> . exp PLUS exp
(49) exp -> . exp TIMES exp
(50) exp -> . exp DIVIDE exp
(51) exp -> . exp EQUAL exp
(52) exp -> . exp NEQUAL exp
(53) exp -> . exp GREATER exp
(54) exp -> . exp LESS exp
(55) exp -> . exp GREATEREQ exp
(56) exp -> . exp LESSEQ exp
(62) exp -> . TRUE
(63) exp -> . FALSE
(35) lexp -> . var
(36) lexp -> . lexp LBRACK exp RBRACK
(57) unop -> . MINUS
(58) unop -> . NOT
(61) var -> . NAME
LENGTH shift and go to state 27
LPAR shift and go to state 18
NAME shift and go to state 26
NUMBER shift and go to state 24
QCHAR shift and go to state 19
TRUE shift and go to state 20
FALSE shift and go to state 25
MINUS shift and go to state 21
NOT shift and go to state 29
unop shift and go to state 17
var shift and go to state 23
lexp shift and go to state 22
exp shift and go to state 62
state 40
(43) exp -> NAME LPAR . RPAR
(44) exp -> NAME LPAR . pars RPAR
(59) pars -> . pars COMMA exp
(60) pars -> . exp
(37) exp -> . lexp
(38) exp -> . LENGTH lexp
(39) exp -> . unop exp
(40) exp -> . LPAR exp RPAR
(41) exp -> . exp AND exp
(42) exp -> . exp OR exp
(43) exp -> . NAME LPAR RPAR
(44) exp -> . NAME LPAR pars RPAR
(45) exp -> . NUMBER
(46) exp -> . QCHAR
(47) exp -> . exp MINUS exp
(48) exp -> . exp PLUS exp
(49) exp -> . exp TIMES exp
(50) exp -> . exp DIVIDE exp
(51) exp -> . exp EQUAL exp
(52) exp -> . exp NEQUAL exp
(53) exp -> . exp GREATER exp
(54) exp -> . exp LESS exp
(55) exp -> . exp GREATEREQ exp
(56) exp -> . exp LESSEQ exp
(62) exp -> . TRUE
(63) exp -> . FALSE
(35) lexp -> . var
(36) lexp -> . lexp LBRACK exp RBRACK
(57) unop -> . MINUS
(58) unop -> . NOT
(61) var -> . NAME
RPAR shift and go to state 63
LENGTH shift and go to state 27
LPAR shift and go to state 18
NAME shift and go to state 26
NUMBER shift and go to state 24
QCHAR shift and go to state 19
TRUE shift and go to state 20
FALSE shift and go to state 25
MINUS shift and go to state 21
NOT shift and go to state 29
unop shift and go to state 17
var shift and go to state 23
pars shift and go to state 64
lexp shift and go to state 22
exp shift and go to state 65
state 41
(38) exp -> LENGTH lexp .
(36) lexp -> lexp . LBRACK exp RBRACK
AND reduce using rule 38 (exp -> LENGTH lexp .)
OR reduce using rule 38 (exp -> LENGTH lexp .)
MINUS reduce using rule 38 (exp -> LENGTH lexp .)
PLUS reduce using rule 38 (exp -> LENGTH lexp .)
TIMES reduce using rule 38 (exp -> LENGTH lexp .)
DIVIDE reduce using rule 38 (exp -> LENGTH lexp .)
EQUAL reduce using rule 38 (exp -> LENGTH lexp .)
NEQUAL reduce using rule 38 (exp -> LENGTH lexp .)
GREATER reduce using rule 38 (exp -> LENGTH lexp .)
LESS reduce using rule 38 (exp -> LENGTH lexp .)