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?, #next_symbol, #prev_symbol

Constructor Details

#initialize(aNonTerminal) ⇒ NonTerminalVertex

Constructor to specialize in subclasses.

Parameters:



18
19
20
21
# File 'lib/rley/gfg/non_terminal_vertex.rb', line 18

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

Instance Attribute Details

#non_terminalSyntax::NonTerminal (readonly)

The non-terminal symbol associated to the vertex

Returns:



14
15
16
# File 'lib/rley/gfg/non_terminal_vertex.rb', line 14

def non_terminal
  @non_terminal
end