Sha256: 28b6e7db8239efeeb1bde2f915ff3fd09e46f835b264e5321b774a0d75e9d2c6

Contents?: true

Size: 983 Bytes

Versions: 14

Compression:

Stored size: 983 Bytes

Contents

require_relative 'edge'

module Rley # This module is used as a namespace
  module GFG # This module is used as a namespace
    # Specialization of an edge in a grammar flow graph
    # that has a item vertex as its head (predecessor).
    # and a start vertex (.X) as its tail (successor).
    # Responsibilities:
    # - To know the successor vertex (tail)
    class CallEdge < Edge
      attr_reader(:key)

      # Pre-condition: thePredecessor is an ItemVertex
      # Pre-condition: theSuccessor is an StartVertex
      def initialize(thePredecessor, theSuccessor)
        super(thePredecessor, theSuccessor)
        do_set_key(thePredecessor, theSuccessor)
      end

      private

      def do_set_key(thePredecessor, _theSuccessor)
        tail_d_item = thePredecessor.dotted_item
        tail_production = tail_d_item.production
        @key = "CALL_#{tail_production.object_id}_#{tail_d_item.position}"
      end
    end # class
  end # module
end # module

# End of file

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rley-0.4.05 lib/rley/gfg/call_edge.rb
rley-0.4.04 lib/rley/gfg/call_edge.rb
rley-0.4.03 lib/rley/gfg/call_edge.rb
rley-0.4.02 lib/rley/gfg/call_edge.rb
rley-0.4.01 lib/rley/gfg/call_edge.rb
rley-0.4.00 lib/rley/gfg/call_edge.rb
rley-0.3.12 lib/rley/gfg/call_edge.rb
rley-0.3.11 lib/rley/gfg/call_edge.rb
rley-0.3.10 lib/rley/gfg/call_edge.rb
rley-0.3.09 lib/rley/gfg/call_edge.rb
rley-0.3.08 lib/rley/gfg/call_edge.rb
rley-0.3.07 lib/rley/gfg/call_edge.rb
rley-0.3.06 lib/rley/gfg/call_edge.rb
rley-0.3.05 lib/rley/gfg/call_edge.rb