Class: RMasm::BinaryExpression

Inherits:
ExpressionElement show all
Defined in:
lib/rmasm/expression.rb

Overview

Binary expression

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ExpressionOperations

#*, #+, #-, #/, #check_arg, #coerce

Constructor Details

#initialize(left, right, operator) ⇒ BinaryExpression

Returns a new instance of BinaryExpression.



67
68
69
70
71
# File 'lib/rmasm/expression.rb', line 67

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

Instance Attribute Details

#leftObject (readonly)

Returns the value of attribute left.



65
66
67
# File 'lib/rmasm/expression.rb', line 65

def left
  @left
end

#operatorObject (readonly)

Returns the value of attribute operator.



65
66
67
# File 'lib/rmasm/expression.rb', line 65

def operator
  @operator
end

#rightObject (readonly)

Returns the value of attribute right.



65
66
67
# File 'lib/rmasm/expression.rb', line 65

def right
  @right
end

Instance Method Details

#to_sObject



73
74
75
# File 'lib/rmasm/expression.rb', line 73

def to_s()
  "#{@left} #{@operator} #{@right}"
end