Module: Ducktape::Expression::BinaryOpExp

Included in:
IndexerExp, PropertyExp, QualifiedExp
Defined in:
lib/ducktape/expression/binary_op_exp.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#leftObject (readonly)

Returns the value of attribute left.



4
5
6
# File 'lib/ducktape/expression/binary_op_exp.rb', line 4

def left
  @left
end

#ownerObject

Returns the value of attribute owner.



5
6
7
# File 'lib/ducktape/expression/binary_op_exp.rb', line 5

def owner
  @owner
end

#rightObject (readonly)

Returns the value of attribute right.



4
5
6
# File 'lib/ducktape/expression/binary_op_exp.rb', line 4

def right
  @right
end

Instance Method Details

#bind(src, type, qual = nil, root = src) ⇒ Object



15
16
17
18
19
# File 'lib/ducktape/expression/binary_op_exp.rb', line 15

def bind(src, type, qual = nil, root = src)
  unbind
  lsrc = left.bind(src, :path, qual, root)
  right.bind(lsrc, type, self.class, root)
end

#initialize(left, right) ⇒ Object



7
8
9
# File 'lib/ducktape/expression/binary_op_exp.rb', line 7

def initialize(left, right)
  @left, @right = left, right
end

#rightmostObject



27
28
29
# File 'lib/ducktape/expression/binary_op_exp.rb', line 27

def rightmost
  @right.rightmost
end

#unbindObject



21
22
23
24
25
# File 'lib/ducktape/expression/binary_op_exp.rb', line 21

def unbind
  left.unbind
  right.unbind
  nil
end

#unparseObject



31
32
33
# File 'lib/ducktape/expression/binary_op_exp.rb', line 31

def unparse
  "#{left.unparse}#{self.class.instance_variable_get(:@op)}#{right.unparse}"
end

#valueObject



35
36
37
# File 'lib/ducktape/expression/binary_op_exp.rb', line 35

def value
  right.value
end

#value=(v) ⇒ Object



39
40
41
# File 'lib/ducktape/expression/binary_op_exp.rb', line 39

def value=(v)
  right.value = v
end