Class: Node::CLASS

Inherits:
Node show all
Defined in:
ext/nodeinfo.c,
ext/cached/ruby-1.6.3/nodeinfo.c,
ext/cached/ruby-1.6.4/nodeinfo.c,
ext/cached/ruby-1.6.5/nodeinfo.c,
ext/cached/ruby-1.6.7/nodeinfo.c,
ext/cached/ruby-1.6.8/nodeinfo.c,
ext/cached/ruby-1.8.0/nodeinfo.c,
ext/cached/ruby-1.8.1/nodeinfo.c,
ext/cached/ruby-1.8.2/nodeinfo.c,
ext/cached/ruby-1.8.3/nodeinfo.c,
ext/cached/ruby-1.8.4/nodeinfo.c,
ext/cached/ruby-1.8.5/nodeinfo.c,
ext/cached/ruby-1.8.6/nodeinfo.c

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#[], #_dump, _load, #address, #as_code, #as_expression, #as_paren_expression, #bytecode_compile, compile_string, define_code, define_expression, #eval, #flags, #inspect, #members, #nd_file, #nd_line, #nd_type, #pretty_print, #tree

Class Method Details

.membersObject

Return an array of strings containing the names of the node class’s members.



2076
2077
2078
2079
# File 'ext/nodeinfo.c', line 2076

VALUE node_s_members(VALUE klass)
{
  return rb_iv_get(klass, "__member__");
}

Instance Method Details

#bodyObject

Return the Node’s body member. The return type is either a Node or an Object.



1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
# File 'ext/nodeinfo.c', line 1524

static VALUE node_body(VALUE self)
{
  NODE * n;
  Data_Get_Struct(self, NODE, n);

  if(TYPE(n->nd_body) == T_NODE)
  {
    return wrap_node((NODE *)n->nd_body);
  }
  else
  {
    return (VALUE)n->nd_body;
  }
}

#cnameObject

Return the Node’s cname member. The return type is a Symbol.



1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
# File 'ext/cached/ruby-1.6.3/nodeinfo.c', line 1593

static VALUE node_cname(VALUE self)
{
  NODE * n;
  Data_Get_Struct(self, NODE, n);
  if(n->nd_cname == 0)
  {
    rb_raise(
        rb_eRuntimeError,
        "Invalid ID for cname (node type=%d)",
        nd_type(n));
  }
  return ID2SYM(n->nd_cname);
}

#cpathObject

Return the Node’s cpath member. The return type is either a Node or an Object.



1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
# File 'ext/nodeinfo.c', line 1608

static VALUE node_cpath(VALUE self)
{
  NODE * n;
  Data_Get_Struct(self, NODE, n);

  if(TYPE(n->nd_cpath) == T_NODE)
  {
    return wrap_node((NODE *)n->nd_cpath);
  }
  else
  {
    return (VALUE)n->nd_cpath;
  }
}

#superObject

Return the Node’s super member. The return type is either a Node or an Object.



1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
# File 'ext/nodeinfo.c', line 1976

static VALUE node_super(VALUE self)
{
  NODE * n;
  Data_Get_Struct(self, NODE, n);

  if(TYPE(n->nd_super) == T_NODE)
  {
    return wrap_node((NODE *)n->nd_super);
  }
  else
  {
    return (VALUE)n->nd_super;
  }
}