Class: RLSL::Prism::IR::IfStatement

Inherits:
Node
  • Object
show all
Defined in:
lib/rlsl/prism/ir/control_flow.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#type

Instance Method Summary collapse

Methods inherited from Node

#accept, visits

Constructor Details

#initialize(condition, then_branch, else_branch = nil, type = nil) ⇒ IfStatement

Returns a new instance of IfStatement.



11
12
13
14
15
16
17
# File 'lib/rlsl/prism/ir/control_flow.rb', line 11

def initialize(condition, then_branch, else_branch = nil, type = nil)
  super()
  @condition = condition
  @then_branch = then_branch
  @else_branch = else_branch
  @type = type
end

Instance Attribute Details

#conditionObject (readonly)

Returns the value of attribute condition.



7
8
9
# File 'lib/rlsl/prism/ir/control_flow.rb', line 7

def condition
  @condition
end

#else_branchObject (readonly)

Returns the value of attribute else_branch.



7
8
9
# File 'lib/rlsl/prism/ir/control_flow.rb', line 7

def else_branch
  @else_branch
end

#then_branchObject (readonly)

Returns the value of attribute then_branch.



7
8
9
# File 'lib/rlsl/prism/ir/control_flow.rb', line 7

def then_branch
  @then_branch
end