Package de.monochromata.anaphors.ast.spi
Interface AnaphoraResolutionSpi<N,E,T,B,VB extends B,FB extends B,MB extends 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>>
- Type Parameters:
N- The node type in the ASTE- The expression typeT- The type typeB- The binding typeVB- The variable binding typeFB- The field binding typeMB- The method 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
public interface AnaphoraResolutionSpi<N,E,T,B,VB extends B,FB extends B,MB extends 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>>
A special service provider interface related to finding potential referents
of a given definite expression in a given related expression.
-
Method Summary
Modifier and Type Method Description booleancouldBeAPreviousRealization(E definiteExpression)<RP extends RelatedExpressionPart<N, E, T, B, TB, S, I, QI, R>, AP extends AnaphorPart<N, E, T, B, TB, S, I, QI, R, A>>
AcreateDirectAnaphora(RP relatedExpressionPart, AP anaphorPart, boolean isUnderspecified)<RP extends RelatedExpressionPart<N, E, T, B, TB, S, I, QI, R>, AP extends AnaphorPart<N, E, T, B, TB, S, I, QI, R, A>>
AcreateIndirectAnaphora(RP relatedExpressionPart, AP anaphorPart, String underspecifiedRelation, boolean isUnderspecified)<RP extends RelatedExpressionPart<N, E, T, B, TB, S, I, QI, R>, AP extends AnaphorPart<N, E, T, B, TB, S, I, QI, R, A>>
AcreateIndirectAnaphora(RP relatedExpressionPart, AP anaphorPart, String underspecifiedRelation, Supplier<String> customReferenceDescriptionSupplier, boolean isUnderspecified)booleandoesGetterMethodOnlyReturnValueOf(MB methodBinding, FB fieldBinding, S scope)List<FB>getAccessibleFields(TB typeBinding, S scope)List<MB>getAccessibleGetterMethods(TB typeBinding, S scope)StringgetFieldDescription(FB fieldBinding)IgetFieldName(FB fieldBinding)StringgetIA1MrUnderspecifiedRelation(R potentialRelatedExpression, MB methodBinding, S scope)StringgetIA2FUnderspecifiedRelation(R relatedExpression, FB fieldBinding, S scope)Returns the underspecified relation represented by an indirect anaphora relation of kind IA2F in the format<fully-qualified name of field declaring type>.<fieldName>.StringgetIA2MgUnderspecifiedRelation(R relatedExpression, MB methodBinding, S scope)IgetIdFromPreviousRealization(E definiteExpression)StringgetMethodDescription(MB methodBinding)IgetMethodName(MB methodBinding)QIgetReferentName(MB methodBinding)Return a variable name for the given method that removes getter or setter prefix to the method name and converts the first character of the remaining string to lower case.booleanidentifierStartsUpperCase(I identifier)ErealizeDA1Re(RelatedExpressionPart<N,E,T,B,TB,S,I,QI,R> relatedExpressionPart, AnaphorPart<N,E,T,B,TB,S,I,QI,R,A> anaphorPart, E replacee, Optional<I> guessedTempName, Object... support)Replace an anaphor of kind DA1Re by an expression that realizes it.ErealizeIA1Mr(RelatedExpressionPart<N,E,T,B,TB,S,I,QI,R> relatedExpressionPart, AnaphorPart<N,E,T,B,TB,S,I,QI,R,A> anaphorPart, E replacee, Optional<I> guessedTempName, Object[] support)ErealizeIA2F(RelatedExpressionPart<N,E,T,B,TB,S,I,QI,R> relatedExpressionPart, AnaphorPart<N,E,T,B,TB,S,I,QI,R,A> anaphorPart, E replacee, Optional<I> guessedTempName, Object... support)Replace an anaphor of kind IA2F by an expression that realizes it.ErealizeIA2Mg(RelatedExpressionPart<N,E,T,B,TB,S,I,QI,R> relatedExpressionPart, AnaphorPart<N,E,T,B,TB,S,I,QI,R,A> anaphorPart, E replacee, Optional<I> guessedTempName, Object... support)Replace an anaphor of kind IA2Mg by an expression that realizes it.TBresolveReturnType(MB methodBinding, S scope)TBresolveType(FB fieldBinding, S scope)
-
Method Details
-
createDirectAnaphora
-
createIndirectAnaphora
-
createIndirectAnaphora
<RP extends RelatedExpressionPart<N, E, T, B, TB, S, I, QI, R>, AP extends AnaphorPart<N, E, T, B, TB, S, I, QI, R, A>> A createIndirectAnaphora(RP relatedExpressionPart, AP anaphorPart, String underspecifiedRelation, Supplier<String> customReferenceDescriptionSupplier, boolean isUnderspecified) -
getAccessibleFields
-
getFieldName
-
identifierStartsUpperCase
-
getFieldDescription
-
resolveType
-
getAccessibleGetterMethods
-
doesGetterMethodOnlyReturnValueOf
-
getReferentName
Return a variable name for the given method that removes getter or setter prefix to the method name and converts the first character of the remaining string to lower case.- Parameters:
methodBinding- The method binding to use.- Returns:
- A variable name.
-
getMethodName
-
getMethodDescription
-
resolveReturnType
-
couldBeAPreviousRealization
-
getIdFromPreviousRealization
-
realizeDA1Re
E realizeDA1Re(RelatedExpressionPart<N,E,T,B,TB,S,I,QI,R> relatedExpressionPart, AnaphorPart<N,E,T,B,TB,S,I,QI,R,A> anaphorPart, E replacee, Optional<I> guessedTempName, Object... support)Replace an anaphor of kind DA1Re by an expression that realizes it.- Parameters:
replacee- The anaphor to be replaced.guessedTempName- If the given related expression part has aLocalTempVariableIntroducingStrategy, the strategy introduced a temporary variable that might be used by the anaphor resolution strategy to generate code for the anaphors.support- Optional compiler-specific support objects.- Returns:
- The AST node that realizes the anaphor.
-
realizeIA1Mr
-
realizeIA2F
E realizeIA2F(RelatedExpressionPart<N,E,T,B,TB,S,I,QI,R> relatedExpressionPart, AnaphorPart<N,E,T,B,TB,S,I,QI,R,A> anaphorPart, E replacee, Optional<I> guessedTempName, Object... support)Replace an anaphor of kind IA2F by an expression that realizes it.- Parameters:
replacee- The anaphor to be replaced.guessedTempName- If the given related expression part has aLocalTempVariableIntroducingStrategy, the strategy introduced a temporary variable that might be used by the anaphor resolution strategy to generate code for the anaphors.support- Optional compiler-specific support objects.- Returns:
- The AST node that realizes the anaphor.
-
realizeIA2Mg
E realizeIA2Mg(RelatedExpressionPart<N,E,T,B,TB,S,I,QI,R> relatedExpressionPart, AnaphorPart<N,E,T,B,TB,S,I,QI,R,A> anaphorPart, E replacee, Optional<I> guessedTempName, Object... support)Replace an anaphor of kind IA2Mg by an expression that realizes it.- Parameters:
replacee- The anaphor to be replaced.guessedTempName- If the given related expression part has aLocalTempVariableIntroducingStrategy, the strategy introduced a temporary variable that might be used by the anaphor resolution strategy to generate code for the anaphors.support- Optional compiler-specific support objects.- Returns:
- The AST node that realizes the anaphor.
-
getIA1MrUnderspecifiedRelation
-
getIA2FUnderspecifiedRelation
Returns the underspecified relation represented by an indirect anaphora relation of kind IA2F in the format<fully-qualified name of field declaring type>.<fieldName>.- Parameters:
relatedExpression- The related expression whose type declares the underspecified relation.fieldBinding- The field that is part of the underspecified relation.scope- The scope containing the anaphor if used by the compiler-specific implementation.- Returns:
- A string representing the underspecified relation.
-
getIA2MgUnderspecifiedRelation
-