depager 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -4,7 +4,6 @@
|
|
4
4
|
###
|
5
5
|
require 'pp.rb'
|
6
6
|
require 'depager/parser.rb'
|
7
|
-
require 'depager/parse_action'
|
8
7
|
|
9
8
|
|
10
9
|
module D4ASTBuilderExtension #:nodoc:all
|
@@ -25,18 +24,19 @@ class ASTBuilderExtension #:nodoc:all
|
|
25
24
|
def __regext__ p
|
26
25
|
super p, :default, nil
|
27
26
|
|
28
|
-
@hook[0] =
|
29
|
-
@h2p['
|
30
|
-
p.
|
27
|
+
@hook[0] = ASTBuilderExtension_post_rhs.new(p, @nparam, self)
|
28
|
+
@h2p['post_rhs'] = @hook[0]
|
29
|
+
p.hooks[:post_rhs].push [@hook[0], :do_parse]
|
31
30
|
|
32
|
-
@hook[1] =
|
33
|
-
@h2p['
|
34
|
-
p.
|
31
|
+
@hook[1] = ASTBuilderExtension_pre_rule_list.new(p, @nparam, self)
|
32
|
+
@h2p['pre_rule_list'] = @hook[1]
|
33
|
+
p.hooks[:pre_rule_list].push [@hook[1], :do_parse]
|
35
34
|
|
36
35
|
regext p
|
37
36
|
end
|
38
37
|
|
39
38
|
### Inner Code
|
39
|
+
require 'plugins/_ast_tmpl'
|
40
40
|
attr_accessor :optouter, :on_reduce, :visitor
|
41
41
|
def init_parser
|
42
42
|
super
|
@@ -45,13 +45,12 @@ class ASTBuilderExtension #:nodoc:all
|
|
45
45
|
@on_reduce = []
|
46
46
|
@output_file_name = nil
|
47
47
|
end
|
48
|
-
def
|
48
|
+
def post_rule_list
|
49
49
|
g_parser.optouter <<
|
50
50
|
gen_action_decorator_code(target_name, paramkey,
|
51
51
|
@on_reduce, @optouter)
|
52
52
|
end
|
53
53
|
|
54
|
-
Template = CodeUtils::make_tmpl("#{Depager::Tmpldir}/ast.erbs")
|
55
54
|
def modify_action_code code, nodes=[]
|
56
55
|
code = code.gsub(/\$\.([a-z_])/, 'node.\1')
|
57
56
|
code << %{
|
@@ -75,15 +74,14 @@ end
|
|
75
74
|
### Outer Code
|
76
75
|
|
77
76
|
###
|
78
|
-
###
|
77
|
+
### ASTBuilderExtension_pre_rule_list - Part of Depager Extension (slave)
|
79
78
|
###
|
80
|
-
module
|
79
|
+
module D4ASTBuilderExtension_pre_rule_list #:nodoc:all
|
81
80
|
end
|
82
81
|
|
83
|
-
class
|
82
|
+
class ASTBuilderExtension_pre_rule_list < Depager::LALR::Basis #:nodoc:all
|
84
83
|
include Depager::ExtensionUtils
|
85
84
|
|
86
|
-
include ActionParser
|
87
85
|
|
88
86
|
### Reduce Table
|
89
87
|
reduce_table = [
|
@@ -154,90 +152,90 @@ class ASTBuilderExtension_prerulelist < Depager::LALR::Basis #:nodoc:all
|
|
154
152
|
]
|
155
153
|
### Action Table
|
156
154
|
action_table = [
|
157
|
-
[ nil, nil,
|
155
|
+
[ nil, nil, 1, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
156
|
+
[ nil, nil, nil, nil, nil, nil, nil, nil, 5, nil, nil, nil, nil, nil, ],
|
158
157
|
[ ACC, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
159
|
-
[ nil, nil, nil, nil,
|
160
|
-
[ nil, nil, nil,
|
161
|
-
[ nil, nil, nil, nil, nil,
|
162
|
-
[ nil, nil, nil,
|
163
|
-
[ nil, nil, nil,
|
164
|
-
[ nil, nil, nil, nil, nil, 20, nil, nil, nil, 18, nil, nil, nil, nil, ],
|
165
|
-
[ nil, nil, nil, nil, nil, 11, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
158
|
+
[ nil, nil, nil, nil, 6, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
159
|
+
[ nil, nil, nil, 8, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
160
|
+
[ nil, nil, nil, nil, nil, 10, nil, nil, nil, 9, nil, nil, nil, nil, ],
|
161
|
+
[ nil, nil, nil, 12, nil, nil, nil, nil, nil, nil, nil, nil, 16, nil, ],
|
162
|
+
[ nil, nil, nil, nil, nil, 18, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
166
163
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
167
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, 7, nil, nil, nil, nil, nil, ],
|
168
|
-
[ nil, nil, nil, nil, nil, nil, 23, nil, nil, nil, nil, nil, nil, nil, ],
|
169
164
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
170
165
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
171
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
166
|
+
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, 21, 22, nil, nil, nil, ],
|
172
167
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
173
|
-
[ nil, nil, nil, nil, nil, 25, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
174
168
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
169
|
+
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 16, nil, ],
|
175
170
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
176
|
-
[ nil, nil, nil, nil, nil,
|
171
|
+
[ nil, nil, nil, nil, nil, 24, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
177
172
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
173
|
+
[ nil, nil, nil, nil, nil, nil, 25, nil, nil, nil, nil, nil, nil, nil, ],
|
174
|
+
[ nil, nil, nil, nil, nil, nil, nil, nil, 5, nil, nil, nil, nil, nil, ],
|
175
|
+
[ nil, nil, nil, nil, nil, 18, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
178
176
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
179
|
-
[ nil, nil, nil,
|
180
|
-
[ nil, nil, nil, nil, nil, 32, nil, 29, nil, nil, nil, 33, nil, nil, ],
|
177
|
+
[ nil, nil, nil, nil, nil, 28, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
181
178
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
182
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
179
|
+
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 29, ],
|
180
|
+
[ nil, nil, nil, nil, nil, 31, nil, 34, nil, nil, nil, 32, nil, nil, ],
|
181
|
+
[ nil, nil, nil, 12, nil, nil, nil, nil, nil, nil, nil, nil, 16, nil, ],
|
183
182
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
184
|
-
[ nil, nil, nil, nil, nil, 35, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
185
183
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
184
|
+
[ nil, nil, nil, 36, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
186
185
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
187
|
-
[ nil, nil, nil, nil, nil, nil, nil, 36, nil, nil, 37, nil, nil, nil, ],
|
188
186
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
187
|
+
[ nil, nil, nil, nil, nil, 37, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
188
|
+
[ nil, nil, nil, nil, nil, nil, nil, 39, nil, nil, 38, nil, nil, nil, ],
|
189
189
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
190
|
-
[ nil, nil, nil, nil, nil, 38, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
191
|
-
[ nil, nil, nil, 39, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
192
190
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
193
191
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
194
|
-
[ nil, nil, nil, nil, nil, 32, nil, nil, nil, nil, nil, 33, nil, nil, ],
|
195
192
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
193
|
+
[ nil, nil, nil, nil, nil, 31, nil, nil, nil, nil, nil, 32, nil, nil, ],
|
196
194
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
197
195
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
198
196
|
]
|
199
197
|
### Default Reduce Table
|
200
198
|
defred_table = [
|
201
199
|
-2,
|
200
|
+
-11,
|
202
201
|
nil,
|
203
202
|
-4,
|
204
|
-
-11,
|
205
203
|
nil,
|
206
|
-
-20,
|
207
204
|
nil,
|
205
|
+
-20,
|
208
206
|
nil,
|
209
|
-
-
|
210
|
-
-
|
211
|
-
-
|
207
|
+
-3,
|
208
|
+
-12,
|
209
|
+
-18,
|
212
210
|
nil,
|
213
|
-
-5,
|
214
211
|
-21,
|
212
|
+
-5,
|
215
213
|
-22,
|
216
214
|
-23,
|
217
215
|
nil,
|
218
|
-
-
|
219
|
-
-12,
|
216
|
+
-6,
|
220
217
|
nil,
|
221
|
-
-
|
222
|
-
-
|
223
|
-
-
|
218
|
+
-11,
|
219
|
+
-1,
|
220
|
+
-13,
|
224
221
|
nil,
|
225
222
|
-24,
|
226
223
|
nil,
|
227
|
-
-13,
|
228
224
|
nil,
|
229
|
-
-
|
230
|
-
-
|
225
|
+
-20,
|
226
|
+
-7,
|
227
|
+
-19,
|
231
228
|
nil,
|
232
229
|
-14,
|
233
230
|
-16,
|
234
231
|
nil,
|
235
232
|
nil,
|
236
|
-
-
|
237
|
-
-
|
238
|
-
nil,
|
239
|
-
-17,
|
233
|
+
-9,
|
234
|
+
-8,
|
240
235
|
-25,
|
236
|
+
-17,
|
237
|
+
nil,
|
238
|
+
-10,
|
241
239
|
-15,
|
242
240
|
]
|
243
241
|
defred_after_shift_table = [
|
@@ -249,38 +247,38 @@ class ASTBuilderExtension_prerulelist < Depager::LALR::Basis #:nodoc:all
|
|
249
247
|
nil,
|
250
248
|
nil,
|
251
249
|
nil,
|
250
|
+
-3,
|
251
|
+
-12,
|
252
|
+
-18,
|
252
253
|
nil,
|
253
|
-
-6,
|
254
|
-
nil,
|
255
|
-
nil,
|
256
|
-
-5,
|
257
254
|
-21,
|
255
|
+
-5,
|
258
256
|
nil,
|
259
257
|
-23,
|
260
258
|
nil,
|
261
|
-
-
|
262
|
-
|
259
|
+
-6,
|
260
|
+
nil,
|
263
261
|
nil,
|
264
|
-
-18,
|
265
|
-
-7,
|
266
262
|
nil,
|
263
|
+
-13,
|
267
264
|
nil,
|
268
265
|
-24,
|
269
266
|
nil,
|
270
|
-
-13,
|
271
267
|
nil,
|
272
|
-
|
273
|
-
-
|
268
|
+
nil,
|
269
|
+
-7,
|
270
|
+
-19,
|
274
271
|
nil,
|
275
272
|
-14,
|
276
273
|
-16,
|
277
274
|
nil,
|
278
275
|
nil,
|
279
|
-
-
|
280
|
-
-
|
281
|
-
nil,
|
282
|
-
-17,
|
276
|
+
-9,
|
277
|
+
-8,
|
283
278
|
-25,
|
279
|
+
-17,
|
280
|
+
nil,
|
281
|
+
-10,
|
284
282
|
-15,
|
285
283
|
]
|
286
284
|
### Nonterm to Int
|
@@ -317,33 +315,33 @@ class ASTBuilderExtension_prerulelist < Depager::LALR::Basis #:nodoc:all
|
|
317
315
|
]
|
318
316
|
### Goto Table
|
319
317
|
goto_table = [
|
320
|
-
[
|
318
|
+
[ 2, 3, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
319
|
+
[ nil, nil, nil, nil, 4, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
321
320
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
322
|
-
[ nil, nil,
|
323
|
-
[ nil, nil, nil, nil, 6, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
324
|
-
[ nil, nil, nil, 8, nil, nil, 9, 10, nil, nil, nil, nil, nil, ],
|
325
|
-
[ nil, nil, nil, nil, nil, 12, nil, nil, nil, nil, nil, 14, 15, ],
|
321
|
+
[ nil, nil, 7, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
326
322
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
327
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
328
|
-
[ nil, nil, nil, nil, nil,
|
323
|
+
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, 11, nil, nil, nil, ],
|
324
|
+
[ nil, nil, nil, nil, nil, 13, nil, nil, nil, nil, nil, 14, 15, ],
|
325
|
+
[ nil, nil, nil, 20, nil, nil, 17, 19, nil, nil, nil, nil, nil, ],
|
329
326
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
330
|
-
[ nil, nil, nil, nil, 22, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
331
327
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
332
328
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
333
329
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
334
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 24, ],
|
335
330
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
336
331
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
332
|
+
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 23, ],
|
337
333
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
338
334
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
339
335
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
340
336
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
337
|
+
[ nil, nil, nil, nil, 26, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
338
|
+
[ nil, nil, nil, nil, nil, nil, 27, 19, nil, nil, nil, nil, nil, ],
|
341
339
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
342
|
-
[ nil, nil, nil, nil, nil, 28, nil, nil, nil, nil, nil, 14, 15, ],
|
343
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, 30, nil, 31, nil, nil, ],
|
344
340
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
345
341
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
346
342
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
343
|
+
[ nil, nil, nil, nil, nil, nil, nil, nil, 33, nil, 30, nil, nil, ],
|
344
|
+
[ nil, nil, nil, nil, nil, 35, nil, nil, nil, nil, nil, 14, 15, ],
|
347
345
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
348
346
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
349
347
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
@@ -354,8 +352,8 @@ class ASTBuilderExtension_prerulelist < Depager::LALR::Basis #:nodoc:all
|
|
354
352
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
355
353
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
356
354
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
357
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 40, nil, nil, ],
|
358
355
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
356
|
+
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 40, nil, nil, ],
|
359
357
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
360
358
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
361
359
|
]
|
@@ -370,7 +368,7 @@ class ASTBuilderExtension_prerulelist < Depager::LALR::Basis #:nodoc:all
|
|
370
368
|
@g_parser = @p = p
|
371
369
|
@master = @m = master
|
372
370
|
@nparam = nparam
|
373
|
-
@dect =
|
371
|
+
@dect = D4ASTBuilderExtension_pre_rule_list::NVAction.new(self)
|
374
372
|
init_parser
|
375
373
|
end
|
376
374
|
|
@@ -408,27 +406,27 @@ class ASTBuilderExtension_prerulelist < Depager::LALR::Basis #:nodoc:all
|
|
408
406
|
|
409
407
|
when /\ANode/
|
410
408
|
@oldline = @line; @line = $'
|
411
|
-
yield
|
409
|
+
yield token(:NODE, $&)
|
412
410
|
|
413
411
|
|
414
412
|
when /\AVisitor/
|
415
413
|
@oldline = @line; @line = $'
|
416
|
-
yield
|
414
|
+
yield token(:VISITOR, $&)
|
417
415
|
|
418
416
|
|
419
417
|
when /\A[a-zA-Z][a-zA-Z0-9_]*/
|
420
418
|
@oldline = @line; @line = $'
|
421
|
-
yield
|
419
|
+
yield token(:ID, $&)
|
422
420
|
|
423
421
|
|
424
422
|
when /\A\{/
|
425
423
|
#
|
426
|
-
ln = lineno; yield
|
424
|
+
ln = lineno; yield token(:ACTION, parse_action, ln)
|
427
425
|
|
428
426
|
|
429
427
|
when /\A./
|
430
428
|
@oldline = @line; @line = $'
|
431
|
-
yield
|
429
|
+
yield token($&, $&)
|
432
430
|
|
433
431
|
|
434
432
|
else
|
@@ -443,9 +441,9 @@ end
|
|
443
441
|
|
444
442
|
### Outer Code
|
445
443
|
|
446
|
-
class
|
444
|
+
class D4ASTBuilderExtension_pre_rule_list::NVAction < Depager::LALR::Action #:nodoc:all
|
447
445
|
include Depager::DecoratorUtils
|
448
|
-
|
446
|
+
|
449
447
|
on_reduce = [
|
450
448
|
nil,
|
451
449
|
:_act_0,
|
@@ -483,7 +481,7 @@ class D4ASTBuilderExtension_prerulelist::NVAction < Depager::LALR::Action #:nodo
|
|
483
481
|
end
|
484
482
|
|
485
483
|
|
486
|
-
module_eval <<-'.,.,
|
484
|
+
module_eval <<-'.,.,122745803347277.,.,', 'ast.dr', 55
|
487
485
|
def _act_0 val
|
488
486
|
_opt_defnode, _opt_defvis, _defnode_list, = *val
|
489
487
|
|
@@ -514,16 +512,16 @@ def _act_0 val
|
|
514
512
|
end
|
515
513
|
|
516
514
|
end
|
517
|
-
.,.,
|
515
|
+
.,.,122745803347277.,.,
|
518
516
|
|
519
|
-
module_eval <<-'.,.,
|
517
|
+
module_eval <<-'.,.,122745803338304.,.,', 'ast.dr', 84
|
520
518
|
def _act_1 val
|
521
519
|
""
|
522
520
|
|
523
521
|
end
|
524
|
-
.,.,
|
522
|
+
.,.,122745803338304.,.,
|
525
523
|
|
526
|
-
module_eval <<-'.,.,
|
524
|
+
module_eval <<-'.,.,122745803334064.,.,', 'ast.dr', 86
|
527
525
|
def _act_2 val
|
528
526
|
_NODE, _opt_attr, _ACTION, = *val
|
529
527
|
|
@@ -532,19 +530,19 @@ def _act_2 val
|
|
532
530
|
#{_ACTION.value}
|
533
531
|
end
|
534
532
|
};#code
|
535
|
-
master.
|
533
|
+
ERB.new(master.class::TMPL_NODE_BASE).result(binding)
|
536
534
|
|
537
535
|
end
|
538
|
-
.,.,
|
536
|
+
.,.,122745803334064.,.,
|
539
537
|
|
540
|
-
module_eval <<-'.,.,
|
538
|
+
module_eval <<-'.,.,122745803350390.,.,', 'ast.dr', 96
|
541
539
|
def _act_3 val
|
542
540
|
[]
|
543
541
|
|
544
542
|
end
|
545
|
-
.,.,
|
543
|
+
.,.,122745803350390.,.,
|
546
544
|
|
547
|
-
module_eval <<-'.,.,
|
545
|
+
module_eval <<-'.,.,122745803327135.,.,', 'ast.dr', 98
|
548
546
|
def _act_4 val
|
549
547
|
_VISITOR, _opt_action, = *val
|
550
548
|
|
@@ -555,25 +553,25 @@ def _act_4 val
|
|
555
553
|
end
|
556
554
|
|
557
555
|
end
|
558
|
-
.,.,
|
556
|
+
.,.,122745803327135.,.,
|
559
557
|
|
560
|
-
module_eval <<-'.,.,
|
558
|
+
module_eval <<-'.,.,1227458033227.,.,', 'ast.dr', 107
|
561
559
|
def _act_5 val
|
562
560
|
_defnode, = *val
|
563
561
|
_defnode
|
564
562
|
|
565
563
|
end
|
566
|
-
.,.,
|
564
|
+
.,.,1227458033227.,.,
|
567
565
|
|
568
|
-
module_eval <<-'.,.,
|
566
|
+
module_eval <<-'.,.,122745803349542.,.,', 'ast.dr', 108
|
569
567
|
def _act_6 val
|
570
568
|
_defnode_list, _defnode, = *val
|
571
569
|
_defnode_list << _defnode
|
572
570
|
|
573
571
|
end
|
574
|
-
.,.,
|
572
|
+
.,.,122745803349542.,.,
|
575
573
|
|
576
|
-
module_eval <<-'.,.,
|
574
|
+
module_eval <<-'.,.,122745803342203.,.,', 'ast.dr', 112
|
577
575
|
def _act_7 val
|
578
576
|
_defnode_header, _opt_attr, _opt_action, = *val
|
579
577
|
|
@@ -595,156 +593,156 @@ def _act_7 val
|
|
595
593
|
master.gen_defm_code("visit_Node_#{name} node",
|
596
594
|
vis_code, act.lineno)
|
597
595
|
end
|
598
|
-
master.
|
596
|
+
ERB.new(master.class::TMPL_NODE).result(binding)
|
599
597
|
|
600
598
|
end
|
601
|
-
.,.,
|
599
|
+
.,.,122745803342203.,.,
|
602
600
|
|
603
|
-
module_eval <<-'.,.,
|
601
|
+
module_eval <<-'.,.,122745803342598.,.,', 'ast.dr', 135
|
604
602
|
def _act_8 val
|
605
603
|
_ID, _, _, = *val
|
606
604
|
[_ID.value, []]
|
607
605
|
|
608
606
|
end
|
609
|
-
.,.,
|
607
|
+
.,.,122745803342598.,.,
|
610
608
|
|
611
|
-
module_eval <<-'.,.,
|
609
|
+
module_eval <<-'.,.,122745803344032.,.,', 'ast.dr', 136
|
612
610
|
def _act_9 val
|
613
611
|
_ID, _, _fact_list, _, = *val
|
614
612
|
[_ID.value, _fact_list]
|
615
613
|
|
616
614
|
end
|
617
|
-
.,.,
|
615
|
+
.,.,122745803344032.,.,
|
618
616
|
|
619
|
-
module_eval <<-'.,.,
|
617
|
+
module_eval <<-'.,.,122745803361859.,.,', 'ast.dr', 139
|
620
618
|
def _act_10 val
|
621
619
|
[]
|
622
620
|
|
623
621
|
end
|
624
|
-
.,.,
|
622
|
+
.,.,122745803361859.,.,
|
625
623
|
|
626
|
-
module_eval <<-'.,.,
|
624
|
+
module_eval <<-'.,.,122745803323572.,.,', 'ast.dr', 140
|
627
625
|
def _act_11 val
|
628
626
|
_, _, = *val
|
629
627
|
[]
|
630
628
|
|
631
629
|
end
|
632
|
-
.,.,
|
630
|
+
.,.,122745803323572.,.,
|
633
631
|
|
634
|
-
module_eval <<-'.,.,
|
632
|
+
module_eval <<-'.,.,122745803313754.,.,', 'ast.dr', 141
|
635
633
|
def _act_12 val
|
636
634
|
_, _id_list, _, = *val
|
637
635
|
_id_list
|
638
636
|
|
639
637
|
end
|
640
|
-
.,.,
|
638
|
+
.,.,122745803313754.,.,
|
641
639
|
|
642
|
-
module_eval <<-'.,.,
|
640
|
+
module_eval <<-'.,.,12274580331318.,.,', 'ast.dr', 144
|
643
641
|
def _act_13 val
|
644
642
|
_fact, = *val
|
645
643
|
[_fact]
|
646
644
|
|
647
645
|
end
|
648
|
-
.,.,
|
646
|
+
.,.,12274580331318.,.,
|
649
647
|
|
650
|
-
module_eval <<-'.,.,
|
648
|
+
module_eval <<-'.,.,1227458033572.,.,', 'ast.dr', 145
|
651
649
|
def _act_14 val
|
652
650
|
_fact_list, _, _fact, = *val
|
653
651
|
_fact_list.push _fact
|
654
652
|
|
655
653
|
end
|
656
|
-
.,.,
|
654
|
+
.,.,1227458033572.,.,
|
657
655
|
|
658
|
-
module_eval <<-'.,.,
|
656
|
+
module_eval <<-'.,.,12274580337279.,.,', 'ast.dr', 148
|
659
657
|
def _act_15 val
|
660
658
|
_ID, = *val
|
661
659
|
_ID.value
|
662
660
|
|
663
661
|
end
|
664
|
-
.,.,
|
662
|
+
.,.,12274580337279.,.,
|
665
663
|
|
666
|
-
module_eval <<-'.,.,
|
664
|
+
module_eval <<-'.,.,122745803312359.,.,', 'ast.dr', 149
|
667
665
|
def _act_16 val
|
668
666
|
_, _ID, = *val
|
669
667
|
'-' + _ID.value
|
670
668
|
|
671
669
|
end
|
672
|
-
.,.,
|
670
|
+
.,.,122745803312359.,.,
|
673
671
|
|
674
|
-
module_eval <<-'.,.,
|
672
|
+
module_eval <<-'.,.,122745803363891.,.,', 'ast.dr', 152
|
675
673
|
def _act_17 val
|
676
674
|
_ID, = *val
|
677
675
|
[ _ID.value ]
|
678
676
|
|
679
677
|
end
|
680
|
-
.,.,
|
678
|
+
.,.,122745803363891.,.,
|
681
679
|
|
682
|
-
module_eval <<-'.,.,
|
680
|
+
module_eval <<-'.,.,122745803346333.,.,', 'ast.dr', 153
|
683
681
|
def _act_18 val
|
684
682
|
_id_list, _, _ID, = *val
|
685
683
|
_id_list.push _ID.value
|
686
684
|
|
687
685
|
end
|
688
|
-
.,.,
|
686
|
+
.,.,122745803346333.,.,
|
689
687
|
|
690
|
-
module_eval <<-'.,.,
|
688
|
+
module_eval <<-'.,.,122745803358364.,.,', 'ast.dr', 156
|
691
689
|
def _act_19 val
|
692
690
|
{nil => Token['', 0]}
|
693
691
|
|
694
692
|
end
|
695
|
-
.,.,
|
693
|
+
.,.,122745803358364.,.,
|
696
694
|
|
697
|
-
module_eval <<-'.,.,
|
695
|
+
module_eval <<-'.,.,122745803347204.,.,', 'ast.dr', 157
|
698
696
|
def _act_20 val
|
699
697
|
_ACTION, = *val
|
700
698
|
{nil => _ACTION}
|
701
699
|
|
702
700
|
end
|
703
|
-
.,.,
|
701
|
+
.,.,122745803347204.,.,
|
704
702
|
|
705
|
-
module_eval <<-'.,.,
|
703
|
+
module_eval <<-'.,.,122745803352244.,.,', 'ast.dr', 159
|
706
704
|
def _act_21 val
|
707
705
|
_pass_action_list, = *val
|
708
706
|
|
709
707
|
Hash[ *_pass_action_list.flatten ].merge({nil => Token['', 0]})
|
710
708
|
|
711
709
|
end
|
712
|
-
.,.,
|
710
|
+
.,.,122745803352244.,.,
|
713
711
|
|
714
|
-
module_eval <<-'.,.,
|
712
|
+
module_eval <<-'.,.,122745803353056.,.,', 'ast.dr', 164
|
715
713
|
def _act_22 val
|
716
714
|
_pass_action, = *val
|
717
715
|
[ _pass_action ]
|
718
716
|
|
719
717
|
end
|
720
|
-
.,.,
|
718
|
+
.,.,122745803353056.,.,
|
721
719
|
|
722
|
-
module_eval <<-'.,.,
|
720
|
+
module_eval <<-'.,.,122745803358655.,.,', 'ast.dr', 165
|
723
721
|
def _act_23 val
|
724
722
|
_pass_action_list, _pass_action, = *val
|
725
723
|
_pass_action_list << _pass_action
|
726
724
|
|
727
725
|
end
|
728
|
-
.,.,
|
726
|
+
.,.,122745803358655.,.,
|
729
727
|
|
730
|
-
module_eval <<-'.,.,
|
728
|
+
module_eval <<-'.,.,122745803347204.,.,', 'ast.dr', 169
|
731
729
|
def _act_24 val
|
732
730
|
_, _ID, _, _ACTION, = *val
|
733
731
|
[_ID.value, _ACTION]
|
734
732
|
|
735
733
|
end
|
736
|
-
.,.,
|
734
|
+
.,.,122745803347204.,.,
|
737
735
|
|
738
736
|
end
|
739
737
|
|
740
738
|
|
741
739
|
###
|
742
|
-
###
|
740
|
+
### ASTBuilderExtension_post_rhs - Part of Depager Extension (slave)
|
743
741
|
###
|
744
|
-
module
|
742
|
+
module D4ASTBuilderExtension_post_rhs #:nodoc:all
|
745
743
|
end
|
746
744
|
|
747
|
-
class
|
745
|
+
class ASTBuilderExtension_post_rhs < Depager::LALR::Basis #:nodoc:all
|
748
746
|
include Depager::ExtensionUtils
|
749
747
|
|
750
748
|
|
@@ -819,101 +817,101 @@ class ASTBuilderExtension_postrhs < Depager::LALR::Basis #:nodoc:all
|
|
819
817
|
]
|
820
818
|
### Action Table
|
821
819
|
action_table = [
|
822
|
-
[ nil, nil,
|
823
|
-
[ ACC, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
824
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 14, 15, ],
|
820
|
+
[ nil, nil, 13, nil, nil, nil, 9, 11, 1, 3, 6, 8, nil, 12, nil, nil, nil, ],
|
825
821
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
826
822
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
827
823
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
828
|
-
[ nil, nil, nil, 18, nil, nil, nil, nil, nil, nil, nil, nil, 17, nil, nil, nil, nil, ],
|
829
824
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
825
|
+
[ ACC, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
830
826
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
827
|
+
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 14, 15, ],
|
831
828
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
832
829
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
833
830
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
834
831
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
835
|
-
[ nil, nil,
|
836
|
-
[ nil, nil,
|
837
|
-
[ nil, nil,
|
832
|
+
[ nil, nil, 13, nil, nil, nil, 9, 11, 1, 3, 6, 8, nil, 12, 16, nil, nil, ],
|
833
|
+
[ nil, nil, nil, 19, nil, nil, nil, nil, nil, nil, nil, nil, 21, nil, nil, nil, nil, ],
|
834
|
+
[ nil, nil, 13, nil, nil, nil, 9, 11, 1, 3, 6, 8, nil, 12, nil, nil, nil, ],
|
835
|
+
[ nil, nil, 13, nil, nil, nil, 9, 11, 1, 3, 6, 8, nil, 12, nil, nil, nil, ],
|
838
836
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
837
|
+
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 14, 15, ],
|
838
|
+
[ nil, nil, nil, nil, nil, 25, nil, nil, nil, nil, nil, nil, nil, nil, 24, nil, nil, ],
|
839
|
+
[ nil, nil, 13, nil, 26, nil, 9, 11, 1, 3, 6, 8, nil, 12, nil, nil, nil, ],
|
839
840
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
840
|
-
[ nil, nil, 6, nil, 24, nil, 7, 8, 9, 10, 11, 12, nil, 13, nil, nil, nil, ],
|
841
841
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
842
|
-
[ nil, nil, nil, nil, nil, 27, nil, nil, nil, nil, nil, nil, nil, nil, 26, nil, nil, ],
|
843
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 14, 15, ],
|
844
842
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 14, 15, ],
|
845
843
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 14, 15, ],
|
846
844
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
847
|
-
[ nil, nil,
|
848
|
-
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
849
|
-
[ nil, nil, 6, nil, nil, nil, 7, 8, 9, 10, 11, 12, nil, 13, nil, nil, nil, ],
|
845
|
+
[ nil, nil, 13, nil, nil, nil, 9, 11, 1, 3, 6, 8, nil, 12, nil, nil, nil, ],
|
850
846
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
847
|
+
[ nil, nil, nil, nil, 29, 25, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
851
848
|
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 14, 15, ],
|
849
|
+
[ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, ],
|
852
850
|
]
|
853
851
|
### Default Reduce Table
|
854
852
|
defred_table = [
|
855
853
|
nil,
|
856
|
-
nil,
|
857
|
-
-1,
|
858
|
-
-6,
|
859
|
-
-7,
|
860
|
-
-8,
|
861
|
-
-16,
|
862
|
-
-10,
|
863
|
-
-11,
|
864
854
|
-12,
|
855
|
+
-6,
|
865
856
|
-13,
|
857
|
+
-8,
|
858
|
+
nil,
|
866
859
|
-14,
|
860
|
+
-1,
|
867
861
|
-15,
|
862
|
+
-10,
|
863
|
+
-7,
|
864
|
+
-11,
|
868
865
|
nil,
|
866
|
+
-16,
|
869
867
|
nil,
|
870
868
|
nil,
|
871
|
-
-9,
|
872
|
-
-17,
|
873
|
-
nil,
|
874
869
|
-18,
|
875
|
-
nil,
|
876
870
|
-4,
|
871
|
+
nil,
|
872
|
+
nil,
|
873
|
+
-9,
|
874
|
+
-17,
|
877
875
|
-20,
|
878
876
|
-21,
|
879
|
-
-2,
|
880
|
-
nil,
|
881
877
|
-19,
|
882
878
|
nil,
|
883
|
-
-
|
879
|
+
-2,
|
880
|
+
nil,
|
884
881
|
-5,
|
882
|
+
-3,
|
885
883
|
]
|
886
884
|
defred_after_shift_table = [
|
887
885
|
nil,
|
888
|
-
|
889
|
-
nil,
|
886
|
+
-12,
|
890
887
|
-6,
|
891
|
-
-
|
888
|
+
-13,
|
892
889
|
-8,
|
893
890
|
nil,
|
894
|
-
-10,
|
895
|
-
-11,
|
896
|
-
-12,
|
897
|
-
-13,
|
898
891
|
-14,
|
892
|
+
nil,
|
899
893
|
-15,
|
894
|
+
-10,
|
895
|
+
-7,
|
896
|
+
-11,
|
900
897
|
nil,
|
901
898
|
nil,
|
902
899
|
nil,
|
903
|
-
-9,
|
904
|
-
-17,
|
905
900
|
nil,
|
906
901
|
-18,
|
907
902
|
nil,
|
908
903
|
nil,
|
909
904
|
nil,
|
905
|
+
-9,
|
906
|
+
-17,
|
910
907
|
nil,
|
911
|
-
-2,
|
912
908
|
nil,
|
913
909
|
-19,
|
914
910
|
nil,
|
915
|
-
-
|
911
|
+
-2,
|
912
|
+
nil,
|
916
913
|
nil,
|
914
|
+
-3,
|
917
915
|
]
|
918
916
|
### Nonterm to Int
|
919
917
|
nt2i = {
|
@@ -937,34 +935,34 @@ class ASTBuilderExtension_postrhs < Depager::LALR::Basis #:nodoc:all
|
|
937
935
|
]
|
938
936
|
### Goto Table
|
939
937
|
goto_table = [
|
940
|
-
[
|
938
|
+
[ 5, 7, 10, nil, 2, 4, nil, ],
|
941
939
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
942
940
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
943
941
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
944
942
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
945
943
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
946
|
-
[ nil, nil, nil, nil, nil, nil, 16, ],
|
947
944
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
948
945
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
949
946
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
950
947
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
951
948
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
952
949
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
953
|
-
[ nil,
|
954
|
-
[ nil,
|
955
|
-
[ nil,
|
950
|
+
[ nil, 17, 10, 18, 2, 4, nil, ],
|
951
|
+
[ nil, nil, nil, nil, nil, nil, 20, ],
|
952
|
+
[ nil, 22, 10, nil, 2, 4, nil, ],
|
953
|
+
[ nil, 23, 10, nil, 2, 4, nil, ],
|
956
954
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
957
955
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
958
|
-
[ nil, 21, 4, 25, 3, 5, nil, ],
|
959
956
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
957
|
+
[ nil, 17, 10, 27, 2, 4, nil, ],
|
960
958
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
961
959
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
962
960
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
963
961
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
964
962
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
963
|
+
[ nil, 28, 10, nil, 2, 4, nil, ],
|
965
964
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
966
965
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
967
|
-
[ nil, 29, 4, nil, 3, 5, nil, ],
|
968
966
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
969
967
|
[ nil, nil, nil, nil, nil, nil, nil, ],
|
970
968
|
]
|
@@ -979,7 +977,7 @@ class ASTBuilderExtension_postrhs < Depager::LALR::Basis #:nodoc:all
|
|
979
977
|
@g_parser = @p = p
|
980
978
|
@master = @m = master
|
981
979
|
@nparam = nparam
|
982
|
-
@dect =
|
980
|
+
@dect = D4ASTBuilderExtension_post_rhs::NVAction.new(self)
|
983
981
|
init_parser
|
984
982
|
end
|
985
983
|
|
@@ -1017,52 +1015,52 @@ class ASTBuilderExtension_postrhs < Depager::LALR::Basis #:nodoc:all
|
|
1017
1015
|
|
1018
1016
|
when /\A<</
|
1019
1017
|
@oldline = @line; @line = $'
|
1020
|
-
yield
|
1018
|
+
yield token(:LL, $&)
|
1021
1019
|
|
1022
1020
|
|
1023
1021
|
when /\A%([a-zA-Z0-9_]+)((::[a-zA-Z0-9_]+)*)/
|
1024
1022
|
@oldline = @line; @line = $'
|
1025
|
-
yield
|
1023
|
+
yield token(:CONST, $1+$2)
|
1026
1024
|
|
1027
1025
|
|
1028
1026
|
when /\A%\((.+)\)%/
|
1029
1027
|
@oldline = @line; @line = $'
|
1030
|
-
yield
|
1028
|
+
yield token(:EMBED, $1)
|
1031
1029
|
|
1032
1030
|
|
1033
1031
|
when /\Anil/
|
1034
1032
|
@oldline = @line; @line = $'
|
1035
|
-
yield
|
1033
|
+
yield token(:NIL, $&)
|
1036
1034
|
|
1037
1035
|
|
1038
1036
|
when /\ANilNode/
|
1039
1037
|
@oldline = @line; @line = $'
|
1040
|
-
yield
|
1038
|
+
yield token(:NILNODE, $&)
|
1041
1039
|
|
1042
1040
|
|
1043
1041
|
when /\A[0-9]+/
|
1044
1042
|
@oldline = @line; @line = $'
|
1045
|
-
yield
|
1043
|
+
yield token(:NUMBER, $&.to_i)
|
1046
1044
|
|
1047
1045
|
|
1048
1046
|
when /\A:[a-zA-Z0-9_]+/
|
1049
1047
|
@oldline = @line; @line = $'
|
1050
|
-
yield
|
1048
|
+
yield token(:SYMBOL, $&)
|
1051
1049
|
|
1052
1050
|
|
1053
1051
|
when /\A[a-zA-Z][a-zA-Z0-9_]*/
|
1054
1052
|
@oldline = @line; @line = $'
|
1055
|
-
yield
|
1053
|
+
yield token(:ID, $&)
|
1056
1054
|
|
1057
1055
|
|
1058
1056
|
when /\A'(.+)'/
|
1059
1057
|
@oldline = @line; @line = $'
|
1060
|
-
yield
|
1058
|
+
yield token(:STR, $1)
|
1061
1059
|
|
1062
1060
|
|
1063
1061
|
when /\A./
|
1064
1062
|
@oldline = @line; @line = $'
|
1065
|
-
yield
|
1063
|
+
yield token($&, $&)
|
1066
1064
|
|
1067
1065
|
|
1068
1066
|
else
|
@@ -1083,9 +1081,9 @@ end
|
|
1083
1081
|
|
1084
1082
|
### Outer Code
|
1085
1083
|
|
1086
|
-
class
|
1084
|
+
class D4ASTBuilderExtension_post_rhs::NVAction < Depager::LALR::Action #:nodoc:all
|
1087
1085
|
include Depager::DecoratorUtils
|
1088
|
-
|
1086
|
+
|
1089
1087
|
on_reduce = [
|
1090
1088
|
nil,
|
1091
1089
|
:_act_0,
|
@@ -1119,7 +1117,7 @@ class D4ASTBuilderExtension_postrhs::NVAction < Depager::LALR::Action #:nodoc:al
|
|
1119
1117
|
end
|
1120
1118
|
|
1121
1119
|
|
1122
|
-
module_eval <<-'.,.,
|
1120
|
+
module_eval <<-'.,.,122745803323544.,.,', 'ast.dr', 206
|
1123
1121
|
def _act_0 val
|
1124
1122
|
_fnl, = *val
|
1125
1123
|
|
@@ -1129,17 +1127,17 @@ def _act_0 val
|
|
1129
1127
|
master.on_reduce[n] = ":_ast_#{n}"
|
1130
1128
|
|
1131
1129
|
end
|
1132
|
-
.,.,
|
1130
|
+
.,.,122745803323544.,.,
|
1133
1131
|
|
1134
|
-
module_eval <<-'.,.,
|
1132
|
+
module_eval <<-'.,.,122745803342416.,.,', 'ast.dr', 214
|
1135
1133
|
def _act_1 val
|
1136
1134
|
_ID, _, _, = *val
|
1137
1135
|
"Node_#{_ID.value}.new(basis.file.lineno)"
|
1138
1136
|
|
1139
1137
|
end
|
1140
|
-
.,.,
|
1138
|
+
.,.,122745803342416.,.,
|
1141
1139
|
|
1142
|
-
module_eval <<-'.,.,
|
1140
|
+
module_eval <<-'.,.,122745803355262.,.,', 'ast.dr', 216
|
1143
1141
|
def _act_2 val
|
1144
1142
|
_ID, _, _fnlpair, _, = *val
|
1145
1143
|
|
@@ -1150,49 +1148,49 @@ def _act_2 val
|
|
1150
1148
|
end
|
1151
1149
|
|
1152
1150
|
end
|
1153
|
-
.,.,
|
1151
|
+
.,.,122745803355262.,.,
|
1154
1152
|
|
1155
|
-
module_eval <<-'.,.,
|
1153
|
+
module_eval <<-'.,.,122745803363965.,.,', 'ast.dr', 225
|
1156
1154
|
def _act_3 val
|
1157
1155
|
_fnl, = *val
|
1158
1156
|
[_fnl]
|
1159
1157
|
|
1160
1158
|
end
|
1161
|
-
.,.,
|
1159
|
+
.,.,122745803363965.,.,
|
1162
1160
|
|
1163
|
-
module_eval <<-'.,.,
|
1161
|
+
module_eval <<-'.,.,122745803314919.,.,', 'ast.dr', 226
|
1164
1162
|
def _act_4 val
|
1165
1163
|
_fnlpair, _, _fnl, = *val
|
1166
1164
|
_fnlpair << _fnl
|
1167
1165
|
|
1168
1166
|
end
|
1169
|
-
.,.,
|
1167
|
+
.,.,122745803314919.,.,
|
1170
1168
|
|
1171
|
-
module_eval <<-'.,.,
|
1169
|
+
module_eval <<-'.,.,122745803310521.,.,', 'ast.dr', 229
|
1172
1170
|
def _act_5 val
|
1173
1171
|
_fact, = *val
|
1174
1172
|
_fact
|
1175
1173
|
|
1176
1174
|
end
|
1177
|
-
.,.,
|
1175
|
+
.,.,122745803310521.,.,
|
1178
1176
|
|
1179
|
-
module_eval <<-'.,.,
|
1177
|
+
module_eval <<-'.,.,122745803362726.,.,', 'ast.dr', 230
|
1180
1178
|
def _act_6 val
|
1181
1179
|
_node, = *val
|
1182
1180
|
_node
|
1183
1181
|
|
1184
1182
|
end
|
1185
|
-
.,.,
|
1183
|
+
.,.,122745803362726.,.,
|
1186
1184
|
|
1187
|
-
module_eval <<-'.,.,
|
1185
|
+
module_eval <<-'.,.,122745803349195.,.,', 'ast.dr', 231
|
1188
1186
|
def _act_7 val
|
1189
1187
|
_list, = *val
|
1190
1188
|
_list
|
1191
1189
|
|
1192
1190
|
end
|
1193
|
-
.,.,
|
1191
|
+
.,.,122745803349195.,.,
|
1194
1192
|
|
1195
|
-
module_eval <<-'.,.,
|
1193
|
+
module_eval <<-'.,.,122745803359728.,.,', 'ast.dr', 235
|
1196
1194
|
def _act_8 val
|
1197
1195
|
_ID, _opt_embed, = *val
|
1198
1196
|
|
@@ -1203,80 +1201,80 @@ def _act_8 val
|
|
1203
1201
|
"val[#{i}]#{val[1]}"
|
1204
1202
|
|
1205
1203
|
end
|
1206
|
-
.,.,
|
1204
|
+
.,.,122745803359728.,.,
|
1207
1205
|
|
1208
|
-
module_eval <<-'.,.,
|
1206
|
+
module_eval <<-'.,.,122745803321128.,.,', 'ast.dr', 242
|
1209
1207
|
def _act_9 val
|
1210
1208
|
_CONST, = *val
|
1211
1209
|
"Depager::Token[#{_CONST.value}]"
|
1212
1210
|
|
1213
1211
|
end
|
1214
|
-
.,.,
|
1212
|
+
.,.,122745803321128.,.,
|
1215
1213
|
|
1216
|
-
module_eval <<-'.,.,
|
1214
|
+
module_eval <<-'.,.,122745803364413.,.,', 'ast.dr', 243
|
1217
1215
|
def _act_10 val
|
1218
1216
|
_SYMBOL, = *val
|
1219
1217
|
"Depager::Token[#{_SYMBOL.value}]"
|
1220
1218
|
|
1221
1219
|
end
|
1222
|
-
.,.,
|
1220
|
+
.,.,122745803364413.,.,
|
1223
1221
|
|
1224
|
-
module_eval <<-'.,.,
|
1222
|
+
module_eval <<-'.,.,122745803318993.,.,', 'ast.dr', 244
|
1225
1223
|
def _act_11 val
|
1226
1224
|
_STR, = *val
|
1227
1225
|
"Depager::Token['#{_STR.value}']"
|
1228
1226
|
|
1229
1227
|
end
|
1230
|
-
.,.,
|
1228
|
+
.,.,122745803318993.,.,
|
1231
1229
|
|
1232
|
-
module_eval <<-'.,.,
|
1230
|
+
module_eval <<-'.,.,122745803313763.,.,', 'ast.dr', 245
|
1233
1231
|
def _act_12 val
|
1234
1232
|
_NILNODE, = *val
|
1235
1233
|
"NilNode.new(basis.file.lineno)"
|
1236
1234
|
|
1237
1235
|
end
|
1238
|
-
.,.,
|
1236
|
+
.,.,122745803313763.,.,
|
1239
1237
|
|
1240
|
-
module_eval <<-'.,.,
|
1238
|
+
module_eval <<-'.,.,122745803311965.,.,', 'ast.dr', 246
|
1241
1239
|
def _act_13 val
|
1242
1240
|
_NUMBER, = *val
|
1243
1241
|
"Depager::Token[#{_NUMBER.value}]"
|
1244
1242
|
|
1245
1243
|
end
|
1246
|
-
.,.,
|
1244
|
+
.,.,122745803311965.,.,
|
1247
1245
|
|
1248
|
-
module_eval <<-'.,.,
|
1246
|
+
module_eval <<-'.,.,122745803349781.,.,', 'ast.dr', 247
|
1249
1247
|
def _act_14 val
|
1250
1248
|
_NIL, = *val
|
1251
1249
|
"nil"
|
1252
1250
|
|
1253
1251
|
end
|
1254
|
-
.,.,
|
1252
|
+
.,.,122745803349781.,.,
|
1255
1253
|
|
1256
|
-
module_eval <<-'.,.,
|
1254
|
+
module_eval <<-'.,.,122745803334484.,.,', 'ast.dr', 250
|
1257
1255
|
def _act_15 val
|
1258
1256
|
''
|
1259
1257
|
|
1260
1258
|
end
|
1261
|
-
.,.,
|
1259
|
+
.,.,122745803334484.,.,
|
1262
1260
|
|
1263
|
-
module_eval <<-'.,.,
|
1261
|
+
module_eval <<-'.,.,122745803333629.,.,', 'ast.dr', 251
|
1264
1262
|
def _act_16 val
|
1265
1263
|
_EMBED, = *val
|
1266
1264
|
_EMBED.value
|
1267
1265
|
|
1268
1266
|
end
|
1269
|
-
.,.,
|
1267
|
+
.,.,122745803333629.,.,
|
1270
1268
|
|
1271
|
-
module_eval <<-'.,.,
|
1269
|
+
module_eval <<-'.,.,122745803344085.,.,', 'ast.dr', 254
|
1272
1270
|
def _act_17 val
|
1273
1271
|
_, _, = *val
|
1274
1272
|
"NodeList.new(basis.file.lineno, [])"
|
1275
1273
|
|
1276
1274
|
end
|
1277
|
-
.,.,
|
1275
|
+
.,.,122745803344085.,.,
|
1278
1276
|
|
1279
|
-
module_eval <<-'.,.,
|
1277
|
+
module_eval <<-'.,.,122745803324936.,.,', 'ast.dr', 256
|
1280
1278
|
def _act_18 val
|
1281
1279
|
_, _fnlpair, _, = *val
|
1282
1280
|
|
@@ -1287,23 +1285,23 @@ def _act_18 val
|
|
1287
1285
|
end
|
1288
1286
|
|
1289
1287
|
end
|
1290
|
-
.,.,
|
1288
|
+
.,.,122745803324936.,.,
|
1291
1289
|
|
1292
|
-
module_eval <<-'.,.,
|
1290
|
+
module_eval <<-'.,.,122745803328741.,.,', 'ast.dr', 263
|
1293
1291
|
def _act_19 val
|
1294
1292
|
_l, _LL, _r, = *val
|
1295
1293
|
"#{_l}.push(#{_r})"
|
1296
1294
|
|
1297
1295
|
end
|
1298
|
-
.,.,
|
1296
|
+
.,.,122745803328741.,.,
|
1299
1297
|
|
1300
|
-
module_eval <<-'.,.,
|
1298
|
+
module_eval <<-'.,.,122745803318918.,.,', 'ast.dr', 264
|
1301
1299
|
def _act_20 val
|
1302
1300
|
_l, _, _r, = *val
|
1303
1301
|
"#{_l}.concat(#{_r})"
|
1304
1302
|
|
1305
1303
|
end
|
1306
|
-
.,.,
|
1304
|
+
.,.,122745803318918.,.,
|
1307
1305
|
|
1308
1306
|
end
|
1309
1307
|
|