Class: StarlarkCompiler::AST::BinaryOperator

Inherits:
Node
  • Object
show all
Defined in:
lib/starlark_compiler/ast.rb

Direct Known Subclasses

PlusOperator

Constant Summary

Constants inherited from Node

Node::TYPE

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lhs, rhs, operator:) ⇒ BinaryOperator

Returns a new instance of BinaryOperator.



168
169
170
171
172
# File 'lib/starlark_compiler/ast.rb', line 168

def initialize(lhs, rhs, operator:)
  @lhs = node(lhs)
  @rhs = node(rhs)
  @operator = operator
end

Instance Attribute Details

#lhsObject (readonly)

Returns the value of attribute lhs.



167
168
169
# File 'lib/starlark_compiler/ast.rb', line 167

def lhs
  @lhs
end

#operatorObject (readonly)

Returns the value of attribute operator.



167
168
169
# File 'lib/starlark_compiler/ast.rb', line 167

def operator
  @operator
end

#rhsObject (readonly)

Returns the value of attribute rhs.



167
168
169
# File 'lib/starlark_compiler/ast.rb', line 167

def rhs
  @rhs
end