Class: Omnium::Parser::AST::BinaryOperator
- Defined in:
- lib/omnium/parser/ast/binary_operator.rb
Overview
Binary operator represents the four binary operations: add, subtract, multiply and divide. @left and @right are the nodes representing operands (i.e. Number).
Instance Attribute Summary collapse
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#operator ⇒ Object
readonly
Returns the value of attribute operator.
-
#right ⇒ Object
readonly
Returns the value of attribute right.
Instance Method Summary collapse
-
#initialize(left, operator, right) ⇒ BinaryOperator
constructor
A new instance of BinaryOperator.
Constructor Details
#initialize(left, operator, right) ⇒ BinaryOperator
Returns a new instance of BinaryOperator.
12 13 14 15 16 |
# File 'lib/omnium/parser/ast/binary_operator.rb', line 12 def initialize(left, operator, right) @left = left @operator = operator @right = right end |
Instance Attribute Details
#left ⇒ Object (readonly)
Returns the value of attribute left.
10 11 12 |
# File 'lib/omnium/parser/ast/binary_operator.rb', line 10 def left @left end |
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
10 11 12 |
# File 'lib/omnium/parser/ast/binary_operator.rb', line 10 def operator @operator end |
#right ⇒ Object (readonly)
Returns the value of attribute right.
10 11 12 |
# File 'lib/omnium/parser/ast/binary_operator.rb', line 10 def right @right end |