antelope 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/antelope.gemspec +0 -2
- data/bin/antelope +3 -20
- data/examples/deterministic.output +97 -103
- data/examples/example.ace +0 -1
- data/examples/example.output +259 -333
- data/examples/simple.output +85 -87
- data/lib/antelope/ace/compiler.rb +14 -16
- data/lib/antelope/ace/errors.rb +9 -3
- data/lib/antelope/ace/grammar/generation.rb +38 -7
- data/lib/antelope/ace/grammar/precedences.rb +59 -0
- data/lib/antelope/ace/grammar/production.rb +24 -25
- data/lib/antelope/ace/grammar/productions.rb +8 -8
- data/lib/antelope/ace/grammar.rb +3 -3
- data/lib/antelope/ace/{presidence.rb → precedence.rb} +11 -11
- data/lib/antelope/ace/scanner/second.rb +2 -2
- data/lib/antelope/ace/token.rb +1 -1
- data/lib/antelope/ace.rb +2 -2
- data/lib/antelope/cli.rb +33 -0
- data/lib/antelope/errors.rb +6 -0
- data/lib/antelope/generation/constructor/first.rb +40 -6
- data/lib/antelope/generation/constructor/follow.rb +83 -25
- data/lib/antelope/generation/constructor/nullable.rb +24 -2
- data/lib/antelope/generation/constructor.rb +39 -13
- data/lib/antelope/generation/errors.rb +15 -0
- data/lib/antelope/generation/recognizer/rule.rb +111 -11
- data/lib/antelope/generation/recognizer/state.rb +53 -5
- data/lib/antelope/generation/recognizer.rb +31 -1
- data/lib/antelope/generation/tableizer.rb +42 -10
- data/lib/antelope/generation.rb +1 -1
- data/lib/antelope/generator/templates/output.erb +19 -18
- data/lib/antelope/version.rb +1 -1
- data/lib/antelope.rb +3 -2
- metadata +7 -36
- data/lib/antelope/ace/grammar/presidence.rb +0 -59
- data/lib/antelope/automaton.rb +0 -36
- data/lib/antelope/generation/conflictor/conflict.rb +0 -7
- data/lib/antelope/generation/conflictor.rb +0 -45
- data/lib/antelope/generation/constructor/lookahead.rb +0 -42
data/examples/example.output
CHANGED
@@ -1,70 +1,68 @@
|
|
1
1
|
Productions:
|
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
|
-
expression →
|
33
|
-
|
34
|
-
expression →
|
35
|
-
|
36
|
-
expression → expression "-" expression
|
37
|
-
|
38
|
-
expression → expression "
|
39
|
-
|
40
|
-
expression →
|
41
|
-
|
42
|
-
expression →
|
43
|
-
|
44
|
-
expression →
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
Presidence:
|
2
|
+
expression → NUMBER { |a| a[1] }
|
3
|
+
expression → expression "+" expression { |a, _, b| a + b }
|
4
|
+
expression → expression "-" expression { |a, _, b| a - b }
|
5
|
+
expression → expression "*" expression { |a, _, b| a * b }
|
6
|
+
expression → expression "/" expression { |a, _, b| a / b }
|
7
|
+
expression → "(" expression ")" { |_, a, _| a }
|
8
|
+
expression → "(" $error ")"
|
9
|
+
$start → expression $
|
10
|
+
|
11
|
+
Productions, Again:
|
12
|
+
0/n0: $start(0) → expression(0:1) $
|
13
|
+
1/n1: expression(0:1) → NUMBER
|
14
|
+
2/l2: expression(0:1) → expression(0:1) "+" expression(10:16)
|
15
|
+
3/l2: expression(0:1) → expression(0:1) "-" expression(11:17)
|
16
|
+
4/l3: expression(0:1) → expression(0:1) "*" expression(12:18)
|
17
|
+
5/l3: expression(0:1) → expression(0:1) "/" expression(13:19)
|
18
|
+
6/n4: expression(0:1) → "(" expression(7:14) ")"
|
19
|
+
7/n4: expression(0:1) → "(" $error ")"
|
20
|
+
19/n1: expression(7:14) → NUMBER
|
21
|
+
20/l2: expression(7:14) → expression(7:14) "+" expression(10:16)
|
22
|
+
21/l2: expression(7:14) → expression(7:14) "-" expression(11:17)
|
23
|
+
22/l3: expression(7:14) → expression(7:14) "*" expression(12:18)
|
24
|
+
23/l3: expression(7:14) → expression(7:14) "/" expression(13:19)
|
25
|
+
24/n4: expression(7:14) → "(" expression(7:14) ")"
|
26
|
+
25/n4: expression(7:14) → "(" $error ")"
|
27
|
+
30/n1: expression(10:16) → NUMBER
|
28
|
+
31/l2: expression(10:16) → expression(10:16) "+" expression(10:16)
|
29
|
+
32/l2: expression(10:16) → expression(10:16) "-" expression(11:17)
|
30
|
+
33/l3: expression(10:16) → expression(10:16) "*" expression(12:18)
|
31
|
+
34/l3: expression(10:16) → expression(10:16) "/" expression(13:19)
|
32
|
+
35/n4: expression(10:16) → "(" expression(7:14) ")"
|
33
|
+
36/n4: expression(10:16) → "(" $error ")"
|
34
|
+
38/n1: expression(11:17) → NUMBER
|
35
|
+
39/l2: expression(11:17) → expression(11:17) "+" expression(10:16)
|
36
|
+
40/l2: expression(11:17) → expression(11:17) "-" expression(11:17)
|
37
|
+
41/l3: expression(11:17) → expression(11:17) "*" expression(12:18)
|
38
|
+
42/l3: expression(11:17) → expression(11:17) "/" expression(13:19)
|
39
|
+
43/n4: expression(11:17) → "(" expression(7:14) ")"
|
40
|
+
44/n4: expression(11:17) → "(" $error ")"
|
41
|
+
46/n1: expression(12:18) → NUMBER
|
42
|
+
47/l2: expression(12:18) → expression(12:18) "+" expression(10:16)
|
43
|
+
48/l2: expression(12:18) → expression(12:18) "-" expression(11:17)
|
44
|
+
49/l3: expression(12:18) → expression(12:18) "*" expression(12:18)
|
45
|
+
50/l3: expression(12:18) → expression(12:18) "/" expression(13:19)
|
46
|
+
51/n4: expression(12:18) → "(" expression(7:14) ")"
|
47
|
+
52/n4: expression(12:18) → "(" $error ")"
|
48
|
+
54/n1: expression(13:19) → NUMBER
|
49
|
+
55/l2: expression(13:19) → expression(13:19) "+" expression(10:16)
|
50
|
+
56/l2: expression(13:19) → expression(13:19) "-" expression(11:17)
|
51
|
+
57/l3: expression(13:19) → expression(13:19) "*" expression(12:18)
|
52
|
+
58/l3: expression(13:19) → expression(13:19) "/" expression(13:19)
|
53
|
+
59/n4: expression(13:19) → "(" expression(7:14) ")"
|
54
|
+
60/n4: expression(13:19) → "(" $error ")"
|
55
|
+
|
56
|
+
FOLLOW:
|
57
|
+
$start(0): {}
|
58
|
+
expression(0:1): {$, "+", "-", "*", "/"}
|
59
|
+
expression(7:14): {")", "+", "-", "*", "/"}
|
60
|
+
expression(10:16): {$, "+", "-", "*", "/", ")"}
|
61
|
+
expression(11:17): {$, "+", "-", "*", "/", ")"}
|
62
|
+
expression(12:18): {$, "+", "-", "*", "/", ")"}
|
63
|
+
expression(13:19): {$, "+", "-", "*", "/", ")"}
|
64
|
+
|
65
|
+
Precedence:
|
68
66
|
--- highest
|
69
67
|
nonassoc 4:
|
70
68
|
{LPAREN, RPAREN}
|
@@ -79,198 +77,126 @@ Presidence:
|
|
79
77
|
--- lowest
|
80
78
|
|
81
79
|
Table:
|
82
|
-
|
83
|
-
1
|
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
|
-
#<Antelope::Generation::Recognizer::Rule id=22 left=expression(13:19) right=[expression(7:14) "*" expression(12:18)] position=0>,
|
185
|
-
#<Antelope::Generation::Recognizer::Rule id=23 left=expression(13:19) right=[expression(7:14) "/" expression(13:19)] position=0>,
|
186
|
-
#<Antelope::Generation::Recognizer::Rule id=24 left=expression(13:19) right=["(" expression(7:14) ")"] position=0>,
|
187
|
-
#<Antelope::Generation::Recognizer::Rule id=25 left=expression(13:19) right=["(" $error ")"] position=0>,
|
188
|
-
nil,
|
189
|
-
#<Antelope::Generation::Recognizer::Rule id=27 left=expression(13:19) right=["(" $error ")"] position=1>,
|
190
|
-
#<Antelope::Generation::Recognizer::Rule id=28 left=$start(0) right=[expression $] position=2>,
|
191
|
-
#<Antelope::Generation::Recognizer::Rule id=29 left=expression(13:19) right=[expression "+" expression] position=2>,
|
192
|
-
#<Antelope::Generation::Recognizer::Rule id=30 left=expression(13:19) right=[NUMBER] position=0>,
|
193
|
-
#<Antelope::Generation::Recognizer::Rule id=31 left=expression(13:19) right=[expression(10:16) "+" expression(10:16)] position=0>,
|
194
|
-
#<Antelope::Generation::Recognizer::Rule id=32 left=expression(13:19) right=[expression(10:16) "-" expression(11:17)] position=0>,
|
195
|
-
#<Antelope::Generation::Recognizer::Rule id=33 left=expression(13:19) right=[expression(10:16) "*" expression(12:18)] position=0>,
|
196
|
-
#<Antelope::Generation::Recognizer::Rule id=34 left=expression(13:19) right=[expression(10:16) "/" expression(13:19)] position=0>,
|
197
|
-
#<Antelope::Generation::Recognizer::Rule id=35 left=expression(13:19) right=["(" expression(7:14) ")"] position=0>,
|
198
|
-
#<Antelope::Generation::Recognizer::Rule id=36 left=expression(13:19) right=["(" $error ")"] position=0>,
|
199
|
-
#<Antelope::Generation::Recognizer::Rule id=37 left=expression(13:19) right=[expression "-" expression] position=2>,
|
200
|
-
#<Antelope::Generation::Recognizer::Rule id=38 left=expression(13:19) right=[NUMBER] position=0>,
|
201
|
-
#<Antelope::Generation::Recognizer::Rule id=39 left=expression(13:19) right=[expression(11:17) "+" expression(10:16)] position=0>,
|
202
|
-
#<Antelope::Generation::Recognizer::Rule id=40 left=expression(13:19) right=[expression(11:17) "-" expression(11:17)] position=0>,
|
203
|
-
#<Antelope::Generation::Recognizer::Rule id=41 left=expression(13:19) right=[expression(11:17) "*" expression(12:18)] position=0>,
|
204
|
-
#<Antelope::Generation::Recognizer::Rule id=42 left=expression(13:19) right=[expression(11:17) "/" expression(13:19)] position=0>,
|
205
|
-
#<Antelope::Generation::Recognizer::Rule id=43 left=expression(13:19) right=["(" expression(7:14) ")"] position=0>,
|
206
|
-
#<Antelope::Generation::Recognizer::Rule id=44 left=expression(13:19) right=["(" $error ")"] position=0>,
|
207
|
-
#<Antelope::Generation::Recognizer::Rule id=45 left=expression(13:19) right=[expression "*" expression] position=2>,
|
208
|
-
#<Antelope::Generation::Recognizer::Rule id=46 left=expression(13:19) right=[NUMBER] position=0>,
|
209
|
-
#<Antelope::Generation::Recognizer::Rule id=47 left=expression(13:19) right=[expression(12:18) "+" expression(10:16)] position=0>,
|
210
|
-
#<Antelope::Generation::Recognizer::Rule id=48 left=expression(13:19) right=[expression(12:18) "-" expression(11:17)] position=0>,
|
211
|
-
#<Antelope::Generation::Recognizer::Rule id=49 left=expression(13:19) right=[expression(12:18) "*" expression(12:18)] position=0>,
|
212
|
-
#<Antelope::Generation::Recognizer::Rule id=50 left=expression(13:19) right=[expression(12:18) "/" expression(13:19)] position=0>,
|
213
|
-
#<Antelope::Generation::Recognizer::Rule id=51 left=expression(13:19) right=["(" expression(7:14) ")"] position=0>,
|
214
|
-
#<Antelope::Generation::Recognizer::Rule id=52 left=expression(13:19) right=["(" $error ")"] position=0>,
|
215
|
-
#<Antelope::Generation::Recognizer::Rule id=53 left=expression(13:19) right=[expression "/" expression] position=2>,
|
216
|
-
#<Antelope::Generation::Recognizer::Rule id=54 left=expression(13:19) right=[NUMBER] position=0>,
|
217
|
-
#<Antelope::Generation::Recognizer::Rule id=55 left=expression(13:19) right=[expression(13:19) "+" expression(10:16)] position=0>,
|
218
|
-
#<Antelope::Generation::Recognizer::Rule id=56 left=expression(13:19) right=[expression(13:19) "-" expression(11:17)] position=0>,
|
219
|
-
#<Antelope::Generation::Recognizer::Rule id=57 left=expression(13:19) right=[expression(13:19) "*" expression(12:18)] position=0>,
|
220
|
-
#<Antelope::Generation::Recognizer::Rule id=58 left=expression(13:19) right=[expression(13:19) "/" expression(13:19)] position=0>,
|
221
|
-
#<Antelope::Generation::Recognizer::Rule id=59 left=expression(13:19) right=["(" expression(7:14) ")"] position=0>,
|
222
|
-
#<Antelope::Generation::Recognizer::Rule id=60 left=expression(13:19) right=["(" $error ")"] position=0>,
|
223
|
-
#<Antelope::Generation::Recognizer::Rule id=61 left=expression(13:19) right=["(" expression ")"] position=2>,
|
224
|
-
nil,
|
225
|
-
nil,
|
226
|
-
nil,
|
227
|
-
nil,
|
228
|
-
nil,
|
229
|
-
#<Antelope::Generation::Recognizer::Rule id=67 left=expression(13:19) right=["(" $error ")"] position=2>,
|
230
|
-
#<Antelope::Generation::Recognizer::Rule id=68 left=expression(13:19) right=[expression "+" expression] position=3>,
|
231
|
-
nil,
|
232
|
-
nil,
|
233
|
-
nil,
|
234
|
-
nil,
|
235
|
-
nil,
|
236
|
-
#<Antelope::Generation::Recognizer::Rule id=74 left=expression(13:19) right=[expression "-" expression] position=3>,
|
237
|
-
nil,
|
238
|
-
nil,
|
239
|
-
nil,
|
240
|
-
nil,
|
241
|
-
nil,
|
242
|
-
#<Antelope::Generation::Recognizer::Rule id=80 left=expression(13:19) right=[expression "*" expression] position=3>,
|
243
|
-
nil,
|
244
|
-
nil,
|
245
|
-
nil,
|
246
|
-
nil,
|
247
|
-
nil,
|
248
|
-
#<Antelope::Generation::Recognizer::Rule id=86 left=expression(13:19) right=[expression "/" expression] position=3>,
|
249
|
-
#<Antelope::Generation::Recognizer::Rule id=87 left=$start(0) right=[expression $] position=1>,
|
250
|
-
#<Antelope::Generation::Recognizer::Rule id=88 left=expression(13:19) right=[expression "+" expression] position=1>,
|
251
|
-
#<Antelope::Generation::Recognizer::Rule id=89 left=expression(13:19) right=[expression "-" expression] position=1>,
|
252
|
-
#<Antelope::Generation::Recognizer::Rule id=90 left=expression(13:19) right=[expression "*" expression] position=1>,
|
253
|
-
#<Antelope::Generation::Recognizer::Rule id=91 left=expression(13:19) right=[expression "/" expression] position=1>,
|
254
|
-
#<Antelope::Generation::Recognizer::Rule id=92 left=expression(13:19) right=["(" expression ")"] position=3>,
|
255
|
-
#<Antelope::Generation::Recognizer::Rule id=93 left=expression(13:19) right=["(" $error ")"] position=3>]
|
80
|
+
State 0:
|
81
|
+
expression: state (1)
|
82
|
+
NUMBER : state (2)
|
83
|
+
LPAREN : state (7)
|
84
|
+
State 1:
|
85
|
+
$ : state (9)
|
86
|
+
ADD : state (10)
|
87
|
+
SUBTRACT : state (11)
|
88
|
+
MULTIPLY : state (12)
|
89
|
+
DIVIDE : state (13)
|
90
|
+
State 2:
|
91
|
+
$ : reduce (1)
|
92
|
+
ADD : reduce (1)
|
93
|
+
SUBTRACT : reduce (1)
|
94
|
+
MULTIPLY : reduce (1)
|
95
|
+
DIVIDE : reduce (1)
|
96
|
+
RPAREN : reduce (1)
|
97
|
+
State 3:
|
98
|
+
ADD : state (10)
|
99
|
+
State 4:
|
100
|
+
SUBTRACT : state (11)
|
101
|
+
State 5:
|
102
|
+
MULTIPLY : state (12)
|
103
|
+
State 6:
|
104
|
+
DIVIDE : state (13)
|
105
|
+
State 7:
|
106
|
+
expression: state (14)
|
107
|
+
NUMBER : state (2)
|
108
|
+
LPAREN : state (7)
|
109
|
+
$error : state (15)
|
110
|
+
State 8:
|
111
|
+
$error : state (15)
|
112
|
+
State 9:
|
113
|
+
$ : accept (0)
|
114
|
+
State 10:
|
115
|
+
expression: state (16)
|
116
|
+
NUMBER : state (2)
|
117
|
+
LPAREN : state (7)
|
118
|
+
State 11:
|
119
|
+
expression: state (17)
|
120
|
+
NUMBER : state (2)
|
121
|
+
LPAREN : state (7)
|
122
|
+
State 12:
|
123
|
+
expression: state (18)
|
124
|
+
NUMBER : state (2)
|
125
|
+
LPAREN : state (7)
|
126
|
+
State 13:
|
127
|
+
expression: state (19)
|
128
|
+
NUMBER : state (2)
|
129
|
+
LPAREN : state (7)
|
130
|
+
State 14:
|
131
|
+
$ : state (9)
|
132
|
+
ADD : state (10)
|
133
|
+
SUBTRACT : state (11)
|
134
|
+
MULTIPLY : state (12)
|
135
|
+
DIVIDE : state (13)
|
136
|
+
RPAREN : state (20)
|
137
|
+
State 15:
|
138
|
+
RPAREN : state (21)
|
139
|
+
State 16:
|
140
|
+
$ : reduce (2)
|
141
|
+
ADD : reduce (2)
|
142
|
+
SUBTRACT : reduce (2)
|
143
|
+
MULTIPLY : state (12)
|
144
|
+
DIVIDE : state (13)
|
145
|
+
RPAREN : reduce (2)
|
146
|
+
State 17:
|
147
|
+
$ : reduce (3)
|
148
|
+
ADD : reduce (3)
|
149
|
+
SUBTRACT : reduce (3)
|
150
|
+
MULTIPLY : state (12)
|
151
|
+
DIVIDE : state (13)
|
152
|
+
RPAREN : reduce (3)
|
153
|
+
State 18:
|
154
|
+
$ : reduce (4)
|
155
|
+
ADD : reduce (4)
|
156
|
+
SUBTRACT : reduce (4)
|
157
|
+
MULTIPLY : reduce (4)
|
158
|
+
DIVIDE : reduce (4)
|
159
|
+
RPAREN : reduce (4)
|
160
|
+
State 19:
|
161
|
+
$ : reduce (5)
|
162
|
+
ADD : reduce (5)
|
163
|
+
SUBTRACT : reduce (5)
|
164
|
+
MULTIPLY : reduce (5)
|
165
|
+
DIVIDE : reduce (5)
|
166
|
+
RPAREN : reduce (5)
|
167
|
+
State 20:
|
168
|
+
$ : reduce (6)
|
169
|
+
ADD : reduce (6)
|
170
|
+
SUBTRACT : reduce (6)
|
171
|
+
MULTIPLY : reduce (6)
|
172
|
+
DIVIDE : reduce (6)
|
173
|
+
RPAREN : reduce (6)
|
174
|
+
State 21:
|
175
|
+
$ : reduce (7)
|
176
|
+
ADD : reduce (7)
|
177
|
+
SUBTRACT : reduce (7)
|
178
|
+
MULTIPLY : reduce (7)
|
179
|
+
DIVIDE : reduce (7)
|
180
|
+
RPAREN : reduce (7)
|
181
|
+
|
256
182
|
|
257
183
|
State 0:
|
258
184
|
rules:
|
259
185
|
0/n0: $start(0) → • expression(0:1) $
|
260
186
|
{}
|
261
|
-
1/n1: expression(
|
187
|
+
1/n1: expression(0:1) → • NUMBER
|
262
188
|
{}
|
263
|
-
2/l2: expression(
|
189
|
+
2/l2: expression(0:1) → • expression(0:1) "+" expression(10:16)
|
264
190
|
{}
|
265
|
-
3/l2: expression(
|
191
|
+
3/l2: expression(0:1) → • expression(0:1) "-" expression(11:17)
|
266
192
|
{}
|
267
|
-
4/l3: expression(
|
193
|
+
4/l3: expression(0:1) → • expression(0:1) "*" expression(12:18)
|
268
194
|
{}
|
269
|
-
5/l3: expression(
|
195
|
+
5/l3: expression(0:1) → • expression(0:1) "/" expression(13:19)
|
270
196
|
{}
|
271
|
-
6/n4: expression(
|
197
|
+
6/n4: expression(0:1) → • "(" expression(7:14) ")"
|
272
198
|
{}
|
273
|
-
7/n4: expression(
|
199
|
+
7/n4: expression(0:1) → • "(" $error ")"
|
274
200
|
{}
|
275
201
|
|
276
202
|
transitions:
|
@@ -280,15 +206,15 @@ State 0:
|
|
280
206
|
|
281
207
|
State 1:
|
282
208
|
rules:
|
283
|
-
87/n0: $start
|
209
|
+
87/n0: $start → expression • $
|
284
210
|
{}
|
285
|
-
88/l2: expression
|
211
|
+
88/l2: expression → expression • "+" expression
|
286
212
|
{}
|
287
|
-
89/l2: expression
|
213
|
+
89/l2: expression → expression • "-" expression
|
288
214
|
{}
|
289
|
-
90/l3: expression
|
215
|
+
90/l3: expression → expression • "*" expression
|
290
216
|
{}
|
291
|
-
91/l3: expression
|
217
|
+
91/l3: expression → expression • "/" expression
|
292
218
|
{}
|
293
219
|
|
294
220
|
transitions:
|
@@ -300,14 +226,14 @@ State 1:
|
|
300
226
|
|
301
227
|
State 2:
|
302
228
|
rules:
|
303
|
-
13/n1: expression
|
304
|
-
{"+", "-", "*", "/", ")"
|
229
|
+
13/n1: expression → NUMBER •
|
230
|
+
{$, "+", "-", "*", "/", ")"}
|
305
231
|
|
306
232
|
transitions:
|
307
233
|
|
308
234
|
State 3:
|
309
235
|
rules:
|
310
|
-
88/l2: expression
|
236
|
+
88/l2: expression → expression • "+" expression
|
311
237
|
{}
|
312
238
|
|
313
239
|
transitions:
|
@@ -315,7 +241,7 @@ State 3:
|
|
315
241
|
|
316
242
|
State 4:
|
317
243
|
rules:
|
318
|
-
89/l2: expression
|
244
|
+
89/l2: expression → expression • "-" expression
|
319
245
|
{}
|
320
246
|
|
321
247
|
transitions:
|
@@ -323,7 +249,7 @@ State 4:
|
|
323
249
|
|
324
250
|
State 5:
|
325
251
|
rules:
|
326
|
-
90/l3: expression
|
252
|
+
90/l3: expression → expression • "*" expression
|
327
253
|
{}
|
328
254
|
|
329
255
|
transitions:
|
@@ -331,7 +257,7 @@ State 5:
|
|
331
257
|
|
332
258
|
State 6:
|
333
259
|
rules:
|
334
|
-
91/l3: expression
|
260
|
+
91/l3: expression → expression • "/" expression
|
335
261
|
{}
|
336
262
|
|
337
263
|
transitions:
|
@@ -339,23 +265,23 @@ State 6:
|
|
339
265
|
|
340
266
|
State 7:
|
341
267
|
rules:
|
342
|
-
18/n4: expression
|
268
|
+
18/n4: expression → "(" • expression ")"
|
343
269
|
{}
|
344
|
-
19/n1: expression(
|
270
|
+
19/n1: expression(7:14) → • NUMBER
|
345
271
|
{}
|
346
|
-
20/l2: expression(
|
272
|
+
20/l2: expression(7:14) → • expression(7:14) "+" expression(10:16)
|
347
273
|
{}
|
348
|
-
21/l2: expression(
|
274
|
+
21/l2: expression(7:14) → • expression(7:14) "-" expression(11:17)
|
349
275
|
{}
|
350
|
-
22/l3: expression(
|
276
|
+
22/l3: expression(7:14) → • expression(7:14) "*" expression(12:18)
|
351
277
|
{}
|
352
|
-
23/l3: expression(
|
278
|
+
23/l3: expression(7:14) → • expression(7:14) "/" expression(13:19)
|
353
279
|
{}
|
354
|
-
24/n4: expression(
|
280
|
+
24/n4: expression(7:14) → • "(" expression(7:14) ")"
|
355
281
|
{}
|
356
|
-
25/n4: expression(
|
282
|
+
25/n4: expression(7:14) → • "(" $error ")"
|
357
283
|
{}
|
358
|
-
27/n4: expression
|
284
|
+
27/n4: expression → "(" • $error ")"
|
359
285
|
{}
|
360
286
|
|
361
287
|
transitions:
|
@@ -366,7 +292,7 @@ State 7:
|
|
366
292
|
|
367
293
|
State 8:
|
368
294
|
rules:
|
369
|
-
27/n4: expression
|
295
|
+
27/n4: expression → "(" • $error ")"
|
370
296
|
{}
|
371
297
|
|
372
298
|
transitions:
|
@@ -374,28 +300,28 @@ State 8:
|
|
374
300
|
|
375
301
|
State 9:
|
376
302
|
rules:
|
377
|
-
28/n0: $start
|
303
|
+
28/n0: $start → expression $ •
|
378
304
|
{}
|
379
305
|
|
380
306
|
transitions:
|
381
307
|
|
382
308
|
State 10:
|
383
309
|
rules:
|
384
|
-
29/l2: expression
|
310
|
+
29/l2: expression → expression "+" • expression
|
385
311
|
{}
|
386
|
-
30/n1: expression(
|
312
|
+
30/n1: expression(10:16) → • NUMBER
|
387
313
|
{}
|
388
|
-
31/l2: expression(
|
314
|
+
31/l2: expression(10:16) → • expression(10:16) "+" expression(10:16)
|
389
315
|
{}
|
390
|
-
32/l2: expression(
|
316
|
+
32/l2: expression(10:16) → • expression(10:16) "-" expression(11:17)
|
391
317
|
{}
|
392
|
-
33/l3: expression(
|
318
|
+
33/l3: expression(10:16) → • expression(10:16) "*" expression(12:18)
|
393
319
|
{}
|
394
|
-
34/l3: expression(
|
320
|
+
34/l3: expression(10:16) → • expression(10:16) "/" expression(13:19)
|
395
321
|
{}
|
396
|
-
35/n4: expression(
|
322
|
+
35/n4: expression(10:16) → • "(" expression(7:14) ")"
|
397
323
|
{}
|
398
|
-
36/n4: expression(
|
324
|
+
36/n4: expression(10:16) → • "(" $error ")"
|
399
325
|
{}
|
400
326
|
|
401
327
|
transitions:
|
@@ -405,21 +331,21 @@ State 10:
|
|
405
331
|
|
406
332
|
State 11:
|
407
333
|
rules:
|
408
|
-
37/l2: expression
|
334
|
+
37/l2: expression → expression "-" • expression
|
409
335
|
{}
|
410
|
-
38/n1: expression(
|
336
|
+
38/n1: expression(11:17) → • NUMBER
|
411
337
|
{}
|
412
|
-
39/l2: expression(
|
338
|
+
39/l2: expression(11:17) → • expression(11:17) "+" expression(10:16)
|
413
339
|
{}
|
414
|
-
40/l2: expression(
|
340
|
+
40/l2: expression(11:17) → • expression(11:17) "-" expression(11:17)
|
415
341
|
{}
|
416
|
-
41/l3: expression(
|
342
|
+
41/l3: expression(11:17) → • expression(11:17) "*" expression(12:18)
|
417
343
|
{}
|
418
|
-
42/l3: expression(
|
344
|
+
42/l3: expression(11:17) → • expression(11:17) "/" expression(13:19)
|
419
345
|
{}
|
420
|
-
43/n4: expression(
|
346
|
+
43/n4: expression(11:17) → • "(" expression(7:14) ")"
|
421
347
|
{}
|
422
|
-
44/n4: expression(
|
348
|
+
44/n4: expression(11:17) → • "(" $error ")"
|
423
349
|
{}
|
424
350
|
|
425
351
|
transitions:
|
@@ -429,21 +355,21 @@ State 11:
|
|
429
355
|
|
430
356
|
State 12:
|
431
357
|
rules:
|
432
|
-
45/l3: expression
|
358
|
+
45/l3: expression → expression "*" • expression
|
433
359
|
{}
|
434
|
-
46/n1: expression(
|
360
|
+
46/n1: expression(12:18) → • NUMBER
|
435
361
|
{}
|
436
|
-
47/l2: expression(
|
362
|
+
47/l2: expression(12:18) → • expression(12:18) "+" expression(10:16)
|
437
363
|
{}
|
438
|
-
48/l2: expression(
|
364
|
+
48/l2: expression(12:18) → • expression(12:18) "-" expression(11:17)
|
439
365
|
{}
|
440
|
-
49/l3: expression(
|
366
|
+
49/l3: expression(12:18) → • expression(12:18) "*" expression(12:18)
|
441
367
|
{}
|
442
|
-
50/l3: expression(
|
368
|
+
50/l3: expression(12:18) → • expression(12:18) "/" expression(13:19)
|
443
369
|
{}
|
444
|
-
51/n4: expression(
|
370
|
+
51/n4: expression(12:18) → • "(" expression(7:14) ")"
|
445
371
|
{}
|
446
|
-
52/n4: expression(
|
372
|
+
52/n4: expression(12:18) → • "(" $error ")"
|
447
373
|
{}
|
448
374
|
|
449
375
|
transitions:
|
@@ -453,7 +379,7 @@ State 12:
|
|
453
379
|
|
454
380
|
State 13:
|
455
381
|
rules:
|
456
|
-
53/l3: expression
|
382
|
+
53/l3: expression → expression "/" • expression
|
457
383
|
{}
|
458
384
|
54/n1: expression(13:19) → • NUMBER
|
459
385
|
{}
|
@@ -477,17 +403,17 @@ State 13:
|
|
477
403
|
|
478
404
|
State 14:
|
479
405
|
rules:
|
480
|
-
61/n4: expression
|
406
|
+
61/n4: expression → "(" expression • ")"
|
481
407
|
{}
|
482
|
-
87/n0: $start
|
408
|
+
87/n0: $start → expression • $
|
483
409
|
{}
|
484
|
-
88/l2: expression
|
410
|
+
88/l2: expression → expression • "+" expression
|
485
411
|
{}
|
486
|
-
89/l2: expression
|
412
|
+
89/l2: expression → expression • "-" expression
|
487
413
|
{}
|
488
|
-
90/l3: expression
|
414
|
+
90/l3: expression → expression • "*" expression
|
489
415
|
{}
|
490
|
-
91/l3: expression
|
416
|
+
91/l3: expression → expression • "/" expression
|
491
417
|
{}
|
492
418
|
|
493
419
|
transitions:
|
@@ -500,7 +426,7 @@ State 14:
|
|
500
426
|
|
501
427
|
State 15:
|
502
428
|
rules:
|
503
|
-
67/n4: expression
|
429
|
+
67/n4: expression → "(" $error • ")"
|
504
430
|
{}
|
505
431
|
|
506
432
|
transitions:
|
@@ -508,17 +434,17 @@ State 15:
|
|
508
434
|
|
509
435
|
State 16:
|
510
436
|
rules:
|
511
|
-
68/l2: expression
|
512
|
-
{"+", "-", "*", "/", ")"
|
513
|
-
87/n0: $start
|
437
|
+
68/l2: expression → expression "+" expression •
|
438
|
+
{$, "+", "-", "*", "/", ")"}
|
439
|
+
87/n0: $start → expression • $
|
514
440
|
{}
|
515
|
-
88/l2: expression
|
441
|
+
88/l2: expression → expression • "+" expression
|
516
442
|
{}
|
517
|
-
89/l2: expression
|
443
|
+
89/l2: expression → expression • "-" expression
|
518
444
|
{}
|
519
|
-
90/l3: expression
|
445
|
+
90/l3: expression → expression • "*" expression
|
520
446
|
{}
|
521
|
-
91/l3: expression
|
447
|
+
91/l3: expression → expression • "/" expression
|
522
448
|
{}
|
523
449
|
|
524
450
|
transitions:
|
@@ -530,17 +456,17 @@ State 16:
|
|
530
456
|
|
531
457
|
State 17:
|
532
458
|
rules:
|
533
|
-
74/l2: expression
|
534
|
-
{"+", "-", "*", "/", ")"
|
535
|
-
87/n0: $start
|
459
|
+
74/l2: expression → expression "-" expression •
|
460
|
+
{$, "+", "-", "*", "/", ")"}
|
461
|
+
87/n0: $start → expression • $
|
536
462
|
{}
|
537
|
-
88/l2: expression
|
463
|
+
88/l2: expression → expression • "+" expression
|
538
464
|
{}
|
539
|
-
89/l2: expression
|
465
|
+
89/l2: expression → expression • "-" expression
|
540
466
|
{}
|
541
|
-
90/l3: expression
|
467
|
+
90/l3: expression → expression • "*" expression
|
542
468
|
{}
|
543
|
-
91/l3: expression
|
469
|
+
91/l3: expression → expression • "/" expression
|
544
470
|
{}
|
545
471
|
|
546
472
|
transitions:
|
@@ -552,17 +478,17 @@ State 17:
|
|
552
478
|
|
553
479
|
State 18:
|
554
480
|
rules:
|
555
|
-
80/l3: expression
|
556
|
-
{"+", "-", "*", "/", ")"
|
557
|
-
87/n0: $start
|
481
|
+
80/l3: expression → expression "*" expression •
|
482
|
+
{$, "+", "-", "*", "/", ")"}
|
483
|
+
87/n0: $start → expression • $
|
558
484
|
{}
|
559
|
-
88/l2: expression
|
485
|
+
88/l2: expression → expression • "+" expression
|
560
486
|
{}
|
561
|
-
89/l2: expression
|
487
|
+
89/l2: expression → expression • "-" expression
|
562
488
|
{}
|
563
|
-
90/l3: expression
|
489
|
+
90/l3: expression → expression • "*" expression
|
564
490
|
{}
|
565
|
-
91/l3: expression
|
491
|
+
91/l3: expression → expression • "/" expression
|
566
492
|
{}
|
567
493
|
|
568
494
|
transitions:
|
@@ -574,17 +500,17 @@ State 18:
|
|
574
500
|
|
575
501
|
State 19:
|
576
502
|
rules:
|
577
|
-
86/l3: expression
|
578
|
-
{"+", "-", "*", "/", ")"
|
579
|
-
87/n0: $start
|
503
|
+
86/l3: expression → expression "/" expression •
|
504
|
+
{$, "+", "-", "*", "/", ")"}
|
505
|
+
87/n0: $start → expression • $
|
580
506
|
{}
|
581
|
-
88/l2: expression
|
507
|
+
88/l2: expression → expression • "+" expression
|
582
508
|
{}
|
583
|
-
89/l2: expression
|
509
|
+
89/l2: expression → expression • "-" expression
|
584
510
|
{}
|
585
|
-
90/l3: expression
|
511
|
+
90/l3: expression → expression • "*" expression
|
586
512
|
{}
|
587
|
-
91/l3: expression
|
513
|
+
91/l3: expression → expression • "/" expression
|
588
514
|
{}
|
589
515
|
|
590
516
|
transitions:
|
@@ -596,15 +522,15 @@ State 19:
|
|
596
522
|
|
597
523
|
State 20:
|
598
524
|
rules:
|
599
|
-
92/n4: expression
|
600
|
-
{"+", "-", "*", "/", ")"
|
525
|
+
92/n4: expression → "(" expression ")" •
|
526
|
+
{$, "+", "-", "*", "/", ")"}
|
601
527
|
|
602
528
|
transitions:
|
603
529
|
|
604
530
|
State 21:
|
605
531
|
rules:
|
606
|
-
93/n4: expression
|
607
|
-
{"+", "-", "*", "/", ")"
|
532
|
+
93/n4: expression → "(" $error ")" •
|
533
|
+
{$, "+", "-", "*", "/", ")"}
|
608
534
|
|
609
535
|
transitions:
|
610
536
|
|