Class PointerType
java.lang.Object
de.fraunhofer.aisec.cpg.graph.Node
de.fraunhofer.aisec.cpg.graph.types.Type
de.fraunhofer.aisec.cpg.graph.types.PointerType
- All Implemented Interfaces:
Persistable,SecondOrderType,IVisitable<de.fraunhofer.aisec.cpg.graph.Node>
public class PointerType extends Type implements SecondOrderType
PointerTypes represent all references to other Types. For C/CPP this includes pointers, as well
as arrays, since technically arrays are pointers. For JAVA the only use case are arrays as there
is no such pointer concept.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPointerType.PointerOriginNested classes/interfaces inherited from class de.fraunhofer.aisec.cpg.graph.types.Type
Type.Origin, Type.Qualifier, Type.StorageNested 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.types.Type
origin, primitive, qualifier, storage, superTypes, UNKNOWN_TYPE_STRINGFields inherited from class de.fraunhofer.aisec.cpg.graph.Node
Companion, EMPTY_NAME, TO_STRING_STYLE -
Constructor Summary
Constructors Constructor Description PointerType(Type elementType, PointerType.PointerOrigin pointerOrigin)PointerType(Type type, Type elementType, PointerType.PointerOrigin pointerOrigin) -
Method Summary
Modifier and Type Method Description Typedereference()Typeduplicate()booleanequals(java.lang.Object o)TypegetElementType()PointerType.PointerOrigingetPointerOrigin()intgetReferenceDepth()inthashCode()booleanisArray()booleanisSimilar(Type t)Required for possibleSubTypes to check if the new Type should be considered a subtype or notPointerTypereference(PointerType.PointerOrigin origin)voidrefreshNames()voidsetElementType(Type elementType)Methods inherited from class de.fraunhofer.aisec.cpg.graph.types.Type
getQualifier, getRoot, getStorage, getSuperTypes, getTypeName, getTypeOrigin, isFirstOrderType, isPrimitive, setAdditionalTypeKeywords, setQualifier, setRoot, setStorage, setTypeOrigin, toStringMethods inherited from class de.fraunhofer.aisec.cpg.graph.Node
addAnnotations, addNextDFG, addNextEOG, addPrevDFG, addPrevEOG, addTypedef, clearNextEOG, disconnectFromGraph, getAnnotations, getArgumentIndex, 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, setTypedefsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface de.fraunhofer.aisec.cpg.processing.IVisitable
accept
-
Constructor Details
-
PointerType
-
PointerType
-
-
Method Details
-
reference
-
dereference
- Specified by:
dereferencein classType- Returns:
- dereferencing a PointerType yields the type the pointer was pointing towards
-
refreshNames
public void refreshNames()- Overrides:
refreshNamesin classType
-
duplicate
-
isArray
public boolean isArray() -
isSimilar
Description copied from class:TypeRequired for possibleSubTypes to check if the new Type should be considered a subtype or not -
getPointerOrigin
-
getElementType
- Specified by:
getElementTypein interfaceSecondOrderType
-
getReferenceDepth
public int getReferenceDepth()- Overrides:
getReferenceDepthin classType- Returns:
- number of steps that are required in order to traverse the type chain until the root is reached
-
setElementType
- Specified by:
setElementTypein interfaceSecondOrderType
-
equals
public boolean equals(java.lang.Object o) -
hashCode
public int hashCode()
-