forked from sanved77/flexbison
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.output
119 lines (65 loc) · 1.57 KB
/
test.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
Grammar
0 $accept: prog $end
1 prog: stmts
2 stmts: %empty
3 | stmt SEMICOLON stmts
4 stmt: STRING
5 | NUM
6 | OTHER
Terminals, with rules where they appear
$end (0) 0
error (256)
STRING (258) 4
NUM (259) 5
OTHER (260) 6
SEMICOLON (261) 3
Nonterminals, with rules where they appear
$accept (7)
on left: 0
prog (8)
on left: 1, on right: 0
stmts (9)
on left: 2 3, on right: 1 3
stmt (10)
on left: 4 5 6, on right: 3
State 0
0 $accept: . prog $end
STRING shift, and go to state 1
NUM shift, and go to state 2
OTHER shift, and go to state 3
$default reduce using rule 2 (stmts)
prog go to state 4
stmts go to state 5
stmt go to state 6
State 1
4 stmt: STRING .
$default reduce using rule 4 (stmt)
State 2
5 stmt: NUM .
$default reduce using rule 5 (stmt)
State 3
6 stmt: OTHER .
$default reduce using rule 6 (stmt)
State 4
0 $accept: prog . $end
$end shift, and go to state 7
State 5
1 prog: stmts .
$default reduce using rule 1 (prog)
State 6
3 stmts: stmt . SEMICOLON stmts
SEMICOLON shift, and go to state 8
State 7
0 $accept: prog $end .
$default accept
State 8
3 stmts: stmt SEMICOLON . stmts
STRING shift, and go to state 1
NUM shift, and go to state 2
OTHER shift, and go to state 3
$default reduce using rule 2 (stmts)
stmts go to state 9
stmt go to state 6
State 9
3 stmts: stmt SEMICOLON stmts .
$default reduce using rule 3 (stmts)