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.
- data/ChangeLog +4 -0
- data/README.ja +27 -28
- data/examples/c89/c89.dr +34 -34
- data/examples/c89/c89.tab.rb +3074 -3074
- data/examples/extension/paction.dr +4 -4
- data/examples/extension/pactiontest.dr +1 -1
- data/examples/pl0d/pl0ds.dr +27 -27
- data/examples/pl0d/pl0ds.tab.rb +626 -643
- data/examples/sample_calc/calc.action.dr +6 -6
- data/examples/sample_calc/calc.action.tab.rb +90 -90
- data/examples/sample_calc/calc.ast.action.dr +7 -7
- data/examples/sample_calc/calc.ast.action.tab.rb +121 -127
- data/examples/sample_calc/calc.ast.dr +6 -6
- data/examples/sample_calc/calc.ast.tab.rb +102 -109
- data/examples/sample_calc/calc.astdf.dr +6 -6
- data/examples/sample_calc/calc.astdf.tab.rb +102 -109
- data/examples/sample_calc/calc.atree.dr +6 -6
- data/examples/sample_calc/calc.atree.tab.rb +90 -90
- data/examples/sample_calc/calc.cst.dr +5 -5
- data/examples/sample_calc/calc.cst.tab.rb +106 -106
- data/examples/sample_calc/calc.dr +1 -1
- data/examples/sample_calc/calc.lex.dr +4 -4
- data/examples/sample_calc/calc.lex.tab.rb +73 -73
- data/examples/sample_calc/calc.nvaction.dr +6 -6
- data/examples/sample_calc/calc.nvaction.tab.rb +90 -90
- data/examples/sample_calc/calc.tab.rb +71 -71
- data/examples/sample_calc/calc_prec.nvaction.dr +6 -6
- data/examples/sample_calc/calc_prec.nvaction.tab.rb +46 -46
- data/examples/slex_test/divreg.slex.dr +7 -7
- data/examples/slex_test/divreg.slex.tab.rb +20 -20
- data/examples/slex_test/ljoin.slex.dr +7 -7
- data/examples/slex_test/ljoin.slex.tab.rb +15 -15
- data/lib/depager.rb +45 -83
- data/lib/depager/grammar.rb +3 -7
- data/lib/depager/lr.rb +123 -1
- data/lib/depager/parser.rb +29 -48
- data/lib/depager/{template/ast.erbs → ruby/plugins/_ast_tmpl.rb} +11 -7
- data/lib/depager/{action.rb → ruby/plugins/action.rb} +7 -11
- data/lib/depager/{ast.dr → ruby/plugins/ast.dr} +24 -25
- data/lib/depager/{ast.rb → ruby/plugins/ast.rb} +241 -243
- data/lib/depager/{astdf.rb → ruby/plugins/astdf.rb} +1 -2
- data/lib/depager/{atree.dr → ruby/plugins/atree.dr} +5 -5
- data/lib/depager/{atree.rb → ruby/plugins/atree.rb} +39 -39
- data/lib/depager/{cst.dr → ruby/plugins/cst.dr} +17 -21
- data/lib/depager/{cst.rb → ruby/plugins/cst.rb} +62 -68
- data/lib/depager/{lex.dr → ruby/plugins/lex.dr} +3 -4
- data/lib/depager/{lex.rb → ruby/plugins/lex.rb} +29 -31
- data/lib/depager/{nvaction.rb → ruby/plugins/nvaction.rb} +1 -3
- data/lib/depager/{slex.dr → ruby/plugins/slex.dr} +16 -17
- data/lib/depager/{slex.rb → ruby/plugins/slex.rb} +115 -117
- data/lib/depager/{srp.rb → ruby/plugins/srp.rb} +4 -4
- data/lib/depager/{template → ruby/templates}/extension_lalr_master.erb +6 -6
- data/lib/depager/{template → ruby/templates}/extension_lalr_slave.erb +0 -0
- data/lib/depager/{template → ruby/templates}/simple.erb +0 -0
- data/lib/depager/{template → ruby/templates}/single_lalr_parser.erb +0 -0
- data/lib/depager/utils.rb +30 -69
- data/lib/depager/version.rb +1 -1
- metadata +59 -56
- data/examples/Rakefile +0 -36
- data/lib/depager/Rakefile +0 -34
- data/lib/depager/lr_put_table.rb +0 -116
- data/lib/depager/parse_action.rb +0 -24
@@ -51,25 +51,26 @@ class TinyCalc < Depager::LALR::Basis
|
|
51
51
|
]
|
52
52
|
### Action Table
|
53
53
|
action_table = [
|
54
|
-
[ nil, nil, nil, nil, nil, nil,
|
55
|
-
[
|
56
|
-
[
|
54
|
+
[ nil, nil, nil, nil, nil, nil, 5, 1, nil, ],
|
55
|
+
[ nil, nil, nil, nil, nil, nil, 5, 1, nil, ],
|
56
|
+
[ ACC, nil, 7, 8, nil, nil, nil, nil, nil, ],
|
57
|
+
[ nil, nil, nil, nil, 9, 10, nil, nil, nil, ],
|
57
58
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
58
59
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
59
|
-
[ nil, nil,
|
60
|
-
[ nil, nil, nil, nil, nil, nil,
|
61
|
-
[ nil, nil, nil, nil, nil, nil,
|
62
|
-
[ nil, nil, nil, nil, nil, nil,
|
63
|
-
[ nil, nil, nil, nil, nil, nil,
|
64
|
-
[ nil, nil, 6, 7, nil, nil, nil, nil, 15, ],
|
65
|
-
[ nil, nil, nil, nil, 8, 9, nil, nil, nil, ],
|
66
|
-
[ nil, nil, nil, nil, 8, 9, nil, nil, nil, ],
|
60
|
+
[ nil, nil, 7, 8, nil, nil, nil, nil, 11, ],
|
61
|
+
[ nil, nil, nil, nil, nil, nil, 5, 1, nil, ],
|
62
|
+
[ nil, nil, nil, nil, nil, nil, 5, 1, nil, ],
|
63
|
+
[ nil, nil, nil, nil, nil, nil, 5, 1, nil, ],
|
64
|
+
[ nil, nil, nil, nil, nil, nil, 5, 1, nil, ],
|
67
65
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
66
|
+
[ nil, nil, nil, nil, 9, 10, nil, nil, nil, ],
|
67
|
+
[ nil, nil, nil, nil, 9, 10, nil, nil, nil, ],
|
68
68
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
69
69
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
70
70
|
]
|
71
71
|
### Default Reduce Table
|
72
72
|
defred_table = [
|
73
|
+
nil,
|
73
74
|
nil,
|
74
75
|
nil,
|
75
76
|
-3,
|
@@ -80,17 +81,17 @@ class TinyCalc < Depager::LALR::Basis
|
|
80
81
|
nil,
|
81
82
|
nil,
|
82
83
|
nil,
|
83
|
-
|
84
|
+
-8,
|
84
85
|
-1,
|
85
86
|
-2,
|
86
87
|
-4,
|
87
88
|
-5,
|
88
|
-
-8,
|
89
89
|
]
|
90
90
|
defred_after_shift_table = [
|
91
91
|
nil,
|
92
92
|
nil,
|
93
93
|
nil,
|
94
|
+
nil,
|
94
95
|
-6,
|
95
96
|
-7,
|
96
97
|
nil,
|
@@ -98,12 +99,11 @@ class TinyCalc < Depager::LALR::Basis
|
|
98
99
|
nil,
|
99
100
|
nil,
|
100
101
|
nil,
|
101
|
-
|
102
|
+
-8,
|
102
103
|
nil,
|
103
104
|
nil,
|
104
105
|
-4,
|
105
106
|
-5,
|
106
|
-
-8,
|
107
107
|
]
|
108
108
|
### Nonterm to Int
|
109
109
|
nt2i = {
|
@@ -119,17 +119,17 @@ class TinyCalc < Depager::LALR::Basis
|
|
119
119
|
]
|
120
120
|
### Goto Table
|
121
121
|
goto_table = [
|
122
|
-
[
|
122
|
+
[ 2, 3, 4, ],
|
123
|
+
[ 6, 3, 4, ],
|
123
124
|
[ nil, nil, nil, ],
|
124
125
|
[ nil, nil, nil, ],
|
125
126
|
[ nil, nil, nil, ],
|
126
127
|
[ nil, nil, nil, ],
|
127
|
-
[ 10, 2, 3, ],
|
128
|
-
[ nil, 11, 3, ],
|
129
|
-
[ nil, 12, 3, ],
|
130
|
-
[ nil, nil, 13, ],
|
131
|
-
[ nil, nil, 14, ],
|
132
128
|
[ nil, nil, nil, ],
|
129
|
+
[ nil, 12, 4, ],
|
130
|
+
[ nil, 13, 4, ],
|
131
|
+
[ nil, nil, 14, ],
|
132
|
+
[ nil, nil, 15, ],
|
133
133
|
[ nil, nil, nil, ],
|
134
134
|
[ nil, nil, nil, ],
|
135
135
|
[ nil, nil, nil, ],
|
@@ -150,20 +150,30 @@ class TinyCalc < Depager::LALR::Basis
|
|
150
150
|
I000 =
|
151
151
|
( 0) $start : _ expr
|
152
152
|
|
153
|
-
NUM shift, and goto to state
|
154
|
-
'(' shift, and goto to state
|
153
|
+
NUM shift, and goto to state 5
|
154
|
+
'(' shift, and goto to state 1
|
155
155
|
|
156
156
|
|
157
157
|
----------
|
158
158
|
|
159
159
|
<<'----------',
|
160
160
|
I001 =
|
161
|
+
( 8) fact : '(' _ expr ')'
|
162
|
+
|
163
|
+
NUM shift, and goto to state 5
|
164
|
+
'(' shift, and goto to state 1
|
165
|
+
|
166
|
+
|
167
|
+
----------
|
168
|
+
|
169
|
+
<<'----------',
|
170
|
+
I002 =
|
161
171
|
( 0) $start : expr _
|
162
172
|
( 1) expr : expr _ '+' term
|
163
173
|
( 2) expr : expr _ '-' term
|
164
174
|
|
165
|
-
'+' shift, and goto to state
|
166
|
-
'-' shift, and goto to state
|
175
|
+
'+' shift, and goto to state 7
|
176
|
+
'-' shift, and goto to state 8
|
167
177
|
|
168
178
|
|
169
179
|
$end accept
|
@@ -171,20 +181,20 @@ I001 =
|
|
171
181
|
----------
|
172
182
|
|
173
183
|
<<'----------',
|
174
|
-
|
184
|
+
I003 =
|
175
185
|
( 3) expr : term _
|
176
186
|
( 4) term : term _ '*' fact
|
177
187
|
( 5) term : term _ '/' fact
|
178
188
|
|
179
|
-
'*' shift, and goto to state
|
180
|
-
'/' shift, and goto to state
|
189
|
+
'*' shift, and goto to state 9
|
190
|
+
'/' shift, and goto to state 10
|
181
191
|
|
182
192
|
$default reduce using rule 3 (expr)
|
183
193
|
|
184
194
|
----------
|
185
195
|
|
186
196
|
<<'----------',
|
187
|
-
|
197
|
+
I004 =
|
188
198
|
( 6) term : fact _
|
189
199
|
|
190
200
|
|
@@ -193,7 +203,7 @@ I003 =
|
|
193
203
|
----------
|
194
204
|
|
195
205
|
<<'----------',
|
196
|
-
|
206
|
+
I005 =
|
197
207
|
( 7) fact : NUM _
|
198
208
|
|
199
209
|
|
@@ -202,96 +212,95 @@ I004 =
|
|
202
212
|
----------
|
203
213
|
|
204
214
|
<<'----------',
|
205
|
-
|
206
|
-
( 8) fact : '(' _
|
215
|
+
I006 =
|
216
|
+
( 8) fact : '(' expr _ ')'
|
217
|
+
( 1) expr : expr _ '+' term
|
218
|
+
( 2) expr : expr _ '-' term
|
207
219
|
|
208
|
-
|
209
|
-
'
|
220
|
+
'+' shift, and goto to state 7
|
221
|
+
'-' shift, and goto to state 8
|
222
|
+
')' shift, and goto to state 11
|
210
223
|
|
211
224
|
|
212
225
|
----------
|
213
226
|
|
214
227
|
<<'----------',
|
215
|
-
|
228
|
+
I007 =
|
216
229
|
( 1) expr : expr '+' _ term
|
217
230
|
|
218
|
-
NUM shift, and goto to state
|
219
|
-
'(' shift, and goto to state
|
231
|
+
NUM shift, and goto to state 5
|
232
|
+
'(' shift, and goto to state 1
|
220
233
|
|
221
234
|
|
222
235
|
----------
|
223
236
|
|
224
237
|
<<'----------',
|
225
|
-
|
238
|
+
I008 =
|
226
239
|
( 2) expr : expr '-' _ term
|
227
240
|
|
228
|
-
NUM shift, and goto to state
|
229
|
-
'(' shift, and goto to state
|
241
|
+
NUM shift, and goto to state 5
|
242
|
+
'(' shift, and goto to state 1
|
230
243
|
|
231
244
|
|
232
245
|
----------
|
233
246
|
|
234
247
|
<<'----------',
|
235
|
-
|
248
|
+
I009 =
|
236
249
|
( 4) term : term '*' _ fact
|
237
250
|
|
238
|
-
NUM shift, and goto to state
|
239
|
-
'(' shift, and goto to state
|
251
|
+
NUM shift, and goto to state 5
|
252
|
+
'(' shift, and goto to state 1
|
240
253
|
|
241
254
|
|
242
255
|
----------
|
243
256
|
|
244
257
|
<<'----------',
|
245
|
-
|
258
|
+
I010 =
|
246
259
|
( 5) term : term '/' _ fact
|
247
260
|
|
248
|
-
NUM shift, and goto to state
|
249
|
-
'(' shift, and goto to state
|
261
|
+
NUM shift, and goto to state 5
|
262
|
+
'(' shift, and goto to state 1
|
250
263
|
|
251
264
|
|
252
265
|
----------
|
253
266
|
|
254
267
|
<<'----------',
|
255
|
-
|
256
|
-
( 8) fact : '(' expr
|
257
|
-
( 1) expr : expr _ '+' term
|
258
|
-
( 2) expr : expr _ '-' term
|
268
|
+
I011 =
|
269
|
+
( 8) fact : '(' expr ')' _
|
259
270
|
|
260
|
-
'+' shift, and goto to state 6
|
261
|
-
'-' shift, and goto to state 7
|
262
|
-
')' shift, and goto to state 15
|
263
271
|
|
272
|
+
$default reduce using rule 8 (fact) [after shift]
|
264
273
|
|
265
274
|
----------
|
266
275
|
|
267
276
|
<<'----------',
|
268
|
-
|
277
|
+
I012 =
|
269
278
|
( 1) expr : expr '+' term _
|
270
279
|
( 4) term : term _ '*' fact
|
271
280
|
( 5) term : term _ '/' fact
|
272
281
|
|
273
|
-
'*' shift, and goto to state
|
274
|
-
'/' shift, and goto to state
|
282
|
+
'*' shift, and goto to state 9
|
283
|
+
'/' shift, and goto to state 10
|
275
284
|
|
276
285
|
$default reduce using rule 1 (expr)
|
277
286
|
|
278
287
|
----------
|
279
288
|
|
280
289
|
<<'----------',
|
281
|
-
|
290
|
+
I013 =
|
282
291
|
( 2) expr : expr '-' term _
|
283
292
|
( 4) term : term _ '*' fact
|
284
293
|
( 5) term : term _ '/' fact
|
285
294
|
|
286
|
-
'*' shift, and goto to state
|
287
|
-
'/' shift, and goto to state
|
295
|
+
'*' shift, and goto to state 9
|
296
|
+
'/' shift, and goto to state 10
|
288
297
|
|
289
298
|
$default reduce using rule 2 (expr)
|
290
299
|
|
291
300
|
----------
|
292
301
|
|
293
302
|
<<'----------',
|
294
|
-
|
303
|
+
I014 =
|
295
304
|
( 4) term : term '*' fact _
|
296
305
|
|
297
306
|
|
@@ -300,21 +309,12 @@ I013 =
|
|
300
309
|
----------
|
301
310
|
|
302
311
|
<<'----------',
|
303
|
-
|
312
|
+
I015 =
|
304
313
|
( 5) term : term '/' fact _
|
305
314
|
|
306
315
|
|
307
316
|
$default reduce using rule 5 (term) [after shift]
|
308
317
|
|
309
|
-
----------
|
310
|
-
|
311
|
-
<<'----------',
|
312
|
-
I015 =
|
313
|
-
( 8) fact : '(' expr ')' _
|
314
|
-
|
315
|
-
|
316
|
-
$default reduce using rule 8 (fact) [after shift]
|
317
|
-
|
318
318
|
----------
|
319
319
|
]
|
320
320
|
|
@@ -341,12 +341,12 @@ I015 =
|
|
341
341
|
|
342
342
|
when /\A[1-9][0-9]*/
|
343
343
|
@oldline = @line; @line = $'
|
344
|
-
yield
|
344
|
+
yield token(:NUM, $&.to_i)
|
345
345
|
|
346
346
|
|
347
347
|
when /\A./
|
348
348
|
@oldline = @line; @line = $'
|
349
|
-
yield
|
349
|
+
yield token($&, $&)
|
350
350
|
|
351
351
|
|
352
352
|
else
|
@@ -368,61 +368,61 @@ end
|
|
368
368
|
|
369
369
|
class Visitor
|
370
370
|
|
371
|
-
module_eval <<-'.,.,
|
371
|
+
module_eval <<-'.,.,122745803928929.,.,', 'sample_calc/calc.cst.dr', 23
|
372
372
|
def visit_Node_expr_0 node
|
373
373
|
node.value = node.expr.value + node.term.value
|
374
374
|
|
375
375
|
end
|
376
|
-
.,.,
|
376
|
+
.,.,122745803928929.,.,
|
377
377
|
|
378
|
-
module_eval <<-'.,.,
|
378
|
+
module_eval <<-'.,.,12274580395023.,.,', 'sample_calc/calc.cst.dr', 24
|
379
379
|
def visit_Node_expr_1 node
|
380
380
|
node.value = node.expr.value + node.term.value
|
381
381
|
|
382
382
|
end
|
383
|
-
.,.,
|
383
|
+
.,.,12274580395023.,.,
|
384
384
|
|
385
|
-
module_eval <<-'.,.,
|
385
|
+
module_eval <<-'.,.,12274580391475.,.,', 'sample_calc/calc.cst.dr', 25
|
386
386
|
def visit_Node_expr_2 node
|
387
387
|
node.value = node.term.value
|
388
388
|
|
389
389
|
end
|
390
|
-
.,.,
|
390
|
+
.,.,12274580391475.,.,
|
391
391
|
|
392
|
-
module_eval <<-'.,.,
|
392
|
+
module_eval <<-'.,.,122745803963610.,.,', 'sample_calc/calc.cst.dr', 28
|
393
393
|
def visit_Node_term_0 node
|
394
394
|
node.value = node.term.value * node.fact.value
|
395
395
|
|
396
396
|
end
|
397
|
-
.,.,
|
397
|
+
.,.,122745803963610.,.,
|
398
398
|
|
399
|
-
module_eval <<-'.,.,
|
399
|
+
module_eval <<-'.,.,122745803936130.,.,', 'sample_calc/calc.cst.dr', 29
|
400
400
|
def visit_Node_term_1 node
|
401
401
|
node.value = node.term.value / node.fact.value
|
402
402
|
|
403
403
|
end
|
404
|
-
.,.,
|
404
|
+
.,.,122745803936130.,.,
|
405
405
|
|
406
|
-
module_eval <<-'.,.,
|
406
|
+
module_eval <<-'.,.,122745803926151.,.,', 'sample_calc/calc.cst.dr', 30
|
407
407
|
def visit_Node_term_2 node
|
408
408
|
node.value = node.fact.value
|
409
409
|
|
410
410
|
end
|
411
|
-
.,.,
|
411
|
+
.,.,122745803926151.,.,
|
412
412
|
|
413
|
-
module_eval <<-'.,.,
|
413
|
+
module_eval <<-'.,.,122745803911098.,.,', 'sample_calc/calc.cst.dr', 33
|
414
414
|
def visit_Node_fact_0 node
|
415
415
|
node.value = node.num.value
|
416
416
|
|
417
417
|
end
|
418
|
-
.,.,
|
418
|
+
.,.,122745803911098.,.,
|
419
419
|
|
420
|
-
module_eval <<-'.,.,
|
420
|
+
module_eval <<-'.,.,122745803942330.,.,', 'sample_calc/calc.cst.dr', 34
|
421
421
|
def visit_Node_fact_1 node
|
422
422
|
node.value = node.expr
|
423
423
|
|
424
424
|
end
|
425
|
-
.,.,
|
425
|
+
.,.,122745803942330.,.,
|
426
426
|
|
427
427
|
end
|
428
428
|
|
@@ -554,7 +554,7 @@ v.visit_Node_fact_1(self)
|
|
554
554
|
|
555
555
|
class D4TinyCalc::CSTBuilder < Depager::LALR::Action #:nodoc:all
|
556
556
|
include Depager::DecoratorUtils
|
557
|
-
|
557
|
+
|
558
558
|
on_reduce = [
|
559
559
|
nil,
|
560
560
|
:_cst_0,
|
@@ -575,53 +575,53 @@ class D4TinyCalc::CSTBuilder < Depager::LALR::Action #:nodoc:all
|
|
575
575
|
end
|
576
576
|
|
577
577
|
|
578
|
-
module_eval <<-'.,.,
|
578
|
+
module_eval <<-'.,.,122745803958185.,.,', 'sample_calc/calc.cst.dr', 23
|
579
579
|
def _cst_0 val
|
580
580
|
Node_expr_0.new(val[0], val[1], val[2])
|
581
581
|
end
|
582
|
-
.,.,
|
582
|
+
.,.,122745803958185.,.,
|
583
583
|
|
584
|
-
module_eval <<-'.,.,
|
584
|
+
module_eval <<-'.,.,122745803928586.,.,', 'sample_calc/calc.cst.dr', 24
|
585
585
|
def _cst_1 val
|
586
586
|
Node_expr_1.new(val[0], val[1], val[2])
|
587
587
|
end
|
588
|
-
.,.,
|
588
|
+
.,.,122745803928586.,.,
|
589
589
|
|
590
|
-
module_eval <<-'.,.,
|
590
|
+
module_eval <<-'.,.,122745803930636.,.,', 'sample_calc/calc.cst.dr', 25
|
591
591
|
def _cst_2 val
|
592
592
|
Node_expr_2.new(val[0])
|
593
593
|
end
|
594
|
-
.,.,
|
594
|
+
.,.,122745803930636.,.,
|
595
595
|
|
596
|
-
module_eval <<-'.,.,
|
596
|
+
module_eval <<-'.,.,12274580392302.,.,', 'sample_calc/calc.cst.dr', 28
|
597
597
|
def _cst_3 val
|
598
598
|
Node_term_0.new(val[0], val[1], val[2])
|
599
599
|
end
|
600
|
-
.,.,
|
600
|
+
.,.,12274580392302.,.,
|
601
601
|
|
602
|
-
module_eval <<-'.,.,
|
602
|
+
module_eval <<-'.,.,122745803915548.,.,', 'sample_calc/calc.cst.dr', 29
|
603
603
|
def _cst_4 val
|
604
604
|
Node_term_1.new(val[0], val[1], val[2])
|
605
605
|
end
|
606
|
-
.,.,
|
606
|
+
.,.,122745803915548.,.,
|
607
607
|
|
608
|
-
module_eval <<-'.,.,
|
608
|
+
module_eval <<-'.,.,122745803944731.,.,', 'sample_calc/calc.cst.dr', 30
|
609
609
|
def _cst_5 val
|
610
610
|
Node_term_2.new(val[0])
|
611
611
|
end
|
612
|
-
.,.,
|
612
|
+
.,.,122745803944731.,.,
|
613
613
|
|
614
|
-
module_eval <<-'.,.,
|
614
|
+
module_eval <<-'.,.,122745803920542.,.,', 'sample_calc/calc.cst.dr', 33
|
615
615
|
def _cst_6 val
|
616
616
|
Node_fact_0.new(val[0])
|
617
617
|
end
|
618
|
-
.,.,
|
618
|
+
.,.,122745803920542.,.,
|
619
619
|
|
620
|
-
module_eval <<-'.,.,
|
620
|
+
module_eval <<-'.,.,12274580399969.,.,', 'sample_calc/calc.cst.dr', 34
|
621
621
|
def _cst_7 val
|
622
622
|
Node_fact_1.new(val[0], val[1], val[2])
|
623
623
|
end
|
624
|
-
.,.,
|
624
|
+
.,.,12274580399969.,.,
|
625
625
|
|
626
626
|
end
|
627
627
|
|
@@ -635,7 +635,7 @@ if __FILE__ == $0
|
|
635
635
|
### Main Code
|
636
636
|
require 'pp'
|
637
637
|
parser = createDecoratedTinyCalc
|
638
|
-
r, = parser.
|
638
|
+
r, = parser.parse(STDIN)
|
639
639
|
v = Visitor.new
|
640
640
|
r.accept(v)
|
641
641
|
pp r
|