def visit_leaf(leaf_node)
      parent = @stack.last
      if @delegate
        @delegate.visit_leaf(leaf_node) if @delegate.respond_to? :visit_leaf
      else
        @on_visit_leaf_node_blocks.each do |b|
          if b.arity == 1
            b.call(leaf_node)
          elsif b.arity == 2
            b.call(leaf_node, parent)
          end
        end
      end
    end
def visit_leaf(leaf_node)
      parent = @stack.last
      if @delegate
        @delegate.visit_leaf(leaf_node) if @delegate.respond_to? :visit_leaf
      else
        @on_visit_leaf_node_blocks.each do |b|
          if b.arity == 1
            b.call(leaf_node)
          elsif b.arity == 2
            b.call(leaf_node, parent)
          end
        end
      end
    end
called when visit leaf node