antelope 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +25 -23
- data/.rspec +3 -3
- data/.travis.yml +10 -9
- data/.yardopts +7 -7
- data/CONTRIBUTING.md +38 -38
- data/GENERATORS.md +124 -124
- data/Gemfile +7 -7
- data/LICENSE.txt +22 -22
- data/README.md +104 -104
- data/Rakefile +2 -2
- data/TODO.md +58 -58
- data/antelope.gemspec +28 -28
- data/bin/antelope +7 -7
- data/examples/deterministic.ace +35 -35
- data/examples/example.ace +51 -50
- data/examples/example.err +192 -0
- data/examples/{example.output → example.inf} +384 -385
- data/examples/liquidscript.ace +233 -162
- data/examples/simple.ace +22 -22
- data/lib/antelope/ace/compiler.rb +334 -334
- data/lib/antelope/ace/errors.rb +48 -48
- data/lib/antelope/ace/grammar/generation.rb +80 -80
- data/lib/antelope/ace/grammar/loading.rb +53 -53
- data/lib/antelope/ace/grammar/precedences.rb +68 -65
- data/lib/antelope/ace/grammar/productions.rb +156 -150
- data/lib/antelope/ace/grammar/symbols.rb +66 -66
- data/lib/antelope/ace/grammar.rb +69 -69
- data/lib/antelope/ace/precedence.rb +61 -61
- data/lib/antelope/ace/production.rb +57 -57
- data/lib/antelope/ace/scanner/argument.rb +57 -57
- data/lib/antelope/ace/scanner/first.rb +89 -89
- data/lib/antelope/ace/scanner/second.rb +177 -177
- data/lib/antelope/ace/scanner/third.rb +27 -27
- data/lib/antelope/ace/scanner.rb +134 -134
- data/lib/antelope/ace/token/epsilon.rb +24 -24
- data/lib/antelope/ace/token/error.rb +26 -26
- data/lib/antelope/ace/token/nonterminal.rb +17 -17
- data/lib/antelope/ace/token/terminal.rb +17 -17
- data/lib/antelope/ace/token.rb +238 -238
- data/lib/antelope/ace.rb +53 -53
- data/lib/antelope/cli.rb +55 -55
- data/lib/antelope/errors.rb +8 -8
- data/lib/antelope/generation/constructor/first.rb +88 -88
- data/lib/antelope/generation/constructor/follow.rb +103 -103
- data/lib/antelope/generation/constructor/nullable.rb +64 -64
- data/lib/antelope/generation/constructor.rb +126 -126
- data/lib/antelope/generation/errors.rb +17 -17
- data/lib/antelope/generation/null.rb +13 -13
- data/lib/antelope/generation/recognizer/rule.rb +216 -216
- data/lib/antelope/generation/recognizer/state.rb +130 -130
- data/lib/antelope/generation/recognizer.rb +180 -180
- data/lib/antelope/generation/tableizer.rb +175 -154
- data/lib/antelope/generation.rb +15 -15
- data/lib/antelope/generator/base.rb +264 -264
- data/lib/antelope/generator/c.rb +11 -11
- data/lib/antelope/generator/c_header.rb +105 -105
- data/lib/antelope/generator/c_source.rb +39 -39
- data/lib/antelope/generator/error.rb +34 -0
- data/lib/antelope/generator/group.rb +57 -57
- data/lib/antelope/generator/html.rb +51 -0
- data/lib/antelope/generator/info.rb +47 -0
- data/lib/antelope/generator/null.rb +18 -18
- data/lib/antelope/generator/output.rb +17 -49
- data/lib/antelope/generator/ruby.rb +79 -79
- data/lib/antelope/generator/templates/c_header.ant +36 -36
- data/lib/antelope/generator/templates/c_source.ant +202 -202
- data/lib/antelope/generator/templates/error.ant +33 -0
- data/lib/antelope/generator/templates/html/antelope.css +1 -0
- data/lib/antelope/generator/templates/html/antelope.html +1 -0
- data/lib/antelope/generator/templates/html/antelope.js +1 -0
- data/lib/antelope/generator/templates/html/css.ant +53 -0
- data/lib/antelope/generator/templates/html/html.ant +82 -0
- data/lib/antelope/generator/templates/html/js.ant +9 -0
- data/lib/antelope/generator/templates/info.ant +53 -0
- data/lib/antelope/generator/templates/ruby.ant +178 -146
- data/lib/antelope/generator.rb +66 -63
- data/lib/antelope/template/compiler.rb +78 -78
- data/lib/antelope/template/errors.rb +9 -9
- data/lib/antelope/template/scanner.rb +109 -109
- data/lib/antelope/template.rb +65 -60
- data/lib/antelope/version.rb +6 -6
- data/lib/antelope.rb +13 -13
- data/optimizations.txt +42 -0
- data/spec/antelope/ace/compiler_spec.rb +60 -60
- data/spec/antelope/ace/scanner_spec.rb +27 -27
- data/spec/antelope/constructor_spec.rb +133 -136
- data/spec/antelope/template_spec.rb +50 -49
- data/spec/fixtures/simple.ace +22 -22
- data/spec/spec_helper.rb +39 -39
- data/spec/support/benchmark_helper.rb +5 -5
- data/spec/support/grammar_helper.rb +15 -15
- data/subl/Ace (Ruby).JSON-tmLanguage +94 -94
- data/subl/Ace (Ruby).tmLanguage +153 -153
- metadata +17 -6
- data/lib/antelope/generator/templates/output.ant +0 -68
@@ -1,385 +1,384 @@
|
|
1
|
-
Productions:
|
2
|
-
0 $start
|
3
|
-
1 expression
|
4
|
-
2 expression
|
5
|
-
3 expression
|
6
|
-
4 expression
|
7
|
-
5 expression
|
8
|
-
6 expression
|
9
|
-
7 expression
|
10
|
-
8 expression
|
11
|
-
|
12
|
-
|
13
|
-
Precedence:
|
14
|
-
--- highest
|
15
|
-
right 4:
|
16
|
-
{EXPONENTIATE}
|
17
|
-
left 3:
|
18
|
-
{MULTIPLY, DIVIDE}
|
19
|
-
left 2:
|
20
|
-
{ADD, SUBTRACT}
|
21
|
-
nonassoc 1:
|
22
|
-
{_}
|
23
|
-
nonassoc 0:
|
24
|
-
{$end}
|
25
|
-
--- lowest
|
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
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
"
|
320
|
-
"
|
321
|
-
|
322
|
-
|
323
|
-
"
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
"
|
345
|
-
"
|
346
|
-
"
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
"
|
368
|
-
"
|
369
|
-
"
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
1
|
+
Productions:
|
2
|
+
0 $start → expression $end
|
3
|
+
1 expression → NUMBER { |a| a[1] }
|
4
|
+
2 expression → expression "^" expression { |a, _, b| a** b }
|
5
|
+
3 expression → expression "+" expression { |a, _, b| a + b }
|
6
|
+
4 expression → expression "-" expression { |a, _, b| a - b }
|
7
|
+
5 expression → expression "*" expression { |a, _, b| a * b }
|
8
|
+
6 expression → expression "/" expression { |a, _, b| a / b }
|
9
|
+
7 expression → "(" expression ")" { |_, a, _| a }
|
10
|
+
8 expression → "(" $error ")" { |_, e, _| e[1] }
|
11
|
+
|
12
|
+
|
13
|
+
Precedence:
|
14
|
+
--- highest
|
15
|
+
right 4:
|
16
|
+
{EXPONENTIATE}
|
17
|
+
left 3:
|
18
|
+
{MULTIPLY, DIVIDE}
|
19
|
+
left 2:
|
20
|
+
{ADD, SUBTRACT}
|
21
|
+
nonassoc 1:
|
22
|
+
{_}
|
23
|
+
nonassoc 0:
|
24
|
+
{$end}
|
25
|
+
--- lowest
|
26
|
+
|
27
|
+
State 0:
|
28
|
+
0/n0: $start → • expression $end
|
29
|
+
{}
|
30
|
+
1/n1: expression → • NUMBER
|
31
|
+
{}
|
32
|
+
2/r4: expression → • expression "^" expression
|
33
|
+
{}
|
34
|
+
3/l2: expression → • expression "+" expression
|
35
|
+
{}
|
36
|
+
4/l2: expression → • expression "-" expression
|
37
|
+
{}
|
38
|
+
5/l3: expression → • expression "*" expression
|
39
|
+
{}
|
40
|
+
6/l3: expression → • expression "/" expression
|
41
|
+
{}
|
42
|
+
7/n1: expression → • "(" expression ")"
|
43
|
+
{}
|
44
|
+
8/n1: expression → • "(" $error ")"
|
45
|
+
{}
|
46
|
+
transitions:
|
47
|
+
expression: State 1
|
48
|
+
NUMBER: State 2
|
49
|
+
"(": State 3
|
50
|
+
|
51
|
+
State 1:
|
52
|
+
9/n0: $start → expression • $end
|
53
|
+
{}
|
54
|
+
10/r4: expression → expression • "^" expression
|
55
|
+
{}
|
56
|
+
11/l2: expression → expression • "+" expression
|
57
|
+
{}
|
58
|
+
12/l2: expression → expression • "-" expression
|
59
|
+
{}
|
60
|
+
13/l3: expression → expression • "*" expression
|
61
|
+
{}
|
62
|
+
14/l3: expression → expression • "/" expression
|
63
|
+
{}
|
64
|
+
transitions:
|
65
|
+
$end: State 4
|
66
|
+
"^": State 5
|
67
|
+
"+": State 6
|
68
|
+
"-": State 7
|
69
|
+
"*": State 8
|
70
|
+
"/": State 9
|
71
|
+
|
72
|
+
State 2:
|
73
|
+
15/n1: expression → NUMBER •
|
74
|
+
{$end, "^", "+", "-", "*", "/", ")"}
|
75
|
+
reductions:
|
76
|
+
$default: Rule 1
|
77
|
+
|
78
|
+
State 3:
|
79
|
+
16/n1: expression → "(" • expression ")"
|
80
|
+
{}
|
81
|
+
17/n1: expression → "(" • $error ")"
|
82
|
+
{}
|
83
|
+
18/n1: expression → • NUMBER
|
84
|
+
{}
|
85
|
+
19/r4: expression → • expression "^" expression
|
86
|
+
{}
|
87
|
+
20/l2: expression → • expression "+" expression
|
88
|
+
{}
|
89
|
+
21/l2: expression → • expression "-" expression
|
90
|
+
{}
|
91
|
+
22/l3: expression → • expression "*" expression
|
92
|
+
{}
|
93
|
+
23/l3: expression → • expression "/" expression
|
94
|
+
{}
|
95
|
+
24/n1: expression → • "(" expression ")"
|
96
|
+
{}
|
97
|
+
25/n1: expression → • "(" $error ")"
|
98
|
+
{}
|
99
|
+
transitions:
|
100
|
+
expression: State 10
|
101
|
+
$error: State 11
|
102
|
+
NUMBER: State 2
|
103
|
+
"(": State 3
|
104
|
+
|
105
|
+
State 4:
|
106
|
+
26/n0: $start → expression $end •
|
107
|
+
{}
|
108
|
+
accepting:
|
109
|
+
$end: Rule 0
|
110
|
+
|
111
|
+
State 5:
|
112
|
+
27/r4: expression → expression "^" • expression
|
113
|
+
{}
|
114
|
+
28/n1: expression → • NUMBER
|
115
|
+
{}
|
116
|
+
29/r4: expression → • expression "^" expression
|
117
|
+
{}
|
118
|
+
30/l2: expression → • expression "+" expression
|
119
|
+
{}
|
120
|
+
31/l2: expression → • expression "-" expression
|
121
|
+
{}
|
122
|
+
32/l3: expression → • expression "*" expression
|
123
|
+
{}
|
124
|
+
33/l3: expression → • expression "/" expression
|
125
|
+
{}
|
126
|
+
34/n1: expression → • "(" expression ")"
|
127
|
+
{}
|
128
|
+
35/n1: expression → • "(" $error ")"
|
129
|
+
{}
|
130
|
+
transitions:
|
131
|
+
expression: State 12
|
132
|
+
NUMBER: State 2
|
133
|
+
"(": State 3
|
134
|
+
|
135
|
+
State 6:
|
136
|
+
36/l2: expression → expression "+" • expression
|
137
|
+
{}
|
138
|
+
37/n1: expression → • NUMBER
|
139
|
+
{}
|
140
|
+
38/r4: expression → • expression "^" expression
|
141
|
+
{}
|
142
|
+
39/l2: expression → • expression "+" expression
|
143
|
+
{}
|
144
|
+
40/l2: expression → • expression "-" expression
|
145
|
+
{}
|
146
|
+
41/l3: expression → • expression "*" expression
|
147
|
+
{}
|
148
|
+
42/l3: expression → • expression "/" expression
|
149
|
+
{}
|
150
|
+
43/n1: expression → • "(" expression ")"
|
151
|
+
{}
|
152
|
+
44/n1: expression → • "(" $error ")"
|
153
|
+
{}
|
154
|
+
transitions:
|
155
|
+
expression: State 13
|
156
|
+
NUMBER: State 2
|
157
|
+
"(": State 3
|
158
|
+
|
159
|
+
State 7:
|
160
|
+
45/l2: expression → expression "-" • expression
|
161
|
+
{}
|
162
|
+
46/n1: expression → • NUMBER
|
163
|
+
{}
|
164
|
+
47/r4: expression → • expression "^" expression
|
165
|
+
{}
|
166
|
+
48/l2: expression → • expression "+" expression
|
167
|
+
{}
|
168
|
+
49/l2: expression → • expression "-" expression
|
169
|
+
{}
|
170
|
+
50/l3: expression → • expression "*" expression
|
171
|
+
{}
|
172
|
+
51/l3: expression → • expression "/" expression
|
173
|
+
{}
|
174
|
+
52/n1: expression → • "(" expression ")"
|
175
|
+
{}
|
176
|
+
53/n1: expression → • "(" $error ")"
|
177
|
+
{}
|
178
|
+
transitions:
|
179
|
+
expression: State 14
|
180
|
+
NUMBER: State 2
|
181
|
+
"(": State 3
|
182
|
+
|
183
|
+
State 8:
|
184
|
+
54/l3: expression → expression "*" • expression
|
185
|
+
{}
|
186
|
+
55/n1: expression → • NUMBER
|
187
|
+
{}
|
188
|
+
56/r4: expression → • expression "^" expression
|
189
|
+
{}
|
190
|
+
57/l2: expression → • expression "+" expression
|
191
|
+
{}
|
192
|
+
58/l2: expression → • expression "-" expression
|
193
|
+
{}
|
194
|
+
59/l3: expression → • expression "*" expression
|
195
|
+
{}
|
196
|
+
60/l3: expression → • expression "/" expression
|
197
|
+
{}
|
198
|
+
61/n1: expression → • "(" expression ")"
|
199
|
+
{}
|
200
|
+
62/n1: expression → • "(" $error ")"
|
201
|
+
{}
|
202
|
+
transitions:
|
203
|
+
expression: State 15
|
204
|
+
NUMBER: State 2
|
205
|
+
"(": State 3
|
206
|
+
|
207
|
+
State 9:
|
208
|
+
63/l3: expression → expression "/" • expression
|
209
|
+
{}
|
210
|
+
64/n1: expression → • NUMBER
|
211
|
+
{}
|
212
|
+
65/r4: expression → • expression "^" expression
|
213
|
+
{}
|
214
|
+
66/l2: expression → • expression "+" expression
|
215
|
+
{}
|
216
|
+
67/l2: expression → • expression "-" expression
|
217
|
+
{}
|
218
|
+
68/l3: expression → • expression "*" expression
|
219
|
+
{}
|
220
|
+
69/l3: expression → • expression "/" expression
|
221
|
+
{}
|
222
|
+
70/n1: expression → • "(" expression ")"
|
223
|
+
{}
|
224
|
+
71/n1: expression → • "(" $error ")"
|
225
|
+
{}
|
226
|
+
transitions:
|
227
|
+
expression: State 16
|
228
|
+
NUMBER: State 2
|
229
|
+
"(": State 3
|
230
|
+
|
231
|
+
State 10:
|
232
|
+
72/n1: expression → "(" expression • ")"
|
233
|
+
{}
|
234
|
+
73/r4: expression → expression • "^" expression
|
235
|
+
{}
|
236
|
+
74/l2: expression → expression • "+" expression
|
237
|
+
{}
|
238
|
+
75/l2: expression → expression • "-" expression
|
239
|
+
{}
|
240
|
+
76/l3: expression → expression • "*" expression
|
241
|
+
{}
|
242
|
+
77/l3: expression → expression • "/" expression
|
243
|
+
{}
|
244
|
+
transitions:
|
245
|
+
")": State 17
|
246
|
+
"^": State 5
|
247
|
+
"+": State 6
|
248
|
+
"-": State 7
|
249
|
+
"*": State 8
|
250
|
+
"/": State 9
|
251
|
+
|
252
|
+
State 11:
|
253
|
+
78/n1: expression → "(" $error • ")"
|
254
|
+
{}
|
255
|
+
transitions:
|
256
|
+
")": State 18
|
257
|
+
|
258
|
+
State 12:
|
259
|
+
79/r4: expression → expression "^" expression •
|
260
|
+
{$end, "^", "+", "-", "*", "/", ")"}
|
261
|
+
80/r4: expression → expression • "^" expression
|
262
|
+
{}
|
263
|
+
81/l2: expression → expression • "+" expression
|
264
|
+
{}
|
265
|
+
82/l2: expression → expression • "-" expression
|
266
|
+
{}
|
267
|
+
83/l3: expression → expression • "*" expression
|
268
|
+
{}
|
269
|
+
84/l3: expression → expression • "/" expression
|
270
|
+
{}
|
271
|
+
transitions:
|
272
|
+
"^": State 5
|
273
|
+
reductions:
|
274
|
+
"+": Rule 2
|
275
|
+
"-": Rule 2
|
276
|
+
"*": Rule 2
|
277
|
+
"/": Rule 2
|
278
|
+
$end: Rule 2
|
279
|
+
")": Rule 2
|
280
|
+
|
281
|
+
State 13:
|
282
|
+
85/l2: expression → expression "+" expression •
|
283
|
+
{$end, "^", "+", "-", "*", "/", ")"}
|
284
|
+
86/r4: expression → expression • "^" expression
|
285
|
+
{}
|
286
|
+
87/l2: expression → expression • "+" expression
|
287
|
+
{}
|
288
|
+
88/l2: expression → expression • "-" expression
|
289
|
+
{}
|
290
|
+
89/l3: expression → expression • "*" expression
|
291
|
+
{}
|
292
|
+
90/l3: expression → expression • "/" expression
|
293
|
+
{}
|
294
|
+
transitions:
|
295
|
+
"^": State 5
|
296
|
+
"*": State 8
|
297
|
+
"/": State 9
|
298
|
+
reductions:
|
299
|
+
"+": Rule 3
|
300
|
+
"-": Rule 3
|
301
|
+
$end: Rule 3
|
302
|
+
")": Rule 3
|
303
|
+
|
304
|
+
State 14:
|
305
|
+
91/l2: expression → expression "-" expression •
|
306
|
+
{$end, "^", "+", "-", "*", "/", ")"}
|
307
|
+
92/r4: expression → expression • "^" expression
|
308
|
+
{}
|
309
|
+
93/l2: expression → expression • "+" expression
|
310
|
+
{}
|
311
|
+
94/l2: expression → expression • "-" expression
|
312
|
+
{}
|
313
|
+
95/l3: expression → expression • "*" expression
|
314
|
+
{}
|
315
|
+
96/l3: expression → expression • "/" expression
|
316
|
+
{}
|
317
|
+
transitions:
|
318
|
+
"^": State 5
|
319
|
+
"*": State 8
|
320
|
+
"/": State 9
|
321
|
+
reductions:
|
322
|
+
"+": Rule 4
|
323
|
+
"-": Rule 4
|
324
|
+
$end: Rule 4
|
325
|
+
")": Rule 4
|
326
|
+
|
327
|
+
State 15:
|
328
|
+
97/l3: expression → expression "*" expression •
|
329
|
+
{$end, "^", "+", "-", "*", "/", ")"}
|
330
|
+
98/r4: expression → expression • "^" expression
|
331
|
+
{}
|
332
|
+
99/l2: expression → expression • "+" expression
|
333
|
+
{}
|
334
|
+
100/l2: expression → expression • "-" expression
|
335
|
+
{}
|
336
|
+
101/l3: expression → expression • "*" expression
|
337
|
+
{}
|
338
|
+
102/l3: expression → expression • "/" expression
|
339
|
+
{}
|
340
|
+
transitions:
|
341
|
+
"^": State 5
|
342
|
+
reductions:
|
343
|
+
"+": Rule 5
|
344
|
+
"-": Rule 5
|
345
|
+
"*": Rule 5
|
346
|
+
"/": Rule 5
|
347
|
+
$end: Rule 5
|
348
|
+
")": Rule 5
|
349
|
+
|
350
|
+
State 16:
|
351
|
+
103/l3: expression → expression "/" expression •
|
352
|
+
{$end, "^", "+", "-", "*", "/", ")"}
|
353
|
+
104/r4: expression → expression • "^" expression
|
354
|
+
{}
|
355
|
+
105/l2: expression → expression • "+" expression
|
356
|
+
{}
|
357
|
+
106/l2: expression → expression • "-" expression
|
358
|
+
{}
|
359
|
+
107/l3: expression → expression • "*" expression
|
360
|
+
{}
|
361
|
+
108/l3: expression → expression • "/" expression
|
362
|
+
{}
|
363
|
+
transitions:
|
364
|
+
"^": State 5
|
365
|
+
reductions:
|
366
|
+
"+": Rule 6
|
367
|
+
"-": Rule 6
|
368
|
+
"*": Rule 6
|
369
|
+
"/": Rule 6
|
370
|
+
$end: Rule 6
|
371
|
+
")": Rule 6
|
372
|
+
|
373
|
+
State 17:
|
374
|
+
109/n1: expression → "(" expression ")" •
|
375
|
+
{$end, "^", "+", "-", "*", "/", ")"}
|
376
|
+
reductions:
|
377
|
+
$default: Rule 7
|
378
|
+
|
379
|
+
State 18:
|
380
|
+
110/n1: expression → "(" $error ")" •
|
381
|
+
{$end, "^", "+", "-", "*", "/", ")"}
|
382
|
+
reductions:
|
383
|
+
$default: Rule 8
|
384
|
+
|