Class DeclarationStatement

java.lang.Object
de.fraunhofer.aisec.cpg.graph.Node
de.fraunhofer.aisec.cpg.graph.statements.Statement
de.fraunhofer.aisec.cpg.graph.statements.DeclarationStatement
All Implemented Interfaces:
DeclarationHolder, Persistable, IVisitable<de.fraunhofer.aisec.cpg.graph.Node>
Direct Known Subclasses:
ASMDeclarationStatement

public class DeclarationStatement
extends Statement
A Statement, which contains a single or multiple Declarations. Usually these statements occur if one defines a variable within a function body. A function body is a CompoundStatement, which can only contain other statements, but not declarations. Therefore declarations are wrapped in a DeclarationStatement.
  • 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 inherited from class de.fraunhofer.aisec.cpg.graph.statements.Statement

    locals

    Fields inherited from class de.fraunhofer.aisec.cpg.graph.Node

    Companion, EMPTY_NAME, TO_STRING_STYLE
  • Constructor Summary

    Constructors
    Constructor Description
    DeclarationStatement()  
  • Method Summary

    Modifier and Type Method Description
    void addToPropertyEdgeDeclaration​(@NonNull Declaration declaration)  
    boolean equals​(java.lang.Object o)  
    @NonNull java.util.List<Declaration> getDeclarations()  
    java.util.List<de.fraunhofer.aisec.cpg.graph.edge.PropertyEdge<Declaration>> getDeclarationsPropertyEdge()  
    Declaration getSingleDeclaration()  
    <T extends Declaration>
    T
    getSingleDeclarationAs​(java.lang.Class<T> clazz)  
    int hashCode()  
    boolean isSingleDeclaration()  
    void setDeclarations​(java.util.List<Declaration> declarations)  
    void setSingleDeclaration​(Declaration declaration)  
    @NonNull java.lang.String toString()  

    Methods inherited from class de.fraunhofer.aisec.cpg.graph.statements.Statement

    addDeclaration, getLocals, getLocalsPropertyEdge, removeLocal, setLocals

    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

    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
  • Constructor Details

    • DeclarationStatement

      public DeclarationStatement()
  • Method Details

    • getSingleDeclaration

      public Declaration getSingleDeclaration()
    • isSingleDeclaration

      public boolean isSingleDeclaration()
    • setSingleDeclaration

      public void setSingleDeclaration​(Declaration declaration)
    • getSingleDeclarationAs

      public <T extends Declaration> T getSingleDeclarationAs​(java.lang.Class<T> clazz)
    • getDeclarations

      @NotNull public @NonNull java.util.List<Declaration> getDeclarations()
      Specified by:
      getDeclarations in interface DeclarationHolder
      Overrides:
      getDeclarations in class Statement
    • getDeclarationsPropertyEdge

      public java.util.List<de.fraunhofer.aisec.cpg.graph.edge.PropertyEdge<Declaration>> getDeclarationsPropertyEdge()
    • setDeclarations

      public void setDeclarations​(java.util.List<Declaration> declarations)
    • addToPropertyEdgeDeclaration

      public void addToPropertyEdgeDeclaration​(@NonNull Declaration declaration)
    • toString

      @NotNull public @NonNull java.lang.String toString()
      Overrides:
      toString in class de.fraunhofer.aisec.cpg.graph.Node
    • equals

      public boolean equals​(java.lang.Object o)
      Overrides:
      equals in class Statement
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Statement