Class XbaseInterpreter

    • Constructor Detail

      • XbaseInterpreter

        public XbaseInterpreter()
      • XbaseInterpreter

        public XbaseInterpreter​(com.google.inject.Provider<IEvaluationContext> contextProvider,
                                org.eclipse.xtext.common.types.util.JavaReflectAccess javaReflectAccess,
                                java.lang.ClassLoader loader)
    • Method Detail

      • setClassLoader

        @Inject
        public void setClassLoader​(java.lang.ClassLoader classLoader)
      • createClassFinder

        protected org.eclipse.xtext.common.types.access.impl.ClassFinder createClassFinder​(java.lang.ClassLoader classLoader)
        Since:
        2.18
      • getClass

        protected java.lang.Class<?> getClass​(java.lang.Class<?> class1)
      • doEvaluate

        protected java.lang.Object doEvaluate​(XExpression expression,
                                              IEvaluationContext context,
                                              org.eclipse.xtext.util.CancelIndicator indicator)
        don't call this directly. Always call evaluate() internalEvaluate()
      • _doEvaluate

        protected java.lang.Object _doEvaluate​(XNullLiteral literal,
                                               IEvaluationContext context,
                                               org.eclipse.xtext.util.CancelIndicator indicator)
        Parameters:
        literal - unused in this context but required for dispatching
        context - unused in this context but required for dispatching
        indicator - unused in this context but required for dispatching
      • _doEvaluate

        protected java.lang.Object _doEvaluate​(XStringLiteral literal,
                                               IEvaluationContext context,
                                               org.eclipse.xtext.util.CancelIndicator indicator)
        Parameters:
        context - unused in this context but required for dispatching
        indicator - unused in this context but required for dispatching
      • _doEvaluate

        protected java.lang.Object _doEvaluate​(XNumberLiteral literal,
                                               IEvaluationContext context,
                                               org.eclipse.xtext.util.CancelIndicator indicator)
        Parameters:
        context - unused in this context but required for dispatching
        indicator - unused in this context but required for dispatching
      • _doEvaluate

        protected java.lang.Object _doEvaluate​(XBooleanLiteral literal,
                                               IEvaluationContext context,
                                               org.eclipse.xtext.util.CancelIndicator indicator)
        Parameters:
        context - unused in this context but required for dispatching
        indicator - unused in this context but required for dispatching
      • _doEvaluate

        protected java.lang.Object _doEvaluate​(XTypeLiteral literal,
                                               IEvaluationContext context,
                                               org.eclipse.xtext.util.CancelIndicator indicator)
        Parameters:
        context - unused in this context but required for dispatching
        indicator - unused in this context but required for dispatching
      • _doEvaluate

        protected java.lang.Object _doEvaluate​(XListLiteral literal,
                                               IEvaluationContext context,
                                               org.eclipse.xtext.util.CancelIndicator indicator)
      • getJavaType

        protected java.lang.Class<?> getJavaType​(org.eclipse.xtext.common.types.JvmType type)
                                          throws java.lang.ClassNotFoundException
        Throws:
        java.lang.ClassNotFoundException
      • _doEvaluate

        protected java.lang.Object _doEvaluate​(XSetLiteral literal,
                                               IEvaluationContext context,
                                               org.eclipse.xtext.util.CancelIndicator indicator)
      • isType

        protected boolean isType​(XExpression element,
                                 java.lang.Class<?> clazz)
      • _doEvaluate

        protected java.lang.Object _doEvaluate​(XClosure closure,
                                               IEvaluationContext context,
                                               org.eclipse.xtext.util.CancelIndicator indicator)
      • _doEvaluate

        protected java.lang.Object _doEvaluate​(XIfExpression ifExpression,
                                               IEvaluationContext context,
                                               org.eclipse.xtext.util.CancelIndicator indicator)
      • castToPrimitiveType

        protected java.lang.Object castToPrimitiveType​(java.lang.Object castMe,
                                                       org.eclipse.xtext.common.types.util.Primitives.Primitive kind)
      • _doEvaluate

        protected java.lang.Object _doEvaluate​(XThrowExpression throwExpression,
                                               IEvaluationContext context,
                                               org.eclipse.xtext.util.CancelIndicator indicator)
      • isInstanceoOf

        protected boolean isInstanceoOf​(java.lang.Object value,
                                        org.eclipse.xtext.common.types.JvmTypeReference type)
      • findCloseMethod

        protected org.eclipse.xtext.common.types.JvmOperation findCloseMethod​(XVariableDeclaration resource)
        Since:
        2.18
      • eq

        protected boolean eq​(java.lang.Object a,
                             java.lang.Object b)
      • throwNullPointerException

        protected java.lang.Object throwNullPointerException​(XExpression expression,
                                                             java.lang.String message)
        Parameters:
        expression - may be used by inheritors
      • throwClassCastException

        protected java.lang.Object throwClassCastException​(XExpression expression,
                                                           java.lang.Object result,
                                                           java.lang.Class<?> expectedType)
        Parameters:
        expression - may be used by inheritors
      • wrapOrUnwrapArray

        protected java.lang.Object wrapOrUnwrapArray​(java.lang.Object result,
                                                     LightweightTypeReference expectedType)
      • _doEvaluate

        protected java.lang.Object _doEvaluate​(XConstructorCall constructorCall,
                                               IEvaluationContext context,
                                               org.eclipse.xtext.util.CancelIndicator indicator)
      • translateJvmTypeToResult

        protected java.lang.Object translateJvmTypeToResult​(org.eclipse.xtext.common.types.JvmType type,
                                                            int arrayDims)
      • _doEvaluate

        protected java.lang.Object _doEvaluate​(XFeatureCall featureCall,
                                               IEvaluationContext context,
                                               org.eclipse.xtext.util.CancelIndicator indicator)
      • evaluateGetAndAssign

        protected java.lang.Object evaluateGetAndAssign​(XAbstractFeatureCall featureCall,
                                                        IEvaluationContext context,
                                                        org.eclipse.xtext.util.CancelIndicator indicator)
      • applyGetAndAssignOperator

        protected java.lang.Object applyGetAndAssignOperator​(java.lang.Object originalValue,
                                                             java.lang.String operatorName)
      • invokeFeature

        protected java.lang.Object invokeFeature​(org.eclipse.xtext.common.types.JvmIdentifiableElement feature,
                                                 XAbstractFeatureCall featureCall,
                                                 java.lang.Object receiverObj,
                                                 IEvaluationContext context,
                                                 org.eclipse.xtext.util.CancelIndicator indicator)
      • _invokeFeature

        protected java.lang.Object _invokeFeature​(org.eclipse.xtext.common.types.JvmIdentifiableElement identifiable,
                                                  XAbstractFeatureCall featureCall,
                                                  java.lang.Object receiver,
                                                  IEvaluationContext context,
                                                  org.eclipse.xtext.util.CancelIndicator indicator)
        Parameters:
        featureCall - unused in this context but required for dispatching
        indicator - unused in this context but required for dispatching
      • _invokeFeature

        protected java.lang.Object _invokeFeature​(org.eclipse.xtext.common.types.JvmField jvmField,
                                                  XAbstractFeatureCall featureCall,
                                                  java.lang.Object receiver,
                                                  IEvaluationContext context,
                                                  org.eclipse.xtext.util.CancelIndicator indicator)
        Parameters:
        featureCall - unused in this context but required for dispatching
        context - unused in this context but required for dispatching
        indicator - unused in this context but required for dispatching
      • featureCallField

        protected java.lang.Object featureCallField​(org.eclipse.xtext.common.types.JvmField jvmField,
                                                    java.lang.Object receiver)
      • _invokeFeature

        protected java.lang.Object _invokeFeature​(org.eclipse.xtext.common.types.JvmOperation operation,
                                                  XAbstractFeatureCall featureCall,
                                                  java.lang.Object receiver,
                                                  IEvaluationContext context,
                                                  org.eclipse.xtext.util.CancelIndicator indicator)
      • invokeOperation

        protected java.lang.Object invokeOperation​(org.eclipse.xtext.common.types.JvmOperation operation,
                                                   java.lang.Object receiver,
                                                   java.util.List<java.lang.Object> argumentValues,
                                                   IEvaluationContext context,
                                                   org.eclipse.xtext.util.CancelIndicator indicator)
        Parameters:
        operation - the operation that should be invoked.
        receiver - the receiver for the invocation. It may be null which could signal a NullPointerException or be valid if the given operation is a static operation.
        argumentValues - the argument values. The number of arguments has to match the number of declared parameters.
        context - the current evalutation context.
        indicator - the cancel indicator.
        Since:
        2.3.1
      • invokeOperation

        protected java.lang.Object invokeOperation​(org.eclipse.xtext.common.types.JvmOperation operation,
                                                   java.lang.Object receiver,
                                                   java.util.List<java.lang.Object> argumentValues)
      • evaluateArgumentExpressions

        protected java.util.List<java.lang.Object> evaluateArgumentExpressions​(org.eclipse.xtext.common.types.JvmExecutable executable,
                                                                               java.util.List<XExpression> expressions,
                                                                               IEvaluationContext context,
                                                                               org.eclipse.xtext.util.CancelIndicator indicator)
      • coerceArgumentType

        protected java.lang.Object coerceArgumentType​(java.lang.Object value,
                                                      org.eclipse.xtext.common.types.JvmTypeReference expectedType)
      • _doEvaluate

        protected java.lang.Object _doEvaluate​(XAssignment assignment,
                                               IEvaluationContext context,
                                               org.eclipse.xtext.util.CancelIndicator indicator)
      • assignValueTo

        protected java.lang.Object assignValueTo​(org.eclipse.xtext.common.types.JvmIdentifiableElement feature,
                                                 XAbstractFeatureCall assignment,
                                                 java.lang.Object value,
                                                 IEvaluationContext context,
                                                 org.eclipse.xtext.util.CancelIndicator indicator)
      • _assignValueTo

        protected java.lang.Object _assignValueTo​(XVariableDeclaration variable,
                                                  XAbstractFeatureCall assignment,
                                                  java.lang.Object value,
                                                  IEvaluationContext context,
                                                  org.eclipse.xtext.util.CancelIndicator indicator)
        Parameters:
        assignment - unused in this context but required for dispatching
        indicator - unused in this context but required for dispatching
      • _assignValueTo

        protected java.lang.Object _assignValueTo​(org.eclipse.xtext.common.types.JvmField jvmField,
                                                  XAbstractFeatureCall assignment,
                                                  java.lang.Object value,
                                                  IEvaluationContext context,
                                                  org.eclipse.xtext.util.CancelIndicator indicator)
      • _assignValueTo

        protected java.lang.Object _assignValueTo​(org.eclipse.xtext.common.types.JvmOperation jvmOperation,
                                                  XAbstractFeatureCall assignment,
                                                  java.lang.Object value,
                                                  IEvaluationContext context,
                                                  org.eclipse.xtext.util.CancelIndicator indicator)
      • getClassFinder

        protected org.eclipse.xtext.common.types.access.impl.ClassFinder getClassFinder()
      • getJavaReflectAccess

        protected org.eclipse.xtext.common.types.util.JavaReflectAccess getJavaReflectAccess()