Mercurial > hg > Members > nobuyasu > SampleSource
comparison Bison-Flex/CALC/Bison-Flex/EUC/calc-parser.output @ 0:db40c85cad7a default tip
upload sample source
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 09 May 2011 03:11:59 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:db40c85cad7a |
---|---|
1 文法 | |
2 | |
3 0 $accept: unit "end of file" | |
4 | |
5 1 unit: state | |
6 2 | unit state | |
7 | |
8 3 state: "identifier" '=' expr '\n' | |
9 4 | "print" expr '\n' | |
10 5 | "list" '\n' | |
11 | |
12 6 expr: expr '-' expr | |
13 7 | expr '+' expr | |
14 8 | expr '*' expr | |
15 9 | expr '/' expr | |
16 10 | '-' expr | |
17 11 | '(' expr ')' | |
18 12 | "identifier" | |
19 13 | "ival" | |
20 | |
21 | |
22 出現位置の規則による終端 | |
23 | |
24 "end of file" (0) 0 | |
25 '\n' (10) 3 4 5 | |
26 '(' (40) 11 | |
27 ')' (41) 11 | |
28 '*' (42) 8 | |
29 '+' (43) 7 | |
30 '-' (45) 6 10 | |
31 '/' (47) 9 | |
32 '=' (61) 3 | |
33 error (256) | |
34 "ival" (258) 13 | |
35 "identifier" (259) 3 12 | |
36 "print" (260) 4 | |
37 "list" (261) 5 | |
38 NEG (262) | |
39 | |
40 | |
41 出現位置の規則による非終端 | |
42 | |
43 $accept (16) | |
44 左辺: 0 | |
45 unit (17) | |
46 左辺: 1 2, 右辺: 0 2 | |
47 state (18) | |
48 左辺: 3 4 5, 右辺: 1 2 | |
49 expr (19) | |
50 左辺: 6 7 8 9 10 11 12 13, 右辺: 3 4 6 7 8 9 10 11 | |
51 | |
52 | |
53 状態 0 | |
54 | |
55 0 $accept: . unit "end of file" | |
56 1 unit: . state | |
57 2 | . unit state | |
58 3 state: . "identifier" '=' expr '\n' | |
59 4 | . "print" expr '\n' | |
60 5 | . "list" '\n' | |
61 | |
62 "identifier" shift, and go to state 1 | |
63 "print" shift, and go to state 2 | |
64 "list" shift, and go to state 3 | |
65 | |
66 unit go to state 4 | |
67 state go to state 5 | |
68 | |
69 | |
70 状態 1 | |
71 | |
72 3 state: "identifier" . '=' expr '\n' | |
73 | |
74 '=' shift, and go to state 6 | |
75 | |
76 | |
77 状態 2 | |
78 | |
79 4 state: "print" . expr '\n' | |
80 6 expr: . expr '-' expr | |
81 7 | . expr '+' expr | |
82 8 | . expr '*' expr | |
83 9 | . expr '/' expr | |
84 10 | . '-' expr | |
85 11 | . '(' expr ')' | |
86 12 | . "identifier" | |
87 13 | . "ival" | |
88 | |
89 "ival" shift, and go to state 7 | |
90 "identifier" shift, and go to state 8 | |
91 '-' shift, and go to state 9 | |
92 '(' shift, and go to state 10 | |
93 | |
94 expr go to state 11 | |
95 | |
96 | |
97 状態 3 | |
98 | |
99 5 state: "list" . '\n' | |
100 | |
101 '\n' shift, and go to state 12 | |
102 | |
103 | |
104 状態 4 | |
105 | |
106 0 $accept: unit . "end of file" | |
107 2 unit: unit . state | |
108 3 state: . "identifier" '=' expr '\n' | |
109 4 | . "print" expr '\n' | |
110 5 | . "list" '\n' | |
111 | |
112 "end of file" shift, and go to state 13 | |
113 "identifier" shift, and go to state 1 | |
114 "print" shift, and go to state 2 | |
115 "list" shift, and go to state 3 | |
116 | |
117 state go to state 14 | |
118 | |
119 | |
120 状態 5 | |
121 | |
122 1 unit: state . | |
123 | |
124 $default reduce using rule 1 (unit) | |
125 | |
126 | |
127 状態 6 | |
128 | |
129 3 state: "identifier" '=' . expr '\n' | |
130 6 expr: . expr '-' expr | |
131 7 | . expr '+' expr | |
132 8 | . expr '*' expr | |
133 9 | . expr '/' expr | |
134 10 | . '-' expr | |
135 11 | . '(' expr ')' | |
136 12 | . "identifier" | |
137 13 | . "ival" | |
138 | |
139 "ival" shift, and go to state 7 | |
140 "identifier" shift, and go to state 8 | |
141 '-' shift, and go to state 9 | |
142 '(' shift, and go to state 10 | |
143 | |
144 expr go to state 15 | |
145 | |
146 | |
147 状態 7 | |
148 | |
149 13 expr: "ival" . | |
150 | |
151 $default reduce using rule 13 (expr) | |
152 | |
153 | |
154 状態 8 | |
155 | |
156 12 expr: "identifier" . | |
157 | |
158 $default reduce using rule 12 (expr) | |
159 | |
160 | |
161 状態 9 | |
162 | |
163 6 expr: . expr '-' expr | |
164 7 | . expr '+' expr | |
165 8 | . expr '*' expr | |
166 9 | . expr '/' expr | |
167 10 | . '-' expr | |
168 10 | '-' . expr | |
169 11 | . '(' expr ')' | |
170 12 | . "identifier" | |
171 13 | . "ival" | |
172 | |
173 "ival" shift, and go to state 7 | |
174 "identifier" shift, and go to state 8 | |
175 '-' shift, and go to state 9 | |
176 '(' shift, and go to state 10 | |
177 | |
178 expr go to state 16 | |
179 | |
180 | |
181 状態 10 | |
182 | |
183 6 expr: . expr '-' expr | |
184 7 | . expr '+' expr | |
185 8 | . expr '*' expr | |
186 9 | . expr '/' expr | |
187 10 | . '-' expr | |
188 11 | . '(' expr ')' | |
189 11 | '(' . expr ')' | |
190 12 | . "identifier" | |
191 13 | . "ival" | |
192 | |
193 "ival" shift, and go to state 7 | |
194 "identifier" shift, and go to state 8 | |
195 '-' shift, and go to state 9 | |
196 '(' shift, and go to state 10 | |
197 | |
198 expr go to state 17 | |
199 | |
200 | |
201 状態 11 | |
202 | |
203 4 state: "print" expr . '\n' | |
204 6 expr: expr . '-' expr | |
205 7 | expr . '+' expr | |
206 8 | expr . '*' expr | |
207 9 | expr . '/' expr | |
208 | |
209 '+' shift, and go to state 18 | |
210 '-' shift, and go to state 19 | |
211 '*' shift, and go to state 20 | |
212 '/' shift, and go to state 21 | |
213 '\n' shift, and go to state 22 | |
214 | |
215 | |
216 状態 12 | |
217 | |
218 5 state: "list" '\n' . | |
219 | |
220 $default reduce using rule 5 (state) | |
221 | |
222 | |
223 状態 13 | |
224 | |
225 0 $accept: unit "end of file" . | |
226 | |
227 $default accept | |
228 | |
229 | |
230 状態 14 | |
231 | |
232 2 unit: unit state . | |
233 | |
234 $default reduce using rule 2 (unit) | |
235 | |
236 | |
237 状態 15 | |
238 | |
239 3 state: "identifier" '=' expr . '\n' | |
240 6 expr: expr . '-' expr | |
241 7 | expr . '+' expr | |
242 8 | expr . '*' expr | |
243 9 | expr . '/' expr | |
244 | |
245 '+' shift, and go to state 18 | |
246 '-' shift, and go to state 19 | |
247 '*' shift, and go to state 20 | |
248 '/' shift, and go to state 21 | |
249 '\n' shift, and go to state 23 | |
250 | |
251 | |
252 状態 16 | |
253 | |
254 6 expr: expr . '-' expr | |
255 7 | expr . '+' expr | |
256 8 | expr . '*' expr | |
257 9 | expr . '/' expr | |
258 10 | '-' expr . ['+', '-', '*', '/', '\n', ')'] | |
259 | |
260 $default reduce using rule 10 (expr) | |
261 | |
262 Conflict between rule 10 and token '+' resolved as reduce ('+' < NEG). | |
263 Conflict between rule 10 and token '-' resolved as reduce ('-' < NEG). | |
264 Conflict between rule 10 and token '*' resolved as reduce ('*' < NEG). | |
265 Conflict between rule 10 and token '/' resolved as reduce ('/' < NEG). | |
266 | |
267 | |
268 状態 17 | |
269 | |
270 6 expr: expr . '-' expr | |
271 7 | expr . '+' expr | |
272 8 | expr . '*' expr | |
273 9 | expr . '/' expr | |
274 11 | '(' expr . ')' | |
275 | |
276 '+' shift, and go to state 18 | |
277 '-' shift, and go to state 19 | |
278 '*' shift, and go to state 20 | |
279 '/' shift, and go to state 21 | |
280 ')' shift, and go to state 24 | |
281 | |
282 | |
283 状態 18 | |
284 | |
285 6 expr: . expr '-' expr | |
286 7 | . expr '+' expr | |
287 7 | expr '+' . expr | |
288 8 | . expr '*' expr | |
289 9 | . expr '/' expr | |
290 10 | . '-' expr | |
291 11 | . '(' expr ')' | |
292 12 | . "identifier" | |
293 13 | . "ival" | |
294 | |
295 "ival" shift, and go to state 7 | |
296 "identifier" shift, and go to state 8 | |
297 '-' shift, and go to state 9 | |
298 '(' shift, and go to state 10 | |
299 | |
300 expr go to state 25 | |
301 | |
302 | |
303 状態 19 | |
304 | |
305 6 expr: . expr '-' expr | |
306 6 | expr '-' . expr | |
307 7 | . expr '+' expr | |
308 8 | . expr '*' expr | |
309 9 | . expr '/' expr | |
310 10 | . '-' expr | |
311 11 | . '(' expr ')' | |
312 12 | . "identifier" | |
313 13 | . "ival" | |
314 | |
315 "ival" shift, and go to state 7 | |
316 "identifier" shift, and go to state 8 | |
317 '-' shift, and go to state 9 | |
318 '(' shift, and go to state 10 | |
319 | |
320 expr go to state 26 | |
321 | |
322 | |
323 状態 20 | |
324 | |
325 6 expr: . expr '-' expr | |
326 7 | . expr '+' expr | |
327 8 | . expr '*' expr | |
328 8 | expr '*' . expr | |
329 9 | . expr '/' expr | |
330 10 | . '-' expr | |
331 11 | . '(' expr ')' | |
332 12 | . "identifier" | |
333 13 | . "ival" | |
334 | |
335 "ival" shift, and go to state 7 | |
336 "identifier" shift, and go to state 8 | |
337 '-' shift, and go to state 9 | |
338 '(' shift, and go to state 10 | |
339 | |
340 expr go to state 27 | |
341 | |
342 | |
343 状態 21 | |
344 | |
345 6 expr: . expr '-' expr | |
346 7 | . expr '+' expr | |
347 8 | . expr '*' expr | |
348 9 | . expr '/' expr | |
349 9 | expr '/' . expr | |
350 10 | . '-' expr | |
351 11 | . '(' expr ')' | |
352 12 | . "identifier" | |
353 13 | . "ival" | |
354 | |
355 "ival" shift, and go to state 7 | |
356 "identifier" shift, and go to state 8 | |
357 '-' shift, and go to state 9 | |
358 '(' shift, and go to state 10 | |
359 | |
360 expr go to state 28 | |
361 | |
362 | |
363 状態 22 | |
364 | |
365 4 state: "print" expr '\n' . | |
366 | |
367 $default reduce using rule 4 (state) | |
368 | |
369 | |
370 状態 23 | |
371 | |
372 3 state: "identifier" '=' expr '\n' . | |
373 | |
374 $default reduce using rule 3 (state) | |
375 | |
376 | |
377 状態 24 | |
378 | |
379 11 expr: '(' expr ')' . | |
380 | |
381 $default reduce using rule 11 (expr) | |
382 | |
383 | |
384 状態 25 | |
385 | |
386 6 expr: expr . '-' expr | |
387 7 | expr . '+' expr ['+', '-', '\n', ')'] | |
388 7 | expr '+' expr . ['+', '-', '\n', ')'] | |
389 8 | expr . '*' expr | |
390 9 | expr . '/' expr | |
391 | |
392 '*' shift, and go to state 20 | |
393 '/' shift, and go to state 21 | |
394 | |
395 $default reduce using rule 7 (expr) | |
396 | |
397 Conflict between rule 7 and token '+' resolved as reduce (%left '+'). | |
398 Conflict between rule 7 and token '-' resolved as reduce (%left '-'). | |
399 Conflict between rule 7 and token '*' resolved as shift ('+' < '*'). | |
400 Conflict between rule 7 and token '/' resolved as shift ('+' < '/'). | |
401 | |
402 | |
403 状態 26 | |
404 | |
405 6 expr: expr . '-' expr ['+', '-', '\n', ')'] | |
406 6 | expr '-' expr . ['+', '-', '\n', ')'] | |
407 7 | expr . '+' expr | |
408 8 | expr . '*' expr | |
409 9 | expr . '/' expr | |
410 | |
411 '*' shift, and go to state 20 | |
412 '/' shift, and go to state 21 | |
413 | |
414 $default reduce using rule 6 (expr) | |
415 | |
416 Conflict between rule 6 and token '+' resolved as reduce (%left '+'). | |
417 Conflict between rule 6 and token '-' resolved as reduce (%left '-'). | |
418 Conflict between rule 6 and token '*' resolved as shift ('-' < '*'). | |
419 Conflict between rule 6 and token '/' resolved as shift ('-' < '/'). | |
420 | |
421 | |
422 状態 27 | |
423 | |
424 6 expr: expr . '-' expr | |
425 7 | expr . '+' expr | |
426 8 | expr . '*' expr ['+', '-', '*', '/', '\n', ')'] | |
427 8 | expr '*' expr . ['+', '-', '*', '/', '\n', ')'] | |
428 9 | expr . '/' expr | |
429 | |
430 $default reduce using rule 8 (expr) | |
431 | |
432 Conflict between rule 8 and token '+' resolved as reduce ('+' < '*'). | |
433 Conflict between rule 8 and token '-' resolved as reduce ('-' < '*'). | |
434 Conflict between rule 8 and token '*' resolved as reduce (%left '*'). | |
435 Conflict between rule 8 and token '/' resolved as reduce (%left '/'). | |
436 | |
437 | |
438 状態 28 | |
439 | |
440 6 expr: expr . '-' expr | |
441 7 | expr . '+' expr | |
442 8 | expr . '*' expr | |
443 9 | expr . '/' expr ['+', '-', '*', '/', '\n', ')'] | |
444 9 | expr '/' expr . ['+', '-', '*', '/', '\n', ')'] | |
445 | |
446 $default reduce using rule 9 (expr) | |
447 | |
448 Conflict between rule 9 and token '+' resolved as reduce ('+' < '/'). | |
449 Conflict between rule 9 and token '-' resolved as reduce ('-' < '/'). | |
450 Conflict between rule 9 and token '*' resolved as reduce (%left '*'). | |
451 Conflict between rule 9 and token '/' resolved as reduce (%left '/'). |