Class: Waxeye::AST

Inherits:
Object
  • Object
show all
Defined in:
lib/waxeye.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, children, pos) ⇒ AST

Returns a new instance of AST.



68
69
70
71
72
# File 'lib/waxeye.rb', line 68

def initialize(type, children, pos)
  @type = type
  @children = children
  @pos = pos
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



67
68
69
# File 'lib/waxeye.rb', line 67

def children
  @children
end

#posObject (readonly)

Returns the value of attribute pos.



67
68
69
# File 'lib/waxeye.rb', line 67

def pos
  @pos
end

#typeObject (readonly)

Returns the value of attribute type.



67
68
69
# File 'lib/waxeye.rb', line 67

def type
  @type
end

Instance Method Details

#to_sObject



80
81
82
83
84
# File 'lib/waxeye.rb', line 80

def to_s()
  acc = []
  to_s_iter(self, [0], acc)
  acc.to_s
end

#to_s_sexprObject



74
75
76
77
78
# File 'lib/waxeye.rb', line 74

def to_s_sexpr()
  acc = []
  display_sexpr_iter(self, acc)
  acc.to_s
end