antelope 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +7 -0
  3. data/examples/deterministic.output +53 -139
  4. data/examples/example.output +159 -347
  5. data/examples/simple.output +50 -124
  6. data/lib/antelope/ace/compiler.rb +10 -1
  7. data/lib/antelope/ace/errors.rb +8 -0
  8. data/lib/antelope/ace/grammar/generation.rb +6 -1
  9. data/lib/antelope/ace/grammar/loading.rb +2 -0
  10. data/lib/antelope/ace/grammar/precedences.rb +3 -1
  11. data/lib/antelope/ace/grammar/production.rb +2 -0
  12. data/lib/antelope/ace/grammar/productions.rb +2 -0
  13. data/lib/antelope/ace/grammar/terminals.rb +2 -0
  14. data/lib/antelope/ace/grammar.rb +2 -0
  15. data/lib/antelope/ace/precedence.rb +2 -0
  16. data/lib/antelope/ace/scanner/first.rb +2 -0
  17. data/lib/antelope/ace/scanner/second.rb +3 -1
  18. data/lib/antelope/ace/scanner/third.rb +2 -0
  19. data/lib/antelope/ace/scanner.rb +2 -0
  20. data/lib/antelope/ace/token/epsilon.rb +4 -2
  21. data/lib/antelope/ace/token/error.rb +2 -0
  22. data/lib/antelope/ace/token/nonterminal.rb +2 -0
  23. data/lib/antelope/ace/token/terminal.rb +2 -0
  24. data/lib/antelope/ace/token.rb +2 -0
  25. data/lib/antelope/ace.rb +2 -0
  26. data/lib/antelope/cli.rb +2 -0
  27. data/lib/antelope/errors.rb +2 -0
  28. data/lib/antelope/generation/constructor/first.rb +2 -0
  29. data/lib/antelope/generation/constructor/follow.rb +5 -0
  30. data/lib/antelope/generation/constructor/nullable.rb +2 -0
  31. data/lib/antelope/generation/constructor.rb +2 -0
  32. data/lib/antelope/generation/errors.rb +2 -0
  33. data/lib/antelope/generation/recognizer/rule.rb +9 -0
  34. data/lib/antelope/generation/recognizer/state.rb +2 -0
  35. data/lib/antelope/generation/recognizer.rb +7 -2
  36. data/lib/antelope/generation/tableizer.rb +3 -2
  37. data/lib/antelope/generation.rb +2 -0
  38. data/lib/antelope/generator/output.rb +2 -0
  39. data/lib/antelope/generator/ruby.rb +2 -0
  40. data/lib/antelope/generator/templates/output.erb +21 -25
  41. data/lib/antelope/generator/templates/ruby.erb +1 -1
  42. data/lib/antelope/generator.rb +2 -0
  43. data/lib/antelope/version.rb +3 -1
  44. data/lib/antelope.rb +2 -0
  45. data/spec/antelope/ace/compiler_spec.rb +11 -1
  46. data/spec/antelope/constructor_spec.rb +127 -0
  47. data/spec/fixtures/simple.ace +22 -0
  48. data/spec/spec_helper.rb +1 -0
  49. data/spec/support/grammar_helper.rb +15 -0
  50. metadata +9 -4
  51. data/spec/antelope/automaton_spec.rb +0 -29
@@ -8,60 +8,6 @@ Productions:
8
8
  expression → "(" $error ")"
9
9
  $start → expression $
10
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
11
  Precedence:
66
12
  --- highest
67
13
  nonassoc 4:
@@ -76,112 +22,7 @@ Precedence:
76
22
  {$}
77
23
  --- lowest
78
24
 
79
- Table:
80
25
  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
-
182
-
183
- State 0:
184
- rules:
185
26
  0/n0: $start(0) → • expression(0:1) $
186
27
  {}
187
28
  1/n1: expression(0:1) → • NUMBER
@@ -198,73 +39,65 @@ State 0:
198
39
  {}
199
40
  7/n4: expression(0:1) → • "(" $error ")"
200
41
  {}
42
+ transitions:
43
+ expression: State 1
44
+ NUMBER: State 2
45
+ LPAREN: State 7
201
46
 
202
- transitions:
203
- expression: State 1
204
- NUMBER : State 2
205
- LPAREN : State 7
206
-
207
- State 1:
208
- rules:
209
- 87/n0: $start → expression • $
47
+ State 1:
48
+ 8/n0: $start → expression • $
210
49
  {}
211
- 88/l2: expression → expression • "+" expression
50
+ 83/l2: expression → expression • "+" expression
212
51
  {}
