Class: RLSL::Prism::IR::Ternary

Inherits:
Node
  • Object
show all
Defined in:
lib/rlsl/prism/ir/expressions.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_expr, else_expr, type = nil) ⇒ Ternary

Returns a new instance of Ternary.



138
139
140
141
142
143
144
# File 'lib/rlsl/prism/ir/expressions.rb', line 138

def initialize(condition, then_expr, else_expr, type = nil)
  super()
  @condition = condition
  @then_expr = then_expr
  @else_expr = else_expr
  @type = type
end

Instance Attribute Details

#conditionObject (readonly)

Returns the value of attribute condition.



134
135
136
# File 'lib/rlsl/prism/ir/expressions.rb', line 134

def condition
  @condition
end

#else_exprObject (readonly)

Returns the value of attribute else_expr.



134
135
136
# File 'lib/rlsl/prism/ir/expressions.rb', line 134

def else_expr
  @else_expr
end

#then_exprObject (readonly)

Returns the value of attribute then_expr.



134
135
136
# File 'lib/rlsl/prism/ir/expressions.rb', line 134

def then_expr
  @then_expr
end