Ruby 1.9.2p136(2010-12-25revision30365)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

# node.h

Go to the documentation of this file.

    00001 /**********************************************************************
    00002
    00003   node.h -
    00004
    00005   $Author: muraken $
    00006   created at: Fri May 28 15:14:02 JST 1993
    00007
    00008   Copyright (C) 1993-2007 Yukihiro Matsumoto
    00009
    00010 **********************************************************************/
    00011
    00012 #ifndef RUBY_NODE_H
    00013 #define RUBY_NODE_H 1
    00014
    00015 #if defined(__cplusplus)
    00016 extern "C" {
    00017 #if 0
    00018 } /* satisfy cc-mode */
    00019 #endif
    00020 #endif
    00021
    00022 enum node_type {
    00023     NODE_SCOPE,
    00024 #define NODE_SCOPE       NODE_SCOPE
    00025     NODE_BLOCK,
    00026 #define NODE_BLOCK       NODE_BLOCK
    00027     NODE_IF,
    00028 #define NODE_IF          NODE_IF
    00029     NODE_CASE,
    00030 #define NODE_CASE        NODE_CASE
    00031     NODE_WHEN,
    00032 #define NODE_WHEN        NODE_WHEN
    00033     NODE_OPT_N,
    00034 #define NODE_OPT_N       NODE_OPT_N
    00035     NODE_WHILE,
    00036 #define NODE_WHILE       NODE_WHILE
    00037     NODE_UNTIL,
    00038 #define NODE_UNTIL       NODE_UNTIL
    00039     NODE_ITER,
    00040 #define NODE_ITER        NODE_ITER
    00041     NODE_FOR,
    00042 #define NODE_FOR         NODE_FOR
    00043     NODE_BREAK,
    00044 #define NODE_BREAK       NODE_BREAK
    00045     NODE_NEXT,
    00046 #define NODE_NEXT        NODE_NEXT
    00047     NODE_REDO,
    00048 #define NODE_REDO        NODE_REDO
    00049     NODE_RETRY,
    00050 #define NODE_RETRY       NODE_RETRY
    00051     NODE_BEGIN,
    00052 #define NODE_BEGIN       NODE_BEGIN
    00053     NODE_RESCUE,
    00054 #define NODE_RESCUE      NODE_RESCUE
    00055     NODE_RESBODY,
    00056 #define NODE_RESBODY     NODE_RESBODY
    00057     NODE_ENSURE,
    00058 #define NODE_ENSURE      NODE_ENSURE
    00059     NODE_AND,
    00060 #define NODE_AND         NODE_AND
    00061     NODE_OR,
    00062 #define NODE_OR          NODE_OR
    00063     NODE_MASGN,
    00064 #define NODE_MASGN       NODE_MASGN
    00065     NODE_LASGN,
    00066 #define NODE_LASGN       NODE_LASGN
    00067     NODE_DASGN,
    00068 #define NODE_DASGN       NODE_DASGN
    00069     NODE_DASGN_CURR,
    00070 #define NODE_DASGN_CURR  NODE_DASGN_CURR
    00071     NODE_GASGN,
    00072 #define NODE_GASGN       NODE_GASGN
    00073     NODE_IASGN,
    00074 #define NODE_IASGN       NODE_IASGN
    00075     NODE_IASGN2,
    00076 #define NODE_IASGN2      NODE_IASGN2
    00077     NODE_CDECL,
    00078 #define NODE_CDECL       NODE_CDECL
    00079     NODE_CVASGN,
    00080 #define NODE_CVASGN      NODE_CVASGN
    00081     NODE_CVDECL,
    00082 #define NODE_CVDECL      NODE_CVDECL
    00083     NODE_OP_ASGN1,
    00084 #define NODE_OP_ASGN1    NODE_OP_ASGN1
    00085     NODE_OP_ASGN2,
    00086 #define NODE_OP_ASGN2    NODE_OP_ASGN2
    00087     NODE_OP_ASGN_AND,
    00088 #define NODE_OP_ASGN_AND NODE_OP_ASGN_AND
    00089     NODE_OP_ASGN_OR,
    00090 #define NODE_OP_ASGN_OR  NODE_OP_ASGN_OR
    00091     NODE_CALL,
    00092 #define NODE_CALL        NODE_CALL
    00093     NODE_FCALL,
    00094 #define NODE_FCALL       NODE_FCALL
    00095     NODE_VCALL,
    00096 #define NODE_VCALL       NODE_VCALL
    00097     NODE_SUPER,
    00098 #define NODE_SUPER       NODE_SUPER
    00099     NODE_ZSUPER,
    00100 #define NODE_ZSUPER      NODE_ZSUPER
    00101     NODE_ARRAY,
    00102 #define NODE_ARRAY       NODE_ARRAY
    00103     NODE_ZARRAY,
    00104 #define NODE_ZARRAY      NODE_ZARRAY
    00105     NODE_VALUES,
    00106 #define NODE_VALUES      NODE_VALUES
    00107     NODE_HASH,
    00108 #define NODE_HASH        NODE_HASH
    00109     NODE_RETURN,
    00110 #define NODE_RETURN      NODE_RETURN
    00111     NODE_YIELD,
    00112 #define NODE_YIELD       NODE_YIELD
    00113     NODE_LVAR,
    00114 #define NODE_LVAR        NODE_LVAR
    00115     NODE_DVAR,
    00116 #define NODE_DVAR        NODE_DVAR
    00117     NODE_GVAR,
    00118 #define NODE_GVAR        NODE_GVAR
    00119     NODE_IVAR,
    00120 #define NODE_IVAR        NODE_IVAR
    00121     NODE_CONST,
    00122 #define NODE_CONST       NODE_CONST
    00123     NODE_CVAR,
    00124 #define NODE_CVAR        NODE_CVAR
    00125     NODE_NTH_REF,
    00126 #define NODE_NTH_REF     NODE_NTH_REF
    00127     NODE_BACK_REF,
    00128 #define NODE_BACK_REF    NODE_BACK_REF
    00129     NODE_MATCH,
    00130 #define NODE_MATCH       NODE_MATCH
    00131     NODE_MATCH2,
    00132 #define NODE_MATCH2      NODE_MATCH2
    00133     NODE_MATCH3,
    00134 #define NODE_MATCH3      NODE_MATCH3
    00135     NODE_LIT,
    00136 #define NODE_LIT         NODE_LIT
    00137     NODE_STR,
    00138 #define NODE_STR         NODE_STR
    00139     NODE_DSTR,
    00140 #define NODE_DSTR        NODE_DSTR
    00141     NODE_XSTR,
    00142 #define NODE_XSTR        NODE_XSTR
    00143     NODE_DXSTR,
    00144 #define NODE_DXSTR       NODE_DXSTR
    00145     NODE_EVSTR,
    00146 #define NODE_EVSTR       NODE_EVSTR
    00147     NODE_DREGX,
    00148 #define NODE_DREGX       NODE_DREGX
    00149     NODE_DREGX_ONCE,
    00150 #define NODE_DREGX_ONCE  NODE_DREGX_ONCE
    00151     NODE_ARGS,
    00152 #define NODE_ARGS        NODE_ARGS
    00153     NODE_ARGS_AUX,
    00154 #define NODE_ARGS_AUX    NODE_ARGS_AUX
    00155     NODE_OPT_ARG,
    00156 #define NODE_OPT_ARG     NODE_OPT_ARG
    00157     NODE_POSTARG,
    00158 #define NODE_POSTARG     NODE_POSTARG
    00159     NODE_ARGSCAT,
    00160 #define NODE_ARGSCAT     NODE_ARGSCAT
    00161     NODE_ARGSPUSH,
    00162 #define NODE_ARGSPUSH    NODE_ARGSPUSH
    00163     NODE_SPLAT,
    00164 #define NODE_SPLAT       NODE_SPLAT
    00165     NODE_TO_ARY,
    00166 #define NODE_TO_ARY      NODE_TO_ARY
    00167     NODE_BLOCK_ARG,
    00168 #define NODE_BLOCK_ARG   NODE_BLOCK_ARG
    00169     NODE_BLOCK_PASS,
    00170 #define NODE_BLOCK_PASS  NODE_BLOCK_PASS
    00171     NODE_DEFN,
    00172 #define NODE_DEFN        NODE_DEFN
    00173     NODE_DEFS,
    00174 #define NODE_DEFS        NODE_DEFS
    00175     NODE_ALIAS,
    00176 #define NODE_ALIAS       NODE_ALIAS
    00177     NODE_VALIAS,
    00178 #define NODE_VALIAS      NODE_VALIAS
    00179     NODE_UNDEF,
    00180 #define NODE_UNDEF       NODE_UNDEF
    00181     NODE_CLASS,
    00182 #define NODE_CLASS       NODE_CLASS
    00183     NODE_MODULE,
    00184 #define NODE_MODULE      NODE_MODULE
    00185     NODE_SCLASS,
    00186 #define NODE_SCLASS      NODE_SCLASS
    00187     NODE_COLON2,
    00188 #define NODE_COLON2      NODE_COLON2
    00189     NODE_COLON3,
    00190 #define NODE_COLON3      NODE_COLON3
    00191     NODE_DOT2,
    00192 #define NODE_DOT2        NODE_DOT2
    00193     NODE_DOT3,
    00194 #define NODE_DOT3        NODE_DOT3
    00195     NODE_FLIP2,
    00196 #define NODE_FLIP2       NODE_FLIP2
    00197     NODE_FLIP3,
    00198 #define NODE_FLIP3       NODE_FLIP3
    00199     NODE_SELF,
    00200 #define NODE_SELF        NODE_SELF
    00201     NODE_NIL,
    00202 #define NODE_NIL         NODE_NIL
    00203     NODE_TRUE,
    00204 #define NODE_TRUE        NODE_TRUE
    00205     NODE_FALSE,
    00206 #define NODE_FALSE       NODE_FALSE
    00207     NODE_ERRINFO,
    00208 #define NODE_ERRINFO     NODE_ERRINFO
    00209     NODE_DEFINED,
    00210 #define NODE_DEFINED     NODE_DEFINED
    00211     NODE_POSTEXE,
    00212 #define NODE_POSTEXE     NODE_POSTEXE
    00213     NODE_ALLOCA,
    00214 #define NODE_ALLOCA      NODE_ALLOCA
    00215     NODE_BMETHOD,
    00216 #define NODE_BMETHOD     NODE_BMETHOD
    00217     NODE_MEMO,
    00218 #define NODE_MEMO        NODE_MEMO
    00219     NODE_IFUNC,
    00220 #define NODE_IFUNC       NODE_IFUNC
    00221     NODE_DSYM,
    00222 #define NODE_DSYM        NODE_DSYM
    00223     NODE_ATTRASGN,
    00224 #define NODE_ATTRASGN    NODE_ATTRASGN
    00225     NODE_PRELUDE,
    00226 #define NODE_PRELUDE     NODE_PRELUDE
    00227     NODE_LAMBDA,
    00228 #define NODE_LAMBDA      NODE_LAMBDA
    00229     NODE_OPTBLOCK,
    00230 #define NODE_OPTBLOCK    NODE_OPTBLOCK
    00231     NODE_LAST
    00232 #define NODE_LAST        NODE_LAST
    00233 };
    00234
    00235 typedef struct RNode {
    00236     unsigned long flags;
    00237     char *nd_file;
    00238     union {
    00239         struct RNode *node;
    00240         ID id;
    00241         VALUE value;
    00242         VALUE (*cfunc)(ANYARGS);
    00243         ID *tbl;
    00244     } u1;
    00245     union {
    00246         struct RNode *node;
    00247         ID id;
    00248         long argc;
    00249         VALUE value;
    00250     } u2;
    00251     union {
    00252         struct RNode *node;
    00253         ID id;
    00254         long state;
    00255         struct rb_global_entry *entry;
    00256         long cnt;
    00257         VALUE value;
    00258     } u3;
    00259 } NODE;
    00260
    00261 #define RNODE(obj)  (R_CAST(RNode)(obj))
    00262
    00263 /* 0..4:T_TYPES, 5:FL_MARK, 6:reserved, 7:NODE_FL_NEWLINE */
    00264 #define NODE_FL_NEWLINE (((VALUE)1)<<7)
    00265 #define NODE_FL_CREF_PUSHED_BY_EVAL NODE_FL_NEWLINE
    00266
    00267 #define NODE_TYPESHIFT 8
    00268 #define NODE_TYPEMASK  (((VALUE)0x7f)<<NODE_TYPESHIFT)
    00269
    00270 #define nd_type(n) ((int) (((RNODE(n))->flags & NODE_TYPEMASK)>>NODE_TYPESHIFT))
    00271 #define nd_set_type(n,t) \
    00272     RNODE(n)->flags=((RNODE(n)->flags&~NODE_TYPEMASK)|((((unsigned long)t)<<NODE_TYPESHIFT)&NODE_TYPEMASK))
    00273
    00274 #define NODE_LSHIFT (NODE_TYPESHIFT+7)
    00275 #define NODE_LMASK  (((SIGNED_VALUE)1<<(sizeof(VALUE)*CHAR_BIT-NODE_LSHIFT))-1)
    00276 #define nd_line(n) (int)(RNODE(n)->flags>>NODE_LSHIFT)
    00277 #define nd_set_line(n,l) \
    00278     RNODE(n)->flags=((RNODE(n)->flags&~(-1<<NODE_LSHIFT))|(((l)&NODE_LMASK)<<NODE_LSHIFT))
    00279
    00280 #define nd_head  u1.node
    00281 #define nd_alen  u2.argc
    00282 #define nd_next  u3.node
    00283
    00284 #define nd_cond  u1.node
    00285 #define nd_body  u2.node
    00286 #define nd_else  u3.node
    00287
    00288 #define nd_orig  u3.value
    00289
    00290 #define nd_resq  u2.node
    00291 #define nd_ensr  u3.node
    00292
    00293 #define nd_1st   u1.node
    00294 #define nd_2nd   u2.node
    00295
    00296 #define nd_stts  u1.node
    00297
    00298 #define nd_entry u3.entry
    00299 #define nd_vid   u1.id
    00300 #define nd_cflag u2.id
    00301 #define nd_cval  u3.value
    00302
    00303 #define nd_oid   u1.id
    00304 #define nd_cnt   u3.cnt
    00305 #define nd_tbl   u1.tbl
    00306
    00307 #define nd_var   u1.node
    00308 #define nd_iter  u3.node
    00309
    00310 #define nd_value u2.node
    00311 #define nd_aid   u3.id
    00312
    00313 #define nd_lit   u1.value
    00314
    00315 #define nd_frml  u2.argc
    00316 #define nd_rest  u1.id
    00317 #define nd_opt   u1.node
    00318 #define nd_pid   u1.id
    00319 #define nd_plen  u2.argc
    00320
    00321 #define nd_recv  u1.node
    00322 #define nd_mid   u2.id
    00323 #define nd_args  u3.node
    00324
    00325 #define nd_noex  u3.id
    00326 #define nd_defn  u3.node
    00327
    00328 #define nd_cfnc  u1.cfunc
    00329 #define nd_argc  u2.argc
    00330
    00331 #define nd_cpath u1.node
    00332 #define nd_super u3.node
    00333
    00334 #define nd_modl  u1.id
    00335 #define nd_clss  u1.value
    00336
    00337 #define nd_beg   u1.node
    00338 #define nd_end   u2.node
    00339 #define nd_state u3.state
    00340 #define nd_rval  u2.value
    00341
    00342 #define nd_nth   u2.argc
    00343
    00344 #define nd_tag   u1.id
    00345 #define nd_tval  u2.value
    00346
    00347 #define nd_visi  u2.argc
    00348
    00349 #define NEW_NODE(t,a0,a1,a2) rb_node_newnode((t),(VALUE)(a0),(VALUE)(a1),(VALUE)(a2))
    00350
    00351 #define NEW_DEFN(i,a,d,p) NEW_NODE(NODE_DEFN,0,i,NEW_SCOPE(a,d))
    00352 #define NEW_DEFS(r,i,a,d) NEW_NODE(NODE_DEFS,r,i,NEW_SCOPE(a,d))
    00353 #define NEW_IFUNC(f,c) NEW_NODE(NODE_IFUNC,f,c,0)
    00354 #define NEW_SCOPE(a,b) NEW_NODE(NODE_SCOPE,local_tbl(),b,a)
    00355 #define NEW_BLOCK(a) NEW_NODE(NODE_BLOCK,a,0,0)
    00356 #define NEW_IF(c,t,e) NEW_NODE(NODE_IF,c,t,e)
    00357 #define NEW_UNLESS(c,t,e) NEW_IF(c,e,t)
    00358 #define NEW_CASE(h,b) NEW_NODE(NODE_CASE,h,b,0)
    00359 #define NEW_WHEN(c,t,e) NEW_NODE(NODE_WHEN,c,t,e)
    00360 #define NEW_OPT_N(b) NEW_NODE(NODE_OPT_N,0,b,0)
    00361 #define NEW_WHILE(c,b,n) NEW_NODE(NODE_WHILE,c,b,n)
    00362 #define NEW_UNTIL(c,b,n) NEW_NODE(NODE_UNTIL,c,b,n)
    00363 #define NEW_FOR(v,i,b) NEW_NODE(NODE_FOR,v,b,i)
    00364 #define NEW_ITER(a,b) NEW_NODE(NODE_ITER,0,NEW_SCOPE(a,b),0)
    00365 #define NEW_LAMBDA(a) NEW_NODE(NODE_LAMBDA,a,0,0)
    00366 #define NEW_BREAK(s) NEW_NODE(NODE_BREAK,s,0,0)
    00367 #define NEW_NEXT(s) NEW_NODE(NODE_NEXT,s,0,0)
    00368 #define NEW_REDO() NEW_NODE(NODE_REDO,0,0,0)
    00369 #define NEW_RETRY() NEW_NODE(NODE_RETRY,0,0,0)
    00370 #define NEW_BEGIN(b) NEW_NODE(NODE_BEGIN,0,b,0)
    00371 #define NEW_RESCUE(b,res,e) NEW_NODE(NODE_RESCUE,b,res,e)
    00372 #define NEW_RESBODY(a,ex,n) NEW_NODE(NODE_RESBODY,n,ex,a)
    00373 #define NEW_ENSURE(b,en) NEW_NODE(NODE_ENSURE,b,0,en)
    00374 #define NEW_RETURN(s) NEW_NODE(NODE_RETURN,s,0,0)
    00375 #define NEW_YIELD(a,s) NEW_NODE(NODE_YIELD,a,0,s)
    00376 #define NEW_LIST(a)  NEW_ARRAY(a)
    00377 #define NEW_ARRAY(a) NEW_NODE(NODE_ARRAY,a,1,0)
    00378 #define NEW_ZARRAY() NEW_NODE(NODE_ZARRAY,0,0,0)
    00379 #define NEW_HASH(a)  NEW_NODE(NODE_HASH,a,0,0)
    00380 #define NEW_MASGN(l,r)   NEW_NODE(NODE_MASGN,l,0,r)
    00381 #define NEW_GASGN(v,val) NEW_NODE(NODE_GASGN,v,val,rb_global_entry(v))
    00382 #define NEW_LASGN(v,val) NEW_NODE(NODE_LASGN,v,val,0)
    00383 #define NEW_DASGN(v,val) NEW_NODE(NODE_DASGN,v,val,0)
    00384 #define NEW_DASGN_CURR(v,val) NEW_NODE(NODE_DASGN_CURR,v,val,0)
    00385 #define NEW_IASGN(v,val) NEW_NODE(NODE_IASGN,v,val,0)
    00386 #define NEW_IASGN2(v,val) NEW_NODE(NODE_IASGN2,v,val,0)
    00387 #define NEW_CDECL(v,val,path) NEW_NODE(NODE_CDECL,v,val,path)
    00388 #define NEW_CVASGN(v,val) NEW_NODE(NODE_CVASGN,v,val,0)
    00389 #define NEW_CVDECL(v,val) NEW_NODE(NODE_CVDECL,v,val,0)
    00390 #define NEW_OP_ASGN1(p,id,a) NEW_NODE(NODE_OP_ASGN1,p,id,a)
    00391 #define NEW_OP_ASGN2(r,i,o,val) NEW_NODE(NODE_OP_ASGN2,r,val,NEW_OP_ASGN22(i,o))
    00392 #define NEW_OP_ASGN22(i,o) NEW_NODE(NODE_OP_ASGN2,i,o,rb_id_attrset(i))
    00393 #define NEW_OP_ASGN_OR(i,val) NEW_NODE(NODE_OP_ASGN_OR,i,val,0)
    00394 #define NEW_OP_ASGN_AND(i,val) NEW_NODE(NODE_OP_ASGN_AND,i,val,0)
    00395 #define NEW_GVAR(v) NEW_NODE(NODE_GVAR,v,0,rb_global_entry(v))
    00396 #define NEW_LVAR(v) NEW_NODE(NODE_LVAR,v,0,0)
    00397 #define NEW_DVAR(v) NEW_NODE(NODE_DVAR,v,0,0)
    00398 #define NEW_IVAR(v) NEW_NODE(NODE_IVAR,v,0,0)
    00399 #define NEW_CONST(v) NEW_NODE(NODE_CONST,v,0,0)
    00400 #define NEW_CVAR(v) NEW_NODE(NODE_CVAR,v,0,0)
    00401 #define NEW_NTH_REF(n)  NEW_NODE(NODE_NTH_REF,0,n,0)
    00402 #define NEW_BACK_REF(n) NEW_NODE(NODE_BACK_REF,0,n,0)
    00403 #define NEW_MATCH(c) NEW_NODE(NODE_MATCH,c,0,0)
    00404 #define NEW_MATCH2(n1,n2) NEW_NODE(NODE_MATCH2,n1,n2,0)
    00405 #define NEW_MATCH3(r,n2) NEW_NODE(NODE_MATCH3,r,n2,0)
    00406 #define NEW_LIT(l) NEW_NODE(NODE_LIT,l,0,0)
    00407 #define NEW_STR(s) NEW_NODE(NODE_STR,s,0,0)
    00408 #define NEW_DSTR(s) NEW_NODE(NODE_DSTR,s,1,0)
    00409 #define NEW_XSTR(s) NEW_NODE(NODE_XSTR,s,0,0)
    00410 #define NEW_DXSTR(s) NEW_NODE(NODE_DXSTR,s,0,0)
    00411 #define NEW_DSYM(s) NEW_NODE(NODE_DSYM,s,0,0)
    00412 #define NEW_EVSTR(n) NEW_NODE(NODE_EVSTR,0,(n),0)
    00413 #define NEW_CALL(r,m,a) NEW_NODE(NODE_CALL,r,m,a)
    00414 #define NEW_FCALL(m,a) NEW_NODE(NODE_FCALL,0,m,a)
    00415 #define NEW_VCALL(m) NEW_NODE(NODE_VCALL,0,m,0)
    00416 #define NEW_SUPER(a) NEW_NODE(NODE_SUPER,0,0,a)
    00417 #define NEW_ZSUPER() NEW_NODE(NODE_ZSUPER,0,0,0)
    00418 #define NEW_ARGS(m,o) NEW_NODE(NODE_ARGS,o,m,0)
    00419 #define NEW_ARGS_AUX(r,b) NEW_NODE(NODE_ARGS_AUX,r,b,0)
    00420 #define NEW_OPT_ARG(i,v) NEW_NODE(NODE_OPT_ARG,i,v,0)
    00421 #define NEW_POSTARG(i,v) NEW_NODE(NODE_POSTARG,i,v,0)
    00422 #define NEW_ARGSCAT(a,b) NEW_NODE(NODE_ARGSCAT,a,b,0)
    00423 #define NEW_ARGSPUSH(a,b) NEW_NODE(NODE_ARGSPUSH,a,b,0)
    00424 #define NEW_SPLAT(a) NEW_NODE(NODE_SPLAT,a,0,0)
    00425 #define NEW_TO_ARY(a) NEW_NODE(NODE_TO_ARY,a,0,0)
    00426 #define NEW_BLOCK_ARG(v) NEW_NODE(NODE_BLOCK_ARG,v,0,local_cnt(v))
    00427 #define NEW_BLOCK_PASS(b) NEW_NODE(NODE_BLOCK_PASS,0,b,0)
    00428 #define NEW_ALIAS(n,o) NEW_NODE(NODE_ALIAS,n,o,0)
    00429 #define NEW_VALIAS(n,o) NEW_NODE(NODE_VALIAS,n,o,0)
    00430 #define NEW_UNDEF(i) NEW_NODE(NODE_UNDEF,0,i,0)
    00431 #define NEW_CLASS(n,b,s) NEW_NODE(NODE_CLASS,n,NEW_SCOPE(0,b),(s))
    00432 #define NEW_SCLASS(r,b) NEW_NODE(NODE_SCLASS,r,NEW_SCOPE(0,b),0)
    00433 #define NEW_MODULE(n,b) NEW_NODE(NODE_MODULE,n,NEW_SCOPE(0,b),0)
    00434 #define NEW_COLON2(c,i) NEW_NODE(NODE_COLON2,c,i,0)
    00435 #define NEW_COLON3(i) NEW_NODE(NODE_COLON3,0,i,0)
    00436 #define NEW_DOT2(b,e) NEW_NODE(NODE_DOT2,b,e,0)
    00437 #define NEW_DOT3(b,e) NEW_NODE(NODE_DOT3,b,e,0)
    00438 #define NEW_SELF() NEW_NODE(NODE_SELF,0,0,0)
    00439 #define NEW_NIL() NEW_NODE(NODE_NIL,0,0,0)
    00440 #define NEW_TRUE() NEW_NODE(NODE_TRUE,0,0,0)
    00441 #define NEW_FALSE() NEW_NODE(NODE_FALSE,0,0,0)
    00442 #define NEW_ERRINFO() NEW_NODE(NODE_ERRINFO,0,0,0)
    00443 #define NEW_DEFINED(e) NEW_NODE(NODE_DEFINED,e,0,0)
    00444 #define NEW_PREEXE(b) NEW_SCOPE(b)
    00445 #define NEW_POSTEXE(b) NEW_NODE(NODE_POSTEXE,0,b,0)
    00446 #define NEW_BMETHOD(b) NEW_NODE(NODE_BMETHOD,0,0,b)
    00447 #define NEW_ATTRASGN(r,m,a) NEW_NODE(NODE_ATTRASGN,r,m,a)
    00448 #define NEW_PRELUDE(p,b) NEW_NODE(NODE_PRELUDE,p,b,0)
    00449 #define NEW_OPTBLOCK(a) NEW_NODE(NODE_OPTBLOCK,a,0,0)
    00450
    00451 VALUE rb_parser_new(void);
    00452 VALUE rb_parser_end_seen_p(VALUE);
    00453 VALUE rb_parser_encoding(VALUE);
    00454
    00455 NODE *rb_parser_compile_cstr(volatile VALUE, const char*, const char*, int, int);
    00456 NODE *rb_parser_compile_string(volatile VALUE, const char*, VALUE, int);
    00457 NODE *rb_parser_compile_file(volatile VALUE, const char*, VALUE, int);
    00458
    00459 NODE *rb_compile_cstr(const char*, const char*, int, int);
    00460 NODE *rb_compile_string(const char*, VALUE, int);
    00461 NODE *rb_compile_file(const char*, VALUE, int);
    00462
    00463 NODE *rb_node_newnode(enum node_type,VALUE,VALUE,VALUE);
    00464 NODE *rb_node_newnode_longlife(enum node_type,VALUE,VALUE,VALUE);
    00465
    00466 struct rb_global_entry {
    00467     struct rb_global_variable *var;
    00468     ID id;
    00469 };
    00470
    00471 struct rb_global_entry *rb_global_entry(ID);
    00472 VALUE rb_gvar_get(struct rb_global_entry *);
    00473 VALUE rb_gvar_set(struct rb_global_entry *, VALUE);
    00474 VALUE rb_gvar_defined(struct rb_global_entry *);
    00475
    00476 #if defined(__cplusplus)
    00477 #if 0
    00478 { /* satisfy cc-mode */
    00479 #endif
    00480 }  /* extern "C" { */
    00481 #endif
    00482
    00483 #endif /* RUBY_NODE_H */
    00484