Class: Dentaku::AST::Combinator

Inherits:
Operation show all
Defined in:
lib/dentaku/ast/combinators.rb

Direct Known Subclasses

And, Or

Instance Attribute Summary

Attributes inherited from Operation

#left, #right

Instance Method Summary collapse

Methods inherited from Operation

#dependencies, right_associative?

Methods inherited from Node

arity, #dependencies, precedence

Constructor Details

#initializeCombinator

Returns a new instance of Combinator.



6
7
8
9
10
11
# File 'lib/dentaku/ast/combinators.rb', line 6

def initialize(*)
  super
  unless valid_node?(left) && valid_node?(right)
    fail ParseError, "#{ self.class } requires logical operands"
  end
end

Instance Method Details

#typeObject



13
14
15
# File 'lib/dentaku/ast/combinators.rb', line 13

def type
  :logical
end