Class ControlFlowExtractor
- java.lang.Object
-
- it.unive.lisa.program.cfg.controlFlow.ControlFlowExtractor
-
public class ControlFlowExtractor extends java.lang.Object
An extractor ofControlFlowStructure
s fromCFG
s. It usesDominators
to extractLoop
s, and a graph visiting heuristics to findIfThenElse
s.
Extracting control flows should be a last-resort: if the cfg contains arbitrary jumps (likegoto, break, continue, ...
) the aforementioned algorithms will fail to properly infer some of the structures. It is always preferable to have frontends define each structure relying on source code information.
-
-
Constructor Summary
Constructors Constructor Description ControlFlowExtractor(CFG target)
Builds the extractor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<ControlFlowStructure>
extract()
Runs the algorithms for extractingControlFlowStructure
s.
-
-
-
Constructor Detail
-
ControlFlowExtractor
public ControlFlowExtractor(CFG target)
Builds the extractor.- Parameters:
target
- the cfg whose control flows structures are to be extracted
-
-
Method Detail
-
extract
public java.util.Collection<ControlFlowStructure> extract()
Runs the algorithms for extractingControlFlowStructure
s.- Returns:
- the collection of extracted structures
-
-