Class AbstractTypeComputationState
- java.lang.Object
-
- org.eclipse.xtext.xbase.typesystem.internal.AbstractTypeComputationState
-
- All Implemented Interfaces:
ITypeComputationState
- Direct Known Subclasses:
AbstractRootTypeComputationState,AbstractStackedTypeComputationState
public abstract class AbstractTypeComputationState extends java.lang.Object implements ITypeComputationState
Base implementation ofITypeComputationState.
-
-
Field Summary
Fields Modifier and Type Field Description protected ResolvedTypesresolvedTypes
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractTypeComputationState(ResolvedTypes resolvedTypes, IFeatureScopeSession featureScopeSession)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidacceptActualType(LightweightTypeReference type)Annotates the currently considered expression(s) with the given type.voidacceptActualType(LightweightTypeReference type, int flags)Annotates the currently considered expression(s) with the given type.voidacceptActualType(LightweightTypeReference type, java.util.EnumSet<ConformanceHint> hints)Annotates the currently considered expression(s) with the given type.voidacceptActualType(LightweightTypeReference type, ConformanceHint... hints)Annotates the currently considered expression(s) with the given type.voidacceptCandidate(XExpression expression, IApplicableCandidate candidate)Allows to register a candidate that gets the chance to validate or change the state of the AST in a subsequent processing step.protected abstract LightweightTypeReferenceacceptType(ResolvedTypes types, AbstractTypeExpectation expectation, LightweightTypeReference type, boolean returnType, int flags)protected abstract LightweightTypeReferenceacceptType(XExpression alreadyHandled, ResolvedTypes types, AbstractTypeExpectation expectation, LightweightTypeReference type, boolean returnType, int flags)voidaddDiagnostic(org.eclipse.xtext.diagnostics.AbstractDiagnostic diagnostic)Adds the given diagnostic to the current state.voidaddExtensionsToCurrentScope(java.util.List<? extends org.eclipse.xtext.common.types.JvmIdentifiableElement> extensionProviders)Adds the given elements as extension providers to the current scope.voidaddExtensionToCurrentScope(org.eclipse.xtext.common.types.JvmIdentifiableElement extensionProvider)Adds the given element as an extension provider to the current scope.voidaddImports(ITypeImporter.Client importer)Allows to add several imports in a bulk operation on a fine grained basis, e.g.voidaddLocalToCurrentScope(org.eclipse.xtext.common.types.JvmIdentifiableElement element)Adds the given element as a local variable.protected voidaddLocalToCurrentScope(org.eclipse.xtext.naming.QualifiedName elementName, org.eclipse.xtext.common.types.JvmIdentifiableElement element, boolean raiseIssueIfShadowing)voidaddTypeToStaticExtensionImportScope(org.eclipse.xtext.common.types.JvmDeclaredType type)Adds the given type to the static extension scope.voidaddTypeToStaticImportScope(org.eclipse.xtext.common.types.JvmDeclaredType type)Adds the given type to the static scope.voidafterScope(org.eclipse.emf.ecore.EObject context)If the expression tree contains intermediate objects, e.g.AbstractTypeComputationStateassignType(org.eclipse.xtext.common.types.JvmIdentifiableElement element, LightweightTypeReference type)Assigns the type to the given element and makes the element available in the scope.AbstractTypeComputationStateassignType(org.eclipse.xtext.common.types.JvmIdentifiableElement element, LightweightTypeReference type, boolean addToChildScope)Assigns the given type to the given element and optionally adds the element to the scope.voidassignType(org.eclipse.xtext.naming.QualifiedName name, org.eclipse.xtext.common.types.JvmType rawType, LightweightTypeReference actualType)Assigns the given actual type to the raw type which shall be reachable with the given name.TypeAssignerassignTypes()Obtain a newITypeAssignerthat allows to add a bulk ofelementsto this computation state.ITypeComputationResultcomputeTypes(XExpression expression)Triggers type computation for a child expression of the currently considered expression.protected IFeatureLinkingCandidatecreateCandidate(XAbstractFeatureCall featureCall, StackedResolvedTypes demandComputedTypes, IIdentifiableElementDescription description)protected IConstructorLinkingCandidatecreateCandidate(XConstructorCall constructorCall, IIdentifiableElementDescription description)protected IFeatureLinkingCandidatecreateCandidateWithReceiverType(XAbstractFeatureCall featureCall, StackedResolvedTypes demandComputedTypes, IIdentifiableElementDescription description)protected ExpressionTypeComputationStatecreateExpressionComputationState(XExpression expression, StackedResolvedTypes typeResolution)protected IFeatureLinkingCandidatecreateResolvedLink(XAbstractFeatureCall featureCall, org.eclipse.xtext.common.types.JvmIdentifiableElement resolvedTo)protected IConstructorLinkingCandidatecreateResolvedLink(XConstructorCall constructorCall, org.eclipse.xtext.common.types.JvmConstructor resolvedTo)protected TypeAssignercreateTypeAssigner(AbstractTypeComputationState state)UnboundTypeReferencecreateUnboundTypeReference(XExpression expression, org.eclipse.xtext.common.types.JvmTypeParameter typeParameter)Create a new, managedUnboundTypeReferencefor the given type parameter which was first encountered for the given expression.voiddiscardReassignedTypes(org.eclipse.xtext.common.types.JvmIdentifiableElement refinable)A reassigned type may become obsolete due to assignments.protected ExpressionAwareStackedResolvedTypesdoComputeTypes(XExpression expression)java.util.List<? extends ITypeExpectation>getExpectations()The result is never empty.protected abstract java.util.List<AbstractTypeExpectation>getExpectations(AbstractTypeComputationState actualState)java.util.List<LightweightTypeReference>getExpectedExceptions()IFeatureScopeSessiongetFeatureScopeSession()java.util.List<IFeatureLinkingCandidate>getLinkingCandidates(XAbstractFeatureCall featureCall)The result is never empty.java.util.List<IConstructorLinkingCandidate>getLinkingCandidates(XConstructorCall constructorCall)The result is never empty.ITypeReferenceOwnergetReferenceOwner()The current type reference owner for newly converted type references.ResolvedTypesgetResolvedTypes()protected DefaultReentrantTypeResolvergetResolver()protected java.util.List<? extends ITypeExpectation>getReturnExpectations()protected abstract java.util.List<AbstractTypeExpectation>getReturnExpectations(AbstractTypeComputationState actualState, boolean asActualExpectation)protected org.eclipse.xtext.validation.IssueSeveritiesgetSeverities()org.eclipse.xtext.diagnostics.SeveritygetSeverity(java.lang.String issueCode)Returns the severity for the givenissueCode.protected ITypeExpectationgetSingleExpectation(ITypeComputationState state)protected ITypeComputergetTypeComputer()protected org.eclipse.xtext.common.types.util.TypeReferencesgetTypeReferences()booleanisIgnored(java.lang.String issueCode)Returnsfalseif no issues have to be produced for the given issueCode.protected ExpressionAwareStackedResolvedTypespushTypes(XExpression expression)voidreassignType(org.eclipse.xtext.common.types.JvmIdentifiableElement refinable, LightweightTypeReference type)Allows to specialize the known type of an identifiable, that was already annotated with a type.voidrefineExpectedType(XExpression expression, LightweightTypeReference expectation)After the fact refinement of the expected type.voidrewriteScope(org.eclipse.emf.ecore.EObject context)If the container of an expression decides to alter the scope after the expression was typed, its AFTER scope may be rewritten.protected IIdentifiableElementDescriptiontoIdentifiableDescription(org.eclipse.xtext.resource.IEObjectDescription description)java.lang.StringtoString()TypeComputationStateWithExpectationwithExpectation(LightweightTypeReference expectation)The given expectation will be resolved if it contains unresolved type arguments, e.g.AbstractTypeComputationStatewithExpectedExceptions(java.util.List<LightweightTypeReference> declaredExceptionTypes)voidwithinScope(org.eclipse.emf.ecore.EObject context)If the expression tree contains expressions that define a new scope, e.g.AbstractTypeComputationStatewithNonVoidExpectation()Keep the current return expectation and assume an actual expectation that is not void.protected AbstractTypeComputationStatewithNonVoidExpectation(ResolvedTypes resolvedTypes)AbstractTypeComputationStatewithoutExpectation()Keeps the return type expectation.TypeComputationStateWithRootExpectationwithoutRootExpectation()The outer context is ignored for child expressions and the newly produced context does not impose any restrictions on the expectation.AbstractTypeComputationStatewithReturnExpectation()Transfers the available return type expectation to the actual expectation of this computation step.TypeComputationStateWithRootExpectationwithRootExpectation(LightweightTypeReference expectation)The given expectation becomes the expected return type and the expected type for the current context.TypeCheckpointComputationStatewithTypeCheckpoint(org.eclipse.emf.ecore.EObject context)A type checkpoint allows to re-specify the type of an identifiable that was already type-computed.
-
-
-
Field Detail
-
resolvedTypes
protected final ResolvedTypes resolvedTypes
-
-
Constructor Detail
-
AbstractTypeComputationState
protected AbstractTypeComputationState(ResolvedTypes resolvedTypes, IFeatureScopeSession featureScopeSession)
-
-
Method Detail
-
getResolvedTypes
public ResolvedTypes getResolvedTypes()
-
getFeatureScopeSession
public IFeatureScopeSession getFeatureScopeSession()
-
getTypeReferences
protected org.eclipse.xtext.common.types.util.TypeReferences getTypeReferences()
-
getTypeComputer
protected ITypeComputer getTypeComputer()
-
getResolver
protected DefaultReentrantTypeResolver getResolver()
-
acceptType
protected abstract LightweightTypeReference acceptType(ResolvedTypes types, AbstractTypeExpectation expectation, LightweightTypeReference type, boolean returnType, int flags)
-
acceptType
protected abstract LightweightTypeReference acceptType(XExpression alreadyHandled, ResolvedTypes types, AbstractTypeExpectation expectation, LightweightTypeReference type, boolean returnType, int flags)
-
computeTypes
public final ITypeComputationResult computeTypes(XExpression expression)
Description copied from interface:ITypeComputationStateTriggers type computation for a child expression of the currently considered expression.- Specified by:
computeTypesin interfaceITypeComputationState
-
doComputeTypes
protected ExpressionAwareStackedResolvedTypes doComputeTypes(XExpression expression)
-
pushTypes
protected ExpressionAwareStackedResolvedTypes pushTypes(XExpression expression)
-
createExpressionComputationState
protected ExpressionTypeComputationState createExpressionComputationState(XExpression expression, StackedResolvedTypes typeResolution)
-
withExpectation
public TypeComputationStateWithExpectation withExpectation(LightweightTypeReference expectation)
Description copied from interface:ITypeComputationStateThe given expectation will be resolved if it contains unresolved type arguments, e.g. an operation that declares two parameters of the very same type argument will yield a more detailed expectation if possible.<T> T foo(T, T)withfoo<String>(null, 'string')will allow to pass the unresolvedTas expectation where clients would be invoked with the better candidate 'string'.- Specified by:
withExpectationin interfaceITypeComputationState
-
refineExpectedType
public void refineExpectedType(XExpression expression, LightweightTypeReference expectation)
Description copied from interface:ITypeComputationStateAfter the fact refinement of the expected type. The expected type of a given expression may be changed after the real type of that expression is known. Example:for(double d: produceIntArray) { }Expressions are resolved in the context of an expected type, which may or may not exist (e.g. it may benull). The expectation for the call toproduceIntArrayisdouble[]. However, the method returns an array of int. The tricky part is, that anint[]is not assignable to adouble[]which would lead to incompatible types. Nevertheless, the expression is valid, since the component type is relevant for the compatibility in the context of a for-loop. Therefore, the expectation is refined after the fact toint[]because the conformance could be validated.- Specified by:
refineExpectedTypein interfaceITypeComputationState
-
withRootExpectation
public TypeComputationStateWithRootExpectation withRootExpectation(LightweightTypeReference expectation)
Description copied from interface:ITypeComputationStateThe given expectation becomes the expected return type and the expected type for the current context. Outer context is ignored for child expressions.- Specified by:
withRootExpectationin interfaceITypeComputationState
-
withoutRootExpectation
public TypeComputationStateWithRootExpectation withoutRootExpectation()
Description copied from interface:ITypeComputationStateThe outer context is ignored for child expressions and the newly produced context does not impose any restrictions on the expectation.- Specified by:
withoutRootExpectationin interfaceITypeComputationState
-
withNonVoidExpectation
public AbstractTypeComputationState withNonVoidExpectation()
Description copied from interface:ITypeComputationStateKeep the current return expectation and assume an actual expectation that is not void. Example:val x = someExpression
The expectation for the call tosomeExpressionis anything butvoid.- Specified by:
withNonVoidExpectationin interfaceITypeComputationState
-
withNonVoidExpectation
protected AbstractTypeComputationState withNonVoidExpectation(ResolvedTypes resolvedTypes)
-
withReturnExpectation
public AbstractTypeComputationState withReturnExpectation()
Description copied from interface:ITypeComputationStateTransfers the available return type expectation to the actual expectation of this computation step.op someMethod: String { return someExpression }The actual expectation of the childsomeExpressionis the return expectation in that context, e.g.java.lang.Stringin the given example.- Specified by:
withReturnExpectationin interfaceITypeComputationState
-
withoutExpectation
public AbstractTypeComputationState withoutExpectation()
Description copied from interface:ITypeComputationStateKeeps the return type expectation. Otherwise the new state does not have any expectations. Example:{ someExpression subsequent }The expectation for the call tosomeExpressiondoes not have any actual expectations.- Specified by:
withoutExpectationin interfaceITypeComputationState
-
withTypeCheckpoint
public TypeCheckpointComputationState withTypeCheckpoint(org.eclipse.emf.ecore.EObject context)
Description copied from interface:ITypeComputationStateA type checkpoint allows to re-specify the type of an identifiable that was already type-computed. The refined type is discarded as soon as the state is left. In that sense, the type checkpoint describes the scope of certain type specializations.- Specified by:
withTypeCheckpointin interfaceITypeComputationState- Parameters:
context- an indicator that describes the context of this type checkpoint, e.g. anXCasePart.
-
withExpectedExceptions
public AbstractTypeComputationState withExpectedExceptions(java.util.List<LightweightTypeReference> declaredExceptionTypes)
- Specified by:
withExpectedExceptionsin interfaceITypeComputationState
-
assignType
public AbstractTypeComputationState assignType(org.eclipse.xtext.common.types.JvmIdentifiableElement element, LightweightTypeReference type)
Description copied from interface:ITypeComputationStateAssigns the type to the given element and makes the element available in the scope. This is fully equivalent toassignType(element, type, true). Each element may only be typed once.- Specified by:
assignTypein interfaceITypeComputationState- Parameters:
element- the identifiable that will be annotated with the given type.type- the type of the element.nullor other invalid types will be treated as error types.- See Also:
ITypeComputationState.assignType(JvmIdentifiableElement, LightweightTypeReference, boolean),ITypeComputationState.addLocalToCurrentScope(JvmIdentifiableElement),ITypeComputationState.assignTypes(),ITypeAssigner
-
assignType
public AbstractTypeComputationState assignType(org.eclipse.xtext.common.types.JvmIdentifiableElement element, LightweightTypeReference type, boolean addToChildScope)
Description copied from interface:ITypeComputationStateAssigns the given type to the given element and optionally adds the element to the scope. Each element may only be typed once.- Specified by:
assignTypein interfaceITypeComputationState- Parameters:
element- the identifiable that will be annotated with the given type.type- the type of the element.nullor other invalid types will be treated as error types.addToChildScope-trueif the element should be added to the child scope,falseif only the type information should be recorded.- See Also:
ITypeAssigner,ITypeComputationState.assignTypes(),ITypeComputationState.addLocalToCurrentScope(JvmIdentifiableElement)
-
addLocalToCurrentScope
public void addLocalToCurrentScope(org.eclipse.xtext.common.types.JvmIdentifiableElement element)
Description copied from interface:ITypeComputationStateAdds the given element as a local variable. An issue is recorded if the new element will shadow an existing element. If the new element has a disallowed name, it will not be added to the scope.- Specified by:
addLocalToCurrentScopein interfaceITypeComputationState- Parameters:
element- the newly added element (e.g. avariableorparameter.- See Also:
FeatureNameValidator
-
addExtensionToCurrentScope
public void addExtensionToCurrentScope(org.eclipse.xtext.common.types.JvmIdentifiableElement extensionProvider)
Description copied from interface:ITypeComputationStateAdds the given element as an extension provider to the current scope.- Specified by:
addExtensionToCurrentScopein interfaceITypeComputationState- Parameters:
extensionProvider- the identifiable that points to the extension provider
-
addTypeToStaticImportScope
public void addTypeToStaticImportScope(org.eclipse.xtext.common.types.JvmDeclaredType type)
Description copied from interface:ITypeComputationStateAdds the given type to the static scope.- Specified by:
addTypeToStaticImportScopein interfaceITypeComputationState- Parameters:
type- the type that is added to the static scope.
-
addTypeToStaticExtensionImportScope
public void addTypeToStaticExtensionImportScope(org.eclipse.xtext.common.types.JvmDeclaredType type)
Description copied from interface:ITypeComputationStateAdds the given type to the static extension scope.- Specified by:
addTypeToStaticExtensionImportScopein interfaceITypeComputationState- Parameters:
type- the type that is added to the static extension scope.
-
addImports
public void addImports(ITypeImporter.Client importer)
Description copied from interface:ITypeComputationStateAllows to add several imports in a bulk operation on a fine grained basis, e.g. it supports to import only a subset of the members of a type.- Specified by:
addImportsin interfaceITypeComputationState
-
addExtensionsToCurrentScope
public void addExtensionsToCurrentScope(java.util.List<? extends org.eclipse.xtext.common.types.JvmIdentifiableElement> extensionProviders)
Description copied from interface:ITypeComputationStateAdds the given elements as extension providers to the current scope. The elements are all treated with equal priority, e.g. their contributed extensions may be ambiguous.- Specified by:
addExtensionsToCurrentScopein interfaceITypeComputationState- Parameters:
extensionProviders- the identifiables that contribute to the extension scope
-
addLocalToCurrentScope
protected void addLocalToCurrentScope(org.eclipse.xtext.naming.QualifiedName elementName, org.eclipse.xtext.common.types.JvmIdentifiableElement element, boolean raiseIssueIfShadowing)
-
assignType
public void assignType(org.eclipse.xtext.naming.QualifiedName name, org.eclipse.xtext.common.types.JvmType rawType, LightweightTypeReference actualType)Description copied from interface:ITypeComputationStateAssigns the given actual type to the raw type which shall be reachable with the given name. This is useful to refine the context of certain expression children, e.g. the body of a lambda expression shall use the visibility constraints of the implemented SAM type.assignType(IFeatureNames.SELF, 'java.util.Comparator', 'java.util.Comparator<String>');- Specified by:
assignTypein interfaceITypeComputationState- Parameters:
name- the name of the feature that should point to the given type, e.g.IFeatureNames.THISrawType- the type that declares the context of the expression.actualType- the context type with bound type arguments (possibly unresolved).
-
assignTypes
public TypeAssigner assignTypes()
Description copied from interface:ITypeComputationStateObtain a newITypeAssignerthat allows to add a bulk ofelementsto this computation state.- Specified by:
assignTypesin interfaceITypeComputationState
-
addDiagnostic
public void addDiagnostic(org.eclipse.xtext.diagnostics.AbstractDiagnostic diagnostic)
Description copied from interface:ITypeComputationStateAdds the given diagnostic to the current state. If this state is later discarded in favor of a better solution, the diagnostic is discarded, too.- Specified by:
addDiagnosticin interfaceITypeComputationState
-
createTypeAssigner
protected TypeAssigner createTypeAssigner(AbstractTypeComputationState state)
-
getExpectations
public final java.util.List<? extends ITypeExpectation> getExpectations()
Description copied from interface:ITypeComputationStateThe result is never empty.- Specified by:
getExpectationsin interfaceITypeComputationState
-
getReturnExpectations
protected final java.util.List<? extends ITypeExpectation> getReturnExpectations()
-
getExpectations
protected abstract java.util.List<AbstractTypeExpectation> getExpectations(AbstractTypeComputationState actualState)
-
getReturnExpectations
protected abstract java.util.List<AbstractTypeExpectation> getReturnExpectations(AbstractTypeComputationState actualState, boolean asActualExpectation)
-
acceptCandidate
public void acceptCandidate(XExpression expression, IApplicableCandidate candidate)
Description copied from interface:ITypeComputationStateAllows to register a candidate that gets the chance to validate or change the state of the AST in a subsequent processing step.- Specified by:
acceptCandidatein interfaceITypeComputationState- Parameters:
expression- the expression that the given candidate is associated with.candidate- the candidate to validate if it is still present at the root of the decision tree.- See Also:
IClosureCandidate
-
acceptActualType
public void acceptActualType(LightweightTypeReference type)
Description copied from interface:ITypeComputationStateAnnotates the currently considered expression(s) with the given type. It is assumed that the type does not depend on the expectation.- Specified by:
acceptActualTypein interfaceITypeComputationState
-
acceptActualType
public void acceptActualType(LightweightTypeReference type, ConformanceHint... hints)
Description copied from interface:ITypeComputationStateAnnotates the currently considered expression(s) with the given type. It is assumed that the type does not depend on the expectation. The conformance hints are used to decide which variant will be finally chosen, if more than one type was given.- Specified by:
acceptActualTypein interfaceITypeComputationState
-
acceptActualType
public void acceptActualType(LightweightTypeReference type, java.util.EnumSet<ConformanceHint> hints)
Description copied from interface:ITypeComputationStateAnnotates the currently considered expression(s) with the given type. It is assumed that the type does not depend on the expectation. The conformance hints are used to decide which variant will be finally chosen, if more than one type was given.- Specified by:
acceptActualTypein interfaceITypeComputationState
-
acceptActualType
public void acceptActualType(LightweightTypeReference type, int flags)
Description copied from interface:ITypeComputationStateAnnotates the currently considered expression(s) with the given type. It is assumed that the type does not depend on the expectation. The flags are used to decide which variant will be finally chosen, if more than one type was given.- Specified by:
acceptActualTypein interfaceITypeComputationState- See Also:
ConformanceFlags
-
reassignType
public void reassignType(org.eclipse.xtext.common.types.JvmIdentifiableElement refinable, LightweightTypeReference type)Description copied from interface:ITypeComputationStateAllows to specialize the known type of an identifiable, that was already annotated with a type. Type refinements may be used to save casts. Usually only simple identifiables should be refined, e.g.local variables. It's the clients responsibility to decide about that. Example:val Object x = obtainInstance if (x instanceof String && x.length > 0) { x.substring(1) }The instanceof expression may refine the type for subsequent expressions, e.g. in boolean conditions or blocks.- Specified by:
reassignTypein interfaceITypeComputationState
-
discardReassignedTypes
public void discardReassignedTypes(org.eclipse.xtext.common.types.JvmIdentifiableElement refinable)
Description copied from interface:ITypeComputationStateA reassigned type may become obsolete due to assignments. Those should discard the reassign information. Example:var node = someNode; while(node instanceof ContainerNode) { node = node.container node.container // type error }After the assignment in the while loop, the node is no longer considered to be a ContainerNode.- Specified by:
discardReassignedTypesin interfaceITypeComputationState
-
getLinkingCandidates
public java.util.List<IFeatureLinkingCandidate> getLinkingCandidates(XAbstractFeatureCall featureCall)
Description copied from interface:ITypeComputationStateThe result is never empty.- Specified by:
getLinkingCandidatesin interfaceITypeComputationState
-
createResolvedLink
protected IFeatureLinkingCandidate createResolvedLink(XAbstractFeatureCall featureCall, org.eclipse.xtext.common.types.JvmIdentifiableElement resolvedTo)
-
createCandidate
protected IFeatureLinkingCandidate createCandidate(XAbstractFeatureCall featureCall, StackedResolvedTypes demandComputedTypes, IIdentifiableElementDescription description)
-
getSingleExpectation
protected ITypeExpectation getSingleExpectation(ITypeComputationState state)
-
createCandidateWithReceiverType
protected IFeatureLinkingCandidate createCandidateWithReceiverType(XAbstractFeatureCall featureCall, StackedResolvedTypes demandComputedTypes, IIdentifiableElementDescription description)
-
getLinkingCandidates
public java.util.List<IConstructorLinkingCandidate> getLinkingCandidates(XConstructorCall constructorCall)
Description copied from interface:ITypeComputationStateThe result is never empty.- Specified by:
getLinkingCandidatesin interfaceITypeComputationState
-
toIdentifiableDescription
protected IIdentifiableElementDescription toIdentifiableDescription(org.eclipse.xtext.resource.IEObjectDescription description)
-
createResolvedLink
protected IConstructorLinkingCandidate createResolvedLink(XConstructorCall constructorCall, org.eclipse.xtext.common.types.JvmConstructor resolvedTo)
-
createCandidate
protected IConstructorLinkingCandidate createCandidate(XConstructorCall constructorCall, IIdentifiableElementDescription description)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getReferenceOwner
public ITypeReferenceOwner getReferenceOwner()
Description copied from interface:ITypeComputationStateThe current type reference owner for newly converted type references.- Specified by:
getReferenceOwnerin interfaceITypeComputationState
-
createUnboundTypeReference
public UnboundTypeReference createUnboundTypeReference(XExpression expression, org.eclipse.xtext.common.types.JvmTypeParameter typeParameter)
Description copied from interface:ITypeComputationStateCreate a new, managedUnboundTypeReferencefor the given type parameter which was first encountered for the given expression.- Specified by:
createUnboundTypeReferencein interfaceITypeComputationState- Parameters:
expression- the expression that used / referenced the type parametertypeParameter- the type parameter
-
getExpectedExceptions
public java.util.List<LightweightTypeReference> getExpectedExceptions()
- Specified by:
getExpectedExceptionsin interfaceITypeComputationState
-
getSeverities
protected org.eclipse.xtext.validation.IssueSeverities getSeverities()
-
getSeverity
public org.eclipse.xtext.diagnostics.Severity getSeverity(java.lang.String issueCode)
Description copied from interface:ITypeComputationStateReturns the severity for the givenissueCode.- Specified by:
getSeverityin interfaceITypeComputationState
-
isIgnored
public boolean isIgnored(java.lang.String issueCode)
Description copied from interface:ITypeComputationStateReturnsfalseif no issues have to be produced for the given issueCode.- Specified by:
isIgnoredin interfaceITypeComputationState
-
withinScope
public void withinScope(org.eclipse.emf.ecore.EObject context)
Description copied from interface:ITypeComputationStateIf the expression tree contains expressions that define a new scope, e.g. add local variables to the scope as aXForLoopExpressionwould do, the scope for contained expressions may be explicitly recorded by announcing that the inference is now done within that newly created scope.- Specified by:
withinScopein interfaceITypeComputationState
-
afterScope
public void afterScope(org.eclipse.emf.ecore.EObject context)
Description copied from interface:ITypeComputationStateIf the expression tree contains intermediate objects, e.g.XCasePartorXCatchClause, one can explicitly record the scope of these objects as these won't be processed by the inference infrastructure.- Specified by:
afterScopein interfaceITypeComputationState
-
rewriteScope
public void rewriteScope(org.eclipse.emf.ecore.EObject context)
Description copied from interface:ITypeComputationStateIf the container of an expression decides to alter the scope after the expression was typed, its AFTER scope may be rewritten.- Specified by:
rewriteScopein interfaceITypeComputationState
-
-