Class: Rley::GFG::ScanEdge
Overview
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
Instance Attribute Summary collapse
-
#terminal ⇒ Object
readonly
The terminal symbol expected from the input stream.
Attributes inherited from Edge
Instance Method Summary collapse
-
#initialize(thePredecessor, theSuccessor, aTerminal) ⇒ ScanEdge
constructor
A new instance of ScanEdge.
- #to_s ⇒ Object
Methods inherited from Edge
Constructor Details
#initialize(thePredecessor, theSuccessor, aTerminal) ⇒ ScanEdge
Returns a new instance of ScanEdge.
15 16 17 18 |
# File 'lib/rley/gfg/scan_edge.rb', line 15 def initialize(thePredecessor, theSuccessor, aTerminal) super(thePredecessor, theSuccessor) @terminal = aTerminal end |
Instance Attribute Details
#terminal ⇒ Object (readonly)
The terminal symbol expected from the input stream
13 14 15 |
# File 'lib/rley/gfg/scan_edge.rb', line 13 def terminal @terminal end |
Instance Method Details
#to_s ⇒ Object
20 21 22 |
# File 'lib/rley/gfg/scan_edge.rb', line 20 def to_s " -#{terminal}-> #{successor.label}" end |