Class: Logicality::Parser::Ast::BinaryOperatorNode

Inherits:
Node
  • Object
show all
Defined in:
lib/logicality/parser/ast/binary_operator_node.rb

Overview

A binary operator contains two children (left and right) nodes.

Instance Attribute Summary collapse

Attributes inherited from Node

#name, #token

Instance Method Summary collapse

Methods inherited from Node

#to_s

Constructor Details

#initialize(left, token, right) ⇒ BinaryOperatorNode

Returns a new instance of BinaryOperatorNode.



17
18
19
20
21
22
23
# File 'lib/logicality/parser/ast/binary_operator_node.rb', line 17

def initialize(left, token, right)
  super(token)

  @name  = 'binary_operator_node'
  @left  = left
  @right = right
end

Instance Attribute Details

#leftObject (readonly)

Returns the value of attribute left.



15
16
17
# File 'lib/logicality/parser/ast/binary_operator_node.rb', line 15

def left
  @left
end

#rightObject (readonly)

Returns the value of attribute right.



15
16
17
# File 'lib/logicality/parser/ast/binary_operator_node.rb', line 15

def right
  @right
end