class LeafCountVisitor

Public Class Methods

new() click to toggle source
Calls superclass method BaseVisitor::new
# File lib/visitor/leaf_count_visitor.rb, line 4
def initialize
  super
end

Public Instance Methods

postVisit(node) click to toggle source
# File lib/visitor/leaf_count_visitor.rb, line 8
def postVisit(node)
  if (node.children != nil) then
    node.children.values.each do |child|
      node.leafCount += child.leafCount
    end
  end
end