Class: Alf::Algebra::Compiler
- Inherits:
-
Object
- Object
- Alf::Algebra::Compiler
- Includes:
- Visitor
- Defined in:
- lib/alf/algebra/support/compiler.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#apply(expr, *args, &bl) ⇒ Object
copy all default implementation.
-
#call(expr, *args, &bl) ⇒ Object
public interface.
- #not_supported(expr, *args, &bl) ⇒ Object
- #on_missing(expr, *args, &bl) ⇒ Object
Methods included from Visitor
Instance Method Details
#apply(expr, *args, &bl) ⇒ Object
copy all default implementation
14 15 16 |
# File 'lib/alf/algebra/support/compiler.rb', line 14 def apply(expr, *args, &bl) send to_method_name(expr, "on_"), expr, *args, &bl end |
#call(expr, *args, &bl) ⇒ Object
public interface
8 9 10 |
# File 'lib/alf/algebra/support/compiler.rb', line 8 def call(expr, *args, &bl) apply(expr, *args, &bl) end |
#not_supported(expr, *args, &bl) ⇒ Object
22 23 24 |
# File 'lib/alf/algebra/support/compiler.rb', line 22 def not_supported(expr, *args, &bl) raise NotSupportedError, "Unexpected operand `#{expr}`" end |
#on_missing(expr, *args, &bl) ⇒ Object
18 19 20 |
# File 'lib/alf/algebra/support/compiler.rb', line 18 def on_missing(expr, *args, &bl) raise NotSupportedError, "Unable to compile `#{expr}`" end |