Class: RDG::Control::When

Inherits:
Analysis::Propagater show all
Defined in:
lib/rdg/control/when.rb

Instance Method Summary collapse

Methods inherited from Analysis::Propagater

#analyse

Methods inherited from Analysis::Analyser

#initialize, register_analyser, register_default_analyser

Constructor Details

This class inherits a constructor from RDG::Analysis::Analyser

Instance Method Details

#internal_flow_edgesObject



12
13
14
# File 'lib/rdg/control/when.rb', line 12

def internal_flow_edges
  [[@test, @action]]
end

#prepareObject



8
9
10
# File 'lib/rdg/control/when.rb', line 8

def prepare
  @test, @action = children
end

#propogate_outgoing_flowObject



20
21
22
23
24
# File 'lib/rdg/control/when.rb', line 20

def propogate_outgoing_flow
  successors = graph.each_successor(@ast_node).to_a
  graph.add_edge(@test, successors.first)
  graph.add_edge(@action, successors.last)
end

#start_nodeObject



16
17
18
# File 'lib/rdg/control/when.rb', line 16

def start_node
  @test
end