Class: Rley::GFG::GrmFlowGraph
- Inherits:
-
Object
- Object
- Rley::GFG::GrmFlowGraph
- Defined in:
- lib/rley/gfg/grm_flow_graph.rb
Overview
TODO: add definition
Instance Attribute Summary collapse
-
#end_vertex_for ⇒ Object
readonly
A Hash with pairs of the form: non-terminal symbol => end node.
-
#start_vertex ⇒ Object
readonly
The vertex marked as start node of the graph.
-
#start_vertex_for ⇒ Object
readonly
A Hash with pairs of the form: non-terminal symbol => start node.
-
#vertices ⇒ Object
readonly
The set of all vertices in the graph.
Instance Method Summary collapse
-
#find_vertex(aVertexLabel) ⇒ Object
Return the vertex with given vertex label.
-
#initialize(theDottedItems) ⇒ GrmFlowGraph
constructor
A new instance of GrmFlowGraph.
Constructor Details
#initialize(theDottedItems) ⇒ GrmFlowGraph
Returns a new instance of GrmFlowGraph.
26 27 28 29 30 31 32 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 26 def initialize(theDottedItems) @vertices = [] @start_vertex_for = {} @end_vertex_for = {} build_graph(theDottedItems) end |
Instance Attribute Details
#end_vertex_for ⇒ Object (readonly)
A Hash with pairs of the form: non-terminal symbol => end node
24 25 26 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 24 def end_vertex_for @end_vertex_for end |
#start_vertex ⇒ Object (readonly)
The vertex marked as start node of the graph
18 19 20 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 18 def start_vertex @start_vertex end |
#start_vertex_for ⇒ Object (readonly)
A Hash with pairs of the form: non-terminal symbol => start node
21 22 23 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 21 def start_vertex_for @start_vertex_for end |
#vertices ⇒ Object (readonly)
The set of all vertices in the graph
15 16 17 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 15 def vertices @vertices end |
Instance Method Details
#find_vertex(aVertexLabel) ⇒ Object
Return the vertex with given vertex label.
35 36 37 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 35 def find_vertex(aVertexLabel) vertices.find { |a_vertex| a_vertex.label == aVertexLabel } end |