Package de.fraunhofer.aisec.cpg.passes
Class ControlFlowGraphPass
- java.lang.Object
-
- de.fraunhofer.aisec.cpg.passes.ControlFlowGraphPass
-
- All Implemented Interfaces:
Pass,java.util.function.Consumer<TranslationResult>
public class ControlFlowGraphPass extends java.lang.Object implements Pass
Creates a simple control flow graph (CFG) based on AST.The CFG is a directed cyclic graph with Node representing statements and edges representing the program control flow.
- Return statements will have no successors.
- Branch statements (if/switch/exception traps) will have multiple successors.
- Simple statements will have their following statement as sole successor
- break / continue will create respective edges
-
-
Constructor Summary
Constructors Constructor Description ControlFlowGraphPass()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(TranslationResult t)voidaddTodo(int index, Statement... stmts)Adds a statement to this.remaining, omitting null.voidaddTodo(int index, java.util.List<Statement> stmts)voidcleanup()LanguageFrontendgetLang()We do not want the passes to depend on a language frontendvoidsetLang(LanguageFrontend lang)We do not want the passes to depend on a language frontend-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.fraunhofer.aisec.cpg.passes.Pass
createUnknownTranslationUnit
-
-
-
-
Method Detail
-
getLang
public LanguageFrontend getLang()
Description copied from interface:PassWe do not want the passes to depend on a language frontend
-
setLang
public void setLang(LanguageFrontend lang)
Description copied from interface:PassWe do not want the passes to depend on a language frontend
-
accept
public void accept(TranslationResult t)
- Specified by:
acceptin interfacejava.util.function.Consumer<TranslationResult>
-
addTodo
public void addTodo(int index, java.util.List<Statement> stmts)
-
addTodo
public void addTodo(int index, Statement... stmts)Adds a statement to this.remaining, omitting null.- Parameters:
index-stmts-
-
-