io.sarl.lang.extralanguage.compiler
Class ExtraLanguageFeatureNameConverter
class ExtraLanguageFeatureNameConverter
extends java.lang.Object
Converter from Jvm feature name to the extra language feature name.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
compiler
Since:
0.6
Constructor Summary
Action Summary
Modifier and type Action and description
java.lang.String convertDeclarationName(String,SarlAction)
Convert the given name for the given feature to its equivalent in the extra language.
io.sarl.lang.extralanguage.compiler.ConversionResult convertFeatureCall(String,JvmIdentifiableElement,List<E>,List<E>,List<E>)
Convert a full call to a feature.
ConversionType getConversionTypeFor(XAbstractFeatureCall)
Replies the type of conversion for the given feature call.
static char getKey(String)
Compute the mapping key for the given simple name.
protected java.util.Map<K,V> initMapping
Build the mapping table.
Constructor Details
new(IExtraLanguageConversionInitializer,IExtraLanguageGeneratorContext,IExtraLanguageKeywordProvider)
new(IExtraLanguageConversionInitializer,IExtraLanguageGeneratorContext,IExtraLanguageKeywordProvider)
Constructor.
Parameters:
initializer - the initializer.
context - the generation context.
keywords - the provider of extra-language keywords.
Action Details
convertDeclarationName(String,SarlAction)
def convertDeclarationName(String,SarlAction) : java.lang.String
Convert the given name for the given feature to its equivalent in the extra language.

Usually, this function is called to convert the function's name when it is declared.
Parameters:
simpleName - the feature's simple name to convert.
feature - the JVM feature that corresponds to the name.
Returns:
the conversion result, or null if the equivalent function not exists, or simpleName if the function name should stay unchanged.
convertFeatureCall(String,JvmIdentifiableElement,List<E>,List<E>,List<E>)
def convertFeatureCall(String,JvmIdentifiableElement,List<E>,List<E>,List<E>) : io.sarl.lang.extralanguage.compiler.ConversionResult
Convert a full call to a feature.

This function is supposed to change the two list parameters for reflecting the conversion.
Parameters:
simpleName - the simple name of the feature to be called.
calledFeature - the called feature.
leftOperand - the description of the elements into the left operand (usually, before assignment sign).
receiver - the description of the receiver, i.e. the object on which the feature is called.
arguments - the list of the arguments.
Returns:
a description of the conversion; or null for ignoring the call.
getConversionTypeFor(XAbstractFeatureCall)
def getConversionTypeFor(XAbstractFeatureCall) : ConversionType
Replies the type of conversion for the given feature call.
Parameters:
featureCall - the feature call.
Returns:
the type of conversion.
getKey(String)
def getKey(String) : char
Compute the mapping key for the given simple name.
Parameters:
name - the simple name.
Returns:
the mapping ket for the simple name.
initMapping
protected def initMapping : java.util.Map<K,V>
Build the mapping table.
Returns:
the mapping table.