Module: TreeStack::TreeElement

Included in:
Leaf, Node
Defined in:
lib/pseudohiki/treestack.rb

Overview

a class that includes NodeType is expected to have #push method to include child nodes, and a class that includes LeafType module is expected to have #concat method.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#depthObject

Returns the value of attribute depth.



12
13
14
# File 'lib/pseudohiki/treestack.rb', line 12

def depth
  @depth
end

Instance Method Details

#accept(visitor, memo = nil) ⇒ Object



14
15
16
# File 'lib/pseudohiki/treestack.rb', line 14

def accept(visitor, memo=nil)
  visitor.visit(self, memo)
end