depager 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. data/ChangeLog +4 -0
  2. data/README.ja +27 -28
  3. data/examples/c89/c89.dr +34 -34
  4. data/examples/c89/c89.tab.rb +3074 -3074
  5. data/examples/extension/paction.dr +4 -4
  6. data/examples/extension/pactiontest.dr +1 -1
  7. data/examples/pl0d/pl0ds.dr +27 -27
  8. data/examples/pl0d/pl0ds.tab.rb +626 -643
  9. data/examples/sample_calc/calc.action.dr +6 -6
  10. data/examples/sample_calc/calc.action.tab.rb +90 -90
  11. data/examples/sample_calc/calc.ast.action.dr +7 -7
  12. data/examples/sample_calc/calc.ast.action.tab.rb +121 -127
  13. data/examples/sample_calc/calc.ast.dr +6 -6
  14. data/examples/sample_calc/calc.ast.tab.rb +102 -109
  15. data/examples/sample_calc/calc.astdf.dr +6 -6
  16. data/examples/sample_calc/calc.astdf.tab.rb +102 -109
  17. data/examples/sample_calc/calc.atree.dr +6 -6
  18. data/examples/sample_calc/calc.atree.tab.rb +90 -90
  19. data/examples/sample_calc/calc.cst.dr +5 -5
  20. data/examples/sample_calc/calc.cst.tab.rb +106 -106
  21. data/examples/sample_calc/calc.dr +1 -1
  22. data/examples/sample_calc/calc.lex.dr +4 -4
  23. data/examples/sample_calc/calc.lex.tab.rb +73 -73
  24. data/examples/sample_calc/calc.nvaction.dr +6 -6
  25. data/examples/sample_calc/calc.nvaction.tab.rb +90 -90
  26. data/examples/sample_calc/calc.tab.rb +71 -71
  27. data/examples/sample_calc/calc_prec.nvaction.dr +6 -6
  28. data/examples/sample_calc/calc_prec.nvaction.tab.rb +46 -46
  29. data/examples/slex_test/divreg.slex.dr +7 -7
  30. data/examples/slex_test/divreg.slex.tab.rb +20 -20
  31. data/examples/slex_test/ljoin.slex.dr +7 -7
  32. data/examples/slex_test/ljoin.slex.tab.rb +15 -15
  33. data/lib/depager.rb +45 -83
  34. data/lib/depager/grammar.rb +3 -7
  35. data/lib/depager/lr.rb +123 -1
  36. data/lib/depager/parser.rb +29 -48
  37. data/lib/depager/{template/ast.erbs → ruby/plugins/_ast_tmpl.rb} +11 -7
  38. data/lib/depager/{action.rb → ruby/plugins/action.rb} +7 -11
  39. data/lib/depager/{ast.dr → ruby/plugins/ast.dr} +24 -25
  40. data/lib/depager/{ast.rb → ruby/plugins/ast.rb} +241 -243
  41. data/lib/depager/{astdf.rb → ruby/plugins/astdf.rb} +1 -2
  42. data/lib/depager/{atree.dr → ruby/plugins/atree.dr} +5 -5
  43. data/lib/depager/{atree.rb → ruby/plugins/atree.rb} +39 -39
  44. data/lib/depager/{cst.dr → ruby/plugins/cst.dr} +17 -21
  45. data/lib/depager/{cst.rb → ruby/plugins/cst.rb} +62 -68
  46. data/lib/depager/{lex.dr → ruby/plugins/lex.dr} +3 -4
  47. data/lib/depager/{lex.rb → ruby/plugins/lex.rb} +29 -31
  48. data/lib/depager/{nvaction.rb → ruby/plugins/nvaction.rb} +1 -3
  49. data/lib/depager/{slex.dr → ruby/plugins/slex.dr} +16 -17
  50. data/lib/depager/{slex.rb → ruby/plugins/slex.rb} +115 -117
  51. data/lib/depager/{srp.rb → ruby/plugins/srp.rb} +4 -4
  52. data/lib/depager/{template → ruby/templates}/extension_lalr_master.erb +6 -6
  53. data/lib/depager/{template → ruby/templates}/extension_lalr_slave.erb +0 -0
  54. data/lib/depager/{template → ruby/templates}/simple.erb +0 -0
  55. data/lib/depager/{template → ruby/templates}/single_lalr_parser.erb +0 -0
  56. data/lib/depager/utils.rb +30 -69
  57. data/lib/depager/version.rb +1 -1
  58. metadata +59 -56
  59. data/examples/Rakefile +0 -36
  60. data/lib/depager/Rakefile +0 -34
  61. data/lib/depager/lr_put_table.rb +0 -116
  62. data/lib/depager/parse_action.rb +0 -24
