-
Notifications
You must be signed in to change notification settings - Fork 0
/
parser.output
314 lines (186 loc) · 4.26 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
0 $accept : %entry% $end
1 program : begin_stmt statements end_stmt EOF
2 begin_stmt : BEGIN
3 end_stmt : END
4 statements :
5 | statement statements
6 | statement pipe_statements
7 statement : ID ASSIGN GET lstr
8 | GET lstr
9 | ID ASSIGN EXTRACT ID lstr lstr
10 | PRINT ID
11 pipe_statements :
12 | pipe_statement pipe_statements
13 | pipe_statement statements
14 pipe_statement : PIPE EXTRACT lstr lstr
15 | PIPE PRINT
16 lstr : STR
17 %entry% : '\001' program
state 0
$accept : . %entry% $end (0)
'\001' shift 1
. error
%entry% goto 2
state 1
%entry% : '\001' . program (17)
BEGIN shift 3
. error
program goto 4
begin_stmt goto 5
state 2
$accept : %entry% . $end (0)
$end accept
state 3
begin_stmt : BEGIN . (2)
. reduce 2
state 4
%entry% : '\001' program . (17)
. reduce 17
state 5
program : begin_stmt . statements end_stmt EOF (1)
statements : . (4)
ID shift 6
GET shift 7
PRINT shift 8
END reduce 4
statements goto 9
statement goto 10
state 6
statement : ID . ASSIGN GET lstr (7)
statement : ID . ASSIGN EXTRACT ID lstr lstr (9)
ASSIGN shift 11
. error
state 7
statement : GET . lstr (8)
STR shift 12
. error
lstr goto 13
state 8
statement : PRINT . ID (10)
ID shift 14
. error
state 9
program : begin_stmt statements . end_stmt EOF (1)
END shift 15
. error
end_stmt goto 16
10: reduce/reduce conflict (reduce 4, reduce 11) on END
state 10
statements : statement . statements (5)
statements : statement . pipe_statements (6)
statements : . (4)
pipe_statements : . (11)
ID shift 6
GET shift 7
PRINT shift 8
PIPE shift 17
END reduce 4
statements goto 18
statement goto 10
pipe_statements goto 19
pipe_statement goto 20
state 11
statement : ID ASSIGN . GET lstr (7)
statement : ID ASSIGN . EXTRACT ID lstr lstr (9)
GET shift 21
EXTRACT shift 22
. error
state 12
lstr : STR . (16)
. reduce 16
state 13
statement : GET lstr . (8)
. reduce 8
state 14
statement : PRINT ID . (10)
. reduce 10
state 15
end_stmt : END . (3)
. reduce 3
state 16
program : begin_stmt statements end_stmt . EOF (1)
EOF shift 23
. error
state 17
pipe_statement : PIPE . EXTRACT lstr lstr (14)
pipe_statement : PIPE . PRINT (15)
PRINT shift 24
EXTRACT shift 25
. error
state 18
statements : statement statements . (5)
. reduce 5
state 19
statements : statement pipe_statements . (6)
. reduce 6
20: reduce/reduce conflict (reduce 4, reduce 11) on END
state 20
pipe_statements : pipe_statement . pipe_statements (12)
pipe_statements : pipe_statement . statements (13)
statements : . (4)
pipe_statements : . (11)
ID shift 6
GET shift 7
PRINT shift 8
PIPE shift 17
END reduce 4
statements goto 26
statement goto 10
pipe_statements goto 27
pipe_statement goto 20
state 21
statement : ID ASSIGN GET . lstr (7)
STR shift 12
. error
lstr goto 28
state 22
statement : ID ASSIGN EXTRACT . ID lstr lstr (9)
ID shift 29
. error
state 23
program : begin_stmt statements end_stmt EOF . (1)
. reduce 1
state 24
pipe_statement : PIPE PRINT . (15)
. reduce 15
state 25
pipe_statement : PIPE EXTRACT . lstr lstr (14)
STR shift 12
. error
lstr goto 30
state 26
pipe_statements : pipe_statement statements . (13)
. reduce 13
state 27
pipe_statements : pipe_statement pipe_statements . (12)
. reduce 12
state 28
statement : ID ASSIGN GET lstr . (7)
. reduce 7
state 29
statement : ID ASSIGN EXTRACT ID . lstr lstr (9)
STR shift 12
. error
lstr goto 31
state 30
pipe_statement : PIPE EXTRACT lstr . lstr (14)
STR shift 12
. error
lstr goto 32
state 31
statement : ID ASSIGN EXTRACT ID lstr . lstr (9)
STR shift 12
. error
lstr goto 33
state 32
pipe_statement : PIPE EXTRACT lstr lstr . (14)
. reduce 14
state 33
statement : ID ASSIGN EXTRACT ID lstr lstr . (9)
. reduce 9
Rules never reduced:
pipe_statements : (11)
State 10 contains 1 reduce/reduce conflict.
State 20 contains 1 reduce/reduce conflict.
17 terminals, 10 nonterminals
18 grammar rules, 34 states