213
- 89/l2: expression → expression • "-" expression
52
+ 84/l2: expression → expression • "-" expression
214
53
  {}
215
- 90/l3: expression → expression • "*" expression
54
+ 85/l3: expression → expression • "*" expression
216
55
  {}
217
- 91/l3: expression → expression • "/" expression
56
+ 86/l3: expression → expression • "/" expression
218
57
  {}
58
+ transitions:
59
+ $: State 9
60
+ ADD: State 10
61
+ SUBTRACT: State 11
62
+ MULTIPLY: State 12
63
+ DIVIDE: State 13
219
64
 
220
- transitions:
221
- $ : State 9
222
- ADD : State 10
223
- SUBTRACT: State 11
224
- MULTIPLY: State 12
225
- DIVIDE : State 13
226
-
227
- State 2:
228
- rules:
65
+ State 2:
229
66
  13/n1: expression → NUMBER •
230
67
  {$, "+", "-", "*", "/", ")"}
68
+ reductions:
69
+ $: Rule 1
70
+ ADD: Rule 1
71
+ SUBTRACT: Rule 1
72
+ MULTIPLY: Rule 1
73
+ DIVIDE: Rule 1
74
+ RPAREN: Rule 1
231
75
 
232
- transitions:
233
-
234
- State 3:
235
- rules:
236
- 88/l2: expression → expression • "+" expression
76
+ State 3:
77
+ 83/l2: expression → expression • "+" expression
237
78
  {}
79
+ transitions:
80
+ ADD: State 10
238
81
 
239
- transitions:
240
- ADD: State 10
241
-
242
- State 4:
243
- rules:
244
- 89/l2: expression → expression • "-" expression
82
+ State 4:
83
+ 84/l2: expression → expression • "-" expression
245
84
  {}
85
+ transitions:
86
+ SUBTRACT: State 11
246
87
 
247
- transitions:
248
- SUBTRACT: State 11
249
-
250
- State 5:
251
- rules:
252
- 90/l3: expression → expression • "*" expression
88
+ State 5:
89
+ 85/l3: expression → expression • "*" expression
253
90
  {}
91
+ transitions:
92
+ MULTIPLY: State 12
254
93
 
255
- transitions:
256
- MULTIPLY: State 12
257
-
258
- State 6:
259
- rules:
260
- 91/l3: expression → expression • "/" expression
94
+ State 6:
95
+ 86/l3: expression → expression • "/" expression
261
96
  {}
97
+ transitions:
98
+ DIVIDE: State 13
262
99
 
263
- transitions:
264
- DIVIDE: State 13
265
-
266
- State 7:
267
- rules:
100
+ State 7:
268
101
  18/n4: expression → "(" • expression ")"
269
102
  {}
270
103
  19/n1: expression(7:14) → • NUMBER
@@ -283,30 +116,25 @@ State 7:
283
116
  {}
284
117
  27/n4: expression → "(" • $error ")"
285
118
  {}
119
+ transitions:
120
+ expression: State 14
121
+ NUMBER: State 2
122
+ LPAREN: State 7
123
+ $error: State 15
286
124
 
287
- transitions:
288
- expression: State 14
289
- NUMBER : State 2
290
- LPAREN : State 7
291
- $error : State 15
292
-
293
- State 8:
294
- rules:
125
+ State 8:
295
126
  27/n4: expression → "(" • $error ")"
296
127
  {}
128
+ transitions:
129
+ $error: State 15
297
130
 
298
- transitions:
299
- $error: State 15
300
-
301
- State 9:
302
- rules:
131
+ State 9:
303
132
  28/n0: $start → expression $ •
304
133
  {}
134
+ accepting:
135
+ $: Rule 0
305
136
 
306
- transitions:
307
-
308
- State 10:
309
- rules:
137
+ State 10:
310
138
  29/l2: expression → expression "+" • expression
311
139
  {}
312
140
  30/n1: expression(10:16) → • NUMBER
@@ -323,14 +151,12 @@ State 10:
323
151
  {}
324
152
  36/n4: expression(10:16) → • "(" $error ")"
325
153
  {}
154
+ transitions:
155
+ expression: State 16
156
+ NUMBER: State 2
157
+ LPAREN: State 7
326
158
 
327
- transitions:
328
- expression: State 16
329
- NUMBER : State 2
330
- LPAREN : State 7
331
-
332
- State 11:
333
- rules:
159
+ State 11:
334
160
  37/l2: expression → expression "-" • expression
335
161
  {}
336
162
  38/n1: expression(11:17) → • NUMBER
@@ -347,14 +173,12 @@ State 11:
347
173
  {}
348
174
  44/n4: expression(11:17) → • "(" $error ")"
