Class: RDG::CFG::BiDiDirectedAdjacencyGraph

Inherits:
RGL::DirectedAdjacencyGraph
  • Object
show all
Defined in:
lib/rdg/cfg.rb

Instance Method Summary collapse

Instance Method Details

#each_predecessor(vertex, &block) ⇒ Object



67
68
69
# File 'lib/rdg/cfg.rb', line 67

def each_predecessor(vertex, &block)
  each_vertex.select { |v| each_adjacent(v).include?(vertex) }.each(&block)
end

#each_successor(vertex, &block) ⇒ Object



71
72
73
# File 'lib/rdg/cfg.rb', line 71

def each_successor(vertex, &block)
  each_adjacent(vertex, &block) if has_vertex?(vertex)
end