Class: Omnium::Parser::AST::Assignment

Inherits:
Base
  • Object
show all
Defined in:
lib/omnium/parser/ast/assignment.rb

Overview

This is an assignment statement, for example ‘x := 5’ or ‘y := x’. @left is a reference to the variable node and @right is a reference to the node returned by Parser::Core#expr

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(left, operator, right) ⇒ Assignment

Returns a new instance of Assignment.



12
13
14
15
16
# File 'lib/omnium/parser/ast/assignment.rb', line 12

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

Instance Attribute Details

#leftObject (readonly)

Returns the value of attribute left.



10
11
12
# File 'lib/omnium/parser/ast/assignment.rb', line 10

def left
  @left
end

#operatorObject (readonly)

Returns the value of attribute operator.



10
11
12
# File 'lib/omnium/parser/ast/assignment.rb', line 10

def operator
  @operator
end

#rightObject (readonly)

Returns the value of attribute right.



10
11
12
# File 'lib/omnium/parser/ast/assignment.rb', line 10

def right
  @right
end