org.eclipse.xtext.xbase.typing
Class XbaseTypeProvider

java.lang.Object
  extended by org.eclipse.xtext.xbase.typing.AbstractTypeProvider
      extended by org.eclipse.xtext.xbase.typing.XbaseTypeProvider
All Implemented Interfaces:
ITypeProvider
Direct Known Subclasses:
XbaseWithAnnotationsTypeProvider

public class XbaseTypeProvider
extends AbstractTypeProvider

Author:
Sven Efftinge

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.xtext.xbase.typing.AbstractTypeProvider
AbstractTypeProvider.ComputationData<T extends org.eclipse.emf.ecore.EObject>, AbstractTypeProvider.EarlyExitAcceptor, AbstractTypeProvider.ImmutableLinkedItem
 
Field Summary
 
Fields inherited from class org.eclipse.xtext.xbase.typing.AbstractTypeProvider
getExpectedType, getType, getTypeForIdentifiable
 
Constructor Summary
XbaseTypeProvider()
           
 
Method Summary
protected  void _earlyExits(XAbstractFeatureCall expr, AbstractTypeProvider.EarlyExitAcceptor acceptor)
           
protected  void _earlyExits(XClosure expr, AbstractTypeProvider.EarlyExitAcceptor a)
           
protected  void _earlyExits(XConstructorCall expr, AbstractTypeProvider.EarlyExitAcceptor acceptor)
           
protected  void _earlyExits(XReturnExpression expr, AbstractTypeProvider.EarlyExitAcceptor acceptor)
           
protected  void _earlyExits(XThrowExpression expr, AbstractTypeProvider.EarlyExitAcceptor acceptor)
           
protected  void _earlyExits(XTryCatchFinallyExpression expr, AbstractTypeProvider.EarlyExitAcceptor acceptor)
           
