Class JavaLikeMatchingStrategy
- java.lang.Object
-
- it.unive.lisa.program.language.resolution.FixedOrderMatchingStrategy
-
- it.unive.lisa.program.language.resolution.JavaLikeMatchingStrategy
-
- All Implemented Interfaces:
ParameterMatchingStrategy
public class JavaLikeMatchingStrategy extends FixedOrderMatchingStrategy
A strategy where the first parameter is tested usingRuntimeTypesMatchingStrategy
if it represents the receiver of an instance call, otherwise it is tested withStaticTypesMatchingStrategy
. Other parameters are always tested usingStaticTypesMatchingStrategy
, achieving Java-like resolution.
-
-
Field Summary
Fields Modifier and Type Field Description static JavaLikeMatchingStrategy
INSTANCE
The singleton instance of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
matches(Call call, int pos, Parameter formal, Expression actual, java.util.Set<Type> types)
Yieldstrue
if and only if the signature of thepos
-th parameter of a cfg is matched by the given actual parameter, according to this strategy.-
Methods inherited from class it.unive.lisa.program.language.resolution.FixedOrderMatchingStrategy
matches
-
-
-
-
Field Detail
-
INSTANCE
public static final JavaLikeMatchingStrategy INSTANCE
The singleton instance of this class.
-
-
Method Detail
-
matches
public boolean matches(Call call, int pos, Parameter formal, Expression actual, java.util.Set<Type> types)
Description copied from class:FixedOrderMatchingStrategy
Yieldstrue
if and only if the signature of thepos
-th parameter of a cfg is matched by the given actual parameter, according to this strategy.- Specified by:
matches
in classFixedOrderMatchingStrategy
- Parameters:
call
- the call where the parameters are being matchedpos
- the position of the parameter being evaluatedformal
- the parameter definition of the cfgactual
- the expression that is used as parametertypes
- the runtime types of the actual parameter- Returns:
true
if and only if that condition holds
-
-