Class: SyntaxTree::Bf::Visitor
- Inherits:
-
Object
- Object
- SyntaxTree::Bf::Visitor
show all
- Defined in:
- lib/syntax_tree/bf/visitor.rb
Instance Method Summary
collapse
Instance Method Details
#visit(node) ⇒ Object
6
7
8
|
# File 'lib/syntax_tree/bf/visitor.rb', line 6
def visit(node)
node.accept(self)
end
|
#visit_all(nodes) ⇒ Object
10
11
12
|
# File 'lib/syntax_tree/bf/visitor.rb', line 10
def visit_all(nodes)
nodes.map { |node| visit(node) }
end
|
#visit_child_nodes(node) ⇒ Object
Also known as:
visit_root, visit_loop, visit_increment, visit_decrement, visit_shift_right, visit_shift_left, visit_input, visit_output
14
15
16
|
# File 'lib/syntax_tree/bf/visitor.rb', line 14
def visit_child_nodes(node)
visit_all(node.child_nodes)
end
|