def visit_node_and_children(node, &operator)
      # set the current node
      @lineage.push(node)
      # if depth-first, then visit the children before the current node
      visit_children(node, &operator) if depth_first?
      # apply the operator to the current node, if given
      result = @visited[node] = block_given? ? yield(node) : node
      logger.debug { "#{self} visited #{node.qp} with result #{result.qp}" } if @verbose
      # if not depth-first, then visit the children after the current node
      visit_children(node, &operator) unless depth_first?
      @lineage.pop
      # return the visit result
      result
    end
def visit_node_and_children(node, &operator)
      # set the current node
      @lineage.push(node)
      # if depth-first, then visit the children before the current node
      visit_children(node, &operator) if depth_first?
      # apply the operator to the current node, if given
      result = @visited[node] = block_given? ? yield(node) : node
      logger.debug { "#{self} visited #{node.qp} with result #{result.qp}" } if @verbose
      # if not depth-first, then visit the children after the current node
      visit_children(node, &operator) unless depth_first?
      @lineage.pop
      # return the visit result
      result
    end
Visits the given node and its children. If this visitor is #{depth_first?}, then the
 operator is applied to the children before the given node. Otherwise, the operator is
 applied to the children after the given node. The default operator returns the visited
 node itself.

 @param node the node to visit
 @yield (see #visit)
 @yieldparam (see #visit)