Class: Alf::Optimizer::Search

Inherits:
Algebra::Rewriter show all
Defined in:
lib/alf/optimizer.rb

Instance Method Summary collapse

Methods inherited from Algebra::Rewriter

#call, #not_supported, #on_leaf_operand, #on_missing, #on_shortcut

Methods included from Algebra::Visitor

#copy_and_apply

Constructor Details

#initialize(processor, interest) ⇒ Search


28
29
30
31
# File 'lib/alf/optimizer.rb', line 28

def initialize(processor, interest)
  @processor = processor
  @interest = interest
end

Instance Method Details

#apply(expr) ⇒ Object


33
34
35
36
37
38
39
# File 'lib/alf/optimizer.rb', line 33

def apply(expr)
  if @interest === expr
    @processor.call(expr, self)
  else
    super
  end
end