Repository navigation
Expand file tree
/
Copy pathparser.out
More file actions
2848 lines (2139 loc) · 108 KB
/
Copy pathparser.out
File metadata and controls
2848 lines (2139 loc) · 108 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.11 (http://www.dabeaz.com/ply)
Unused terminals:
ABSOLUTE
AND
ASM
BREAK
CASE
CONSTRUCTOR
CONTINUE
DESTRUCTOR
DIV
DOWNTO
EXTERNAL
FILE
FORWARD
GOTO
IMPLEMENTATION
IN
INHERITED
INLINE
INTERFACE
INTERRUPT
LABEL
MOD
NIL
NOT
ON
OPERATOR
OR
PACKED
RECORD
REPEAT
SELF
SET
SHL
SHR
SINGLE_COMMENT
UNIT
UNTIL
WHILE
WITH
XOR
Grammar
Rule 0 S' -> program
Rule 1 program -> PROGRAM ID SEMICOLON uses_clause declaration_sections compound_stmt DOT
Rule 2 uses_clause -> USES id_list SEMICOLON
Rule 3 uses_clause -> empty
Rule 4 id_list -> ID
Rule 5 id_list -> id_list COMMA ID
Rule 6 declaration_sections -> declaration_sections section
Rule 7 declaration_sections -> empty
Rule 8 section -> const_section
Rule 9 section -> type_section
Rule 10 section -> var_section
Rule 11 section -> procedure_declaration
Rule 12 section -> function_declaration
Rule 13 const_section -> CONST const_list
Rule 14 const_list -> const_list ID EQUALS expression SEMICOLON
Rule 15 const_list -> ID EQUALS expression SEMICOLON
Rule 16 type_section -> TYPE type_list
Rule 17 type_list -> type_list ID EQUALS type_specifier SEMICOLON
Rule 18 type_list -> ID EQUALS type_specifier SEMICOLON
Rule 19 var_section -> VAR var_list
Rule 20 var_list -> var_list id_list COLON type_specifier SEMICOLON
Rule 21 var_list -> id_list COLON type_specifier SEMICOLON
Rule 22 type_specifier -> type_base
Rule 23 type_specifier -> ARRAY LBRACKET range RBRACKET OF type_base
Rule 24 type_specifier -> STRING LBRACKET NUMBER RBRACKET
Rule 25 type_base -> INTEGER
Rule 26 type_base -> REAL
Rule 27 type_base -> CHAR
Rule 28 type_base -> BOOLEAN
Rule 29 range -> NUMBER DOT DOT NUMBER
Rule 30 procedure_declaration -> PROCEDURE ID LPAREN enter_args args RPAREN SEMICOLON compound_stmt SEMICOLON
Rule 31 function_declaration -> FUNCTION ID LPAREN enter_args args RPAREN COLON type_base SEMICOLON compound_stmt SEMICOLON
Rule 32 enter_args -> <empty>
Rule 33 compound_stmt -> BEGIN statement_list END
Rule 34 compound_stmt -> var_section BEGIN statement_list END
Rule 35 statement_list -> statement_list statement
Rule 36 statement_list -> statement
Rule 37 statement_list -> empty
Rule 38 statement -> call_stmt SEMICOLON
Rule 39 statement -> assignment_stmt SEMICOLON
Rule 40 statement -> compound_stmt
Rule 41 statement -> if_stmt
Rule 42 statement -> for_stmt
Rule 43 if_stmt -> IF LPAREN expression RPAREN THEN statement
Rule 44 if_stmt -> IF LPAREN expression RPAREN THEN statement ELSE statement
Rule 45 for_stmt -> FOR ID ASSIGN expression TO expression DO loop_guard statement
Rule 46 loop_guard -> <empty>
Rule 47 assignment_stmt -> ID ASSIGN expression
Rule 48 call_stmt -> ID LPAREN expression_list RPAREN
Rule 49 call_stmt -> ID
Rule 50 args -> arg_list
Rule 51 args -> empty
Rule 52 arg_list -> arg_spec
Rule 53 arg_list -> arg_list SEMICOLON arg_spec
Rule 54 arg_spec -> ID COLON type_base
Rule 55 arg_spec -> VAR ID COLON type_base
Rule 56 expression_list -> expression_list COMMA expression
Rule 57 expression_list -> expression
Rule 58 expression -> term
Rule 59 expression -> expression PLUS term
Rule 60 expression -> expression MINUS term
Rule 61 expression -> expression GREATER term
Rule 62 expression -> expression LESS term
Rule 63 expression -> expression GREATEREQUAL term
Rule 64 expression -> expression LESSEQUAL term
Rule 65 expression -> expression NOTEQUAL term
Rule 66 term -> factor
Rule 67 term -> term TIMES factor
Rule 68 term -> term DIVIDE factor
Rule 69 factor -> NUMBER
Rule 70 factor -> STRING
Rule 71 factor -> call_stmt
Rule 72 factor -> LPAREN expression RPAREN
Rule 73 empty -> <empty>
Terminals, with rules where they appear
ABSOLUTE :
AND :
ARRAY : 23
ASM :
ASSIGN : 45 47
BEGIN : 33 34
BOOLEAN : 28
BREAK :
CASE :
CHAR : 27
COLON : 20 21 31 54 55
COMMA : 5 56
CONST : 13
CONSTRUCTOR :
CONTINUE :
DESTRUCTOR :
DIV :
DIVIDE : 68
DO : 45
DOT : 1 29 29
DOWNTO :
ELSE : 44
END : 33 34
EQUALS : 14 15 17 18
EXTERNAL :
FILE :
FOR : 45
FORWARD :
FUNCTION : 31
GOTO :
GREATER : 61
GREATEREQUAL : 63
ID : 1 4 5 14 15 17 18 30 31 45 47 48 49 54 55
IF : 43 44
IMPLEMENTATION :
IN :
INHERITED :
INLINE :
INTEGER : 25
INTERFACE :
INTERRUPT :
LABEL :
LBRACKET : 23 24
LESS : 62
LESSEQUAL : 64
LPAREN : 30 31 43 44 48 72
MINUS : 60
MOD :
NIL :
NOT :
NOTEQUAL : 65
NUMBER : 24 29 29 69
OF : 23
ON :
OPERATOR :
OR :
PACKED :
PLUS : 59
PROCEDURE : 30
PROGRAM : 1
RBRACKET : 23 24
REAL : 26
RECORD :
REPEAT :
RPAREN : 30 31 43 44 48 72
SELF :
SEMICOLON : 1 2 14 15 17 18 20 21 30 30 31 31 38 39 53
SET :
SHL :
SHR :
SINGLE_COMMENT :
STRING : 24 70
THEN : 43 44
TIMES : 67
TO : 45
TYPE : 16
UNIT :
UNTIL :
USES : 2
VAR : 19 55
WHILE :
WITH :
XOR :
error :
Nonterminals, with rules where they appear
arg_list : 50 53
arg_spec : 52 53
args : 30 31
assignment_stmt : 39
call_stmt : 38 71
compound_stmt : 1 30 31 40
const_list : 13 14
const_section : 8
declaration_sections : 1 6
empty : 3 7 37 51
enter_args : 30 31
expression : 14 15 43 44 45 45 47 56 57 59 60 61 62 63 64 65 72
expression_list : 48 56
factor : 66 67 68
for_stmt : 42
function_declaration : 12
id_list : 2 5 20 21
if_stmt : 41
loop_guard : 45
procedure_declaration : 11
program : 0
range : 23
section : 6
statement : 35 36 43 44 44 45
statement_list : 33 34 35
term : 58 59 60 61 62 63 64 65 67 68
type_base : 22 23 31 54 55
type_list : 16 17
type_section : 9
type_specifier : 17 18 20 21
uses_clause : 1
var_list : 19 20
var_section : 10 34
Parsing method: LALR
state 0
(0) S' -> . program
(1) program -> . PROGRAM ID SEMICOLON uses_clause declaration_sections compound_stmt DOT
PROGRAM shift and go to state 2
program shift and go to state 1
state 1
(0) S' -> program .
state 2
(1) program -> PROGRAM . ID SEMICOLON uses_clause declaration_sections compound_stmt DOT
ID shift and go to state 3
state 3
(1) program -> PROGRAM ID . SEMICOLON uses_clause declaration_sections compound_stmt DOT
SEMICOLON shift and go to state 4
state 4
(1) program -> PROGRAM ID SEMICOLON . uses_clause declaration_sections compound_stmt DOT
(2) uses_clause -> . USES id_list SEMICOLON
(3) uses_clause -> . empty
(73) empty -> .
USES shift and go to state 6
BEGIN reduce using rule 73 (empty -> .)
VAR reduce using rule 73 (empty -> .)
CONST reduce using rule 73 (empty -> .)
TYPE reduce using rule 73 (empty -> .)
PROCEDURE reduce using rule 73 (empty -> .)
FUNCTION reduce using rule 73 (empty -> .)
uses_clause shift and go to state 5
empty shift and go to state 7
state 5
(1) program -> PROGRAM ID SEMICOLON uses_clause . declaration_sections compound_stmt DOT
(6) declaration_sections -> . declaration_sections section
(7) declaration_sections -> . empty
(73) empty -> .
BEGIN reduce using rule 73 (empty -> .)
VAR reduce using rule 73 (empty -> .)
CONST reduce using rule 73 (empty -> .)
TYPE reduce using rule 73 (empty -> .)
PROCEDURE reduce using rule 73 (empty -> .)
FUNCTION reduce using rule 73 (empty -> .)
declaration_sections shift and go to state 8
empty shift and go to state 9
state 6
(2) uses_clause -> USES . id_list SEMICOLON
(4) id_list -> . ID
(5) id_list -> . id_list COMMA ID
ID shift and go to state 11
id_list shift and go to state 10
state 7
(3) uses_clause -> empty .
BEGIN reduce using rule 3 (uses_clause -> empty .)
VAR reduce using rule 3 (uses_clause -> empty .)
CONST reduce using rule 3 (uses_clause -> empty .)
TYPE reduce using rule 3 (uses_clause -> empty .)
PROCEDURE reduce using rule 3 (uses_clause -> empty .)
FUNCTION reduce using rule 3 (uses_clause -> empty .)
state 8
(1) program -> PROGRAM ID SEMICOLON uses_clause declaration_sections . compound_stmt DOT
(6) declaration_sections -> declaration_sections . section
(33) compound_stmt -> . BEGIN statement_list END
(34) compound_stmt -> . var_section BEGIN statement_list END
(8) section -> . const_section
(9) section -> . type_section
(10) section -> . var_section
(11) section -> . procedure_declaration
(12) section -> . function_declaration
(19) var_section -> . VAR var_list
(13) const_section -> . CONST const_list
(16) type_section -> . TYPE type_list
(30) procedure_declaration -> . PROCEDURE ID LPAREN enter_args args RPAREN SEMICOLON compound_stmt SEMICOLON
(31) function_declaration -> . FUNCTION ID LPAREN enter_args args RPAREN COLON type_base SEMICOLON compound_stmt SEMICOLON
BEGIN shift and go to state 14
VAR shift and go to state 20
CONST shift and go to state 21
TYPE shift and go to state 22
PROCEDURE shift and go to state 23
FUNCTION shift and go to state 24
compound_stmt shift and go to state 12
section shift and go to state 13
var_section shift and go to state 15
const_section shift and go to state 16
type_section shift and go to state 17
procedure_declaration shift and go to state 18
function_declaration shift and go to state 19
state 9
(7) declaration_sections -> empty .
BEGIN reduce using rule 7 (declaration_sections -> empty .)
VAR reduce using rule 7 (declaration_sections -> empty .)
CONST reduce using rule 7 (declaration_sections -> empty .)
TYPE reduce using rule 7 (declaration_sections -> empty .)
PROCEDURE reduce using rule 7 (declaration_sections -> empty .)
FUNCTION reduce using rule 7 (declaration_sections -> empty .)
state 10
(2) uses_clause -> USES id_list . SEMICOLON
(5) id_list -> id_list . COMMA ID
SEMICOLON shift and go to state 25
COMMA shift and go to state 26
state 11
(4) id_list -> ID .
SEMICOLON reduce using rule 4 (id_list -> ID .)
COMMA reduce using rule 4 (id_list -> ID .)
COLON reduce using rule 4 (id_list -> ID .)
state 12
(1) program -> PROGRAM ID SEMICOLON uses_clause declaration_sections compound_stmt . DOT
DOT shift and go to state 27
state 13
(6) declaration_sections -> declaration_sections section .
BEGIN reduce using rule 6 (declaration_sections -> declaration_sections section .)
VAR reduce using rule 6 (declaration_sections -> declaration_sections section .)
CONST reduce using rule 6 (declaration_sections -> declaration_sections section .)
TYPE reduce using rule 6 (declaration_sections -> declaration_sections section .)
PROCEDURE reduce using rule 6 (declaration_sections -> declaration_sections section .)
FUNCTION reduce using rule 6 (declaration_sections -> declaration_sections section .)
state 14
(33) compound_stmt -> BEGIN . statement_list END
(35) statement_list -> . statement_list statement
(36) statement_list -> . statement
(37) statement_list -> . empty
(38) statement -> . call_stmt SEMICOLON
(39) statement -> . assignment_stmt SEMICOLON
(40) statement -> . compound_stmt
(41) statement -> . if_stmt
(42) statement -> . for_stmt
(73) empty -> .
(48) call_stmt -> . ID LPAREN expression_list RPAREN
(49) call_stmt -> . ID
(47) assignment_stmt -> . ID ASSIGN expression
(33) compound_stmt -> . BEGIN statement_list END
(34) compound_stmt -> . var_section BEGIN statement_list END
(43) if_stmt -> . IF LPAREN expression RPAREN THEN statement
(44) if_stmt -> . IF LPAREN expression RPAREN THEN statement ELSE statement
(45) for_stmt -> . FOR ID ASSIGN expression TO expression DO loop_guard statement
(19) var_section -> . VAR var_list
! shift/reduce conflict for ID resolved as shift
! shift/reduce conflict for BEGIN resolved as shift
! shift/reduce conflict for IF resolved as shift
! shift/reduce conflict for FOR resolved as shift
! shift/reduce conflict for VAR resolved as shift
END reduce using rule 73 (empty -> .)
ID shift and go to state 36
BEGIN shift and go to state 14
IF shift and go to state 38
FOR shift and go to state 39
VAR shift and go to state 20
! ID [ reduce using rule 73 (empty -> .) ]
! BEGIN [ reduce using rule 73 (empty -> .) ]
! IF [ reduce using rule 73 (empty -> .) ]
! FOR [ reduce using rule 73 (empty -> .) ]
! VAR [ reduce using rule 73 (empty -> .) ]
statement_list shift and go to state 28
statement shift and go to state 29
empty shift and go to state 30
call_stmt shift and go to state 31
assignment_stmt shift and go to state 32
compound_stmt shift and go to state 33
if_stmt shift and go to state 34
for_stmt shift and go to state 35
var_section shift and go to state 37
state 15
(34) compound_stmt -> var_section . BEGIN statement_list END
(10) section -> var_section .
! shift/reduce conflict for BEGIN resolved as shift
BEGIN shift and go to state 40
VAR reduce using rule 10 (section -> var_section .)
CONST reduce using rule 10 (section -> var_section .)
TYPE reduce using rule 10 (section -> var_section .)
PROCEDURE reduce using rule 10 (section -> var_section .)
FUNCTION reduce using rule 10 (section -> var_section .)
! BEGIN [ reduce using rule 10 (section -> var_section .) ]
state 16
(8) section -> const_section .
BEGIN reduce using rule 8 (section -> const_section .)
VAR reduce using rule 8 (section -> const_section .)
CONST reduce using rule 8 (section -> const_section .)
TYPE reduce using rule 8 (section -> const_section .)
PROCEDURE reduce using rule 8 (section -> const_section .)
FUNCTION reduce using rule 8 (section -> const_section .)
state 17
(9) section -> type_section .
BEGIN reduce using rule 9 (section -> type_section .)
VAR reduce using rule 9 (section -> type_section .)
CONST reduce using rule 9 (section -> type_section .)
TYPE reduce using rule 9 (section -> type_section .)
PROCEDURE reduce using rule 9 (section -> type_section .)
FUNCTION reduce using rule 9 (section -> type_section .)
state 18
(11) section -> procedure_declaration .
BEGIN reduce using rule 11 (section -> procedure_declaration .)
VAR reduce using rule 11 (section -> procedure_declaration .)
CONST reduce using rule 11 (section -> procedure_declaration .)
TYPE reduce using rule 11 (section -> procedure_declaration .)
PROCEDURE reduce using rule 11 (section -> procedure_declaration .)
FUNCTION reduce using rule 11 (section -> procedure_declaration .)
state 19
(12) section -> function_declaration .
BEGIN reduce using rule 12 (section -> function_declaration .)
VAR reduce using rule 12 (section -> function_declaration .)
CONST reduce using rule 12 (section -> function_declaration .)
TYPE reduce using rule 12 (section -> function_declaration .)
PROCEDURE reduce using rule 12 (section -> function_declaration .)
FUNCTION reduce using rule 12 (section -> function_declaration .)
state 20
(19) var_section -> VAR . var_list
(20) var_list -> . var_list id_list COLON type_specifier SEMICOLON
(21) var_list -> . id_list COLON type_specifier SEMICOLON
(4) id_list -> . ID
(5) id_list -> . id_list COMMA ID
ID shift and go to state 11
var_list shift and go to state 41
id_list shift and go to state 42
state 21
(13) const_section -> CONST . const_list
(14) const_list -> . const_list ID EQUALS expression SEMICOLON
(15) const_list -> . ID EQUALS expression SEMICOLON
ID shift and go to state 44
const_list shift and go to state 43
state 22
(16) type_section -> TYPE . type_list
(17) type_list -> . type_list ID EQUALS type_specifier SEMICOLON
(18) type_list -> . ID EQUALS type_specifier SEMICOLON
ID shift and go to state 46
type_list shift and go to state 45
state 23
(30) procedure_declaration -> PROCEDURE . ID LPAREN enter_args args RPAREN SEMICOLON compound_stmt SEMICOLON
ID shift and go to state 47
state 24
(31) function_declaration -> FUNCTION . ID LPAREN enter_args args RPAREN COLON type_base SEMICOLON compound_stmt SEMICOLON
ID shift and go to state 48
state 25
(2) uses_clause -> USES id_list SEMICOLON .
BEGIN reduce using rule 2 (uses_clause -> USES id_list SEMICOLON .)
VAR reduce using rule 2 (uses_clause -> USES id_list SEMICOLON .)
CONST reduce using rule 2 (uses_clause -> USES id_list SEMICOLON .)
TYPE reduce using rule 2 (uses_clause -> USES id_list SEMICOLON .)
PROCEDURE reduce using rule 2 (uses_clause -> USES id_list SEMICOLON .)
FUNCTION reduce using rule 2 (uses_clause -> USES id_list SEMICOLON .)
state 26
(5) id_list -> id_list COMMA . ID
ID shift and go to state 49
state 27
(1) program -> PROGRAM ID SEMICOLON uses_clause declaration_sections compound_stmt DOT .
$end reduce using rule 1 (program -> PROGRAM ID SEMICOLON uses_clause declaration_sections compound_stmt DOT .)
state 28
(33) compound_stmt -> BEGIN statement_list . END
(35) statement_list -> statement_list . statement
(38) statement -> . call_stmt SEMICOLON
(39) statement -> . assignment_stmt SEMICOLON
(40) statement -> . compound_stmt
(41) statement -> . if_stmt
(42) statement -> . for_stmt
(48) call_stmt -> . ID LPAREN expression_list RPAREN
(49) call_stmt -> . ID
(47) assignment_stmt -> . ID ASSIGN expression
(33) compound_stmt -> . BEGIN statement_list END
(34) compound_stmt -> . var_section BEGIN statement_list END
(43) if_stmt -> . IF LPAREN expression RPAREN THEN statement
(44) if_stmt -> . IF LPAREN expression RPAREN THEN statement ELSE statement
(45) for_stmt -> . FOR ID ASSIGN expression TO expression DO loop_guard statement
(19) var_section -> . VAR var_list
END shift and go to state 50
ID shift and go to state 36
BEGIN shift and go to state 14
IF shift and go to state 38
FOR shift and go to state 39
VAR shift and go to state 20
statement shift and go to state 51
call_stmt shift and go to state 31
assignment_stmt shift and go to state 32
compound_stmt shift and go to state 33
if_stmt shift and go to state 34
for_stmt shift and go to state 35
var_section shift and go to state 37
state 29
(36) statement_list -> statement .
END reduce using rule 36 (statement_list -> statement .)
ID reduce using rule 36 (statement_list -> statement .)
BEGIN reduce using rule 36 (statement_list -> statement .)
IF reduce using rule 36 (statement_list -> statement .)
FOR reduce using rule 36 (statement_list -> statement .)
VAR reduce using rule 36 (statement_list -> statement .)
state 30
(37) statement_list -> empty .
END reduce using rule 37 (statement_list -> empty .)
ID reduce using rule 37 (statement_list -> empty .)
BEGIN reduce using rule 37 (statement_list -> empty .)
IF reduce using rule 37 (statement_list -> empty .)
FOR reduce using rule 37 (statement_list -> empty .)
VAR reduce using rule 37 (statement_list -> empty .)
state 31
(38) statement -> call_stmt . SEMICOLON
SEMICOLON shift and go to state 52
state 32
(39) statement -> assignment_stmt . SEMICOLON
SEMICOLON shift and go to state 53
state 33
(40) statement -> compound_stmt .
END reduce using rule 40 (statement -> compound_stmt .)
ID reduce using rule 40 (statement -> compound_stmt .)
BEGIN reduce using rule 40 (statement -> compound_stmt .)
IF reduce using rule 40 (statement -> compound_stmt .)
FOR reduce using rule 40 (statement -> compound_stmt .)
VAR reduce using rule 40 (statement -> compound_stmt .)
ELSE reduce using rule 40 (statement -> compound_stmt .)
state 34
(41) statement -> if_stmt .
END reduce using rule 41 (statement -> if_stmt .)
ID reduce using rule 41 (statement -> if_stmt .)
BEGIN reduce using rule 41 (statement -> if_stmt .)
IF reduce using rule 41 (statement -> if_stmt .)
FOR reduce using rule 41 (statement -> if_stmt .)
VAR reduce using rule 41 (statement -> if_stmt .)
ELSE reduce using rule 41 (statement -> if_stmt .)
state 35
(42) statement -> for_stmt .
END reduce using rule 42 (statement -> for_stmt .)
ID reduce using rule 42 (statement -> for_stmt .)
BEGIN reduce using rule 42 (statement -> for_stmt .)
IF reduce using rule 42 (statement -> for_stmt .)
FOR reduce using rule 42 (statement -> for_stmt .)
VAR reduce using rule 42 (statement -> for_stmt .)
ELSE reduce using rule 42 (statement -> for_stmt .)
state 36
(48) call_stmt -> ID . LPAREN expression_list RPAREN
(49) call_stmt -> ID .
(47) assignment_stmt -> ID . ASSIGN expression
LPAREN shift and go to state 54
SEMICOLON reduce using rule 49 (call_stmt -> ID .)
ASSIGN shift and go to state 55
state 37
(34) compound_stmt -> var_section . BEGIN statement_list END
BEGIN shift and go to state 40
state 38
(43) if_stmt -> IF . LPAREN expression RPAREN THEN statement
(44) if_stmt -> IF . LPAREN expression RPAREN THEN statement ELSE statement
LPAREN shift and go to state 56
state 39
(45) for_stmt -> FOR . ID ASSIGN expression TO expression DO loop_guard statement
ID shift and go to state 57
state 40
(34) compound_stmt -> var_section BEGIN . statement_list END
(35) statement_list -> . statement_list statement
(36) statement_list -> . statement
(37) statement_list -> . empty
(38) statement -> . call_stmt SEMICOLON
(39) statement -> . assignment_stmt SEMICOLON
(40) statement -> . compound_stmt
(41) statement -> . if_stmt
(42) statement -> . for_stmt
(73) empty -> .
(48) call_stmt -> . ID LPAREN expression_list RPAREN
(49) call_stmt -> . ID
(47) assignment_stmt -> . ID ASSIGN expression
(33) compound_stmt -> . BEGIN statement_list END
(34) compound_stmt -> . var_section BEGIN statement_list END
(43) if_stmt -> . IF LPAREN expression RPAREN THEN statement
(44) if_stmt -> . IF LPAREN expression RPAREN THEN statement ELSE statement
(45) for_stmt -> . FOR ID ASSIGN expression TO expression DO loop_guard statement
(19) var_section -> . VAR var_list
! shift/reduce conflict for ID resolved as shift
! shift/reduce conflict for BEGIN resolved as shift
! shift/reduce conflict for IF resolved as shift
! shift/reduce conflict for FOR resolved as shift
! shift/reduce conflict for VAR resolved as shift
END reduce using rule 73 (empty -> .)
ID shift and go to state 36
BEGIN shift and go to state 14
IF shift and go to state 38
FOR shift and go to state 39
VAR shift and go to state 20
! ID [ reduce using rule 73 (empty -> .) ]
! BEGIN [ reduce using rule 73 (empty -> .) ]
! IF [ reduce using rule 73 (empty -> .) ]
! FOR [ reduce using rule 73 (empty -> .) ]
! VAR [ reduce using rule 73 (empty -> .) ]
var_section shift and go to state 37
statement_list shift and go to state 58
statement shift and go to state 29
empty shift and go to state 30
call_stmt shift and go to state 31
assignment_stmt shift and go to state 32
compound_stmt shift and go to state 33
if_stmt shift and go to state 34
for_stmt shift and go to state 35
state 41
(19) var_section -> VAR var_list .
(20) var_list -> var_list . id_list COLON type_specifier SEMICOLON
(4) id_list -> . ID
(5) id_list -> . id_list COMMA ID
BEGIN reduce using rule 19 (var_section -> VAR var_list .)
VAR reduce using rule 19 (var_section -> VAR var_list .)
CONST reduce using rule 19 (var_section -> VAR var_list .)
TYPE reduce using rule 19 (var_section -> VAR var_list .)
PROCEDURE reduce using rule 19 (var_section -> VAR var_list .)
FUNCTION reduce using rule 19 (var_section -> VAR var_list .)
ID shift and go to state 11
id_list shift and go to state 59
state 42
(21) var_list -> id_list . COLON type_specifier SEMICOLON
(5) id_list -> id_list . COMMA ID
COLON shift and go to state 60
COMMA shift and go to state 26
state 43
(13) const_section -> CONST const_list .
(14) const_list -> const_list . ID EQUALS expression SEMICOLON
BEGIN reduce using rule 13 (const_section -> CONST const_list .)
VAR reduce using rule 13 (const_section -> CONST const_list .)
CONST reduce using rule 13 (const_section -> CONST const_list .)
TYPE reduce using rule 13 (const_section -> CONST const_list .)
PROCEDURE reduce using rule 13 (const_section -> CONST const_list .)
FUNCTION reduce using rule 13 (const_section -> CONST const_list .)
ID shift and go to state 61
state 44
(15) const_list -> ID . EQUALS expression SEMICOLON
EQUALS shift and go to state 62
state 45
(16) type_section -> TYPE type_list .
(17) type_list -> type_list . ID EQUALS type_specifier SEMICOLON
BEGIN reduce using rule 16 (type_section -> TYPE type_list .)
VAR reduce using rule 16 (type_section -> TYPE type_list .)
CONST reduce using rule 16 (type_section -> TYPE type_list .)
TYPE reduce using rule 16 (type_section -> TYPE type_list .)
PROCEDURE reduce using rule 16 (type_section -> TYPE type_list .)
FUNCTION reduce using rule 16 (type_section -> TYPE type_list .)
ID shift and go to state 63
state 46
(18) type_list -> ID . EQUALS type_specifier SEMICOLON
EQUALS shift and go to state 64
state 47
(30) procedure_declaration -> PROCEDURE ID . LPAREN enter_args args RPAREN SEMICOLON compound_stmt SEMICOLON
LPAREN shift and go to state 65
state 48
(31) function_declaration -> FUNCTION ID . LPAREN enter_args args RPAREN COLON type_base SEMICOLON compound_stmt SEMICOLON
LPAREN shift and go to state 66
state 49
(5) id_list -> id_list COMMA ID .
SEMICOLON reduce using rule 5 (id_list -> id_list COMMA ID .)
COMMA reduce using rule 5 (id_list -> id_list COMMA ID .)
COLON reduce using rule 5 (id_list -> id_list COMMA ID .)
state 50
(33) compound_stmt -> BEGIN statement_list END .
DOT reduce using rule 33 (compound_stmt -> BEGIN statement_list END .)
END reduce using rule 33 (compound_stmt -> BEGIN statement_list END .)
ID reduce using rule 33 (compound_stmt -> BEGIN statement_list END .)
BEGIN reduce using rule 33 (compound_stmt -> BEGIN statement_list END .)
IF reduce using rule 33 (compound_stmt -> BEGIN statement_list END .)
FOR reduce using rule 33 (compound_stmt -> BEGIN statement_list END .)
VAR reduce using rule 33 (compound_stmt -> BEGIN statement_list END .)
ELSE reduce using rule 33 (compound_stmt -> BEGIN statement_list END .)
SEMICOLON reduce using rule 33 (compound_stmt -> BEGIN statement_list END .)
state 51
(35) statement_list -> statement_list statement .
END reduce using rule 35 (statement_list -> statement_list statement .)
ID reduce using rule 35 (statement_list -> statement_list statement .)
BEGIN reduce using rule 35 (statement_list -> statement_list statement .)
IF reduce using rule 35 (statement_list -> statement_list statement .)
FOR reduce using rule 35 (statement_list -> statement_list statement .)
VAR reduce using rule 35 (statement_list -> statement_list statement .)
state 52
(38) statement -> call_stmt SEMICOLON .
END reduce using rule 38 (statement -> call_stmt SEMICOLON .)
ID reduce using rule 38 (statement -> call_stmt SEMICOLON .)
BEGIN reduce using rule 38 (statement -> call_stmt SEMICOLON .)
IF reduce using rule 38 (statement -> call_stmt SEMICOLON .)
FOR reduce using rule 38 (statement -> call_stmt SEMICOLON .)
VAR reduce using rule 38 (statement -> call_stmt SEMICOLON .)
ELSE reduce using rule 38 (statement -> call_stmt SEMICOLON .)
state 53
(39) statement -> assignment_stmt SEMICOLON .
END reduce using rule 39 (statement -> assignment_stmt SEMICOLON .)
ID reduce using rule 39 (statement -> assignment_stmt SEMICOLON .)
BEGIN reduce using rule 39 (statement -> assignment_stmt SEMICOLON .)
IF reduce using rule 39 (statement -> assignment_stmt SEMICOLON .)
FOR reduce using rule 39 (statement -> assignment_stmt SEMICOLON .)
VAR reduce using rule 39 (statement -> assignment_stmt SEMICOLON .)
ELSE reduce using rule 39 (statement -> assignment_stmt SEMICOLON .)
state 54
(48) call_stmt -> ID LPAREN . expression_list RPAREN
(56) expression_list -> . expression_list COMMA expression
(57) expression_list -> . expression
(58) expression -> . term
(59) expression -> . expression PLUS term
(60) expression -> . expression MINUS term
(61) expression -> . expression GREATER term
(62) expression -> . expression LESS term
(63) expression -> . expression GREATEREQUAL term
(64) expression -> . expression LESSEQUAL term
(65) expression -> . expression NOTEQUAL term
(66) term -> . factor
(67) term -> . term TIMES factor
(68) term -> . term DIVIDE factor
(69) factor -> . NUMBER
(70) factor -> . STRING
(71) factor -> . call_stmt
(72) factor -> . LPAREN expression RPAREN
(48) call_stmt -> . ID LPAREN expression_list RPAREN
(49) call_stmt -> . ID
NUMBER shift and go to state 73
STRING shift and go to state 74
LPAREN shift and go to state 68
ID shift and go to state 67
expression_list shift and go to state 69
expression shift and go to state 70
term shift and go to state 71
factor shift and go to state 72
call_stmt shift and go to state 75
state 55
(47) assignment_stmt -> ID ASSIGN . expression
(58) expression -> . term
(59) expression -> . expression PLUS term
(60) expression -> . expression MINUS term
(61) expression -> . expression GREATER term
(62) expression -> . expression LESS term
(63) expression -> . expression GREATEREQUAL term
(64) expression -> . expression LESSEQUAL term
(65) expression -> . expression NOTEQUAL term
(66) term -> . factor
(67) term -> . term TIMES factor
(68) term -> . term DIVIDE factor
(69) factor -> . NUMBER
(70) factor -> . STRING
(71) factor -> . call_stmt
(72) factor -> . LPAREN expression RPAREN
(48) call_stmt -> . ID LPAREN expression_list RPAREN
(49) call_stmt -> . ID
NUMBER shift and go to state 73
STRING shift and go to state 74
LPAREN shift and go to state 68
ID shift and go to state 67
expression shift and go to state 76