Interface ParameterAssigningStrategy
-
- All Known Implementing Classes:
OrderPreservingAssigningStrategy
,PythonLikeAssigningStrategy
public interface ParameterAssigningStrategy
A strategy for assigning parameters at call sites. Depending on the language, assignments from actual to formal parameters might happen in the same order as they are evaluated, or they might happen with a by-name semantics, where the name of a parameter is prefixed to the expression representing the value to be assigned to it. The latter semantics enables parameter shuffling. Each strategy comes with a differentprepare(Call, AnalysisState, InterproceduralAnalysis, StatementStore, Parameter[], ExpressionSet[])
implementation that can automatically perform the assignments.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <A extends AbstractState<A>>
org.apache.commons.lang3.tuple.Pair<AnalysisState<A>,ExpressionSet[]>prepare(Call call, AnalysisState<A> callState, InterproceduralAnalysis<A> interprocedural, StatementStore<A> expressions, Parameter[] formals, ExpressionSet[] actuals)
Prepares the entryState for the targets of the givenCall
, assuming that the state when the call is executed (after the evaluation of the parameters) iscallState
, and each parameter to the call is represented by an element ofparameters
.
-
-
-
Method Detail
-
prepare
<A extends AbstractState<A>> org.apache.commons.lang3.tuple.Pair<AnalysisState<A>,ExpressionSet[]> prepare(Call call, AnalysisState<A> callState, InterproceduralAnalysis<A> interprocedural, StatementStore<A> expressions, Parameter[] formals, ExpressionSet[] actuals) throws SemanticException
Prepares the entryState for the targets of the givenCall
, assuming that the state when the call is executed (after the evaluation of the parameters) iscallState
, and each parameter to the call is represented by an element ofparameters
. Here, no restrictions on the order of the parameters is made: they can be passed as-is, preserving their evaluation order (Java-like), or they may be passed by-name (Python-like).- Type Parameters:
A
- the type ofAbstractState
- Parameters:
call
- the call to be preparedcallState
- the analysis state where the call is to be executedinterprocedural
- the interprocedural analysis of the program to analyzeexpressions
- the cache where analysis states of intermediate expressions must be storedformals
- the expressions representing the formal parameters of the callactuals
- the expressions representing the actual parameters of the call- Returns:
- the prepared state, ready to be used as entry-state for the targets, and the expressions to use as parameters of the call
- Throws:
SemanticException
- if something goes wrong while preparing the entry-state
-
-