-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathparser.out
More file actions
208 lines (149 loc) · 5.79 KB
/
parser.out
File metadata and controls
208 lines (149 loc) · 5.79 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
Created by PLY version 3.11 (http://www.dabeaz.com/ply)
Unused terminals:
LPAREN
RPAREN
Grammar
Rule 0 S' -> Program
Rule 1 Program -> Term
Rule 2 Term -> ( Term )
Rule 3 Term -> VARIABLE
Rule 4 Term -> Term Term
Rule 5 Term -> BACKSLASH VARIABLE . Term
Terminals, with rules where they appear
( : 2
) : 2
. : 5
BACKSLASH : 5
LPAREN :
RPAREN :
VARIABLE : 3 5
error :
Nonterminals, with rules where they appear
Program : 0
Term : 1 2 4 4 5
Parsing method: LALR
state 0
(0) S' -> . Program
(1) Program -> . Term
(2) Term -> . ( Term )
(3) Term -> . VARIABLE
(4) Term -> . Term Term
(5) Term -> . BACKSLASH VARIABLE . Term
( shift and go to state 3
VARIABLE shift and go to state 4
BACKSLASH shift and go to state 5
Program shift and go to state 1
Term shift and go to state 2
state 1
(0) S' -> Program .
state 2
(1) Program -> Term .
(4) Term -> Term . Term
(2) Term -> . ( Term )
(3) Term -> . VARIABLE
(4) Term -> . Term Term
(5) Term -> . BACKSLASH VARIABLE . Term
$end reduce using rule 1 (Program -> Term .)
( shift and go to state 3
VARIABLE shift and go to state 4
BACKSLASH shift and go to state 5
Term shift and go to state 6
state 3
(2) Term -> ( . Term )
(2) Term -> . ( Term )
(3) Term -> . VARIABLE
(4) Term -> . Term Term
(5) Term -> . BACKSLASH VARIABLE . Term
( shift and go to state 3
VARIABLE shift and go to state 4
BACKSLASH shift and go to state 5
Term shift and go to state 7
state 4
(3) Term -> VARIABLE .
( reduce using rule 3 (Term -> VARIABLE .)
VARIABLE reduce using rule 3 (Term -> VARIABLE .)
BACKSLASH reduce using rule 3 (Term -> VARIABLE .)
$end reduce using rule 3 (Term -> VARIABLE .)
) reduce using rule 3 (Term -> VARIABLE .)
state 5
(5) Term -> BACKSLASH . VARIABLE . Term
VARIABLE shift and go to state 8
state 6
(4) Term -> Term Term .
(4) Term -> Term . Term
(2) Term -> . ( Term )
(3) Term -> . VARIABLE
(4) Term -> . Term Term
(5) Term -> . BACKSLASH VARIABLE . Term
! shift/reduce conflict for ( resolved as shift
! shift/reduce conflict for VARIABLE resolved as shift
! shift/reduce conflict for BACKSLASH resolved as shift
$end reduce using rule 4 (Term -> Term Term .)
) reduce using rule 4 (Term -> Term Term .)
( shift and go to state 3
VARIABLE shift and go to state 4
BACKSLASH shift and go to state 5
! ( [ reduce using rule 4 (Term -> Term Term .) ]
! VARIABLE [ reduce using rule 4 (Term -> Term Term .) ]
! BACKSLASH [ reduce using rule 4 (Term -> Term Term .) ]
Term shift and go to state 6
state 7
(2) Term -> ( Term . )
(4) Term -> Term . Term
(2) Term -> . ( Term )
(3) Term -> . VARIABLE
(4) Term -> . Term Term
(5) Term -> . BACKSLASH VARIABLE . Term
) shift and go to state 9
( shift and go to state 3
VARIABLE shift and go to state 4
BACKSLASH shift and go to state 5
Term shift and go to state 6
state 8
(5) Term -> BACKSLASH VARIABLE . . Term
. shift and go to state 10
state 9
(2) Term -> ( Term ) .
( reduce using rule 2 (Term -> ( Term ) .)
VARIABLE reduce using rule 2 (Term -> ( Term ) .)
BACKSLASH reduce using rule 2 (Term -> ( Term ) .)
$end reduce using rule 2 (Term -> ( Term ) .)
) reduce using rule 2 (Term -> ( Term ) .)
state 10
(5) Term -> BACKSLASH VARIABLE . . Term
(2) Term -> . ( Term )
(3) Term -> . VARIABLE
(4) Term -> . Term Term
(5) Term -> . BACKSLASH VARIABLE . Term
( shift and go to state 3
VARIABLE shift and go to state 4
BACKSLASH shift and go to state 5
Term shift and go to state 11
state 11
(5) Term -> BACKSLASH VARIABLE . Term .
(4) Term -> Term . Term
(2) Term -> . ( Term )
(3) Term -> . VARIABLE
(4) Term -> . Term Term
(5) Term -> . BACKSLASH VARIABLE . Term
! shift/reduce conflict for ( resolved as shift
! shift/reduce conflict for VARIABLE resolved as shift
! shift/reduce conflict for BACKSLASH resolved as shift
$end reduce using rule 5 (Term -> BACKSLASH VARIABLE . Term .)
) reduce using rule 5 (Term -> BACKSLASH VARIABLE . Term .)
( shift and go to state 3
VARIABLE shift and go to state 4
BACKSLASH shift and go to state 5
! ( [ reduce using rule 5 (Term -> BACKSLASH VARIABLE . Term .) ]
! VARIABLE [ reduce using rule 5 (Term -> BACKSLASH VARIABLE . Term .) ]
! BACKSLASH [ reduce using rule 5 (Term -> BACKSLASH VARIABLE . Term .) ]
Term shift and go to state 6
WARNING:
WARNING: Conflicts:
WARNING:
WARNING: shift/reduce conflict for ( in state 6 resolved as shift
WARNING: shift/reduce conflict for VARIABLE in state 6 resolved as shift
WARNING: shift/reduce conflict for BACKSLASH in state 6 resolved as shift
WARNING: shift/reduce conflict for ( in state 11 resolved as shift
WARNING: shift/reduce conflict for VARIABLE in state 11 resolved as shift
WARNING: shift/reduce conflict for BACKSLASH in state 11 resolved as shift