Class: RDG::Control::If

Inherits:
Analysis::Propagater show all
Defined in:
lib/rdg/control/if.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

#end_nodesObject



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

def end_nodes
  if @consequences.size == 1
    [@predicate, @consequences.first]
  else
    @consequences
  end
end

#internal_flow_edgesObject



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

def internal_flow_edges
  @consequences.map { |consequence| [@predicate, consequence] }
end

#prepareObject



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

def prepare
  @predicate, *@consequences = children.reject(&:empty?)
end

#start_nodeObject



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

def start_node
  @predicate
end