io.sarl.lang.extralanguage.compiler
Class AbstractExpressionGenerator
All Superinterfaces:
IExpressionGenerator
All Known Subclasses:
PyExpressionGenerator
abstract class AbstractExpressionGenerator
extends java.lang.Object
implements IExpressionGenerator
Abstract Generator of XExpression.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
compiler
Since:
0.6
Property Summary
Modifier and type Property and description
org.eclipse.xtext.xbase.util.XExpressionHelper expressionHelper
Replies the expression helper.
IExtraLanguageKeywordProvider extraLanguageKeywordProvider
Replies the provider of the extra-language keywords.
protected IExtraLanguageConversionInitializer featureNameConverterInitializer
Replies the initializer for the feature name converter.
org.eclipse.xtext.xbase.featurecalls.IdentifiableSimpleNameProvider featureNameProvider
Replies the basic feature name provider.
org.eclipse.xtext.xbase.jvmmodel.ILogicalContainerProvider logicalContainerProvider
Replies the provider of the logical container.
org.eclipse.xtext.xbase.scoping.featurecalls.OperatorMapping operatorMapping
Replies the mapping for the operators.
org.eclipse.xtext.xbase.jvmmodel.JvmTypesBuilder typeBuilder
Replies the type builder.
protected IExtraLanguageConversionInitializer typeConverterInitializer
Replies the initializer for the type converter.
org.eclipse.xtext.common.types.util.TypeReferences typeReferences
Replies the type reference finder.
org.eclipse.xtext.xbase.typesystem.IBatchTypeResolver typeResolver
Replies the type resolver for expressions.
Nested Type Summary
Modifier and type Type and description
protected class AbstractExpressionGenerator.FeatureCallGenerator
A specific feature call generator.
Constructor Summary
Constructor and description
new(IExtraLanguageKeywordProvider)
Constructor.
Action Summary
Modifier and type Action and description
protected void after(XExpression,IAppendable,IExtraLanguageGeneratorContext)
Invoked after an expression is processed.
protected void before(XExpression,IAppendable,IExtraLanguageGeneratorContext)
Invoked before an expression is processed.
static boolean buildCallReceiver(XAbstractFeatureCall,Function0<Result>,Function1<Param,Result>,List<E>)
Compute the list of object that serve as the receiver for the given call.
protected ExtraLanguageFeatureNameConverter createFeatureNameConverterInstance(IExtraLanguageConversionInitializer,IExtraLanguageGeneratorContext)
Create the instance of the feature name converter.
protected ExtraLanguageTypeConverter createTypeConverterInstance(IExtraLanguageConversionInitializer,IExtraLanguageGeneratorContext)
Create the instance of the type converter.
org.eclipse.xtext.xbase.XExpression generate(XExpression,LightweightTypeReference,IAppendable,IExtraLanguageGeneratorContext)
static java.lang.String getCallSimpleName(XAbstractFeatureCall,ILogicalContainerProvider,IdentifiableSimpleNameProvider,Function0<Result>,Function0<Result>,Function0<Result>,Function1<Param,Result>)
Compute the simple name for the called feature.
protected org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference getExpectedType(XExpression)
Compute the expected type of the given expression.
org.eclipse.xtext.xbase.util.XExpressionHelper getExpressionHelper
Replies the expression helper.
IExtraLanguageKeywordProvider getExtraLanguageKeywordProvider
Replies the provider of the extra-language keywords.
ExtraLanguageFeatureNameConverter getFeatureNameConverter(IExtraLanguageGeneratorContext)
protected IExtraLanguageConversionInitializer getFeatureNameConverterInitializer
Replies the initializer for the feature name converter.
org.eclipse.xtext.xbase.featurecalls.IdentifiableSimpleNameProvider getFeatureNameProvider
Replies the basic feature name provider.
org.eclipse.xtext.xbase.jvmmodel.ILogicalContainerProvider getLogicalContainerProvider
Replies the provider of the logical container.
org.eclipse.xtext.xbase.scoping.featurecalls.OperatorMapping getOperatorMapping
Replies the mapping for the operators.
protected java.lang.String getOperatorSymbol(XAbstractFeatureCall)
Get the string representation of an operator.
org.eclipse.xtext.xbase.jvmmodel.JvmTypesBuilder getTypeBuilder
Replies the type builder.
ExtraLanguageTypeConverter getTypeConverter(IExtraLanguageGeneratorContext)
protected IExtraLanguageConversionInitializer getTypeConverterInitializer
Replies the initializer for the type converter.
org.eclipse.xtext.common.types.util.TypeReferences getTypeReferences
Replies the type reference finder.
org.eclipse.xtext.xbase.typesystem.IBatchTypeResolver getTypeResolver
Replies the type resolver for expressions.
void setExpressionHelper(XExpressionHelper)
Change the expression helper.
void setFeatureNameProvider(IdentifiableSimpleNameProvider)
Change the basic feature name provider.
void setInjector(Injector)
Change the injector.
void setLogicalContainerProvider(ILogicalContainerProvider)
Change the provider of the logical container.
void setOperatorMapping(OperatorMapping)
Change the mapping for the operators.
void setTypeBuilder(JvmTypesBuilder)
Change the type builder.
void setTypeReferences(TypeReferences)
Change the type reference finder.
void setTypeResolver(IBatchTypeResolver)
Change the type resolver for expressions.
Property Details
expressionHelper
var expressionHelper : org.eclipse.xtext.xbase.util.XExpressionHelper
Replies the expression helper.

