Class XsemanticsJvmModelInferrer

  • All Implemented Interfaces:
    org.eclipse.xtext.xbase.jvmmodel.IJvmModelInferrer

    public class XsemanticsJvmModelInferrer
    extends org.eclipse.xtext.xbase.jvmmodel.AbstractModelInferrer

    Infers a JVM model from the source model.

    The JVM model should contain all elements that would appear in the Java code which is generated from the source model. Other models link against the JVM model rather than the source model.

    • Constructor Detail

      • XsemanticsJvmModelInferrer

        public XsemanticsJvmModelInferrer()
    • Method Detail

      • _infer

        protected void _infer​(XsemanticsSystem ts,
                              org.eclipse.xtext.xbase.jvmmodel.IJvmDeclaredTypeAcceptor acceptor,
                              boolean isPreIndexingPhase)
        The dispatch method infer is called for each instance of the given element's type that is contained in a resource.
        Parameters:
        element - the model to create one or more declared types from.
        acceptor - each created type without a container should be passed to the acceptor in order get attached to the current resource. The acceptor's accept(..) method takes the constructed empty type for the pre-indexing phase. This one is further initialized in the indexing phase using the lambda you pass to accept as the last argument.
        isPreIndexingPhase - whether the method is called in a pre-indexing phase, i.e. when the global index is not yet fully updated. You must not rely on linking using the index if isPreIndexingPhase is true.
      • genIssueField

        public org.eclipse.xtext.common.types.JvmField genIssueField​(Named e)
      • genConstructor

        public org.eclipse.xtext.common.types.JvmConstructor genConstructor​(XsemanticsSystem ts)
      • genPolymorphicDispatcherField

        public org.eclipse.xtext.common.types.JvmField genPolymorphicDispatcherField​(JudgmentDescription e)
      • genPolymorphicDispatcherField

        public org.eclipse.xtext.common.types.JvmField genPolymorphicDispatcherField​(AuxiliaryDescription e)
      • polymorphicDispatcherType

        public org.eclipse.xtext.common.types.JvmTypeReference polymorphicDispatcherType​(JudgmentDescription e)
      • polymorphicDispatcherType

        public org.eclipse.xtext.common.types.JvmTypeReference polymorphicDispatcherType​(AuxiliaryDescription e)
      • genInit

        public org.eclipse.xtext.common.types.JvmOperation genInit​(XsemanticsSystem ts)
      • genPolymorphicDispatcherInit

        public java.lang.CharSequence genPolymorphicDispatcherInit​(JudgmentDescription judgmentDescription)
      • genPolymorphicDispatcherInit

        public java.lang.CharSequence genPolymorphicDispatcherInit​(AuxiliaryDescription aux)
      • genEntryPointMethods

        public java.util.ArrayList<org.eclipse.xtext.common.types.JvmOperation> genEntryPointMethods​(JudgmentDescription judgmentDescription)
      • toEntryMethodsTriple

        public java.util.ArrayList<org.eclipse.xtext.common.types.JvmOperation> toEntryMethodsTriple​(JudgmentDescription judgmentDescription,
                                                                                                     java.lang.String name,
                                                                                                     org.eclipse.xtext.common.types.JvmTypeReference resultType,
                                                                                                     org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super org.eclipse.xtext.common.types.JvmOperation> mainBodyCreator)
        Parameters:
        judgmentDescription -
        name - method name
        resultType - method return type
        beforeInputParams - can add parameters before the input parameters
        mainBodyCreator - handles the creation of the body of the third method, which implements the real logic; the first two methods are only delegates with default arguments.
      • toEntryMethodCommon

        protected org.eclipse.xtext.common.types.JvmOperation toEntryMethodCommon​(JudgmentDescription judgmentDescription,
                                                                                  java.lang.String name,
                                                                                  org.eclipse.xtext.common.types.JvmTypeReference resultType,
                                                                                  org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super org.eclipse.xtext.common.types.JvmOperation> beforeInputParams,
                                                                                  org.eclipse.xtext.xbase.lib.Procedures.Procedure1<? super org.eclipse.xtext.common.types.JvmOperation> bodyCreator)
        Parameters:
        judgmentDescription -
        name - method name
        resultType - method return type
        beforeInputParams - can add parameters before the input parameters
        bodyCreator - handles the creation of the body of the method
      • genSucceededMethods

        public java.util.ArrayList<org.eclipse.xtext.common.types.JvmOperation> genSucceededMethods​(JudgmentDescription judgmentDescription)
      • genEntryPointMethods

        public java.util.ArrayList<org.eclipse.xtext.common.types.JvmOperation> genEntryPointMethods​(AuxiliaryDescription aux)
      • inputParameters

        public java.util.List<org.eclipse.xtext.common.types.JvmFormalParameter> inputParameters​(JudgmentDescription judgmentDescription)
      • inputParameters

        public java.util.List<org.eclipse.xtext.common.types.JvmFormalParameter> inputParameters​(AuxiliaryDescription aux)
      • inputParameters

        public java.util.List<org.eclipse.xtext.common.types.JvmFormalParameter> inputParameters​(AuxiliaryFunction aux)
      • environmentParam

        public org.eclipse.xtext.common.types.JvmFormalParameter environmentParam​(JudgmentDescription e)
      • ruleApplicationTraceParam

        public org.eclipse.xtext.common.types.JvmFormalParameter ruleApplicationTraceParam​(org.eclipse.emf.ecore.EObject e)
      • compileThrowExceptionMethod

        public org.eclipse.xtext.common.types.JvmOperation compileThrowExceptionMethod​(JudgmentDescription judgmentDescription)
      • compileErrorSpecification

        public void compileErrorSpecification​(org.eclipse.xtext.common.types.JvmOperation it,
                                              org.eclipse.xtext.xbase.XExpression errorSpecification)
      • compileCacheConditionMethod

        public org.eclipse.xtext.common.types.JvmOperation compileCacheConditionMethod​(Cachable cachable)
      • compileThrowExceptionMethod

        public org.eclipse.xtext.common.types.JvmOperation compileThrowExceptionMethod​(AuxiliaryDescription aux)
      • compileInternalMethod

        public org.eclipse.xtext.common.types.JvmOperation compileInternalMethod​(JudgmentDescription judgmentDescription)
      • compileInternalMethod

        public org.eclipse.xtext.common.types.JvmOperation compileInternalMethod​(AuxiliaryDescription aux)
      • ruleFailedExceptionType

        public org.eclipse.xtext.common.types.JvmTypeReference ruleFailedExceptionType()
      • environmentType

        public org.eclipse.xtext.common.types.JvmTypeReference environmentType()
      • compileImplMethod

        public org.eclipse.xtext.common.types.JvmOperation compileImplMethod​(Rule rule)
      • compileImplMethod

        public org.eclipse.xtext.common.types.JvmOperation compileImplMethod​(AuxiliaryFunction aux)
      • errorInformationArgs

        public org.eclipse.xtend2.lib.StringConcatenationClient errorInformationArgs​(Rule rule)
      • errorInformationArgs

        public org.eclipse.xtend2.lib.StringConcatenationClient errorInformationArgs​(AuxiliaryFunction aux)
      • errorInformationArgs

        public org.eclipse.xtend2.lib.StringConcatenationClient errorInformationArgs​(java.lang.Iterable<java.lang.String> names)
      • compileApplyMethod

        public org.eclipse.xtext.common.types.JvmOperation compileApplyMethod​(Rule rule)
      • _assignBody

        protected void _assignBody​(org.eclipse.xtext.common.types.JvmExecutable logicalContainer,
                                   Rule rule)
      • _assignBody

        protected void _assignBody​(org.eclipse.xtext.common.types.JvmExecutable logicalContainer,
                                   RuleWithPremises rule)
      • compileExpressionInConclusionMethod

        public org.eclipse.xtext.common.types.JvmOperation compileExpressionInConclusionMethod​(ExpressionInConclusion e)
      • compileErrorSpecificationMethod

        public org.eclipse.xtext.common.types.JvmOperation compileErrorSpecificationMethod​(Rule rule)
      • compileApplyAuxiliaryFunction

        public org.eclipse.xtext.common.types.JvmOperation compileApplyAuxiliaryFunction​(AuxiliaryFunction auxfun)
      • compileCheckRuleMethods

        public java.util.ArrayList<org.eclipse.xtext.common.types.JvmOperation> compileCheckRuleMethods​(CheckRule rule)
      • compileValidatorCheckRuleMethod

        public org.eclipse.xtext.common.types.JvmOperation compileValidatorCheckRuleMethod​(CheckRule rule)
      • compileInternalMethod

        public org.eclipse.xtext.common.types.JvmOperation compileInternalMethod​(CheckRule rule)
      • paramForEnvironment

        public org.eclipse.xtext.common.types.JvmFormalParameter paramForEnvironment​(Rule rule)
      • inputParameters

        public java.util.List<org.eclipse.xtext.common.types.JvmFormalParameter> inputParameters​(Rule rule)
      • isBoolean

        public boolean isBoolean​(org.eclipse.xtext.common.types.JvmTypeReference typeRef)
      • infer

        public void infer​(org.eclipse.emf.ecore.EObject ts,
                          org.eclipse.xtext.xbase.jvmmodel.IJvmDeclaredTypeAcceptor acceptor,
                          boolean isPreIndexingPhase)
        Specified by:
        infer in interface org.eclipse.xtext.xbase.jvmmodel.IJvmModelInferrer
        Overrides:
        infer in class org.eclipse.xtext.xbase.jvmmodel.AbstractModelInferrer
      • assignBody

        public void assignBody​(org.eclipse.xtext.common.types.JvmExecutable logicalContainer,
                               Rule rule)