class TPPlus::Nodes::IONode

Attributes

comment[RW]
id[R]

Public Class Methods

new(type, id) click to toggle source
# File lib/tp_plus/nodes/io_node.rb, line 6
def initialize(type, id)
  @type    = type
  @id      = id.to_i
  @comment = ""
end

Public Instance Methods

eval(context, options={}) click to toggle source
# File lib/tp_plus/nodes/io_node.rb, line 20
def eval(context, options={})
  s = result

  if options[:disable_mixed_logic]
    s = "#{s}=ON"
  end

  options[:force_parens] ? "(#{s})" : s
end
requires_mixed_logic?(context) click to toggle source
# File lib/tp_plus/nodes/io_node.rb, line 12
def requires_mixed_logic?(context)
  ["F","SO","SI","DI"].include?(@type) ? true : false
end
result() click to toggle source
# File lib/tp_plus/nodes/io_node.rb, line 16
def result
  "#{@type}[#{@id}:#{@comment}]"
end