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
Constructor Details
#initialize(thePredecessor, theSuccessor, aTerminal) ⇒ ScanEdge
Returns a new instance of ScanEdge.
13 14 15 16 |
# File 'lib/rley/gfg/scan_edge.rb', line 13 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
11 12 13 |
# File 'lib/rley/gfg/scan_edge.rb', line 11 def terminal @terminal end |
Instance Method Details
#to_s ⇒ Object
18 19 20 |
# File 'lib/rley/gfg/scan_edge.rb', line 18 def to_s() " -#{terminal}-> #{successor.label}" end |