class SyntaxTree::Search

subtree of an AST.
Provides an interface for searching for a pattern of nodes against a

def initialize(pattern)

def initialize(pattern)
  @pattern = pattern
end

def scan(root)

def scan(root)
  return to_enum(__method__, root) unless block_given?
  queue = [root]
  until queue.empty?
    node = queue.shift
    next unless node
    yield node if pattern.call(node)
    queue += node.child_nodes
  end
end