antelope 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,12 +1,50 @@
1
1
  Productions:
2
- expressionNUMBER { |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
- $startexpression $
2
+ 0 $start(0) expression(0:1) $
3
+ 1 expression(0:1)NUMBER { |a| a[1] }
4
+ 2 expression(0:1) → expression(0:1) "+" expression(5:11) { |a, _, b| a + b }
5
+ 3 expression(0:1) → expression(0:1) "-" expression(6:12) { |a, _, b| a - b }
6
+ 4 expression(0:1) → expression(0:1) "*" expression(7:13) { |a, _, b| a * b }
7
+ 5 expression(0:1)expression(0:1) "/" expression(8:14) { |a, _, b| a / b }
8
+ 6 expression(0:1) → "(" expression(3:9) ")" { |_, a, _| a }
9
+ 7 expression(0:1) "(" $error ")"
10
+ 1 expression(3:9) → NUMBER { |a| a[1] }
11
+ 2 expression(3:9) → expression(3:9) "+" expression(5:11) { |a, _, b| a + b }
12
+ 3 expression(3:9) → expression(3:9) "-" expression(6:12) { |a, _, b| a - b }
13
+ 4 expression(3:9) → expression(3:9) "*" expression(7:13) { |a, _, b| a * b }
14
+ 5 expression(3:9) → expression(3:9) "/" expression(8:14) { |a, _, b| a / b }
15
+ 6 expression(3:9) → "(" expression(3:9) ")" { |_, a, _| a }
16
+ 7 expression(3:9) → "(" $error ")"
17
+ 1 expression(5:11) → NUMBER { |a| a[1] }
18
+ 2 expression(5:11) → expression(5:11) "+" expression(5:11) { |a, _, b| a + b }
19
+ 3 expression(5:11) → expression(5:11) "-" expression(6:12) { |a, _, b| a - b }
20
+ 4 expression(5:11) → expression(5:11) "*" expression(7:13) { |a, _, b| a * b }
21
+ 5 expression(5:11) → expression(5:11) "/" expression(8:14) { |a, _, b| a / b }
22
+ 6 expression(5:11) → "(" expression(3:9) ")" { |_, a, _| a }
23
+ 7 expression(5:11) → "(" $error ")"
24
+ 1 expression(6:12) → NUMBER { |a| a[1] }
25
+ 2 expression(6:12) → expression(6:12) "+" expression(5:11) { |a, _, b| a + b }
26
+ 3 expression(6:12) → expression(6:12) "-" expression(6:12) { |a, _, b| a - b }
27
+ 4 expression(6:12) → expression(6:12) "*" expression(7:13) { |a, _, b| a * b }
28
+ 5 expression(6:12) → expression(6:12) "/" expression(8:14) { |a, _, b| a / b }
29
+ 6 expression(6:12) → "(" expression(3:9) ")" { |_, a, _| a }
30
+ 7 expression(6:12) → "(" $error ")"
31
+ 1 expression(7:13) → NUMBER { |a| a[1] }
32
+ 2 expression(7:13) → expression(7:13) "+" expression(5:11) { |a, _, b| a + b }
33
+ 3 expression(7:13) → expression(7:13) "-" expression(6:12) { |a, _, b| a - b }
34
+ 4 expression(7:13) → expression(7:13) "*" expression(7:13) { |a, _, b| a * b }
35
+ 5 expression(7:13) → expression(7:13) "/" expression(8:14) { |a, _, b| a / b }
36
+ 6 expression(7:13) → "(" expression(3:9) ")" { |_, a, _| a }
37
+ 7 expression(7:13) → "(" $error ")"
38
+ 1 expression(8:14) → NUMBER { |a| a[1] }
39
+ 2 expression(8:14) → expression(8:14) "+" expression(5:11) { |a, _, b| a + b }
40
+ 3 expression(8:14) → expression(8:14) "-" expression(6:12) { |a, _, b| a - b }
41
+ 4 expression(8:14) → expression(8:14) "*" expression(7:13) { |a, _, b| a * b }
42
+ 5 expression(8:14) → expression(8:14) "/" expression(8:14) { |a, _, b| a / b }
43
+ 6 expression(8:14) → "(" expression(3:9) ")" { |_, a, _| a }
44
+ 7 expression(8:14) → "(" $error ")"
45
+
46
+ Nontemrinals:
47
+ ["$start(0)", "expression(0:1)", "expression(3:9)", "expression(5:11)", "expression(6:12)", "expression(7:13)", "expression(8:14)"]
10
48
 
11
49
  Precedence:
12
50
  --- highest
@@ -23,48 +61,48 @@ Precedence:
23
61
  --- lowest
24
62
 
25
63
  State 0:
26
- 0/n0: $start(0) → • expression(0:1) $
27
- {}
28
- 1/n1: expression(0:1) → • NUMBER
29
- {}
30
- 2/l2: expression(0:1) → • expression(0:1) "+" expression(10:16)
31
- {}
32
- 3/l2: expression(0:1) → • expression(0:1) "-" expression(11:17)
33
- {}
34
- 4/l3: expression(0:1) → • expression(0:1) "*" expression(12:18)
35
- {}
36
- 5/l3: expression(0:1) → • expression(0:1) "/" expression(13:19)
37
- {}
38
- 6/n4: expression(0:1) → • "(" expression(7:14) ")"
39
- {}
40
- 7/n4: expression(0:1) → • "(" $error ")"
41
- {}
64
+ 0/n0: $start → • expression $
65
+ {} ($start)
66
+ 1/n1: expression → • NUMBER
67
+ {} (expression)
68
+ 2/l2: expression → • expression "+" expression
69
+ {} (expression)
70
+ 3/l2: expression → • expression "-" expression
71
+ {} (expression)
72
+ 4/l3: expression → • expression "*" expression
73
+ {} (expression)
74
+ 5/l3: expression → • expression "/" expression
75
+ {} (expression)
76
+ 6/n4: expression → • "(" expression ")"
77
+ {} (expression)
78
+ 7/n4: expression → • "(" $error ")"
79
+ {} (expression)
42
80
  transitions:
43
81
  expression: State 1
44
82
  NUMBER: State 2
45
- LPAREN: State 7
83
+ LPAREN: State 3
46
84
 
47
85
  State 1:
48
86
  8/n0: $start → expression • $
49
- {}
50
- 83/l2: expression → expression • "+" expression
51
- {}
52
- 84/l2: expression → expression • "-" expression
53
- {}
54
- 85/l3: expression → expression • "*" expression
55
- {}
56
- 86/l3: expression → expression • "/" expression
57
- {}
87
+ {} ($start)
88
+ 9/l2: expression → expression • "+" expression
89
+ {} (expression)
90
+ 10/l2: expression → expression • "-" expression
91
+ {} (expression)
92
+ 11/l3: expression → expression • "*" expression
93
+ {} (expression)
94
+ 12/l3: expression → expression • "/" expression
95
+ {} (expression)
58
96
  transitions:
59
- $: State 9
60
- ADD: State 10
61
- SUBTRACT: State 11
62
- MULTIPLY: State 12
63
- DIVIDE: State 13
97
+ $: State 4
98
+ ADD: State 5
99
+ SUBTRACT: State 6
100
+ MULTIPLY: State 7
101
+ DIVIDE: State 8
64
102
 
65
103
  State 2:
66
104
  13/n1: expression → NUMBER •
67
- {$, "+", "-", "*", "/", ")"}
105
+ {$, "+", "-", "*", "/", ")"} (expression)
68
106
  reductions:
69
107
  $: Rule 1
70
108
  ADD: Rule 1
@@ -74,229 +112,199 @@ Precedence:
74
112
  RPAREN: Rule 1
75
113
 
76
114
  State 3:
77
- 83/l2: expression → expression • "+" expression
78
- {}
115
+ 14/n4: expression → "("expression ")"
116
+ {} (expression)
117
+ 15/n1: expression → • NUMBER
118
+ {} (expression)
119
+ 16/l2: expression → • expression "+" expression
120
+ {} (expression)
121
+ 17/l2: expression → • expression "-" expression
122
+ {} (expression)
123
+ 18/l3: expression → • expression "*" expression
124
+ {} (expression)
125
+ 19/l3: expression → • expression "/" expression
126
+ {} (expression)
127
+ 20/n4: expression → • "(" expression ")"
128
+ {} (expression)
129
+ 21/n4: expression → • "(" $error ")"
130
+ {} (expression)
131
+ 22/n4: expression → "(" • $error ")"
132
+ {} (expression)
79
133
  transitions:
80
- ADD: State 10
134
+ expression: State 9
135
+ NUMBER: State 2
136
+ LPAREN: State 3
137
+ $error: State 10
81
138
 
82
139
  State 4:
83
- 84/l2: expression → expression • "-" expression
84
- {}
85
- transitions:
86
- SUBTRACT: State 11
140
+ 23/n0: $start → expression $
141
+ {} ($start)
142
+ accepting:
143
+ $: Rule 0
87
144
 
88
145
  State 5:
89
- 85/l3: expression → expression "*" expression
90
- {}
146
+ 24/l2: expression → expression "+" expression
147
+ {} (expression)
148
+ 25/n1: expression → • NUMBER
149
+ {} (expression)
150
+ 26/l2: expression → • expression "+" expression
151
+ {} (expression)
152
+ 27/l2: expression → • expression "-" expression
153
+ {} (expression)
154
+ 28/l3: expression → • expression "*" expression
155
+ {} (expression)
156
+ 29/l3: expression → • expression "/" expression
157
+ {} (expression)
158
+ 30/n4: expression → • "(" expression ")"
159
+ {} (expression)
160
+ 31/n4: expression → • "(" $error ")"
161
+ {} (expression)
91
162
  transitions:
92
- MULTIPLY: State 12
163
+ expression: State 11
164
+ NUMBER: State 2
165
+ LPAREN: State 3
93
166
 
94
167
  State 6:
95
- 86/l3: expression → expression "/" expression
96
- {}
168
+ 32/l2: expression → expression "-" expression
169
+ {} (expression)
170
+ 33/n1: expression → • NUMBER
171
+ {} (expression)
172
+ 34/l2: expression → • expression "+" expression
173
+ {} (expression)
174
+ 35/l2: expression → • expression "-" expression
175
+ {} (expression)
176
+ 36/l3: expression → • expression "*" expression
177
+ {} (expression)
178
+ 37/l3: expression → • expression "/" expression
179
+ {} (expression)
180
+ 38/n4: expression → • "(" expression ")"
181
+ {} (expression)
182
+ 39/n4: expression → • "(" $error ")"
183
+ {} (expression)
97
184
  transitions:
98
- DIVIDE: State 13
185
+ expression: State 12
186
+ NUMBER: State 2
187
+ LPAREN: State 3
99
188
 
100
189
  State 7:
101
- 18/n4: expression → "(" • expression ")"
102
- {}
103
- 19/n1: expression(7:14) → • NUMBER
104
- {}
105
- 20/l2: expression(7:14) → • expression(7:14) "+" expression(10:16)
106
- {}
107
- 21/l2: expression(7:14) → • expression(7:14) "-" expression(11:17)
108
- {}
109
- 22/l3: expression(7:14) → • expression(7:14) "*" expression(12:18)
110
- {}
111
- 23/l3: expression(7:14) → • expression(7:14) "/" expression(13:19)
112
- {}
113
- 24/n4: expression(7:14) → • "(" expression(7:14) ")"
114
- {}
115
- 25/n4: expression(7:14) → • "(" $error ")"
116
- {}
117
- 27/n4: expression → "(" • $error ")"
118
- {}
190
+ 40/l3: expression → expression "*" • expression
191
+ {} (expression)
192
+ 41/n1: expression → • NUMBER
193
+ {} (expression)
194
+ 42/l2: expression → • expression "+" expression
195
+ {} (expression)
196
+ 43/l2: expression → • expression "-" expression
197
+ {} (expression)
198
+ 44/l3: expression → • expression "*" expression
199
+ {} (expression)
200
+ 45/l3: expression → • expression "/" expression
201
+ {} (expression)
202
+ 46/n4: expression → • "(" expression ")"
203
+ {} (expression)
204
+ 47/n4: expression → • "(" $error ")"
205
+ {} (expression)
119
206
  transitions:
120
- expression: State 14
207
+ expression: State 13
121
208
  NUMBER: State 2
122
- LPAREN: State 7
123
- $error: State 15
209
+ LPAREN: State 3
124
210
 
125
211
  State 8:
126
- 27/n4: expression → "(" • $error ")"
127
- {}
212
+ 48/l3: expression → expression "/" • expression
213
+ {} (expression)
214
+ 49/n1: expression → • NUMBER
215
+ {} (expression)
216
+ 50/l2: expression → • expression "+" expression
217
+ {} (expression)
218
+ 51/l2: expression → • expression "-" expression
219
+ {} (expression)
220
+ 52/l3: expression → • expression "*" expression
221
+ {} (expression)
222
+ 53/l3: expression → • expression "/" expression
223
+ {} (expression)
224
+ 54/n4: expression → • "(" expression ")"
225
+ {} (expression)
226
+ 55/n4: expression → • "(" $error ")"
227
+ {} (expression)
128
228
  transitions:
129
- $error: State 15
229
+ expression: State 14
230
+ NUMBER: State 2
231
+ LPAREN: State 3
130
232
 
131
233
  State 9:
132
- 28/n0: $start → expression $
133
- {}
134
- accepting:
135
- $: Rule 0
234
+ 56/n4: expression"(" expression • ")"
235
+ {} (expression)
236
+ 57/l2: expression → expression • "+" expression
237
+ {} (expression)
238
+ 58/l2: expression → expression • "-" expression
239
+ {} (expression)
240
+ 59/l3: expression → expression • "*" expression
241
+ {} (expression)
242
+ 60/l3: expression → expression • "/" expression
243
+ {} (expression)
244
+ transitions:
245
+ RPAREN: State 15
246
+ ADD: State 5
247
+ SUBTRACT: State 6
248
+ MULTIPLY: State 7
249
+ DIVIDE: State 8
136
250
 
137
251
  State 10:
138
- 29/l2: expression → expression "+" • expression
139
- {}
140
- 30/n1: expression(10:16) → • NUMBER
141
- {}
142
- 31/l2: expression(10:16) → • expression(10:16) "+" expression(10:16)
143
- {}
144
- 32/l2: expression(10:16) → • expression(10:16) "-" expression(11:17)
145
- {}
146
- 33/l3: expression(10:16) → • expression(10:16) "*" expression(12:18)
147
- {}
148
- 34/l3: expression(10:16) → • expression(10:16) "/" expression(13:19)
149
- {}
150
- 35/n4: expression(10:16) → • "(" expression(7:14) ")"
151
- {}
152
- 36/n4: expression(10:16) → • "(" $error ")"
153
- {}
252
+ 61/n4: expression → "(" $error ")"
253
+ {} (expression)
154
254
  transitions:
155
- expression: State 16
156
- NUMBER: State 2
157
- LPAREN: State 7
255
+ RPAREN: State 16
158
256
 
159
257
  State 11:
160
- 37/l2: expression → expression "-" • expression
161
- {}
162
- 38/n1: expression(11:17) NUMBER
163
- {}
164
- 39/l2: expression(11:17) expression(11:17) "+" expression(10:16)
165
- {}
166
- 40/l2: expression(11:17) expression(11:17) "-" expression(11:17)
167
- {}
168
- 41/l3: expression(11:17) expression(11:17) "*" expression(12:18)
169
- {}
170
- 42/l3: expression(11:17) → • expression(11:17) "/" expression(13:19)
171
- {}
172
- 43/n4: expression(11:17) → • "(" expression(7:14) ")"
173
- {}
174
- 44/n4: expression(11:17) → • "(" $error ")"
175
- {}
258
+ 62/l2: expression → expression "+" expression
259
+ {$, "+", "-", "*", "/", ")"} (expression)
260
+ 63/l2: expression → expression "+" expression
261
+ {} (expression)
262
+ 64/l2: expression → expression "-" expression
263
+ {} (expression)
264
+ 65/l3: expression → expression "*" expression
265
+ {} (expression)
266
+ 66/l3: expression → expression "/" expression
267
+ {} (expression)
176
268
  transitions:
177
- expression: State 17
178
- NUMBER: State 2
179
- LPAREN: State 7
180
-
181
- State 12:
182
- 45/l3: expression → expression "*" • expression
183
- {}
184
- 46/n1: expression(12:18) → • NUMBER
185
- {}
186
- 47/l2: expression(12:18) → • expression(12:18) "+" expression(10:16)
187
- {}
188
- 48/l2: expression(12:18) → • expression(12:18) "-" expression(11:17)
189
- {}
190
- 49/l3: expression(12:18) → • expression(12:18) "*" expression(12:18)
191
- {}
192
- 50/l3: expression(12:18) → • expression(12:18) "/" expression(13:19)
193
- {}
194
- 51/n4: expression(12:18) → • "(" expression(7:14) ")"
195
- {}
196
- 52/n4: expression(12:18) → • "(" $error ")"
197
- {}
198
- transitions:
199
- expression: State 18
200
- NUMBER: State 2
201
- LPAREN: State 7
202
-
203
- State 13:
204
- 53/l3: expression → expression "/" • expression
205
- {}
206
- 54/n1: expression(13:19) → • NUMBER
207
- {}
208
- 55/l2: expression(13:19) → • expression(13:19) "+" expression(10:16)
209
- {}
210
- 56/l2: expression(13:19) → • expression(13:19) "-" expression(11:17)
211
- {}
212
- 57/l3: expression(13:19) → • expression(13:19) "*" expression(12:18)
213
- {}
214
- 58/l3: expression(13:19) → • expression(13:19) "/" expression(13:19)
215
- {}
216
- 59/n4: expression(13:19) → • "(" expression(7:14) ")"
217
- {}
218
- 60/n4: expression(13:19) → • "(" $error ")"
219
- {}
220
- transitions:
221
- expression: State 19
222
- NUMBER: State 2
223
- LPAREN: State 7
224
-
225
- State 14:
226
- 61/n4: expression → "(" expression • ")"
227
- {}
228
- 83/l2: expression → expression • "+" expression
229
- {}
230
- 84/l2: expression → expression • "-" expression
231
- {}
232
- 85/l3: expression → expression • "*" expression
233
- {}
234
- 86/l3: expression → expression • "/" expression
235
- {}
236
- transitions:
237
- ADD: State 10
238
- SUBTRACT: State 11
239
- MULTIPLY: State 12
240
- DIVIDE: State 13
241
- RPAREN: State 20
242
-
243
- State 15:
244
- 66/n4: expression → "(" $error • ")"
245
- {}
246
- transitions:
247
- RPAREN: State 21
248
-
249
- State 16:
250
- 67/l2: expression → expression "+" expression •
251
- {$, "+", "-", "*", "/", ")"}
252
- 83/l2: expression → expression • "+" expression
253
- {}
254
- 84/l2: expression → expression • "-" expression
255
- {}
256
- 85/l3: expression → expression • "*" expression
257
- {}
258
- 86/l3: expression → expression • "/" expression
259
- {}
260
- transitions:
261
- MULTIPLY: State 12
262
- DIVIDE: State 13
269
+ MULTIPLY: State 7
270
+ DIVIDE: State 8
263
271
  reductions:
264
272
  ADD: Rule 2
265
273
  SUBTRACT: Rule 2
266
274
  $: Rule 2
267
275
  RPAREN: Rule 2
268
276
 
269
- State 17:
270
- 72/l2: expression → expression "-" expression •
271
- {$, "+", "-", "*", "/", ")"}
272
- 83/l2: expression → expression • "+" expression
273
- {}
274
- 84/l2: expression → expression • "-" expression
275
- {}
276
- 85/l3: expression → expression • "*" expression
277
- {}
278
- 86/l3: expression → expression • "/" expression
279
- {}
277
+ State 12:
278
+ 67/l2: expression → expression "-" expression •
279
+ {$, "+", "-", "*", "/", ")"} (expression)
280
+ 68/l2: expression → expression • "+" expression
281
+ {} (expression)
282
+ 69/l2: expression → expression • "-" expression
283
+ {} (expression)
284
+ 70/l3: expression → expression • "*" expression
285
+ {} (expression)
286
+ 71/l3: expression → expression • "/" expression
287
+ {} (expression)
280
288
  transitions:
281
- MULTIPLY: State 12
282
- DIVIDE: State 13
289
+ MULTIPLY: State 7
290
+ DIVIDE: State 8
283
291
  reductions:
284
292
  ADD: Rule 3
285
293
  SUBTRACT: Rule 3
286
294
  $: Rule 3
287
295
  RPAREN: Rule 3
288
296
 
289
- State 18:
290
- 77/l3: expression → expression "*" expression •
291
- {$, "+", "-", "*", "/", ")"}
292
- 83/l2: expression → expression • "+" expression
293
- {}
294
- 84/l2: expression → expression • "-" expression
295
- {}
296
- 85/l3: expression → expression • "*" expression
297
- {}
298
- 86/l3: expression → expression • "/" expression
299
- {}
297
+ State 13:
298
+ 72/l3: expression → expression "*" expression •
299
+ {$, "+", "-", "*", "/", ")"} (expression)
300
+ 73/l2: expression → expression • "+" expression
301
+ {} (expression)
302
+ 74/l2: expression → expression • "-" expression
303
+ {} (expression)
304
+ 75/l3: expression → expression • "*" expression
305
+ {} (expression)
306
+ 76/l3: expression → expression • "/" expression
307
+ {} (expression)
300
308
  reductions:
301
309
  ADD: Rule 4
302
310
  SUBTRACT: Rule 4
@@ -305,17 +313,17 @@ Precedence:
305
313
  $: Rule 4
306
314
  RPAREN: Rule 4
307
315
 
308
- State 19:
309
- 82/l3: expression → expression "/" expression •
310
- {$, "+", "-", "*", "/", ")"}
311
- 83/l2: expression → expression • "+" expression
312
- {}
313
- 84/l2: expression → expression • "-" expression
314
- {}
315
- 85/l3: expression → expression • "*" expression
316
- {}
317
- 86/l3: expression → expression • "/" expression
318
- {}
316
+ State 14:
317
+ 77/l3: expression → expression "/" expression •
318
+ {$, "+", "-", "*", "/", ")"} (expression)
319
+ 78/l2: expression → expression • "+" expression
320
+ {} (expression)
321
+ 79/l2: expression → expression • "-" expression
322
+ {} (expression)
323
+ 80/l3: expression → expression • "*" expression
324
+ {} (expression)
325
+ 81/l3: expression → expression • "/" expression
326
+ {} (expression)
319
327
  reductions:
320
328
  ADD: Rule 5
321
329
  SUBTRACT: Rule 5
@@ -324,9 +332,9 @@ Precedence:
324
332
  $: Rule 5
325
333
  RPAREN: Rule 5
326
334
 
327
- State 20:
328
- 87/n4: expression → "(" expression ")" •
329
- {$, "+", "-", "*", "/", ")"}
335
+ State 15:
336
+ 82/n4: expression → "(" expression ")" •
337
+ {$, "+", "-", "*", "/", ")"} (expression)
330
338
  reductions:
331
339
  $: Rule 6
332
340
  ADD: Rule 6
@@ -335,9 +343,9 @@ Precedence:
335
343
  DIVIDE: Rule 6
336
344
  RPAREN: Rule 6
337
345
 
338
- State 21:
339
- 88/n4: expression → "(" $error ")" •
340
- {$, "+", "-", "*", "/", ")"}
346
+ State 16:
347
+ 83/n4: expression → "(" $error ")" •
348
+ {$, "+", "-", "*", "/", ")"} (expression)
341
349
  reductions:
342
350
  $: Rule 7
343
351
  ADD: Rule 7