Sha256: bc20c363a615f0fc9da1fa526263d0f1be19c80bd4e87bf7ec1050dda0eb8ad7

Contents?: true

Size: 1.07 KB

Versions: 12

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true

require_relative 'vertex'

module Rley # This module is used as a namespace
  module GFG # This module is used as a namespace
    # Abstract class.
    # Represents a specialized vertex in a grammar flow graph
    # that is associated to a given non-terminal symbol and
    # that may have in-degree or out-degree > 1
    # Responsibilities (in addition to inherited ones):
    # - Know its related non-terminal symbol
    class NonTerminalVertex < Vertex
      # The non-terminal symbol associated to the vertex
      # @return [Syntax::NonTerminal]
      attr_reader :non_terminal

      # Constructor to specialize in subclasses.
      # @param aNonTerminal [Syntax::NonTerminal]
      def initialize(aNonTerminal)
        super()
        @non_terminal = aNonTerminal
      end

      protected

      # Validation method for adding an outgoing edge to the vertex.
      # A start vertex may accept an indegree and outdegree greater than one
      def check_add_edge(anEdge)
        anEdge
      end
    end # class
  end # module
end # module

# End of file

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rley-0.8.13 lib/rley/gfg/non_terminal_vertex.rb
rley-0.8.11 lib/rley/gfg/non_terminal_vertex.rb
rley-0.8.10 lib/rley/gfg/non_terminal_vertex.rb
rley-0.8.09 lib/rley/gfg/non_terminal_vertex.rb
rley-0.8.08 lib/rley/gfg/non_terminal_vertex.rb
rley-0.8.06 lib/rley/gfg/non_terminal_vertex.rb
rley-0.8.05 lib/rley/gfg/non_terminal_vertex.rb
rley-0.8.03 lib/rley/gfg/non_terminal_vertex.rb
rley-0.8.02 lib/rley/gfg/non_terminal_vertex.rb
rley-0.8.01 lib/rley/gfg/non_terminal_vertex.rb
rley-0.8.00 lib/rley/gfg/non_terminal_vertex.rb
rley-0.7.08 lib/rley/gfg/non_terminal_vertex.rb