349
175
  {}
176
+ transitions:
177
+ expression: State 17
178
+ NUMBER: State 2
179
+ LPAREN: State 7
350
180
 
351
- transitions:
352
- expression: State 17
353
- NUMBER : State 2
354
- LPAREN : State 7
355
-
356
- State 12:
357
- rules:
181
+ State 12:
358
182
  45/l3: expression → expression "*" • expression
359
183
  {}
360
184
  46/n1: expression(12:18) → • NUMBER
@@ -371,14 +195,12 @@ State 12:
371
195
  {}
372
196
  52/n4: expression(12:18) → • "(" $error ")"
373
197
  {}
198
+ transitions:
199
+ expression: State 18
200
+ NUMBER: State 2
201
+ LPAREN: State 7
374
202
 
375
- transitions:
376
- expression: State 18
377
- NUMBER : State 2
378
- LPAREN : State 7
379
-
380
- State 13:
381
- rules:
203
+ State 13:
382
204
  53/l3: expression → expression "/" • expression
383
205
  {}
384
206
  54/n1: expression(13:19) → • NUMBER
@@ -395,142 +217,132 @@ State 13:
395
217
  {}
396
218
  60/n4: expression(13:19) → • "(" $error ")"
397
219
  {}
220
+ transitions:
221
+ expression: State 19
222
+ NUMBER: State 2
223
+ LPAREN: State 7
398
224
 
399
- transitions:
400
- expression: State 19
401
- NUMBER : State 2
402
- LPAREN : State 7
403
-
404
- State 14:
405
- rules:
225
+ State 14:
406
226
  61/n4: expression → "(" expression • ")"
407
227
  {}
408
- 87/n0: $start → expression • $
228
+ 83/l2: expression → expression • "+" expression
409
229
  {}
410
- 88/l2: expression → expression • "+" expression
230
+ 84/l2: expression → expression • "-" expression
411
231
  {}
412
- 89/l2: expression → expression • "-" expression
232
+ 85/l3: expression → expression • "*" expression
413
233
  {}
414
- 90/l3: expression → expression • "*" expression
234
+ 86/l3: expression → expression • "/" expression
415
235
  {}
416
- 91/l3: expression → expression • "/" expression
417
- {}
418
-
419
- transitions:
420
- $ : State 9
421
- ADD : State 10
422
- SUBTRACT: State 11
423
- MULTIPLY: State 12
424
- DIVIDE : State 13
425
- RPAREN : State 20
236
+ transitions:
237
+ ADD: State 10
238
+ SUBTRACT: State 11
239
+ MULTIPLY: State 12
240
+ DIVIDE: State 13
241
+ RPAREN: State 20
426
242
 
427
- State 15:
428
- rules:
429
- 67/n4: expression → "(" $error • ")"
243
+ State 15:
244
+ 66/n4: expression → "(" $error • ")"
430
245
  {}
246
+ transitions:
247
+ RPAREN: State 21
431
248
 
432
- transitions:
433
- RPAREN: State 21
434
-
435
- State 16:
436
- rules:
437
- 68/l2: expression → expression "+" expression •
249
+ State 16:
250
+ 67/l2: expression → expression "+" expression •
438
251
  {$, "+", "-", "*", "/", ")"}
439
- 87/n0: $start → expression • $
252
+ 83/l2: expression → expression • "+" expression
440
253
  {}
441
- 88/l2: expression → expression • "+" expression
254
+ 84/l2: expression → expression • "-" expression
442
255
  {}
443
- 89/l2: expression → expression • "-" expression
256
+ 85/l3: expression → expression • "*" expression
444
257
  {}
445
- 90/l3: expression → expression • "*" expression
258
+ 86/l3: expression → expression • "/" expression
446
259
  {}
447
- 91/l3: expression → expression • "/" expression
448
- {}
449
-
450
- transitions:
451
- $ : State 9
452
- ADD : State 10
453
- SUBTRACT: State 11
454
- MULTIPLY: State 12
455
- DIVIDE : State 13
260
+ transitions:
261
+ MULTIPLY: State 12
262
+ DIVIDE: State 13
263
+ reductions:
264
+ ADD: Rule 2
265
+ SUBTRACT: Rule 2
266
+ $: Rule 2
267
+ RPAREN: Rule 2
456
268
 
457
- State 17:
458
- rules:
459
- 74/l2: expression → expression "-" expression •
269
+ State 17:
270
+ 72/l2: expression → expression "-" expression •
460
271
  {$, "+", "-", "*", "/", ")"}
