Class: AbstractSyntaxTreeKit::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/astkit/node.rb,
lib/astkit/node/if.rb,
lib/astkit/node/or.rb,
lib/astkit/node/and.rb,
lib/astkit/node/for.rb,
lib/astkit/node/lit.rb,
lib/astkit/node/nil.rb,
lib/astkit/node/str.rb,
lib/astkit/node/args.rb,
lib/astkit/node/call.rb,
lib/astkit/node/case.rb,
lib/astkit/node/cvar.rb,
lib/astkit/node/defn.rb,
lib/astkit/node/defs.rb,
lib/astkit/node/dot2.rb,
lib/astkit/node/dot3.rb,
lib/astkit/node/dstr.rb,
lib/astkit/node/dsym.rb,
lib/astkit/node/dvar.rb,
lib/astkit/node/gvar.rb,
lib/astkit/node/hash.rb,
lib/astkit/node/iter.rb,
lib/astkit/node/ivar.rb,
lib/astkit/node/lvar.rb,
lib/astkit/node/next.rb,
lib/astkit/node/once.rb,
lib/astkit/node/redo.rb,
lib/astkit/node/self.rb,
lib/astkit/node/true.rb,
lib/astkit/node/when.rb,
lib/astkit/node/xstr.rb,
lib/astkit/node/alias.rb,
lib/astkit/node/array.rb,
lib/astkit/node/block.rb,
lib/astkit/node/break.rb,
lib/astkit/node/case2.rb,
lib/astkit/node/cdecl.rb,
lib/astkit/node/class.rb,
lib/astkit/node/const.rb,
lib/astkit/node/dasgn.rb,
lib/astkit/node/dregx.rb,
lib/astkit/node/dxstr.rb,
lib/astkit/node/evstr.rb,
lib/astkit/node/false.rb,
lib/astkit/node/fcall.rb,
lib/astkit/node/flip2.rb,
lib/astkit/node/flip3.rb,
lib/astkit/node/gasgn.rb,
lib/astkit/node/iasgn.rb,
lib/astkit/node/lasgn.rb,
lib/astkit/node/masgn.rb,
lib/astkit/node/match.rb,
lib/astkit/node/qcall.rb,
lib/astkit/node/retry.rb,
lib/astkit/node/scope.rb,
lib/astkit/node/splat.rb,
lib/astkit/node/super.rb,
lib/astkit/node/undef.rb,
lib/astkit/node/until.rb,
lib/astkit/node/vcall.rb,
lib/astkit/node/while.rb,
lib/astkit/node/yield.rb,
lib/astkit/node/colon2.rb,
lib/astkit/node/colon3.rb,
lib/astkit/node/cvasgn.rb,
lib/astkit/node/ensure.rb,
lib/astkit/node/kw_arg.rb,
lib/astkit/node/lambda.rb,
lib/astkit/node/match2.rb,
lib/astkit/node/match3.rb,
lib/astkit/node/module.rb,
lib/astkit/node/nbegin.rb,
lib/astkit/node/opcall.rb,
lib/astkit/node/rescue.rb,
lib/astkit/node/return.rb,
lib/astkit/node/sclass.rb,
lib/astkit/node/unless.rb,
lib/astkit/node/valias.rb,
lib/astkit/node/values.rb,
lib/astkit/node/zarray.rb,
lib/astkit/node/zsuper.rb,
lib/astkit/node/defined.rb,
lib/astkit/node/errinfo.rb,
lib/astkit/node/nth_ref.rb,
lib/astkit/node/resbody.rb,
lib/astkit/node/argspush.rb,
lib/astkit/node/attrasgn.rb,
lib/astkit/node/back_ref.rb,
lib/astkit/node/op_asgn1.rb,
lib/astkit/node/op_asgn2.rb,
lib/astkit/node/op_cdecl.rb,
lib/astkit/node/dasgn_curr.rb,
lib/astkit/node/op_asgn_or.rb,
lib/astkit/node/op_asgn_and.rb

Defined Under Namespace

Classes: ALIAS, AND, ARGS, ARGSPUSH, ARRAY, ATTRASGN, BACK_REF, BLOCK, BREAK, CALL, CASE, CASE2, CDECL, CLASS, COLON2, COLON3, CONST, CVAR, CVASGN, DASGN, DASGN_CURR, DEFINED, DEFN, DEFS, DOT2, DOT3, DREGX, DSTR, DSYM, DVAR, DXSTR, ENSURE, ERRINFO, EVSTR, FALSE, FCALL, FLIP2, FLIP3, FOR, GASGN, GVAR, HASH, IASGN, IF, ITER, IVAR, KW_ARG, LAMBDA, LASGN, LIT, LVAR, MASGN, MATCH, MATCH2, MATCH3, MODULE, NBEGIN, NEXT, NIL, NTH_REF, ONCE, OPCALL, OP_ASGN1, OP_ASGN2, OP_ASGN_AND, OP_ASGN_OR, OP_CDECL, OR, QCALL, REDO, RESBODY, RESCUE, RETRY, RETURN, SCLASS, SCOPE, SELF, SPLAT, STR, SUPER, TRUE, UNDEF, UNLESS, UNTIL, VALIAS, VALUES, VCALL, WHEN, WHILE, XSTR, YIELD, ZARRAY, ZSUPER

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ Node

Returns a new instance of Node.



5
6
7
8
9
10
11
12
# File 'lib/astkit/node.rb', line 5

def initialize(node)
  @type = node.type
  @children = node.children
  @first_column = node.first_column
  @first_lineno = node.first_lineno
  @last_column = node.last_column
  @last_lineno = node.last_lineno
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



3
4
5
# File 'lib/astkit/node/if.rb', line 3

def body
  @body
end

#childrenObject (readonly)

Returns the value of attribute children.



3
4
5
# File 'lib/astkit/node.rb', line 3

def children
  @children
end

#conditionObject (readonly)

Returns the value of attribute condition.



3
4
5
# File 'lib/astkit/node/if.rb', line 3

def condition
  @condition
end

#elsObject (readonly)

Returns the value of attribute els.



3
4
5
# File 'lib/astkit/node/if.rb', line 3

def els
  @els
end

#first_columnObject (readonly)

Returns the value of attribute first_column.



3
4
5
# File 'lib/astkit/node.rb', line 3

def first_column
  @first_column
end

#first_linenoObject (readonly)

Returns the value of attribute first_lineno.



3
4
5
# File 'lib/astkit/node.rb', line 3

def first_lineno
  @first_lineno
end

#last_columnObject (readonly)

Returns the value of attribute last_column.



3
4
5
# File 'lib/astkit/node.rb', line 3

def last_column
  @last_column
end

#last_linenoObject (readonly)

Returns the value of attribute last_lineno.



3
4
5
# File 'lib/astkit/node.rb', line 3

def last_lineno
  @last_lineno
end

#typeObject (readonly)

Returns the value of attribute type.



3
4
5
# File 'lib/astkit/node.rb', line 3

def type
  @type
end