Debian Codegraph @

documentation/demos/manual/calc/parser/parse.output

raw
1
2
3
4 Production Rules:
5 1: input -> <empty>
6 2: input -> input line
7 3: line -> '\n'
8 4: line -> exp '\n'
9 5: exp -> NUM
10 6: exp -> exp '+' exp
11 7: exp -> exp '-' exp
12 8: exp -> exp '*' exp
13 9: exp -> exp '/' exp
14 10: exp -> '-' exp
15 11: exp -> exp '^' exp
16 12: exp -> '(' exp ')'
17 13: input_$ -> input
18
19
20 GRAMMAR STATES:
21
22 State 0
23
24 input_$ -> . input (rule 13)
25 Lookahead set { <EOF> }
26
27 All production rules (using dot == 0) of:
28 input Lookahead set { NUM '-' '\n' '(' <EOF> }
29
30 on input: shift, and go to state 1
31
32 _default_: reduce, using production
33 1: input -> <empty>
34
35 State 1
36
37 input_$ -> input . (rule 13)
38 Lookahead set { <EOF> }
39
40 input -> input . line (rule 2)
41 Lookahead set { NUM '-' '\n' '(' <EOF> }
42
43 All production rules (using dot == 0) of:
44 line Lookahead set { NUM '-' '\n' '(' <EOF> }
45 exp Lookahead set { '-' '+' '*' '/' '^' '\n' }
46
47 on NUM: shift, and go to state 2
48 on '-': shift, and go to state 3
49 on '\n': shift, and go to state 5
50 on '(': shift, and go to state 7
51 on line: shift, and go to state 4
52 on exp: shift, and go to state 6
53
54 State 2 (inherited terminal: NUM)
55
56 exp -> NUM . (rule 5)
57 Lookahead set { '-' '+' '*' '/' '^' '\n' ')' }
58
59
60 _default_: reduce, using production
61 5: exp -> NUM
62
63 State 3 (inherited terminal: '-')
64
65 exp -> '-' . exp (rule 10)
66 Lookahead set { '-' '+' '*' '/' '^' '\n' ')' }
67
68 All production rules (using dot == 0) of:
69 exp Lookahead set { '-' '+' '*' '/' '^' '\n' }
70
71 on NUM: shift, and go to state 2
72 on '-': shift, and go to state 3
73 on '(': shift, and go to state 7
74 on exp: shift, and go to state 8
75
76 State 4
77
78 input -> input line . (rule 2)
79 Lookahead set { NUM '-' '\n' '(' <EOF> }
80
81
82 _default_: reduce, using production
83 2: input -> input line
84
85 State 5 (inherited terminal: '\n')
86
87 line -> '\n' . (rule 3)
88 Lookahead set { NUM '-' '\n' '(' <EOF> }
89
90
91 _default_: reduce, using production
92 3: line -> '\n'
93
94 State 6
95
96 line -> exp . '\n' (rule 4)
97 Lookahead set { NUM '-' '\n' '(' <EOF> }
98
99 exp -> exp . '+' exp (rule 6)
100 Lookahead set { '-' '+' '*' '/' '^' '\n' }
101
102 exp -> exp . '-' exp (rule 7)
103 Lookahead set { '-' '+' '*' '/' '^' '\n' }
104
105 exp -> exp . '*' exp (rule 8)
106 Lookahead set { '-' '+' '*' '/' '^' '\n' }
107
108 exp -> exp . '/' exp (rule 9)
109 Lookahead set { '-' '+' '*' '/' '^' '\n' }
110
111 exp -> exp . '^' exp (rule 11)
112 Lookahead set { '-' '+' '*' '/' '^' '\n' }
113
114 on '-': shift, and go to state 9
115 on '+': shift, and go to state 10
116 on '*': shift, and go to state 11
117 on '/': shift, and go to state 12
118 on '^': shift, and go to state 13
119 on '\n': shift, and go to state 14
120
121 State 7 (inherited terminal: '(')
122
123 exp -> '(' . exp ')' (rule 12)
124 Lookahead set { '-' '+' '*' '/' '^' '\n' ')' }
125
126 All production rules (using dot == 0) of:
127 exp Lookahead set { '-' '+' '*' '/' '^' ')' }
128
129 on NUM: shift, and go to state 2
130 on '-': shift, and go to state 3
131 on '(': shift, and go to state 7
132 on exp: shift, and go to state 15
133
134 State 8 (inherited terminal: '-')
135
136 exp -> '-' exp . (rule 10)
137 Lookahead set { '-' '+' '*' '/' '^' '\n' }
138
139 exp -> exp . '+' exp (rule 6)
140 Lookahead set { '-' '+' '*' '/' '^' '\n' }
141
142 exp -> exp . '-' exp (rule 7)
143 Lookahead set { '-' '+' '*' '/' '^' '\n' }
144
145 exp -> exp . '*' exp (rule 8)
146 Lookahead set { '-' '+' '*' '/' '^' '\n' }
147
148 exp -> exp . '/' exp (rule 9)
149 Lookahead set { '-' '+' '*' '/' '^' '\n' }
150
151 exp -> exp . '^' exp (rule 11)
152 Lookahead set { '-' '+' '*' '/' '^' '\n' }
153
154 on '^': shift, and go to state 13
155
156 _default_: reduce, using production
157 10: exp -> '-' exp
158
159 Actions suppressed by the default conflict resolution procedures:
160 [on '^': reduce, using production
161 10: exp -> '-' exp]
162
163 State 9 (inherited terminal: '-')
164
165 exp -> exp '-' . exp (rule 7)
166 Lookahead set { '-' '+' '*' '/' '^' '\n' ')' }
167
168 All production rules (using dot == 0) of:
169 exp Lookahead set { '-' '+' '*' '/' '^' '\n' }
170
171 on NUM: shift, and go to state 2
172 on '-': shift, and go to state 3
173 on '(': shift, and go to state 7
174 on exp: shift, and go to state 16
175
176 State 10 (inherited terminal: '+')
177
178 exp -> exp '+' . exp (rule 6)
179 Lookahead set { '-' '+' '*' '/' '^' '\n' ')' }
180
181 All production rules (using dot == 0) of:
182 exp Lookahead set { '-' '+' '*' '/' '^' '\n' }
183
184 on NUM: shift, and go to state 2
185 on '-': shift, and go to state 3
186 on '(': shift, and go to state 7
187 on exp: shift, and go to state 17
188
189 State 11 (inherited terminal: '*')
190
191 exp -> exp '*' . exp (rule 8)
192 Lookahead set { '-' '+' '*' '/' '^' '\n' ')' }
193
194 All production rules (using dot == 0) of:
195 exp Lookahead set { '-' '+' '*' '/' '^' '\n' }
196
197 on NUM: shift, and go to state 2
198 on '-': shift, and go to state 3
199 on '(': shift, and go to state 7
200 on exp: shift, and go to state 18
201
202 State 12 (inherited terminal: '/')
203
204 exp -> exp '/' . exp (rule 9)
205 Lookahead set { '-' '+' '*' '/' '^' '\n' ')' }
206
207 All production rules (using dot == 0) of:
208 exp Lookahead set { '-' '+' '*' '/' '^' '\n' }
209
210 on NUM: shift, and go to state 2
211 on '-': shift, and go to state 3
212 on '(': shift, and go to state 7
213 on exp: shift, and go to state 19
214
215 State 13 (inherited terminal: '^')
216
217 exp -> exp '^' . exp (rule 11)
218 Lookahead set { '-' '+' '*' '/' '^' '\n' ')' }
219
220 All production rules (using dot == 0) of:
221 exp Lookahead set { '-' '+' '*' '/' '^' '\n' }
222
223 on NUM: shift, and go to state 2
224 on '-': shift, and go to state 3
225 on '(': shift, and go to state 7
226 on exp: shift, and go to state 20
227
228 State 14 (inherited terminal: '\n')
229
230 line -> exp '\n' . (rule 4)
231 Lookahead set { NUM '-' '\n' '(' <EOF> }
232
233
234 _default_: reduce, using production
235 4: line -> exp '\n'
236
237 State 15 (inherited terminal: '(')
238
239 exp -> '(' exp . ')' (rule 12)
240 Lookahead set { '-' '+' '*' '/' '^' '\n' ')' }
241
242 exp -> exp . '+' exp (rule 6)
243 Lookahead set { '-' '+' '*' '/' '^' ')' }
244
245 exp -> exp . '-' exp (rule 7)
246 Lookahead set { '-' '+' '*' '/' '^' ')' }
247
248 exp -> exp . '*' exp (rule 8)
249 Lookahead set { '-' '+' '*' '/' '^' ')' }
250
251 exp -> exp . '/' exp (rule 9)
252 Lookahead set { '-' '+' '*' '/' '^' ')' }
253
254 exp -> exp . '^' exp (rule 11)
255 Lookahead set { '-' '+' '*' '/' '^' ')' }
256
257 on '-': shift, and go to state 9
258 on '+': shift, and go to state 10
259 on '*': shift, and go to state 11
260 on '/': shift, and go to state 12
261 on '^': shift, and go to state 13
262 on ')': shift, and go to state 21
263
264 State 16 (inherited terminal: '-')
265
266 exp -> exp '-' exp . (rule 7)
267 Lookahead set { '-' '+' '*' '/' '^' '\n' }
268
269 exp -> exp . '+' exp (rule 6)
270 Lookahead set { '-' '+' '*' '/' '^' '\n' }
271
272 exp -> exp . '-' exp (rule 7)
273 Lookahead set { '-' '+' '*' '/' '^' '\n' }
274
275 exp -> exp . '*' exp (rule 8)
276 Lookahead set { '-' '+' '*' '/' '^' '\n' }
277
278 exp -> exp . '/' exp (rule 9)
279 Lookahead set { '-' '+' '*' '/' '^' '\n' }
280
281 exp -> exp . '^' exp (rule 11)
282 Lookahead set { '-' '+' '*' '/' '^' '\n' }
283
284 on '*': shift, and go to state 11
285 on '/': shift, and go to state 12
286 on '^': shift, and go to state 13
287
288 _default_: reduce, using production
289 7: exp -> exp '-' exp
290
291 Actions suppressed by the default conflict resolution procedures:
292 [on '*': reduce, using production
293 7: exp -> exp '-' exp]
294 [on '/': reduce, using production
295 7: exp -> exp '-' exp]
296 [on '^': reduce, using production
297 7: exp -> exp '-' exp]
298
299 State 17 (inherited terminal: '+')
300
301 exp -> exp '+' exp . (rule 6)
302 Lookahead set { '-' '+' '*' '/' '^' '\n' }
303
304 exp -> exp . '+' exp (rule 6)
305 Lookahead set { '-' '+' '*' '/' '^' '\n' }
306
307 exp -> exp . '-' exp (rule 7)
308 Lookahead set { '-' '+' '*' '/' '^' '\n' }
309
310 exp -> exp . '*' exp (rule 8)
311 Lookahead set { '-' '+' '*' '/' '^' '\n' }
312
313 exp -> exp . '/' exp (rule 9)
314 Lookahead set { '-' '+' '*' '/' '^' '\n' }
315
316 exp -> exp . '^' exp (rule 11)
317 Lookahead set { '-' '+' '*' '/' '^' '\n' }
318
319 on '*': shift, and go to state 11
320 on '/': shift, and go to state 12
321 on '^': shift, and go to state 13
322
323 _default_: reduce, using production
324 6: exp -> exp '+' exp
325
326 Actions suppressed by the default conflict resolution procedures:
327 [on '*': reduce, using production
328 6: exp -> exp '+' exp]
329 [on '/': reduce, using production
330 6: exp -> exp '+' exp]
331 [on '^': reduce, using production
332 6: exp -> exp '+' exp]
333
334 State 18 (inherited terminal: '*')
335
336 exp -> exp '*' exp . (rule 8)
337 Lookahead set { '-' '+' '*' '/' '^' '\n' }
338
339 exp -> exp . '+' exp (rule 6)
340 Lookahead set { '-' '+' '*' '/' '^' '\n' }
341
342 exp -> exp . '-' exp (rule 7)
343 Lookahead set { '-' '+' '*' '/' '^' '\n' }
344
345 exp -> exp . '*' exp (rule 8)
346 Lookahead set { '-' '+' '*' '/' '^' '\n' }
347
348 exp -> exp . '/' exp (rule 9)
349 Lookahead set { '-' '+' '*' '/' '^' '\n' }
350
351 exp -> exp . '^' exp (rule 11)
352 Lookahead set { '-' '+' '*' '/' '^' '\n' }
353
354 on '^': shift, and go to state 13
355
356 _default_: reduce, using production
357 8: exp -> exp '*' exp
358
359 Actions suppressed by the default conflict resolution procedures:
360 [on '^': reduce, using production
361 8: exp -> exp '*' exp]
362
363 State 19 (inherited terminal: '/')
364
365 exp -> exp '/' exp . (rule 9)
366 Lookahead set { '-' '+' '*' '/' '^' '\n' }
367
368 exp -> exp . '+' exp (rule 6)
369 Lookahead set { '-' '+' '*' '/' '^' '\n' }
370
371 exp -> exp . '-' exp (rule 7)
372 Lookahead set { '-' '+' '*' '/' '^' '\n' }
373
374 exp -> exp . '*' exp (rule 8)
375 Lookahead set { '-' '+' '*' '/' '^' '\n' }
376
377 exp -> exp . '/' exp (rule 9)
378 Lookahead set { '-' '+' '*' '/' '^' '\n' }
379
380 exp -> exp . '^' exp (rule 11)
381 Lookahead set { '-' '+' '*' '/' '^' '\n' }
382
383 on '^': shift, and go to state 13
384
385 _default_: reduce, using production
386 9: exp -> exp '/' exp
387
388 Actions suppressed by the default conflict resolution procedures:
389 [on '^': reduce, using production
390 9: exp -> exp '/' exp]
391
392 State 20 (inherited terminal: '^')
393
394 exp -> exp '^' exp . (rule 11)
395 Lookahead set { '-' '+' '*' '/' '^' '\n' ')' }
396
397 exp -> exp . '+' exp (rule 6)
398 Lookahead set { '-' '+' '*' '/' '^' '\n' }
399
400 exp -> exp . '-' exp (rule 7)
401 Lookahead set { '-' '+' '*' '/' '^' '\n' }
402
403 exp -> exp . '*' exp (rule 8)
404 Lookahead set { '-' '+' '*' '/' '^' '\n' }
405
406 exp -> exp . '/' exp (rule 9)
407 Lookahead set { '-' '+' '*' '/' '^' '\n' }
408
409 exp -> exp . '^' exp (rule 11)
410 Lookahead set { '-' '+' '*' '/' '^' '\n' }
411
412 on '^': shift, and go to state 13
413
414 _default_: reduce, using production
415 11: exp -> exp '^' exp
416
417 Actions suppressed by the default conflict resolution procedures:
418 [on '^': reduce, using production
419 11: exp -> exp '^' exp]
420
421 State 21 (inherited terminal: ')')
422
423 exp -> '(' exp ')' . (rule 12)
424 Lookahead set { '-' '+' '*' '/' '^' '\n' ')' }
425
426
427 _default_: reduce, using production
428 12: exp -> '(' exp ')'
429