io.sarl.lang.jvmmodel.fragments
Class AbstractJvmModelInferrerExecutableFragment
All Known Subclasses:
ActionInferrerFragment, ConstructorInferrerFragment
abstract class AbstractJvmModelInferrerExecutableFragment
extends AbstractJvmModelInferrerFragment
Abstract implementation of a fragment that may be used for inferring executable to JVM model.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
compiler
Since:
0.15
Field Summary
Modifier and type Field and description
protected var ISarlEarlyExitComputer earlyExitComputer
Computer of early-exits for SARL.
protected var IInlineExpressionCompiler inlineExpressionCompiler
Compiler of expressions that may be used for inlining expressions for functions.
protected var IOperationHelper operationHelper
Helper for defining operations.
Constructor Summary
Constructor and description
new
Action Summary
Modifier and type Action and description
protected void copyTypeParametersFromJvmOperation(JvmOperation,JvmOperation,IBaseJvmModelInferrer)
Copy the type parameters from a JvmOperation.
protected org.eclipse.xtext.common.types.JvmTypeReference inferFunctionReturnType(XExpression,IBaseJvmModelInferrer)
Infer the function's return type.
protected org.eclipse.xtext.common.types.JvmTypeReference inferFunctionReturnType(XtendFunction,JvmOperation,JvmOperation,IBaseJvmModelInferrer)
Infer the return type for the given source function.
protected void translateSarlFormalParameters(GenerationContext,JvmExecutable,JvmGenericType,boolean,List<E>,boolean,List<E>,boolean,IBaseJvmModelInferrer)
Generate a list of formal parameters with annotations for the default values.
protected void translateSarlFormalParametersForLocalHiddenDefaultValues(GenerationContext,JvmOperation)
Generate the local default values.
protected java.util.List<E> translateSarlFormalParametersForSyntheticOperation(JvmExecutable,JvmGenericType,boolean,List<E>,IBaseJvmModelInferrer)
Generate a list arguments from the formal parameters in order to be used for a call into a synthetic operation, such as default-valued parameter function.
Field Details
earlyExitComputer
protected var earlyExitComputer : ISarlEarlyExitComputer
Computer of early-exits for SARL.
inlineExpressionCompiler
protected var inlineExpressionCompiler : IInlineExpressionCompiler
Compiler of expressions that may be used for inlining expressions for functions.
operationHelper
protected var operationHelper : IOperationHelper
Helper for defining operations.
Constructor Details
new
new
Action Details
copyTypeParametersFromJvmOperation(JvmOperation,JvmOperation,IBaseJvmModelInferrer)
protected def copyTypeParametersFromJvmOperation(JvmOperation,JvmOperation,IBaseJvmModelInferrer)
Copy the type parameters from a JvmOperation.
Parameters:
fromOperation - the operation from which the type parameters are copied.
toOperation - the operation that will receives the new type parameters.
baseInferrer - the inferrer that is the considered as the base (starting point) of inferring process.
inferFunctionReturnType(XExpression,IBaseJvmModelInferrer)
protected def inferFunctionReturnType(XExpression,IBaseJvmModelInferrer) : org.eclipse.xtext.common.types.JvmTypeReference
Infer the function's return type.
Parameters:
body - the body of the function.
baseInferrer - the inferrer that is the considered as the base (starting point) of inferring process.
Returns:
the return type.
inferFunctionReturnType(XtendFunction,JvmOperation,JvmOperation,IBaseJvmModelInferrer)
protected def inferFunctionReturnType(XtendFunction,JvmOperation,JvmOperation,IBaseJvmModelInferrer) : org.eclipse.xtext.common.types.JvmTypeReference
Infer the return type for the given source function.
Parameters:
source - the source function.
target - the target operation.
overriddenOperation - reference to the overridden operation.
baseInferrer - the inferrer that is the considered as the base (starting point) of inferring process.
Returns:
the inferred return type.
Since:
0.7
translateSarlFormalParameters(GenerationContext,JvmExecutable,JvmGenericType,boolean,List<E>,boolean,List<E>,boolean,IBaseJvmModelInferrer)
protected def translateSarlFormalParameters(GenerationContext,JvmExecutable,JvmGenericType,boolean,List<E>,boolean,List<E>,boolean,IBaseJvmModelInferrer)
Generate a list of formal parameters with annotations for the default values.
Parameters:
context - the generation context.
owner - the JVM element to change.
actionContainer - the container of the action.
varargs - indicates if the signature has variadic parameter.
params - the parameters.
isForInterface - indicates if the formal parameters are for an interface (true) or a class (false).
paramSpec - the specification of the parameter as computed by a IActionPrototypeProvider.
ignoreOverridableOperations - indicates if the operations are ignored if it is marked as overridable.
baseInferrer - the inferrer that is the considered as the base (starting point) of inferring process.
translateSarlFormalParametersForLocalHiddenDefaultValues(GenerationContext,JvmOperation)
protected def translateSarlFormalParametersForLocalHiddenDefaultValues(GenerationContext,JvmOperation)
Generate the local default values.
Parameters:
context - the generation context.
inheritedOperation - the reference to the inherited operation.
Since:
0.12
translateSarlFormalParametersForSyntheticOperation(JvmExecutable,JvmGenericType,boolean,List<E>,IBaseJvmModelInferrer)
protected def translateSarlFormalParametersForSyntheticOperation(JvmExecutable,JvmGenericType,boolean,List<E>,IBaseJvmModelInferrer) : java.util.List<E>
Generate a list arguments from the formal parameters in order to be used for a call into a synthetic operation, such as default-valued parameter function.
Parameters:
owner - the JVM element to change.
actionContainer - the container of the action.
varargs - indicates if the signature has variadic parameter.
signature - the description of the parameters.
baseInferrer - the inferrer that is the considered as the base (starting point) of inferring process.
Returns:
the arguments to pass to the original function.