Class XsemanticsJvmModelInferrer
- java.lang.Object
-
- org.eclipse.xtext.xbase.jvmmodel.AbstractModelInferrer
-
- org.eclipse.xsemantics.dsl.jvmmodel.XsemanticsJvmModelInferrer
-
- All Implemented Interfaces:
org.eclipse.xtext.xbase.jvmmodel.IJvmModelInferrer
public class XsemanticsJvmModelInferrer extends org.eclipse.xtext.xbase.jvmmodel.AbstractModelInferrerInfers 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 Summary
Constructors Constructor Description XsemanticsJvmModelInferrer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void_assignBody(org.eclipse.xtext.common.types.JvmExecutable logicalContainer, Rule rule)protected void_assignBody(org.eclipse.xtext.common.types.JvmExecutable logicalContainer, RuleWithPremises rule)protected void_infer(XsemanticsSystem ts, org.eclipse.xtext.xbase.jvmmodel.IJvmDeclaredTypeAcceptor acceptor, boolean isPreIndexingPhase)The dispatch methodinferis called for each instance of the given element's type that is contained in a resource.voidassignBody(org.eclipse.xtext.common.types.JvmExecutable logicalContainer, Rule rule)org.eclipse.xtext.common.types.JvmOperationcompileApplyAuxiliaryFunction(AuxiliaryFunction auxfun)org.eclipse.xtext.common.types.JvmOperationcompileApplyMethod(Rule rule)org.eclipse.xtext.common.types.JvmOperationcompileCacheConditionMethod(Cachable cachable)java.util.ArrayList<org.eclipse.xtext.common.types.JvmOperation>compileCheckRuleMethods(CheckRule rule)voidcompileErrorSpecification(org.eclipse.xtext.common.types.JvmOperation it, org.eclipse.xtext.xbase.XExpression errorSpecification)org.eclipse.xtext.common.types.JvmOperationcompileErrorSpecificationMethod(Rule rule)org.eclipse.xtext.common.types.JvmOperationcompileExpressionInConclusionMethod(ExpressionInConclusion e)org.eclipse.xtext.common.types.JvmOperationcompileImplMethod(AuxiliaryFunction aux)org.eclipse.xtext.common.types.JvmOperationcompileImplMethod(Rule rule)org.eclipse.xtext.common.types.JvmOperationcompileInternalMethod(AuxiliaryDescription aux)org.eclipse.xtext.common.types.JvmOperationcompileInternalMethod(CheckRule rule)org.eclipse.xtext.common.types.JvmOperationcompileInternalMethod(JudgmentDescription judgmentDescription)org.eclipse.xtext.common.types.JvmOperationcompileThrowExceptionMethod(AuxiliaryDescription aux)org.eclipse.xtext.common.types.JvmOperationcompileThrowExceptionMethod(JudgmentDescription judgmentDescription)org.eclipse.xtext.common.types.JvmOperationcompileValidatorCheckRuleMethod(CheckRule rule)org.eclipse.xtext.common.types.JvmFormalParameterenvironmentParam(JudgmentDescription e)org.eclipse.xtext.common.types.JvmTypeReferenceenvironmentType()org.eclipse.xtend2.lib.StringConcatenationClienterrorInformationArgs(java.lang.Iterable<java.lang.String> names)org.eclipse.xtend2.lib.StringConcatenationClienterrorInformationArgs(AuxiliaryFunction aux)org.eclipse.xtend2.lib.StringConcatenationClienterrorInformationArgs(Rule rule)org.eclipse.xtext.common.types.JvmConstructorgenConstructor(XsemanticsSystem ts)java.util.ArrayList<org.eclipse.xtext.common.types.JvmOperation>genEntryPointMethods(AuxiliaryDescription aux)java.util.ArrayList<org.eclipse.xtext.common.types.JvmOperation>genEntryPointMethods(JudgmentDescription judgmentDescription)org.eclipse.xtext.common.types.JvmOperationgenInit(XsemanticsSystem ts)org.eclipse.xtext.common.types.JvmFieldgenIssueField(Named e)org.eclipse.xtext.common.types.JvmFieldgenPolymorphicDispatcherField(AuxiliaryDescription e)org.eclipse.xtext.common.types.JvmFieldgenPolymorphicDispatcherField(JudgmentDescription e)java.lang.CharSequencegenPolymorphicDispatcherInit(AuxiliaryDescription aux)java.lang.CharSequencegenPolymorphicDispatcherInit(JudgmentDescription judgmentDescription)java.util.ArrayList<org.eclipse.xtext.common.types.JvmOperation>genSucceededMethods(JudgmentDescription judgmentDescription)voidinfer(org.eclipse.emf.ecore.EObject ts, org.eclipse.xtext.xbase.jvmmodel.IJvmDeclaredTypeAcceptor acceptor, boolean isPreIndexingPhase)java.util.List<org.eclipse.xtext.common.types.JvmFormalParameter>inputParameters(AuxiliaryDescription aux)java.util.List<org.eclipse.xtext.common.types.JvmFormalParameter>inputParameters(AuxiliaryFunction aux)java.util.List<org.eclipse.xtext.common.types.JvmFormalParameter>inputParameters(JudgmentDescription judgmentDescription)java.util.List<org.eclipse.xtext.common.types.JvmFormalParameter>inputParameters(Rule rule)booleanisBoolean(org.eclipse.xtext.common.types.JvmTypeReference typeRef)org.eclipse.xtext.common.types.JvmFormalParameterparamForEnvironment(Rule rule)org.eclipse.xtext.common.types.JvmTypeReferencepolymorphicDispatcherType(AuxiliaryDescription e)org.eclipse.xtext.common.types.JvmTypeReferencepolymorphicDispatcherType(JudgmentDescription e)org.eclipse.xtext.common.types.JvmFormalParameterruleApplicationTraceParam(org.eclipse.emf.ecore.EObject e)org.eclipse.xtext.common.types.JvmTypeReferenceruleFailedExceptionType()protected org.eclipse.xtext.common.types.JvmOperationtoEntryMethodCommon(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)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)
-
-
-
Method Detail
-
_infer
protected void _infer(XsemanticsSystem ts, org.eclipse.xtext.xbase.jvmmodel.IJvmDeclaredTypeAcceptor acceptor, boolean isPreIndexingPhase)
The dispatch methodinferis called for each instance of the given element's type that is contained in a resource.- Parameters:
element- the model to create one or moredeclared typesfrom.acceptor- each createdtypewithout 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 istrue.
-
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 nameresultType- method return typebeforeInputParams- can add parameters before the input parametersmainBodyCreator- 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 nameresultType- method return typebeforeInputParams- can add parameters before the input parametersbodyCreator- 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:
inferin interfaceorg.eclipse.xtext.xbase.jvmmodel.IJvmModelInferrer- Overrides:
inferin classorg.eclipse.xtext.xbase.jvmmodel.AbstractModelInferrer
-
assignBody
public void assignBody(org.eclipse.xtext.common.types.JvmExecutable logicalContainer, Rule rule)
-
-