2000-05-01 05:42:38 -04:00
|
|
|
/**********************************************************************
|
1998-01-16 07:13:05 -05:00
|
|
|
|
|
|
|
node.h -
|
|
|
|
|
|
|
|
$Author$
|
|
|
|
$Date$
|
|
|
|
created at: Fri May 28 15:14:02 JST 1993
|
|
|
|
|
2002-05-14 02:22:31 -04:00
|
|
|
Copyright (C) 1993-2002 Yukihiro Matsumoto
|
1998-01-16 07:13:05 -05:00
|
|
|
|
2000-05-01 05:42:38 -04:00
|
|
|
**********************************************************************/
|
1998-01-16 07:13:05 -05:00
|
|
|
|
|
|
|
#ifndef NODE_H
|
|
|
|
#define NODE_H
|
|
|
|
|
1999-10-29 05:25:48 -04:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
1998-01-16 07:13:05 -05:00
|
|
|
enum node_type {
|
|
|
|
NODE_METHOD,
|
|
|
|
NODE_FBODY,
|
|
|
|
NODE_CFUNC,
|
|
|
|
NODE_SCOPE,
|
|
|
|
NODE_BLOCK,
|
|
|
|
NODE_IF,
|
|
|
|
NODE_CASE,
|
|
|
|
NODE_WHEN,
|
|
|
|
NODE_OPT_N,
|
|
|
|
NODE_WHILE,
|
|
|
|
NODE_UNTIL,
|
|
|
|
NODE_ITER,
|
|
|
|
NODE_FOR,
|
1998-01-16 07:19:22 -05:00
|
|
|
NODE_BREAK,
|
|
|
|
NODE_NEXT,
|
|
|
|
NODE_REDO,
|
|
|
|
NODE_RETRY,
|
1998-01-16 07:13:05 -05:00
|
|
|
NODE_BEGIN,
|
|
|
|
NODE_RESCUE,
|
|
|
|
NODE_RESBODY,
|
|
|
|
NODE_ENSURE,
|
|
|
|
NODE_AND,
|
|
|
|
NODE_OR,
|
|
|
|
NODE_NOT,
|
|
|
|
NODE_MASGN,
|
|
|
|
NODE_LASGN,
|
|
|
|
NODE_DASGN,
|
2000-01-31 22:12:21 -05:00
|
|
|
NODE_DASGN_CURR,
|
1998-01-16 07:13:05 -05:00
|
|
|
NODE_GASGN,
|
|
|
|
NODE_IASGN,
|
1999-11-17 02:30:37 -05:00
|
|
|
NODE_CDECL,
|
2000-11-21 09:26:25 -05:00
|
|
|
NODE_CVASGN,
|
2000-03-23 03:37:35 -05:00
|
|
|
NODE_CVDECL,
|
1998-01-16 07:13:05 -05:00
|
|
|
NODE_OP_ASGN1,
|
|
|
|
NODE_OP_ASGN2,
|
1999-01-19 23:59:39 -05:00
|
|
|
NODE_OP_ASGN_AND,
|
|
|
|
NODE_OP_ASGN_OR,
|
1998-01-16 07:13:05 -05:00
|
|
|
NODE_CALL,
|
|
|
|
NODE_FCALL,
|
|
|
|
NODE_VCALL,
|
|
|
|
NODE_SUPER,
|
|
|
|
NODE_ZSUPER,
|
|
|
|
NODE_ARRAY,
|
|
|
|
NODE_ZARRAY,
|
|
|
|
NODE_HASH,
|
|
|
|
NODE_RETURN,
|
|
|
|
NODE_YIELD,
|
|
|
|
NODE_LVAR,
|
|
|
|
NODE_DVAR,
|
|
|
|
NODE_GVAR,
|
|
|
|
NODE_IVAR,
|
2000-03-23 03:37:35 -05:00
|
|
|
NODE_CONST,
|
1998-01-16 07:13:05 -05:00
|
|
|
NODE_CVAR,
|
|
|
|
NODE_NTH_REF,
|
|
|
|
NODE_BACK_REF,
|
|
|
|
NODE_MATCH,
|
1998-01-16 07:19:22 -05:00
|
|
|
NODE_MATCH2,
|
|
|
|
NODE_MATCH3,
|
1998-01-16 07:13:05 -05:00
|
|
|
NODE_LIT,
|
|
|
|
NODE_STR,
|
|
|
|
NODE_DSTR,
|
|
|
|
NODE_XSTR,
|
|
|
|
NODE_DXSTR,
|
|
|
|
NODE_EVSTR,
|
|
|
|
NODE_DREGX,
|
|
|
|
NODE_DREGX_ONCE,
|
|
|
|
NODE_ARGS,
|
1999-01-19 23:59:39 -05:00
|
|
|
NODE_ARGSCAT,
|
2000-01-17 03:37:53 -05:00
|
|
|
NODE_ARGSPUSH,
|
1999-01-19 23:59:39 -05:00
|
|
|
NODE_RESTARGS,
|
2001-06-08 10:20:58 -04:00
|
|
|
NODE_RESTARY,
|
2001-06-23 11:14:28 -04:00
|
|
|
NODE_REXPAND,
|
1999-01-19 23:59:39 -05:00
|
|
|
NODE_BLOCK_ARG,
|
|
|
|
NODE_BLOCK_PASS,
|
1998-01-16 07:13:05 -05:00
|
|
|
NODE_DEFN,
|
|
|
|
NODE_DEFS,
|
|
|
|
NODE_ALIAS,
|
|
|
|
NODE_VALIAS,
|
|
|
|
NODE_UNDEF,
|
|
|
|
NODE_CLASS,
|
|
|
|
NODE_MODULE,
|
|
|
|
NODE_SCLASS,
|
|
|
|
NODE_COLON2,
|
1999-01-19 23:59:39 -05:00
|
|
|
NODE_COLON3,
|
1998-01-16 07:13:05 -05:00
|
|
|
NODE_CREF,
|
|
|
|
NODE_DOT2,
|
|
|
|
NODE_DOT3,
|
|
|
|
NODE_FLIP2,
|
|
|
|
NODE_FLIP3,
|
|
|
|
NODE_ATTRSET,
|
|
|
|
NODE_SELF,
|
|
|
|
NODE_NIL,
|
1998-01-16 07:19:22 -05:00
|
|
|
NODE_TRUE,
|
|
|
|
NODE_FALSE,
|
1998-01-16 07:13:05 -05:00
|
|
|
NODE_DEFINED,
|
|
|
|
NODE_NEWLINE,
|
1998-01-16 07:19:22 -05:00
|
|
|
NODE_POSTEXE,
|
1999-01-19 23:59:39 -05:00
|
|
|
#ifdef C_ALLOCA
|
|
|
|
NODE_ALLOCA,
|
|
|
|
#endif
|
2000-12-05 04:36:54 -05:00
|
|
|
NODE_DMETHOD,
|
|
|
|
NODE_BMETHOD,
|
2000-01-17 03:37:53 -05:00
|
|
|
NODE_MEMO,
|
2001-01-09 02:26:21 -05:00
|
|
|
NODE_IFUNC,
|
2002-10-23 06:17:30 -04:00
|
|
|
NODE_DSYM,
|
2000-05-01 05:42:38 -04:00
|
|
|
NODE_LAST
|
1998-01-16 07:13:05 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct RNode {
|
1999-01-19 23:59:39 -05:00
|
|
|
unsigned long flags;
|
1998-01-16 07:19:22 -05:00
|
|
|
char *nd_file;
|
1998-01-16 07:13:05 -05:00
|
|
|
union {
|
|
|
|
struct RNode *node;
|
|
|
|
ID id;
|
|
|
|
VALUE value;
|
2001-05-02 00:22:21 -04:00
|
|
|
VALUE (*cfunc)(ANYARGS);
|
1998-01-16 07:13:05 -05:00
|
|
|
ID *tbl;
|
|
|
|
} u1;
|
|
|
|
union {
|
|
|
|
struct RNode *node;
|
|
|
|
ID id;
|
2002-05-29 01:20:39 -04:00
|
|
|
int argc;
|
1998-01-16 07:13:05 -05:00
|
|
|
VALUE value;
|
|
|
|
} u2;
|
|
|
|
union {
|
|
|
|
struct RNode *node;
|
|
|
|
ID id;
|
2000-05-24 00:34:26 -04:00
|
|
|
long state;
|
1998-01-16 07:13:05 -05:00
|
|
|
struct global_entry *entry;
|
2000-05-24 00:34:26 -04:00
|
|
|
long cnt;
|
1998-01-16 07:13:05 -05:00
|
|
|
VALUE value;
|
|
|
|
} u3;
|
|
|
|
} NODE;
|
|
|
|
|
|
|
|
#define RNODE(obj) (R_CAST(RNode)(obj))
|
|
|
|
|
2002-10-26 11:51:59 -04:00
|
|
|
#define nd_type(n) ((int)(((RNODE(n))->flags>>FL_USHIFT)&0xff))
|
1998-01-16 07:13:05 -05:00
|
|
|
#define nd_set_type(n,t) \
|
|
|
|
RNODE(n)->flags=((RNODE(n)->flags&~FL_UMASK)|(((t)<<FL_USHIFT)&FL_UMASK))
|
|
|
|
|
1999-01-19 23:59:39 -05:00
|
|
|
#define NODE_LSHIFT (FL_USHIFT+8)
|
1999-08-13 01:45:20 -04:00
|
|
|
#define NODE_LMASK (((long)1<<(sizeof(NODE*)*CHAR_BIT-NODE_LSHIFT))-1)
|
2002-08-27 04:27:11 -04:00
|
|
|
#define nd_line(n) ((unsigned int)(((RNODE(n))->flags>>NODE_LSHIFT)&NODE_LMASK))
|
1998-01-16 07:13:05 -05:00
|
|
|
#define nd_set_line(n,l) \
|
1999-01-19 23:59:39 -05:00
|
|
|
RNODE(n)->flags=((RNODE(n)->flags&~(-1<<NODE_LSHIFT))|(((l)&NODE_LMASK)<<NODE_LSHIFT))
|
1998-01-16 07:13:05 -05:00
|
|
|
|
|
|
|
#define nd_head u1.node
|
|
|
|
#define nd_alen u2.argc
|
|
|
|
#define nd_next u3.node
|
|
|
|
|
|
|
|
#define nd_cond u1.node
|
|
|
|
#define nd_body u2.node
|
|
|
|
#define nd_else u3.node
|
|
|
|
|
|
|
|
#define nd_orig u3.value
|
|
|
|
|
|
|
|
#define nd_resq u2.node
|
|
|
|
#define nd_ensr u3.node
|
|
|
|
|
|
|
|
#define nd_1st u1.node
|
|
|
|
#define nd_2nd u2.node
|
|
|
|
|
|
|
|
#define nd_stts u1.node
|
|
|
|
|
|
|
|
#define nd_entry u3.entry
|
|
|
|
#define nd_vid u1.id
|
|
|
|
#define nd_cflag u2.id
|
|
|
|
#define nd_cval u3.value
|
|
|
|
|
|
|
|
#define nd_cnt u3.cnt
|
|
|
|
#define nd_tbl u1.tbl
|
|
|
|
|
|
|
|
#define nd_var u1.node
|
|
|
|
#define nd_ibdy u2.node
|
|
|
|
#define nd_iter u3.node
|
|
|
|
|
|
|
|
#define nd_value u2.node
|
|
|
|
#define nd_aid u3.id
|
|
|
|
|
|
|
|
#define nd_lit u1.value
|
|
|
|
|
|
|
|
#define nd_frml u1.node
|
|
|
|
#define nd_rest u2.argc
|
|
|
|
#define nd_opt u1.node
|
|
|
|
|
|
|
|
#define nd_recv u1.node
|
|
|
|
#define nd_mid u2.id
|
|
|
|
#define nd_args u3.node
|
|
|
|
|
|
|
|
#define nd_noex u1.id
|
|
|
|
#define nd_defn u3.node
|
|
|
|
|
1999-01-19 23:59:39 -05:00
|
|
|
#define nd_old u1.id
|
1998-01-16 07:13:05 -05:00
|
|
|
#define nd_new u2.id
|
|
|
|
|
|
|
|
#define nd_cfnc u1.cfunc
|
|
|
|
#define nd_argc u2.argc
|
|
|
|
|
|
|
|
#define nd_cname u1.id
|
1998-01-16 07:19:22 -05:00
|
|
|
#define nd_super u3.node
|
1998-01-16 07:13:05 -05:00
|
|
|
|
|
|
|
#define nd_modl u1.id
|
|
|
|
#define nd_clss u1.value
|
|
|
|
|
|
|
|
#define nd_beg u1.node
|
|
|
|
#define nd_end u2.node
|
|
|
|
#define nd_state u3.state
|
1999-01-19 23:59:39 -05:00
|
|
|
#define nd_rval u2.value
|
1998-01-16 07:13:05 -05:00
|
|
|
|
|
|
|
#define nd_nth u2.argc
|
|
|
|
|
|
|
|
#define nd_tag u1.id
|
|
|
|
#define nd_tval u2.value
|
|
|
|
|
1999-01-19 23:59:39 -05:00
|
|
|
#define NEW_METHOD(n,x) rb_node_newnode(NODE_METHOD,x,n,0)
|
|
|
|
#define NEW_FBODY(n,i,o) rb_node_newnode(NODE_FBODY,n,i,o)
|
|
|
|
#define NEW_DEFN(i,a,d,p) rb_node_newnode(NODE_DEFN,p,i,NEW_RFUNC(a,d))
|
|
|
|
#define NEW_DEFS(r,i,a,d) rb_node_newnode(NODE_DEFS,r,i,NEW_RFUNC(a,d))
|
|
|
|
#define NEW_CFUNC(f,c) rb_node_newnode(NODE_CFUNC,f,c,0)
|
2000-12-29 13:23:22 -05:00
|
|
|
#define NEW_IFUNC(f,c) rb_node_newnode(NODE_IFUNC,f,c,0)
|
1998-01-16 07:13:05 -05:00
|
|
|
#define NEW_RFUNC(b1,b2) NEW_SCOPE(block_append(b1,b2))
|
2001-05-02 00:22:21 -04:00
|
|
|
#define NEW_SCOPE(b) rb_node_newnode(NODE_SCOPE,local_tbl(),0,(b))
|
1999-01-19 23:59:39 -05:00
|
|
|
#define NEW_BLOCK(a) rb_node_newnode(NODE_BLOCK,a,0,0)
|
|
|
|
#define NEW_IF(c,t,e) rb_node_newnode(NODE_IF,c,t,e)
|
|
|
|
#define NEW_UNLESS(c,t,e) NEW_IF(c,e,t)
|
|
|
|
#define NEW_CASE(h,b) rb_node_newnode(NODE_CASE,h,b,0)
|
|
|
|
#define NEW_WHEN(c,t,e) rb_node_newnode(NODE_WHEN,c,t,e)
|
|
|
|
#define NEW_OPT_N(b) rb_node_newnode(NODE_OPT_N,0,b,0)
|
|
|
|
#define NEW_WHILE(c,b,n) rb_node_newnode(NODE_WHILE,c,b,n)
|
|
|
|
#define NEW_UNTIL(c,b,n) rb_node_newnode(NODE_UNTIL,c,b,n)
|
|
|
|
#define NEW_FOR(v,i,b) rb_node_newnode(NODE_FOR,v,b,i)
|
|
|
|
#define NEW_ITER(v,i,b) rb_node_newnode(NODE_ITER,v,b,i)
|
2001-05-22 04:28:11 -04:00
|
|
|
#define NEW_BREAK(s) rb_node_newnode(NODE_BREAK,s,0,0)
|
|
|
|
#define NEW_NEXT(s) rb_node_newnode(NODE_NEXT,s,0,0)
|
1999-01-19 23:59:39 -05:00
|
|
|
#define NEW_REDO() rb_node_newnode(NODE_REDO,0,0,0)
|
|
|
|
#define NEW_RETRY() rb_node_newnode(NODE_RETRY,0,0,0)
|
|
|
|
#define NEW_BEGIN(b) rb_node_newnode(NODE_BEGIN,0,b,0)
|
|
|
|
#define NEW_RESCUE(b,res,e) rb_node_newnode(NODE_RESCUE,b,res,e)
|
|
|
|
#define NEW_RESBODY(a,ex,n) rb_node_newnode(NODE_RESBODY,n,ex,a)
|
|
|
|
#define NEW_ENSURE(b,en) rb_node_newnode(NODE_ENSURE,b,0,en)
|
|
|
|
#define NEW_RETURN(s) rb_node_newnode(NODE_RETURN,s,0,0)
|
|
|
|
#define NEW_YIELD(a) rb_node_newnode(NODE_YIELD,a,0,0)
|
1998-01-16 07:13:05 -05:00
|
|
|
#define NEW_LIST(a) NEW_ARRAY(a)
|
1999-01-19 23:59:39 -05:00
|
|
|
#define NEW_ARRAY(a) rb_node_newnode(NODE_ARRAY,a,1,0)
|
|
|
|
#define NEW_ZARRAY() rb_node_newnode(NODE_ZARRAY,0,0,0)
|
|
|
|
#define NEW_HASH(a) rb_node_newnode(NODE_HASH,a,0,0)
|
|
|
|
#define NEW_NOT(a) rb_node_newnode(NODE_NOT,0,a,0)
|
|
|
|
#define NEW_MASGN(l,r) rb_node_newnode(NODE_MASGN,l,0,r)
|
|
|
|
#define NEW_GASGN(v,val) rb_node_newnode(NODE_GASGN,v,val,rb_global_entry(v))
|
|
|
|
#define NEW_LASGN(v,val) rb_node_newnode(NODE_LASGN,v,val,local_cnt(v))
|
2002-05-27 23:20:04 -04:00
|
|
|
#define NEW_DASGN(v,val) rb_node_newnode(NODE_DASGN,v,val,0)
|
|
|
|
#define NEW_DASGN_CURR(v,val) rb_node_newnode(NODE_DASGN_CURR,v,val,0)
|
1999-01-19 23:59:39 -05:00
|
|
|
#define NEW_IASGN(v,val) rb_node_newnode(NODE_IASGN,v,val,0)
|
1999-11-17 02:30:37 -05:00
|
|
|
#define NEW_CDECL(v,val) rb_node_newnode(NODE_CDECL,v,val,0)
|
2000-11-21 09:26:25 -05:00
|
|
|
#define NEW_CVASGN(v,val) rb_node_newnode(NODE_CVASGN,v,val,0)
|
2000-03-23 03:37:35 -05:00
|
|
|
#define NEW_CVDECL(v,val) rb_node_newnode(NODE_CVDECL,v,val,0)
|
1999-01-19 23:59:39 -05:00
|
|
|
#define NEW_OP_ASGN1(p,id,a) rb_node_newnode(NODE_OP_ASGN1,p,id,a)
|
|
|
|
#define NEW_OP_ASGN2(r,i,o,val) rb_node_newnode(NODE_OP_ASGN2,r,val,NEW_OP_ASGN22(i,o))
|
|
|
|
#define NEW_OP_ASGN22(i,o) rb_node_newnode(NODE_OP_ASGN2,i,o,rb_id_attrset(i))
|
|
|
|
#define NEW_OP_ASGN_OR(i,val) rb_node_newnode(NODE_OP_ASGN_OR,i,val,0)
|
|
|
|
#define NEW_OP_ASGN_AND(i,val) rb_node_newnode(NODE_OP_ASGN_AND,i,val,0)
|
|
|
|
#define NEW_GVAR(v) rb_node_newnode(NODE_GVAR,v,0,rb_global_entry(v))
|
|
|
|
#define NEW_LVAR(v) rb_node_newnode(NODE_LVAR,v,0,local_cnt(v))
|
|
|
|
#define NEW_DVAR(v) rb_node_newnode(NODE_DVAR,v,0,0);
|
|
|
|
#define NEW_IVAR(v) rb_node_newnode(NODE_IVAR,v,0,0)
|
2000-03-23 03:37:35 -05:00
|
|
|
#define NEW_CONST(v) rb_node_newnode(NODE_CONST,v,0,0)
|
1999-01-19 23:59:39 -05:00
|
|
|
#define NEW_CVAR(v) rb_node_newnode(NODE_CVAR,v,0,0)
|
|
|
|
#define NEW_NTH_REF(n) rb_node_newnode(NODE_NTH_REF,0,n,local_cnt('~'))
|
|
|
|
#define NEW_BACK_REF(n) rb_node_newnode(NODE_BACK_REF,0,n,local_cnt('~'))
|
|
|
|
#define NEW_MATCH(c) rb_node_newnode(NODE_MATCH,c,0,0)
|
|
|
|
#define NEW_MATCH2(n1,n2) rb_node_newnode(NODE_MATCH2,n1,n2,0)
|
|
|
|
#define NEW_MATCH3(r,n2) rb_node_newnode(NODE_MATCH3,r,n2,0)
|
|
|
|
#define NEW_LIT(l) rb_node_newnode(NODE_LIT,l,0,0)
|
|
|
|
#define NEW_STR(s) rb_node_newnode(NODE_STR,s,0,0)
|
|
|
|
#define NEW_DSTR(s) rb_node_newnode(NODE_DSTR,s,0,0)
|
|
|
|
#define NEW_XSTR(s) rb_node_newnode(NODE_XSTR,s,0,0)
|
|
|
|
#define NEW_DXSTR(s) rb_node_newnode(NODE_DXSTR,s,0,0)
|
2002-10-23 06:17:30 -04:00
|
|
|
#define NEW_DSYM(s) rb_node_newnode(NODE_DSYM,s,0,0)
|
2002-07-26 02:12:39 -04:00
|
|
|
#define NEW_EVSTR(n) rb_node_newnode(NODE_EVSTR,0,(n),0)
|
1999-01-19 23:59:39 -05:00
|
|
|
#define NEW_CALL(r,m,a) rb_node_newnode(NODE_CALL,r,m,a)
|
|
|
|
#define NEW_FCALL(m,a) rb_node_newnode(NODE_FCALL,0,m,a)
|
|
|
|
#define NEW_VCALL(m) rb_node_newnode(NODE_VCALL,0,m,0)
|
|
|
|
#define NEW_SUPER(a) rb_node_newnode(NODE_SUPER,0,0,a)
|
|
|
|
#define NEW_ZSUPER() rb_node_newnode(NODE_ZSUPER,0,0,0)
|
|
|
|
#define NEW_ARGS(f,o,r) rb_node_newnode(NODE_ARGS,o,r,f)
|
|
|
|
#define NEW_ARGSCAT(a,b) rb_node_newnode(NODE_ARGSCAT,a,b,0)
|
2000-01-17 03:37:53 -05:00
|
|
|
#define NEW_ARGSPUSH(a,b) rb_node_newnode(NODE_ARGSPUSH,a,b,0)
|
1999-01-19 23:59:39 -05:00
|
|
|
#define NEW_RESTARGS(a) rb_node_newnode(NODE_RESTARGS,a,0,0)
|
2001-06-08 10:20:58 -04:00
|
|
|
#define NEW_RESTARY(a) rb_node_newnode(NODE_RESTARY,a,0,0)
|
2001-06-23 11:14:28 -04:00
|
|
|
#define NEW_REXPAND(a) rb_node_newnode(NODE_REXPAND,a,0,0)
|
1999-01-19 23:59:39 -05:00
|
|
|
#define NEW_BLOCK_ARG(v) rb_node_newnode(NODE_BLOCK_ARG,v,0,local_cnt(v))
|
|
|
|
#define NEW_BLOCK_PASS(b) rb_node_newnode(NODE_BLOCK_PASS,0,b,0)
|
|
|
|
#define NEW_ALIAS(n,o) rb_node_newnode(NODE_ALIAS,o,n,0)
|
|
|
|
#define NEW_VALIAS(n,o) rb_node_newnode(NODE_VALIAS,o,n,0)
|
|
|
|
#define NEW_UNDEF(i) rb_node_newnode(NODE_UNDEF,0,i,0)
|
2001-05-02 00:22:21 -04:00
|
|
|
#define NEW_CLASS(n,b,s) rb_node_newnode(NODE_CLASS,n,NEW_SCOPE(b),(s))
|
|
|
|
#define NEW_SCLASS(r,b) rb_node_newnode(NODE_SCLASS,r,NEW_SCOPE(b),0)
|
|
|
|
#define NEW_MODULE(n,b) rb_node_newnode(NODE_MODULE,n,NEW_SCOPE(b),0)
|
1999-01-19 23:59:39 -05:00
|
|
|
#define NEW_COLON2(c,i) rb_node_newnode(NODE_COLON2,c,i,0)
|
|
|
|
#define NEW_COLON3(i) rb_node_newnode(NODE_COLON3,0,i,0)
|
2001-05-02 00:22:21 -04:00
|
|
|
#define NEW_CREF(c) (rb_node_newnode(NODE_CREF,0,0,c))
|
1999-01-19 23:59:39 -05:00
|
|
|
#define NEW_DOT2(b,e) rb_node_newnode(NODE_DOT2,b,e,0)
|
|
|
|
#define NEW_DOT3(b,e) rb_node_newnode(NODE_DOT3,b,e,0)
|
|
|
|
#define NEW_ATTRSET(a) rb_node_newnode(NODE_ATTRSET,a,0,0)
|
|
|
|
#define NEW_SELF() rb_node_newnode(NODE_SELF,0,0,0)
|
|
|
|
#define NEW_NIL() rb_node_newnode(NODE_NIL,0,0,0)
|
|
|
|
#define NEW_TRUE() rb_node_newnode(NODE_TRUE,0,0,0)
|
|
|
|
#define NEW_FALSE() rb_node_newnode(NODE_FALSE,0,0,0)
|
|
|
|
#define NEW_DEFINED(e) rb_node_newnode(NODE_DEFINED,e,0,0)
|
|
|
|
#define NEW_NEWLINE(n) rb_node_newnode(NODE_NEWLINE,0,0,n)
|
1998-01-16 07:19:22 -05:00
|
|
|
#define NEW_PREEXE(b) NEW_SCOPE(b)
|
1999-01-19 23:59:39 -05:00
|
|
|
#define NEW_POSTEXE() rb_node_newnode(NODE_POSTEXE,0,0,0)
|
2000-12-05 04:36:54 -05:00
|
|
|
#define NEW_DMETHOD(b) rb_node_newnode(NODE_DMETHOD,0,0,b)
|
|
|
|
#define NEW_BMETHOD(b) rb_node_newnode(NODE_BMETHOD,0,0,b)
|
1998-01-16 07:13:05 -05:00
|
|
|
|
1999-01-19 23:59:39 -05:00
|
|
|
#define NOEX_PUBLIC 0
|
|
|
|
#define NOEX_UNDEF 1
|
|
|
|
#define NOEX_CFUNC 1
|
|
|
|
#define NOEX_PRIVATE 2
|
|
|
|
#define NOEX_PROTECTED 4
|
1998-01-16 07:13:05 -05:00
|
|
|
|
1999-08-13 01:45:20 -04:00
|
|
|
NODE *rb_compile_cstr _((const char*, const char*, int, int));
|
|
|
|
NODE *rb_compile_string _((const char*, VALUE, int));
|
|
|
|
NODE *rb_compile_file _((const char*, VALUE, int));
|
1998-01-16 07:19:22 -05:00
|
|
|
|
|
|
|
void rb_add_method _((VALUE, ID, NODE *, int));
|
2001-05-02 00:22:21 -04:00
|
|
|
NODE *rb_node_newnode(ANYARGS);
|
1998-01-16 07:19:22 -05:00
|
|
|
|
|
|
|
struct global_entry *rb_global_entry _((ID));
|
|
|
|
VALUE rb_gvar_get _((struct global_entry *));
|
|
|
|
VALUE rb_gvar_set _((struct global_entry *, VALUE));
|
|
|
|
VALUE rb_gvar_defined _((struct global_entry *));
|
1998-01-16 07:13:05 -05:00
|
|
|
|
1999-10-29 05:25:48 -04:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
} /* extern "C" { */
|
|
|
|
#endif
|
|
|
|
|
1998-01-16 07:13:05 -05:00
|
|
|
#endif
|