class YARP::BasicVisitor
A class that knows how to walk down the tree. None of the individual visit methods are implemented on this visitor, so it forces the consumer to implement each one that they need. For a default implementation that continues walking the tree, see the Visitor
class.
Public Instance Methods
visit(node)
click to toggle source
# File yarp.rb, line 210 def visit(node) node&.accept(self) end
visit_all(nodes)
click to toggle source
# File yarp.rb, line 214 def visit_all(nodes) nodes.map { |node| visit(node) } end
visit_child_nodes(node)
click to toggle source
# File yarp.rb, line 218 def visit_child_nodes(node) visit_all(node.child_nodes) end