Sha256: cd8e82d12e6aa4c41ef6bb36a1a8d8aabf0eaf4e93f94f9bd9af40f93cad689e

Contents?: true

Size: 727 Bytes

Versions: 6

Compression:

Stored size: 727 Bytes

Contents

module Furnace::CFG
  class Edge
    attr_accessor :source_operation, :source_label, :target_label

    def initialize(cfg, source_operation, source_label, target_label)
      @cfg, @source_operation, @source_label, @target_label =
          cfg, source_operation, source_label, target_label
    end

    def source
      @cfg.find_node(@source_label)
    end

    def target
      @cfg.find_node(@target_label) if @target_label
    end

    def source=(node)
      @source_label = node.label
    end

    def target=(node)
      if node
        @target_label = node.label
      else
        @target_label = nil
      end
    end

    def inspect
      "<#{@source_label.inspect} -> #{@target_label.inspect}>"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
furnace-0.0.8 lib/furnace/cfg/edge.rb
furnace-0.0.7 lib/furnace/cfg/edge.rb
furnace-0.0.6 lib/furnace/cfg/edge.rb
furnace-0.0.4 lib/furnace/cfg/edge.rb
furnace-0.0.3 lib/furnace/cfg/edge.rb
furnace-0.0.2 lib/furnace/cfg/edge.rb