@@ -24,8 +24,8 @@ class TinyCalc < Depager::LALR::Basis
24
24
  ]
25
25
  ### Extension Params
26
26
  nparams = {
27
- 'ASTBuilder' => 2,
28
27
  'Action' => 3,
28
+ 'ASTBuilder' => 2,
29
29
  }
30
30
  ### Term to Int
31
31
  t2i = {
@@ -53,25 +53,26 @@ class TinyCalc < Depager::LALR::Basis
53
53
  ]
54
54
  ### Action Table
55
55
  action_table = [
56
- [ nil, nil, nil, nil, nil, nil, 4, 5, nil, ],
57
- [ ACC, nil, 6, 7, nil, nil, nil, nil, nil, ],
58
- [ nil, nil, nil, nil, 8, 9, nil, nil, nil, ],
56
+ [ nil, nil, nil, nil, nil, nil, 5, 1, nil, ],
57
+ [ nil, nil, nil, nil, nil, nil, 5, 1, nil, ],
58
+ [ ACC, nil, 7, 8, nil, nil, nil, nil, nil, ],
59
+ [ nil, nil, nil, nil, 9, 10, nil, nil, nil, ],
59
60
  [ nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
60
61
  [ nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
61
- [ nil, nil, nil, nil, nil, nil, 4, 5, nil, ],
62
- [ nil, nil, nil, nil, nil, nil, 4, 5, nil, ],
63
- [ nil, nil, nil, nil, nil, nil, 4, 5, nil, ],
64
- [ nil, nil, nil, nil, nil, nil, 4, 5, nil, ],
65
- [ nil, nil, nil, nil, nil, nil, 4, 5, nil, ],
66
- [ nil, nil, 6, 7, nil, nil, nil, nil, 15, ],
67
- [ nil, nil, nil, nil, 8, 9, nil, nil, nil, ],
68
- [ nil, nil, nil, nil, 8, 9, nil, nil, nil, ],
62
+ [ nil, nil, 7, 8, nil, nil, nil, nil, 11, ],
63
+ [ nil, nil, nil, nil, nil, nil, 5, 1, nil, ],
64
+ [ nil, nil, nil, nil, nil, nil, 5, 1, nil, ],
65
+ [ nil, nil, nil, nil, nil, nil, 5, 1, nil, ],
66
+ [ nil, nil, nil, nil, nil, nil, 5, 1, nil, ],
69
67
  [ nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
68
+ [ nil, nil, nil, nil, 9, 10, nil, nil, nil, ],
69
+ [ nil, nil, nil, nil, 9, 10, nil, nil, nil, ],
70
70
  [ nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
71
71
  [ nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
72
72
  ]
73
73
  ### Default Reduce Table
74
74
  defred_table = [
75
+ nil,
75
76
  nil,
76
77
  nil,
77
78
  -3,
@@ -82,17 +83,17 @@ class TinyCalc < Depager::LALR::Basis
82
83
  nil,
83
84
  nil,
84
85
  nil,
85
- nil,
86
+ -8,
86
87
  -1,
87
88
  -2,
88
89
  -4,
89
90
  -5,
90
- -8,
91
91
  ]
92
92
  defred_after_shift_table = [
93
93
  nil,
94
94
  nil,
95
95
  nil,
96
+ nil,
96
97
  -6,
97
98
  -7,
98
99
  nil,
@@ -100,12 +101,11 @@ class TinyCalc < Depager::LALR::Basis
100
101
  nil,
101
102
  nil,
102
103
  nil,
103
- nil,
104
+ -8,
104
105
  nil,
105
106
  nil,
106
107
  -4,
107
108
  -5,
108
- -8,
109
109
  ]
110
110
  ### Nonterm to Int
111
111
  nt2i = {
@@ -121,17 +121,17 @@ class TinyCalc < Depager::LALR::Basis
121
121
  ]
122
122
  ### Goto Table
123
123
  goto_table = [
124
- [ 1, 2, 3, ],
124
+ [ 2, 3, 4, ],
125
+ [ 6, 3, 4, ],
125
126
  [ nil, nil, nil, ],
126
127
  [ nil, nil, nil, ],
127
128
  [ nil, nil, nil, ],
128
129
  [ nil, nil, nil, ],
129
- [ 10, 2, 3, ],
130
- [ nil, 11, 3, ],
131
- [ nil, 12, 3, ],
132
- [ nil, nil, 13, ],
133
- [ nil, nil, 14, ],
134
130
  [ nil, nil, nil, ],
131
+ [ nil, 12, 4, ],
132
+ [ nil, 13, 4, ],
133
+ [ nil, nil, 14, ],
134
+ [ nil, nil, 15, ],
135
135
  [ nil, nil, nil, ],
136
136
  [ nil, nil, nil, ],
137
137
  [ nil, nil, nil, ],
@@ -152,20 +152,30 @@ class TinyCalc < Depager::LALR::Basis
152
152
  I000 =
153
153
  ( 0) $start : _ expr
154
154
 
155
- NUM shift, and goto to state 4
156
- '(' shift, and goto to state 5
155
+ NUM shift, and goto to state 5
156
+ '(' shift, and goto to state 1
157
157
 
158
158
 
159
159
  ----------
160
160
 
161
161
  <<'----------',
162
162
  I001 =
163
+ ( 8) fact : '(' _ expr ')'
164
+
165
+ NUM shift, and goto to state 5
166
+ '(' shift, and goto to state 1
167
+
168
+
169
+ ----------
170
+
171
+ <<'----------',
172
+ I002 =
163
173
  ( 0) $start : expr _
164
174
  ( 1) expr : expr _ '+' term
165
175
  ( 2) expr : expr _ '-' term
166
176
 
167
- '+' shift, and goto to state 6
168
- '-' shift, and goto to state 7
177
+ '+' shift, and goto to state 7
178
+ '-' shift, and goto to state 8
169
179
 
170
180
 
171
181
  $end accept
@@ -173,20 +183,20 @@ I001 =
173
183
  ----------
174
184
 
175
185
  <<'----------',
176
- I002 =
186
+ I003 =
177
187
  ( 3) expr : term _
178
188
  ( 4) term : term _ '*' fact
179
189
  ( 5) term : term _ '/' fact
180
190
 
181
- '*' shift, and goto to state 8
182
- '/' shift, and goto to state 9
191
+ '*' shift, and goto to state 9
192
+ '/' shift, and goto to state 10
183
193
 
184
194
  $default reduce using rule 3 (expr)
185
195
 
186
196
  ----------
187
197
 
188
198
  <<'----------',
189
- I003 =
199
+ I004 =
190
200
  ( 6) term : fact _
191
201
 
192
202
 
@@ -195,7 +205,7 @@ I003 =
195
205
  ----------
196
206
 
197
207
  <<'----------',
198
- I004 =
208
+ I005 =
199
209
  ( 7) fact : NUM _
200
210
 
201
211
 
@@ -204,96 +214,95 @@ I004 =
204
214
  ----------
205
215
 
206
216
  <<'----------',
207
- I005 =
208
- ( 8) fact : '(' _ expr ')'
217
+ I006 =
218
+ ( 8) fact : '(' expr _ ')'
219
+ ( 1) expr : expr _ '+' term
220
+ ( 2) expr : expr _ '-' term
209
221
 
210
- NUM shift, and goto to state 4
211
- '(' shift, and goto to state 5
222
+ '+' shift, and goto to state 7
223
+ '-' shift, and goto to state 8
224
+ ')' shift, and goto to state 11
212
225
 
213
226
 
214
227
  ----------
215
228
 
216
229
  <<'----------',
217
- I006 =
230
+ I007 =
218
231
  ( 1) expr : expr '+' _ term
219
232
 
220
- NUM shift, and goto to state 4
221
- '(' shift, and goto to state 5
233
+ NUM shift, and goto to state 5
234
+ '(' shift, and goto to state 1
222
235
 
223
236
 
224
237
  ----------
225
238
 
226
239
  <<'----------',
227
- I007 =
240
+ I008 =
228
241
  ( 2) expr : expr '-' _ term
229
242
 
230
- NUM shift, and goto to state 4
231
- '(' shift, and goto to state 5
243
+ NUM shift, and goto to state 5
244
+ '(' shift, and goto to state 1
232
245
 
233
246
 
234
247
  ----------
235
248
 
236
249
  <<'----------',
237
- I008 =
250
+ I009 =
238
251
  ( 4) term : term '*' _ fact
239
252
 
240
- NUM shift, and goto to state 4
241
- '(' shift, and goto to state 5
253
+ NUM shift, and goto to state 5
254
+ '(' shift, and goto to state 1
242
255
 
243
256
 
244
257
  ----------
245
258
 
246
259
  <<'----------',
247
- I009 =
260
+ I010 =
248
261
  ( 5) term : term '/' _ fact
249
262
 
250
- NUM shift, and goto to state 4
251
- '(' shift, and goto to state 5
263
+ NUM shift, and goto to state 5
264
+ '(' shift, and goto to state 1
252
265
 
253
266
 
254
267
  ----------
255
268
 
256
269
  <<'----------',
257
- I010 =
258
- ( 8) fact : '(' expr _ ')'
259
- ( 1) expr : expr _ '+' term
260
- ( 2) expr : expr _ '-' term
270
+ I011 =
271
+ ( 8) fact : '(' expr ')' _
261
272
 
262
- '+' shift, and goto to state 6
263
- '-' shift, and goto to state 7
264
- ')' shift, and goto to state 15
265
273
 
274
+ $default reduce using rule 8 (fact) [after shift]
266
275
 
267
276
  ----------
268
277
 
269
278
  <<'----------',
270
- I011 =
279
+ I012 =
271
280
  ( 1) expr : expr '+' term _
272
281
  ( 4) term : term _ '*' fact
273
282
  ( 5) term : term _ '/' fact
274
283
 
275
- '*' shift, and goto to state 8
276
- '/' shift, and goto to state 9
284
+ '*' shift, and goto to state 9
285
+ '/' shift, and goto to state 10
277
286
 
278
287
  $default reduce using rule 1 (expr)
279
288
 
280
289
  ----------
281
290
 
282
291
  <<'----------',
283
- I012 =
292
+ I013 =
284
293
  ( 2) expr : expr '-' term _
285
294
  ( 4) term : term _ '*' fact
286
295
  ( 5) term : term _ '/' fact
287
296
 
288
- '*' shift, and goto to state 8
289
- '/' shift, and goto to state 9
297
+ '*' shift, and goto to state 9
298
+ '/' shift, and goto to state 10
290
299
 
291
300
  $default reduce using rule 2 (expr)
292
301
 
293
302
  ----------
294
303
 
295
304
  <<'----------',
296
- I013 =
305
+ I014 =
297
306
  ( 4) term : term '*' fact _
298
307
 
299
308
 
@@ -302,21 +311,12 @@ I013 =
302
311
  ----------
303
312
 
304
313
  <<'----------',
305
- I014 =
314
+ I015 =
306
315
  ( 5) term : term '/' fact _
307
316
 
308
317
 
309
318
  $default reduce using rule 5 (term) [after shift]
310
319
 
311
- ----------
312
-
313
- <<'----------',
314
- I015 =
315
- ( 8) fact : '(' expr ')' _
316
-
317
-
318
- $default reduce using rule 8 (fact) [after shift]
319
-
320
320
  ----------
321
321
  ]
322
322
 
@@ -343,12 +343,12 @@ I015 =
343
343
 
344
344
  when /\A[1-9][0-9]*/
345
345
  @oldline = @line; @line = $'
346
- yield _Token(:NUM, $&.to_i)
346
+ yield token(:NUM, $&.to_i)
347
347
 
348
348
 
349
349
  when /\A./
350
350
  @oldline = @line; @line = $'
351
- yield _Token($&, $&)
351
+ yield token($&, $&)
352
352
 
353
353
 
354
354
  else
@@ -362,7 +362,6 @@ I015 =
362
362
  end
363
363
 
364
364
  ### Outer Code
365
-
366
365
  class Node
367
366
  attr_accessor :lineno
368
367
  attr_accessor :value
@@ -419,8 +418,6 @@ class NilNode
419
418
  def accept v
420
419
  end
421
420
  end
422
-
423
-
424
421
  class Node_add < Node
425
422
  attr_accessor :left, :right
426
423
  attr_accessor
@@ -439,7 +436,6 @@ class Node_add < Node
439
436
  self
440
437
  end
441
438
  end
442
-
443
439
  class Node_sub < Node
444
440
  attr_accessor :left, :right
445
441
  attr_accessor
@@ -458,7 +454,6 @@ class Node_sub < Node
458
454
  self
459
455
  end
460
456
  end
461
-
462
457
  class Node_mul < Node
463
458
  attr_accessor :left, :right
464
459
  attr_accessor
@@ -477,7 +472,6 @@ class Node_mul < Node
477
472
  self
478
473
  end
479
474
  end
480
-
481
475
  class Node_div < Node
482
476
  attr_accessor :left, :right
483
477
  attr_accessor
@@ -496,7 +490,6 @@ class Node_div < Node
496
490
  self
497
491
  end
498
492
  end
499
-
500
493
  class Node_literal < Node
501
494
  attr_accessor :n
502
495
  attr_accessor :n
@@ -520,12 +513,12 @@ end
520
513
  node.accept(self)
521
514
  end
522
515
 
523
- module_eval <<-'.,.,120998293133008.,.,', 'sample_calc/calc.ast.action.dr', 19
516
+ module_eval <<-'.,.,122745803836640.,.,', 'sample_calc/calc.ast.action.dr', 19
524
517
 
525
518
 
526
- .,.,120998293133008.,.,
519
+ .,.,122745803836640.,.,
527
520
 
528
- module_eval <<-'.,.,120998293117496.,.,', 'sample_calc/calc.ast.action.dr', 19
521
+ module_eval <<-'.,.,122745803860945.,.,', 'sample_calc/calc.ast.action.dr', 19
529
522
  def visit_Node_add node
530
523
  node.value = visit(node.left).value + visit(node.right).value
531
524
 
@@ -534,9 +527,9 @@ def visit_Node_add node
534
527
  raise
535
528
 
536
529
  end
537
- .,.,120998293117496.,.,
530
+ .,.,122745803860945.,.,
538
531
 
539
- module_eval <<-'.,.,120998293117798.,.,', 'sample_calc/calc.ast.action.dr', 20
532
+ module_eval <<-'.,.,122745803823377.,.,', 'sample_calc/calc.ast.action.dr', 20
540
533
  def visit_Node_sub node
541
534
  node.value = visit(node.left).value - visit(node.right).value
542
535
 
@@ -545,9 +538,9 @@ def visit_Node_sub node
545
538
  raise
546
539
 
547
540
  end
548
- .,.,120998293117798.,.,
541
+ .,.,122745803823377.,.,
549
542
 
550
- module_eval <<-'.,.,120998293122558.,.,', 'sample_calc/calc.ast.action.dr', 21
543
+ module_eval <<-'.,.,12274580385321.,.,', 'sample_calc/calc.ast.action.dr', 21
551
544
  def visit_Node_mul node
552
545
  node.value = visit(node.left).value * visit(node.right).value
553
546
 
@@ -556,9 +549,9 @@ def visit_Node_mul node
556
549
  raise
557
550
 
558
551
  end
559
- .,.,120998293122558.,.,
552
+ .,.,12274580385321.,.,
560
553
 
561
- module_eval <<-'.,.,120998293153267.,.,', 'sample_calc/calc.ast.action.dr', 22
554
+ module_eval <<-'.,.,12274580389451.,.,', 'sample_calc/calc.ast.action.dr', 22
562
555
  def visit_Node_div node
563
556
  node.value = visit(node.left).value / visit(node.right).value
564
557
 
@@ -567,9 +560,9 @@ def visit_Node_div node
567
560
  raise
568
561
 
569
562
  end
570
- .,.,120998293153267.,.,
563
+ .,.,12274580389451.,.,
571
564
 
572
- module_eval <<-'.,.,12099829314264.,.,', 'sample_calc/calc.ast.action.dr', 23
565
+ module_eval <<-'.,.,122745803835690.,.,', 'sample_calc/calc.ast.action.dr', 23
573
566
  def visit_Node_literal node
574
567
  node.value = node.n.value
575
568
 
@@ -578,13 +571,13 @@ def visit_Node_literal node
578
571
  raise
579
572
 
580
573
  end
581
- .,.,12099829314264.,.,
574
+ .,.,122745803835690.,.,
582
575
 
583
576
  end
584
577
 
585
578
  class D4TinyCalc::ASTBuilder < Depager::LALR::Action #:nodoc:all
586
579
  include Depager::DecoratorUtils
587
- []
580
+
588
581
  on_reduce = [
589
582
  nil,
590
583
  :_ast_0,
@@ -605,59 +598,60 @@ class D4TinyCalc::ASTBuilder < Depager::LALR::Action #:nodoc:all
605
598
  end
606
599
 
607
600
 
608
- module_eval <<-'.,.,120998293152228.,.,', 'sample_calc/calc.ast.action.dr', 29
601
+ module_eval <<-'.,.,122745803840943.,.,', 'sample_calc/calc.ast.action.dr', 29
609
602
  def _ast_0 val
610
603
  Node_add.new(val[0].lineno, val[0], val[2])
611
604
  end
612
- .,.,120998293152228.,.,
605
+ .,.,122745803840943.,.,
613
606
 
614
- module_eval <<-'.,.,120998293150297.,.,', 'sample_calc/calc.ast.action.dr', 32
607
+ module_eval <<-'.,.,122745803849112.,.,', 'sample_calc/calc.ast.action.dr', 32
615
608
  def _ast_1 val
616
609
  Node_sub.new(val[0].lineno, val[0], val[2])
617
610
  end
618
- .,.,120998293150297.,.,
611
+ .,.,122745803849112.,.,
619
612
 
620
- module_eval <<-'.,.,120998293136559.,.,', 'sample_calc/calc.ast.action.dr', 35
613
+ module_eval <<-'.,.,122745803812666.,.,', 'sample_calc/calc.ast.action.dr', 35
621
614
  def _ast_2 val
622
615
  val[0]
623
616
  end
624
- .,.,120998293136559.,.,
617
+ .,.,122745803812666.,.,
625
618
 
626
- module_eval <<-'.,.,120998293148223.,.,', 'sample_calc/calc.ast.action.dr', 40
619
+ module_eval <<-'.,.,122745803828835.,.,', 'sample_calc/calc.ast.action.dr', 40
627
620
  def _ast_3 val
628
621
  Node_mul.new(val[0].lineno, val[0], val[2])
629
622
  end
630
- .,.,120998293148223.,.,
623
+ .,.,122745803828835.,.,
631
624
 
632
- module_eval <<-'.,.,120998293116882.,.,', 'sample_calc/calc.ast.action.dr', 43
625
+ module_eval <<-'.,.,122745803856208.,.,', 'sample_calc/calc.ast.action.dr', 43
633
626
  def _ast_4 val
634
627
  Node_div.new(val[0].lineno, val[0], val[2])
635
628
  end
636
- .,.,120998293116882.,.,
629
+ .,.,122745803856208.,.,
637
630
 
638
- module_eval <<-'.,.,120998293121576.,.,', 'sample_calc/calc.ast.action.dr', 46
631
+ module_eval <<-'.,.,122745803842081.,.,', 'sample_calc/calc.ast.action.dr', 46
639
632
  def _ast_5 val
640
633
  val[0]
641
634
  end
642
- .,.,120998293121576.,.,
635
+ .,.,122745803842081.,.,
643
636
 
644
- module_eval <<-'.,.,120998293134763.,.,', 'sample_calc/calc.ast.action.dr', 51
637
+ module_eval <<-'.,.,122745803820842.,.,', 'sample_calc/calc.ast.action.dr', 51
645
638
  def _ast_6 val
646
639
  Node_literal.new(val[0].lineno, val[0])
647
640
  end
648
- .,.,120998293134763.,.,
641
+ .,.,122745803820842.,.,
649
642
 
650
- module_eval <<-'.,.,120998293114095.,.,', 'sample_calc/calc.ast.action.dr', 54
643
+ module_eval <<-'.,.,122745803861388.,.,', 'sample_calc/calc.ast.action.dr', 54
651
644
  def _ast_7 val
652
645
  val[1]
653
646
  end
654
- .,.,120998293114095.,.,
647
+ .,.,122745803861388.,.,
655
648
 
656
649
  end
657
650
 
658
651
  class D4TinyCalc::Action < Depager::LALR::Action #:nodoc:all
659
652
  include Depager::DecoratorUtils
660
- [" include Depager\n"]
653
+ include Depager
654
+
661
655
  on_reduce = [
662
656
  nil,
663
657
  :_act_0,
@@ -678,61 +672,61 @@ class D4TinyCalc::Action < Depager::LALR::Action #:nodoc:all
678
672
  end
679
673
 
680
674
 
681
- module_eval <<-'.,.,120998293112277.,.,', 'sample_calc/calc.ast.action.dr', 30
675
+ module_eval <<-'.,.,122745803844148.,.,', 'sample_calc/calc.ast.action.dr', 30
682
676
  def _act_0 val
683
677
  val[0] + val[2]
684
678
 
685
679
  end
686
- .,.,120998293112277.,.,
680
+ .,.,122745803844148.,.,
687
681
 
688
- module_eval <<-'.,.,12099829311590.,.,', 'sample_calc/calc.ast.action.dr', 33
682
+ module_eval <<-'.,.,122745803845543.,.,', 'sample_calc/calc.ast.action.dr', 33
689
683
  def _act_1 val
690
684
  val[0] - val[2]
691
685
 
692
686
  end
693
- .,.,12099829311590.,.,
687
+ .,.,122745803845543.,.,
694
688
 
695
- module_eval <<-'.,.,120998293160717.,.,', 'sample_calc/calc.ast.action.dr', 36
689
+ module_eval <<-'.,.,122745803827764.,.,', 'sample_calc/calc.ast.action.dr', 36
696
690
  def _act_2 val
697
691
  val[0]
698
692
 
699
693
  end
700
- .,.,120998293160717.,.,
694
+ .,.,122745803827764.,.,
701
695
 
702
- module_eval <<-'.,.,120998293161791.,.,', 'sample_calc/calc.ast.action.dr', 41
696
+ module_eval <<-'.,.,122745803817369.,.,', 'sample_calc/calc.ast.action.dr', 41
703
697
  def _act_3 val
704
698
  val[0] * val[2]
705
699
 
706
700
  end
707
- .,.,120998293161791.,.,
701
+ .,.,122745803817369.,.,
708
702
 
709
- module_eval <<-'.,.,120998293126570.,.,', 'sample_calc/calc.ast.action.dr', 44
703
+ module_eval <<-'.,.,122745803812.,.,', 'sample_calc/calc.ast.action.dr', 44
710
704
  def _act_4 val
711
705
  val[0] / val[2]
712
706
 
713
707
  end
714
- .,.,120998293126570.,.,
708
+ .,.,122745803812.,.,
715
709
 
716
- module_eval <<-'.,.,120998293164676.,.,', 'sample_calc/calc.ast.action.dr', 47
710
+ module_eval <<-'.,.,122745803822872.,.,', 'sample_calc/calc.ast.action.dr', 47
717
711
  def _act_5 val
718
712
  val[0]
719
713
 
720
714
  end
721
- .,.,120998293164676.,.,
715
+ .,.,122745803822872.,.,
722
716
 
723
- module_eval <<-'.,.,120998293119648.,.,', 'sample_calc/calc.ast.action.dr', 52
717
+ module_eval <<-'.,.,12274580385526.,.,', 'sample_calc/calc.ast.action.dr', 52
724
718
  def _act_6 val
725
719
  val[0].value
726
720
 
727
721
  end
728
- .,.,120998293119648.,.,
722
+ .,.,12274580385526.,.,
729
723
 
730
- module_eval <<-'.,.,120998293146539.,.,', 'sample_calc/calc.ast.action.dr', 55
724
+ module_eval <<-'.,.,122745803860083.,.,', 'sample_calc/calc.ast.action.dr', 55
731
725
  def _act_7 val
732
726
  val[1].value
733
727
 
734
728
  end
735
- .,.,120998293146539.,.,
729
+ .,.,122745803860083.,.,
736
730
 
737
731
  end
738
732
 
@@ -746,7 +740,7 @@ if __FILE__ == $0
746
740
  ### Main Code
747
741
  require 'pp'
748
742
  parser = createDecoratedTinyCalc()
749
- t, r = parser.yyparse(STDIN)
743
+ t, r = parser.parse(STDIN)
750
744
  v = Visitor.new
751
745
  pp r
752
746
  pp t.accept(v).value