Class: TPPlus::Nodes::SetNode

Inherits:
Object
  • Object
show all
Defined in:
lib/tp_plus/nodes/set_node.rb

Instance Method Summary collapse

Constructor Details

#initialize(type, target, value) ⇒ SetNode

Returns a new instance of SetNode.



4
5
6
7
8
# File 'lib/tp_plus/nodes/set_node.rb', line 4

def initialize(type, target, value)
  @type   = type
  @target = target
  @value  = value
end

Instance Method Details

#eval(context) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/tp_plus/nodes/set_node.rb', line 10

def eval(context)
  case @type
  when "set_uframe"
    "UFRAME[#{@target.eval(context)}]=#{@value.eval(context)}"
  when "set_skip_condition"
    "SKIP CONDITION #{@value.eval(context, disable_mixed_logic: true)}"
  else
    raise "Unsupported FANUC setter"
  end
end