Sha256: f9276656821cb35c484dae5b00fd55c054398d222ce7dc5b27cee462bb974f00

Contents?: true

Size: 717 Bytes

Versions: 4

Compression:

Stored size: 717 Bytes

Contents

# frozen_string_literal: true

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 is taken as a consequence of a scan rule.
    # Responsibilities:
    # - To know the successor vertex
    class ScanEdge < Edge
      # The terminal symbol expected from the input stream
      attr_reader :terminal

      def initialize(thePredecessor, theSuccessor, aTerminal)
        super(thePredecessor, theSuccessor)
        @terminal = aTerminal
      end

      def to_s()
        " -#{terminal}-> #{successor.label}"
      end
    end # class
  end # module
end # module

# End of file

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rley-0.7.07 lib/rley/gfg/scan_edge.rb
rley-0.7.06 lib/rley/gfg/scan_edge.rb
rley-0.7.05 lib/rley/gfg/scan_edge.rb
rley-0.7.04 lib/rley/gfg/scan_edge.rb