Class DeclaredReferenceExpression
- java.lang.Object
-
- de.fraunhofer.aisec.cpg.graph.Node
-
- de.fraunhofer.aisec.cpg.graph.statements.Statement
-
- de.fraunhofer.aisec.cpg.graph.statements.expressions.Expression
-
- de.fraunhofer.aisec.cpg.graph.statements.expressions.DeclaredReferenceExpression
-
- All Implemented Interfaces:
DeclarationHolder,HasType,HasType.TypeListener,Persistable,IVisitable<Node>
- Direct Known Subclasses:
MemberExpression
public class DeclaredReferenceExpression extends Expression implements HasType.TypeListener
An expression, which refers to something which is declared, e.g. a variable. For example, the expressiona = b, which itself is aBinaryOperator, contains twoDeclaredReferenceExpressions, one for the variableaand one for variableb, which have been previously been declared.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.fraunhofer.aisec.cpg.graph.HasType
HasType.TypeListener
-
-
Field Summary
-
Fields inherited from class de.fraunhofer.aisec.cpg.graph.statements.expressions.Expression
type
-
-
Constructor Summary
Constructors Constructor Description DeclaredReferenceExpression()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)AccessValuesgetAccess()@Nullable DeclarationgetRefersTo()<T extends VariableDeclaration>
@Nullable TgetRefersToAs(java.lang.Class<T> clazz)Returns the contents ofrefersToas the specified class, if the class is assignable.inthashCode()booleanisStaticAccess()voidpossibleSubTypesChanged(HasType src, HasType root, java.util.Set<Type> oldSubTypes)voidsetAccess(AccessValues access)voidsetRefersTo(@Nullable Declaration refersTo)voidsetStaticAccess(boolean staticAccess)java.lang.StringtoString()voidtypeChanged(HasType src, HasType root, Type oldType)-
Methods inherited from class de.fraunhofer.aisec.cpg.graph.statements.expressions.Expression
getPossibleSubTypes, getPropagationType, getType, getTypeListeners, refreshType, registerTypeListener, resetTypes, setPossibleSubTypes, setType, unregisterTypeListener, updatePossibleSubtypes, updateType
-
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, addNextCFG, addNextCFG, addNextDFG, addNextEOG, addPrevDFG, addPrevEOG, addTypedef, clearNextEOG, disconnectFromGraph, getAnnotations, getArgumentIndex, getCode, getFile, getId, getLocation, getName, getNextCFG, getNextDFG, getNextEOG, getNextEOGProperties, getNextEOGPropertyEdge, getPrevDFG, getPrevEOG, getPrevEOGProperties, getTypedefs, 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.graph.HasType
setPossibleSubTypes, setType
-
Methods inherited from interface de.fraunhofer.aisec.cpg.processing.IVisitable
accept
-
-
-
-
Method Detail
-
isStaticAccess
public boolean isStaticAccess()
-
setStaticAccess
public void setStaticAccess(boolean staticAccess)
-
getRefersTo
public @Nullable Declaration getRefersTo()
-
getRefersToAs
public <T extends VariableDeclaration> @Nullable T getRefersToAs(java.lang.Class<T> clazz)
Returns the contents ofrefersToas the specified class, if the class is assignable. Otherwise, it will return null.- Type Parameters:
T- the type- Parameters:
clazz- the expected class- Returns:
- the declaration cast to the expected class, or null if the class is not assignable
-
getAccess
public AccessValues getAccess()
-
setRefersTo
public void setRefersTo(@Nullable Declaration refersTo)
-
typeChanged
public void typeChanged(HasType src, HasType root, Type oldType)
- Specified by:
typeChangedin interfaceHasType.TypeListener
-
possibleSubTypesChanged
public void possibleSubTypesChanged(HasType src, HasType root, java.util.Set<Type> oldSubTypes)
- Specified by:
possibleSubTypesChangedin interfaceHasType.TypeListener
-
toString
public java.lang.String toString()
- Overrides:
toStringin classExpression
-
setAccess
public void setAccess(AccessValues access)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classExpression
-
hashCode
public int hashCode()
- Overrides:
hashCodein classExpression
-
-