461
- 87/n0: $start → expression • $
462
- {}
463
- 88/l2: expression → expression • "+" expression
272
+ 83/l2: expression → expression • "+" expression
464
273
  {}
465
- 89/l2: expression → expression • "-" expression
274
+ 84/l2: expression → expression • "-" expression
466
275
  {}
467
- 90/l3: expression → expression • "*" expression
276
+ 85/l3: expression → expression • "*" expression
468
277
  {}
469
- 91/l3: expression → expression • "/" expression
278
+ 86/l3: expression → expression • "/" expression
470
279
  {}
280
+ transitions:
281
+ MULTIPLY: State 12
282
+ DIVIDE: State 13
283
+ reductions:
284
+ ADD: Rule 3
285
+ SUBTRACT: Rule 3
286
+ $: Rule 3
287
+ RPAREN: Rule 3
471
288
 
472
- transitions:
473
- $ : State 9
474
- ADD : State 10
475
- SUBTRACT: State 11
476
- MULTIPLY: State 12
477
- DIVIDE : State 13
478
-
479
- State 18:
480
- rules:
481
- 80/l3: expression → expression "*" expression •
289
+ State 18:
290
+ 77/l3: expression → expression "*" expression •
482
291
  {$, "+", "-", "*", "/", ")"}
483
- 87/n0: $start → expression • $
292
+ 83/l2: expression → expression • "+" expression
484
293
  {}
485
- 88/l2: expression → expression • "+" expression
294
+ 84/l2: expression → expression • "-" expression
486
295
  {}
487
- 89/l2: expression → expression • "-" expression
296
+ 85/l3: expression → expression • "*" expression
488
297
  {}
489
- 90/l3: expression → expression • "*" expression
298
+ 86/l3: expression → expression • "/" expression
490
299
  {}
491
- 91/l3: expression → expression • "/" expression
492
- {}
493
-
494
- transitions:
495
- $ : State 9
496
- ADD : State 10
497
- SUBTRACT: State 11
498
- MULTIPLY: State 12
499
- DIVIDE : State 13
300
+ reductions:
301
+ ADD: Rule 4
302
+ SUBTRACT: Rule 4
303
+ MULTIPLY: Rule 4
304
+ DIVIDE: Rule 4
305
+ $: Rule 4
306
+ RPAREN: Rule 4
500
307
 
501
- State 19:
502
- rules:
503
- 86/l3: expression → expression "/" expression •
308
+ State 19:
309
+ 82/l3: expression → expression "/" expression •
504
310
  {$, "+", "-", "*", "/", ")"}
505
- 87/n0: $start → expression • $
311
+ 83/l2: expression → expression • "+" expression
506
312
  {}
507
- 88/l2: expression → expression • "+" expression
313
+ 84/l2: expression → expression • "-" expression
508
314
  {}
509
- 89/l2: expression → expression • "-" expression
315
+ 85/l3: expression → expression • "*" expression
510
316
  {}
511
- 90/l3: expression → expression • "*" expression
317
+ 86/l3: expression → expression • "/" expression
512
318
  {}
513
- 91/l3: expression → expression • "/" expression
514
- {}
515
-
516
- transitions:
517
- $ : State 9
518
- ADD : State 10
519
- SUBTRACT: State 11
520
- MULTIPLY: State 12
521
- DIVIDE : State 13
319
+ reductions:
320
+ ADD: Rule 5
321
+ SUBTRACT: Rule 5
322
+ MULTIPLY: Rule 5
323
+ DIVIDE: Rule 5
324
+ $: Rule 5
325
+ RPAREN: Rule 5
522
326
 
523
- State 20:
524
- rules:
525
- 92/n4: expression → "(" expression ")" •
327
+ State 20:
328
+ 87/n4: expression → "(" expression ")" •
526
329
  {$, "+", "-", "*", "/", ")"}
330
+ reductions:
331
+ $: Rule 6
332
+ ADD: Rule 6
333
+ SUBTRACT: Rule 6
334
+ MULTIPLY: Rule 6
335
+ DIVIDE: Rule 6
336
+ RPAREN: Rule 6
527
337
 
528
- transitions:
529
-
530
- State 21:
531
- rules:
532
- 93/n4: expression → "(" $error ")" •
338
+ State 21:
339
+ 88/n4: expression → "(" $error ")" •
533
340
  {$, "+", "-", "*", "/", ")"}
534
-
535
- transitions:
341
+ reductions:
342
+ $: Rule 7
343
+ ADD: Rule 7
344
+ SUBTRACT: Rule 7
345
+ MULTIPLY: Rule 7
346
+ DIVIDE: Rule 7
347
+ RPAREN: Rule 7
536
348