forked from aqjune/atdtocpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.output
320 lines (167 loc) · 5.57 KB
/
main.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
Terminals unused in grammar
TOK_WHITESPACE
State 28 conflicts: 1 shift/reduce
Grammar
0 $accept: program $end
1 program: program typedec
2 | /* empty */
3 typedec: TOK_TYPE TOK_WORD TOK_EQUAL typedec_remain
4 typedec_remain: TOK_LISTBEGIN conslist TOK_LISTEND
5 | TOK_RECORDBEG fieldlist TOK_RECORDEND
6 conslist: TOK_OR TOK_WORD TOK_OF atdtype conslist
7 | /* empty */
8 fieldlist: TOK_WORD TOK_COLON atdtype TOK_SEMICOLON fieldlist
9 | /* empty */
10 atdtype: TOK_WORD
11 | TOK_PTBEGIN TOK_WORD TOK_PTEND
12 | atdtype TOK_PRODUCT atdtype
Terminals, with rules where they appear
$end (0) 0
error (256)
TOK_WHITESPACE (258)
TOK_TYPE (259) 3
TOK_RECORDBEG (260) 5
TOK_RECORDEND (261) 5
TOK_LISTBEGIN (262) 4
TOK_LISTEND (263) 4
TOK_OF (264) 6
TOK_COLON (265) 8
TOK_SEMICOLON (266) 8
TOK_OR (267) 6
TOK_PRODUCT (268) 12
TOK_PTBEGIN (269) 11
TOK_PTEND (270) 11
TOK_WORD (271) 3 6 8 10 11
TOK_EQUAL (272) 3
Nonterminals, with rules where they appear
$accept (18)
on left: 0
program (19)
on left: 1 2, on right: 0 1
typedec (20)
on left: 3, on right: 1
typedec_remain (21)
on left: 4 5, on right: 3
conslist (22)
on left: 6 7, on right: 4 6
fieldlist (23)
on left: 8 9, on right: 5 8
atdtype (24)
on left: 10 11 12, on right: 6 8 12
State 0
0 $accept: . program $end
$default reduce using rule 2 (program)
program go to state 1
State 1
0 $accept: program . $end
1 program: program . typedec
$end shift, and go to state 2
TOK_TYPE shift, and go to state 3
typedec go to state 4
State 2
0 $accept: program $end .
$default accept
State 3
3 typedec: TOK_TYPE . TOK_WORD TOK_EQUAL typedec_remain
TOK_WORD shift, and go to state 5
State 4
1 program: program typedec .
$default reduce using rule 1 (program)
State 5
3 typedec: TOK_TYPE TOK_WORD . TOK_EQUAL typedec_remain
TOK_EQUAL shift, and go to state 6
State 6
3 typedec: TOK_TYPE TOK_WORD TOK_EQUAL . typedec_remain
TOK_RECORDBEG shift, and go to state 7
TOK_LISTBEGIN shift, and go to state 8
typedec_remain go to state 9
State 7
5 typedec_remain: TOK_RECORDBEG . fieldlist TOK_RECORDEND
TOK_WORD shift, and go to state 10
$default reduce using rule 9 (fieldlist)
fieldlist go to state 11
State 8
4 typedec_remain: TOK_LISTBEGIN . conslist TOK_LISTEND
TOK_OR shift, and go to state 12
$default reduce using rule 7 (conslist)
conslist go to state 13
State 9
3 typedec: TOK_TYPE TOK_WORD TOK_EQUAL typedec_remain .
$default reduce using rule 3 (typedec)
State 10
8 fieldlist: TOK_WORD . TOK_COLON atdtype TOK_SEMICOLON fieldlist
TOK_COLON shift, and go to state 14
State 11
5 typedec_remain: TOK_RECORDBEG fieldlist . TOK_RECORDEND
TOK_RECORDEND shift, and go to state 15
State 12
6 conslist: TOK_OR . TOK_WORD TOK_OF atdtype conslist
TOK_WORD shift, and go to state 16
State 13
4 typedec_remain: TOK_LISTBEGIN conslist . TOK_LISTEND
TOK_LISTEND shift, and go to state 17
State 14
8 fieldlist: TOK_WORD TOK_COLON . atdtype TOK_SEMICOLON fieldlist
TOK_PTBEGIN shift, and go to state 18
TOK_WORD shift, and go to state 19
atdtype go to state 20
State 15
5 typedec_remain: TOK_RECORDBEG fieldlist TOK_RECORDEND .
$default reduce using rule 5 (typedec_remain)
State 16
6 conslist: TOK_OR TOK_WORD . TOK_OF atdtype conslist
TOK_OF shift, and go to state 21
State 17
4 typedec_remain: TOK_LISTBEGIN conslist TOK_LISTEND .
$default reduce using rule 4 (typedec_remain)
State 18
11 atdtype: TOK_PTBEGIN . TOK_WORD TOK_PTEND
TOK_WORD shift, and go to state 22
State 19
10 atdtype: TOK_WORD .
$default reduce using rule 10 (atdtype)
State 20
8 fieldlist: TOK_WORD TOK_COLON atdtype . TOK_SEMICOLON fieldlist
12 atdtype: atdtype . TOK_PRODUCT atdtype
TOK_SEMICOLON shift, and go to state 23
TOK_PRODUCT shift, and go to state 24
State 21
6 conslist: TOK_OR TOK_WORD TOK_OF . atdtype conslist
TOK_PTBEGIN shift, and go to state 18
TOK_WORD shift, and go to state 19
atdtype go to state 25
State 22
11 atdtype: TOK_PTBEGIN TOK_WORD . TOK_PTEND
TOK_PTEND shift, and go to state 26
State 23
8 fieldlist: TOK_WORD TOK_COLON atdtype TOK_SEMICOLON . fieldlist
TOK_WORD shift, and go to state 10
$default reduce using rule 9 (fieldlist)
fieldlist go to state 27
State 24
12 atdtype: atdtype TOK_PRODUCT . atdtype
TOK_PTBEGIN shift, and go to state 18
TOK_WORD shift, and go to state 19
atdtype go to state 28
State 25
6 conslist: TOK_OR TOK_WORD TOK_OF atdtype . conslist
12 atdtype: atdtype . TOK_PRODUCT atdtype
TOK_OR shift, and go to state 12
TOK_PRODUCT shift, and go to state 24
$default reduce using rule 7 (conslist)
conslist go to state 29
State 26
11 atdtype: TOK_PTBEGIN TOK_WORD TOK_PTEND .
$default reduce using rule 11 (atdtype)
State 27
8 fieldlist: TOK_WORD TOK_COLON atdtype TOK_SEMICOLON fieldlist .
$default reduce using rule 8 (fieldlist)
State 28
12 atdtype: atdtype . TOK_PRODUCT atdtype
12 | atdtype TOK_PRODUCT atdtype .
TOK_PRODUCT shift, and go to state 24
TOK_PRODUCT [reduce using rule 12 (atdtype)]
$default reduce using rule 12 (atdtype)
State 29
6 conslist: TOK_OR TOK_WORD TOK_OF atdtype conslist .
$default reduce using rule 6 (conslist)