Class ReferenceType
java.lang.Object
de.fraunhofer.aisec.cpg.graph.Node
de.fraunhofer.aisec.cpg.graph.types.Type
de.fraunhofer.aisec.cpg.graph.types.ReferenceType
- All Implemented Interfaces:
Persistable,SecondOrderType,IVisitable<de.fraunhofer.aisec.cpg.graph.Node>
public class ReferenceType extends Type implements SecondOrderType
ReferenceTypes describe CPP References (int&), which are represent an alternative name for a
variable. It is necessary to make this distinction, and not just rely on the original type as it
is required for matching parameters in function arguments to discover which implementation is
called.
-
Nested Class Summary
Nested 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 ReferenceType(Type reference)ReferenceType(Type.Storage storage, Type.Qualifier qualifier, Type reference)ReferenceType(Type type, Type reference) -
Method Summary
Modifier and Type Method Description Typedereference()Typeduplicate()booleanequals(java.lang.Object o)TypegetElementType()inthashCode()booleanisSimilar(Type t)Required for possibleSubTypes to check if the new Type should be considered a subtype or notTypereference(PointerType.PointerOrigin pointerOrigin)voidrefreshName()voidsetElementType(Type reference)java.lang.StringtoString()Methods inherited from class de.fraunhofer.aisec.cpg.graph.types.Type
getQualifier, getReferenceDepth, getRoot, getStorage, getSuperTypes, getTypeName, getTypeOrigin, isFirstOrderType, isPrimitive, refreshNames, setAdditionalTypeKeywords, setQualifier, setRoot, setStorage, setTypeOriginMethods 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, 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
-
ReferenceType
-
ReferenceType
-
ReferenceType
-
-
Method Details
-
reference
-
dereference
- Specified by:
dereferencein classType- Returns:
- Dereferencing a ReferenceType equals to dereferencing the original (non-reference) type
-
duplicate
-
getElementType
- Specified by:
getElementTypein interfaceSecondOrderType
-
setElementType
- Specified by:
setElementTypein interfaceSecondOrderType
-
isSimilar
Description copied from class:TypeRequired for possibleSubTypes to check if the new Type should be considered a subtype or not -
refreshName
public void refreshName() -
equals
public boolean equals(java.lang.Object o) -
hashCode
public int hashCode() -
toString
public java.lang.String toString()
-