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<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.
-
-
Constructor Summary
Constructors Constructor Description DeclarationSequence()
-
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.java.util.List<Declaration>asList()Declarationfirst()java.util.List<Declaration>getChildren()java.util.List<PropertyEdge<Declaration>>getChildrenPropertyEdge()booleanisSingle()-
Methods inherited from class de.fraunhofer.aisec.cpg.graph.declarations.Declaration
toString
-
Methods inherited from class de.fraunhofer.aisec.cpg.graph.Node
addAnnotations, addNextCFG, addNextCFG, addNextDFG, addNextEOG, addPrevDFG, addPrevEOG, addTypedef, clearNextEOG, disconnectFromGraph, equals, getAnnotations, getArgumentIndex, getCode, getFile, getId, getLocation, getName, getNextCFG, getNextDFG, getNextEOG, getNextEOGProperties, getNextEOGPropertyEdge, getPrevDFG, getPrevEOG, getPrevEOGProperties, getTypedefs, hashCode, isDummy, isImplicit, removeNextDFG, removePrevDFG, removePrevEOGEntries, removePrevEOGEntry, setArgumentIndex, setCode, setComment, setDummy, setFile, setImplicit, setLocation, setName, setNextDFG, setNextEOG, setPrevDFG, setPrevEOG, setPrevEOGProperties, 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
-
-
-
-
Method Detail
-
getChildrenPropertyEdge
public java.util.List<PropertyEdge<Declaration>> getChildrenPropertyEdge()
-
getChildren
public java.util.List<Declaration> getChildren()
-
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
-
asList
public java.util.List<Declaration> asList()
-
isSingle
public boolean isSingle()
-
first
public Declaration first()
-
-