Class: Omnium::Parser::AST::Assignment
- 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
-
#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) ⇒ Assignment
constructor
A new instance of Assignment.
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
#left ⇒ Object (readonly)
Returns the value of attribute left.
10 11 12 |
# File 'lib/omnium/parser/ast/assignment.rb', line 10 def left @left end |
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
10 11 12 |
# File 'lib/omnium/parser/ast/assignment.rb', line 10 def operator @operator end |
#right ⇒ Object (readonly)
Returns the value of attribute right.
10 11 12 |
# File 'lib/omnium/parser/ast/assignment.rb', line 10 def right @right end |