Class Statement
- java.lang.Object
-
- de.fraunhofer.aisec.cpg.graph.Node
-
- de.fraunhofer.aisec.cpg.graph.statements.Statement
-
- All Implemented Interfaces:
DeclarationHolder,Persistable,IVisitable<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 Node implements DeclarationHolder
A statement.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<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 Summary
Constructors Constructor Description Statement()
-
Method Summary
All Methods Instance Methods Concrete Methods 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<VariableDeclaration>getLocals()java.util.List<PropertyEdge<VariableDeclaration>>getLocalsPropertyEdge()inthashCode()voidremoveLocal(VariableDeclaration variableDeclaration)voidsetLocals(java.util.List<VariableDeclaration> locals)-
Methods inherited from class de.fraunhofer.aisec.cpg.graph.Node
addAnnotations, addNextCFG, addNextCFG, addNextDFG, addNextEOG, addPrevDFG, addPrevEOG, addTypedef, clearNextEOG, disconnectFromGraph, getAnnotations, getArgumentIndex, getCode, getFile, getId, getLocation, getName, getNextCFG, getNextDFG, getNextEOG, getNextEOGProperties, getNextEOGPropertyEdge, getPrevDFG, getPrevEOG, getPrevEOGProperties, getTypedefs, isDummy, isImplicit, removeNextDFG, removePrevDFG, removePrevEOGEntries, removePrevEOGEntry, setArgumentIndex, setCode, setComment, setDummy, setFile, setImplicit, setLocation, setName, setNextDFG, setNextEOG, setPrevDFG, setPrevEOG, setPrevEOGProperties, setTypedefs, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.fraunhofer.aisec.cpg.graph.DeclarationHolder
addIfNotContains, addIfNotContains, addIfNotContains
-
Methods inherited from interface de.fraunhofer.aisec.cpg.processing.IVisitable
accept
-
-
-
-
Field Detail
-
locals
protected java.util.List<PropertyEdge<VariableDeclaration>> locals
A 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
-
-
Method Detail
-
getLocals
public java.util.List<VariableDeclaration> getLocals()
-
getLocalsPropertyEdge
public java.util.List<PropertyEdge<VariableDeclaration>> getLocalsPropertyEdge()
-
removeLocal
public void removeLocal(VariableDeclaration variableDeclaration)
-
setLocals
public void setLocals(java.util.List<VariableDeclaration> locals)
-
addDeclaration
public void addDeclaration(@NonNull Declaration declaration)
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
-
-