nodewrap 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +59 -0
- data/LEGAL +6 -0
- data/LGPL +515 -0
- data/LICENSE +6 -0
- data/README +31 -0
- data/TODO +9 -0
- data/example/README +5 -0
- data/example/simple_client.rb +12 -0
- data/example/simple_server.rb +11 -0
- data/example/triangle_client.rb +7 -0
- data/example/triangle_server.rb +24 -0
- data/ext/MANIFEST +11 -0
- data/ext/builtins.h +25 -0
- data/ext/cached/ruby-1.6.3/COPYING +340 -0
- data/ext/cached/ruby-1.6.3/README +3 -0
- data/ext/cached/ruby-1.6.3/classpath.c +3 -0
- data/ext/cached/ruby-1.6.3/classpath.h +8 -0
- data/ext/cached/ruby-1.6.3/evalinfo.h +62 -0
- data/ext/cached/ruby-1.6.3/global_entry.h +15 -0
- data/ext/cached/ruby-1.6.3/insns_info.c +40 -0
- data/ext/cached/ruby-1.6.3/insns_info.h +19 -0
- data/ext/cached/ruby-1.6.3/node_type_descrip.c +150 -0
- data/ext/cached/ruby-1.6.3/nodeinfo.c +3182 -0
- data/ext/cached/ruby-1.6.3/nodeinfo.h +66 -0
- data/ext/cached/ruby-1.6.4/COPYING +340 -0
- data/ext/cached/ruby-1.6.4/README +3 -0
- data/ext/cached/ruby-1.6.4/classpath.c +3 -0
- data/ext/cached/ruby-1.6.4/classpath.h +8 -0
- data/ext/cached/ruby-1.6.4/evalinfo.h +62 -0
- data/ext/cached/ruby-1.6.4/global_entry.h +15 -0
- data/ext/cached/ruby-1.6.4/insns_info.c +40 -0
- data/ext/cached/ruby-1.6.4/insns_info.h +19 -0
- data/ext/cached/ruby-1.6.4/node_type_descrip.c +150 -0
- data/ext/cached/ruby-1.6.4/nodeinfo.c +3182 -0
- data/ext/cached/ruby-1.6.4/nodeinfo.h +66 -0
- data/ext/cached/ruby-1.6.5/COPYING +56 -0
- data/ext/cached/ruby-1.6.5/GPL +340 -0
- data/ext/cached/ruby-1.6.5/LEGAL +325 -0
- data/ext/cached/ruby-1.6.5/LGPL +504 -0
- data/ext/cached/ruby-1.6.5/README +3 -0
- data/ext/cached/ruby-1.6.5/classpath.c +3 -0
- data/ext/cached/ruby-1.6.5/classpath.h +8 -0
- data/ext/cached/ruby-1.6.5/evalinfo.h +63 -0
- data/ext/cached/ruby-1.6.5/global_entry.h +15 -0
- data/ext/cached/ruby-1.6.5/insns_info.c +40 -0
- data/ext/cached/ruby-1.6.5/insns_info.h +19 -0
- data/ext/cached/ruby-1.6.5/node_type_descrip.c +150 -0
- data/ext/cached/ruby-1.6.5/nodeinfo.c +3182 -0
- data/ext/cached/ruby-1.6.5/nodeinfo.h +66 -0
- data/ext/cached/ruby-1.6.7/COPYING +56 -0
- data/ext/cached/ruby-1.6.7/GPL +340 -0
- data/ext/cached/ruby-1.6.7/LEGAL +308 -0
- data/ext/cached/ruby-1.6.7/LGPL +504 -0
- data/ext/cached/ruby-1.6.7/README +3 -0
- data/ext/cached/ruby-1.6.7/classpath.c +3 -0
- data/ext/cached/ruby-1.6.7/classpath.h +8 -0
- data/ext/cached/ruby-1.6.7/evalinfo.h +63 -0
- data/ext/cached/ruby-1.6.7/global_entry.h +15 -0
- data/ext/cached/ruby-1.6.7/insns_info.c +40 -0
- data/ext/cached/ruby-1.6.7/insns_info.h +19 -0
- data/ext/cached/ruby-1.6.7/node_type_descrip.c +150 -0
- data/ext/cached/ruby-1.6.7/nodeinfo.c +3182 -0
- data/ext/cached/ruby-1.6.7/nodeinfo.h +66 -0
- data/ext/cached/ruby-1.6.8/COPYING +56 -0
- data/ext/cached/ruby-1.6.8/GPL +340 -0
- data/ext/cached/ruby-1.6.8/LEGAL +308 -0
- data/ext/cached/ruby-1.6.8/LGPL +504 -0
- data/ext/cached/ruby-1.6.8/README +3 -0
- data/ext/cached/ruby-1.6.8/classpath.c +3 -0
- data/ext/cached/ruby-1.6.8/classpath.h +8 -0
- data/ext/cached/ruby-1.6.8/evalinfo.h +63 -0
- data/ext/cached/ruby-1.6.8/global_entry.h +15 -0
- data/ext/cached/ruby-1.6.8/insns_info.c +40 -0
- data/ext/cached/ruby-1.6.8/insns_info.h +19 -0
- data/ext/cached/ruby-1.6.8/node_type_descrip.c +150 -0
- data/ext/cached/ruby-1.6.8/nodeinfo.c +3182 -0
- data/ext/cached/ruby-1.6.8/nodeinfo.h +66 -0
- data/ext/cached/ruby-1.8.0/COPYING +56 -0
- data/ext/cached/ruby-1.8.0/GPL +340 -0
- data/ext/cached/ruby-1.8.0/LEGAL +371 -0
- data/ext/cached/ruby-1.8.0/LGPL +504 -0
- data/ext/cached/ruby-1.8.0/README +3 -0
- data/ext/cached/ruby-1.8.0/classpath.c +27 -0
- data/ext/cached/ruby-1.8.0/classpath.h +14 -0
- data/ext/cached/ruby-1.8.0/evalinfo.h +65 -0
- data/ext/cached/ruby-1.8.0/global_entry.h +10 -0
- data/ext/cached/ruby-1.8.0/insns_info.c +40 -0
- data/ext/cached/ruby-1.8.0/insns_info.h +19 -0
- data/ext/cached/ruby-1.8.0/node_type_descrip.c +150 -0
- data/ext/cached/ruby-1.8.0/nodeinfo.c +3199 -0
- data/ext/cached/ruby-1.8.0/nodeinfo.h +66 -0
- data/ext/cached/ruby-1.8.1/COPYING +56 -0
- data/ext/cached/ruby-1.8.1/GPL +340 -0
- data/ext/cached/ruby-1.8.1/LEGAL +371 -0
- data/ext/cached/ruby-1.8.1/LGPL +504 -0
- data/ext/cached/ruby-1.8.1/README +3 -0
- data/ext/cached/ruby-1.8.1/classpath.c +27 -0
- data/ext/cached/ruby-1.8.1/classpath.h +14 -0
- data/ext/cached/ruby-1.8.1/evalinfo.h +59 -0
- data/ext/cached/ruby-1.8.1/global_entry.h +10 -0
- data/ext/cached/ruby-1.8.1/insns_info.c +40 -0
- data/ext/cached/ruby-1.8.1/insns_info.h +19 -0
- data/ext/cached/ruby-1.8.1/node_type_descrip.c +150 -0
- data/ext/cached/ruby-1.8.1/nodeinfo.c +3199 -0
- data/ext/cached/ruby-1.8.1/nodeinfo.h +66 -0
- data/ext/cached/ruby-1.8.2/COPYING +56 -0
- data/ext/cached/ruby-1.8.2/GPL +340 -0
- data/ext/cached/ruby-1.8.2/LEGAL +371 -0
- data/ext/cached/ruby-1.8.2/LGPL +504 -0
- data/ext/cached/ruby-1.8.2/README +3 -0
- data/ext/cached/ruby-1.8.2/classpath.c +45 -0
- data/ext/cached/ruby-1.8.2/classpath.h +17 -0
- data/ext/cached/ruby-1.8.2/evalinfo.h +60 -0
- data/ext/cached/ruby-1.8.2/global_entry.h +10 -0
- data/ext/cached/ruby-1.8.2/insns_info.c +40 -0
- data/ext/cached/ruby-1.8.2/insns_info.h +19 -0
- data/ext/cached/ruby-1.8.2/node_type_descrip.c +150 -0
- data/ext/cached/ruby-1.8.2/nodeinfo.c +3199 -0
- data/ext/cached/ruby-1.8.2/nodeinfo.h +66 -0
- data/ext/cached/ruby-1.8.3/COPYING +56 -0
- data/ext/cached/ruby-1.8.3/GPL +340 -0
- data/ext/cached/ruby-1.8.3/LEGAL +370 -0
- data/ext/cached/ruby-1.8.3/LGPL +504 -0
- data/ext/cached/ruby-1.8.3/README +3 -0
- data/ext/cached/ruby-1.8.3/classpath.c +45 -0
- data/ext/cached/ruby-1.8.3/classpath.h +17 -0
- data/ext/cached/ruby-1.8.3/evalinfo.h +61 -0
- data/ext/cached/ruby-1.8.3/global_entry.h +10 -0
- data/ext/cached/ruby-1.8.3/insns_info.c +40 -0
- data/ext/cached/ruby-1.8.3/insns_info.h +19 -0
- data/ext/cached/ruby-1.8.3/node_type_descrip.c +150 -0
- data/ext/cached/ruby-1.8.3/nodeinfo.c +3199 -0
- data/ext/cached/ruby-1.8.3/nodeinfo.h +66 -0
- data/ext/cached/ruby-1.8.4/COPYING +56 -0
- data/ext/cached/ruby-1.8.4/GPL +340 -0
- data/ext/cached/ruby-1.8.4/LEGAL +370 -0
- data/ext/cached/ruby-1.8.4/LGPL +504 -0
- data/ext/cached/ruby-1.8.4/README +3 -0
- data/ext/cached/ruby-1.8.4/classpath.c +45 -0
- data/ext/cached/ruby-1.8.4/classpath.h +17 -0
- data/ext/cached/ruby-1.8.4/evalinfo.h +61 -0
- data/ext/cached/ruby-1.8.4/global_entry.h +10 -0
- data/ext/cached/ruby-1.8.4/insns_info.c +40 -0
- data/ext/cached/ruby-1.8.4/insns_info.h +19 -0
- data/ext/cached/ruby-1.8.4/node_type_descrip.c +150 -0
- data/ext/cached/ruby-1.8.4/nodeinfo.c +3199 -0
- data/ext/cached/ruby-1.8.4/nodeinfo.h +66 -0
- data/ext/cached/ruby-1.8.5/COPYING +56 -0
- data/ext/cached/ruby-1.8.5/GPL +340 -0
- data/ext/cached/ruby-1.8.5/LEGAL +370 -0
- data/ext/cached/ruby-1.8.5/LGPL +504 -0
- data/ext/cached/ruby-1.8.5/README +3 -0
- data/ext/cached/ruby-1.8.5/classpath.c +45 -0
- data/ext/cached/ruby-1.8.5/classpath.h +17 -0
- data/ext/cached/ruby-1.8.5/evalinfo.h +61 -0
- data/ext/cached/ruby-1.8.5/global_entry.h +10 -0
- data/ext/cached/ruby-1.8.5/insns_info.c +40 -0
- data/ext/cached/ruby-1.8.5/insns_info.h +19 -0
- data/ext/cached/ruby-1.8.5/node_type_descrip.c +150 -0
- data/ext/cached/ruby-1.8.5/nodeinfo.c +3187 -0
- data/ext/cached/ruby-1.8.5/nodeinfo.h +64 -0
- data/ext/cached/ruby-1.8.6/COPYING +56 -0
- data/ext/cached/ruby-1.8.6/GPL +340 -0
- data/ext/cached/ruby-1.8.6/LEGAL +370 -0
- data/ext/cached/ruby-1.8.6/LGPL +504 -0
- data/ext/cached/ruby-1.8.6/README +3 -0
- data/ext/cached/ruby-1.8.6/classpath.c +45 -0
- data/ext/cached/ruby-1.8.6/classpath.h +17 -0
- data/ext/cached/ruby-1.8.6/evalinfo.h +61 -0
- data/ext/cached/ruby-1.8.6/global_entry.h +10 -0
- data/ext/cached/ruby-1.8.6/insns_info.c +40 -0
- data/ext/cached/ruby-1.8.6/insns_info.h +19 -0
- data/ext/cached/ruby-1.8.6/node_type_descrip.c +150 -0
- data/ext/cached/ruby-1.8.6/nodeinfo.c +3187 -0
- data/ext/cached/ruby-1.8.6/nodeinfo.h +64 -0
- data/ext/classpath.c +42 -0
- data/ext/classpath.c.rpp +28 -0
- data/ext/classpath.h +17 -0
- data/ext/classpath.h.rpp +35 -0
- data/ext/evalinfo.h +21 -0
- data/ext/evalinfo.h.rpp +49 -0
- data/ext/extconf.rb +68 -0
- data/ext/generate.rb +201 -0
- data/ext/generate_cached.rb +49 -0
- data/ext/global_entry.h +10 -0
- data/ext/global_entry.h.rpp +25 -0
- data/ext/insns_info.c +6079 -0
- data/ext/insns_info.c.rpp +210 -0
- data/ext/insns_info.h +819 -0
- data/ext/insns_info.h.rpp +50 -0
- data/ext/node_type_descrip.c +148 -0
- data/ext/node_type_descrip.c.rpp +72 -0
- data/ext/node_type_descrip.h +17 -0
- data/ext/node_type_descrip.rb +169 -0
- data/ext/nodeinfo.c +3164 -0
- data/ext/nodeinfo.c.rpp +519 -0
- data/ext/nodeinfo.h +67 -0
- data/ext/nodeinfo.h.rpp +27 -0
- data/ext/nodewrap.c +2576 -0
- data/ext/nodewrap.h +20 -0
- data/ext/read_node_h.rb +19 -0
- data/ext/ruby_source_dir.rb +15 -0
- data/ext/ruby_version.h +12 -0
- data/ext/ruby_version_code.rb +16 -0
- data/ext/rubypp.rb +97 -0
- data/ext/test.rb +15 -0
- data/generate_rdoc.rb +33 -0
- data/install.rb +1022 -0
- data/lib/as_code.rb +347 -0
- data/lib/as_expression.rb +657 -0
- data/lib/bytedecoder.rb +848 -0
- data/lib/classtree.rb +54 -0
- data/lib/methodsig.rb +266 -0
- data/lib/node_to_a.rb +34 -0
- data/lib/nodepp.rb +71 -0
- data/lib/nwdebug.rb +18 -0
- data/lib/nwdump.rb +53 -0
- data/lib/nwobfusc.rb +57 -0
- data/lib/procsig.rb +182 -0
- data/lib/test.rb +8 -0
- data/metaconfig +10 -0
- data/post-config.rb +53 -0
- data/post-setup.rb +9 -0
- data/pre-config.rb +1 -0
- data/run_tests.rb +48 -0
- data/test/expression_samples.rb +158 -0
- data/test/node_samples.rb +122 -0
- data/test/test.rb +39 -0
- data/test/test2.rb +7 -0
- data/test/test3.rb +5 -0
- data/test/test4.rb +5 -0
- data/test/test_as_code.rb +249 -0
- data/test/test_as_expression.rb +222 -0
- data/test/test_methodsig.rb +189 -0
- data/test/test_nodewrap.rb +369 -0
- metadata +286 -0
data/ext/nodeinfo.c
ADDED
@@ -0,0 +1,3164 @@
|
|
1
|
+
#include "nodeinfo.h"
|
2
|
+
#include "version.h"
|
3
|
+
#include "global_entry.h"
|
4
|
+
#include "builtins.h"
|
5
|
+
|
6
|
+
static int is_flip_state(ID id)
|
7
|
+
{
|
8
|
+
if(id == 0)
|
9
|
+
{
|
10
|
+
return 1;
|
11
|
+
}
|
12
|
+
#if RUBY_VERSION_CODE >= 180
|
13
|
+
if(!rb_is_local_id(id))
|
14
|
+
{
|
15
|
+
return 1;
|
16
|
+
}
|
17
|
+
#endif
|
18
|
+
return 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
static VALUE variable_names(ID * tbl)
|
22
|
+
{
|
23
|
+
if(tbl)
|
24
|
+
{
|
25
|
+
size_t j;
|
26
|
+
VALUE arr = rb_ary_new();
|
27
|
+
/* A tbl contains the names of local variables. The first
|
28
|
+
* element is the size of the table. The next two elements
|
29
|
+
* are $_ and $~. The rest of the elements are the names of
|
30
|
+
* the variables themselves.
|
31
|
+
*/
|
32
|
+
for(j = 3; j <= tbl[0]; ++j)
|
33
|
+
{
|
34
|
+
if(is_flip_state(tbl[j]))
|
35
|
+
{
|
36
|
+
/* flip state */
|
37
|
+
rb_ary_push(arr, Qnil);
|
38
|
+
}
|
39
|
+
else
|
40
|
+
{
|
41
|
+
rb_ary_push(arr, ID2SYM(tbl[j]));
|
42
|
+
}
|
43
|
+
}
|
44
|
+
return arr;
|
45
|
+
}
|
46
|
+
else
|
47
|
+
{
|
48
|
+
return Qnil;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
/* Every node contains three elements. This function takes any one of
|
53
|
+
* those elements, converts it to a Ruby object that can be dumped
|
54
|
+
* (since nodes can't be dumped), and puts the resulting object into
|
55
|
+
* node_hash.
|
56
|
+
*/
|
57
|
+
VALUE dump_node_elem(enum Node_Elem_Name nen, NODE * n, VALUE node_hash)
|
58
|
+
{
|
59
|
+
switch(nen)
|
60
|
+
{
|
61
|
+
case NEN_NONE:
|
62
|
+
return Qnil;
|
63
|
+
case NEN_1ST:
|
64
|
+
if(n->nd_1st)
|
65
|
+
{
|
66
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_1st, node_hash);
|
67
|
+
return node_id(n->nd_1st);
|
68
|
+
}
|
69
|
+
else
|
70
|
+
{
|
71
|
+
return Qnil;
|
72
|
+
}
|
73
|
+
case NEN_2ND:
|
74
|
+
if(n->nd_2nd)
|
75
|
+
{
|
76
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_2nd, node_hash);
|
77
|
+
return node_id(n->nd_2nd);
|
78
|
+
}
|
79
|
+
else
|
80
|
+
{
|
81
|
+
return Qnil;
|
82
|
+
}
|
83
|
+
case NEN_AID:
|
84
|
+
if(n->nd_aid == 0)
|
85
|
+
{
|
86
|
+
return Qnil;
|
87
|
+
}
|
88
|
+
else
|
89
|
+
{
|
90
|
+
return ID2SYM(n->nd_aid);
|
91
|
+
}
|
92
|
+
case NEN_ALEN:
|
93
|
+
{
|
94
|
+
return LONG2NUM((long)n->nd_alen);
|
95
|
+
}
|
96
|
+
case NEN_ARGC:
|
97
|
+
{
|
98
|
+
return LONG2NUM((long)n->nd_argc);
|
99
|
+
}
|
100
|
+
case NEN_ARGS:
|
101
|
+
if(n->nd_args)
|
102
|
+
{
|
103
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_args, node_hash);
|
104
|
+
return node_id(n->nd_args);
|
105
|
+
}
|
106
|
+
else
|
107
|
+
{
|
108
|
+
return Qnil;
|
109
|
+
}
|
110
|
+
case NEN_BEG:
|
111
|
+
if(n->nd_beg)
|
112
|
+
{
|
113
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_beg, node_hash);
|
114
|
+
return node_id(n->nd_beg);
|
115
|
+
}
|
116
|
+
else
|
117
|
+
{
|
118
|
+
return Qnil;
|
119
|
+
}
|
120
|
+
case NEN_BODY:
|
121
|
+
if(n->nd_body)
|
122
|
+
{
|
123
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_body, node_hash);
|
124
|
+
return node_id(n->nd_body);
|
125
|
+
}
|
126
|
+
else
|
127
|
+
{
|
128
|
+
return Qnil;
|
129
|
+
}
|
130
|
+
case NEN_CFLAG:
|
131
|
+
{
|
132
|
+
return LONG2NUM((long)n->nd_cflag);
|
133
|
+
}
|
134
|
+
case NEN_CFNC:
|
135
|
+
/* rb_funcall(rb_cObject, rb_intern("pp"), wrap_node(n), 0); */
|
136
|
+
rb_raise(rb_eArgError, "Cannot dump cfunc");
|
137
|
+
case NEN_CLSS:
|
138
|
+
switch(TYPE(n->nd_clss))
|
139
|
+
{
|
140
|
+
case T_CLASS:
|
141
|
+
case T_MODULE:
|
142
|
+
{
|
143
|
+
/* When dumping a class, we dump just the name (otherwise we'd
|
144
|
+
* get multiple copies of the class each time we load a method
|
145
|
+
* on the other side).
|
146
|
+
*/
|
147
|
+
VALUE klass = (VALUE)n->nd_clss;
|
148
|
+
VALUE path;
|
149
|
+
if(FL_TEST(klass, FL_SINGLETON))
|
150
|
+
{
|
151
|
+
VALUE singleton = rb_iv_get(klass, "__attached__");
|
152
|
+
path = rb_class_path(singleton);
|
153
|
+
}
|
154
|
+
else
|
155
|
+
{
|
156
|
+
path = rb_class_path(klass);
|
157
|
+
if(STR2CSTR(path)[0] == '#')
|
158
|
+
{
|
159
|
+
rb_raise(rb_eArgError, "cannot dump anonymous class");
|
160
|
+
}
|
161
|
+
}
|
162
|
+
return rb_assoc_new(
|
163
|
+
INT2NUM(((struct RBasic *)(n->nd_clss))->flags),
|
164
|
+
path);
|
165
|
+
}
|
166
|
+
|
167
|
+
default:
|
168
|
+
/* TODO: would like to dump flags, not type */
|
169
|
+
return rb_assoc_new(
|
170
|
+
INT2NUM(TYPE((VALUE)n->nd_clss)),
|
171
|
+
(VALUE)n->nd_clss);
|
172
|
+
}
|
173
|
+
case NEN_CNT:
|
174
|
+
{
|
175
|
+
return LONG2NUM((long)n->nd_cnt);
|
176
|
+
}
|
177
|
+
case NEN_COND:
|
178
|
+
if(n->nd_cond)
|
179
|
+
{
|
180
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_cond, node_hash);
|
181
|
+
return node_id(n->nd_cond);
|
182
|
+
}
|
183
|
+
else
|
184
|
+
{
|
185
|
+
return Qnil;
|
186
|
+
}
|
187
|
+
case NEN_CPATH:
|
188
|
+
if(n->nd_cpath)
|
189
|
+
{
|
190
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_cpath, node_hash);
|
191
|
+
return node_id(n->nd_cpath);
|
192
|
+
}
|
193
|
+
else
|
194
|
+
{
|
195
|
+
return Qnil;
|
196
|
+
}
|
197
|
+
case NEN_CVAL:
|
198
|
+
switch(TYPE(n->nd_cval))
|
199
|
+
{
|
200
|
+
case T_CLASS:
|
201
|
+
case T_MODULE:
|
202
|
+
{
|
203
|
+
/* When dumping a class, we dump just the name (otherwise we'd
|
204
|
+
* get multiple copies of the class each time we load a method
|
205
|
+
* on the other side).
|
206
|
+
*/
|
207
|
+
VALUE klass = (VALUE)n->nd_cval;
|
208
|
+
VALUE path;
|
209
|
+
if(FL_TEST(klass, FL_SINGLETON))
|
210
|
+
{
|
211
|
+
VALUE singleton = rb_iv_get(klass, "__attached__");
|
212
|
+
path = rb_class_path(singleton);
|
213
|
+
}
|
214
|
+
else
|
215
|
+
{
|
216
|
+
path = rb_class_path(klass);
|
217
|
+
if(STR2CSTR(path)[0] == '#')
|
218
|
+
{
|
219
|
+
rb_raise(rb_eArgError, "cannot dump anonymous class");
|
220
|
+
}
|
221
|
+
}
|
222
|
+
return rb_assoc_new(
|
223
|
+
INT2NUM(((struct RBasic *)(n->nd_cval))->flags),
|
224
|
+
path);
|
225
|
+
}
|
226
|
+
|
227
|
+
default:
|
228
|
+
/* TODO: would like to dump flags, not type */
|
229
|
+
return rb_assoc_new(
|
230
|
+
INT2NUM(TYPE((VALUE)n->nd_cval)),
|
231
|
+
(VALUE)n->nd_cval);
|
232
|
+
}
|
233
|
+
case NEN_DEFN:
|
234
|
+
if(n->nd_defn)
|
235
|
+
{
|
236
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_defn, node_hash);
|
237
|
+
return node_id(n->nd_defn);
|
238
|
+
}
|
239
|
+
else
|
240
|
+
{
|
241
|
+
return Qnil;
|
242
|
+
}
|
243
|
+
case NEN_ELSE:
|
244
|
+
if(n->nd_else)
|
245
|
+
{
|
246
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_else, node_hash);
|
247
|
+
return node_id(n->nd_else);
|
248
|
+
}
|
249
|
+
else
|
250
|
+
{
|
251
|
+
return Qnil;
|
252
|
+
}
|
253
|
+
case NEN_END:
|
254
|
+
if(n->nd_end)
|
255
|
+
{
|
256
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_end, node_hash);
|
257
|
+
return node_id(n->nd_end);
|
258
|
+
}
|
259
|
+
else
|
260
|
+
{
|
261
|
+
return Qnil;
|
262
|
+
}
|
263
|
+
case NEN_ENSR:
|
264
|
+
if(n->nd_ensr)
|
265
|
+
{
|
266
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_ensr, node_hash);
|
267
|
+
return node_id(n->nd_ensr);
|
268
|
+
}
|
269
|
+
else
|
270
|
+
{
|
271
|
+
return Qnil;
|
272
|
+
}
|
273
|
+
case NEN_ENTRY:
|
274
|
+
if(n->nd_entry->id == 0)
|
275
|
+
{
|
276
|
+
rb_raise(
|
277
|
+
rb_eRuntimeError,
|
278
|
+
"Invalid ID for entry (node type %d)",
|
279
|
+
nd_type(n));
|
280
|
+
}
|
281
|
+
return ID2SYM(n->nd_entry->id);
|
282
|
+
case NEN_FRML:
|
283
|
+
{
|
284
|
+
return LONG2NUM((long)n->nd_frml);
|
285
|
+
}
|
286
|
+
case NEN_HEAD:
|
287
|
+
if(n->nd_head)
|
288
|
+
{
|
289
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_head, node_hash);
|
290
|
+
return node_id(n->nd_head);
|
291
|
+
}
|
292
|
+
else
|
293
|
+
{
|
294
|
+
return Qnil;
|
295
|
+
}
|
296
|
+
case NEN_ITER:
|
297
|
+
if(n->nd_iter)
|
298
|
+
{
|
299
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_iter, node_hash);
|
300
|
+
return node_id(n->nd_iter);
|
301
|
+
}
|
302
|
+
else
|
303
|
+
{
|
304
|
+
return Qnil;
|
305
|
+
}
|
306
|
+
case NEN_LIT:
|
307
|
+
switch(TYPE(n->nd_lit))
|
308
|
+
{
|
309
|
+
case T_CLASS:
|
310
|
+
case T_MODULE:
|
311
|
+
{
|
312
|
+
/* When dumping a class, we dump just the name (otherwise we'd
|
313
|
+
* get multiple copies of the class each time we load a method
|
314
|
+
* on the other side).
|
315
|
+
*/
|
316
|
+
VALUE klass = (VALUE)n->nd_lit;
|
317
|
+
VALUE path;
|
318
|
+
if(FL_TEST(klass, FL_SINGLETON))
|
319
|
+
{
|
320
|
+
VALUE singleton = rb_iv_get(klass, "__attached__");
|
321
|
+
path = rb_class_path(singleton);
|
322
|
+
}
|
323
|
+
else
|
324
|
+
{
|
325
|
+
path = rb_class_path(klass);
|
326
|
+
if(STR2CSTR(path)[0] == '#')
|
327
|
+
{
|
328
|
+
rb_raise(rb_eArgError, "cannot dump anonymous class");
|
329
|
+
}
|
330
|
+
}
|
331
|
+
return rb_assoc_new(
|
332
|
+
INT2NUM(((struct RBasic *)(n->nd_lit))->flags),
|
333
|
+
path);
|
334
|
+
}
|
335
|
+
|
336
|
+
default:
|
337
|
+
/* TODO: would like to dump flags, not type */
|
338
|
+
return rb_assoc_new(
|
339
|
+
INT2NUM(TYPE((VALUE)n->nd_lit)),
|
340
|
+
(VALUE)n->nd_lit);
|
341
|
+
}
|
342
|
+
case NEN_MID:
|
343
|
+
if(n->nd_mid == 0)
|
344
|
+
{
|
345
|
+
return Qnil;
|
346
|
+
}
|
347
|
+
else
|
348
|
+
{
|
349
|
+
return ID2SYM(n->nd_mid);
|
350
|
+
}
|
351
|
+
case NEN_MODL:
|
352
|
+
if(n->nd_modl == 0)
|
353
|
+
{
|
354
|
+
return Qnil;
|
355
|
+
}
|
356
|
+
else
|
357
|
+
{
|
358
|
+
return ID2SYM(n->nd_modl);
|
359
|
+
}
|
360
|
+
case NEN_NEXT:
|
361
|
+
if(n->nd_next)
|
362
|
+
{
|
363
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_next, node_hash);
|
364
|
+
return node_id(n->nd_next);
|
365
|
+
}
|
366
|
+
else
|
367
|
+
{
|
368
|
+
return Qnil;
|
369
|
+
}
|
370
|
+
case NEN_NOEX:
|
371
|
+
{
|
372
|
+
return LONG2NUM((long)n->nd_noex);
|
373
|
+
}
|
374
|
+
case NEN_NTH:
|
375
|
+
{
|
376
|
+
return LONG2NUM((long)n->nd_nth);
|
377
|
+
}
|
378
|
+
case NEN_OID:
|
379
|
+
if(n->nd_oid == 0)
|
380
|
+
{
|
381
|
+
return Qnil;
|
382
|
+
}
|
383
|
+
else
|
384
|
+
{
|
385
|
+
return ID2SYM(n->nd_oid);
|
386
|
+
}
|
387
|
+
case NEN_OPT:
|
388
|
+
if(n->nd_opt)
|
389
|
+
{
|
390
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_opt, node_hash);
|
391
|
+
return node_id(n->nd_opt);
|
392
|
+
}
|
393
|
+
else
|
394
|
+
{
|
395
|
+
return Qnil;
|
396
|
+
}
|
397
|
+
case NEN_ORIG:
|
398
|
+
switch(TYPE(n->nd_orig))
|
399
|
+
{
|
400
|
+
case T_CLASS:
|
401
|
+
case T_MODULE:
|
402
|
+
{
|
403
|
+
/* When dumping a class, we dump just the name (otherwise we'd
|
404
|
+
* get multiple copies of the class each time we load a method
|
405
|
+
* on the other side).
|
406
|
+
*/
|
407
|
+
VALUE klass = (VALUE)n->nd_orig;
|
408
|
+
VALUE path;
|
409
|
+
if(FL_TEST(klass, FL_SINGLETON))
|
410
|
+
{
|
411
|
+
VALUE singleton = rb_iv_get(klass, "__attached__");
|
412
|
+
path = rb_class_path(singleton);
|
413
|
+
}
|
414
|
+
else
|
415
|
+
{
|
416
|
+
path = rb_class_path(klass);
|
417
|
+
if(STR2CSTR(path)[0] == '#')
|
418
|
+
{
|
419
|
+
rb_raise(rb_eArgError, "cannot dump anonymous class");
|
420
|
+
}
|
421
|
+
}
|
422
|
+
return rb_assoc_new(
|
423
|
+
INT2NUM(((struct RBasic *)(n->nd_orig))->flags),
|
424
|
+
path);
|
425
|
+
}
|
426
|
+
|
427
|
+
default:
|
428
|
+
/* TODO: would like to dump flags, not type */
|
429
|
+
return rb_assoc_new(
|
430
|
+
INT2NUM(TYPE((VALUE)n->nd_orig)),
|
431
|
+
(VALUE)n->nd_orig);
|
432
|
+
}
|
433
|
+
case NEN_PID:
|
434
|
+
if(n->nd_pid == 0)
|
435
|
+
{
|
436
|
+
return Qnil;
|
437
|
+
}
|
438
|
+
else
|
439
|
+
{
|
440
|
+
return ID2SYM(n->nd_pid);
|
441
|
+
}
|
442
|
+
case NEN_PLEN:
|
443
|
+
{
|
444
|
+
return LONG2NUM((long)n->nd_plen);
|
445
|
+
}
|
446
|
+
case NEN_RECV:
|
447
|
+
if(n->nd_recv)
|
448
|
+
{
|
449
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_recv, node_hash);
|
450
|
+
return node_id(n->nd_recv);
|
451
|
+
}
|
452
|
+
else
|
453
|
+
{
|
454
|
+
return Qnil;
|
455
|
+
}
|
456
|
+
case NEN_RESQ:
|
457
|
+
if(n->nd_resq)
|
458
|
+
{
|
459
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_resq, node_hash);
|
460
|
+
return node_id(n->nd_resq);
|
461
|
+
}
|
462
|
+
else
|
463
|
+
{
|
464
|
+
return Qnil;
|
465
|
+
}
|
466
|
+
case NEN_REST:
|
467
|
+
if(n->nd_rest == 0)
|
468
|
+
{
|
469
|
+
return Qnil;
|
470
|
+
}
|
471
|
+
else
|
472
|
+
{
|
473
|
+
return ID2SYM(n->nd_rest);
|
474
|
+
}
|
475
|
+
case NEN_RVAL:
|
476
|
+
if(n->nd_2nd)
|
477
|
+
{
|
478
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_2nd, node_hash);
|
479
|
+
return node_id(n->nd_2nd);
|
480
|
+
}
|
481
|
+
else
|
482
|
+
{
|
483
|
+
return Qnil;
|
484
|
+
}
|
485
|
+
case NEN_STATE:
|
486
|
+
{
|
487
|
+
return LONG2NUM((long)n->nd_state);
|
488
|
+
}
|
489
|
+
case NEN_STTS:
|
490
|
+
if(n->nd_stts)
|
491
|
+
{
|
492
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_stts, node_hash);
|
493
|
+
return node_id(n->nd_stts);
|
494
|
+
}
|
495
|
+
else
|
496
|
+
{
|
497
|
+
return Qnil;
|
498
|
+
}
|
499
|
+
case NEN_SUPER:
|
500
|
+
if(n->nd_super)
|
501
|
+
{
|
502
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_super, node_hash);
|
503
|
+
return node_id(n->nd_super);
|
504
|
+
}
|
505
|
+
else
|
506
|
+
{
|
507
|
+
return Qnil;
|
508
|
+
}
|
509
|
+
case NEN_TAG:
|
510
|
+
if(n->nd_tag == 0)
|
511
|
+
{
|
512
|
+
return Qnil;
|
513
|
+
}
|
514
|
+
else
|
515
|
+
{
|
516
|
+
return ID2SYM(n->nd_tag);
|
517
|
+
}
|
518
|
+
case NEN_TBL:
|
519
|
+
{
|
520
|
+
VALUE v = variable_names(n->nd_tbl);
|
521
|
+
return v;
|
522
|
+
}
|
523
|
+
case NEN_TVAL:
|
524
|
+
switch(TYPE(n->nd_tval))
|
525
|
+
{
|
526
|
+
case T_CLASS:
|
527
|
+
case T_MODULE:
|
528
|
+
{
|
529
|
+
/* When dumping a class, we dump just the name (otherwise we'd
|
530
|
+
* get multiple copies of the class each time we load a method
|
531
|
+
* on the other side).
|
532
|
+
*/
|
533
|
+
VALUE klass = (VALUE)n->nd_tval;
|
534
|
+
VALUE path;
|
535
|
+
if(FL_TEST(klass, FL_SINGLETON))
|
536
|
+
{
|
537
|
+
VALUE singleton = rb_iv_get(klass, "__attached__");
|
538
|
+
path = rb_class_path(singleton);
|
539
|
+
}
|
540
|
+
else
|
541
|
+
{
|
542
|
+
path = rb_class_path(klass);
|
543
|
+
if(STR2CSTR(path)[0] == '#')
|
544
|
+
{
|
545
|
+
rb_raise(rb_eArgError, "cannot dump anonymous class");
|
546
|
+
}
|
547
|
+
}
|
548
|
+
return rb_assoc_new(
|
549
|
+
INT2NUM(((struct RBasic *)(n->nd_tval))->flags),
|
550
|
+
path);
|
551
|
+
}
|
552
|
+
|
553
|
+
default:
|
554
|
+
/* TODO: would like to dump flags, not type */
|
555
|
+
return rb_assoc_new(
|
556
|
+
INT2NUM(TYPE((VALUE)n->nd_tval)),
|
557
|
+
(VALUE)n->nd_tval);
|
558
|
+
}
|
559
|
+
case NEN_VALUE:
|
560
|
+
if(n->nd_value)
|
561
|
+
{
|
562
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_value, node_hash);
|
563
|
+
return node_id(n->nd_value);
|
564
|
+
}
|
565
|
+
else
|
566
|
+
{
|
567
|
+
return Qnil;
|
568
|
+
}
|
569
|
+
case NEN_VAR:
|
570
|
+
if(n->nd_var)
|
571
|
+
{
|
572
|
+
dump_node_or_iseq_to_hash((VALUE)n->nd_var, node_hash);
|
573
|
+
return node_id(n->nd_var);
|
574
|
+
}
|
575
|
+
else
|
576
|
+
{
|
577
|
+
return Qnil;
|
578
|
+
}
|
579
|
+
case NEN_VID:
|
580
|
+
if(n->nd_vid == 0)
|
581
|
+
{
|
582
|
+
return Qnil;
|
583
|
+
}
|
584
|
+
else
|
585
|
+
{
|
586
|
+
return ID2SYM(n->nd_vid);
|
587
|
+
}
|
588
|
+
case NEN_VISI:
|
589
|
+
{
|
590
|
+
return LONG2NUM((long)n->nd_visi);
|
591
|
+
}
|
592
|
+
}
|
593
|
+
rb_raise(rb_eArgError, "Invalid Node_Elem_Name %d", nen);
|
594
|
+
}
|
595
|
+
|
596
|
+
void load_node_elem(enum Node_Elem_Name nen, VALUE v, NODE * n, VALUE node_hash, VALUE id_hash)
|
597
|
+
{
|
598
|
+
switch(nen)
|
599
|
+
{
|
600
|
+
case NEN_NONE:
|
601
|
+
return;
|
602
|
+
case NEN_1ST:
|
603
|
+
{
|
604
|
+
if(v == Qnil)
|
605
|
+
{
|
606
|
+
n->nd_1st = 0;
|
607
|
+
}
|
608
|
+
else
|
609
|
+
{
|
610
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
611
|
+
if(RTEST(nid))
|
612
|
+
{
|
613
|
+
n->nd_1st = id_to_node(nid);
|
614
|
+
}
|
615
|
+
else
|
616
|
+
{
|
617
|
+
n->u1.node = (NODE *)load_node_or_iseq_from_hash(
|
618
|
+
v, node_hash, id_hash);
|
619
|
+
}
|
620
|
+
}
|
621
|
+
return;
|
622
|
+
}
|
623
|
+
case NEN_2ND:
|
624
|
+
{
|
625
|
+
if(v == Qnil)
|
626
|
+
{
|
627
|
+
n->nd_2nd = 0;
|
628
|
+
}
|
629
|
+
else
|
630
|
+
{
|
631
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
632
|
+
if(RTEST(nid))
|
633
|
+
{
|
634
|
+
n->nd_2nd = id_to_node(nid);
|
635
|
+
}
|
636
|
+
else
|
637
|
+
{
|
638
|
+
n->u2.node = (NODE *)load_node_or_iseq_from_hash(
|
639
|
+
v, node_hash, id_hash);
|
640
|
+
}
|
641
|
+
}
|
642
|
+
return;
|
643
|
+
}
|
644
|
+
case NEN_AID:
|
645
|
+
{
|
646
|
+
if(NIL_P(v))
|
647
|
+
{
|
648
|
+
n->nd_aid = 0;
|
649
|
+
}
|
650
|
+
else
|
651
|
+
{
|
652
|
+
n->nd_aid = SYM2ID(v);
|
653
|
+
}
|
654
|
+
return;
|
655
|
+
}
|
656
|
+
case NEN_ALEN:
|
657
|
+
{
|
658
|
+
n->nd_alen = NUM2LONG(v);
|
659
|
+
return;
|
660
|
+
}
|
661
|
+
case NEN_ARGC:
|
662
|
+
{
|
663
|
+
n->nd_argc = NUM2LONG(v);
|
664
|
+
return;
|
665
|
+
}
|
666
|
+
case NEN_ARGS:
|
667
|
+
{
|
668
|
+
if(v == Qnil)
|
669
|
+
{
|
670
|
+
n->nd_args = 0;
|
671
|
+
}
|
672
|
+
else
|
673
|
+
{
|
674
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
675
|
+
if(RTEST(nid))
|
676
|
+
{
|
677
|
+
n->nd_args = id_to_node(nid);
|
678
|
+
}
|
679
|
+
else
|
680
|
+
{
|
681
|
+
n->u3.node = (NODE *)load_node_or_iseq_from_hash(
|
682
|
+
v, node_hash, id_hash);
|
683
|
+
}
|
684
|
+
}
|
685
|
+
return;
|
686
|
+
}
|
687
|
+
case NEN_BEG:
|
688
|
+
{
|
689
|
+
if(v == Qnil)
|
690
|
+
{
|
691
|
+
n->nd_beg = 0;
|
692
|
+
}
|
693
|
+
else
|
694
|
+
{
|
695
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
696
|
+
if(RTEST(nid))
|
697
|
+
{
|
698
|
+
n->nd_beg = id_to_node(nid);
|
699
|
+
}
|
700
|
+
else
|
701
|
+
{
|
702
|
+
n->u1.node = (NODE *)load_node_or_iseq_from_hash(
|
703
|
+
v, node_hash, id_hash);
|
704
|
+
}
|
705
|
+
}
|
706
|
+
return;
|
707
|
+
}
|
708
|
+
case NEN_BODY:
|
709
|
+
{
|
710
|
+
if(v == Qnil)
|
711
|
+
{
|
712
|
+
n->nd_body = 0;
|
713
|
+
}
|
714
|
+
else
|
715
|
+
{
|
716
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
717
|
+
if(RTEST(nid))
|
718
|
+
{
|
719
|
+
n->nd_body = id_to_node(nid);
|
720
|
+
}
|
721
|
+
else
|
722
|
+
{
|
723
|
+
n->u2.node = (NODE *)load_node_or_iseq_from_hash(
|
724
|
+
v, node_hash, id_hash);
|
725
|
+
}
|
726
|
+
}
|
727
|
+
return;
|
728
|
+
}
|
729
|
+
case NEN_CFLAG:
|
730
|
+
{
|
731
|
+
n->nd_cflag = NUM2LONG(v);
|
732
|
+
return;
|
733
|
+
}
|
734
|
+
case NEN_CFNC:
|
735
|
+
{
|
736
|
+
rb_raise(rb_eRuntimeError, "Cannot load cfunc");
|
737
|
+
}
|
738
|
+
case NEN_CLSS:
|
739
|
+
{
|
740
|
+
Check_Type(v, T_ARRAY);
|
741
|
+
if(RARRAY_LEN(v) != 2)
|
742
|
+
{
|
743
|
+
rb_raise(rb_eArgError, "wrong size for array");
|
744
|
+
}
|
745
|
+
int flags = NUM2INT(RARRAY_PTR(v)[0]);
|
746
|
+
switch(flags & T_MASK)
|
747
|
+
{
|
748
|
+
case T_CLASS:
|
749
|
+
case T_MODULE:
|
750
|
+
{
|
751
|
+
VALUE str = RARRAY_PTR(v)[1];
|
752
|
+
Check_Type(str, T_STRING);
|
753
|
+
VALUE klass = rb_path2class(STR2CSTR(str));
|
754
|
+
if(flags & FL_SINGLETON)
|
755
|
+
{
|
756
|
+
*(VALUE *)(&n->nd_clss) =
|
757
|
+
rb_singleton_class(klass);
|
758
|
+
}
|
759
|
+
else
|
760
|
+
{
|
761
|
+
*(VALUE *)(&n->nd_clss) =
|
762
|
+
klass;
|
763
|
+
}
|
764
|
+
break;
|
765
|
+
}
|
766
|
+
default:
|
767
|
+
*(VALUE *)(&n->nd_clss) = RARRAY_PTR(v)[1];
|
768
|
+
break;
|
769
|
+
}
|
770
|
+
return;
|
771
|
+
}
|
772
|
+
case NEN_CNT:
|
773
|
+
{
|
774
|
+
n->nd_cnt = NUM2LONG(v);
|
775
|
+
return;
|
776
|
+
}
|
777
|
+
case NEN_COND:
|
778
|
+
{
|
779
|
+
if(v == Qnil)
|
780
|
+
{
|
781
|
+
n->nd_cond = 0;
|
782
|
+
}
|
783
|
+
else
|
784
|
+
{
|
785
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
786
|
+
if(RTEST(nid))
|
787
|
+
{
|
788
|
+
n->nd_cond = id_to_node(nid);
|
789
|
+
}
|
790
|
+
else
|
791
|
+
{
|
792
|
+
n->u1.node = (NODE *)load_node_or_iseq_from_hash(
|
793
|
+
v, node_hash, id_hash);
|
794
|
+
}
|
795
|
+
}
|
796
|
+
return;
|
797
|
+
}
|
798
|
+
case NEN_CPATH:
|
799
|
+
{
|
800
|
+
if(v == Qnil)
|
801
|
+
{
|
802
|
+
n->nd_cpath = 0;
|
803
|
+
}
|
804
|
+
else
|
805
|
+
{
|
806
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
807
|
+
if(RTEST(nid))
|
808
|
+
{
|
809
|
+
n->nd_cpath = id_to_node(nid);
|
810
|
+
}
|
811
|
+
else
|
812
|
+
{
|
813
|
+
n->u1.node = (NODE *)load_node_or_iseq_from_hash(
|
814
|
+
v, node_hash, id_hash);
|
815
|
+
}
|
816
|
+
}
|
817
|
+
return;
|
818
|
+
}
|
819
|
+
case NEN_CVAL:
|
820
|
+
{
|
821
|
+
Check_Type(v, T_ARRAY);
|
822
|
+
if(RARRAY_LEN(v) != 2)
|
823
|
+
{
|
824
|
+
rb_raise(rb_eArgError, "wrong size for array");
|
825
|
+
}
|
826
|
+
int flags = NUM2INT(RARRAY_PTR(v)[0]);
|
827
|
+
switch(flags & T_MASK)
|
828
|
+
{
|
829
|
+
case T_CLASS:
|
830
|
+
case T_MODULE:
|
831
|
+
{
|
832
|
+
VALUE str = RARRAY_PTR(v)[1];
|
833
|
+
Check_Type(str, T_STRING);
|
834
|
+
VALUE klass = rb_path2class(STR2CSTR(str));
|
835
|
+
if(flags & FL_SINGLETON)
|
836
|
+
{
|
837
|
+
*(VALUE *)(&n->nd_cval) =
|
838
|
+
rb_singleton_class(klass);
|
839
|
+
}
|
840
|
+
else
|
841
|
+
{
|
842
|
+
*(VALUE *)(&n->nd_cval) =
|
843
|
+
klass;
|
844
|
+
}
|
845
|
+
break;
|
846
|
+
}
|
847
|
+
default:
|
848
|
+
*(VALUE *)(&n->nd_cval) = RARRAY_PTR(v)[1];
|
849
|
+
break;
|
850
|
+
}
|
851
|
+
return;
|
852
|
+
}
|
853
|
+
case NEN_DEFN:
|
854
|
+
{
|
855
|
+
if(v == Qnil)
|
856
|
+
{
|
857
|
+
n->nd_defn = 0;
|
858
|
+
}
|
859
|
+
else
|
860
|
+
{
|
861
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
862
|
+
if(RTEST(nid))
|
863
|
+
{
|
864
|
+
n->nd_defn = id_to_node(nid);
|
865
|
+
}
|
866
|
+
else
|
867
|
+
{
|
868
|
+
n->u3.node = (NODE *)load_node_or_iseq_from_hash(
|
869
|
+
v, node_hash, id_hash);
|
870
|
+
}
|
871
|
+
}
|
872
|
+
return;
|
873
|
+
}
|
874
|
+
case NEN_ELSE:
|
875
|
+
{
|
876
|
+
if(v == Qnil)
|
877
|
+
{
|
878
|
+
n->nd_else = 0;
|
879
|
+
}
|
880
|
+
else
|
881
|
+
{
|
882
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
883
|
+
if(RTEST(nid))
|
884
|
+
{
|
885
|
+
n->nd_else = id_to_node(nid);
|
886
|
+
}
|
887
|
+
else
|
888
|
+
{
|
889
|
+
n->u3.node = (NODE *)load_node_or_iseq_from_hash(
|
890
|
+
v, node_hash, id_hash);
|
891
|
+
}
|
892
|
+
}
|
893
|
+
return;
|
894
|
+
}
|
895
|
+
case NEN_END:
|
896
|
+
{
|
897
|
+
if(v == Qnil)
|
898
|
+
{
|
899
|
+
n->nd_end = 0;
|
900
|
+
}
|
901
|
+
else
|
902
|
+
{
|
903
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
904
|
+
if(RTEST(nid))
|
905
|
+
{
|
906
|
+
n->nd_end = id_to_node(nid);
|
907
|
+
}
|
908
|
+
else
|
909
|
+
{
|
910
|
+
n->u2.node = (NODE *)load_node_or_iseq_from_hash(
|
911
|
+
v, node_hash, id_hash);
|
912
|
+
}
|
913
|
+
}
|
914
|
+
return;
|
915
|
+
}
|
916
|
+
case NEN_ENSR:
|
917
|
+
{
|
918
|
+
if(v == Qnil)
|
919
|
+
{
|
920
|
+
n->nd_ensr = 0;
|
921
|
+
}
|
922
|
+
else
|
923
|
+
{
|
924
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
925
|
+
if(RTEST(nid))
|
926
|
+
{
|
927
|
+
n->nd_ensr = id_to_node(nid);
|
928
|
+
}
|
929
|
+
else
|
930
|
+
{
|
931
|
+
n->u3.node = (NODE *)load_node_or_iseq_from_hash(
|
932
|
+
v, node_hash, id_hash);
|
933
|
+
}
|
934
|
+
}
|
935
|
+
return;
|
936
|
+
}
|
937
|
+
case NEN_ENTRY:
|
938
|
+
{
|
939
|
+
n->nd_entry = rb_global_entry(SYM2ID(v));
|
940
|
+
return;
|
941
|
+
}
|
942
|
+
case NEN_FRML:
|
943
|
+
{
|
944
|
+
n->nd_frml = NUM2LONG(v);
|
945
|
+
return;
|
946
|
+
}
|
947
|
+
case NEN_HEAD:
|
948
|
+
{
|
949
|
+
if(v == Qnil)
|
950
|
+
{
|
951
|
+
n->nd_head = 0;
|
952
|
+
}
|
953
|
+
else
|
954
|
+
{
|
955
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
956
|
+
if(RTEST(nid))
|
957
|
+
{
|
958
|
+
n->nd_head = id_to_node(nid);
|
959
|
+
}
|
960
|
+
else
|
961
|
+
{
|
962
|
+
n->u1.node = (NODE *)load_node_or_iseq_from_hash(
|
963
|
+
v, node_hash, id_hash);
|
964
|
+
}
|
965
|
+
}
|
966
|
+
return;
|
967
|
+
}
|
968
|
+
case NEN_ITER:
|
969
|
+
{
|
970
|
+
if(v == Qnil)
|
971
|
+
{
|
972
|
+
n->nd_iter = 0;
|
973
|
+
}
|
974
|
+
else
|
975
|
+
{
|
976
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
977
|
+
if(RTEST(nid))
|
978
|
+
{
|
979
|
+
n->nd_iter = id_to_node(nid);
|
980
|
+
}
|
981
|
+
else
|
982
|
+
{
|
983
|
+
n->u3.node = (NODE *)load_node_or_iseq_from_hash(
|
984
|
+
v, node_hash, id_hash);
|
985
|
+
}
|
986
|
+
}
|
987
|
+
return;
|
988
|
+
}
|
989
|
+
case NEN_LIT:
|
990
|
+
{
|
991
|
+
Check_Type(v, T_ARRAY);
|
992
|
+
if(RARRAY_LEN(v) != 2)
|
993
|
+
{
|
994
|
+
rb_raise(rb_eArgError, "wrong size for array");
|
995
|
+
}
|
996
|
+
int flags = NUM2INT(RARRAY_PTR(v)[0]);
|
997
|
+
switch(flags & T_MASK)
|
998
|
+
{
|
999
|
+
case T_CLASS:
|
1000
|
+
case T_MODULE:
|
1001
|
+
{
|
1002
|
+
VALUE str = RARRAY_PTR(v)[1];
|
1003
|
+
Check_Type(str, T_STRING);
|
1004
|
+
VALUE klass = rb_path2class(STR2CSTR(str));
|
1005
|
+
if(flags & FL_SINGLETON)
|
1006
|
+
{
|
1007
|
+
*(VALUE *)(&n->nd_lit) =
|
1008
|
+
rb_singleton_class(klass);
|
1009
|
+
}
|
1010
|
+
else
|
1011
|
+
{
|
1012
|
+
*(VALUE *)(&n->nd_lit) =
|
1013
|
+
klass;
|
1014
|
+
}
|
1015
|
+
break;
|
1016
|
+
}
|
1017
|
+
default:
|
1018
|
+
*(VALUE *)(&n->nd_lit) = RARRAY_PTR(v)[1];
|
1019
|
+
break;
|
1020
|
+
}
|
1021
|
+
return;
|
1022
|
+
}
|
1023
|
+
case NEN_MID:
|
1024
|
+
{
|
1025
|
+
if(NIL_P(v))
|
1026
|
+
{
|
1027
|
+
n->nd_mid = 0;
|
1028
|
+
}
|
1029
|
+
else
|
1030
|
+
{
|
1031
|
+
n->nd_mid = SYM2ID(v);
|
1032
|
+
}
|
1033
|
+
return;
|
1034
|
+
}
|
1035
|
+
case NEN_MODL:
|
1036
|
+
{
|
1037
|
+
if(NIL_P(v))
|
1038
|
+
{
|
1039
|
+
n->nd_modl = 0;
|
1040
|
+
}
|
1041
|
+
else
|
1042
|
+
{
|
1043
|
+
n->nd_modl = SYM2ID(v);
|
1044
|
+
}
|
1045
|
+
return;
|
1046
|
+
}
|
1047
|
+
case NEN_NEXT:
|
1048
|
+
{
|
1049
|
+
if(v == Qnil)
|
1050
|
+
{
|
1051
|
+
n->nd_next = 0;
|
1052
|
+
}
|
1053
|
+
else
|
1054
|
+
{
|
1055
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
1056
|
+
if(RTEST(nid))
|
1057
|
+
{
|
1058
|
+
n->nd_next = id_to_node(nid);
|
1059
|
+
}
|
1060
|
+
else
|
1061
|
+
{
|
1062
|
+
n->u3.node = (NODE *)load_node_or_iseq_from_hash(
|
1063
|
+
v, node_hash, id_hash);
|
1064
|
+
}
|
1065
|
+
}
|
1066
|
+
return;
|
1067
|
+
}
|
1068
|
+
case NEN_NOEX:
|
1069
|
+
{
|
1070
|
+
n->nd_noex = NUM2LONG(v);
|
1071
|
+
return;
|
1072
|
+
}
|
1073
|
+
case NEN_NTH:
|
1074
|
+
{
|
1075
|
+
n->nd_nth = NUM2LONG(v);
|
1076
|
+
return;
|
1077
|
+
}
|
1078
|
+
case NEN_OID:
|
1079
|
+
{
|
1080
|
+
if(NIL_P(v))
|
1081
|
+
{
|
1082
|
+
n->nd_oid = 0;
|
1083
|
+
}
|
1084
|
+
else
|
1085
|
+
{
|
1086
|
+
n->nd_oid = SYM2ID(v);
|
1087
|
+
}
|
1088
|
+
return;
|
1089
|
+
}
|
1090
|
+
case NEN_OPT:
|
1091
|
+
{
|
1092
|
+
if(v == Qnil)
|
1093
|
+
{
|
1094
|
+
n->nd_opt = 0;
|
1095
|
+
}
|
1096
|
+
else
|
1097
|
+
{
|
1098
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
1099
|
+
if(RTEST(nid))
|
1100
|
+
{
|
1101
|
+
n->nd_opt = id_to_node(nid);
|
1102
|
+
}
|
1103
|
+
else
|
1104
|
+
{
|
1105
|
+
n->u1.node = (NODE *)load_node_or_iseq_from_hash(
|
1106
|
+
v, node_hash, id_hash);
|
1107
|
+
}
|
1108
|
+
}
|
1109
|
+
return;
|
1110
|
+
}
|
1111
|
+
case NEN_ORIG:
|
1112
|
+
{
|
1113
|
+
Check_Type(v, T_ARRAY);
|
1114
|
+
if(RARRAY_LEN(v) != 2)
|
1115
|
+
{
|
1116
|
+
rb_raise(rb_eArgError, "wrong size for array");
|
1117
|
+
}
|
1118
|
+
int flags = NUM2INT(RARRAY_PTR(v)[0]);
|
1119
|
+
switch(flags & T_MASK)
|
1120
|
+
{
|
1121
|
+
case T_CLASS:
|
1122
|
+
case T_MODULE:
|
1123
|
+
{
|
1124
|
+
VALUE str = RARRAY_PTR(v)[1];
|
1125
|
+
Check_Type(str, T_STRING);
|
1126
|
+
VALUE klass = rb_path2class(STR2CSTR(str));
|
1127
|
+
if(flags & FL_SINGLETON)
|
1128
|
+
{
|
1129
|
+
*(VALUE *)(&n->nd_orig) =
|
1130
|
+
rb_singleton_class(klass);
|
1131
|
+
}
|
1132
|
+
else
|
1133
|
+
{
|
1134
|
+
*(VALUE *)(&n->nd_orig) =
|
1135
|
+
klass;
|
1136
|
+
}
|
1137
|
+
break;
|
1138
|
+
}
|
1139
|
+
default:
|
1140
|
+
*(VALUE *)(&n->nd_orig) = RARRAY_PTR(v)[1];
|
1141
|
+
break;
|
1142
|
+
}
|
1143
|
+
return;
|
1144
|
+
}
|
1145
|
+
case NEN_PID:
|
1146
|
+
{
|
1147
|
+
if(NIL_P(v))
|
1148
|
+
{
|
1149
|
+
n->nd_pid = 0;
|
1150
|
+
}
|
1151
|
+
else
|
1152
|
+
{
|
1153
|
+
n->nd_pid = SYM2ID(v);
|
1154
|
+
}
|
1155
|
+
return;
|
1156
|
+
}
|
1157
|
+
case NEN_PLEN:
|
1158
|
+
{
|
1159
|
+
n->nd_plen = NUM2LONG(v);
|
1160
|
+
return;
|
1161
|
+
}
|
1162
|
+
case NEN_RECV:
|
1163
|
+
{
|
1164
|
+
if(v == Qnil)
|
1165
|
+
{
|
1166
|
+
n->nd_recv = 0;
|
1167
|
+
}
|
1168
|
+
else
|
1169
|
+
{
|
1170
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
1171
|
+
if(RTEST(nid))
|
1172
|
+
{
|
1173
|
+
n->nd_recv = id_to_node(nid);
|
1174
|
+
}
|
1175
|
+
else
|
1176
|
+
{
|
1177
|
+
n->u1.node = (NODE *)load_node_or_iseq_from_hash(
|
1178
|
+
v, node_hash, id_hash);
|
1179
|
+
}
|
1180
|
+
}
|
1181
|
+
return;
|
1182
|
+
}
|
1183
|
+
case NEN_RESQ:
|
1184
|
+
{
|
1185
|
+
if(v == Qnil)
|
1186
|
+
{
|
1187
|
+
n->nd_resq = 0;
|
1188
|
+
}
|
1189
|
+
else
|
1190
|
+
{
|
1191
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
1192
|
+
if(RTEST(nid))
|
1193
|
+
{
|
1194
|
+
n->nd_resq = id_to_node(nid);
|
1195
|
+
}
|
1196
|
+
else
|
1197
|
+
{
|
1198
|
+
n->u2.node = (NODE *)load_node_or_iseq_from_hash(
|
1199
|
+
v, node_hash, id_hash);
|
1200
|
+
}
|
1201
|
+
}
|
1202
|
+
return;
|
1203
|
+
}
|
1204
|
+
case NEN_REST:
|
1205
|
+
{
|
1206
|
+
if(NIL_P(v))
|
1207
|
+
{
|
1208
|
+
n->nd_rest = 0;
|
1209
|
+
}
|
1210
|
+
else
|
1211
|
+
{
|
1212
|
+
n->nd_rest = SYM2ID(v);
|
1213
|
+
}
|
1214
|
+
return;
|
1215
|
+
}
|
1216
|
+
case NEN_RVAL:
|
1217
|
+
{
|
1218
|
+
if(v == Qnil)
|
1219
|
+
{
|
1220
|
+
n->nd_2nd = 0;
|
1221
|
+
}
|
1222
|
+
else
|
1223
|
+
{
|
1224
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
1225
|
+
if(RTEST(nid))
|
1226
|
+
{
|
1227
|
+
n->nd_2nd = id_to_node(nid);
|
1228
|
+
}
|
1229
|
+
else
|
1230
|
+
{
|
1231
|
+
n->u2.node = (NODE *)load_node_or_iseq_from_hash(
|
1232
|
+
v, node_hash, id_hash);
|
1233
|
+
}
|
1234
|
+
}
|
1235
|
+
return;
|
1236
|
+
}
|
1237
|
+
case NEN_STATE:
|
1238
|
+
{
|
1239
|
+
n->nd_state = NUM2LONG(v);
|
1240
|
+
return;
|
1241
|
+
}
|
1242
|
+
case NEN_STTS:
|
1243
|
+
{
|
1244
|
+
if(v == Qnil)
|
1245
|
+
{
|
1246
|
+
n->nd_stts = 0;
|
1247
|
+
}
|
1248
|
+
else
|
1249
|
+
{
|
1250
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
1251
|
+
if(RTEST(nid))
|
1252
|
+
{
|
1253
|
+
n->nd_stts = id_to_node(nid);
|
1254
|
+
}
|
1255
|
+
else
|
1256
|
+
{
|
1257
|
+
n->u1.node = (NODE *)load_node_or_iseq_from_hash(
|
1258
|
+
v, node_hash, id_hash);
|
1259
|
+
}
|
1260
|
+
}
|
1261
|
+
return;
|
1262
|
+
}
|
1263
|
+
case NEN_SUPER:
|
1264
|
+
{
|
1265
|
+
if(v == Qnil)
|
1266
|
+
{
|
1267
|
+
n->nd_super = 0;
|
1268
|
+
}
|
1269
|
+
else
|
1270
|
+
{
|
1271
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
1272
|
+
if(RTEST(nid))
|
1273
|
+
{
|
1274
|
+
n->nd_super = id_to_node(nid);
|
1275
|
+
}
|
1276
|
+
else
|
1277
|
+
{
|
1278
|
+
n->u3.node = (NODE *)load_node_or_iseq_from_hash(
|
1279
|
+
v, node_hash, id_hash);
|
1280
|
+
}
|
1281
|
+
}
|
1282
|
+
return;
|
1283
|
+
}
|
1284
|
+
case NEN_TAG:
|
1285
|
+
{
|
1286
|
+
if(NIL_P(v))
|
1287
|
+
{
|
1288
|
+
n->nd_tag = 0;
|
1289
|
+
}
|
1290
|
+
else
|
1291
|
+
{
|
1292
|
+
n->nd_tag = SYM2ID(v);
|
1293
|
+
}
|
1294
|
+
return;
|
1295
|
+
}
|
1296
|
+
case NEN_TBL:
|
1297
|
+
{
|
1298
|
+
if(v == Qnil)
|
1299
|
+
{
|
1300
|
+
n->nd_tbl = 0;
|
1301
|
+
}
|
1302
|
+
else
|
1303
|
+
{
|
1304
|
+
size_t len, j;
|
1305
|
+
ID * tmp_tbl;
|
1306
|
+
|
1307
|
+
Check_Type(v, T_ARRAY);
|
1308
|
+
len = RARRAY_LEN(v);
|
1309
|
+
tmp_tbl = ALLOCA_N(ID, len + 3);
|
1310
|
+
tmp_tbl[0] = (ID)(len + 2);
|
1311
|
+
tmp_tbl[1] = (ID)('_');
|
1312
|
+
tmp_tbl[2] = (ID)('~');
|
1313
|
+
for(j = 0; j < len; ++j)
|
1314
|
+
{
|
1315
|
+
VALUE e = RARRAY_PTR(v)[j];
|
1316
|
+
if(e == Qnil)
|
1317
|
+
{
|
1318
|
+
/* flip state */
|
1319
|
+
tmp_tbl[j + 3] = 0;
|
1320
|
+
}
|
1321
|
+
else
|
1322
|
+
{
|
1323
|
+
tmp_tbl[j + 3] = SYM2ID(e);
|
1324
|
+
}
|
1325
|
+
}
|
1326
|
+
n->nd_tbl = ALLOC_N(ID, len + 3);
|
1327
|
+
memcpy(n->nd_tbl, tmp_tbl, sizeof(ID) * (len + 3));
|
1328
|
+
}
|
1329
|
+
return;
|
1330
|
+
}
|
1331
|
+
case NEN_TVAL:
|
1332
|
+
{
|
1333
|
+
Check_Type(v, T_ARRAY);
|
1334
|
+
if(RARRAY_LEN(v) != 2)
|
1335
|
+
{
|
1336
|
+
rb_raise(rb_eArgError, "wrong size for array");
|
1337
|
+
}
|
1338
|
+
int flags = NUM2INT(RARRAY_PTR(v)[0]);
|
1339
|
+
switch(flags & T_MASK)
|
1340
|
+
{
|
1341
|
+
case T_CLASS:
|
1342
|
+
case T_MODULE:
|
1343
|
+
{
|
1344
|
+
VALUE str = RARRAY_PTR(v)[1];
|
1345
|
+
Check_Type(str, T_STRING);
|
1346
|
+
VALUE klass = rb_path2class(STR2CSTR(str));
|
1347
|
+
if(flags & FL_SINGLETON)
|
1348
|
+
{
|
1349
|
+
*(VALUE *)(&n->nd_tval) =
|
1350
|
+
rb_singleton_class(klass);
|
1351
|
+
}
|
1352
|
+
else
|
1353
|
+
{
|
1354
|
+
*(VALUE *)(&n->nd_tval) =
|
1355
|
+
klass;
|
1356
|
+
}
|
1357
|
+
break;
|
1358
|
+
}
|
1359
|
+
default:
|
1360
|
+
*(VALUE *)(&n->nd_tval) = RARRAY_PTR(v)[1];
|
1361
|
+
break;
|
1362
|
+
}
|
1363
|
+
return;
|
1364
|
+
}
|
1365
|
+
case NEN_VALUE:
|
1366
|
+
{
|
1367
|
+
if(v == Qnil)
|
1368
|
+
{
|
1369
|
+
n->nd_value = 0;
|
1370
|
+
}
|
1371
|
+
else
|
1372
|
+
{
|
1373
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
1374
|
+
if(RTEST(nid))
|
1375
|
+
{
|
1376
|
+
n->nd_value = id_to_node(nid);
|
1377
|
+
}
|
1378
|
+
else
|
1379
|
+
{
|
1380
|
+
n->u2.node = (NODE *)load_node_or_iseq_from_hash(
|
1381
|
+
v, node_hash, id_hash);
|
1382
|
+
}
|
1383
|
+
}
|
1384
|
+
return;
|
1385
|
+
}
|
1386
|
+
case NEN_VAR:
|
1387
|
+
{
|
1388
|
+
if(v == Qnil)
|
1389
|
+
{
|
1390
|
+
n->nd_var = 0;
|
1391
|
+
}
|
1392
|
+
else
|
1393
|
+
{
|
1394
|
+
VALUE nid = rb_hash_aref(id_hash, v);
|
1395
|
+
if(RTEST(nid))
|
1396
|
+
{
|
1397
|
+
n->nd_var = id_to_node(nid);
|
1398
|
+
}
|
1399
|
+
else
|
1400
|
+
{
|
1401
|
+
n->u1.node = (NODE *)load_node_or_iseq_from_hash(
|
1402
|
+
v, node_hash, id_hash);
|
1403
|
+
}
|
1404
|
+
}
|
1405
|
+
return;
|
1406
|
+
}
|
1407
|
+
case NEN_VID:
|
1408
|
+
{
|
1409
|
+
if(NIL_P(v))
|
1410
|
+
{
|
1411
|
+
n->nd_vid = 0;
|
1412
|
+
}
|
1413
|
+
else
|
1414
|
+
{
|
1415
|
+
n->nd_vid = SYM2ID(v);
|
1416
|
+
}
|
1417
|
+
return;
|
1418
|
+
}
|
1419
|
+
case NEN_VISI:
|
1420
|
+
{
|
1421
|
+
n->nd_visi = NUM2LONG(v);
|
1422
|
+
return;
|
1423
|
+
}
|
1424
|
+
}
|
1425
|
+
rb_raise(rb_eRuntimeError, "Internal error: invalid Node_Elem_Name %d", nen);
|
1426
|
+
}
|
1427
|
+
|
1428
|
+
/*
|
1429
|
+
* Return the Node's _1st_ member. The return type is
|
1430
|
+
* either a Node or an Object.
|
1431
|
+
*/
|
1432
|
+
static VALUE node_1st(VALUE self)
|
1433
|
+
{
|
1434
|
+
NODE * n;
|
1435
|
+
Data_Get_Struct(self, NODE, n);
|
1436
|
+
|
1437
|
+
if(TYPE(n->nd_1st) == T_NODE)
|
1438
|
+
{
|
1439
|
+
return wrap_node((NODE *)n->nd_1st);
|
1440
|
+
}
|
1441
|
+
else
|
1442
|
+
{
|
1443
|
+
return (VALUE)n->nd_1st;
|
1444
|
+
}
|
1445
|
+
}
|
1446
|
+
/*
|
1447
|
+
* Return the Node's _2nd_ member. The return type is
|
1448
|
+
* either a Node or an Object.
|
1449
|
+
*/
|
1450
|
+
static VALUE node_2nd(VALUE self)
|
1451
|
+
{
|
1452
|
+
NODE * n;
|
1453
|
+
Data_Get_Struct(self, NODE, n);
|
1454
|
+
|
1455
|
+
if(TYPE(n->nd_2nd) == T_NODE)
|
1456
|
+
{
|
1457
|
+
return wrap_node((NODE *)n->nd_2nd);
|
1458
|
+
}
|
1459
|
+
else
|
1460
|
+
{
|
1461
|
+
return (VALUE)n->nd_2nd;
|
1462
|
+
}
|
1463
|
+
}
|
1464
|
+
/*
|
1465
|
+
* Return the Node's _alen_ member. The return type is an
|
1466
|
+
* Integer.
|
1467
|
+
*/
|
1468
|
+
static VALUE node_alen(VALUE self)
|
1469
|
+
{
|
1470
|
+
NODE * n;
|
1471
|
+
Data_Get_Struct(self, NODE, n);
|
1472
|
+
return LONG2NUM(n->nd_alen);
|
1473
|
+
}
|
1474
|
+
/*
|
1475
|
+
* Return the Node's _argc_ member. The return type is an
|
1476
|
+
* Integer.
|
1477
|
+
*/
|
1478
|
+
static VALUE node_argc(VALUE self)
|
1479
|
+
{
|
1480
|
+
NODE * n;
|
1481
|
+
Data_Get_Struct(self, NODE, n);
|
1482
|
+
return LONG2NUM(n->nd_argc);
|
1483
|
+
}
|
1484
|
+
/*
|
1485
|
+
* Return the Node's _args_ member. The return type is
|
1486
|
+
* either a Node or an Object.
|
1487
|
+
*/
|
1488
|
+
static VALUE node_args(VALUE self)
|
1489
|
+
{
|
1490
|
+
NODE * n;
|
1491
|
+
Data_Get_Struct(self, NODE, n);
|
1492
|
+
|
1493
|
+
if(TYPE(n->nd_args) == T_NODE)
|
1494
|
+
{
|
1495
|
+
return wrap_node((NODE *)n->nd_args);
|
1496
|
+
}
|
1497
|
+
else
|
1498
|
+
{
|
1499
|
+
return (VALUE)n->nd_args;
|
1500
|
+
}
|
1501
|
+
}
|
1502
|
+
/*
|
1503
|
+
* Return the Node's _beg_ member. The return type is
|
1504
|
+
* either a Node or an Object.
|
1505
|
+
*/
|
1506
|
+
static VALUE node_beg(VALUE self)
|
1507
|
+
{
|
1508
|
+
NODE * n;
|
1509
|
+
Data_Get_Struct(self, NODE, n);
|
1510
|
+
|
1511
|
+
if(TYPE(n->nd_beg) == T_NODE)
|
1512
|
+
{
|
1513
|
+
return wrap_node((NODE *)n->nd_beg);
|
1514
|
+
}
|
1515
|
+
else
|
1516
|
+
{
|
1517
|
+
return (VALUE)n->nd_beg;
|
1518
|
+
}
|
1519
|
+
}
|
1520
|
+
/*
|
1521
|
+
* Return the Node's _body_ member. The return type is
|
1522
|
+
* either a Node or an Object.
|
1523
|
+
*/
|
1524
|
+
static VALUE node_body(VALUE self)
|
1525
|
+
{
|
1526
|
+
NODE * n;
|
1527
|
+
Data_Get_Struct(self, NODE, n);
|
1528
|
+
|
1529
|
+
if(TYPE(n->nd_body) == T_NODE)
|
1530
|
+
{
|
1531
|
+
return wrap_node((NODE *)n->nd_body);
|
1532
|
+
}
|
1533
|
+
else
|
1534
|
+
{
|
1535
|
+
return (VALUE)n->nd_body;
|
1536
|
+
}
|
1537
|
+
}
|
1538
|
+
/*
|
1539
|
+
* Return the Node's _cflag_ member. The return type is an
|
1540
|
+
* Integer.
|
1541
|
+
*/
|
1542
|
+
static VALUE node_cflag(VALUE self)
|
1543
|
+
{
|
1544
|
+
NODE * n;
|
1545
|
+
Data_Get_Struct(self, NODE, n);
|
1546
|
+
return LONG2NUM(n->nd_cflag);
|
1547
|
+
}
|
1548
|
+
/*
|
1549
|
+
* Return the Node's _cfnc_ member. The return type is an
|
1550
|
+
* integer representation of the cfnc's pointer.
|
1551
|
+
*/
|
1552
|
+
static VALUE node_cfnc(VALUE self)
|
1553
|
+
{
|
1554
|
+
NODE * n;
|
1555
|
+
Data_Get_Struct(self, NODE, n);
|
1556
|
+
return LONG2NUM((long)(n->nd_cfnc));
|
1557
|
+
}
|
1558
|
+
/*
|
1559
|
+
* Return the Node's _clss_ member. The return type is
|
1560
|
+
* either a Node or an Object.
|
1561
|
+
*/
|
1562
|
+
static VALUE node_clss(VALUE self)
|
1563
|
+
{
|
1564
|
+
NODE * n;
|
1565
|
+
Data_Get_Struct(self, NODE, n);
|
1566
|
+
|
1567
|
+
if(TYPE(n->nd_clss) == T_NODE)
|
1568
|
+
{
|
1569
|
+
return wrap_node((NODE *)n->nd_clss);
|
1570
|
+
}
|
1571
|
+
else
|
1572
|
+
{
|
1573
|
+
return (VALUE)n->nd_clss;
|
1574
|
+
}
|
1575
|
+
}
|
1576
|
+
/*
|
1577
|
+
* Return the Node's _cnt_ member. The return type is an
|
1578
|
+
* Integer.
|
1579
|
+
*/
|
1580
|
+
static VALUE node_cnt(VALUE self)
|
1581
|
+
{
|
1582
|
+
NODE * n;
|
1583
|
+
Data_Get_Struct(self, NODE, n);
|
1584
|
+
return LONG2NUM(n->nd_cnt);
|
1585
|
+
}
|
1586
|
+
/*
|
1587
|
+
* Return the Node's _cond_ member. The return type is
|
1588
|
+
* either a Node or an Object.
|
1589
|
+
*/
|
1590
|
+
static VALUE node_cond(VALUE self)
|
1591
|
+
{
|
1592
|
+
NODE * n;
|
1593
|
+
Data_Get_Struct(self, NODE, n);
|
1594
|
+
|
1595
|
+
if(TYPE(n->nd_cond) == T_NODE)
|
1596
|
+
{
|
1597
|
+
return wrap_node((NODE *)n->nd_cond);
|
1598
|
+
}
|
1599
|
+
else
|
1600
|
+
{
|
1601
|
+
return (VALUE)n->nd_cond;
|
1602
|
+
}
|
1603
|
+
}
|
1604
|
+
/*
|
1605
|
+
* Return the Node's _cpath_ member. The return type is
|
1606
|
+
* either a Node or an Object.
|
1607
|
+
*/
|
1608
|
+
static VALUE node_cpath(VALUE self)
|
1609
|
+
{
|
1610
|
+
NODE * n;
|
1611
|
+
Data_Get_Struct(self, NODE, n);
|
1612
|
+
|
1613
|
+
if(TYPE(n->nd_cpath) == T_NODE)
|
1614
|
+
{
|
1615
|
+
return wrap_node((NODE *)n->nd_cpath);
|
1616
|
+
}
|
1617
|
+
else
|
1618
|
+
{
|
1619
|
+
return (VALUE)n->nd_cpath;
|
1620
|
+
}
|
1621
|
+
}
|
1622
|
+
/*
|
1623
|
+
* Return the Node's _cval_ member. The return type is
|
1624
|
+
* either a Node or an Object.
|
1625
|
+
*/
|
1626
|
+
static VALUE node_cval(VALUE self)
|
1627
|
+
{
|
1628
|
+
NODE * n;
|
1629
|
+
Data_Get_Struct(self, NODE, n);
|
1630
|
+
|
1631
|
+
if(TYPE(n->nd_cval) == T_NODE)
|
1632
|
+
{
|
1633
|
+
return wrap_node((NODE *)n->nd_cval);
|
1634
|
+
}
|
1635
|
+
else
|
1636
|
+
{
|
1637
|
+
return (VALUE)n->nd_cval;
|
1638
|
+
}
|
1639
|
+
}
|
1640
|
+
/*
|
1641
|
+
* Return the Node's _defn_ member. The return type is
|
1642
|
+
* either a Node or an Object.
|
1643
|
+
*/
|
1644
|
+
static VALUE node_defn(VALUE self)
|
1645
|
+
{
|
1646
|
+
NODE * n;
|
1647
|
+
Data_Get_Struct(self, NODE, n);
|
1648
|
+
|
1649
|
+
if(TYPE(n->nd_defn) == T_NODE)
|
1650
|
+
{
|
1651
|
+
return wrap_node((NODE *)n->nd_defn);
|
1652
|
+
}
|
1653
|
+
else
|
1654
|
+
{
|
1655
|
+
return (VALUE)n->nd_defn;
|
1656
|
+
}
|
1657
|
+
}
|
1658
|
+
/*
|
1659
|
+
* Return the Node's _else_ member. The return type is
|
1660
|
+
* either a Node or an Object.
|
1661
|
+
*/
|
1662
|
+
static VALUE node_else(VALUE self)
|
1663
|
+
{
|
1664
|
+
NODE * n;
|
1665
|
+
Data_Get_Struct(self, NODE, n);
|
1666
|
+
|
1667
|
+
if(TYPE(n->nd_else) == T_NODE)
|
1668
|
+
{
|
1669
|
+
return wrap_node((NODE *)n->nd_else);
|
1670
|
+
}
|
1671
|
+
else
|
1672
|
+
{
|
1673
|
+
return (VALUE)n->nd_else;
|
1674
|
+
}
|
1675
|
+
}
|
1676
|
+
/*
|
1677
|
+
* Return the Node's _end_ member. The return type is
|
1678
|
+
* either a Node or an Object.
|
1679
|
+
*/
|
1680
|
+
static VALUE node_end(VALUE self)
|
1681
|
+
{
|
1682
|
+
NODE * n;
|
1683
|
+
Data_Get_Struct(self, NODE, n);
|
1684
|
+
|
1685
|
+
if(TYPE(n->nd_end) == T_NODE)
|
1686
|
+
{
|
1687
|
+
return wrap_node((NODE *)n->nd_end);
|
1688
|
+
}
|
1689
|
+
else
|
1690
|
+
{
|
1691
|
+
return (VALUE)n->nd_end;
|
1692
|
+
}
|
1693
|
+
}
|
1694
|
+
/*
|
1695
|
+
* Return the Node's _ensr_ member. The return type is
|
1696
|
+
* either a Node or an Object.
|
1697
|
+
*/
|
1698
|
+
static VALUE node_ensr(VALUE self)
|
1699
|
+
{
|
1700
|
+
NODE * n;
|
1701
|
+
Data_Get_Struct(self, NODE, n);
|
1702
|
+
|
1703
|
+
if(TYPE(n->nd_ensr) == T_NODE)
|
1704
|
+
{
|
1705
|
+
return wrap_node((NODE *)n->nd_ensr);
|
1706
|
+
}
|
1707
|
+
else
|
1708
|
+
{
|
1709
|
+
return (VALUE)n->nd_ensr;
|
1710
|
+
}
|
1711
|
+
}
|
1712
|
+
/*
|
1713
|
+
* Return the Node's _entry_ member. The return type is
|
1714
|
+
* either a Node or an Object.
|
1715
|
+
*/
|
1716
|
+
static VALUE node_entry(VALUE self)
|
1717
|
+
{
|
1718
|
+
NODE * n;
|
1719
|
+
Data_Get_Struct(self, NODE, n);
|
1720
|
+
if(n->nd_entry->id == 0)
|
1721
|
+
{
|
1722
|
+
rb_raise(
|
1723
|
+
rb_eRuntimeError,
|
1724
|
+
"Invalid ID for entry (node type %d)",
|
1725
|
+
nd_type(n));
|
1726
|
+
}
|
1727
|
+
return ID2SYM(n->nd_entry->id);
|
1728
|
+
}
|
1729
|
+
/*
|
1730
|
+
* Return the Node's _head_ member. The return type is
|
1731
|
+
* either a Node or an Object.
|
1732
|
+
*/
|
1733
|
+
static VALUE node_head(VALUE self)
|
1734
|
+
{
|
1735
|
+
NODE * n;
|
1736
|
+
Data_Get_Struct(self, NODE, n);
|
1737
|
+
|
1738
|
+
if(TYPE(n->nd_head) == T_NODE)
|
1739
|
+
{
|
1740
|
+
return wrap_node((NODE *)n->nd_head);
|
1741
|
+
}
|
1742
|
+
else
|
1743
|
+
{
|
1744
|
+
return (VALUE)n->nd_head;
|
1745
|
+
}
|
1746
|
+
}
|
1747
|
+
/*
|
1748
|
+
* Return the Node's _iter_ member. The return type is
|
1749
|
+
* either a Node or an Object.
|
1750
|
+
*/
|
1751
|
+
static VALUE node_iter(VALUE self)
|
1752
|
+
{
|
1753
|
+
NODE * n;
|
1754
|
+
Data_Get_Struct(self, NODE, n);
|
1755
|
+
|
1756
|
+
if(TYPE(n->nd_iter) == T_NODE)
|
1757
|
+
{
|
1758
|
+
return wrap_node((NODE *)n->nd_iter);
|
1759
|
+
}
|
1760
|
+
else
|
1761
|
+
{
|
1762
|
+
return (VALUE)n->nd_iter;
|
1763
|
+
}
|
1764
|
+
}
|
1765
|
+
/*
|
1766
|
+
* Return the Node's _lit_ member. The return type is
|
1767
|
+
* either a Node or an Object.
|
1768
|
+
*/
|
1769
|
+
static VALUE node_lit(VALUE self)
|
1770
|
+
{
|
1771
|
+
NODE * n;
|
1772
|
+
Data_Get_Struct(self, NODE, n);
|
1773
|
+
|
1774
|
+
if(TYPE(n->nd_lit) == T_NODE)
|
1775
|
+
{
|
1776
|
+
return wrap_node((NODE *)n->nd_lit);
|
1777
|
+
}
|
1778
|
+
else
|
1779
|
+
{
|
1780
|
+
return (VALUE)n->nd_lit;
|
1781
|
+
}
|
1782
|
+
}
|
1783
|
+
/*
|
1784
|
+
* Return the Node's _mid_ member. The return type is a
|
1785
|
+
* Symbol.
|
1786
|
+
*/
|
1787
|
+
static VALUE node_mid(VALUE self)
|
1788
|
+
{
|
1789
|
+
NODE * n;
|
1790
|
+
Data_Get_Struct(self, NODE, n);
|
1791
|
+
if(n->nd_mid == 0)
|
1792
|
+
{
|
1793
|
+
rb_raise(
|
1794
|
+
rb_eRuntimeError,
|
1795
|
+
"Invalid ID for mid (node type=%d)",
|
1796
|
+
nd_type(n));
|
1797
|
+
}
|
1798
|
+
return ID2SYM(n->nd_mid);
|
1799
|
+
}
|
1800
|
+
/*
|
1801
|
+
* Return the Node's _next_ member. The return type is
|
1802
|
+
* either a Node or an Object.
|
1803
|
+
*/
|
1804
|
+
static VALUE node_next(VALUE self)
|
1805
|
+
{
|
1806
|
+
NODE * n;
|
1807
|
+
Data_Get_Struct(self, NODE, n);
|
1808
|
+
|
1809
|
+
if(TYPE(n->nd_next) == T_NODE)
|
1810
|
+
{
|
1811
|
+
return wrap_node((NODE *)n->nd_next);
|
1812
|
+
}
|
1813
|
+
else
|
1814
|
+
{
|
1815
|
+
return (VALUE)n->nd_next;
|
1816
|
+
}
|
1817
|
+
}
|
1818
|
+
/*
|
1819
|
+
* Return the Node's _noex_ member. The return type is an
|
1820
|
+
* Integer.
|
1821
|
+
*/
|
1822
|
+
static VALUE node_noex(VALUE self)
|
1823
|
+
{
|
1824
|
+
NODE * n;
|
1825
|
+
Data_Get_Struct(self, NODE, n);
|
1826
|
+
return LONG2NUM(n->nd_noex);
|
1827
|
+
}
|
1828
|
+
/*
|
1829
|
+
* Return the Node's _nth_ member. The return type is an
|
1830
|
+
* Integer.
|
1831
|
+
*/
|
1832
|
+
static VALUE node_nth(VALUE self)
|
1833
|
+
{
|
1834
|
+
NODE * n;
|
1835
|
+
Data_Get_Struct(self, NODE, n);
|
1836
|
+
return LONG2NUM(n->nd_nth);
|
1837
|
+
}
|
1838
|
+
/*
|
1839
|
+
* Return the Node's _oid_ member. The return type is a
|
1840
|
+
* Symbol.
|
1841
|
+
*/
|
1842
|
+
static VALUE node_oid(VALUE self)
|
1843
|
+
{
|
1844
|
+
NODE * n;
|
1845
|
+
Data_Get_Struct(self, NODE, n);
|
1846
|
+
if(n->nd_oid == 0)
|
1847
|
+
{
|
1848
|
+
rb_raise(
|
1849
|
+
rb_eRuntimeError,
|
1850
|
+
"Invalid ID for oid (node type=%d)",
|
1851
|
+
nd_type(n));
|
1852
|
+
}
|
1853
|
+
return ID2SYM(n->nd_oid);
|
1854
|
+
}
|
1855
|
+
/*
|
1856
|
+
* Return the Node's _opt_ member. The return type is
|
1857
|
+
* either a Node or an Object.
|
1858
|
+
*/
|
1859
|
+
static VALUE node_opt(VALUE self)
|
1860
|
+
{
|
1861
|
+
NODE * n;
|
1862
|
+
Data_Get_Struct(self, NODE, n);
|
1863
|
+
|
1864
|
+
if(TYPE(n->nd_opt) == T_NODE)
|
1865
|
+
{
|
1866
|
+
return wrap_node((NODE *)n->nd_opt);
|
1867
|
+
}
|
1868
|
+
else
|
1869
|
+
{
|
1870
|
+
return (VALUE)n->nd_opt;
|
1871
|
+
}
|
1872
|
+
}
|
1873
|
+
/*
|
1874
|
+
* Return the Node's _recv_ member. The return type is
|
1875
|
+
* either a Node or an Object.
|
1876
|
+
*/
|
1877
|
+
static VALUE node_recv(VALUE self)
|
1878
|
+
{
|
1879
|
+
NODE * n;
|
1880
|
+
Data_Get_Struct(self, NODE, n);
|
1881
|
+
|
1882
|
+
if(TYPE(n->nd_recv) == T_NODE)
|
1883
|
+
{
|
1884
|
+
return wrap_node((NODE *)n->nd_recv);
|
1885
|
+
}
|
1886
|
+
else
|
1887
|
+
{
|
1888
|
+
return (VALUE)n->nd_recv;
|
1889
|
+
}
|
1890
|
+
}
|
1891
|
+
/*
|
1892
|
+
* Return the Node's _resq_ member. The return type is
|
1893
|
+
* either a Node or an Object.
|
1894
|
+
*/
|
1895
|
+
static VALUE node_resq(VALUE self)
|
1896
|
+
{
|
1897
|
+
NODE * n;
|
1898
|
+
Data_Get_Struct(self, NODE, n);
|
1899
|
+
|
1900
|
+
if(TYPE(n->nd_resq) == T_NODE)
|
1901
|
+
{
|
1902
|
+
return wrap_node((NODE *)n->nd_resq);
|
1903
|
+
}
|
1904
|
+
else
|
1905
|
+
{
|
1906
|
+
return (VALUE)n->nd_resq;
|
1907
|
+
}
|
1908
|
+
}
|
1909
|
+
/*
|
1910
|
+
* Return the Node's _rest_ member. The return type is a
|
1911
|
+
* Symbol.
|
1912
|
+
*/
|
1913
|
+
static VALUE node_rest(VALUE self)
|
1914
|
+
{
|
1915
|
+
NODE * n;
|
1916
|
+
Data_Get_Struct(self, NODE, n);
|
1917
|
+
if(n->nd_rest == 0)
|
1918
|
+
{
|
1919
|
+
rb_raise(
|
1920
|
+
rb_eRuntimeError,
|
1921
|
+
"Invalid ID for rest (node type=%d)",
|
1922
|
+
nd_type(n));
|
1923
|
+
}
|
1924
|
+
return ID2SYM(n->nd_rest);
|
1925
|
+
}
|
1926
|
+
/*
|
1927
|
+
* Return the Node's _rval_ member. The return type is
|
1928
|
+
* either a Node or an Object.
|
1929
|
+
*/
|
1930
|
+
static VALUE node_rval(VALUE self)
|
1931
|
+
{
|
1932
|
+
NODE * n;
|
1933
|
+
Data_Get_Struct(self, NODE, n);
|
1934
|
+
|
1935
|
+
if(TYPE(n->nd_rval) == T_NODE)
|
1936
|
+
{
|
1937
|
+
return wrap_node((NODE *)n->nd_rval);
|
1938
|
+
}
|
1939
|
+
else
|
1940
|
+
{
|
1941
|
+
return (VALUE)n->nd_rval;
|
1942
|
+
}
|
1943
|
+
}
|
1944
|
+
/*
|
1945
|
+
* Return the Node's _state_ member. The return type is an
|
1946
|
+
* Integer.
|
1947
|
+
*/
|
1948
|
+
static VALUE node_state(VALUE self)
|
1949
|
+
{
|
1950
|
+
NODE * n;
|
1951
|
+
Data_Get_Struct(self, NODE, n);
|
1952
|
+
return LONG2NUM(n->nd_state);
|
1953
|
+
}
|
1954
|
+
/*
|
1955
|
+
* Return the Node's _stts_ member. The return type is
|
1956
|
+
* either a Node or an Object.
|
1957
|
+
*/
|
1958
|
+
static VALUE node_stts(VALUE self)
|
1959
|
+
{
|
1960
|
+
NODE * n;
|
1961
|
+
Data_Get_Struct(self, NODE, n);
|
1962
|
+
|
1963
|
+
if(TYPE(n->nd_stts) == T_NODE)
|
1964
|
+
{
|
1965
|
+
return wrap_node((NODE *)n->nd_stts);
|
1966
|
+
}
|
1967
|
+
else
|
1968
|
+
{
|
1969
|
+
return (VALUE)n->nd_stts;
|
1970
|
+
}
|
1971
|
+
}
|
1972
|
+
/*
|
1973
|
+
* Return the Node's _super_ member. The return type is
|
1974
|
+
* either a Node or an Object.
|
1975
|
+
*/
|
1976
|
+
static VALUE node_super(VALUE self)
|
1977
|
+
{
|
1978
|
+
NODE * n;
|
1979
|
+
Data_Get_Struct(self, NODE, n);
|
1980
|
+
|
1981
|
+
if(TYPE(n->nd_super) == T_NODE)
|
1982
|
+
{
|
1983
|
+
return wrap_node((NODE *)n->nd_super);
|
1984
|
+
}
|
1985
|
+
else
|
1986
|
+
{
|
1987
|
+
return (VALUE)n->nd_super;
|
1988
|
+
}
|
1989
|
+
}
|
1990
|
+
/*
|
1991
|
+
* Return the Node's _tbl_ member. The return value is an
|
1992
|
+
* Array holding names of variables.
|
1993
|
+
*/
|
1994
|
+
static VALUE node_tbl(VALUE self)
|
1995
|
+
{
|
1996
|
+
NODE * n;
|
1997
|
+
Data_Get_Struct(self, NODE, n);
|
1998
|
+
return variable_names(n->nd_tbl);
|
1999
|
+
}
|
2000
|
+
/*
|
2001
|
+
* Return the Node's _tval_ member. The return type is
|
2002
|
+
* either a Node or an Object.
|
2003
|
+
*/
|
2004
|
+
static VALUE node_tval(VALUE self)
|
2005
|
+
{
|
2006
|
+
NODE * n;
|
2007
|
+
Data_Get_Struct(self, NODE, n);
|
2008
|
+
|
2009
|
+
if(TYPE(n->nd_tval) == T_NODE)
|
2010
|
+
{
|
2011
|
+
return wrap_node((NODE *)n->nd_tval);
|
2012
|
+
}
|
2013
|
+
else
|
2014
|
+
{
|
2015
|
+
return (VALUE)n->nd_tval;
|
2016
|
+
}
|
2017
|
+
}
|
2018
|
+
/*
|
2019
|
+
* Return the Node's _value_ member. The return type is
|
2020
|
+
* either a Node or an Object.
|
2021
|
+
*/
|
2022
|
+
static VALUE node_value(VALUE self)
|
2023
|
+
{
|
2024
|
+
NODE * n;
|
2025
|
+
Data_Get_Struct(self, NODE, n);
|
2026
|
+
|
2027
|
+
if(TYPE(n->nd_value) == T_NODE)
|
2028
|
+
{
|
2029
|
+
return wrap_node((NODE *)n->nd_value);
|
2030
|
+
}
|
2031
|
+
else
|
2032
|
+
{
|
2033
|
+
return (VALUE)n->nd_value;
|
2034
|
+
}
|
2035
|
+
}
|
2036
|
+
/*
|
2037
|
+
* Return the Node's _var_ member. The return type is
|
2038
|
+
* either a Node or an Object.
|
2039
|
+
*/
|
2040
|
+
static VALUE node_var(VALUE self)
|
2041
|
+
{
|
2042
|
+
NODE * n;
|
2043
|
+
Data_Get_Struct(self, NODE, n);
|
2044
|
+
|
2045
|
+
if(TYPE(n->nd_var) == T_NODE)
|
2046
|
+
{
|
2047
|
+
return wrap_node((NODE *)n->nd_var);
|
2048
|
+
}
|
2049
|
+
else
|
2050
|
+
{
|
2051
|
+
return (VALUE)n->nd_var;
|
2052
|
+
}
|
2053
|
+
}
|
2054
|
+
/*
|
2055
|
+
* Return the Node's _vid_ member. The return type is a
|
2056
|
+
* Symbol.
|
2057
|
+
*/
|
2058
|
+
static VALUE node_vid(VALUE self)
|
2059
|
+
{
|
2060
|
+
NODE * n;
|
2061
|
+
Data_Get_Struct(self, NODE, n);
|
2062
|
+
if(n->nd_vid == 0)
|
2063
|
+
{
|
2064
|
+
rb_raise(
|
2065
|
+
rb_eRuntimeError,
|
2066
|
+
"Invalid ID for vid (node type=%d)",
|
2067
|
+
nd_type(n));
|
2068
|
+
}
|
2069
|
+
return ID2SYM(n->nd_vid);
|
2070
|
+
}
|
2071
|
+
|
2072
|
+
/*
|
2073
|
+
* Return an array of strings containing the names of the node class's
|
2074
|
+
* members.
|
2075
|
+
*/
|
2076
|
+
VALUE node_s_members(VALUE klass)
|
2077
|
+
{
|
2078
|
+
return rb_iv_get(klass, "__member__");
|
2079
|
+
}
|
2080
|
+
|
2081
|
+
void define_node_subclass_methods()
|
2082
|
+
{
|
2083
|
+
/* For rdoc: rb_cNode = rb_define_class("Node", rb_cObject); */
|
2084
|
+
VALUE rb_cNode = rb_const_get(rb_cObject, rb_intern("Node"));
|
2085
|
+
VALUE members;
|
2086
|
+
|
2087
|
+
{
|
2088
|
+
VALUE rb_cBLOCK = rb_define_class_under(rb_cNode, "BLOCK", rb_cNode);
|
2089
|
+
members = rb_ary_new();
|
2090
|
+
rb_cNodeSubclass[NODE_BLOCK] = rb_cBLOCK;
|
2091
|
+
rb_iv_set(rb_cBLOCK, "__member__", members);
|
2092
|
+
rb_define_singleton_method(rb_cBLOCK, "members", node_s_members, 0);
|
2093
|
+
rb_define_method(rb_cBLOCK, "head", node_head, 0);
|
2094
|
+
rb_ary_push(members, rb_str_new2("head"));
|
2095
|
+
rb_define_method(rb_cBLOCK, "next", node_next, 0);
|
2096
|
+
rb_ary_push(members, rb_str_new2("next"));
|
2097
|
+
}
|
2098
|
+
{
|
2099
|
+
VALUE rb_cPOSTEXE = rb_define_class_under(rb_cNode, "POSTEXE", rb_cNode);
|
2100
|
+
members = rb_ary_new();
|
2101
|
+
rb_cNodeSubclass[NODE_POSTEXE] = rb_cPOSTEXE;
|
2102
|
+
rb_iv_set(rb_cPOSTEXE, "__member__", members);
|
2103
|
+
rb_define_singleton_method(rb_cPOSTEXE, "members", node_s_members, 0);
|
2104
|
+
}
|
2105
|
+
{
|
2106
|
+
VALUE rb_cBEGIN = rb_define_class_under(rb_cNode, "BEGIN", rb_cNode);
|
2107
|
+
members = rb_ary_new();
|
2108
|
+
rb_cNodeSubclass[NODE_BEGIN] = rb_cBEGIN;
|
2109
|
+
rb_iv_set(rb_cBEGIN, "__member__", members);
|
2110
|
+
rb_define_singleton_method(rb_cBEGIN, "members", node_s_members, 0);
|
2111
|
+
rb_define_method(rb_cBEGIN, "body", node_body, 0);
|
2112
|
+
rb_ary_push(members, rb_str_new2("body"));
|
2113
|
+
}
|
2114
|
+
{
|
2115
|
+
VALUE rb_cMATCH = rb_define_class_under(rb_cNode, "MATCH", rb_cNode);
|
2116
|
+
members = rb_ary_new();
|
2117
|
+
rb_cNodeSubclass[NODE_MATCH] = rb_cMATCH;
|
2118
|
+
rb_iv_set(rb_cMATCH, "__member__", members);
|
2119
|
+
rb_define_singleton_method(rb_cMATCH, "members", node_s_members, 0);
|
2120
|
+
rb_define_method(rb_cMATCH, "head", node_head, 0);
|
2121
|
+
rb_ary_push(members, rb_str_new2("head"));
|
2122
|
+
}
|
2123
|
+
{
|
2124
|
+
VALUE rb_cMATCH2 = rb_define_class_under(rb_cNode, "MATCH2", rb_cNode);
|
2125
|
+
members = rb_ary_new();
|
2126
|
+
rb_cNodeSubclass[NODE_MATCH2] = rb_cMATCH2;
|
2127
|
+
rb_iv_set(rb_cMATCH2, "__member__", members);
|
2128
|
+
rb_define_singleton_method(rb_cMATCH2, "members", node_s_members, 0);
|
2129
|
+
rb_define_method(rb_cMATCH2, "recv", node_recv, 0);
|
2130
|
+
rb_ary_push(members, rb_str_new2("recv"));
|
2131
|
+
rb_define_method(rb_cMATCH2, "value", node_value, 0);
|
2132
|
+
rb_ary_push(members, rb_str_new2("value"));
|
2133
|
+
}
|
2134
|
+
{
|
2135
|
+
VALUE rb_cMATCH3 = rb_define_class_under(rb_cNode, "MATCH3", rb_cNode);
|
2136
|
+
members = rb_ary_new();
|
2137
|
+
rb_cNodeSubclass[NODE_MATCH3] = rb_cMATCH3;
|
2138
|
+
rb_iv_set(rb_cMATCH3, "__member__", members);
|
2139
|
+
rb_define_singleton_method(rb_cMATCH3, "members", node_s_members, 0);
|
2140
|
+
rb_define_method(rb_cMATCH3, "recv", node_recv, 0);
|
2141
|
+
rb_ary_push(members, rb_str_new2("recv"));
|
2142
|
+
rb_define_method(rb_cMATCH3, "value", node_value, 0);
|
2143
|
+
rb_ary_push(members, rb_str_new2("value"));
|
2144
|
+
}
|
2145
|
+
{
|
2146
|
+
VALUE rb_cOPT_N = rb_define_class_under(rb_cNode, "OPT_N", rb_cNode);
|
2147
|
+
members = rb_ary_new();
|
2148
|
+
rb_cNodeSubclass[NODE_OPT_N] = rb_cOPT_N;
|
2149
|
+
rb_iv_set(rb_cOPT_N, "__member__", members);
|
2150
|
+
rb_define_singleton_method(rb_cOPT_N, "members", node_s_members, 0);
|
2151
|
+
rb_define_method(rb_cOPT_N, "body", node_body, 0);
|
2152
|
+
rb_ary_push(members, rb_str_new2("body"));
|
2153
|
+
}
|
2154
|
+
{
|
2155
|
+
VALUE rb_cSELF = rb_define_class_under(rb_cNode, "SELF", rb_cNode);
|
2156
|
+
members = rb_ary_new();
|
2157
|
+
rb_cNodeSubclass[NODE_SELF] = rb_cSELF;
|
2158
|
+
rb_iv_set(rb_cSELF, "__member__", members);
|
2159
|
+
rb_define_singleton_method(rb_cSELF, "members", node_s_members, 0);
|
2160
|
+
}
|
2161
|
+
{
|
2162
|
+
VALUE rb_cNILNODE = rb_define_class_under(rb_cNode, "NILNODE", rb_cNode);
|
2163
|
+
members = rb_ary_new();
|
2164
|
+
rb_cNodeSubclass[NODE_NIL] = rb_cNILNODE;
|
2165
|
+
rb_iv_set(rb_cNILNODE, "__member__", members);
|
2166
|
+
rb_define_singleton_method(rb_cNILNODE, "members", node_s_members, 0);
|
2167
|
+
}
|
2168
|
+
{
|
2169
|
+
VALUE rb_cTRUENODE = rb_define_class_under(rb_cNode, "TRUENODE", rb_cNode);
|
2170
|
+
members = rb_ary_new();
|
2171
|
+
rb_cNodeSubclass[NODE_TRUE] = rb_cTRUENODE;
|
2172
|
+
rb_iv_set(rb_cTRUENODE, "__member__", members);
|
2173
|
+
rb_define_singleton_method(rb_cTRUENODE, "members", node_s_members, 0);
|
2174
|
+
}
|
2175
|
+
{
|
2176
|
+
VALUE rb_cFALSENODE = rb_define_class_under(rb_cNode, "FALSENODE", rb_cNode);
|
2177
|
+
members = rb_ary_new();
|
2178
|
+
rb_cNodeSubclass[NODE_FALSE] = rb_cFALSENODE;
|
2179
|
+
rb_iv_set(rb_cFALSENODE, "__member__", members);
|
2180
|
+
rb_define_singleton_method(rb_cFALSENODE, "members", node_s_members, 0);
|
2181
|
+
}
|
2182
|
+
{
|
2183
|
+
VALUE rb_cIF = rb_define_class_under(rb_cNode, "IF", rb_cNode);
|
2184
|
+
members = rb_ary_new();
|
2185
|
+
rb_cNodeSubclass[NODE_IF] = rb_cIF;
|
2186
|
+
rb_iv_set(rb_cIF, "__member__", members);
|
2187
|
+
rb_define_singleton_method(rb_cIF, "members", node_s_members, 0);
|
2188
|
+
rb_define_method(rb_cIF, "body", node_body, 0);
|
2189
|
+
rb_ary_push(members, rb_str_new2("body"));
|
2190
|
+
rb_define_method(rb_cIF, "else", node_else, 0);
|
2191
|
+
rb_ary_push(members, rb_str_new2("else"));
|
2192
|
+
rb_define_method(rb_cIF, "cond", node_cond, 0);
|
2193
|
+
rb_ary_push(members, rb_str_new2("cond"));
|
2194
|
+
}
|
2195
|
+
{
|
2196
|
+
VALUE rb_cWHEN = rb_define_class_under(rb_cNode, "WHEN", rb_cNode);
|
2197
|
+
members = rb_ary_new();
|
2198
|
+
rb_cNodeSubclass[NODE_WHEN] = rb_cWHEN;
|
2199
|
+
rb_iv_set(rb_cWHEN, "__member__", members);
|
2200
|
+
rb_define_singleton_method(rb_cWHEN, "members", node_s_members, 0);
|
2201
|
+
rb_define_method(rb_cWHEN, "head", node_head, 0);
|
2202
|
+
rb_ary_push(members, rb_str_new2("head"));
|
2203
|
+
rb_define_method(rb_cWHEN, "body", node_body, 0);
|
2204
|
+
rb_ary_push(members, rb_str_new2("body"));
|
2205
|
+
rb_define_method(rb_cWHEN, "next", node_next, 0);
|
2206
|
+
rb_ary_push(members, rb_str_new2("next"));
|
2207
|
+
}
|
2208
|
+
{
|
2209
|
+
VALUE rb_cCASE = rb_define_class_under(rb_cNode, "CASE", rb_cNode);
|
2210
|
+
members = rb_ary_new();
|
2211
|
+
rb_cNodeSubclass[NODE_CASE] = rb_cCASE;
|
2212
|
+
rb_iv_set(rb_cCASE, "__member__", members);
|
2213
|
+
rb_define_singleton_method(rb_cCASE, "members", node_s_members, 0);
|
2214
|
+
rb_define_method(rb_cCASE, "head", node_head, 0);
|
2215
|
+
rb_ary_push(members, rb_str_new2("head"));
|
2216
|
+
rb_define_method(rb_cCASE, "body", node_body, 0);
|
2217
|
+
rb_ary_push(members, rb_str_new2("body"));
|
2218
|
+
rb_define_method(rb_cCASE, "next", node_next, 0);
|
2219
|
+
rb_ary_push(members, rb_str_new2("next"));
|
2220
|
+
}
|
2221
|
+
{
|
2222
|
+
VALUE rb_cWHILE = rb_define_class_under(rb_cNode, "WHILE", rb_cNode);
|
2223
|
+
members = rb_ary_new();
|
2224
|
+
rb_cNodeSubclass[NODE_WHILE] = rb_cWHILE;
|
2225
|
+
rb_iv_set(rb_cWHILE, "__member__", members);
|
2226
|
+
rb_define_singleton_method(rb_cWHILE, "members", node_s_members, 0);
|
2227
|
+
rb_define_method(rb_cWHILE, "cond", node_cond, 0);
|
2228
|
+
rb_ary_push(members, rb_str_new2("cond"));
|
2229
|
+
rb_define_method(rb_cWHILE, "body", node_body, 0);
|
2230
|
+
rb_ary_push(members, rb_str_new2("body"));
|
2231
|
+
rb_define_method(rb_cWHILE, "state", node_state, 0);
|
2232
|
+
rb_ary_push(members, rb_str_new2("state"));
|
2233
|
+
}
|
2234
|
+
{
|
2235
|
+
VALUE rb_cUNTIL = rb_define_class_under(rb_cNode, "UNTIL", rb_cNode);
|
2236
|
+
members = rb_ary_new();
|
2237
|
+
rb_cNodeSubclass[NODE_UNTIL] = rb_cUNTIL;
|
2238
|
+
rb_iv_set(rb_cUNTIL, "__member__", members);
|
2239
|
+
rb_define_singleton_method(rb_cUNTIL, "members", node_s_members, 0);
|
2240
|
+
rb_define_method(rb_cUNTIL, "cond", node_cond, 0);
|
2241
|
+
rb_ary_push(members, rb_str_new2("cond"));
|
2242
|
+
rb_define_method(rb_cUNTIL, "body", node_body, 0);
|
2243
|
+
rb_ary_push(members, rb_str_new2("body"));
|
2244
|
+
rb_define_method(rb_cUNTIL, "state", node_state, 0);
|
2245
|
+
rb_ary_push(members, rb_str_new2("state"));
|
2246
|
+
}
|
2247
|
+
{
|
2248
|
+
VALUE rb_cBLOCK_PASS = rb_define_class_under(rb_cNode, "BLOCK_PASS", rb_cNode);
|
2249
|
+
members = rb_ary_new();
|
2250
|
+
rb_cNodeSubclass[NODE_BLOCK_PASS] = rb_cBLOCK_PASS;
|
2251
|
+
rb_iv_set(rb_cBLOCK_PASS, "__member__", members);
|
2252
|
+
rb_define_singleton_method(rb_cBLOCK_PASS, "members", node_s_members, 0);
|
2253
|
+
rb_define_method(rb_cBLOCK_PASS, "body", node_body, 0);
|
2254
|
+
rb_ary_push(members, rb_str_new2("body"));
|
2255
|
+
rb_define_method(rb_cBLOCK_PASS, "iter", node_iter, 0);
|
2256
|
+
rb_ary_push(members, rb_str_new2("iter"));
|
2257
|
+
}
|
2258
|
+
{
|
2259
|
+
VALUE rb_cITER = rb_define_class_under(rb_cNode, "ITER", rb_cNode);
|
2260
|
+
members = rb_ary_new();
|
2261
|
+
rb_cNodeSubclass[NODE_ITER] = rb_cITER;
|
2262
|
+
rb_iv_set(rb_cITER, "__member__", members);
|
2263
|
+
rb_define_singleton_method(rb_cITER, "members", node_s_members, 0);
|
2264
|
+
rb_define_method(rb_cITER, "var", node_var, 0);
|
2265
|
+
rb_ary_push(members, rb_str_new2("var"));
|
2266
|
+
rb_define_method(rb_cITER, "body", node_body, 0);
|
2267
|
+
rb_ary_push(members, rb_str_new2("body"));
|
2268
|
+
rb_define_method(rb_cITER, "iter", node_iter, 0);
|
2269
|
+
rb_ary_push(members, rb_str_new2("iter"));
|
2270
|
+
}
|
2271
|
+
{
|
2272
|
+
VALUE rb_cFOR = rb_define_class_under(rb_cNode, "FOR", rb_cNode);
|
2273
|
+
members = rb_ary_new();
|
2274
|
+
rb_cNodeSubclass[NODE_FOR] = rb_cFOR;
|
2275
|
+
rb_iv_set(rb_cFOR, "__member__", members);
|
2276
|
+
rb_define_singleton_method(rb_cFOR, "members", node_s_members, 0);
|
2277
|
+
rb_define_method(rb_cFOR, "var", node_var, 0);
|
2278
|
+
rb_ary_push(members, rb_str_new2("var"));
|
2279
|
+
rb_define_method(rb_cFOR, "body", node_body, 0);
|
2280
|
+
rb_ary_push(members, rb_str_new2("body"));
|
2281
|
+
rb_define_method(rb_cFOR, "iter", node_iter, 0);
|
2282
|
+
rb_ary_push(members, rb_str_new2("iter"));
|
2283
|
+
}
|
2284
|
+
{
|
2285
|
+
VALUE rb_cBREAK = rb_define_class_under(rb_cNode, "BREAK", rb_cNode);
|
2286
|
+
members = rb_ary_new();
|
2287
|
+
rb_cNodeSubclass[NODE_BREAK] = rb_cBREAK;
|
2288
|
+
rb_iv_set(rb_cBREAK, "__member__", members);
|
2289
|
+
rb_define_singleton_method(rb_cBREAK, "members", node_s_members, 0);
|
2290
|
+
rb_define_method(rb_cBREAK, "stts", node_stts, 0);
|
2291
|
+
rb_ary_push(members, rb_str_new2("stts"));
|
2292
|
+
}
|
2293
|
+
{
|
2294
|
+
VALUE rb_cNEXT = rb_define_class_under(rb_cNode, "NEXT", rb_cNode);
|
2295
|
+
members = rb_ary_new();
|
2296
|
+
rb_cNodeSubclass[NODE_NEXT] = rb_cNEXT;
|
2297
|
+
rb_iv_set(rb_cNEXT, "__member__", members);
|
2298
|
+
rb_define_singleton_method(rb_cNEXT, "members", node_s_members, 0);
|
2299
|
+
rb_define_method(rb_cNEXT, "stts", node_stts, 0);
|
2300
|
+
rb_ary_push(members, rb_str_new2("stts"));
|
2301
|
+
}
|
2302
|
+
{
|
2303
|
+
VALUE rb_cREDO = rb_define_class_under(rb_cNode, "REDO", rb_cNode);
|
2304
|
+
members = rb_ary_new();
|
2305
|
+
rb_cNodeSubclass[NODE_REDO] = rb_cREDO;
|
2306
|
+
rb_iv_set(rb_cREDO, "__member__", members);
|
2307
|
+
rb_define_singleton_method(rb_cREDO, "members", node_s_members, 0);
|
2308
|
+
}
|
2309
|
+
{
|
2310
|
+
VALUE rb_cRETRY = rb_define_class_under(rb_cNode, "RETRY", rb_cNode);
|
2311
|
+
members = rb_ary_new();
|
2312
|
+
rb_cNodeSubclass[NODE_RETRY] = rb_cRETRY;
|
2313
|
+
rb_iv_set(rb_cRETRY, "__member__", members);
|
2314
|
+
rb_define_singleton_method(rb_cRETRY, "members", node_s_members, 0);
|
2315
|
+
}
|
2316
|
+
{
|
2317
|
+
VALUE rb_cYIELD = rb_define_class_under(rb_cNode, "YIELD", rb_cNode);
|
2318
|
+
members = rb_ary_new();
|
2319
|
+
rb_cNodeSubclass[NODE_YIELD] = rb_cYIELD;
|
2320
|
+
rb_iv_set(rb_cYIELD, "__member__", members);
|
2321
|
+
rb_define_singleton_method(rb_cYIELD, "members", node_s_members, 0);
|
2322
|
+
rb_define_method(rb_cYIELD, "stts", node_stts, 0);
|
2323
|
+
rb_ary_push(members, rb_str_new2("stts"));
|
2324
|
+
}
|
2325
|
+
{
|
2326
|
+
VALUE rb_cRESCUE = rb_define_class_under(rb_cNode, "RESCUE", rb_cNode);
|
2327
|
+
members = rb_ary_new();
|
2328
|
+
rb_cNodeSubclass[NODE_RESCUE] = rb_cRESCUE;
|
2329
|
+
rb_iv_set(rb_cRESCUE, "__member__", members);
|
2330
|
+
rb_define_singleton_method(rb_cRESCUE, "members", node_s_members, 0);
|
2331
|
+
rb_define_method(rb_cRESCUE, "head", node_head, 0);
|
2332
|
+
rb_ary_push(members, rb_str_new2("head"));
|
2333
|
+
rb_define_method(rb_cRESCUE, "resq", node_resq, 0);
|
2334
|
+
rb_ary_push(members, rb_str_new2("resq"));
|
2335
|
+
rb_define_method(rb_cRESCUE, "else", node_else, 0);
|
2336
|
+
rb_ary_push(members, rb_str_new2("else"));
|
2337
|
+
}
|
2338
|
+
{
|
2339
|
+
VALUE rb_cRESBODY = rb_define_class_under(rb_cNode, "RESBODY", rb_cNode);
|
2340
|
+
members = rb_ary_new();
|
2341
|
+
rb_cNodeSubclass[NODE_RESBODY] = rb_cRESBODY;
|
2342
|
+
rb_iv_set(rb_cRESBODY, "__member__", members);
|
2343
|
+
rb_define_singleton_method(rb_cRESBODY, "members", node_s_members, 0);
|
2344
|
+
rb_define_method(rb_cRESBODY, "head", node_head, 0);
|
2345
|
+
rb_ary_push(members, rb_str_new2("head"));
|
2346
|
+
rb_define_method(rb_cRESBODY, "resq", node_resq, 0);
|
2347
|
+
rb_ary_push(members, rb_str_new2("resq"));
|
2348
|
+
rb_define_method(rb_cRESBODY, "ensr", node_ensr, 0);
|
2349
|
+
rb_ary_push(members, rb_str_new2("ensr"));
|
2350
|
+
}
|
2351
|
+
{
|
2352
|
+
VALUE rb_cENSURE = rb_define_class_under(rb_cNode, "ENSURE", rb_cNode);
|
2353
|
+
members = rb_ary_new();
|
2354
|
+
rb_cNodeSubclass[NODE_ENSURE] = rb_cENSURE;
|
2355
|
+
rb_iv_set(rb_cENSURE, "__member__", members);
|
2356
|
+
rb_define_singleton_method(rb_cENSURE, "members", node_s_members, 0);
|
2357
|
+
rb_define_method(rb_cENSURE, "head", node_head, 0);
|
2358
|
+
rb_ary_push(members, rb_str_new2("head"));
|
2359
|
+
rb_define_method(rb_cENSURE, "ensr", node_ensr, 0);
|
2360
|
+
rb_ary_push(members, rb_str_new2("ensr"));
|
2361
|
+
}
|
2362
|
+
{
|
2363
|
+
VALUE rb_cAND = rb_define_class_under(rb_cNode, "AND", rb_cNode);
|
2364
|
+
members = rb_ary_new();
|
2365
|
+
rb_cNodeSubclass[NODE_AND] = rb_cAND;
|
2366
|
+
rb_iv_set(rb_cAND, "__member__", members);
|
2367
|
+
rb_define_singleton_method(rb_cAND, "members", node_s_members, 0);
|
2368
|
+
rb_define_method(rb_cAND, "first", node_1st, 0);
|
2369
|
+
rb_ary_push(members, rb_str_new2("first"));
|
2370
|
+
rb_define_method(rb_cAND, "second", node_2nd, 0);
|
2371
|
+
rb_ary_push(members, rb_str_new2("second"));
|
2372
|
+
}
|
2373
|
+
{
|
2374
|
+
VALUE rb_cOR = rb_define_class_under(rb_cNode, "OR", rb_cNode);
|
2375
|
+
members = rb_ary_new();
|
2376
|
+
rb_cNodeSubclass[NODE_OR] = rb_cOR;
|
2377
|
+
rb_iv_set(rb_cOR, "__member__", members);
|
2378
|
+
rb_define_singleton_method(rb_cOR, "members", node_s_members, 0);
|
2379
|
+
rb_define_method(rb_cOR, "first", node_1st, 0);
|
2380
|
+
rb_ary_push(members, rb_str_new2("first"));
|
2381
|
+
rb_define_method(rb_cOR, "second", node_2nd, 0);
|
2382
|
+
rb_ary_push(members, rb_str_new2("second"));
|
2383
|
+
}
|
2384
|
+
{
|
2385
|
+
VALUE rb_cNOT = rb_define_class_under(rb_cNode, "NOT", rb_cNode);
|
2386
|
+
members = rb_ary_new();
|
2387
|
+
rb_cNodeSubclass[NODE_NOT] = rb_cNOT;
|
2388
|
+
rb_iv_set(rb_cNOT, "__member__", members);
|
2389
|
+
rb_define_singleton_method(rb_cNOT, "members", node_s_members, 0);
|
2390
|
+
rb_define_method(rb_cNOT, "body", node_body, 0);
|
2391
|
+
rb_ary_push(members, rb_str_new2("body"));
|
2392
|
+
}
|
2393
|
+
{
|
2394
|
+
VALUE rb_cDOT2 = rb_define_class_under(rb_cNode, "DOT2", rb_cNode);
|
2395
|
+
members = rb_ary_new();
|
2396
|
+
rb_cNodeSubclass[NODE_DOT2] = rb_cDOT2;
|
2397
|
+
rb_iv_set(rb_cDOT2, "__member__", members);
|
2398
|
+
rb_define_singleton_method(rb_cDOT2, "members", node_s_members, 0);
|
2399
|
+
rb_define_method(rb_cDOT2, "beg", node_beg, 0);
|
2400
|
+
rb_ary_push(members, rb_str_new2("beg"));
|
2401
|
+
rb_define_method(rb_cDOT2, "end", node_end, 0);
|
2402
|
+
rb_ary_push(members, rb_str_new2("end"));
|
2403
|
+
rb_define_method(rb_cDOT2, "state", node_state, 0);
|
2404
|
+
rb_ary_push(members, rb_str_new2("state"));
|
2405
|
+
}
|
2406
|
+
{
|
2407
|
+
VALUE rb_cDOT3 = rb_define_class_under(rb_cNode, "DOT3", rb_cNode);
|
2408
|
+
members = rb_ary_new();
|
2409
|
+
rb_cNodeSubclass[NODE_DOT3] = rb_cDOT3;
|
2410
|
+
rb_iv_set(rb_cDOT3, "__member__", members);
|
2411
|
+
rb_define_singleton_method(rb_cDOT3, "members", node_s_members, 0);
|
2412
|
+
rb_define_method(rb_cDOT3, "beg", node_beg, 0);
|
2413
|
+
rb_ary_push(members, rb_str_new2("beg"));
|
2414
|
+
rb_define_method(rb_cDOT3, "end", node_end, 0);
|
2415
|
+
rb_ary_push(members, rb_str_new2("end"));
|
2416
|
+
rb_define_method(rb_cDOT3, "state", node_state, 0);
|
2417
|
+
rb_ary_push(members, rb_str_new2("state"));
|
2418
|
+
}
|
2419
|
+
{
|
2420
|
+
VALUE rb_cFLIP2 = rb_define_class_under(rb_cNode, "FLIP2", rb_cNode);
|
2421
|
+
members = rb_ary_new();
|
2422
|
+
rb_cNodeSubclass[NODE_FLIP2] = rb_cFLIP2;
|
2423
|
+
rb_iv_set(rb_cFLIP2, "__member__", members);
|
2424
|
+
rb_define_singleton_method(rb_cFLIP2, "members", node_s_members, 0);
|
2425
|
+
rb_define_method(rb_cFLIP2, "cnt", node_cnt, 0);
|
2426
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
2427
|
+
rb_define_method(rb_cFLIP2, "beg", node_beg, 0);
|
2428
|
+
rb_ary_push(members, rb_str_new2("beg"));
|
2429
|
+
rb_define_method(rb_cFLIP2, "end", node_end, 0);
|
2430
|
+
rb_ary_push(members, rb_str_new2("end"));
|
2431
|
+
}
|
2432
|
+
{
|
2433
|
+
VALUE rb_cFLIP3 = rb_define_class_under(rb_cNode, "FLIP3", rb_cNode);
|
2434
|
+
members = rb_ary_new();
|
2435
|
+
rb_cNodeSubclass[NODE_FLIP3] = rb_cFLIP3;
|
2436
|
+
rb_iv_set(rb_cFLIP3, "__member__", members);
|
2437
|
+
rb_define_singleton_method(rb_cFLIP3, "members", node_s_members, 0);
|
2438
|
+
rb_define_method(rb_cFLIP3, "cnt", node_cnt, 0);
|
2439
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
2440
|
+
rb_define_method(rb_cFLIP3, "beg", node_beg, 0);
|
2441
|
+
rb_ary_push(members, rb_str_new2("beg"));
|
2442
|
+
rb_define_method(rb_cFLIP3, "end", node_end, 0);
|
2443
|
+
rb_ary_push(members, rb_str_new2("end"));
|
2444
|
+
}
|
2445
|
+
{
|
2446
|
+
VALUE rb_cRETURN = rb_define_class_under(rb_cNode, "RETURN", rb_cNode);
|
2447
|
+
members = rb_ary_new();
|
2448
|
+
rb_cNodeSubclass[NODE_RETURN] = rb_cRETURN;
|
2449
|
+
rb_iv_set(rb_cRETURN, "__member__", members);
|
2450
|
+
rb_define_singleton_method(rb_cRETURN, "members", node_s_members, 0);
|
2451
|
+
rb_define_method(rb_cRETURN, "stts", node_stts, 0);
|
2452
|
+
rb_ary_push(members, rb_str_new2("stts"));
|
2453
|
+
}
|
2454
|
+
{
|
2455
|
+
VALUE rb_cARGS = rb_define_class_under(rb_cNode, "ARGS", rb_cNode);
|
2456
|
+
members = rb_ary_new();
|
2457
|
+
rb_cNodeSubclass[NODE_ARGS] = rb_cARGS;
|
2458
|
+
rb_iv_set(rb_cARGS, "__member__", members);
|
2459
|
+
rb_define_singleton_method(rb_cARGS, "members", node_s_members, 0);
|
2460
|
+
rb_define_method(rb_cARGS, "cnt", node_cnt, 0);
|
2461
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
2462
|
+
rb_define_method(rb_cARGS, "rest", node_rest, 0);
|
2463
|
+
rb_ary_push(members, rb_str_new2("rest"));
|
2464
|
+
rb_define_method(rb_cARGS, "opt", node_opt, 0);
|
2465
|
+
rb_ary_push(members, rb_str_new2("opt"));
|
2466
|
+
}
|
2467
|
+
{
|
2468
|
+
VALUE rb_cARGSCAT = rb_define_class_under(rb_cNode, "ARGSCAT", rb_cNode);
|
2469
|
+
members = rb_ary_new();
|
2470
|
+
rb_cNodeSubclass[NODE_ARGSCAT] = rb_cARGSCAT;
|
2471
|
+
rb_iv_set(rb_cARGSCAT, "__member__", members);
|
2472
|
+
rb_define_singleton_method(rb_cARGSCAT, "members", node_s_members, 0);
|
2473
|
+
rb_define_method(rb_cARGSCAT, "head", node_head, 0);
|
2474
|
+
rb_ary_push(members, rb_str_new2("head"));
|
2475
|
+
rb_define_method(rb_cARGSCAT, "body", node_body, 0);
|
2476
|
+
rb_ary_push(members, rb_str_new2("body"));
|
2477
|
+
}
|
2478
|
+
{
|
2479
|
+
VALUE rb_cARGSPUSH = rb_define_class_under(rb_cNode, "ARGSPUSH", rb_cNode);
|
2480
|
+
members = rb_ary_new();
|
2481
|
+
rb_cNodeSubclass[NODE_ARGSPUSH] = rb_cARGSPUSH;
|
2482
|
+
rb_iv_set(rb_cARGSPUSH, "__member__", members);
|
2483
|
+
rb_define_singleton_method(rb_cARGSPUSH, "members", node_s_members, 0);
|
2484
|
+
rb_define_method(rb_cARGSPUSH, "head", node_head, 0);
|
2485
|
+
rb_ary_push(members, rb_str_new2("head"));
|
2486
|
+
rb_define_method(rb_cARGSPUSH, "body", node_body, 0);
|
2487
|
+
rb_ary_push(members, rb_str_new2("body"));
|
2488
|
+
}
|
2489
|
+
{
|
2490
|
+
VALUE rb_cCALL = rb_define_class_under(rb_cNode, "CALL", rb_cNode);
|
2491
|
+
members = rb_ary_new();
|
2492
|
+
rb_cNodeSubclass[NODE_CALL] = rb_cCALL;
|
2493
|
+
rb_iv_set(rb_cCALL, "__member__", members);
|
2494
|
+
rb_define_singleton_method(rb_cCALL, "members", node_s_members, 0);
|
2495
|
+
rb_define_method(rb_cCALL, "recv", node_recv, 0);
|
2496
|
+
rb_ary_push(members, rb_str_new2("recv"));
|
2497
|
+
rb_define_method(rb_cCALL, "args", node_args, 0);
|
2498
|
+
rb_ary_push(members, rb_str_new2("args"));
|
2499
|
+
rb_define_method(rb_cCALL, "mid", node_mid, 0);
|
2500
|
+
rb_ary_push(members, rb_str_new2("mid"));
|
2501
|
+
}
|
2502
|
+
{
|
2503
|
+
VALUE rb_cFCALL = rb_define_class_under(rb_cNode, "FCALL", rb_cNode);
|
2504
|
+
members = rb_ary_new();
|
2505
|
+
rb_cNodeSubclass[NODE_FCALL] = rb_cFCALL;
|
2506
|
+
rb_iv_set(rb_cFCALL, "__member__", members);
|
2507
|
+
rb_define_singleton_method(rb_cFCALL, "members", node_s_members, 0);
|
2508
|
+
rb_define_method(rb_cFCALL, "args", node_args, 0);
|
2509
|
+
rb_ary_push(members, rb_str_new2("args"));
|
2510
|
+
rb_define_method(rb_cFCALL, "mid", node_mid, 0);
|
2511
|
+
rb_ary_push(members, rb_str_new2("mid"));
|
2512
|
+
}
|
2513
|
+
{
|
2514
|
+
VALUE rb_cVCALL = rb_define_class_under(rb_cNode, "VCALL", rb_cNode);
|
2515
|
+
members = rb_ary_new();
|
2516
|
+
rb_cNodeSubclass[NODE_VCALL] = rb_cVCALL;
|
2517
|
+
rb_iv_set(rb_cVCALL, "__member__", members);
|
2518
|
+
rb_define_singleton_method(rb_cVCALL, "members", node_s_members, 0);
|
2519
|
+
rb_define_method(rb_cVCALL, "mid", node_mid, 0);
|
2520
|
+
rb_ary_push(members, rb_str_new2("mid"));
|
2521
|
+
}
|
2522
|
+
{
|
2523
|
+
VALUE rb_cSUPER = rb_define_class_under(rb_cNode, "SUPER", rb_cNode);
|
2524
|
+
members = rb_ary_new();
|
2525
|
+
rb_cNodeSubclass[NODE_SUPER] = rb_cSUPER;
|
2526
|
+
rb_iv_set(rb_cSUPER, "__member__", members);
|
2527
|
+
rb_define_singleton_method(rb_cSUPER, "members", node_s_members, 0);
|
2528
|
+
rb_define_method(rb_cSUPER, "args", node_args, 0);
|
2529
|
+
rb_ary_push(members, rb_str_new2("args"));
|
2530
|
+
}
|
2531
|
+
{
|
2532
|
+
VALUE rb_cZSUPER = rb_define_class_under(rb_cNode, "ZSUPER", rb_cNode);
|
2533
|
+
members = rb_ary_new();
|
2534
|
+
rb_cNodeSubclass[NODE_ZSUPER] = rb_cZSUPER;
|
2535
|
+
rb_iv_set(rb_cZSUPER, "__member__", members);
|
2536
|
+
rb_define_singleton_method(rb_cZSUPER, "members", node_s_members, 0);
|
2537
|
+
rb_define_method(rb_cZSUPER, "args", node_args, 0);
|
2538
|
+
rb_ary_push(members, rb_str_new2("args"));
|
2539
|
+
}
|
2540
|
+
{
|
2541
|
+
VALUE rb_cSCOPE = rb_define_class_under(rb_cNode, "SCOPE", rb_cNode);
|
2542
|
+
members = rb_ary_new();
|
2543
|
+
rb_cNodeSubclass[NODE_SCOPE] = rb_cSCOPE;
|
2544
|
+
rb_iv_set(rb_cSCOPE, "__member__", members);
|
2545
|
+
rb_define_singleton_method(rb_cSCOPE, "members", node_s_members, 0);
|
2546
|
+
rb_define_method(rb_cSCOPE, "rval", node_rval, 0);
|
2547
|
+
rb_ary_push(members, rb_str_new2("rval"));
|
2548
|
+
rb_define_method(rb_cSCOPE, "tbl", node_tbl, 0);
|
2549
|
+
rb_ary_push(members, rb_str_new2("tbl"));
|
2550
|
+
rb_define_method(rb_cSCOPE, "next", node_next, 0);
|
2551
|
+
rb_ary_push(members, rb_str_new2("next"));
|
2552
|
+
}
|
2553
|
+
{
|
2554
|
+
VALUE rb_cOP_ASGN1 = rb_define_class_under(rb_cNode, "OP_ASGN1", rb_cNode);
|
2555
|
+
members = rb_ary_new();
|
2556
|
+
rb_cNodeSubclass[NODE_OP_ASGN1] = rb_cOP_ASGN1;
|
2557
|
+
rb_iv_set(rb_cOP_ASGN1, "__member__", members);
|
2558
|
+
rb_define_singleton_method(rb_cOP_ASGN1, "members", node_s_members, 0);
|
2559
|
+
rb_define_method(rb_cOP_ASGN1, "recv", node_recv, 0);
|
2560
|
+
rb_ary_push(members, rb_str_new2("recv"));
|
2561
|
+
rb_define_method(rb_cOP_ASGN1, "args", node_args, 0);
|
2562
|
+
rb_ary_push(members, rb_str_new2("args"));
|
2563
|
+
rb_define_method(rb_cOP_ASGN1, "mid", node_mid, 0);
|
2564
|
+
rb_ary_push(members, rb_str_new2("mid"));
|
2565
|
+
}
|
2566
|
+
{
|
2567
|
+
VALUE rb_cOP_ASGN2 = rb_define_class_under(rb_cNode, "OP_ASGN2", rb_cNode);
|
2568
|
+
members = rb_ary_new();
|
2569
|
+
rb_cNodeSubclass[NODE_OP_ASGN2] = rb_cOP_ASGN2;
|
2570
|
+
rb_iv_set(rb_cOP_ASGN2, "__member__", members);
|
2571
|
+
rb_define_singleton_method(rb_cOP_ASGN2, "members", node_s_members, 0);
|
2572
|
+
rb_define_method(rb_cOP_ASGN2, "vid", node_vid, 0);
|
2573
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
2574
|
+
rb_define_method(rb_cOP_ASGN2, "recv", node_recv, 0);
|
2575
|
+
rb_ary_push(members, rb_str_new2("recv"));
|
2576
|
+
rb_define_method(rb_cOP_ASGN2, "value", node_value, 0);
|
2577
|
+
rb_ary_push(members, rb_str_new2("value"));
|
2578
|
+
}
|
2579
|
+
{
|
2580
|
+
VALUE rb_cOP_ASGN_AND = rb_define_class_under(rb_cNode, "OP_ASGN_AND", rb_cNode);
|
2581
|
+
members = rb_ary_new();
|
2582
|
+
rb_cNodeSubclass[NODE_OP_ASGN_AND] = rb_cOP_ASGN_AND;
|
2583
|
+
rb_iv_set(rb_cOP_ASGN_AND, "__member__", members);
|
2584
|
+
rb_define_singleton_method(rb_cOP_ASGN_AND, "members", node_s_members, 0);
|
2585
|
+
rb_define_method(rb_cOP_ASGN_AND, "head", node_head, 0);
|
2586
|
+
rb_ary_push(members, rb_str_new2("head"));
|
2587
|
+
rb_define_method(rb_cOP_ASGN_AND, "value", node_value, 0);
|
2588
|
+
rb_ary_push(members, rb_str_new2("value"));
|
2589
|
+
}
|
2590
|
+
{
|
2591
|
+
VALUE rb_cOP_ASGN_OR = rb_define_class_under(rb_cNode, "OP_ASGN_OR", rb_cNode);
|
2592
|
+
members = rb_ary_new();
|
2593
|
+
rb_cNodeSubclass[NODE_OP_ASGN_OR] = rb_cOP_ASGN_OR;
|
2594
|
+
rb_iv_set(rb_cOP_ASGN_OR, "__member__", members);
|
2595
|
+
rb_define_singleton_method(rb_cOP_ASGN_OR, "members", node_s_members, 0);
|
2596
|
+
rb_define_method(rb_cOP_ASGN_OR, "head", node_head, 0);
|
2597
|
+
rb_ary_push(members, rb_str_new2("head"));
|
2598
|
+
rb_define_method(rb_cOP_ASGN_OR, "value", node_value, 0);
|
2599
|
+
rb_ary_push(members, rb_str_new2("value"));
|
2600
|
+
}
|
2601
|
+
{
|
2602
|
+
VALUE rb_cMASGN = rb_define_class_under(rb_cNode, "MASGN", rb_cNode);
|
2603
|
+
members = rb_ary_new();
|
2604
|
+
rb_cNodeSubclass[NODE_MASGN] = rb_cMASGN;
|
2605
|
+
rb_iv_set(rb_cMASGN, "__member__", members);
|
2606
|
+
rb_define_singleton_method(rb_cMASGN, "members", node_s_members, 0);
|
2607
|
+
rb_define_method(rb_cMASGN, "value", node_value, 0);
|
2608
|
+
rb_ary_push(members, rb_str_new2("value"));
|
2609
|
+
rb_define_method(rb_cMASGN, "head", node_head, 0);
|
2610
|
+
rb_ary_push(members, rb_str_new2("head"));
|
2611
|
+
rb_define_method(rb_cMASGN, "args", node_args, 0);
|
2612
|
+
rb_ary_push(members, rb_str_new2("args"));
|
2613
|
+
}
|
2614
|
+
{
|
2615
|
+
VALUE rb_cLASGN = rb_define_class_under(rb_cNode, "LASGN", rb_cNode);
|
2616
|
+
members = rb_ary_new();
|
2617
|
+
rb_cNodeSubclass[NODE_LASGN] = rb_cLASGN;
|
2618
|
+
rb_iv_set(rb_cLASGN, "__member__", members);
|
2619
|
+
rb_define_singleton_method(rb_cLASGN, "members", node_s_members, 0);
|
2620
|
+
rb_define_method(rb_cLASGN, "vid", node_vid, 0);
|
2621
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
2622
|
+
rb_define_method(rb_cLASGN, "value", node_value, 0);
|
2623
|
+
rb_ary_push(members, rb_str_new2("value"));
|
2624
|
+
rb_define_method(rb_cLASGN, "cnt", node_cnt, 0);
|
2625
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
2626
|
+
}
|
2627
|
+
{
|
2628
|
+
VALUE rb_cDASGN = rb_define_class_under(rb_cNode, "DASGN", rb_cNode);
|
2629
|
+
members = rb_ary_new();
|
2630
|
+
rb_cNodeSubclass[NODE_DASGN] = rb_cDASGN;
|
2631
|
+
rb_iv_set(rb_cDASGN, "__member__", members);
|
2632
|
+
rb_define_singleton_method(rb_cDASGN, "members", node_s_members, 0);
|
2633
|
+
rb_define_method(rb_cDASGN, "value", node_value, 0);
|
2634
|
+
rb_ary_push(members, rb_str_new2("value"));
|
2635
|
+
rb_define_method(rb_cDASGN, "vid", node_vid, 0);
|
2636
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
2637
|
+
}
|
2638
|
+
{
|
2639
|
+
VALUE rb_cDASGN_CURR = rb_define_class_under(rb_cNode, "DASGN_CURR", rb_cNode);
|
2640
|
+
members = rb_ary_new();
|
2641
|
+
rb_cNodeSubclass[NODE_DASGN_CURR] = rb_cDASGN_CURR;
|
2642
|
+
rb_iv_set(rb_cDASGN_CURR, "__member__", members);
|
2643
|
+
rb_define_singleton_method(rb_cDASGN_CURR, "members", node_s_members, 0);
|
2644
|
+
rb_define_method(rb_cDASGN_CURR, "value", node_value, 0);
|
2645
|
+
rb_ary_push(members, rb_str_new2("value"));
|
2646
|
+
rb_define_method(rb_cDASGN_CURR, "vid", node_vid, 0);
|
2647
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
2648
|
+
}
|
2649
|
+
{
|
2650
|
+
VALUE rb_cGASGN = rb_define_class_under(rb_cNode, "GASGN", rb_cNode);
|
2651
|
+
members = rb_ary_new();
|
2652
|
+
rb_cNodeSubclass[NODE_GASGN] = rb_cGASGN;
|
2653
|
+
rb_iv_set(rb_cGASGN, "__member__", members);
|
2654
|
+
rb_define_singleton_method(rb_cGASGN, "members", node_s_members, 0);
|
2655
|
+
rb_define_method(rb_cGASGN, "vid", node_vid, 0);
|
2656
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
2657
|
+
rb_define_method(rb_cGASGN, "value", node_value, 0);
|
2658
|
+
rb_ary_push(members, rb_str_new2("value"));
|
2659
|
+
rb_define_method(rb_cGASGN, "entry", node_entry, 0);
|
2660
|
+
rb_ary_push(members, rb_str_new2("entry"));
|
2661
|
+
}
|
2662
|
+
{
|
2663
|
+
VALUE rb_cIASGN = rb_define_class_under(rb_cNode, "IASGN", rb_cNode);
|
2664
|
+
members = rb_ary_new();
|
2665
|
+
rb_cNodeSubclass[NODE_IASGN] = rb_cIASGN;
|
2666
|
+
rb_iv_set(rb_cIASGN, "__member__", members);
|
2667
|
+
rb_define_singleton_method(rb_cIASGN, "members", node_s_members, 0);
|
2668
|
+
rb_define_method(rb_cIASGN, "vid", node_vid, 0);
|
2669
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
2670
|
+
rb_define_method(rb_cIASGN, "value", node_value, 0);
|
2671
|
+
rb_ary_push(members, rb_str_new2("value"));
|
2672
|
+
}
|
2673
|
+
{
|
2674
|
+
VALUE rb_cCDECL = rb_define_class_under(rb_cNode, "CDECL", rb_cNode);
|
2675
|
+
members = rb_ary_new();
|
2676
|
+
rb_cNodeSubclass[NODE_CDECL] = rb_cCDECL;
|
2677
|
+
rb_iv_set(rb_cCDECL, "__member__", members);
|
2678
|
+
rb_define_singleton_method(rb_cCDECL, "members", node_s_members, 0);
|
2679
|
+
rb_define_method(rb_cCDECL, "vid", node_vid, 0);
|
2680
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
2681
|
+
rb_define_method(rb_cCDECL, "value", node_value, 0);
|
2682
|
+
rb_ary_push(members, rb_str_new2("value"));
|
2683
|
+
}
|
2684
|
+
{
|
2685
|
+
VALUE rb_cCVDECL = rb_define_class_under(rb_cNode, "CVDECL", rb_cNode);
|
2686
|
+
members = rb_ary_new();
|
2687
|
+
rb_cNodeSubclass[NODE_CVDECL] = rb_cCVDECL;
|
2688
|
+
rb_iv_set(rb_cCVDECL, "__member__", members);
|
2689
|
+
rb_define_singleton_method(rb_cCVDECL, "members", node_s_members, 0);
|
2690
|
+
rb_define_method(rb_cCVDECL, "value", node_value, 0);
|
2691
|
+
rb_ary_push(members, rb_str_new2("value"));
|
2692
|
+
rb_define_method(rb_cCVDECL, "vid", node_vid, 0);
|
2693
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
2694
|
+
}
|
2695
|
+
{
|
2696
|
+
VALUE rb_cCVASGN = rb_define_class_under(rb_cNode, "CVASGN", rb_cNode);
|
2697
|
+
members = rb_ary_new();
|
2698
|
+
rb_cNodeSubclass[NODE_CVASGN] = rb_cCVASGN;
|
2699
|
+
rb_iv_set(rb_cCVASGN, "__member__", members);
|
2700
|
+
rb_define_singleton_method(rb_cCVASGN, "members", node_s_members, 0);
|
2701
|
+
rb_define_method(rb_cCVASGN, "value", node_value, 0);
|
2702
|
+
rb_ary_push(members, rb_str_new2("value"));
|
2703
|
+
rb_define_method(rb_cCVASGN, "vid", node_vid, 0);
|
2704
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
2705
|
+
}
|
2706
|
+
{
|
2707
|
+
VALUE rb_cLVAR = rb_define_class_under(rb_cNode, "LVAR", rb_cNode);
|
2708
|
+
members = rb_ary_new();
|
2709
|
+
rb_cNodeSubclass[NODE_LVAR] = rb_cLVAR;
|
2710
|
+
rb_iv_set(rb_cLVAR, "__member__", members);
|
2711
|
+
rb_define_singleton_method(rb_cLVAR, "members", node_s_members, 0);
|
2712
|
+
rb_define_method(rb_cLVAR, "cnt", node_cnt, 0);
|
2713
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
2714
|
+
rb_define_method(rb_cLVAR, "vid", node_vid, 0);
|
2715
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
2716
|
+
}
|
2717
|
+
{
|
2718
|
+
VALUE rb_cDVAR = rb_define_class_under(rb_cNode, "DVAR", rb_cNode);
|
2719
|
+
members = rb_ary_new();
|
2720
|
+
rb_cNodeSubclass[NODE_DVAR] = rb_cDVAR;
|
2721
|
+
rb_iv_set(rb_cDVAR, "__member__", members);
|
2722
|
+
rb_define_singleton_method(rb_cDVAR, "members", node_s_members, 0);
|
2723
|
+
rb_define_method(rb_cDVAR, "vid", node_vid, 0);
|
2724
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
2725
|
+
}
|
2726
|
+
{
|
2727
|
+
VALUE rb_cGVAR = rb_define_class_under(rb_cNode, "GVAR", rb_cNode);
|
2728
|
+
members = rb_ary_new();
|
2729
|
+
rb_cNodeSubclass[NODE_GVAR] = rb_cGVAR;
|
2730
|
+
rb_iv_set(rb_cGVAR, "__member__", members);
|
2731
|
+
rb_define_singleton_method(rb_cGVAR, "members", node_s_members, 0);
|
2732
|
+
rb_define_method(rb_cGVAR, "vid", node_vid, 0);
|
2733
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
2734
|
+
rb_define_method(rb_cGVAR, "entry", node_entry, 0);
|
2735
|
+
rb_ary_push(members, rb_str_new2("entry"));
|
2736
|
+
}
|
2737
|
+
{
|
2738
|
+
VALUE rb_cIVAR = rb_define_class_under(rb_cNode, "IVAR", rb_cNode);
|
2739
|
+
members = rb_ary_new();
|
2740
|
+
rb_cNodeSubclass[NODE_IVAR] = rb_cIVAR;
|
2741
|
+
rb_iv_set(rb_cIVAR, "__member__", members);
|
2742
|
+
rb_define_singleton_method(rb_cIVAR, "members", node_s_members, 0);
|
2743
|
+
rb_define_method(rb_cIVAR, "vid", node_vid, 0);
|
2744
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
2745
|
+
}
|
2746
|
+
{
|
2747
|
+
VALUE rb_cCONST = rb_define_class_under(rb_cNode, "CONST", rb_cNode);
|
2748
|
+
members = rb_ary_new();
|
2749
|
+
rb_cNodeSubclass[NODE_CONST] = rb_cCONST;
|
2750
|
+
rb_iv_set(rb_cCONST, "__member__", members);
|
2751
|
+
rb_define_singleton_method(rb_cCONST, "members", node_s_members, 0);
|
2752
|
+
rb_define_method(rb_cCONST, "vid", node_vid, 0);
|
2753
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
2754
|
+
}
|
2755
|
+
{
|
2756
|
+
VALUE rb_cCVAR = rb_define_class_under(rb_cNode, "CVAR", rb_cNode);
|
2757
|
+
members = rb_ary_new();
|
2758
|
+
rb_cNodeSubclass[NODE_CVAR] = rb_cCVAR;
|
2759
|
+
rb_iv_set(rb_cCVAR, "__member__", members);
|
2760
|
+
rb_define_singleton_method(rb_cCVAR, "members", node_s_members, 0);
|
2761
|
+
rb_define_method(rb_cCVAR, "vid", node_vid, 0);
|
2762
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
2763
|
+
}
|
2764
|
+
{
|
2765
|
+
VALUE rb_cBLOCK_ARG = rb_define_class_under(rb_cNode, "BLOCK_ARG", rb_cNode);
|
2766
|
+
members = rb_ary_new();
|
2767
|
+
rb_cNodeSubclass[NODE_BLOCK_ARG] = rb_cBLOCK_ARG;
|
2768
|
+
rb_iv_set(rb_cBLOCK_ARG, "__member__", members);
|
2769
|
+
rb_define_singleton_method(rb_cBLOCK_ARG, "members", node_s_members, 0);
|
2770
|
+
rb_define_method(rb_cBLOCK_ARG, "cnt", node_cnt, 0);
|
2771
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
2772
|
+
}
|
2773
|
+
{
|
2774
|
+
VALUE rb_cCOLON2 = rb_define_class_under(rb_cNode, "COLON2", rb_cNode);
|
2775
|
+
members = rb_ary_new();
|
2776
|
+
rb_cNodeSubclass[NODE_COLON2] = rb_cCOLON2;
|
2777
|
+
rb_iv_set(rb_cCOLON2, "__member__", members);
|
2778
|
+
rb_define_singleton_method(rb_cCOLON2, "members", node_s_members, 0);
|
2779
|
+
rb_define_method(rb_cCOLON2, "head", node_head, 0);
|
2780
|
+
rb_ary_push(members, rb_str_new2("head"));
|
2781
|
+
rb_define_method(rb_cCOLON2, "mid", node_mid, 0);
|
2782
|
+
rb_ary_push(members, rb_str_new2("mid"));
|
2783
|
+
}
|
2784
|
+
{
|
2785
|
+
VALUE rb_cCOLON3 = rb_define_class_under(rb_cNode, "COLON3", rb_cNode);
|
2786
|
+
members = rb_ary_new();
|
2787
|
+
rb_cNodeSubclass[NODE_COLON3] = rb_cCOLON3;
|
2788
|
+
rb_iv_set(rb_cCOLON3, "__member__", members);
|
2789
|
+
rb_define_singleton_method(rb_cCOLON3, "members", node_s_members, 0);
|
2790
|
+
rb_define_method(rb_cCOLON3, "mid", node_mid, 0);
|
2791
|
+
rb_ary_push(members, rb_str_new2("mid"));
|
2792
|
+
}
|
2793
|
+
{
|
2794
|
+
VALUE rb_cNTH_REF = rb_define_class_under(rb_cNode, "NTH_REF", rb_cNode);
|
2795
|
+
members = rb_ary_new();
|
2796
|
+
rb_cNodeSubclass[NODE_NTH_REF] = rb_cNTH_REF;
|
2797
|
+
rb_iv_set(rb_cNTH_REF, "__member__", members);
|
2798
|
+
rb_define_singleton_method(rb_cNTH_REF, "members", node_s_members, 0);
|
2799
|
+
rb_define_method(rb_cNTH_REF, "nth", node_nth, 0);
|
2800
|
+
rb_ary_push(members, rb_str_new2("nth"));
|
2801
|
+
rb_define_method(rb_cNTH_REF, "cnt", node_cnt, 0);
|
2802
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
2803
|
+
}
|
2804
|
+
{
|
2805
|
+
VALUE rb_cBACK_REF = rb_define_class_under(rb_cNode, "BACK_REF", rb_cNode);
|
2806
|
+
members = rb_ary_new();
|
2807
|
+
rb_cNodeSubclass[NODE_BACK_REF] = rb_cBACK_REF;
|
2808
|
+
rb_iv_set(rb_cBACK_REF, "__member__", members);
|
2809
|
+
rb_define_singleton_method(rb_cBACK_REF, "members", node_s_members, 0);
|
2810
|
+
rb_define_method(rb_cBACK_REF, "nth", node_nth, 0);
|
2811
|
+
rb_ary_push(members, rb_str_new2("nth"));
|
2812
|
+
rb_define_method(rb_cBACK_REF, "cnt", node_cnt, 0);
|
2813
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
2814
|
+
}
|
2815
|
+
{
|
2816
|
+
VALUE rb_cHASH = rb_define_class_under(rb_cNode, "HASH", rb_cNode);
|
2817
|
+
members = rb_ary_new();
|
2818
|
+
rb_cNodeSubclass[NODE_HASH] = rb_cHASH;
|
2819
|
+
rb_iv_set(rb_cHASH, "__member__", members);
|
2820
|
+
rb_define_singleton_method(rb_cHASH, "members", node_s_members, 0);
|
2821
|
+
rb_define_method(rb_cHASH, "head", node_head, 0);
|
2822
|
+
rb_ary_push(members, rb_str_new2("head"));
|
2823
|
+
}
|
2824
|
+
{
|
2825
|
+
VALUE rb_cZARRAY = rb_define_class_under(rb_cNode, "ZARRAY", rb_cNode);
|
2826
|
+
members = rb_ary_new();
|
2827
|
+
rb_cNodeSubclass[NODE_ZARRAY] = rb_cZARRAY;
|
2828
|
+
rb_iv_set(rb_cZARRAY, "__member__", members);
|
2829
|
+
rb_define_singleton_method(rb_cZARRAY, "members", node_s_members, 0);
|
2830
|
+
}
|
2831
|
+
{
|
2832
|
+
VALUE rb_cARRAY = rb_define_class_under(rb_cNode, "ARRAY", rb_cNode);
|
2833
|
+
members = rb_ary_new();
|
2834
|
+
rb_cNodeSubclass[NODE_ARRAY] = rb_cARRAY;
|
2835
|
+
rb_iv_set(rb_cARRAY, "__member__", members);
|
2836
|
+
rb_define_singleton_method(rb_cARRAY, "members", node_s_members, 0);
|
2837
|
+
rb_define_method(rb_cARRAY, "alen", node_alen, 0);
|
2838
|
+
rb_ary_push(members, rb_str_new2("alen"));
|
2839
|
+
rb_define_method(rb_cARRAY, "head", node_head, 0);
|
2840
|
+
rb_ary_push(members, rb_str_new2("head"));
|
2841
|
+
rb_define_method(rb_cARRAY, "next", node_next, 0);
|
2842
|
+
rb_ary_push(members, rb_str_new2("next"));
|
2843
|
+
}
|
2844
|
+
{
|
2845
|
+
VALUE rb_cSTR = rb_define_class_under(rb_cNode, "STR", rb_cNode);
|
2846
|
+
members = rb_ary_new();
|
2847
|
+
rb_cNodeSubclass[NODE_STR] = rb_cSTR;
|
2848
|
+
rb_iv_set(rb_cSTR, "__member__", members);
|
2849
|
+
rb_define_singleton_method(rb_cSTR, "members", node_s_members, 0);
|
2850
|
+
rb_define_method(rb_cSTR, "lit", node_lit, 0);
|
2851
|
+
rb_ary_push(members, rb_str_new2("lit"));
|
2852
|
+
}
|
2853
|
+
{
|
2854
|
+
VALUE rb_cDREGX = rb_define_class_under(rb_cNode, "DREGX", rb_cNode);
|
2855
|
+
members = rb_ary_new();
|
2856
|
+
rb_cNodeSubclass[NODE_DREGX] = rb_cDREGX;
|
2857
|
+
rb_iv_set(rb_cDREGX, "__member__", members);
|
2858
|
+
rb_define_singleton_method(rb_cDREGX, "members", node_s_members, 0);
|
2859
|
+
rb_define_method(rb_cDREGX, "lit", node_lit, 0);
|
2860
|
+
rb_ary_push(members, rb_str_new2("lit"));
|
2861
|
+
rb_define_method(rb_cDREGX, "next", node_next, 0);
|
2862
|
+
rb_ary_push(members, rb_str_new2("next"));
|
2863
|
+
rb_define_method(rb_cDREGX, "cflag", node_cflag, 0);
|
2864
|
+
rb_ary_push(members, rb_str_new2("cflag"));
|
2865
|
+
}
|
2866
|
+
{
|
2867
|
+
VALUE rb_cDREGX_ONCE = rb_define_class_under(rb_cNode, "DREGX_ONCE", rb_cNode);
|
2868
|
+
members = rb_ary_new();
|
2869
|
+
rb_cNodeSubclass[NODE_DREGX_ONCE] = rb_cDREGX_ONCE;
|
2870
|
+
rb_iv_set(rb_cDREGX_ONCE, "__member__", members);
|
2871
|
+
rb_define_singleton_method(rb_cDREGX_ONCE, "members", node_s_members, 0);
|
2872
|
+
rb_define_method(rb_cDREGX_ONCE, "lit", node_lit, 0);
|
2873
|
+
rb_ary_push(members, rb_str_new2("lit"));
|
2874
|
+
rb_define_method(rb_cDREGX_ONCE, "next", node_next, 0);
|
2875
|
+
rb_ary_push(members, rb_str_new2("next"));
|
2876
|
+
rb_define_method(rb_cDREGX_ONCE, "cflag", node_cflag, 0);
|
2877
|
+
rb_ary_push(members, rb_str_new2("cflag"));
|
2878
|
+
}
|
2879
|
+
{
|
2880
|
+
VALUE rb_cDSTR = rb_define_class_under(rb_cNode, "DSTR", rb_cNode);
|
2881
|
+
members = rb_ary_new();
|
2882
|
+
rb_cNodeSubclass[NODE_DSTR] = rb_cDSTR;
|
2883
|
+
rb_iv_set(rb_cDSTR, "__member__", members);
|
2884
|
+
rb_define_singleton_method(rb_cDSTR, "members", node_s_members, 0);
|
2885
|
+
rb_define_method(rb_cDSTR, "lit", node_lit, 0);
|
2886
|
+
rb_ary_push(members, rb_str_new2("lit"));
|
2887
|
+
rb_define_method(rb_cDSTR, "next", node_next, 0);
|
2888
|
+
rb_ary_push(members, rb_str_new2("next"));
|
2889
|
+
}
|
2890
|
+
{
|
2891
|
+
VALUE rb_cDXSTR = rb_define_class_under(rb_cNode, "DXSTR", rb_cNode);
|
2892
|
+
members = rb_ary_new();
|
2893
|
+
rb_cNodeSubclass[NODE_DXSTR] = rb_cDXSTR;
|
2894
|
+
rb_iv_set(rb_cDXSTR, "__member__", members);
|
2895
|
+
rb_define_singleton_method(rb_cDXSTR, "members", node_s_members, 0);
|
2896
|
+
rb_define_method(rb_cDXSTR, "lit", node_lit, 0);
|
2897
|
+
rb_ary_push(members, rb_str_new2("lit"));
|
2898
|
+
rb_define_method(rb_cDXSTR, "next", node_next, 0);
|
2899
|
+
rb_ary_push(members, rb_str_new2("next"));
|
2900
|
+
}
|
2901
|
+
{
|
2902
|
+
VALUE rb_cXSTR = rb_define_class_under(rb_cNode, "XSTR", rb_cNode);
|
2903
|
+
members = rb_ary_new();
|
2904
|
+
rb_cNodeSubclass[NODE_XSTR] = rb_cXSTR;
|
2905
|
+
rb_iv_set(rb_cXSTR, "__member__", members);
|
2906
|
+
rb_define_singleton_method(rb_cXSTR, "members", node_s_members, 0);
|
2907
|
+
rb_define_method(rb_cXSTR, "lit", node_lit, 0);
|
2908
|
+
rb_ary_push(members, rb_str_new2("lit"));
|
2909
|
+
}
|
2910
|
+
#if defined(C_ALLOCA) || RUBY_VERSION_CODE >= 190
|
2911
|
+
{
|
2912
|
+
VALUE rb_cALLOCA = rb_define_class_under(rb_cNode, "ALLOCA", rb_cNode);
|
2913
|
+
members = rb_ary_new();
|
2914
|
+
rb_cNodeSubclass[NODE_ALLOCA] = rb_cALLOCA;
|
2915
|
+
rb_iv_set(rb_cALLOCA, "__member__", members);
|
2916
|
+
rb_define_singleton_method(rb_cALLOCA, "members", node_s_members, 0);
|
2917
|
+
rb_define_method(rb_cALLOCA, "lit", node_lit, 0);
|
2918
|
+
rb_ary_push(members, rb_str_new2("lit"));
|
2919
|
+
rb_define_method(rb_cALLOCA, "value", node_value, 0);
|
2920
|
+
rb_ary_push(members, rb_str_new2("value"));
|
2921
|
+
rb_define_method(rb_cALLOCA, "cnt", node_cnt, 0);
|
2922
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
2923
|
+
}
|
2924
|
+
#endif
|
2925
|
+
{
|
2926
|
+
VALUE rb_cLIT = rb_define_class_under(rb_cNode, "LIT", rb_cNode);
|
2927
|
+
members = rb_ary_new();
|
2928
|
+
rb_cNodeSubclass[NODE_LIT] = rb_cLIT;
|
2929
|
+
rb_iv_set(rb_cLIT, "__member__", members);
|
2930
|
+
rb_define_singleton_method(rb_cLIT, "members", node_s_members, 0);
|
2931
|
+
rb_define_method(rb_cLIT, "lit", node_lit, 0);
|
2932
|
+
rb_ary_push(members, rb_str_new2("lit"));
|
2933
|
+
}
|
2934
|
+
{
|
2935
|
+
VALUE rb_cATTRSET = rb_define_class_under(rb_cNode, "ATTRSET", rb_cNode);
|
2936
|
+
members = rb_ary_new();
|
2937
|
+
rb_cNodeSubclass[NODE_ATTRSET] = rb_cATTRSET;
|
2938
|
+
rb_iv_set(rb_cATTRSET, "__member__", members);
|
2939
|
+
rb_define_singleton_method(rb_cATTRSET, "members", node_s_members, 0);
|
2940
|
+
rb_define_method(rb_cATTRSET, "vid", node_vid, 0);
|
2941
|
+
rb_ary_push(members, rb_str_new2("vid"));
|
2942
|
+
}
|
2943
|
+
{
|
2944
|
+
VALUE rb_cDEFN = rb_define_class_under(rb_cNode, "DEFN", rb_cNode);
|
2945
|
+
members = rb_ary_new();
|
2946
|
+
rb_cNodeSubclass[NODE_DEFN] = rb_cDEFN;
|
2947
|
+
rb_iv_set(rb_cDEFN, "__member__", members);
|
2948
|
+
rb_define_singleton_method(rb_cDEFN, "members", node_s_members, 0);
|
2949
|
+
rb_define_method(rb_cDEFN, "defn", node_defn, 0);
|
2950
|
+
rb_ary_push(members, rb_str_new2("defn"));
|
2951
|
+
rb_define_method(rb_cDEFN, "mid", node_mid, 0);
|
2952
|
+
rb_ary_push(members, rb_str_new2("mid"));
|
2953
|
+
rb_define_method(rb_cDEFN, "noex", node_noex, 0);
|
2954
|
+
rb_ary_push(members, rb_str_new2("noex"));
|
2955
|
+
}
|
2956
|
+
{
|
2957
|
+
VALUE rb_cDEFS = rb_define_class_under(rb_cNode, "DEFS", rb_cNode);
|
2958
|
+
members = rb_ary_new();
|
2959
|
+
rb_cNodeSubclass[NODE_DEFS] = rb_cDEFS;
|
2960
|
+
rb_iv_set(rb_cDEFS, "__member__", members);
|
2961
|
+
rb_define_singleton_method(rb_cDEFS, "members", node_s_members, 0);
|
2962
|
+
rb_define_method(rb_cDEFS, "defn", node_defn, 0);
|
2963
|
+
rb_ary_push(members, rb_str_new2("defn"));
|
2964
|
+
rb_define_method(rb_cDEFS, "recv", node_recv, 0);
|
2965
|
+
rb_ary_push(members, rb_str_new2("recv"));
|
2966
|
+
rb_define_method(rb_cDEFS, "mid", node_mid, 0);
|
2967
|
+
rb_ary_push(members, rb_str_new2("mid"));
|
2968
|
+
}
|
2969
|
+
{
|
2970
|
+
VALUE rb_cUNDEF = rb_define_class_under(rb_cNode, "UNDEF", rb_cNode);
|
2971
|
+
members = rb_ary_new();
|
2972
|
+
rb_cNodeSubclass[NODE_UNDEF] = rb_cUNDEF;
|
2973
|
+
rb_iv_set(rb_cUNDEF, "__member__", members);
|
2974
|
+
rb_define_singleton_method(rb_cUNDEF, "members", node_s_members, 0);
|
2975
|
+
rb_define_method(rb_cUNDEF, "mid", node_mid, 0);
|
2976
|
+
rb_ary_push(members, rb_str_new2("mid"));
|
2977
|
+
}
|
2978
|
+
{
|
2979
|
+
VALUE rb_cALIAS = rb_define_class_under(rb_cNode, "ALIAS", rb_cNode);
|
2980
|
+
members = rb_ary_new();
|
2981
|
+
rb_cNodeSubclass[NODE_ALIAS] = rb_cALIAS;
|
2982
|
+
rb_iv_set(rb_cALIAS, "__member__", members);
|
2983
|
+
rb_define_singleton_method(rb_cALIAS, "members", node_s_members, 0);
|
2984
|
+
rb_define_method(rb_cALIAS, "first", node_1st, 0);
|
2985
|
+
rb_ary_push(members, rb_str_new2("first"));
|
2986
|
+
rb_define_method(rb_cALIAS, "second", node_2nd, 0);
|
2987
|
+
rb_ary_push(members, rb_str_new2("second"));
|
2988
|
+
}
|
2989
|
+
{
|
2990
|
+
VALUE rb_cVALIAS = rb_define_class_under(rb_cNode, "VALIAS", rb_cNode);
|
2991
|
+
members = rb_ary_new();
|
2992
|
+
rb_cNodeSubclass[NODE_VALIAS] = rb_cVALIAS;
|
2993
|
+
rb_iv_set(rb_cVALIAS, "__member__", members);
|
2994
|
+
rb_define_singleton_method(rb_cVALIAS, "members", node_s_members, 0);
|
2995
|
+
rb_define_method(rb_cVALIAS, "first", node_1st, 0);
|
2996
|
+
rb_ary_push(members, rb_str_new2("first"));
|
2997
|
+
rb_define_method(rb_cVALIAS, "second", node_2nd, 0);
|
2998
|
+
rb_ary_push(members, rb_str_new2("second"));
|
2999
|
+
}
|
3000
|
+
{
|
3001
|
+
VALUE rb_cSCLASS = rb_define_class_under(rb_cNode, "SCLASS", rb_cNode);
|
3002
|
+
members = rb_ary_new();
|
3003
|
+
rb_cNodeSubclass[NODE_SCLASS] = rb_cSCLASS;
|
3004
|
+
rb_iv_set(rb_cSCLASS, "__member__", members);
|
3005
|
+
rb_define_singleton_method(rb_cSCLASS, "members", node_s_members, 0);
|
3006
|
+
rb_define_method(rb_cSCLASS, "recv", node_recv, 0);
|
3007
|
+
rb_ary_push(members, rb_str_new2("recv"));
|
3008
|
+
rb_define_method(rb_cSCLASS, "body", node_body, 0);
|
3009
|
+
rb_ary_push(members, rb_str_new2("body"));
|
3010
|
+
}
|
3011
|
+
{
|
3012
|
+
VALUE rb_cDEFINED = rb_define_class_under(rb_cNode, "DEFINED", rb_cNode);
|
3013
|
+
members = rb_ary_new();
|
3014
|
+
rb_cNodeSubclass[NODE_DEFINED] = rb_cDEFINED;
|
3015
|
+
rb_iv_set(rb_cDEFINED, "__member__", members);
|
3016
|
+
rb_define_singleton_method(rb_cDEFINED, "members", node_s_members, 0);
|
3017
|
+
rb_define_method(rb_cDEFINED, "head", node_head, 0);
|
3018
|
+
rb_ary_push(members, rb_str_new2("head"));
|
3019
|
+
}
|
3020
|
+
{
|
3021
|
+
VALUE rb_cIFUNC = rb_define_class_under(rb_cNode, "IFUNC", rb_cNode);
|
3022
|
+
members = rb_ary_new();
|
3023
|
+
rb_cNodeSubclass[NODE_IFUNC] = rb_cIFUNC;
|
3024
|
+
rb_iv_set(rb_cIFUNC, "__member__", members);
|
3025
|
+
rb_define_singleton_method(rb_cIFUNC, "members", node_s_members, 0);
|
3026
|
+
rb_define_method(rb_cIFUNC, "cfnc", node_cfnc, 0);
|
3027
|
+
rb_ary_push(members, rb_str_new2("cfnc"));
|
3028
|
+
rb_define_method(rb_cIFUNC, "tval", node_tval, 0);
|
3029
|
+
rb_ary_push(members, rb_str_new2("tval"));
|
3030
|
+
rb_define_method(rb_cIFUNC, "argc", node_argc, 0);
|
3031
|
+
rb_ary_push(members, rb_str_new2("argc"));
|
3032
|
+
}
|
3033
|
+
{
|
3034
|
+
VALUE rb_cCFUNC = rb_define_class_under(rb_cNode, "CFUNC", rb_cNode);
|
3035
|
+
members = rb_ary_new();
|
3036
|
+
rb_cNodeSubclass[NODE_CFUNC] = rb_cCFUNC;
|
3037
|
+
rb_iv_set(rb_cCFUNC, "__member__", members);
|
3038
|
+
rb_define_singleton_method(rb_cCFUNC, "members", node_s_members, 0);
|
3039
|
+
rb_define_method(rb_cCFUNC, "cfnc", node_cfnc, 0);
|
3040
|
+
rb_ary_push(members, rb_str_new2("cfnc"));
|
3041
|
+
rb_define_method(rb_cCFUNC, "tval", node_tval, 0);
|
3042
|
+
rb_ary_push(members, rb_str_new2("tval"));
|
3043
|
+
rb_define_method(rb_cCFUNC, "argc", node_argc, 0);
|
3044
|
+
rb_ary_push(members, rb_str_new2("argc"));
|
3045
|
+
}
|
3046
|
+
{
|
3047
|
+
VALUE rb_cCREF = rb_define_class_under(rb_cNode, "CREF", rb_cNode);
|
3048
|
+
members = rb_ary_new();
|
3049
|
+
rb_cNodeSubclass[NODE_CREF] = rb_cCREF;
|
3050
|
+
rb_iv_set(rb_cCREF, "__member__", members);
|
3051
|
+
rb_define_singleton_method(rb_cCREF, "members", node_s_members, 0);
|
3052
|
+
rb_define_method(rb_cCREF, "clss", node_clss, 0);
|
3053
|
+
rb_ary_push(members, rb_str_new2("clss"));
|
3054
|
+
rb_define_method(rb_cCREF, "next", node_next, 0);
|
3055
|
+
rb_ary_push(members, rb_str_new2("next"));
|
3056
|
+
rb_define_method(rb_cCREF, "body", node_body, 0);
|
3057
|
+
rb_ary_push(members, rb_str_new2("body"));
|
3058
|
+
}
|
3059
|
+
{
|
3060
|
+
VALUE rb_cBMETHOD = rb_define_class_under(rb_cNode, "BMETHOD", rb_cNode);
|
3061
|
+
members = rb_ary_new();
|
3062
|
+
rb_cNodeSubclass[NODE_BMETHOD] = rb_cBMETHOD;
|
3063
|
+
rb_iv_set(rb_cBMETHOD, "__member__", members);
|
3064
|
+
rb_define_singleton_method(rb_cBMETHOD, "members", node_s_members, 0);
|
3065
|
+
rb_define_method(rb_cBMETHOD, "cval", node_cval, 0);
|
3066
|
+
rb_ary_push(members, rb_str_new2("cval"));
|
3067
|
+
}
|
3068
|
+
{
|
3069
|
+
VALUE rb_cMEMO = rb_define_class_under(rb_cNode, "MEMO", rb_cNode);
|
3070
|
+
members = rb_ary_new();
|
3071
|
+
rb_cNodeSubclass[NODE_MEMO] = rb_cMEMO;
|
3072
|
+
rb_iv_set(rb_cMEMO, "__member__", members);
|
3073
|
+
rb_define_singleton_method(rb_cMEMO, "members", node_s_members, 0);
|
3074
|
+
rb_define_method(rb_cMEMO, "lit", node_lit, 0);
|
3075
|
+
rb_ary_push(members, rb_str_new2("lit"));
|
3076
|
+
rb_define_method(rb_cMEMO, "tval", node_tval, 0);
|
3077
|
+
rb_ary_push(members, rb_str_new2("tval"));
|
3078
|
+
}
|
3079
|
+
{
|
3080
|
+
VALUE rb_cEVSTR = rb_define_class_under(rb_cNode, "EVSTR", rb_cNode);
|
3081
|
+
members = rb_ary_new();
|
3082
|
+
rb_cNodeSubclass[NODE_EVSTR] = rb_cEVSTR;
|
3083
|
+
rb_iv_set(rb_cEVSTR, "__member__", members);
|
3084
|
+
rb_define_singleton_method(rb_cEVSTR, "members", node_s_members, 0);
|
3085
|
+
rb_define_method(rb_cEVSTR, "body", node_body, 0);
|
3086
|
+
rb_ary_push(members, rb_str_new2("body"));
|
3087
|
+
}
|
3088
|
+
{
|
3089
|
+
VALUE rb_cMETHOD = rb_define_class_under(rb_cNode, "METHOD", rb_cNode);
|
3090
|
+
members = rb_ary_new();
|
3091
|
+
rb_cNodeSubclass[NODE_METHOD] = rb_cMETHOD;
|
3092
|
+
rb_iv_set(rb_cMETHOD, "__member__", members);
|
3093
|
+
rb_define_singleton_method(rb_cMETHOD, "members", node_s_members, 0);
|
3094
|
+
rb_define_method(rb_cMETHOD, "body", node_body, 0);
|
3095
|
+
rb_ary_push(members, rb_str_new2("body"));
|
3096
|
+
rb_define_method(rb_cMETHOD, "clss", node_clss, 0);
|
3097
|
+
rb_ary_push(members, rb_str_new2("clss"));
|
3098
|
+
rb_define_method(rb_cMETHOD, "noex", node_noex, 0);
|
3099
|
+
rb_ary_push(members, rb_str_new2("noex"));
|
3100
|
+
}
|
3101
|
+
{
|
3102
|
+
VALUE rb_cFBODY = rb_define_class_under(rb_cNode, "FBODY", rb_cNode);
|
3103
|
+
members = rb_ary_new();
|
3104
|
+
rb_cNodeSubclass[NODE_FBODY] = rb_cFBODY;
|
3105
|
+
rb_iv_set(rb_cFBODY, "__member__", members);
|
3106
|
+
rb_define_singleton_method(rb_cFBODY, "members", node_s_members, 0);
|
3107
|
+
rb_define_method(rb_cFBODY, "body", node_body, 0);
|
3108
|
+
rb_ary_push(members, rb_str_new2("body"));
|
3109
|
+
rb_define_method(rb_cFBODY, "oid", node_oid, 0);
|
3110
|
+
rb_ary_push(members, rb_str_new2("oid"));
|
3111
|
+
rb_define_method(rb_cFBODY, "cnt", node_cnt, 0);
|
3112
|
+
rb_ary_push(members, rb_str_new2("cnt"));
|
3113
|
+
}
|
3114
|
+
{
|
3115
|
+
VALUE rb_cCLASS = rb_define_class_under(rb_cNode, "CLASS", rb_cNode);
|
3116
|
+
members = rb_ary_new();
|
3117
|
+
rb_cNodeSubclass[NODE_CLASS] = rb_cCLASS;
|
3118
|
+
rb_iv_set(rb_cCLASS, "__member__", members);
|
3119
|
+
rb_define_singleton_method(rb_cCLASS, "members", node_s_members, 0);
|
3120
|
+
rb_define_method(rb_cCLASS, "super", node_super, 0);
|
3121
|
+
rb_ary_push(members, rb_str_new2("super"));
|
3122
|
+
rb_define_method(rb_cCLASS, "cpath", node_cpath, 0);
|
3123
|
+
rb_ary_push(members, rb_str_new2("cpath"));
|
3124
|
+
rb_define_method(rb_cCLASS, "body", node_body, 0);
|
3125
|
+
rb_ary_push(members, rb_str_new2("body"));
|
3126
|
+
}
|
3127
|
+
{
|
3128
|
+
VALUE rb_cMODULE = rb_define_class_under(rb_cNode, "MODULE", rb_cNode);
|
3129
|
+
members = rb_ary_new();
|
3130
|
+
rb_cNodeSubclass[NODE_MODULE] = rb_cMODULE;
|
3131
|
+
rb_iv_set(rb_cMODULE, "__member__", members);
|
3132
|
+
rb_define_singleton_method(rb_cMODULE, "members", node_s_members, 0);
|
3133
|
+
rb_define_method(rb_cMODULE, "cpath", node_cpath, 0);
|
3134
|
+
rb_ary_push(members, rb_str_new2("cpath"));
|
3135
|
+
rb_define_method(rb_cMODULE, "body", node_body, 0);
|
3136
|
+
rb_ary_push(members, rb_str_new2("body"));
|
3137
|
+
}
|
3138
|
+
{
|
3139
|
+
VALUE rb_cDSYM = rb_define_class_under(rb_cNode, "DSYM", rb_cNode);
|
3140
|
+
members = rb_ary_new();
|
3141
|
+
rb_cNodeSubclass[NODE_DSYM] = rb_cDSYM;
|
3142
|
+
rb_iv_set(rb_cDSYM, "__member__", members);
|
3143
|
+
rb_define_singleton_method(rb_cDSYM, "members", node_s_members, 0);
|
3144
|
+
rb_define_method(rb_cDSYM, "lit", node_lit, 0);
|
3145
|
+
rb_ary_push(members, rb_str_new2("lit"));
|
3146
|
+
rb_define_method(rb_cDSYM, "next", node_next, 0);
|
3147
|
+
rb_ary_push(members, rb_str_new2("next"));
|
3148
|
+
}
|
3149
|
+
{
|
3150
|
+
VALUE rb_cATTRASGN = rb_define_class_under(rb_cNode, "ATTRASGN", rb_cNode);
|
3151
|
+
members = rb_ary_new();
|
3152
|
+
rb_cNodeSubclass[NODE_ATTRASGN] = rb_cATTRASGN;
|
3153
|
+
rb_iv_set(rb_cATTRASGN, "__member__", members);
|
3154
|
+
rb_define_singleton_method(rb_cATTRASGN, "members", node_s_members, 0);
|
3155
|
+
rb_define_method(rb_cATTRASGN, "mid", node_mid, 0);
|
3156
|
+
rb_ary_push(members, rb_str_new2("mid"));
|
3157
|
+
rb_define_method(rb_cATTRASGN, "recv", node_recv, 0);
|
3158
|
+
rb_ary_push(members, rb_str_new2("recv"));
|
3159
|
+
rb_define_method(rb_cATTRASGN, "args", node_args, 0);
|
3160
|
+
rb_ary_push(members, rb_str_new2("args"));
|
3161
|
+
}
|
3162
|
+
}
|
3163
|
+
|
3164
|
+
|