Class AddParameterToCallChain<N,E,T,B,TB extends B,S,I,QI,R extends RelatedExpression<N,T,B,TB,S,QI,R>,A extends ASTBasedAnaphora<N,E,T,B,TB,S,I,QI,R,A>>
java.lang.Object
de.monochromata.anaphors.cog.transform.AbstractPreparatoryTransformation<N,E,T,B,TB,S,I,QI,R,A>
de.monochromata.anaphors.cog.transform.AddParameterToCallChain<N,E,T,B,TB,S,I,QI,R,A>
- Type Parameters:
N- The node type in the ASTE- The expression typeT- The type typeB- The binding typeTB- The type binding typeS- The scope type (optional)I- The type used to represent identifiersQI- The type used to represent qualified identifiersR- The sub-type of related expression to useA- The sub-type of AST-based anaphora to use
- All Implemented Interfaces:
PreparatoryTransformation<N,E,T,B,TB,S,I,QI,R,A>,Strategy
public class AddParameterToCallChain<N,E,T,B,TB extends B,S,I,QI,R extends RelatedExpression<N,T,B,TB,S,QI,R>,A extends ASTBasedAnaphora<N,E,T,B,TB,S,I,QI,R,A>> extends AbstractPreparatoryTransformation<N,E,T,B,TB,S,I,QI,R,A>
If the given definite expression is reachable via the call chain from the
invocable containing the potential related expression, add a parameter for it
to propagate it to the invocable containing the definite expression.
-
Field Summary
Fields inherited from class de.monochromata.anaphors.cog.transform.AbstractPreparatoryTransformation
transformationsSpi -
Constructor Summary
Constructors Modifier Constructor Description protectedAddParameterToCallChain()Used in contract testing.AddParameterToCallChain(TransformationsSpi<N,E,T,B,TB,S,I,QI,R,A> transformationsSpi) -
Method Summary
Modifier and Type Method Description CheckResult<N,E,S>canPerform(Chunk<N> chunk, E definiteExpression, S scope)Check whether the transformation can be performed.StringgetKind()Returns a short mnemonic string that uniquely identifies this strategy among the type of strategies it belongs to.Aperform(CheckResult<N,E,S> result, A preliminaryAnaphora)Perform the preparatory transformation and return a potential Anaphora relation thereafter.Methods inherited from class de.monochromata.anaphors.cog.transform.AbstractPreparatoryTransformation
requireInstanceOf, requireSuccessfulCheck
-
Constructor Details
-
AddParameterToCallChain
protected AddParameterToCallChain()Used in contract testing. -
AddParameterToCallChain
-
-
Method Details
-
getKind
Description copied from interface:StrategyReturns a short mnemonic string that uniquely identifies this strategy among the type of strategies it belongs to.- Returns:
- the kind of strategy
-
canPerform
Description copied from interface:PreparatoryTransformationCheck whether the transformation can be performed.Note that the applicability of preparatory transformations must be mutually exclusive: only one out of all preparatory transformations can be applicable to a combination of chunk, definite expression and scope.
- Parameters:
chunk- The chunk that contains the node that may function as related expression.definiteExpression- The definite expression that can potentially function as anaphor.scope- The scope containing the definite expression. May be null if not required by the AST implementation configured via the service provider interfaces.- Returns:
- the result of a check that might contain (hidden)
implementation-specific cached information to speed up
PreparatoryTransformation.perform(CheckResult, ASTBasedAnaphora).
-
perform
Description copied from interface:PreparatoryTransformationPerform the preparatory transformation and return a potential Anaphora relation thereafter.- Parameters:
result- the result of an invocation of check that might contain (hidden) implementation-specific cached information to speed upPreparatoryTransformation.perform(CheckResult, ASTBasedAnaphora)preliminaryAnaphora- a preliminary anaphora relation that will be used as a blue-print to create the potential anaphora. (The preliminary anaphora is based on the AST before the preparatory transformation - its related expression might be unreachable from its the definite expression.)- Returns:
- a potential anaphora relation that in valid in the AST after the preparatory transformation has been applied.
-