Class Statement
java.lang.Object
de.fraunhofer.aisec.cpg.graph.Node
de.fraunhofer.aisec.cpg.graph.statements.Statement
- All Implemented Interfaces:
DeclarationHolder,Persistable,IVisitable<de.fraunhofer.aisec.cpg.graph.Node>
- Direct Known Subclasses:
AssertStatement,BreakStatement,CaseStatement,CatchClause,CompoundStatement,ContinueStatement,DeclarationStatement,DefaultStatement,DoStatement,EmptyStatement,Expression,ForEachStatement,ForStatement,GotoStatement,IfStatement,LabelStatement,ReturnStatement,SwitchStatement,SynchronizedStatement,TryStatement,WhileStatement
public class Statement extends de.fraunhofer.aisec.cpg.graph.Node implements DeclarationHolder
A statement.
-
Nested Class Summary
Nested classes/interfaces inherited from class de.fraunhofer.aisec.cpg.graph.Node
de.fraunhofer.aisec.cpg.graph.Node.Companion -
Field Summary
Fields Modifier and Type Field Description protected java.util.List<de.fraunhofer.aisec.cpg.graph.edge.PropertyEdge<VariableDeclaration>>localsA list of local variables associated to this statement, defined by theirVariableDeclarationextracted from Block because for, while, if, switch can declare locals in their condition or initializersFields inherited from class de.fraunhofer.aisec.cpg.graph.Node
Companion, EMPTY_NAME, TO_STRING_STYLE -
Constructor Summary
Constructors Constructor Description Statement() -
Method Summary
Modifier and Type Method Description voidaddDeclaration(@NonNull Declaration declaration)Adds the specified declaration to this declaration holder.booleanequals(java.lang.Object o)java.util.List<Declaration>getDeclarations()java.util.List<VariableDeclaration>getLocals()java.util.List<de.fraunhofer.aisec.cpg.graph.edge.PropertyEdge<VariableDeclaration>>getLocalsPropertyEdge()inthashCode()voidremoveLocal(VariableDeclaration variableDeclaration)voidsetLocals(java.util.List<VariableDeclaration> locals)Methods inherited from class de.fraunhofer.aisec.cpg.graph.Node
addAnnotations, addNextDFG, addNextEOG, addPrevDFG, addPrevEOG, addTypedef, clearNextEOG, disconnectFromGraph, getAnnotations, getArgumentIndex, getAstChildren, getCode, getComment, getFile, getId, getLocation, getName, getNextDFG, getNextEOG, getNextEOGEdges, getPrevDFG, getPrevEOG, getPrevEOGEdges, getTypedefs, isImplicit, isInferred, removeNextDFG, removePrevDFG, removePrevEOGEntry, setAnnotations, setArgumentIndex, setCode, setComment, setFile, setId, setImplicit, setInferred, setLocation, setName, setNextDFG, setNextEOG, setNextEOGEdges, setPrevDFG, setPrevEOG, setPrevEOGEdges, setTypedefs, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface de.fraunhofer.aisec.cpg.graph.DeclarationHolder
addIfNotContains, addIfNotContains, addIfNotContainsMethods inherited from interface de.fraunhofer.aisec.cpg.processing.IVisitable
accept
-
Field Details
-
locals
protected java.util.List<de.fraunhofer.aisec.cpg.graph.edge.PropertyEdge<VariableDeclaration>> localsA list of local variables associated to this statement, defined by theirVariableDeclarationextracted from Block because for, while, if, switch can declare locals in their condition or initializers
-
-
Constructor Details
-
Statement
public Statement()
-
-
Method Details
-
getLocals
-
getLocalsPropertyEdge
public java.util.List<de.fraunhofer.aisec.cpg.graph.edge.PropertyEdge<VariableDeclaration>> getLocalsPropertyEdge() -
removeLocal
-
setLocals
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equalsin classde.fraunhofer.aisec.cpg.graph.Node
-
hashCode
public int hashCode()- Overrides:
hashCodein classde.fraunhofer.aisec.cpg.graph.Node
-
addDeclaration
Description copied from interface:DeclarationHolderAdds the specified declaration to this declaration holder. Ideally, the declaration holder should use theDeclarationHolder.addIfNotContains(Collection, Declaration)method to consistently add declarations.- Specified by:
addDeclarationin interfaceDeclarationHolder- Parameters:
declaration- the declaration
-
getDeclarations
- Specified by:
getDeclarationsin interfaceDeclarationHolder
-