Sha256: 2d40b09db57fa8e251afa210dc8464097ccb65de41b63d8bbf1ddcf3101e2dd9

Contents?: true

Size: 944 Bytes

Versions: 46

Compression:

Stored size: 944 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 end vertex (X.) as its head
    # and an item vertex as its tail

    # Responsibilities:
    # - To know the successor vertex (tail)
    class ReturnEdge < Edge
      attr_reader(:key)

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

      private

      def do_set_key(_thePredecessor, theSuccessor)
        tail_d_item = theSuccessor.dotted_item
        prefix = "RET_#{tail_d_item.production.object_id}_"
        @key = prefix + tail_d_item.prev_position.to_s
      end
    end # class
  end # module
end # module

# End of file

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
rley-0.7.03 lib/rley/gfg/return_edge.rb
rley-0.7.02 lib/rley/gfg/return_edge.rb
rley-0.7.01 lib/rley/gfg/return_edge.rb
rley-0.7.00 lib/rley/gfg/return_edge.rb
rley-0.6.09 lib/rley/gfg/return_edge.rb
rley-0.6.08 lib/rley/gfg/return_edge.rb
rley-0.6.07 lib/rley/gfg/return_edge.rb
rley-0.6.06 lib/rley/gfg/return_edge.rb
rley-0.6.05 lib/rley/gfg/return_edge.rb
rley-0.6.04 lib/rley/gfg/return_edge.rb
rley-0.6.03 lib/rley/gfg/return_edge.rb
rley-0.6.02 lib/rley/gfg/return_edge.rb
rley-0.6.01 lib/rley/gfg/return_edge.rb
rley-0.6.00 lib/rley/gfg/return_edge.rb
rley-0.5.14 lib/rley/gfg/return_edge.rb
rley-0.5.13 lib/rley/gfg/return_edge.rb
rley-0.5.12 lib/rley/gfg/return_edge.rb
rley-0.5.11 lib/rley/gfg/return_edge.rb
rley-0.5.10 lib/rley/gfg/return_edge.rb
rley-0.5.09 lib/rley/gfg/return_edge.rb