Class DeclarationSequence
java.lang.Object
de.fraunhofer.aisec.cpg.graph.Node
de.fraunhofer.aisec.cpg.graph.declarations.Declaration
de.fraunhofer.aisec.cpg.graph.declarations.DeclarationSequence
- All Implemented Interfaces:
DeclarationHolder,Persistable,IVisitable<de.fraunhofer.aisec.cpg.graph.Node>
public class DeclarationSequence extends Declaration implements DeclarationHolder
This represents a sequence of one or more declaration(s). The purpose of this node is primarily
to bridge between a single declaration and a list of declarations in the front-end handlers. It
will be converted into a list-structure and all its children will be added to the parent, i.e.
the translation unit. It should not end up in the final graph.
-
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.Node
Companion, EMPTY_NAME, TO_STRING_STYLE -
Constructor Summary
Constructors Constructor Description DeclarationSequence() -
Method Summary
Modifier and Type Method Description voidaddDeclaration(@NonNull Declaration declaration)Adds the specified declaration to this declaration holder.java.util.List<Declaration>asList()Declarationfirst()java.util.List<Declaration>getChildren()java.util.List<de.fraunhofer.aisec.cpg.graph.edge.PropertyEdge<Declaration>>getChildrenPropertyEdge()java.util.List<Declaration>getDeclarations()booleanisSingle()Methods inherited from class de.fraunhofer.aisec.cpg.graph.Node
addAnnotations, addNextDFG, addNextEOG, addPrevDFG, addPrevEOG, addTypedef, clearNextEOG, disconnectFromGraph, equals, getAnnotations, getArgumentIndex, getAstChildren, getCode, getComment, getFile, getId, getLocation, getName, getNextDFG, getNextEOG, getNextEOGEdges, getPrevDFG, getPrevEOG, getPrevEOGEdges, getTypedefs, hashCode, 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
-
Constructor Details
-
DeclarationSequence
public DeclarationSequence()
-
-
Method Details
-
getChildrenPropertyEdge
public java.util.List<de.fraunhofer.aisec.cpg.graph.edge.PropertyEdge<Declaration>> getChildrenPropertyEdge() -
getChildren
-
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
-
asList
-
isSingle
public boolean isSingle() -
first
-
getDeclarations
- Specified by:
getDeclarationsin interfaceDeclarationHolder
-