org.eclipse.xtext.xtend2.typing
Class Xtend2TypeProvider

java.lang.Object
  extended by org.eclipse.xtext.xbase.typing.AbstractTypeProvider
      extended by org.eclipse.xtext.xbase.typing.XbaseTypeProvider
          extended by org.eclipse.xtext.xbase.annotations.typing.XbaseWithAnnotationsTypeProvider
              extended by org.eclipse.xtext.xtend2.typing.Xtend2TypeProvider
All Implemented Interfaces:
ITypeArgumentContextHelper, ITypeProvider

public class Xtend2TypeProvider
extends XbaseWithAnnotationsTypeProvider

Type provider that is aware of Xtend specific expressions and the inferred JVM model.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.xtext.xbase.typing.AbstractTypeProvider
AbstractTypeProvider.EarlyExitAcceptor, AbstractTypeProvider.ImmutableLinkedItem<T>
 
Field Summary
 
Fields inherited from class org.eclipse.xtext.xbase.typing.AbstractTypeProvider
getExpectedType, getType, getTypeForIdentifiable
 
Constructor Summary
Xtend2TypeProvider()
           
 
Method Summary
protected  JvmTypeReference _expectedType(CreateExtensionInfo info, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _expectedType(RichStringElseIf container, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _expectedType(RichStringForLoop expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _expectedType(RichStringIf container, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _expectedType(XtendFunction function, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _type(RichStringForLoop richStringFor, JvmTypeReference rawExpectation, boolean rawType)
           
protected  JvmTypeReference _type(RichStringIf richStringIf, JvmTypeReference rawExpectation, boolean rawType)
           
protected  JvmTypeReference _type(RichString richString, JvmTypeReference rawExpectation, boolean rawType)
           
protected  JvmTypeReference _type(RichStringLiteral stringLiteral, JvmTypeReference rawExpectation, boolean rawType)
           
protected  JvmTypeReference _typeForIdentifiable(XtendClass clazz, boolean rawType)
           
protected  JvmTypeReference _typeForIdentifiable(XtendClassSuperCallReferable referable, boolean rawType)
           
protected  JvmTypeReference _typeForIdentifiable(XtendParameter param, boolean rawType)
           
protected  JvmTypeReference expectedType(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
 JvmTypeReference getExpectedReturnType(XExpression expr, boolean rawType)
          Return the expected return type of the given expression.
 java.lang.Iterable<JvmTypeReference> getThrownExceptionForIdentifiable(JvmIdentifiableElement identifiable)
          returns the exception types, declared to be thrown by referencing / executing the passed JvmIdentifiableElement.
protected  java.lang.Iterable<JvmTypeReference> getThrownExceptions(XtendFunction xtendFunction)
           
protected  JvmTypeReference type(XExpression expression, JvmTypeReference rawExpectation, boolean rawType)
           
protected  JvmTypeReference typeForIdentifiable(JvmIdentifiableElement identifiable, boolean rawType)
           
 
Methods inherited from class org.eclipse.xtext.xbase.annotations.typing.XbaseWithAnnotationsTypeProvider
_expectedType, _expectedType, _expectedType, _expectedType, _type, _type, _type
 
Methods inherited from class org.eclipse.xtext.xbase.typing.XbaseTypeProvider
_earlyExits, _earlyExits, _earlyExits, _earlyExits, _earlyExits, _earlyExits, _expectedType, _expectedType, _expectedType, _expectedType, _expectedType, _expectedType, _expectedType, _expectedType, _expectedType, _expectedType, _expectedType, _expectedType, _expectedType, _expectedType, _expectedType, _expectedType, _expectedType, _expectedType, _type, _type, _type, _type, _type, _type, _type, _type, _type, _type, _type, _type, _type, _type, _type, _type, _type, _type, _type, _typeForIdentifiable, _typeForIdentifiable, _typeForIdentifiable, _typeForIdentifiable, _typeForIdentifiable, _typeForIdentifiable, _typeForIdentifiable, _typeForIdentifiable, _typeForIdentifiable, getArgumentTypes, getArgumentTypes, getCommonType, getExpectedVarArgType, getExpression, getFeatureCallTypeArgContext, getParam, getPrimitiveVoid, getReceiverType, getTypeArgumentContext, getTypeArgumentContext, getTypesFactory, handleCycleGetExpectedType, handleCycleGetTypeForIdentifiable, isFilteredFromCommonTypesList
 
Methods inherited from class org.eclipse.xtext.xbase.typing.AbstractTypeProvider
_earlyExits, _earlyExits, _earlyExits, _type, _typeForIdentifiable, checkIsSingelton, doGetType, getCommonReturnType, getConstructor, getConstructor, getContainingInfo, getDebugIndentation, getExpectedType, getExpectedType, getFeature, getFeature, getLogicalOrRealContainer, getLogicalOrRealContainer, getNearestTypeParameterDeclarator, getThrownExceptionTypes, getType, getType, getType, getTypeArgumentContextProvider, getTypeConformanceComputer, getTypeForIdentifiable, getTypeForIdentifiable, getTypeReferences, handleCyclicGetType, internalCollectEarlyExits, isDeclaratorOf, isResolved, isResolved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Xtend2TypeProvider

public Xtend2TypeProvider()
Method Detail

typeForIdentifiable

protected JvmTypeReference typeForIdentifiable(JvmIdentifiableElement identifiable,
                                               boolean rawType)
Overrides:
typeForIdentifiable in class XbaseTypeProvider

type

protected JvmTypeReference type(XExpression expression,
                                JvmTypeReference rawExpectation,
                                boolean rawType)
Overrides:
type in class XbaseWithAnnotationsTypeProvider

expectedType

protected JvmTypeReference expectedType(org.eclipse.emf.ecore.EObject container,
                                        org.eclipse.emf.ecore.EReference reference,
                                        int index,
                                        boolean rawType)
Overrides:
expectedType in class XbaseWithAnnotationsTypeProvider

_expectedType

protected JvmTypeReference _expectedType(XtendFunction function,
                                         org.eclipse.emf.ecore.EReference reference,
                                         int index,
                                         boolean rawType)

_expectedType

protected JvmTypeReference _expectedType(CreateExtensionInfo info,
                                         org.eclipse.emf.ecore.EReference reference,
                                         int index,
                                         boolean rawType)

getExpectedReturnType

public JvmTypeReference getExpectedReturnType(XExpression expr,
                                              boolean rawType)
Description copied from interface: ITypeProvider
Return the expected return type of the given expression.

Specified by:
getExpectedReturnType in interface ITypeProvider
Overrides:
getExpectedReturnType in class XbaseTypeProvider
Parameters:
expr - the expression. May not be null.
rawType - true if the raw type is sufficient.
Returns:
the expected return type of the given expression, if a correct, fully-linkable model is given. Returns null if no special return type is expected

_type

protected JvmTypeReference _type(RichString richString,
                                 JvmTypeReference rawExpectation,
                                 boolean rawType)

_type

protected JvmTypeReference _type(RichStringLiteral stringLiteral,
                                 JvmTypeReference rawExpectation,
                                 boolean rawType)

_type

protected JvmTypeReference _type(RichStringIf richStringIf,
                                 JvmTypeReference rawExpectation,
                                 boolean rawType)

_type

protected JvmTypeReference _type(RichStringForLoop richStringFor,
                                 JvmTypeReference rawExpectation,
                                 boolean rawType)

_expectedType

protected JvmTypeReference _expectedType(RichStringIf container,
                                         org.eclipse.emf.ecore.EReference reference,
                                         int index,
                                         boolean rawType)

_expectedType

protected JvmTypeReference _expectedType(RichStringElseIf container,
                                         org.eclipse.emf.ecore.EReference reference,
                                         int index,
                                         boolean rawType)

_expectedType

protected JvmTypeReference _expectedType(RichStringForLoop expr,
                                         org.eclipse.emf.ecore.EReference reference,
                                         int index,
                                         boolean rawType)

_typeForIdentifiable

protected JvmTypeReference _typeForIdentifiable(XtendParameter param,
                                                boolean rawType)

_typeForIdentifiable

protected JvmTypeReference _typeForIdentifiable(XtendClass clazz,
                                                boolean rawType)

_typeForIdentifiable

protected JvmTypeReference _typeForIdentifiable(XtendClassSuperCallReferable referable,
                                                boolean rawType)

getThrownExceptionForIdentifiable

public java.lang.Iterable<JvmTypeReference> getThrownExceptionForIdentifiable(JvmIdentifiableElement identifiable)
Description copied from interface: ITypeProvider
returns the exception types, declared to be thrown by referencing / executing the passed JvmIdentifiableElement. This includes explicitly declared RuntimeExceptions as well.

Specified by:
getThrownExceptionForIdentifiable in interface ITypeProvider
Overrides:
getThrownExceptionForIdentifiable in class XbaseTypeProvider
Parameters:
identifiable - May not be null.
Returns:
the iterable of fully-resolved exception types, if a correct, fully-linkable model is given. null indicates a problem during computation, an empty iterable means no thrown exceptions were found.

getThrownExceptions

protected java.lang.Iterable<JvmTypeReference> getThrownExceptions(XtendFunction xtendFunction)