-
Notifications
You must be signed in to change notification settings - Fork 0
/
parser.output
1351 lines (819 loc) · 24.6 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 1 conflicts: 1 shift/reduce
Grammar
0 $accept: saida $end
1 saida: secao_data secao_text END_OF_FILE
2 | secao_data EOL secao_text END_OF_FILE
3 | secao_text END_OF_FILE
4 secao_data: data EOL var
5 | data
6 secao_text: text EOL instrucao
7 instrucao: linha EOL instrucao
8 | labelid linha EOL instrucao
9 | %empty
10 linha: operacao
11 operacao: %empty
12 | syscallOP
13 | NOP
14 | R
15 | I
16 | LS
17 | J
18 | M
19 R: opcoder reg virg reg virg reg
20 | opcoder reg virg reg
21 | opcoders reg virg reg virg reg
22 | opcoders reg virg reg virg shamt
23 | opcodej reg virg reg
24 | opcodej reg
25 | opcoderd reg virg reg
26 I: opcodei reg virg reg virg imm
27 | opcodelui reg virg imm
28 | opcodet reg virg imm
29 | opcodet reg virg reg
30 | opcodeb reg virg id
31 | opcodebeq reg virg reg virg id
32 LS: opcodel reg virg offset abreparents reg fechaparents
33 | opcodel reg virg id
34 J: opcodej address
35 | opcodej id
36 M: opcodemf reg virg reg
37 | opcodemt reg virg reg
38 | opcodemt reg
39 | opcodemf reg
40 | opcodemf reg virg reg virg reg
41 labelid: id colon
42 | id EOL colon
43 var: id colon val var
44 | id colon val
45 val: number EOL
46 | number virg val
47 | t_int number virg val
48 | t_int number EOL
49 address: number
50 shamt: number
51 offset: number
52 imm: number
Terminals, with rules where they appear
$end (0) 0
error (256)
reg (258) 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 36 37 38 39
40
number (259) 45 46 47 48 49 50 51 52
virg (260) 19 20 21 22 23 25 26 27 28 29 30 31 32 33 36 37 40 46 47
EOL (261) 2 4 6 7 8 42 45 48
END_OF_FILE (262) 1 2 3
opcodeb (263) 30
opcoder (264) 19 20
opcoders (265) 21 22
opcoderd (266) 25
opcodel (267) 32 33
opcodei (268) 26
opcodelui (269) 27
opcodej (270) 23 24 34 35
opcodet (271) 28 29
opcodemf (272) 36 39 40
opcodemt (273) 37 38
opcodebeq (274) 31
abreparents (275) 32
fechaparents (276) 32
colon (277) 41 42 43 44
syscallOP (278) 12
NOP (279) 13
data (280) 4 5
text (281) 6
id (282) 30 31 33 35 41 42 43 44
t_int (283) 47 48
Nonterminals, with rules where they appear
$accept (29)
on left: 0
saida (30)
on left: 1 2 3, on right: 0
secao_data (31)
on left: 4 5, on right: 1 2
secao_text (32)
on left: 6, on right: 1 2 3
instrucao (33)
on left: 7 8 9, on right: 6 7 8
linha (34)
on left: 10, on right: 7 8
operacao (35)
on left: 11 12 13 14 15 16 17 18, on right: 10
R (36)
on left: 19 20 21 22 23 24 25, on right: 14
I (37)
on left: 26 27 28 29 30 31, on right: 15
LS (38)
on left: 32 33, on right: 16
J (39)
on left: 34 35, on right: 17
M (40)
on left: 36 37 38 39 40, on right: 18
labelid (41)
on left: 41 42, on right: 8
var (42)
on left: 43 44, on right: 4 43
val (43)
on left: 45 46 47 48, on right: 43 44 46 47
address (44)
on left: 49, on right: 34
shamt (45)
on left: 50, on right: 22
offset (46)
on left: 51, on right: 32
imm (47)
on left: 52, on right: 26 27 28
State 0
0 $accept: . saida $end
1 saida: . secao_data secao_text END_OF_FILE
2 | . secao_data EOL secao_text END_OF_FILE
3 | . secao_text END_OF_FILE
4 secao_data: . data EOL var
5 | . data
6 secao_text: . text EOL instrucao
data shift, and go to state 1
text shift, and go to state 2
saida go to state 3
secao_data go to state 4
secao_text go to state 5
State 1
4 secao_data: data . EOL var
5 | data . [EOL, text]
EOL shift, and go to state 6
EOL [reduce using rule 5 (secao_data)]
$default reduce using rule 5 (secao_data)
State 2
6 secao_text: text . EOL instrucao
EOL shift, and go to state 7
State 3
0 $accept: saida . $end
$end shift, and go to state 8
State 4
1 saida: secao_data . secao_text END_OF_FILE
2 | secao_data . EOL secao_text END_OF_FILE
6 secao_text: . text EOL instrucao
EOL shift, and go to state 9
text shift, and go to state 2
secao_text go to state 10
State 5
3 saida: secao_text . END_OF_FILE
END_OF_FILE shift, and go to state 11
State 6
4 secao_data: data EOL . var
43 var: . id colon val var
44 | . id colon val
id shift, and go to state 12
var go to state 13
State 7
6 secao_text: text EOL . instrucao
7 instrucao: . linha EOL instrucao
8 | . labelid linha EOL instrucao
9 | . %empty [END_OF_FILE]
10 linha: . operacao
11 operacao: . %empty [EOL]
12 | . syscallOP
13 | . NOP
14 | . R
15 | . I
16 | . LS
17 | . J
18 | . M
19 R: . opcoder reg virg reg virg reg
20 | . opcoder reg virg reg
21 | . opcoders reg virg reg virg reg
22 | . opcoders reg virg reg virg shamt
23 | . opcodej reg virg reg
24 | . opcodej reg
25 | . opcoderd reg virg reg
26 I: . opcodei reg virg reg virg imm
27 | . opcodelui reg virg imm
28 | . opcodet reg virg imm
29 | . opcodet reg virg reg
30 | . opcodeb reg virg id
31 | . opcodebeq reg virg reg virg id
32 LS: . opcodel reg virg offset abreparents reg fechaparents
33 | . opcodel reg virg id
34 J: . opcodej address
35 | . opcodej id
36 M: . opcodemf reg virg reg
37 | . opcodemt reg virg reg
38 | . opcodemt reg
39 | . opcodemf reg
40 | . opcodemf reg virg reg virg reg
41 labelid: . id colon
42 | . id EOL colon
opcodeb shift, and go to state 14
opcoder shift, and go to state 15
opcoders shift, and go to state 16
opcoderd shift, and go to state 17
opcodel shift, and go to state 18
opcodei shift, and go to state 19
opcodelui shift, and go to state 20
opcodej shift, and go to state 21
opcodet shift, and go to state 22
opcodemf shift, and go to state 23
opcodemt shift, and go to state 24
opcodebeq shift, and go to state 25
syscallOP shift, and go to state 26
NOP shift, and go to state 27
id shift, and go to state 28
EOL reduce using rule 11 (operacao)
$default reduce using rule 9 (instrucao)
instrucao go to state 29
linha go to state 30
operacao go to state 31
R go to state 32
I go to state 33
LS go to state 34
J go to state 35
M go to state 36
labelid go to state 37
State 8
0 $accept: saida $end .
$default accept
State 9
2 saida: secao_data EOL . secao_text END_OF_FILE
6 secao_text: . text EOL instrucao
text shift, and go to state 2
secao_text go to state 38
State 10
1 saida: secao_data secao_text . END_OF_FILE
END_OF_FILE shift, and go to state 39
State 11
3 saida: secao_text END_OF_FILE .
$default reduce using rule 3 (saida)
State 12
43 var: id . colon val var
44 | id . colon val
colon shift, and go to state 40
State 13
4 secao_data: data EOL var .
$default reduce using rule 4 (secao_data)
State 14
30 I: opcodeb . reg virg id
reg shift, and go to state 41
State 15
19 R: opcoder . reg virg reg virg reg
20 | opcoder . reg virg reg
reg shift, and go to state 42
State 16
21 R: opcoders . reg virg reg virg reg
22 | opcoders . reg virg reg virg shamt
reg shift, and go to state 43
State 17
25 R: opcoderd . reg virg reg
reg shift, and go to state 44
State 18
32 LS: opcodel . reg virg offset abreparents reg fechaparents
33 | opcodel . reg virg id
reg shift, and go to state 45
State 19
26 I: opcodei . reg virg reg virg imm
reg shift, and go to state 46
State 20
27 I: opcodelui . reg virg imm
reg shift, and go to state 47
State 21
23 R: opcodej . reg virg reg
24 | opcodej . reg
34 J: opcodej . address
35 | opcodej . id
49 address: . number
reg shift, and go to state 48
number shift, and go to state 49
id shift, and go to state 50
address go to state 51
State 22
28 I: opcodet . reg virg imm
29 | opcodet . reg virg reg
reg shift, and go to state 52
State 23
36 M: opcodemf . reg virg reg
39 | opcodemf . reg
40 | opcodemf . reg virg reg virg reg
reg shift, and go to state 53
State 24
37 M: opcodemt . reg virg reg
38 | opcodemt . reg
reg shift, and go to state 54
State 25
31 I: opcodebeq . reg virg reg virg id
reg shift, and go to state 55
State 26
12 operacao: syscallOP .
$default reduce using rule 12 (operacao)
State 27
13 operacao: NOP .
$default reduce using rule 13 (operacao)
State 28
41 labelid: id . colon
42 | id . EOL colon
EOL shift, and go to state 56
colon shift, and go to state 57
State 29
6 secao_text: text EOL instrucao .
$default reduce using rule 6 (secao_text)
State 30
7 instrucao: linha . EOL instrucao
EOL shift, and go to state 58
State 31
10 linha: operacao .
$default reduce using rule 10 (linha)
State 32
14 operacao: R .
$default reduce using rule 14 (operacao)
State 33
15 operacao: I .
$default reduce using rule 15 (operacao)
State 34
16 operacao: LS .
$default reduce using rule 16 (operacao)
State 35
17 operacao: J .
$default reduce using rule 17 (operacao)
State 36
18 operacao: M .
$default reduce using rule 18 (operacao)
State 37
8 instrucao: labelid . linha EOL instrucao
10 linha: . operacao
11 operacao: . %empty [EOL]
12 | . syscallOP
13 | . NOP
14 | . R
15 | . I
16 | . LS
17 | . J
18 | . M
19 R: . opcoder reg virg reg virg reg
20 | . opcoder reg virg reg
21 | . opcoders reg virg reg virg reg
22 | . opcoders reg virg reg virg shamt
23 | . opcodej reg virg reg
24 | . opcodej reg
25 | . opcoderd reg virg reg
26 I: . opcodei reg virg reg virg imm
27 | . opcodelui reg virg imm
28 | . opcodet reg virg imm
29 | . opcodet reg virg reg
30 | . opcodeb reg virg id
31 | . opcodebeq reg virg reg virg id
32 LS: . opcodel reg virg offset abreparents reg fechaparents
33 | . opcodel reg virg id
34 J: . opcodej address
35 | . opcodej id
36 M: . opcodemf reg virg reg
37 | . opcodemt reg virg reg
38 | . opcodemt reg
39 | . opcodemf reg
40 | . opcodemf reg virg reg virg reg
opcodeb shift, and go to state 14
opcoder shift, and go to state 15
opcoders shift, and go to state 16
opcoderd shift, and go to state 17
opcodel shift, and go to state 18
opcodei shift, and go to state 19
opcodelui shift, and go to state 20
opcodej shift, and go to state 21
opcodet shift, and go to state 22
opcodemf shift, and go to state 23
opcodemt shift, and go to state 24
opcodebeq shift, and go to state 25
syscallOP shift, and go to state 26
NOP shift, and go to state 27
$default reduce using rule 11 (operacao)
linha go to state 59
operacao go to state 31
R go to state 32
I go to state 33
LS go to state 34
J go to state 35
M go to state 36
State 38
2 saida: secao_data EOL secao_text . END_OF_FILE
END_OF_FILE shift, and go to state 60
State 39
1 saida: secao_data secao_text END_OF_FILE .
$default reduce using rule 1 (saida)
State 40
43 var: id colon . val var
44 | id colon . val
45 val: . number EOL
46 | . number virg val
47 | . t_int number virg val
48 | . t_int number EOL
number shift, and go to state 61
t_int shift, and go to state 62
val go to state 63
State 41
30 I: opcodeb reg . virg id
virg shift, and go to state 64
State 42
19 R: opcoder reg . virg reg virg reg
20 | opcoder reg . virg reg
virg shift, and go to state 65
State 43
21 R: opcoders reg . virg reg virg reg
22 | opcoders reg . virg reg virg shamt
virg shift, and go to state 66
State 44
25 R: opcoderd reg . virg reg
virg shift, and go to state 67
State 45
32 LS: opcodel reg . virg offset abreparents reg fechaparents
33 | opcodel reg . virg id
virg shift, and go to state 68
State 46
26 I: opcodei reg . virg reg virg imm
virg shift, and go to state 69
State 47
27 I: opcodelui reg . virg imm
virg shift, and go to state 70
State 48
23 R: opcodej reg . virg reg
24 | opcodej reg . [EOL]
virg shift, and go to state 71
$default reduce using rule 24 (R)
State 49
49 address: number .
$default reduce using rule 49 (address)
State 50
35 J: opcodej id .
$default reduce using rule 35 (J)
State 51
34 J: opcodej address .
$default reduce using rule 34 (J)
State 52
28 I: opcodet reg . virg imm
29 | opcodet reg . virg reg
virg shift, and go to state 72
State 53
36 M: opcodemf reg . virg reg
39 | opcodemf reg . [EOL]
40 | opcodemf reg . virg reg virg reg
virg shift, and go to state 73
$default reduce using rule 39 (M)
State 54
37 M: opcodemt reg . virg reg
38 | opcodemt reg . [EOL]
virg shift, and go to state 74
$default reduce using rule 38 (M)
State 55
31 I: opcodebeq reg . virg reg virg id
virg shift, and go to state 75
State 56
42 labelid: id EOL . colon
colon shift, and go to state 76
State 57
41 labelid: id colon .
$default reduce using rule 41 (labelid)
State 58
7 instrucao: . linha EOL instrucao
7 | linha EOL . instrucao
8 | . labelid linha EOL instrucao
9 | . %empty [END_OF_FILE]
10 linha: . operacao
11 operacao: . %empty [EOL]
12 | . syscallOP
13 | . NOP
14 | . R
15 | . I
16 | . LS
17 | . J
18 | . M
19 R: . opcoder reg virg reg virg reg
20 | . opcoder reg virg reg
21 | . opcoders reg virg reg virg reg
22 | . opcoders reg virg reg virg shamt
23 | . opcodej reg virg reg
24 | . opcodej reg
25 | . opcoderd reg virg reg
26 I: . opcodei reg virg reg virg imm
27 | . opcodelui reg virg imm
28 | . opcodet reg virg imm
29 | . opcodet reg virg reg
30 | . opcodeb reg virg id
31 | . opcodebeq reg virg reg virg id
32 LS: . opcodel reg virg offset abreparents reg fechaparents
33 | . opcodel reg virg id
34 J: . opcodej address
35 | . opcodej id
36 M: . opcodemf reg virg reg
37 | . opcodemt reg virg reg
38 | . opcodemt reg
39 | . opcodemf reg
40 | . opcodemf reg virg reg virg reg
41 labelid: . id colon
42 | . id EOL colon
opcodeb shift, and go to state 14
opcoder shift, and go to state 15
opcoders shift, and go to state 16
opcoderd shift, and go to state 17
opcodel shift, and go to state 18
opcodei shift, and go to state 19
opcodelui shift, and go to state 20
opcodej shift, and go to state 21
opcodet shift, and go to state 22
opcodemf shift, and go to state 23
opcodemt shift, and go to state 24
opcodebeq shift, and go to state 25
syscallOP shift, and go to state 26
NOP shift, and go to state 27
id shift, and go to state 28
EOL reduce using rule 11 (operacao)
$default reduce using rule 9 (instrucao)
instrucao go to state 77
linha go to state 30
operacao go to state 31
R go to state 32
I go to state 33
LS go to state 34
J go to state 35
M go to state 36
labelid go to state 37
State 59
8 instrucao: labelid linha . EOL instrucao
EOL shift, and go to state 78
State 60
2 saida: secao_data EOL secao_text END_OF_FILE .
$default reduce using rule 2 (saida)
State 61
45 val: number . EOL
46 | number . virg val
virg shift, and go to state 79
EOL shift, and go to state 80
State 62
47 val: t_int . number virg val
48 | t_int . number EOL
number shift, and go to state 81
State 63
43 var: . id colon val var
43 | id colon val . var
44 | . id colon val
44 | id colon val . [EOL, text]
id shift, and go to state 12
$default reduce using rule 44 (var)
var go to state 82
State 64
30 I: opcodeb reg virg . id
id shift, and go to state 83
State 65
19 R: opcoder reg virg . reg virg reg
20 | opcoder reg virg . reg
reg shift, and go to state 84
State 66
21 R: opcoders reg virg . reg virg reg
22 | opcoders reg virg . reg virg shamt
reg shift, and go to state 85
State 67
25 R: opcoderd reg virg . reg
reg shift, and go to state 86
State 68
32 LS: opcodel reg virg . offset abreparents reg fechaparents
33 | opcodel reg virg . id
51 offset: . number
number shift, and go to state 87
id shift, and go to state 88
offset go to state 89
State 69
26 I: opcodei reg virg . reg virg imm
reg shift, and go to state 90
State 70
27 I: opcodelui reg virg . imm
52 imm: . number
number shift, and go to state 91
imm go to state 92
State 71
23 R: opcodej reg virg . reg
reg shift, and go to state 93
State 72
28 I: opcodet reg virg . imm
29 | opcodet reg virg . reg
52 imm: . number
reg shift, and go to state 94
number shift, and go to state 91
imm go to state 95
State 73
36 M: opcodemf reg virg . reg
40 | opcodemf reg virg . reg virg reg
reg shift, and go to state 96
State 74
37 M: opcodemt reg virg . reg
reg shift, and go to state 97
State 75
31 I: opcodebeq reg virg . reg virg id
reg shift, and go to state 98
State 76
42 labelid: id EOL colon .
$default reduce using rule 42 (labelid)
State 77
7 instrucao: linha EOL instrucao .
$default reduce using rule 7 (instrucao)
State 78
7 instrucao: . linha EOL instrucao
8 | . labelid linha EOL instrucao
8 | labelid linha EOL . instrucao
9 | . %empty [END_OF_FILE]
10 linha: . operacao
11 operacao: . %empty [EOL]
12 | . syscallOP
13 | . NOP
14 | . R
15 | . I
16 | . LS
17 | . J
18 | . M
19 R: . opcoder reg virg reg virg reg
20 | . opcoder reg virg reg
21 | . opcoders reg virg reg virg reg
22 | . opcoders reg virg reg virg shamt
23 | . opcodej reg virg reg
24 | . opcodej reg
25 | . opcoderd reg virg reg
26 I: . opcodei reg virg reg virg imm
27 | . opcodelui reg virg imm
28 | . opcodet reg virg imm
29 | . opcodet reg virg reg
30 | . opcodeb reg virg id
31 | . opcodebeq reg virg reg virg id