Class: Rley::GFG::NonTerminalVertex

Inherits:
Vertex
  • Object
show all
Defined in:
lib/rley/gfg/non_terminal_vertex.rb

Overview

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

Direct Known Subclasses

EndVertex, StartVertex

Instance Attribute Summary collapse

Attributes inherited from Vertex

#edges

Instance Method Summary collapse

Methods inherited from Vertex

#add_edge, #complete?, #inspect, #next_symbol, #prev_symbol, #selfie

Constructor Details

#initialize(aNonTerminal) ⇒ NonTerminalVertex

Constructor to specialize in subclasses.

Parameters:



20
21
22
23
# File 'lib/rley/gfg/non_terminal_vertex.rb', line 20

def initialize(aNonTerminal)
  super()
  @non_terminal = aNonTerminal
end

Instance Attribute Details

#non_terminalSyntax::NonTerminal (readonly)

The non-terminal symbol associated to the vertex

Returns:



16
17
18
# File 'lib/rley/gfg/non_terminal_vertex.rb', line 16

def non_terminal
  @non_terminal
end