-
Notifications
You must be signed in to change notification settings - Fork 0
/
parser.output
4151 lines (2909 loc) · 123 KB
/
parser.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
State 97 conflicts: 1 shift/reduce
State 108 conflicts: 1 shift/reduce
State 115 conflicts: 5 shift/reduce
State 132 conflicts: 5 shift/reduce
State 133 conflicts: 5 shift/reduce
State 134 conflicts: 5 shift/reduce
State 135 conflicts: 5 shift/reduce
State 137 conflicts: 5 shift/reduce
State 185 conflicts: 1 shift/reduce
State 202 conflicts: 5 shift/reduce
State 246 conflicts: 1 shift/reduce
State 273 conflicts: 1 shift/reduce
State 279 conflicts: 1 shift/reduce
Grammar
0 $accept: program $end
1 program: function_list
2 function_list: function_s
3 | function_list function_s
4 function_s: function_definition
5 | ENDLINE
6 statement_list: statement
7 | statement_list statement
8 function_definition: TASK VARIABLE VARIABLE ',' '[' declaration_list ']' ENDLINE statement_list RESULT VARIABLE
9 | TASK VARIABLE VARIABLE ENDLINE statement_list RESULT VARIABLE
10 | TASK FINDEXIT ENDLINE statement_list RESULT
11 | TASK VARIABLE VARIABLE error '[' declaration_list ']' ENDLINE statement_list RESULT VARIABLE
12 | TASK VARIABLE error
13 | TASK error VARIABLE ',' '[' declaration_list ']' ENDLINE statement_list RESULT VARIABLE
14 | TASK error VARIABLE ENDLINE statement_list RESULT VARIABLE
15 | TASK VARIABLE VARIABLE ',' '[' declaration_list ']' ENDLINE statement_list error
16 | TASK VARIABLE VARIABLE ENDLINE statement_list error
17 | TASK FINDEXIT ENDLINE statement_list error
18 | TASK VARIABLE VARIABLE ',' '[' declaration_list ']' ENDLINE statement_list RESULT error
19 | TASK VARIABLE VARIABLE ENDLINE statement_list RESULT error
20 | TASK error
21 call_definition: DO VARIABLE VARIABLE ',' '[' declaration_list ']'
22 | DO VARIABLE VARIABLE
23 | DO error VARIABLE
24 | DO error VARIABLE ',' '[' declaration_list ']'
25 | DO VARIABLE error
26 | DO VARIABLE VARIABLE '[' declaration_list ']'
27 | DO error
28 declaration_list: VARIABLE
29 | declaration_list ',' VARIABLE
30 expression_list: expression
31 | expression_list ',' expression
32 expression: BOOL
33 | INTEGER
34 | VARIABLE
35 | binary_operation
36 | robot_operation
37 | unary_operation
38 | VARIABLE '[' expression_list ']'
39 | VARIABLE '[' error ']'
40 | VARIABLE '[' expression_list
41 | '(' expression ')'
42 | '(' error ')'
43 binary_operation: expression '+' expression
44 | expression '*' expression
45 | expression '-' expression
46 | expression '/' expression
47 | expression AND expression
48 robot_operation: MOVE
49 | R_LEFT
50 | R_RIGHT
51 | GET_E
52 unary_operation: compare_operation
53 | '-' expression
54 | NOT expression
55 | NOT error
56 | SIZE '(' VARIABLE ')'
57 | SIZE '(' VARIABLE error
58 | SIZE '(' ')'
59 | SIZE '(' error ')'
60 | SIZE error
61 | GET VARIABLE
62 compare_operation: MXCOMP expression
63 | ELCOMP expression
64 | MXTRUE expression
65 | MXFALSE expression
66 statement: statement_s ENDLINE
67 | error ENDLINE
68 | PLEASE statement_s ENDLINE
69 | PLEASE statement_s THANKS ENDLINE
70 | statement_s THANKS ENDLINE
71 | ENDLINE
72 statement_s: compound_statement
73 | definition
74 | unary_statement
75 | function_definition
76 | call_definition
77 | robot_operation
78 | for_loop
79 | switch_state
80 | PRINT VARIABLE
81 | PRINT error
82 | VARIABLE '=' expression
83 | VARIABLE error expression
84 | appeal_state '=' expression
85 | appeal_state error expression
86 switch_state: SWITCH expression BOOL statement_list '[' BOOL statement_list ']'
87 | SWITCH expression BOOL statement_list '[' BOOL statement_list error
88 | SWITCH expression BOOL statement_list '[' error
89 | SWITCH expression BOOL statement_list error BOOL
90 | SWITCH expression error
91 | SWITCH error
92 appeal_state: VARIABLE '[' expression_list ']'
93 | VARIABLE '[' error ']'
94 | VARIABLE '[' ']'
95 | VARIABLE '[' expression_list error
96 | VARIABLE error
97 for_loop: FOR VARIABLE BOUNDARY VARIABLE STEP VARIABLE ENDLINE '(' statement_list ')'
98 | FOR error
99 | FOR BOUNDARY VARIABLE STEP VARIABLE ENDLINE '(' statement_list ')'
100 | FOR VARIABLE BOUNDARY STEP VARIABLE ENDLINE '(' statement_list ')'
101 | FOR VARIABLE BOUNDARY VARIABLE STEP ENDLINE '(' statement_list ')'
102 | FOR VARIABLE BOUNDARY VARIABLE STEP VARIABLE error
103 | FOR VARIABLE BOUNDARY VARIABLE STEP VARIABLE ENDLINE '(' statement_list error
104 compound_statement: '(' ')'
105 | '(' block_item ')'
106 block_item: statement
107 | block_item statement
108 definition: VAR VARIABLE '[' expression_list ']' '=' INTEGER
109 | VAR VARIABLE '[' expression_list ']' '=' BOOL
110 | VAR VARIABLE '=' INTEGER
111 | VAR VARIABLE '=' BOOL
112 | VAR VARIABLE '[' expression_list ']' '=' error
113 | VAR VARIABLE '=' error
114 | VAR VARIABLE '[' expression_list ']' error
115 | VAR VARIABLE '[' expression_list error '=' INTEGER
116 | VAR VARIABLE '[' expression_list error '=' BOOL
117 | VAR VARIABLE '[' error ']' '=' INTEGER
118 | VAR VARIABLE '[' error ']' '=' BOOL
119 | VAR VARIABLE error
120 | VAR error '[' expression_list ']' '=' INTEGER
121 | VAR error '[' expression_list ']' '=' BOOL
122 | VAR error
123 unary_statement: LOGITIZE VARIABLE
124 | DIGITIZE VARIABLE
125 | REDUCE VARIABLE '[' INTEGER ']'
126 | EXTENED VARIABLE '[' INTEGER ']'
127 | REDUCE VARIABLE '[' INTEGER error
128 | REDUCE VARIABLE '[' error ']'
129 | REDUCE VARIABLE '[' error
130 | REDUCE VARIABLE error
131 | REDUCE error
132 | EXTENED VARIABLE '[' INTEGER error
133 | EXTENED VARIABLE '[' error ']'
134 | EXTENED VARIABLE '[' error
135 | EXTENED VARIABLE error
136 | EXTENED error
Terminals, with rules where they appear
$end (0) 0
'(' (40) 41 42 56 57 58 59 97 99 100 101 103 104 105
')' (41) 41 42 56 58 59 97 99 100 101 104 105
'*' (42) 44
'+' (43) 43
',' (44) 8 13 15 18 21 24 29 31
'-' (45) 45 53
'/' (47) 46
'=' (61) 82 84 108 109 110 111 112 113 115 116 117 118 120 121
'[' (91) 8 11 13 15 18 21 24 26 38 39 40 86 87 88 92 93 94 95 108 109
112 114 115 116 117 118 120 121 125 126 127 128 129 132 133 134
']' (93) 8 11 13 15 18 21 24 26 38 39 86 92 93 94 108 109 112 114 117
118 120 121 125 126 128 133
error (256) 11 12 13 14 15 16 17 18 19 20 23 24 25 27 39 42 55 57 59
60 67 81 83 85 87 88 89 90 91 93 95 96 98 102 103 112 113 114 115
116 117 118 119 120 121 122 127 128 129 130 131 132 133 134 135
136
INTEGER (258) 33 108 110 115 117 120 125 126 127 132
VARIABLE (259) 8 9 11 12 13 14 15 16 18 19 21 22 23 24 25 26 28 29
34 38 39 40 56 57 61 80 82 83 92 93 94 95 96 97 99 100 101 102
103 108 109 110 111 112 113 114 115 116 117 118 119 123 124 125
126 127 128 129 130 132 133 134 135
BOOL (260) 32 86 87 88 89 109 111 116 118 121
FINDEXIT (261) 10 17
TASK (262) 8 9 10 11 12 13 14 15 16 17 18 19 20
DO (263) 21 22 23 24 25 26 27
GET (264) 61
RESULT (265) 8 9 10 11 13 14 18 19
MXCOMP (266) 62
ELCOMP (267) 63
MXFALSE (268) 65
MXTRUE (269) 64
NOT (270) 54 55
AND (271) 47
LOGITIZE (272) 123
DIGITIZE (273) 124
SIZE (274) 56 57 58 59 60
REDUCE (275) 125 127 128 129 130 131
EXTENED (276) 126 132 133 134 135 136
R_LEFT (277) 49
R_RIGHT (278) 50
MOVE (279) 48
GET_E (280) 51
VAR (281) 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
ENDLINE (282) 5 8 9 10 11 13 14 15 16 17 18 19 66 67 68 69 70 71 97
99 100 101 103
FOR (283) 97 98 99 100 101 102 103
BOUNDARY (284) 97 99 100 101 102 103
STEP (285) 97 99 100 101 102 103
SWITCH (286) 86 87 88 89 90 91
PRINT (287) 80 81
PLEASE (288) 68 69
THANKS (289) 69 70
UMINUS (290)
Nonterminals, with rules where they appear
$accept (46)
on left: 0
program (47)
on left: 1, on right: 0
function_list (48)
on left: 2 3, on right: 1 3
function_s (49)
on left: 4 5, on right: 2 3
statement_list (50)
on left: 6 7, on right: 7 8 9 10 11 13 14 15 16 17 18 19 86 87
88 89 97 99 100 101 103
function_definition (51)
on left: 8 9 10 11 12 13 14 15 16 17 18 19 20, on right: 4 75
call_definition (52)
on left: 21 22 23 24 25 26 27, on right: 76
declaration_list (53)
on left: 28 29, on right: 8 11 13 15 18 21 24 26 29
expression_list (54)
on left: 30 31, on right: 31 38 40 92 95 108 109 112 114 115 116
120 121
expression (55)
on left: 32 33 34 35 36 37 38 39 40 41 42, on right: 30 31 41 43
44 45 46 47 53 54 62 63 64 65 82 83 84 85 86 87 88 89 90
binary_operation (56)
on left: 43 44 45 46 47, on right: 35
robot_operation (57)
on left: 48 49 50 51, on right: 36 77
unary_operation (58)
on left: 52 53 54 55 56 57 58 59 60 61, on right: 37
compare_operation (59)
on left: 62 63 64 65, on right: 52
statement (60)
on left: 66 67 68 69 70 71, on right: 6 7 106 107
statement_s (61)
on left: 72 73 74 75 76 77 78 79 80 81 82 83 84 85,
on right: 66 68 69 70
switch_state (62)
on left: 86 87 88 89 90 91, on right: 79
appeal_state (63)
on left: 92 93 94 95 96, on right: 84 85
for_loop (64)
on left: 97 98 99 100 101 102 103, on right: 78
compound_statement (65)
on left: 104 105, on right: 72
block_item (66)
on left: 106 107, on right: 105 107
definition (67)
on left: 108 109 110 111 112 113 114 115 116 117 118 119 120 121
122, on right: 73
unary_statement (68)
on left: 123 124 125 126 127 128 129 130 131 132 133 134 135 136,
on right: 74
state 0
0 $accept: . program $end
TASK shift, and go to state 1
ENDLINE shift, and go to state 2
program go to state 3
function_list go to state 4
function_s go to state 5
function_definition go to state 6
state 1
8 function_definition: TASK . VARIABLE VARIABLE ',' '[' declaration_list ']' ENDLINE statement_list RESULT VARIABLE
9 | TASK . VARIABLE VARIABLE ENDLINE statement_list RESULT VARIABLE
10 | TASK . FINDEXIT ENDLINE statement_list RESULT
11 | TASK . VARIABLE VARIABLE error '[' declaration_list ']' ENDLINE statement_list RESULT VARIABLE
12 | TASK . VARIABLE error
13 | TASK . error VARIABLE ',' '[' declaration_list ']' ENDLINE statement_list RESULT VARIABLE
14 | TASK . error VARIABLE ENDLINE statement_list RESULT VARIABLE
15 | TASK . VARIABLE VARIABLE ',' '[' declaration_list ']' ENDLINE statement_list error
16 | TASK . VARIABLE VARIABLE ENDLINE statement_list error
17 | TASK . FINDEXIT ENDLINE statement_list error
18 | TASK . VARIABLE VARIABLE ',' '[' declaration_list ']' ENDLINE statement_list RESULT error
19 | TASK . VARIABLE VARIABLE ENDLINE statement_list RESULT error
20 | TASK . error
error shift, and go to state 7
VARIABLE shift, and go to state 8
FINDEXIT shift, and go to state 9
state 2
5 function_s: ENDLINE .
$default reduce using rule 5 (function_s)
state 3
0 $accept: program . $end
$end shift, and go to state 10
state 4
1 program: function_list .
3 function_list: function_list . function_s
TASK shift, and go to state 1
ENDLINE shift, and go to state 2
$default reduce using rule 1 (program)
function_s go to state 11
function_definition go to state 6
state 5
2 function_list: function_s .
$default reduce using rule 2 (function_list)
state 6
4 function_s: function_definition .
$default reduce using rule 4 (function_s)
state 7
13 function_definition: TASK error . VARIABLE ',' '[' declaration_list ']' ENDLINE statement_list RESULT VARIABLE
14 | TASK error . VARIABLE ENDLINE statement_list RESULT VARIABLE
20 | TASK error .
VARIABLE shift, and go to state 12
$default reduce using rule 20 (function_definition)
state 8
8 function_definition: TASK VARIABLE . VARIABLE ',' '[' declaration_list ']' ENDLINE statement_list RESULT VARIABLE
9 | TASK VARIABLE . VARIABLE ENDLINE statement_list RESULT VARIABLE
11 | TASK VARIABLE . VARIABLE error '[' declaration_list ']' ENDLINE statement_list RESULT VARIABLE
12 | TASK VARIABLE . error
15 | TASK VARIABLE . VARIABLE ',' '[' declaration_list ']' ENDLINE statement_list error
16 | TASK VARIABLE . VARIABLE ENDLINE statement_list error
18 | TASK VARIABLE . VARIABLE ',' '[' declaration_list ']' ENDLINE statement_list RESULT error
19 | TASK VARIABLE . VARIABLE ENDLINE statement_list RESULT error
error shift, and go to state 13
VARIABLE shift, and go to state 14
state 9
10 function_definition: TASK FINDEXIT . ENDLINE statement_list RESULT
17 | TASK FINDEXIT . ENDLINE statement_list error
ENDLINE shift, and go to state 15
state 10
0 $accept: program $end .
$default accept
state 11
3 function_list: function_list function_s .
$default reduce using rule 3 (function_list)
state 12
13 function_definition: TASK error VARIABLE . ',' '[' declaration_list ']' ENDLINE statement_list RESULT VARIABLE
14 | TASK error VARIABLE . ENDLINE statement_list RESULT VARIABLE
ENDLINE shift, and go to state 16
',' shift, and go to state 17
state 13
12 function_definition: TASK VARIABLE error .
$default reduce using rule 12 (function_definition)
state 14
8 function_definition: TASK VARIABLE VARIABLE . ',' '[' declaration_list ']' ENDLINE statement_list RESULT VARIABLE
9 | TASK VARIABLE VARIABLE . ENDLINE statement_list RESULT VARIABLE
11 | TASK VARIABLE VARIABLE . error '[' declaration_list ']' ENDLINE statement_list RESULT VARIABLE
15 | TASK VARIABLE VARIABLE . ',' '[' declaration_list ']' ENDLINE statement_list error
16 | TASK VARIABLE VARIABLE . ENDLINE statement_list error
18 | TASK VARIABLE VARIABLE . ',' '[' declaration_list ']' ENDLINE statement_list RESULT error
19 | TASK VARIABLE VARIABLE . ENDLINE statement_list RESULT error
error shift, and go to state 18
ENDLINE shift, and go to state 19
',' shift, and go to state 20
state 15
10 function_definition: TASK FINDEXIT ENDLINE . statement_list RESULT
17 | TASK FINDEXIT ENDLINE . statement_list error
error shift, and go to state 21
VARIABLE shift, and go to state 22
TASK shift, and go to state 1
DO shift, and go to state 23
LOGITIZE shift, and go to state 24
DIGITIZE shift, and go to state 25
REDUCE shift, and go to state 26
EXTENED shift, and go to state 27
R_LEFT shift, and go to state 28
R_RIGHT shift, and go to state 29
MOVE shift, and go to state 30
GET_E shift, and go to state 31
VAR shift, and go to state 32
ENDLINE shift, and go to state 33
FOR shift, and go to state 34
SWITCH shift, and go to state 35
PRINT shift, and go to state 36
PLEASE shift, and go to state 37
'(' shift, and go to state 38
statement_list go to state 39
function_definition go to state 40
call_definition go to state 41
robot_operation go to state 42
statement go to state 43
statement_s go to state 44
switch_state go to state 45
appeal_state go to state 46
for_loop go to state 47
compound_statement go to state 48
definition go to state 49
unary_statement go to state 50
state 16
14 function_definition: TASK error VARIABLE ENDLINE . statement_list RESULT VARIABLE
error shift, and go to state 21
VARIABLE shift, and go to state 22
TASK shift, and go to state 1
DO shift, and go to state 23
LOGITIZE shift, and go to state 24
DIGITIZE shift, and go to state 25
REDUCE shift, and go to state 26
EXTENED shift, and go to state 27
R_LEFT shift, and go to state 28
R_RIGHT shift, and go to state 29
MOVE shift, and go to state 30
GET_E shift, and go to state 31
VAR shift, and go to state 32
ENDLINE shift, and go to state 33
FOR shift, and go to state 34
SWITCH shift, and go to state 35
PRINT shift, and go to state 36
PLEASE shift, and go to state 37
'(' shift, and go to state 38
statement_list go to state 51
function_definition go to state 40
call_definition go to state 41
robot_operation go to state 42
statement go to state 43
statement_s go to state 44
switch_state go to state 45
appeal_state go to state 46
for_loop go to state 47
compound_statement go to state 48
definition go to state 49
unary_statement go to state 50
state 17
13 function_definition: TASK error VARIABLE ',' . '[' declaration_list ']' ENDLINE statement_list RESULT VARIABLE
'[' shift, and go to state 52
state 18
11 function_definition: TASK VARIABLE VARIABLE error . '[' declaration_list ']' ENDLINE statement_list RESULT VARIABLE
'[' shift, and go to state 53
state 19
9 function_definition: TASK VARIABLE VARIABLE ENDLINE . statement_list RESULT VARIABLE
16 | TASK VARIABLE VARIABLE ENDLINE . statement_list error
19 | TASK VARIABLE VARIABLE ENDLINE . statement_list RESULT error
error shift, and go to state 21
VARIABLE shift, and go to state 22
TASK shift, and go to state 1
DO shift, and go to state 23
LOGITIZE shift, and go to state 24
DIGITIZE shift, and go to state 25
REDUCE shift, and go to state 26
EXTENED shift, and go to state 27
R_LEFT shift, and go to state 28
R_RIGHT shift, and go to state 29
MOVE shift, and go to state 30
GET_E shift, and go to state 31
VAR shift, and go to state 32
ENDLINE shift, and go to state 33
FOR shift, and go to state 34
SWITCH shift, and go to state 35
PRINT shift, and go to state 36
PLEASE shift, and go to state 37
'(' shift, and go to state 38
statement_list go to state 54
function_definition go to state 40
call_definition go to state 41
robot_operation go to state 42
statement go to state 43
statement_s go to state 44
switch_state go to state 45
appeal_state go to state 46
for_loop go to state 47
compound_statement go to state 48
definition go to state 49
unary_statement go to state 50
state 20
8 function_definition: TASK VARIABLE VARIABLE ',' . '[' declaration_list ']' ENDLINE statement_list RESULT VARIABLE
15 | TASK VARIABLE VARIABLE ',' . '[' declaration_list ']' ENDLINE statement_list error
18 | TASK VARIABLE VARIABLE ',' . '[' declaration_list ']' ENDLINE statement_list RESULT error
'[' shift, and go to state 55
state 21
67 statement: error . ENDLINE
ENDLINE shift, and go to state 56
state 22
82 statement_s: VARIABLE . '=' expression
83 | VARIABLE . error expression
92 appeal_state: VARIABLE . '[' expression_list ']'
93 | VARIABLE . '[' error ']'
94 | VARIABLE . '[' ']'
95 | VARIABLE . '[' expression_list error
96 | VARIABLE . error
error shift, and go to state 57
'[' shift, and go to state 58
'=' shift, and go to state 59
state 23
21 call_definition: DO . VARIABLE VARIABLE ',' '[' declaration_list ']'
22 | DO . VARIABLE VARIABLE
23 | DO . error VARIABLE
24 | DO . error VARIABLE ',' '[' declaration_list ']'
25 | DO . VARIABLE error
26 | DO . VARIABLE VARIABLE '[' declaration_list ']'
27 | DO . error
error shift, and go to state 60
VARIABLE shift, and go to state 61
state 24
123 unary_statement: LOGITIZE . VARIABLE
VARIABLE shift, and go to state 62
state 25
124 unary_statement: DIGITIZE . VARIABLE
VARIABLE shift, and go to state 63
state 26
125 unary_statement: REDUCE . VARIABLE '[' INTEGER ']'
127 | REDUCE . VARIABLE '[' INTEGER error
128 | REDUCE . VARIABLE '[' error ']'
129 | REDUCE . VARIABLE '[' error
130 | REDUCE . VARIABLE error
131 | REDUCE . error
error shift, and go to state 64
VARIABLE shift, and go to state 65
state 27
126 unary_statement: EXTENED . VARIABLE '[' INTEGER ']'
132 | EXTENED . VARIABLE '[' INTEGER error
133 | EXTENED . VARIABLE '[' error ']'
134 | EXTENED . VARIABLE '[' error
135 | EXTENED . VARIABLE error
136 | EXTENED . error
error shift, and go to state 66
VARIABLE shift, and go to state 67
state 28
49 robot_operation: R_LEFT .
$default reduce using rule 49 (robot_operation)
state 29
50 robot_operation: R_RIGHT .
$default reduce using rule 50 (robot_operation)
state 30
48 robot_operation: MOVE .
$default reduce using rule 48 (robot_operation)
state 31
51 robot_operation: GET_E .
$default reduce using rule 51 (robot_operation)
state 32
108 definition: VAR . VARIABLE '[' expression_list ']' '=' INTEGER
109 | VAR . VARIABLE '[' expression_list ']' '=' BOOL
110 | VAR . VARIABLE '=' INTEGER
111 | VAR . VARIABLE '=' BOOL
112 | VAR . VARIABLE '[' expression_list ']' '=' error
113 | VAR . VARIABLE '=' error
114 | VAR . VARIABLE '[' expression_list ']' error
115 | VAR . VARIABLE '[' expression_list error '=' INTEGER
116 | VAR . VARIABLE '[' expression_list error '=' BOOL
117 | VAR . VARIABLE '[' error ']' '=' INTEGER
118 | VAR . VARIABLE '[' error ']' '=' BOOL
119 | VAR . VARIABLE error
120 | VAR . error '[' expression_list ']' '=' INTEGER
121 | VAR . error '[' expression_list ']' '=' BOOL
122 | VAR . error
error shift, and go to state 68
VARIABLE shift, and go to state 69
state 33
71 statement: ENDLINE .
$default reduce using rule 71 (statement)
state 34
97 for_loop: FOR . VARIABLE BOUNDARY VARIABLE STEP VARIABLE ENDLINE '(' statement_list ')'
98 | FOR . error
99 | FOR . BOUNDARY VARIABLE STEP VARIABLE ENDLINE '(' statement_list ')'
100 | FOR . VARIABLE BOUNDARY STEP VARIABLE ENDLINE '(' statement_list ')'
101 | FOR . VARIABLE BOUNDARY VARIABLE STEP ENDLINE '(' statement_list ')'
102 | FOR . VARIABLE BOUNDARY VARIABLE STEP VARIABLE error
103 | FOR . VARIABLE BOUNDARY VARIABLE STEP VARIABLE ENDLINE '(' statement_list error
error shift, and go to state 70
VARIABLE shift, and go to state 71
BOUNDARY shift, and go to state 72
state 35
86 switch_state: SWITCH . expression BOOL statement_list '[' BOOL statement_list ']'
87 | SWITCH . expression BOOL statement_list '[' BOOL statement_list error
88 | SWITCH . expression BOOL statement_list '[' error
89 | SWITCH . expression BOOL statement_list error BOOL
90 | SWITCH . expression error
91 | SWITCH . error
error shift, and go to state 73
INTEGER shift, and go to state 74
VARIABLE shift, and go to state 75
BOOL shift, and go to state 76
GET shift, and go to state 77
MXCOMP shift, and go to state 78
ELCOMP shift, and go to state 79
MXFALSE shift, and go to state 80
MXTRUE shift, and go to state 81
NOT shift, and go to state 82
SIZE shift, and go to state 83
R_LEFT shift, and go to state 28
R_RIGHT shift, and go to state 29
MOVE shift, and go to state 30
GET_E shift, and go to state 31
'-' shift, and go to state 84
'(' shift, and go to state 85
expression go to state 86
binary_operation go to state 87
robot_operation go to state 88
unary_operation go to state 89
compare_operation go to state 90
state 36
80 statement_s: PRINT . VARIABLE
81 | PRINT . error
error shift, and go to state 91
VARIABLE shift, and go to state 92
state 37
68 statement: PLEASE . statement_s ENDLINE
69 | PLEASE . statement_s THANKS ENDLINE
VARIABLE shift, and go to state 22
TASK shift, and go to state 1
DO shift, and go to state 23
LOGITIZE shift, and go to state 24
DIGITIZE shift, and go to state 25
REDUCE shift, and go to state 26
EXTENED shift, and go to state 27
R_LEFT shift, and go to state 28
R_RIGHT shift, and go to state 29
MOVE shift, and go to state 30
GET_E shift, and go to state 31
VAR shift, and go to state 32
FOR shift, and go to state 34
SWITCH shift, and go to state 35
PRINT shift, and go to state 36
'(' shift, and go to state 38
function_definition go to state 40
call_definition go to state 41
robot_operation go to state 42
statement_s go to state 93
switch_state go to state 45
appeal_state go to state 46
for_loop go to state 47
compound_statement go to state 48
definition go to state 49
unary_statement go to state 50
state 38
104 compound_statement: '(' . ')'
105 | '(' . block_item ')'
error shift, and go to state 21
VARIABLE shift, and go to state 22
TASK shift, and go to state 1
DO shift, and go to state 23
LOGITIZE shift, and go to state 24
DIGITIZE shift, and go to state 25
REDUCE shift, and go to state 26
EXTENED shift, and go to state 27
R_LEFT shift, and go to state 28
R_RIGHT shift, and go to state 29
MOVE shift, and go to state 30
GET_E shift, and go to state 31
VAR shift, and go to state 32
ENDLINE shift, and go to state 33
FOR shift, and go to state 34
SWITCH shift, and go to state 35
PRINT shift, and go to state 36
PLEASE shift, and go to state 37
'(' shift, and go to state 38
')' shift, and go to state 94
function_definition go to state 40
call_definition go to state 41
robot_operation go to state 42
statement go to state 95
statement_s go to state 44
switch_state go to state 45
appeal_state go to state 46
for_loop go to state 47
compound_statement go to state 48
block_item go to state 96
definition go to state 49
unary_statement go to state 50
state 39
7 statement_list: statement_list . statement
10 function_definition: TASK FINDEXIT ENDLINE statement_list . RESULT
17 | TASK FINDEXIT ENDLINE statement_list . error
error shift, and go to state 97
VARIABLE shift, and go to state 22
TASK shift, and go to state 1
DO shift, and go to state 23
RESULT shift, and go to state 98
LOGITIZE shift, and go to state 24
DIGITIZE shift, and go to state 25
REDUCE shift, and go to state 26
EXTENED shift, and go to state 27
R_LEFT shift, and go to state 28
R_RIGHT shift, and go to state 29
MOVE shift, and go to state 30
GET_E shift, and go to state 31
VAR shift, and go to state 32
ENDLINE shift, and go to state 33
FOR shift, and go to state 34
SWITCH shift, and go to state 35
PRINT shift, and go to state 36
PLEASE shift, and go to state 37
'(' shift, and go to state 38
function_definition go to state 40
call_definition go to state 41
robot_operation go to state 42
statement go to state 99
statement_s go to state 44
switch_state go to state 45
appeal_state go to state 46
for_loop go to state 47
compound_statement go to state 48
definition go to state 49
unary_statement go to state 50
state 40
75 statement_s: function_definition .
$default reduce using rule 75 (statement_s)
state 41
76 statement_s: call_definition .
$default reduce using rule 76 (statement_s)
state 42
77 statement_s: robot_operation .
$default reduce using rule 77 (statement_s)
state 43
6 statement_list: statement .
$default reduce using rule 6 (statement_list)
state 44
66 statement: statement_s . ENDLINE
70 | statement_s . THANKS ENDLINE
ENDLINE shift, and go to state 100
THANKS shift, and go to state 101
state 45
79 statement_s: switch_state .
$default reduce using rule 79 (statement_s)
state 46
84 statement_s: appeal_state . '=' expression
85 | appeal_state . error expression
error shift, and go to state 102
'=' shift, and go to state 103
state 47
78 statement_s: for_loop .
$default reduce using rule 78 (statement_s)
state 48
72 statement_s: compound_statement .
$default reduce using rule 72 (statement_s)
state 49
73 statement_s: definition .
$default reduce using rule 73 (statement_s)
state 50
74 statement_s: unary_statement .
$default reduce using rule 74 (statement_s)
state 51
7 statement_list: statement_list . statement
14 function_definition: TASK error VARIABLE ENDLINE statement_list . RESULT VARIABLE
error shift, and go to state 21
VARIABLE shift, and go to state 22
TASK shift, and go to state 1
DO shift, and go to state 23
RESULT shift, and go to state 104
LOGITIZE shift, and go to state 24
DIGITIZE shift, and go to state 25
REDUCE shift, and go to state 26
EXTENED shift, and go to state 27
R_LEFT shift, and go to state 28
R_RIGHT shift, and go to state 29
MOVE shift, and go to state 30
GET_E shift, and go to state 31
VAR shift, and go to state 32
ENDLINE shift, and go to state 33
FOR shift, and go to state 34
SWITCH shift, and go to state 35
PRINT shift, and go to state 36
PLEASE shift, and go to state 37
'(' shift, and go to state 38
function_definition go to state 40