Sha256: e3a43ebb1a474aabe06a08507328ec5abbd669686f31e2f8f41d43a55aa07128
Contents?: true
Size: 781 Bytes
Versions: 14
Compression:
Stored size: 781 Bytes
Contents
module Antlr4::Runtime class AbstractParseTreeVisitor def visit(tree) tree.accept(self) end def visit_children(node) result = default_result n = node.child_count i = 0 while i < n break unless should_visit_next_child(node, result) c = node.child_at(i) child_result = c.accept(self) result = aggregate_result(result, child_result) i += 1 end result end def visit_terminal(_node) default_result end def visit_error_node(_node) default_result end def default_result nil end def aggregate_result(_aggregate, next_result) next_result end def should_visit_next_child(_node, _current_result) true end end end
Version data entries
14 entries across 14 versions & 1 rubygems