This property is an alias for the action: getExpressionHelper

Returns:
the expression helper.
extraLanguageKeywordProvider
val extraLanguageKeywordProvider : IExtraLanguageKeywordProvider
Replies the provider of the extra-language keywords.

This property is an alias for the action: getExtraLanguageKeywordProvider

Returns:
the provider.
featureNameConverterInitializer
protected val featureNameConverterInitializer : IExtraLanguageConversionInitializer
Replies the initializer for the feature name converter.

This property is an alias for the action: getFeatureNameConverterInitializer

Returns:
the initializer
featureNameProvider
var featureNameProvider : org.eclipse.xtext.xbase.featurecalls.IdentifiableSimpleNameProvider
Replies the basic feature name provider.

This property is an alias for the action: getFeatureNameProvider

Returns:
the feature name provider.
logicalContainerProvider
var logicalContainerProvider : org.eclipse.xtext.xbase.jvmmodel.ILogicalContainerProvider
Replies the provider of the logical container.

This property is an alias for the action: getLogicalContainerProvider

Returns:
the logical container provider.
operatorMapping
var operatorMapping : org.eclipse.xtext.xbase.scoping.featurecalls.OperatorMapping
Replies the mapping for the operators.

This property is an alias for the action: getOperatorMapping

Returns:
the mapping.
typeBuilder
var typeBuilder : org.eclipse.xtext.xbase.jvmmodel.JvmTypesBuilder
Replies the type builder.

This property is an alias for the action: getTypeBuilder

Returns:
the builder.
typeConverterInitializer
protected val typeConverterInitializer : IExtraLanguageConversionInitializer
Replies the initializer for the type converter.

This property is an alias for the action: getTypeConverterInitializer

Returns:
the initializer
typeReferences
var typeReferences : org.eclipse.xtext.common.types.util.TypeReferences
Replies the type reference finder.

This property is an alias for the action: getTypeReferences

Returns:
the type reference finder.
typeResolver
var typeResolver : org.eclipse.xtext.xbase.typesystem.IBatchTypeResolver
Replies the type resolver for expressions.

This property is an alias for the action: getTypeResolver

