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