Class NamedParameterExpression
- java.lang.Object
-
- it.unive.lisa.program.cfg.statement.Statement
-
- it.unive.lisa.program.cfg.statement.Expression
-
- it.unive.lisa.program.cfg.statement.NaryExpression
-
- it.unive.lisa.program.cfg.statement.UnaryExpression
-
- it.unive.lisa.program.cfg.statement.call.NamedParameterExpression
-
- All Implemented Interfaces:
ProgramPoint
,CodeElement
,CodeNode<CFG,Statement,Edge>
,Node<CFG,Statement,Edge>
,java.lang.Comparable<Statement>
public class NamedParameterExpression extends UnaryExpression
An expression that can be used to for by-name parameter passing toCall
s. In some languages, parameters can be passed in a different order from the one declared in the target procedure's signature. This is made possible by prefixing the expression representing the parameter's value with its name. This expression models the by-name parameter passing, and instances ofParameterAssigningStrategy
can use instances of this class to detect which parameter is being assingned.
-
-
Constructor Summary
Constructors Constructor Description NamedParameterExpression(CFG cfg, CodeLocation location, java.lang.String parameterName, Expression subExpression)
Builds the expression.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.String
getParameterName()
Yields the name of the parameter targeted by this expression.int
hashCode()
<A extends AbstractState<A,H,V,T>,H extends HeapDomain<H>,V extends ValueDomain<V>,T extends TypeDomain<T>>
AnalysisState<A,H,V,T>unarySemantics(InterproceduralAnalysis<A,H,V,T> interprocedural, AnalysisState<A,H,V,T> state, SymbolicExpression expr, StatementStore<A,H,V,T> expressions)
Computes the semantics of the expression, after the semantics of the sub-expression has been computed.-
Methods inherited from class it.unive.lisa.program.cfg.statement.UnaryExpression
expressionSemantics, getSubExpression
-
Methods inherited from class it.unive.lisa.program.cfg.statement.NaryExpression
accept, getConstructName, getOrder, getStatementEvaluatedBefore, getSubExpressions, semantics, setOffset, toString
-
Methods inherited from class it.unive.lisa.program.cfg.statement.Expression
getMetaVariables, getParentStatement, getRootStatement, getStaticType, setParentStatement
-
Methods inherited from class it.unive.lisa.program.cfg.statement.Statement
compareTo, getCFG, getEvaluationPredecessor, getLocation, getOffset, stopsExecution, throwsError
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface it.unive.lisa.program.cfg.ProgramPoint
getProgram
-
-
-
-
Constructor Detail
-
NamedParameterExpression
public NamedParameterExpression(CFG cfg, CodeLocation location, java.lang.String parameterName, Expression subExpression)
Builds the expression. The static type of this expression is the one ofsubExpression
.- Parameters:
cfg
- theCFG
where this operation lieslocation
- the location where this literal is definedparameterName
- the name of the parameter being assigned heresubExpression
- the expression being assigned to the target parameter
-
-
Method Detail
-
getParameterName
public java.lang.String getParameterName()
Yields the name of the parameter targeted by this expression.- Returns:
- the name of the parameter
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classNaryExpression
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classNaryExpression
-
unarySemantics
public <A extends AbstractState<A,H,V,T>,H extends HeapDomain<H>,V extends ValueDomain<V>,T extends TypeDomain<T>> AnalysisState<A,H,V,T> unarySemantics(InterproceduralAnalysis<A,H,V,T> interprocedural, AnalysisState<A,H,V,T> state, SymbolicExpression expr, StatementStore<A,H,V,T> expressions) throws SemanticException
Description copied from class:UnaryExpression
Computes the semantics of the expression, after the semantics of the sub-expression has been computed. Meta variables from the sub-expression will be forgotten after this expression returns.- Specified by:
unarySemantics
in classUnaryExpression
- Type Parameters:
A
- the type ofAbstractState
H
- the type of theHeapDomain
V
- the type of theValueDomain
T
- the type ofTypeDomain
- Parameters:
interprocedural
- the interprocedural analysis of the program to analyzestate
- the state where the expression is to be evaluatedexpr
- the symbolic expressions representing the computed value of the sub-expression of this expressionexpressions
- the cache where analysis states of intermediate expressions are stored and that can be accessed to query for post-states of parameters expressions- Returns:
- the
AnalysisState
representing the abstract result of the execution of this expression - Throws:
SemanticException
- if something goes wrong during the computation
-
-