Returns:
the batch type resolver.
Constructor Details
new(IExtraLanguageKeywordProvider)
new(IExtraLanguageKeywordProvider)
Constructor.
Parameters:
keywordProvider - the provider of extra-language keywords.
Action Details
after(XExpression,IAppendable,IExtraLanguageGeneratorContext)
protected def after(XExpression,IAppendable,IExtraLanguageGeneratorContext)
Invoked after an expression is processed.
Parameters:
expression - the expression.
output - the output.
context - the context.
before(XExpression,IAppendable,IExtraLanguageGeneratorContext)
protected def before(XExpression,IAppendable,IExtraLanguageGeneratorContext)
Invoked before an expression is processed.
Parameters:
expression - the expression.
output - the output.
context - the context.
buildCallReceiver(XAbstractFeatureCall,Function0<Result>,Function1<Param,Result>,List<E>)
def buildCallReceiver(XAbstractFeatureCall,Function0<Result>,Function1<Param,Result>,List<E>) : boolean
Compute the list of object that serve as the receiver for the given call.
Parameters:
call - the feature call to analyze.
output - the objects that constitute the call's receiver.
thisKeyword - the "this" keyword.
referenceNameDefinition - replies the name of the expression, if defined.
Returns:
true if a receiver was found; otherwise false .
createFeatureNameConverterInstance(IExtraLanguageConversionInitializer,IExtraLanguageGeneratorContext)
protected def createFeatureNameConverterInstance(IExtraLanguageConversionInitializer,IExtraLanguageGeneratorContext) : ExtraLanguageFeatureNameConverter
Create the instance of the feature name converter.
Parameters:
initializer - the converter initializer.
context - the generation context.
Returns:
the feature name converter.
createTypeConverterInstance(IExtraLanguageConversionInitializer,IExtraLanguageGeneratorContext)
protected def createTypeConverterInstance(IExtraLanguageConversionInitializer,IExtraLanguageGeneratorContext) : ExtraLanguageTypeConverter
Create the instance of the type converter.
Parameters:
initializer - the converter initializer.
context - the genetation context.
Returns:
the type converter.
generate(XExpression,LightweightTypeReference,IAppendable,IExtraLanguageGeneratorContext)
def generate(XExpression,LightweightTypeReference,IAppendable,IExtraLanguageGeneratorContext) : org.eclipse.xtext.xbase.XExpression
getCallSimpleName(XAbstractFeatureCall,ILogicalContainerProvider,IdentifiableSimpleNameProvider,Function0<Result>,Function0<Result>,Function0<Result>,Function1<Param,Result>)
def getCallSimpleName(XAbstractFeatureCall,ILogicalContainerProvider,IdentifiableSimpleNameProvider,Function0<Result>,Function0<Result>,Function0<Result>,Function1<Param,Result>) : java.lang.String
Compute the simple name for the called feature.
Parameters:
featureCall - the feature call.
logicalContainerProvider - the provider of logicial container.
featureNameProvider - the provider of feature name.
nullKeyword - the null-equivalent keyword.
thisKeyword - the this-equivalent keyword.
superKeyword - the super-equivalent keyword.
referenceNameLambda - replies the reference name or null if none.
Returns:
the simple name.
getExpectedType(XExpression)
protected def getExpectedType(XExpression) : org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference
Compute the expected type of the given expression.
Parameters:
expr - the expression.
Returns:
the expected type of the argument.
getExpressionHelper
def getExpressionHelper : org.eclipse.xtext.xbase.util.XExpressionHelper
Replies the expression helper.
Returns:
the expression helper.
getExtraLanguageKeywordProvider
def getExtraLanguageKeywordProvider : IExtraLanguageKeywordProvider
Replies the provider of the extra-language keywords.
Returns:
the provider.
getFeatureNameConverter(IExtraLanguageGeneratorContext)
def getFeatureNameConverter(IExtraLanguageGeneratorContext) : ExtraLanguageFeatureNameConverter
getFeatureNameConverterInitializer
protected def getFeatureNameConverterInitializer : IExtraLanguageConversionInitializer
Replies the initializer for the feature name converter.
Returns:
the initializer
getFeatureNameProvider
def getFeatureNameProvider : org.eclipse.xtext.xbase.featurecalls.IdentifiableSimpleNameProvider
Replies the basic feature name provider.
Returns:
the feature name provider.
getLogicalContainerProvider
def getLogicalContainerProvider : org.eclipse.xtext.xbase.jvmmodel.ILogicalContainerProvider
Replies the provider of the logical container.
Returns:
the logical container provider.
getOperatorMapping
def getOperatorMapping : org.eclipse.xtext.xbase.scoping.featurecalls.OperatorMapping
Replies the mapping for the operators.
Returns:
the mapping.
getOperatorSymbol(XAbstractFeatureCall)
protected def getOperatorSymbol(XAbstractFeatureCall) : java.lang.String
Get the string representation of an operator.
Parameters:
call - the call to the operator feature.
Returns:
the string representation of the operator or null if not a valid operator.
getTypeBuilder
def getTypeBuilder : org.eclipse.xtext.xbase.jvmmodel.JvmTypesBuilder
Replies the type builder.
Returns:
the builder.
getTypeConverter(IExtraLanguageGeneratorContext)
def getTypeConverter(IExtraLanguageGeneratorContext) : ExtraLanguageTypeConverter
getTypeConverterInitializer
protected def getTypeConverterInitializer : IExtraLanguageConversionInitializer
Replies the initializer for the type converter.
Returns:
the initializer
getTypeReferences
def getTypeReferences : org.eclipse.xtext.common.types.util.TypeReferences
Replies the type reference finder.
Returns:
the type reference finder.
getTypeResolver
def getTypeResolver : org.eclipse.xtext.xbase.typesystem.IBatchTypeResolver
Replies the type resolver for expressions.
Returns:
the batch type resolver.
setExpressionHelper(XExpressionHelper)
def setExpressionHelper(XExpressionHelper)
Change the expression helper.
Parameters:
helper - the expression helper.
setFeatureNameProvider(IdentifiableSimpleNameProvider)
def setFeatureNameProvider(IdentifiableSimpleNameProvider)
Change the basic feature name provider.
Parameters:
provider - the feature name provider.
setInjector(Injector)
def setInjector(Injector)
Change the injector.
Parameters:
injector - the injector.
setLogicalContainerProvider(ILogicalContainerProvider)
def setLogicalContainerProvider(ILogicalContainerProvider)
Change the provider of the logical container.
Parameters:
provider - the logical container provider.
setOperatorMapping(OperatorMapping)
def setOperatorMapping(OperatorMapping)
Change the mapping for the operators.
Parameters:
mapping - the mapping.
setTypeBuilder(JvmTypesBuilder)
def setTypeBuilder(JvmTypesBuilder)
Change the type builder.
Parameters:
builder - the builder.
setTypeReferences(TypeReferences)
def setTypeReferences(TypeReferences)
Change the type reference finder.
Parameters:
finder - the type reference finder.
setTypeResolver(IBatchTypeResolver)
def setTypeResolver(IBatchTypeResolver)
Change the type resolver for expressions.
Parameters:
resolver - the batch type resolver.