forked from CMinusGroup/C_compiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
parser.output
7249 lines (5369 loc) · 240 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
Terminals unused in grammar
TYPE_NAME
状态 387 conflicts: 1 shift/reduce
语法
0 $accept: program $end
1 program: translation_unit
2 primary_expression: IDENTIFIER
3 | CONSTANT
4 | CONSTANT_INT
5 | CONSTANT_DOUBLE
6 | STRING_LITERAL
7 | '(' expression ')'
8 postfix_expression: primary_expression
9 | postfix_expression '[' expression ']'
10 | IDENTIFIER '(' ')'
11 | IDENTIFIER '(' argument_expression_list ')'
12 | postfix_expression '.' IDENTIFIER
13 | postfix_expression OP_PTR IDENTIFIER
14 | postfix_expression OP_INC
15 | postfix_expression OP_DEC
16 | '(' type_name ')' '{' initializer_list '}'
17 | '(' type_name ')' '{' initializer_list ',' '}'
18 argument_expression_list: assignment_expression
19 | argument_expression_list ',' assignment_expression
20 unary_expression: postfix_expression
21 | OP_INC unary_expression
22 | OP_DEC unary_expression
23 | unary_operator cast_expression
24 | SIZEOF unary_expression
25 | SIZEOF '(' type_name ')'
26 unary_operator: '&'
27 | '*'
28 | '+'
29 | '-'
30 | '~'
31 | '!'
32 cast_expression: unary_expression
33 | '(' type_name ')' cast_expression
34 multiplicative_expression: cast_expression
35 | multiplicative_expression '*' cast_expression
36 | multiplicative_expression '/' cast_expression
37 | multiplicative_expression '%' cast_expression
38 additive_expression: multiplicative_expression
39 | additive_expression '+' multiplicative_expression
40 | additive_expression '-' multiplicative_expression
41 shift_expression: additive_expression
42 | shift_expression OP_LEFTSHIFT additive_expression
43 | shift_expression OP_RIGHTSHIFT additive_expression
44 relational_expression: shift_expression
45 | relational_expression '<' shift_expression
46 | relational_expression '>' shift_expression
47 | relational_expression OP_LE shift_expression
48 | relational_expression OP_GE shift_expression
49 equality_expression: relational_expression
50 | equality_expression OP_EQ relational_expression
51 | equality_expression OP_NE relational_expression
52 and_expression: equality_expression
53 | and_expression '&' equality_expression
54 exclusive_or_expression: and_expression
55 | exclusive_or_expression '^' and_expression
56 inclusive_or_expression: exclusive_or_expression
57 | inclusive_or_expression '|' exclusive_or_expression
58 logical_and_expression: inclusive_or_expression
59 | logical_and_expression OP_AND inclusive_or_expression
60 logical_or_expression: logical_and_expression
61 | logical_or_expression OP_OR logical_and_expression
62 conditional_expression: logical_or_expression
63 | logical_or_expression '?' conditional_expression ':' conditional_expression
64 assignment_expression: conditional_expression
65 | unary_expression assignment_operator assignment_expression
66 assignment_operator: '='
67 | ASSIGN_MUL
68 | ASSIGN_DIV
69 | ASSIGN_MOD
70 | ASSIGN_ADD
71 | ASSIGN_SUB
72 | ASSIGN_LEFTSHIFT
73 | ASSIGN_RIGHTSHIFT
74 | ASSIGN_AND
75 | ASSIGN_XOR
76 | ASSIGN_OR
77 expression: assignment_expression
78 | expression ',' assignment_expression
79 constant_expression: conditional_expression
80 declaration: declaration_specifiers ';'
81 | declaration_specifiers init_declarator_list ';'
82 declaration_specifiers: storage_class_specifier
83 | storage_class_specifier declaration_specifiers
84 | type_specifier
85 | type_specifier declaration_specifiers
86 | type_qualifier
87 | type_qualifier declaration_specifiers
88 | function_specifier
89 | function_specifier declaration_specifiers
90 init_declarator_list: init_declarator
91 | init_declarator_list ',' init_declarator
92 init_declarator: declarator
93 | declarator '=' initializer
94 storage_class_specifier: TYPEDEF
95 | EXTERN
96 | STATIC
97 | AUTO
98 type_specifier: VOID
99 | CHAR
100 | SHORT
101 | INT
102 | LONG
103 | FLOAT
104 | DOUBLE
105 | SIGNED
106 | UNSIGNED
107 | BOOL
108 | struct_or_union_specifier
109 | enum_specifier
110 struct_or_union_specifier: struct_or_union IDENTIFIER '{' struct_declaration_list '}'
111 | struct_or_union '{' struct_declaration_list '}'
112 | struct_or_union IDENTIFIER
113 struct_or_union: STRUCT
114 | UNION
115 struct_declaration_list: struct_declaration
116 | struct_declaration_list struct_declaration
117 struct_declaration: specifier_qualifier_list struct_declarator_list ';'
118 specifier_qualifier_list: type_specifier specifier_qualifier_list
119 | type_specifier
120 | type_qualifier specifier_qualifier_list
121 | type_qualifier
122 struct_declarator_list: struct_declarator
123 | struct_declarator_list ',' struct_declarator
124 struct_declarator: declarator
125 | ':' constant_expression
126 | declarator ':' constant_expression
127 enum_specifier: ENUM '{' enumerator_list '}'
128 | ENUM IDENTIFIER '{' enumerator_list '}'
129 | ENUM '{' enumerator_list ',' '}'
130 | ENUM IDENTIFIER '{' enumerator_list ',' '}'
131 | ENUM IDENTIFIER
132 enumerator_list: enumerator
133 | enumerator_list ',' enumerator
134 enumerator: IDENTIFIER
135 | IDENTIFIER '=' constant_expression
136 type_qualifier: CONST
137 | VOLATILE
138 function_specifier: INLINE
139 declarator: pointer direct_declarator
140 | direct_declarator
141 direct_declarator: IDENTIFIER
142 | '(' declarator ')'
143 | direct_declarator '[' type_qualifier_list assignment_expression ']'
144 | direct_declarator '[' type_qualifier_list ']'
145 | direct_declarator '[' assignment_expression ']'
146 | direct_declarator '[' STATIC type_qualifier_list assignment_expression ']'
147 | direct_declarator '[' type_qualifier_list STATIC assignment_expression ']'
148 | direct_declarator '[' type_qualifier_list '*' ']'
149 | direct_declarator '[' '*' ']'
150 | direct_declarator '[' ']'
151 | direct_declarator '(' parameter_type_list ')'
152 | direct_declarator '(' identifier_list ')'
153 | direct_declarator '(' ')'
154 pointer: '*'
155 | '*' type_qualifier_list
156 | '*' pointer
157 | '*' type_qualifier_list pointer
158 type_qualifier_list: type_qualifier
159 | type_qualifier_list type_qualifier
160 parameter_type_list: parameter_list
161 | parameter_list ',' ELLIPSIS
162 parameter_list: parameter_declaration
163 | parameter_list ',' parameter_declaration
164 parameter_declaration: declaration_specifiers declarator
165 | declaration_specifiers abstract_declarator
166 | declaration_specifiers
167 identifier_list: IDENTIFIER
168 | identifier_list ',' IDENTIFIER
169 type_name: specifier_qualifier_list
170 | specifier_qualifier_list abstract_declarator
171 abstract_declarator: pointer
172 | direct_abstract_declarator
173 | pointer direct_abstract_declarator
174 direct_abstract_declarator: '(' abstract_declarator ')'
175 | '[' ']'
176 | '[' assignment_expression ']'
177 | direct_abstract_declarator '[' ']'
178 | direct_abstract_declarator '[' assignment_expression ']'
179 | '[' '*' ']'
180 | direct_abstract_declarator '[' '*' ']'
181 | '(' ')'
182 | '(' parameter_type_list ')'
183 | direct_abstract_declarator '(' ')'
184 | direct_abstract_declarator '(' parameter_type_list ')'
185 initializer: assignment_expression
186 | '{' initializer_list '}'
187 | '{' initializer_list ',' '}'
188 initializer_list: initializer
189 | designation initializer
190 | initializer_list ',' initializer
191 | initializer_list ',' designation initializer
192 designation: designator_list '='
193 designator_list: designator
194 | designator_list designator
195 designator: '[' constant_expression ']'
196 | '.' IDENTIFIER
197 statement: labeled_statement
198 | compound_statement
199 | expression_statement
200 | selection_statement
201 | iteration_statement
202 | jump_statement
203 | print_statement
204 print_statement: println '(' STRING_LITERAL ',' expression ')' ';'
205 labeled_statement: IDENTIFIER ':' statement
206 | CASE constant_expression ':' statement
207 | DEFAULT ':' statement
208 compound_statement: '{' '}'
209 | '{' block_item_list '}'
210 block_item_list: block_item
211 | block_item_list block_item
212 block_item: declaration
213 | statement
214 expression_statement: ';'
215 | expression ';'
216 selection_statement: IF '(' equality_expression ')' statement
217 | IF '(' equality_expression ')' statement ELSE statement
218 | SWITCH '(' equality_expression ')' statement
219 iteration_statement: WHILE '(' expression ')' statement
220 | DO statement WHILE '(' expression ')' ';'
221 | FOR '(' expression_statement expression_statement ')' statement
222 | FOR '(' expression_statement expression_statement expression ')' statement
223 | FOR '(' declaration expression_statement ')' statement
224 | FOR '(' declaration expression_statement expression ')' statement
225 jump_statement: GOTO IDENTIFIER ';'
226 | CONTINUE ';'
227 | BREAK ';'
228 | RETURN ';'
229 | RETURN expression ';'
230 translation_unit: external_declaration
231 | translation_unit external_declaration
232 external_declaration: function_definition
233 | declaration
234 function_definition: declaration_specifiers declarator declaration_list compound_statement
235 | declaration_specifiers declarator compound_statement
236 declaration_list: declaration
237 | declaration_list declaration
Terminals, with rules where they appear
$end (0) 0
'!' (33) 31
'%' (37) 37
'&' (38) 26 53
'(' (40) 7 10 11 16 17 25 33 142 151 152 153 174 181 182 183 184 204
216 217 218 219 220 221 222 223 224
')' (41) 7 10 11 16 17 25 33 142 151 152 153 174 181 182 183 184 204
216 217 218 219 220 221 222 223 224
'*' (42) 27 35 148 149 154 155 156 157 179 180
'+' (43) 28 39
',' (44) 17 19 78 91 123 129 130 133 161 163 168 187 190 191 204
'-' (45) 29 40
'.' (46) 12 196
'/' (47) 36
':' (58) 63 125 126 205 206 207
';' (59) 80 81 117 204 214 215 220 225 226 227 228 229
'<' (60) 45
'=' (61) 66 93 135 192
'>' (62) 46
'?' (63) 63
'[' (91) 9 143 144 145 146 147 148 149 150 175 176 177 178 179 180
195
']' (93) 9 143 144 145 146 147 148 149 150 175 176 177 178 179 180
195
'^' (94) 55
'{' (123) 16 17 110 111 127 128 129 130 186 187 208 209
'|' (124) 57
'}' (125) 16 17 110 111 127 128 129 130 186 187 208 209
'~' (126) 30
error (256)
AUTO (258) 97
SIZEOF (259) 24 25
GOTO (260) 225
RETURN (261) 228 229
println (262) 204
DO (263) 220
WHILE (264) 219 220
FOR (265) 221 222 223 224
CONTINUE (266) 226
BREAK (267) 227
SWITCH (268) 218
DEFAULT (269) 207
CASE (270) 206
IF (271) 216 217
ELSE (272) 217
FLOAT (273) 103
DOUBLE (274) 104
CHAR (275) 99
VOID (276) 98
INT (277) 101
LONG (278) 102
BOOL (279) 107
SHORT (280) 100
VOLATILE (281) 137
CONST (282) 136
SIGNED (283) 105
UNSIGNED (284) 106
STATIC (285) 96 146 147
EXTERN (286) 95
INLINE (287) 138
TYPEDEF (288) 94
STRUCT (289) 113
ENUM (290) 127 128 129 130 131
UNION (291) 114
CONSTANT (292) 3
CONSTANT_INT (293) 4
CONSTANT_DOUBLE (294) 5
ELLIPSIS (295) 161
STRING_LITERAL (296) 6 204
ASSIGN_RIGHTSHIFT (297) 73
ASSIGN_LEFTSHIFT (298) 72
ASSIGN_ADD (299) 70
ASSIGN_SUB (300) 71
ASSIGN_MUL (301) 67
ASSIGN_DIV (302) 68
ASSIGN_MOD (303) 69
ASSIGN_AND (304) 74
ASSIGN_OR (305) 76
TYPE_NAME (306)
ASSIGN_XOR (307) 75
IDENTIFIER (308) 2 10 11 12 13 110 112 128 130 131 134 135 141 167
168 196 205 225
OP_RIGHTSHIFT (309) 43
OP_LEFTSHIFT (310) 42
OP_INC (311) 14 21
OP_DEC (312) 15 22
OP_PTR (313) 13
OP_AND (314) 59
OP_OR (315) 61
OP_LE (316) 47
OP_GE (317) 48
OP_EQ (318) 50
OP_NE (319) 51
Nonterminals, with rules where they appear
$accept (89)
左: 0
program (90)
左: 1, 右: 0
primary_expression (91)
左: 2 3 4 5 6 7, 右: 8
postfix_expression (92)
左: 8 9 10 11 12 13 14 15 16 17, 右: 9 12 13 14 15 20
argument_expression_list (93)
左: 18 19, 右: 11 19
unary_expression (94)
左: 20 21 22 23 24 25, 右: 21 22 24 32 65
unary_operator (95)
左: 26 27 28 29 30 31, 右: 23
cast_expression (96)
左: 32 33, 右: 23 33 34 35 36 37
multiplicative_expression (97)
左: 34 35 36 37, 右: 35 36 37 38 39 40
additive_expression (98)
左: 38 39 40, 右: 39 40 41 42 43
shift_expression (99)
左: 41 42 43, 右: 42 43 44 45 46 47 48
relational_expression (100)
左: 44 45 46 47 48, 右: 45 46 47 48 49 50 51
equality_expression (101)
左: 49 50 51, 右: 50 51 52 53 216 217 218
and_expression (102)
左: 52 53, 右: 53 54 55
exclusive_or_expression (103)
左: 54 55, 右: 55 56 57
inclusive_or_expression (104)
左: 56 57, 右: 57 58 59
logical_and_expression (105)
左: 58 59, 右: 59 60 61
logical_or_expression (106)
左: 60 61, 右: 61 62 63
conditional_expression (107)
左: 62 63, 右: 63 64 79
assignment_expression (108)
左: 64 65, 右: 18 19 65 77 78 143 145 146 147 176 178 185
assignment_operator (109)
左: 66 67 68 69 70 71 72 73 74 75 76, 右: 65
expression (110)
左: 77 78, 右: 7 9 78 204 215 219 220 222 224 229
constant_expression (111)
左: 79, 右: 125 126 135 195 206
declaration (112)
左: 80 81, 右: 212 223 224 233 236 237
declaration_specifiers (113)
左: 82 83 84 85 86 87 88 89, 右: 80 81 83 85 87 89 164 165
166 234 235
init_declarator_list (114)
左: 90 91, 右: 81 91
init_declarator (115)
左: 92 93, 右: 90 91
storage_class_specifier (116)
左: 94 95 96 97, 右: 82 83
type_specifier (117)
左: 98 99 100 101 102 103 104 105 106 107 108 109, 右: 84
85 118 119
struct_or_union_specifier (118)
左: 110 111 112, 右: 108
struct_or_union (119)
左: 113 114, 右: 110 111 112
struct_declaration_list (120)
左: 115 116, 右: 110 111 116
struct_declaration (121)
左: 117, 右: 115 116
specifier_qualifier_list (122)
左: 118 119 120 121, 右: 117 118 120 169 170
struct_declarator_list (123)
左: 122 123, 右: 117 123
struct_declarator (124)
左: 124 125 126, 右: 122 123
enum_specifier (125)
左: 127 128 129 130 131, 右: 109
enumerator_list (126)
左: 132 133, 右: 127 128 129 130 133
enumerator (127)
左: 134 135, 右: 132 133
type_qualifier (128)
左: 136 137, 右: 86 87 120 121 158 159
function_specifier (129)
左: 138, 右: 88 89
declarator (130)
左: 139 140, 右: 92 93 124 126 142 164 234 235
direct_declarator (131)
左: 141 142 143 144 145 146 147 148 149 150 151 152 153, 右:
139 140 143 144 145 146 147 148 149 150 151 152 153
pointer (132)
左: 154 155 156 157, 右: 139 156 157 171 173
type_qualifier_list (133)
左: 158 159, 右: 143 144 146 147 148 155 157 159
parameter_type_list (134)
左: 160 161, 右: 151 182 184
parameter_list (135)
左: 162 163, 右: 160 161 163
parameter_declaration (136)
左: 164 165 166, 右: 162 163
identifier_list (137)
左: 167 168, 右: 152 168
type_name (138)
左: 169 170, 右: 16 17 25 33
abstract_declarator (139)
左: 171 172 173, 右: 165 170 174
direct_abstract_declarator (140)
左: 174 175 176 177 178 179 180 181 182 183 184, 右: 172
173 177 178 180 183 184
initializer (141)
左: 185 186 187, 右: 93 188 189 190 191
initializer_list (142)
左: 188 189 190 191, 右: 16 17 186 187 190 191
designation (143)
左: 192, 右: 189 191
designator_list (144)
左: 193 194, 右: 192 194
designator (145)
左: 195 196, 右: 193 194
statement (146)
左: 197 198 199 200 201 202 203, 右: 205 206 207 213 216
217 218 219 220 221 222 223 224
print_statement (147)
左: 204, 右: 203
labeled_statement (148)
左: 205 206 207, 右: 197
compound_statement (149)
左: 208 209, 右: 198 234 235
block_item_list (150)
左: 210 211, 右: 209 211
block_item (151)
左: 212 213, 右: 210 211
expression_statement (152)
左: 214 215, 右: 199 221 222 223 224
selection_statement (153)
左: 216 217 218, 右: 200
iteration_statement (154)
左: 219 220 221 222 223 224, 右: 201
jump_statement (155)
左: 225 226 227 228 229, 右: 202
translation_unit (156)
左: 230 231, 右: 1 231
external_declaration (157)
左: 232 233, 右: 230 231
function_definition (158)
左: 234 235, 右: 232
declaration_list (159)
左: 236 237, 右: 234 237
State 0
0 $accept: . program $end
AUTO shift, and go to state 1
FLOAT shift, and go to state 2
DOUBLE shift, and go to state 3
CHAR shift, and go to state 4
VOID shift, and go to state 5
INT shift, and go to state 6
LONG shift, and go to state 7
BOOL shift, and go to state 8
SHORT shift, and go to state 9
VOLATILE shift, and go to state 10
CONST shift, and go to state 11
SIGNED shift, and go to state 12
UNSIGNED shift, and go to state 13
STATIC shift, and go to state 14
EXTERN shift, and go to state 15
INLINE shift, and go to state 16
TYPEDEF shift, and go to state 17
STRUCT shift, and go to state 18
ENUM shift, and go to state 19
UNION shift, and go to state 20
program 转到状态 21
declaration 转到状态 22
declaration_specifiers 转到状态 23
storage_class_specifier 转到状态 24
type_specifier 转到状态 25
struct_or_union_specifier 转到状态 26
struct_or_union 转到状态 27
enum_specifier 转到状态 28
type_qualifier 转到状态 29
function_specifier 转到状态 30
translation_unit 转到状态 31
external_declaration 转到状态 32
function_definition 转到状态 33
State 1
97 storage_class_specifier: AUTO .
$default reduce using rule 97 (storage_class_specifier)
State 2
103 type_specifier: FLOAT .
$default reduce using rule 103 (type_specifier)
State 3
104 type_specifier: DOUBLE .
$default reduce using rule 104 (type_specifier)
State 4
99 type_specifier: CHAR .
$default reduce using rule 99 (type_specifier)
State 5
98 type_specifier: VOID .
$default reduce using rule 98 (type_specifier)
State 6
101 type_specifier: INT .
$default reduce using rule 101 (type_specifier)
State 7
102 type_specifier: LONG .
$default reduce using rule 102 (type_specifier)
State 8
107 type_specifier: BOOL .
$default reduce using rule 107 (type_specifier)
State 9
100 type_specifier: SHORT .
$default reduce using rule 100 (type_specifier)
State 10
137 type_qualifier: VOLATILE .
$default reduce using rule 137 (type_qualifier)
State 11
136 type_qualifier: CONST .
$default reduce using rule 136 (type_qualifier)
State 12
105 type_specifier: SIGNED .
$default reduce using rule 105 (type_specifier)
State 13
106 type_specifier: UNSIGNED .
$default reduce using rule 106 (type_specifier)
State 14
96 storage_class_specifier: STATIC .
$default reduce using rule 96 (storage_class_specifier)
State 15
95 storage_class_specifier: EXTERN .
$default reduce using rule 95 (storage_class_specifier)
State 16
138 function_specifier: INLINE .
$default reduce using rule 138 (function_specifier)
State 17
94 storage_class_specifier: TYPEDEF .
$default reduce using rule 94 (storage_class_specifier)
State 18
113 struct_or_union: STRUCT .
$default reduce using rule 113 (struct_or_union)
State 19
127 enum_specifier: ENUM . '{' enumerator_list '}'
128 | ENUM . IDENTIFIER '{' enumerator_list '}'
129 | ENUM . '{' enumerator_list ',' '}'
130 | ENUM . IDENTIFIER '{' enumerator_list ',' '}'
131 | ENUM . IDENTIFIER
IDENTIFIER shift, and go to state 34
'{' shift, and go to state 35
State 20
114 struct_or_union: UNION .
$default reduce using rule 114 (struct_or_union)
State 21
0 $accept: program . $end
$end shift, and go to state 36
State 22
233 external_declaration: declaration .
$default reduce using rule 233 (external_declaration)
State 23
80 declaration: declaration_specifiers . ';'
81 | declaration_specifiers . init_declarator_list ';'
234 function_definition: declaration_specifiers . declarator declaration_list compound_statement
235 | declaration_specifiers . declarator compound_statement
IDENTIFIER shift, and go to state 37
';' shift, and go to state 38
'*' shift, and go to state 39
'(' shift, and go to state 40
init_declarator_list 转到状态 41
init_declarator 转到状态 42
declarator 转到状态 43
direct_declarator 转到状态 44
pointer 转到状态 45
State 24
82 declaration_specifiers: storage_class_specifier .
83 | storage_class_specifier . declaration_specifiers
AUTO shift, and go to state 1
FLOAT shift, and go to state 2
DOUBLE shift, and go to state 3
CHAR shift, and go to state 4
VOID shift, and go to state 5
INT shift, and go to state 6
LONG shift, and go to state 7
BOOL shift, and go to state 8
SHORT shift, and go to state 9
VOLATILE shift, and go to state 10
CONST shift, and go to state 11
SIGNED shift, and go to state 12
UNSIGNED shift, and go to state 13
STATIC shift, and go to state 14
EXTERN shift, and go to state 15
INLINE shift, and go to state 16
TYPEDEF shift, and go to state 17
STRUCT shift, and go to state 18
ENUM shift, and go to state 19
UNION shift, and go to state 20
$default reduce using rule 82 (declaration_specifiers)
declaration_specifiers 转到状态 46
storage_class_specifier 转到状态 24
type_specifier 转到状态 25
struct_or_union_specifier 转到状态 26
struct_or_union 转到状态 27
enum_specifier 转到状态 28
type_qualifier 转到状态 29
function_specifier 转到状态 30
State 25
84 declaration_specifiers: type_specifier .
85 | type_specifier . declaration_specifiers
AUTO shift, and go to state 1
FLOAT shift, and go to state 2
DOUBLE shift, and go to state 3
CHAR shift, and go to state 4
VOID shift, and go to state 5
INT shift, and go to state 6
LONG shift, and go to state 7
BOOL shift, and go to state 8
SHORT shift, and go to state 9
VOLATILE shift, and go to state 10
CONST shift, and go to state 11
SIGNED shift, and go to state 12
UNSIGNED shift, and go to state 13
STATIC shift, and go to state 14
EXTERN shift, and go to state 15
INLINE shift, and go to state 16
TYPEDEF shift, and go to state 17
STRUCT shift, and go to state 18
ENUM shift, and go to state 19
UNION shift, and go to state 20
$default reduce using rule 84 (declaration_specifiers)
declaration_specifiers 转到状态 47
storage_class_specifier 转到状态 24
type_specifier 转到状态 25
struct_or_union_specifier 转到状态 26
struct_or_union 转到状态 27
enum_specifier 转到状态 28
type_qualifier 转到状态 29
function_specifier 转到状态 30
State 26
108 type_specifier: struct_or_union_specifier .
$default reduce using rule 108 (type_specifier)
State 27
110 struct_or_union_specifier: struct_or_union . IDENTIFIER '{' struct_declaration_list '}'
111 | struct_or_union . '{' struct_declaration_list '}'
112 | struct_or_union . IDENTIFIER
IDENTIFIER shift, and go to state 48
'{' shift, and go to state 49
State 28
109 type_specifier: enum_specifier .
$default reduce using rule 109 (type_specifier)
State 29
86 declaration_specifiers: type_qualifier .
87 | type_qualifier . declaration_specifiers
AUTO shift, and go to state 1
FLOAT shift, and go to state 2
DOUBLE shift, and go to state 3
CHAR shift, and go to state 4
VOID shift, and go to state 5
INT shift, and go to state 6
LONG shift, and go to state 7
BOOL shift, and go to state 8
SHORT shift, and go to state 9
VOLATILE shift, and go to state 10
CONST shift, and go to state 11
SIGNED shift, and go to state 12
UNSIGNED shift, and go to state 13
STATIC shift, and go to state 14
EXTERN shift, and go to state 15
INLINE shift, and go to state 16
TYPEDEF shift, and go to state 17
STRUCT shift, and go to state 18
ENUM shift, and go to state 19
UNION shift, and go to state 20
$default reduce using rule 86 (declaration_specifiers)
declaration_specifiers 转到状态 50
storage_class_specifier 转到状态 24
type_specifier 转到状态 25
struct_or_union_specifier 转到状态 26
struct_or_union 转到状态 27
enum_specifier 转到状态 28
type_qualifier 转到状态 29
function_specifier 转到状态 30
State 30
88 declaration_specifiers: function_specifier .
89 | function_specifier . declaration_specifiers
AUTO shift, and go to state 1
FLOAT shift, and go to state 2
DOUBLE shift, and go to state 3
CHAR shift, and go to state 4
VOID shift, and go to state 5
INT shift, and go to state 6
LONG shift, and go to state 7
BOOL shift, and go to state 8
SHORT shift, and go to state 9
VOLATILE shift, and go to state 10
CONST shift, and go to state 11
SIGNED shift, and go to state 12
UNSIGNED shift, and go to state 13
STATIC shift, and go to state 14
EXTERN shift, and go to state 15
INLINE shift, and go to state 16
TYPEDEF shift, and go to state 17
STRUCT shift, and go to state 18
ENUM shift, and go to state 19
UNION shift, and go to state 20
$default reduce using rule 88 (declaration_specifiers)
declaration_specifiers 转到状态 51
storage_class_specifier 转到状态 24
type_specifier 转到状态 25
struct_or_union_specifier 转到状态 26
struct_or_union 转到状态 27
enum_specifier 转到状态 28
type_qualifier 转到状态 29
function_specifier 转到状态 30
State 31
1 program: translation_unit .
231 translation_unit: translation_unit . external_declaration
AUTO shift, and go to state 1
FLOAT shift, and go to state 2
DOUBLE shift, and go to state 3
CHAR shift, and go to state 4
VOID shift, and go to state 5
INT shift, and go to state 6
LONG shift, and go to state 7
BOOL shift, and go to state 8
SHORT shift, and go to state 9
VOLATILE shift, and go to state 10
CONST shift, and go to state 11
SIGNED shift, and go to state 12
UNSIGNED shift, and go to state 13
STATIC shift, and go to state 14
EXTERN shift, and go to state 15
INLINE shift, and go to state 16
TYPEDEF shift, and go to state 17
STRUCT shift, and go to state 18
ENUM shift, and go to state 19
UNION shift, and go to state 20
$default reduce using rule 1 (program)
declaration 转到状态 22
declaration_specifiers 转到状态 23
storage_class_specifier 转到状态 24
type_specifier 转到状态 25
struct_or_union_specifier 转到状态 26
struct_or_union 转到状态 27
enum_specifier 转到状态 28
type_qualifier 转到状态 29
function_specifier 转到状态 30
external_declaration 转到状态 52