protected  JvmTypeReference _expectedType(XAbstractFeatureCall featureCall, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _expectedType(XAbstractWhileExpression expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _expectedType(XAssignment assignment, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _expectedType(XBinaryOperation expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _expectedType(XBlockExpression expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _expectedType(XCasePart expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _expectedType(XCastedExpression expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _expectedType(XCatchClause expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _expectedType(XClosure closure, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _expectedType(XConstructorCall expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _expectedType(XForLoopExpression expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _expectedType(XIfExpression expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _expectedType(XReturnExpression expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _expectedType(XSwitchExpression expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _expectedType(XThrowExpression expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _expectedType(XTryCatchFinallyExpression expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _expectedType(XVariableDeclaration expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmTypeReference _type(XAbstractFeatureCall featureCall, boolean rawType)
           
protected  JvmTypeReference _type(XAbstractWhileExpression object, boolean rawType)
           
protected  JvmTypeReference _type(XBlockExpression object, boolean rawType)
           
protected  JvmTypeReference _type(XBooleanLiteral object, boolean rawType)
           
protected  JvmTypeReference _type(XCastedExpression object, boolean rawType)
           
protected  JvmTypeReference _type(XClosure object, boolean rawType)
           
protected  JvmTypeReference _type(XConstructorCall constructorCall, boolean rawType)
           
protected  JvmTypeReference _type(XForLoopExpression object, boolean rawType)
           
protected  JvmTypeReference _type(XIfExpression object, boolean rawType)
           
protected  JvmTypeReference _type(XInstanceOfExpression object, boolean rawType)
           
protected  JvmTypeReference _type(XIntLiteral object, boolean rawType)
           
protected  JvmTypeReference _type(XNullLiteral object, boolean rawType)
           
protected  JvmTypeReference _type(XReturnExpression object, boolean rawType)
           
protected  JvmTypeReference _type(XStringLiteral object, boolean rawType)
           
protected  JvmTypeReference _type(XSwitchExpression object, boolean rawType)
           
protected  JvmTypeReference _type(XThrowExpression object, boolean rawType)
           
protected  JvmTypeReference _type(XTryCatchFinallyExpression object, boolean rawType)
           
protected  JvmTypeReference _type(XTypeLiteral object, boolean rawType)
           
protected  JvmTypeReference _type(XVariableDeclaration object, boolean rawType)
           
protected  JvmTypeReference _typeForIdentifiable(JvmConstructor constructor, boolean rawType)
           
protected  JvmTypeReference _typeForIdentifiable(JvmField field, boolean rawType)
           
protected  JvmTypeReference _typeForIdentifiable(JvmFormalParameter parameter, boolean rawType)
           
protected  JvmTypeReference _typeForIdentifiable(JvmOperation operation, boolean rawType)
           
protected  JvmTypeReference _typeForIdentifiable(JvmType type, boolean rawType)
           
protected  JvmTypeReference _typeForIdentifiable(XCasePart object, boolean rawType)
           
protected  JvmTypeReference _typeForIdentifiable(XSwitchExpression object, boolean rawType)
           
protected  JvmTypeReference _typeForIdentifiable(XVariableDeclaration object, boolean rawType)
           
protected  JvmTypeReference convertIfNeccessary(XAbstractFeatureCall context, JvmTypeReference toBeConverted, JvmIdentifiableElement feature, boolean rawType)
           
protected  JvmTypeReference[] getArgumentTypes(JvmExecutable executable, java.util.List<XExpression> actualArguments, boolean rawType)
           
protected  JvmTypeReference[] getArgumentTypes(XAbstractFeatureCall expr, boolean rawType)
           
protected  JvmTypeReference getCommonType(java.util.List<JvmTypeReference> types)
          Returns the common type of the given types.
protected  JvmTypeReference getExpectedVarArgType(JvmExecutable feature, TypeArgumentContext typeArgumentContext, boolean rawType)
           
protected  XExpression getExpression(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EReference reference, int index)
           
protected  TypeArgumentContext getFeatureCallTypeArgContext(XAbstractFeatureCall expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
           
protected  JvmFormalParameter getParam(JvmExecutable executable, int i)
           
protected  JvmTypeReference getPrimitiveVoid(XExpression object)
           
protected  JvmTypeReference getReceiverType(XAbstractFeatureCall expr, boolean rawType)
           
 java.lang.Iterable<JvmTypeReference> getThrownExceptionForIdentifiable(JvmIdentifiableElement identifiable)
          returns the exception types, declared to be thrown by referencing / executing the passed JvmIdentifiableElement.
protected  TypesFactory getTypesFactory()
           
protected  JvmTypeReference handleCycleGetExpectedType(XExpression expression, boolean rawType)
           
protected  JvmTypeReference handleCycleGetTypeForIdentifiable(JvmIdentifiableElement identifiableElement, boolean rawType)
           
protected  boolean isFilteredFromCommonTypesList(JvmTypeReference reference)
           
 
Methods inherited from class org.eclipse.xtext.xbase.typing.AbstractTypeProvider
_earlyExits, _earlyExits, _earlyExits, _expectedType, _type, _typeForIdentifiable, checkIsSingelton, doGetType, getCommonReturnType, getContainingInfo, getDebugIndentation, getExpectedType, getExpectedType, getNearestTypeParameterDeclarator, getThrownExceptionTypes, getType, getType, getTypeArgumentContextProvider, getTypeConformanceComputer, getTypeForIdentifiable, getTypeForIdentifiable, getTypeReferences, handleCyclicGetType, internalCollectEarlyExits, isDeclaratorOf, isResolved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XbaseTypeProvider

public XbaseTypeProvider()
Method Detail

_expectedType

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

getExpression

protected XExpression getExpression(org.eclipse.emf.ecore.EObject object,
                                    org.eclipse.emf.ecore.EReference reference,
                                    int index)

_expectedType

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

_expectedType

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

handleCycleGetExpectedType

protected JvmTypeReference handleCycleGetExpectedType(XExpression expression,
                                                      boolean rawType)
Overrides:
handleCycleGetExpectedType in class AbstractTypeProvider

getFeatureCallTypeArgContext

protected TypeArgumentContext getFeatureCallTypeArgContext(XAbstractFeatureCall expr,
                                                           org.eclipse.emf.ecore.EReference reference,
                                                           int index,
                                                           boolean rawType)

getArgumentTypes

protected JvmTypeReference[] getArgumentTypes(XAbstractFeatureCall expr,
                                              boolean rawType)

getArgumentTypes

protected JvmTypeReference[] getArgumentTypes(JvmExecutable executable,
                                              java.util.List<XExpression> actualArguments,
                                              boolean rawType)

getParam

protected JvmFormalParameter getParam(JvmExecutable executable,
                                      int i)

getReceiverType

protected JvmTypeReference getReceiverType(XAbstractFeatureCall expr,
                                           boolean rawType)

_expectedType

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

_expectedType

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

_expectedType

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

getExpectedVarArgType

protected JvmTypeReference getExpectedVarArgType(JvmExecutable feature,
                                                 TypeArgumentContext typeArgumentContext,
                                                 boolean rawType)

_expectedType

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

_expectedType

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

_expectedType

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

_expectedType

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

_expectedType

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

_expectedType

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

_expectedType

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

_expectedType

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

_expectedType

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

_expectedType

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

_expectedType

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

_type

protected JvmTypeReference _type(XIfExpression object,
                                 boolean rawType)

getCommonType

protected JvmTypeReference getCommonType(java.util.List<JvmTypeReference> types)
Returns the common type of the given types. Filters for primitive voids and unresolved types prior to asking the TypeConformanceComputer.


isFilteredFromCommonTypesList

protected boolean isFilteredFromCommonTypesList(JvmTypeReference reference)

_type

protected JvmTypeReference _type(XSwitchExpression object,
                                 boolean rawType)

_type

protected JvmTypeReference _type(XBlockExpression object,
                                 boolean rawType)

_type

protected JvmTypeReference _type(XVariableDeclaration object,
                                 boolean rawType)

_type

protected JvmTypeReference _type(XConstructorCall constructorCall,
                                 boolean rawType)

_type

protected JvmTypeReference _type(XBooleanLiteral object,
                                 boolean rawType)

_type

protected JvmTypeReference _type(XNullLiteral object,
                                 boolean rawType)

_type

protected JvmTypeReference _type(XIntLiteral object,
                                 boolean rawType)

_type

protected JvmTypeReference _type(XStringLiteral object,
                                 boolean rawType)

_type

protected JvmTypeReference _type(XClosure object,
                                 boolean rawType)

_type

protected JvmTypeReference _type(XCastedExpression object,
                                 boolean rawType)

_type

protected JvmTypeReference _type(XForLoopExpression object,
                                 boolean rawType)

_type

protected JvmTypeReference _type(XAbstractWhileExpression object,
                                 boolean rawType)

_type

protected JvmTypeReference _type(XTypeLiteral object,
                                 boolean rawType)

_type

protected JvmTypeReference _type(XInstanceOfExpression object,
                                 boolean rawType)

_type

protected JvmTypeReference _type(XThrowExpression object,
                                 boolean rawType)

_type

protected JvmTypeReference _type(XReturnExpression object,
                                 boolean rawType)

getPrimitiveVoid

protected JvmTypeReference getPrimitiveVoid(XExpression object)

_type

protected JvmTypeReference _type(XTryCatchFinallyExpression object,
                                 boolean rawType)

_type

protected JvmTypeReference _type(XAbstractFeatureCall featureCall,
                                 boolean rawType)

convertIfNeccessary

protected JvmTypeReference convertIfNeccessary(XAbstractFeatureCall context,
                                               JvmTypeReference toBeConverted,
                                               JvmIdentifiableElement feature,
                                               boolean rawType)

_typeForIdentifiable

protected JvmTypeReference _typeForIdentifiable(XSwitchExpression object,
                                                boolean rawType)

_typeForIdentifiable

protected JvmTypeReference _typeForIdentifiable(XCasePart object,
                                                boolean rawType)

_typeForIdentifiable

protected JvmTypeReference _typeForIdentifiable(XVariableDeclaration object,
                                                boolean rawType)

_typeForIdentifiable

protected JvmTypeReference _typeForIdentifiable(JvmFormalParameter parameter,
                                                boolean rawType)

handleCycleGetTypeForIdentifiable

protected JvmTypeReference handleCycleGetTypeForIdentifiable(JvmIdentifiableElement identifiableElement,
                                                             boolean rawType)
Overrides:
handleCycleGetTypeForIdentifiable in class AbstractTypeProvider

_typeForIdentifiable

protected JvmTypeReference _typeForIdentifiable(JvmConstructor constructor,
                                                boolean rawType)

_typeForIdentifiable

protected JvmTypeReference _typeForIdentifiable(JvmField field,
                                                boolean rawType)

_typeForIdentifiable

protected JvmTypeReference _typeForIdentifiable(JvmOperation operation,
                                                boolean rawType)

_typeForIdentifiable

protected JvmTypeReference _typeForIdentifiable(JvmType type,
                                                boolean rawType)

_earlyExits

protected void _earlyExits(XClosure expr,
                           AbstractTypeProvider.EarlyExitAcceptor a)

_earlyExits

protected void _earlyExits(XReturnExpression expr,
                           AbstractTypeProvider.EarlyExitAcceptor acceptor)

_earlyExits

protected void _earlyExits(XThrowExpression expr,
                           AbstractTypeProvider.EarlyExitAcceptor acceptor)

_earlyExits

protected void _earlyExits(XConstructorCall expr,
                           AbstractTypeProvider.EarlyExitAcceptor acceptor)

_earlyExits

protected void _earlyExits(XAbstractFeatureCall expr,
                           AbstractTypeProvider.EarlyExitAcceptor acceptor)

_earlyExits

protected void _earlyExits(XTryCatchFinallyExpression expr,
                           AbstractTypeProvider.EarlyExitAcceptor acceptor)

getTypesFactory

protected TypesFactory getTypesFactory()

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.

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.