This repository was archived by the owner on Jun 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser.out
More file actions
244 lines (161 loc) · 6.9 KB
/
Copy pathparser.out
File metadata and controls
244 lines (161 loc) · 6.9 KB
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
Created by PLY version 3.10 (http://www.dabeaz.com/ply)
Unused terminals:
IF
RETURN
Grammar
Rule 0 S' -> commande
Rule 1 programme -> MAIN LPAREN enum RPAREN LACO commande FINISH PRINT LPAREN expression RPAREN RACO
Rule 2 enum -> ID
Rule 3 enum -> ID COMMA enum
Rule 4 empty -> <empty>
Rule 5 commande -> ID AFFECT expression
Rule 6 commande -> commande END commande
Rule 7 commande -> WHILE LPAREN expression RPAREN LACO commande RACO
Rule 8 expression -> NUMBER
Rule 9 expression -> ID
Rule 10 expression -> expression OPBIN expression
Terminals, with rules where they appear
AFFECT : 5
COMMA : 3
END : 6
FINISH : 1
ID : 2 3 5 9
IF :
LACO : 1 7
LPAREN : 1 1 7
MAIN : 1
NUMBER : 8
OPBIN : 10
PRINT : 1
RACO : 1 7
RETURN :
RPAREN : 1 1 7
WHILE : 7
error :
Nonterminals, with rules where they appear
commande : 1 6 6 7 0
empty :
enum : 1 3
expression : 1 5 7 10 10
programme :
Parsing method: LALR
state 0
(0) S' -> . commande
(5) commande -> . ID AFFECT expression
(6) commande -> . commande END commande
(7) commande -> . WHILE LPAREN expression RPAREN LACO commande RACO
ID shift and go to state 1
WHILE shift and go to state 2
commande shift and go to state 3
state 1
(5) commande -> ID . AFFECT expression
AFFECT shift and go to state 4
state 2
(7) commande -> WHILE . LPAREN expression RPAREN LACO commande RACO
LPAREN shift and go to state 5
state 3
(0) S' -> commande .
(6) commande -> commande . END commande
END shift and go to state 6
state 4
(5) commande -> ID AFFECT . expression
(8) expression -> . NUMBER
(9) expression -> . ID
(10) expression -> . expression OPBIN expression
NUMBER shift and go to state 9
ID shift and go to state 7
expression shift and go to state 8
state 5
(7) commande -> WHILE LPAREN . expression RPAREN LACO commande RACO
(8) expression -> . NUMBER
(9) expression -> . ID
(10) expression -> . expression OPBIN expression
NUMBER shift and go to state 9
ID shift and go to state 7
expression shift and go to state 10
state 6
(6) commande -> commande END . commande
(5) commande -> . ID AFFECT expression
(6) commande -> . commande END commande
(7) commande -> . WHILE LPAREN expression RPAREN LACO commande RACO
ID shift and go to state 1
WHILE shift and go to state 2
commande shift and go to state 11
state 7
(9) expression -> ID .
OPBIN reduce using rule 9 (expression -> ID .)
END reduce using rule 9 (expression -> ID .)
$end reduce using rule 9 (expression -> ID .)
RACO reduce using rule 9 (expression -> ID .)
RPAREN reduce using rule 9 (expression -> ID .)
state 8
(5) commande -> ID AFFECT expression .
(10) expression -> expression . OPBIN expression
RACO reduce using rule 5 (commande -> ID AFFECT expression .)
END reduce using rule 5 (commande -> ID AFFECT expression .)
$end reduce using rule 5 (commande -> ID AFFECT expression .)
OPBIN shift and go to state 12
state 9
(8) expression -> NUMBER .
OPBIN reduce using rule 8 (expression -> NUMBER .)
END reduce using rule 8 (expression -> NUMBER .)
$end reduce using rule 8 (expression -> NUMBER .)
RACO reduce using rule 8 (expression -> NUMBER .)
RPAREN reduce using rule 8 (expression -> NUMBER .)
state 10
(7) commande -> WHILE LPAREN expression . RPAREN LACO commande RACO
(10) expression -> expression . OPBIN expression
RPAREN shift and go to state 13
OPBIN shift and go to state 12
state 11
(6) commande -> commande END commande .
(6) commande -> commande . END commande
! shift/reduce conflict for END resolved as shift
RACO reduce using rule 6 (commande -> commande END commande .)
$end reduce using rule 6 (commande -> commande END commande .)
END shift and go to state 6
! END [ reduce using rule 6 (commande -> commande END commande .) ]
state 12
(10) expression -> expression OPBIN . expression
(8) expression -> . NUMBER
(9) expression -> . ID
(10) expression -> . expression OPBIN expression
NUMBER shift and go to state 9
ID shift and go to state 7
expression shift and go to state 14
state 13
(7) commande -> WHILE LPAREN expression RPAREN . LACO commande RACO
LACO shift and go to state 15
state 14
(10) expression -> expression OPBIN expression .
(10) expression -> expression . OPBIN expression
! shift/reduce conflict for OPBIN resolved as shift
END reduce using rule 10 (expression -> expression OPBIN expression .)
$end reduce using rule 10 (expression -> expression OPBIN expression .)
RACO reduce using rule 10 (expression -> expression OPBIN expression .)
RPAREN reduce using rule 10 (expression -> expression OPBIN expression .)
OPBIN shift and go to state 12
! OPBIN [ reduce using rule 10 (expression -> expression OPBIN expression .) ]
state 15
(7) commande -> WHILE LPAREN expression RPAREN LACO . commande RACO
(5) commande -> . ID AFFECT expression
(6) commande -> . commande END commande
(7) commande -> . WHILE LPAREN expression RPAREN LACO commande RACO
ID shift and go to state 1
WHILE shift and go to state 2
commande shift and go to state 16
state 16
(7) commande -> WHILE LPAREN expression RPAREN LACO commande . RACO
(6) commande -> commande . END commande
RACO shift and go to state 17
END shift and go to state 6
state 17
(7) commande -> WHILE LPAREN expression RPAREN LACO commande RACO .
RACO reduce using rule 7 (commande -> WHILE LPAREN expression RPAREN LACO commande RACO .)
END reduce using rule 7 (commande -> WHILE LPAREN expression RPAREN LACO commande RACO .)
$end reduce using rule 7 (commande -> WHILE LPAREN expression RPAREN LACO commande RACO .)
WARNING:
WARNING: Conflicts:
WARNING:
WARNING: shift/reduce conflict for END in state 11 resolved as shift
WARNING: shift/reduce conflict for OPBIN in state 14 resolved as shift