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 usingRuntimeTypesMatchingStrategyif 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 JavaLikeMatchingStrategyINSTANCEThe singleton instance of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanmatches(Call call, int pos, Parameter formal, Expression actual, java.util.Set<Type> types)Yieldstrueif 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:FixedOrderMatchingStrategyYieldstrueif 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:
matchesin 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:
trueif and only if that condition holds
-
-