|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.xtext.xbase.typing.AbstractTypeProvider org.eclipse.xtext.xbase.typing.XbaseTypeProvider
public class XbaseTypeProvider
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 | |
---|---|
XbaseTypeProvider()
|
Method Summary | |
---|---|
protected void |
_earlyExits(XAbstractFeatureCall expr,
AbstractTypeProvider.EarlyExitAcceptor acceptor)
|
protected void |
_earlyExits(XClosure expr,
AbstractTypeProvider.EarlyExitAcceptor a)
Closures don't exit early and nested expressions have no impact on the container. |
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(org.eclipse.emf.ecore.EObject obj,
org.eclipse.emf.ecore.EReference reference,
int index,
boolean rawType)
|
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,
JvmTypeReference rawExpectation,
boolean rawType)
|
protected JvmTypeReference |
_type(XAbstractWhileExpression object,
JvmTypeReference rawExpectation,
boolean rawType)
|
protected JvmTypeReference |
_type(XBlockExpression object,
JvmTypeReference rawExpectation,
boolean rawType)
|
protected JvmTypeReference |
_type(XBooleanLiteral object,
JvmTypeReference rawExpectation,
boolean rawType)
|
protected JvmTypeReference |
_type(XCastedExpression object,
JvmTypeReference rawExpectation,
boolean rawType)
|
protected JvmTypeReference |
_type(XClosure object,
JvmTypeReference rawExpectation,
boolean rawType)
|
protected JvmTypeReference |
_type(XConstructorCall constructorCall,
JvmTypeReference rawExpectation,
boolean rawType)
|
protected JvmTypeReference |
_type(XFeatureCall featureCall,
JvmTypeReference rawExpectation,
boolean rawType)
|
protected JvmTypeReference |
_type(XForLoopExpression object,
JvmTypeReference rawExpectation,
boolean rawType)
|
protected JvmTypeReference |
_type(XIfExpression object,
JvmTypeReference rawExpectation,
boolean rawType)
|
protected JvmTypeReference |
_type(XInstanceOfExpression object,
JvmTypeReference rawExpectation,
boolean rawType)
|
protected JvmTypeReference |
_type(XNullLiteral object,
JvmTypeReference rawExpectation,
boolean rawType)
|
protected JvmTypeReference |
_type(XNumberLiteral object,
JvmTypeReference rawExpectation,
boolean rawType)
|
protected JvmTypeReference |
_type(XReturnExpression object,
JvmTypeReference rawExpectation,
boolean rawType)
|
protected JvmTypeReference |
_type(XStringLiteral object,
JvmTypeReference rawExpectation,
boolean rawType)
|
protected JvmTypeReference |
_type(XSwitchExpression object,
JvmTypeReference rawExpectation,
boolean rawType)
|
protected JvmTypeReference |
_type(XThrowExpression object,
JvmTypeReference rawExpectation,
boolean rawType)
|
protected JvmTypeReference |
_type(XTryCatchFinallyExpression object,
JvmTypeReference rawExpectation,
boolean rawType)
|
protected JvmTypeReference |
_type(XTypeLiteral object,
JvmTypeReference rawExpectation,
boolean rawType)
|
protected JvmTypeReference |
_type(XVariableDeclaration object,
JvmTypeReference rawExpectation,
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(JvmGenericType thisOrSuper,
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 |
expectedType(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EReference reference,
int index,
boolean rawType)
|
protected XCasePart |
findTypeGuardedXCasePartContainer(org.eclipse.emf.ecore.EObject context,
XFeatureCall call)
|
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. |
JvmTypeReference |
getExpectedReturnType(XExpression expr,
boolean rawType)
Return the expected return type of the given expression. |
protected JvmTypeReference |
getExpectedVarArgType(JvmExecutable feature,
ITypeArgumentContext typeArgumentContext,
boolean rawType,
boolean forceComponentType)
|
protected XExpression |
getExpression(org.eclipse.emf.ecore.EObject object,
org.eclipse.emf.ecore.EReference reference,
int index)
|
protected ITypeArgumentContext |
getFeatureCallTypeArgContext(XAbstractFeatureCall expr,
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 . |
ITypeArgumentContext |
getTypeArgumentContext(XAbstractFeatureCall featureCall,
java.util.List<XExpression> actualArguments,
com.google.inject.Provider<JvmTypeReference> receiverTypeProvider,
JvmIdentifiableElement feature)
|
ITypeArgumentContext |
getTypeArgumentContext(XConstructorCall constructorCall,
JvmConstructor constructor)
|
protected TypesFactory |
getTypesFactory()
|
protected JvmTypeReference |
handleCycleGetExpectedType(XExpression expression,
boolean rawType)
Allows to handle cyclic resolution of expected types. |
protected JvmTypeReference |
handleCycleGetTypeForIdentifiable(JvmIdentifiableElement identifiableElement,
boolean rawType)
Allows to handle cyclic resolution of types. |
protected boolean |
isFilteredFromCommonTypesList(JvmTypeReference reference)
|
protected JvmTypeReference |
type(XExpression expression,
JvmTypeReference rawExpectation,
boolean rawType)
|
protected JvmTypeReference |
typeForIdentifiable(JvmIdentifiableElement identifiable,
boolean rawType)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XbaseTypeProvider()
Method Detail |
---|
protected JvmTypeReference _expectedType(org.eclipse.emf.ecore.EObject obj, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
_expectedType
in class AbstractTypeProvider
obj
- the container that owns the expression that may have a type expectation.reference
- the reference that can be used to obtain the expression with a type expectation.index
- the index if reference
is a multi value
feature.rawType
- true
if we are only interested in the type parameter.protected JvmTypeReference typeForIdentifiable(JvmIdentifiableElement identifiable, boolean rawType)
typeForIdentifiable
in class AbstractTypeProvider
protected JvmTypeReference type(XExpression expression, JvmTypeReference rawExpectation, boolean rawType)
type
in class AbstractTypeProvider
protected JvmTypeReference expectedType(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
expectedType
in class AbstractTypeProvider
protected JvmTypeReference _expectedType(XAssignment assignment, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
protected XExpression getExpression(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EReference reference, int index)
protected JvmTypeReference _expectedType(XAbstractFeatureCall featureCall, 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)
index
- the feature indexprotected JvmTypeReference handleCycleGetExpectedType(XExpression expression, boolean rawType)
AbstractTypeProvider
handleCycleGetExpectedType
in class AbstractTypeProvider
expression
- the expression that was asked reentrant for its expected type.rawType
- true
if we are only interested in the raw typeprotected ITypeArgumentContext getFeatureCallTypeArgContext(XAbstractFeatureCall expr, boolean rawType)
protected JvmTypeReference[] getArgumentTypes(XAbstractFeatureCall expr, boolean rawType)
protected JvmTypeReference[] getArgumentTypes(JvmExecutable executable, java.util.List<XExpression> actualArguments, boolean rawType)
protected JvmFormalParameter getParam(JvmExecutable executable, int i)
protected JvmTypeReference getReceiverType(XAbstractFeatureCall expr, boolean rawType)
protected JvmTypeReference _expectedType(XBinaryOperation 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)
index
- the feature indexrawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _expectedType(XConstructorCall expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
protected JvmTypeReference getExpectedVarArgType(JvmExecutable feature, ITypeArgumentContext typeArgumentContext, boolean rawType, boolean forceComponentType)
rawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _expectedType(XBlockExpression 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)
index
- the feature indexrawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _expectedType(XForLoopExpression expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
expr
- the for loop expression whose expected child type shall be computed. May not be null
.reference
- the feature that describes the child whose type is expectedindex
- the feature indexrawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _expectedType(XAbstractWhileExpression expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
index
- the feature indexrawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _expectedType(XTryCatchFinallyExpression expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
index
- the feature indexrawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _expectedType(XCatchClause expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
index
- the feature indexrawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _expectedType(XCastedExpression expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
expr
- the casted expression that is the container of the child whose expected type should be computed. May not be null
.reference
- the feature that describes the child whose type is expectedindex
- the feature indexrawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _expectedType(XThrowExpression expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
reference
- the feature that describes the child whose type is expectedindex
- the feature indexrawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _expectedType(XReturnExpression expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
index
- the feature indexrawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _expectedType(XSwitchExpression expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
index
- the feature indexrawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _expectedType(XCasePart expr, org.eclipse.emf.ecore.EReference reference, int index, boolean rawType)
index
- the feature indexrawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _type(XIfExpression object, JvmTypeReference rawExpectation, boolean rawType)
protected JvmTypeReference getCommonType(java.util.List<JvmTypeReference> types)
Filters
for primitive voids
and unresolved types prior to asking the
TypeConformanceComputer
.
protected boolean isFilteredFromCommonTypesList(JvmTypeReference reference)
protected JvmTypeReference _type(XSwitchExpression object, JvmTypeReference rawExpectation, boolean rawType)
protected JvmTypeReference _type(XBlockExpression object, JvmTypeReference rawExpectation, boolean rawType)
protected JvmTypeReference _type(XVariableDeclaration object, JvmTypeReference rawExpectation, boolean rawType)
rawExpectation
- the expected raw type if set from the outside. May be null
.rawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _type(XConstructorCall constructorCall, JvmTypeReference rawExpectation, boolean rawType)
rawExpectation
- the expected raw type if set from the outside. May be null
.public ITypeArgumentContext getTypeArgumentContext(XConstructorCall constructorCall, JvmConstructor constructor)
protected JvmTypeReference _type(XBooleanLiteral object, JvmTypeReference rawExpectation, boolean rawType)
rawExpectation
- the expected raw type if set from the outside. May be null
.rawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _type(XNullLiteral object, JvmTypeReference rawExpectation, boolean rawType)
rawExpectation
- the expected raw type if set from the outside. May be null
.rawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _type(XNumberLiteral object, JvmTypeReference rawExpectation, boolean rawType)
rawExpectation
- the expected raw type if set from the outside. May be null
.rawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _type(XStringLiteral object, JvmTypeReference rawExpectation, boolean rawType)
rawExpectation
- the expected raw type if set from the outside. May be null
.rawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _type(XClosure object, JvmTypeReference rawExpectation, boolean rawType)
protected JvmTypeReference _type(XCastedExpression object, JvmTypeReference rawExpectation, boolean rawType)
rawExpectation
- the expected raw type if set from the outside. May be null
.rawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _type(XForLoopExpression object, JvmTypeReference rawExpectation, boolean rawType)
rawExpectation
- the expected raw type if set from the outside. May be null
.rawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _type(XAbstractWhileExpression object, JvmTypeReference rawExpectation, boolean rawType)
rawExpectation
- the expected raw type if set from the outside. May be null
.rawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _type(XTypeLiteral object, JvmTypeReference rawExpectation, boolean rawType)
rawExpectation
- the expected raw type if set from the outside. May be null
.rawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _type(XInstanceOfExpression object, JvmTypeReference rawExpectation, boolean rawType)
rawExpectation
- the expected raw type if set from the outside. May be null
.rawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _type(XThrowExpression object, JvmTypeReference rawExpectation, boolean rawType)
rawExpectation
- the expected raw type if set from the outside. May be null
.rawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _type(XReturnExpression object, JvmTypeReference rawExpectation, boolean rawType)
rawExpectation
- the expected raw type if set from the outside. May be null
.rawType
- true
if we are only interested in the raw typeprotected JvmTypeReference getPrimitiveVoid(XExpression object)
protected JvmTypeReference _type(XTryCatchFinallyExpression object, JvmTypeReference rawExpectation, boolean rawType)
rawExpectation
- the expected raw type if set from the outside. May be null
.rawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _type(XFeatureCall featureCall, JvmTypeReference rawExpectation, boolean rawType)
rawExpectation
- the expected raw type if set from the outside. May be null
.rawType
- true
if we are only interested in the raw typeprotected XCasePart findTypeGuardedXCasePartContainer(org.eclipse.emf.ecore.EObject context, XFeatureCall call)
protected JvmTypeReference _type(XAbstractFeatureCall featureCall, JvmTypeReference rawExpectation, boolean rawType)
rawExpectation
- the expected raw type if set from the outside. May be null
.rawType
- true
if we are only interested in the raw typepublic ITypeArgumentContext getTypeArgumentContext(XAbstractFeatureCall featureCall, java.util.List<XExpression> actualArguments, com.google.inject.Provider<JvmTypeReference> receiverTypeProvider, JvmIdentifiableElement feature)
protected JvmTypeReference _typeForIdentifiable(XSwitchExpression object, boolean rawType)
protected JvmTypeReference _typeForIdentifiable(XCasePart object, boolean rawType)
rawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _typeForIdentifiable(XVariableDeclaration object, boolean rawType)
protected JvmTypeReference _typeForIdentifiable(JvmFormalParameter parameter, boolean rawType)
protected JvmTypeReference handleCycleGetTypeForIdentifiable(JvmIdentifiableElement identifiableElement, boolean rawType)
AbstractTypeProvider
handleCycleGetTypeForIdentifiable
in class AbstractTypeProvider
identifiableElement
- the element that was asked reentrant for its type.rawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _typeForIdentifiable(JvmGenericType thisOrSuper, boolean rawType)
rawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _typeForIdentifiable(JvmConstructor constructor, boolean rawType)
rawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _typeForIdentifiable(JvmField field, boolean rawType)
rawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _typeForIdentifiable(JvmOperation operation, boolean rawType)
rawType
- true
if we are only interested in the raw typeprotected JvmTypeReference _typeForIdentifiable(JvmType type, boolean rawType)
rawType
- true
if we are only interested in the raw typeprotected void _earlyExits(XClosure expr, AbstractTypeProvider.EarlyExitAcceptor a)
expr
- the closure.a
- the collector of the early exit result.protected void _earlyExits(XReturnExpression expr, AbstractTypeProvider.EarlyExitAcceptor acceptor)
protected void _earlyExits(XThrowExpression expr, AbstractTypeProvider.EarlyExitAcceptor acceptor)
protected void _earlyExits(XConstructorCall expr, AbstractTypeProvider.EarlyExitAcceptor acceptor)
protected void _earlyExits(XAbstractFeatureCall expr, AbstractTypeProvider.EarlyExitAcceptor acceptor)
protected void _earlyExits(XTryCatchFinallyExpression expr, AbstractTypeProvider.EarlyExitAcceptor acceptor)
protected TypesFactory getTypesFactory()
public java.lang.Iterable<JvmTypeReference> getThrownExceptionForIdentifiable(JvmIdentifiableElement identifiable)
ITypeProvider
JvmIdentifiableElement
.
This includes explicitly declared RuntimeException
s as well.
identifiable
- May not be null
.
null
indicates a problem during computation, an empty iterable means no thrown exceptions were found.public JvmTypeReference getExpectedReturnType(XExpression expr, boolean rawType)
ITypeProvider
expr
- the expression. May not be null
.rawType
- true
if the raw type is sufficient.
null
if no special return type is expected
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |