io.sarl.lang.compiler
Class JavaInlineExpressionCompiler
All Superinterfaces:
IInlineExpressionCompiler
class JavaInlineExpressionCompiler
extends java.lang.Object
implements IInlineExpressionCompiler
Compiler for creating inline expressions with Java syntax. Inline expressions are usually attached to the SARL code with the @Inline annotation.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
compiler
Since:
0.4
See:
org.eclipse.xtext.xbase.lib.Inline
Nested Type Summary
Modifier and type Type and description
record JavaInlineExpressionCompiler.AnnotationInformation
Information about the line annotation.
protected class JavaInlineExpressionCompiler.InlineAnnotationTreeAppendable
Appendable for creating an inline expression.
Constructor Summary
Constructor and description
new
Constructor.
Action Summary
Modifier and type Action and description
protected java.lang.Boolean _generate(CharSequence,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
Append the inline code for the given character sequence.
protected java.lang.Boolean _generate(Number,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
Append the inline code for the given number value.
protected java.lang.Boolean _generate(JvmTypeReference,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
Append the inline code for the given type.
protected java.lang.Boolean _generate(XBooleanLiteral,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
Append the inline code for the given XBooleanLiteral.
protected java.lang.Boolean _generate(XCastedExpression,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
Append the inline code for the given XCastedExpression.
protected java.lang.Boolean _generate(XInstanceOfExpression,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
Append the inline code for the given XInstanceOfExpression.
protected java.lang.Boolean _generate(XNullLiteral,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
Append the inline code for the given XNullLiteral.
protected java.lang.Boolean _generate(XNumberLiteral,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
Append the inline code for the given XNumberLiteral.
protected java.lang.Boolean _generate(XReturnExpression,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
Append the inline code for the given XReturnLiteral.
protected java.lang.Boolean _generate(XStringLiteral,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
Append the inline code for the given XStringLiteral.
protected java.lang.Boolean _generate(XTypeLiteral,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
Append the inline code for the given XTypeLiteral.
void appendInlineAnnotation(JvmAnnotationTarget,XtendExecutable)
void appendInlineAnnotation(JvmAnnotationTarget,ResourceSet,String,JvmTypeReference*)
protected void appendInlineAnnotation(JvmAnnotationTarget,ResourceSet,String,boolean,boolean,JvmTypeReference*)
Append the inline annotation to the given operation.
protected boolean generate(XExpression,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
Append the inline annotation to the given operation.
protected InlineAnnotationTreeAppendable newAppendable(ImportManager)
Create an appendable.
Constructor Details
new
new
Constructor.
Action Details
_generate(CharSequence,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
protected def _generate(CharSequence,XExpression,XtendExecutable,InlineAnnotationTreeAppendable) : java.lang.Boolean
Append the inline code for the given character sequence.
Parameters:
expression - the expression of the operation.
parentExpression - is the expression that contains this one, or null if the current expression is the root expression.
feature - the feature that contains the expression.
output - the output.
Returns:
true if a text was appended.
_generate(Number,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
protected def _generate(Number,XExpression,XtendExecutable,InlineAnnotationTreeAppendable) : java.lang.Boolean
Append the inline code for the given number value.
Parameters:
expression - the expression of the operation.
parentExpression - is the expression that contains this one, or null if the current expression is the root expression.
feature - the feature that contains the expression.
output - the output.
Returns:
true if a text was appended.
_generate(JvmTypeReference,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
protected def _generate(JvmTypeReference,XExpression,XtendExecutable,InlineAnnotationTreeAppendable) : java.lang.Boolean
Append the inline code for the given type.
Parameters:
expression - the expression of the operation.
parentExpression - is the expression that contains this one, or null if the current expression is the root expression.
feature - the feature that contains the expression.
output - the output.
Returns:
true if a text was appended.
_generate(XBooleanLiteral,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
protected def _generate(XBooleanLiteral,XExpression,XtendExecutable,InlineAnnotationTreeAppendable) : java.lang.Boolean
Append the inline code for the given XBooleanLiteral.
Parameters:
expression - the expression of the operation.
parentExpression - is the expression that contains this one, or null if the current expression is the root expression.
feature - the feature that contains the expression.
output - the output.
Returns:
true if a text was appended.
_generate(XCastedExpression,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
protected def _generate(XCastedExpression,XExpression,XtendExecutable,InlineAnnotationTreeAppendable) : java.lang.Boolean
Append the inline code for the given XCastedExpression.
Parameters:
expression - the expression of the operation.
parentExpression - is the expression that contains this one, or null if the current expression is the root expression.
feature - the feature that contains the expression.
output - the output.
Returns:
true if a text was appended.
_generate(XInstanceOfExpression,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
protected def _generate(XInstanceOfExpression,XExpression,XtendExecutable,InlineAnnotationTreeAppendable) : java.lang.Boolean
Append the inline code for the given XInstanceOfExpression.
Parameters:
expression - the expression of the operation.
parentExpression - is the expression that contains this one, or null if the current expression is the root expression.
feature - the feature that contains the expression.
output - the output.
Returns:
true if a text was appended.
_generate(XNullLiteral,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
protected def _generate(XNullLiteral,XExpression,XtendExecutable,InlineAnnotationTreeAppendable) : java.lang.Boolean
Append the inline code for the given XNullLiteral.
Parameters:
expression - the expression of the operation.
parentExpression - is the expression that contains this one, or null if the current expression is the root expression.
feature - the feature that contains the expression.
output - the output.
Returns:
true if a text was appended.
_generate(XNumberLiteral,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
protected def _generate(XNumberLiteral,XExpression,XtendExecutable,InlineAnnotationTreeAppendable) : java.lang.Boolean
Append the inline code for the given XNumberLiteral.
Parameters:
expression - the expression of the operation.
parentExpression - is the expression that contains this one, or null if the current expression is the root expression.
feature - the feature that contains the expression.
output - the output.
Returns:
true if a text was appended.
_generate(XReturnExpression,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
protected def _generate(XReturnExpression,XExpression,XtendExecutable,InlineAnnotationTreeAppendable) : java.lang.Boolean
Append the inline code for the given XReturnLiteral.
Parameters:
expression - the expression of the operation.
parentExpression - is the expression that contains this one, or null if the current expression is the root expression.
feature - the feature that contains the expression.
output - the output.
Returns:
true if a text was appended.
_generate(XStringLiteral,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
protected def _generate(XStringLiteral,XExpression,XtendExecutable,InlineAnnotationTreeAppendable) : java.lang.Boolean
Append the inline code for the given XStringLiteral.
Parameters:
expression - the expression of the operation.
parentExpression - is the expression that contains this one, or null if the current expression is the root expression.
feature - the feature that contains the expression.
output - the output.
Returns:
true if a text was appended.
_generate(XTypeLiteral,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
protected def _generate(XTypeLiteral,XExpression,XtendExecutable,InlineAnnotationTreeAppendable) : java.lang.Boolean
Append the inline code for the given XTypeLiteral.
Parameters:
expression - the expression of the operation.
parentExpression - is the expression that contains this one, or null if the current expression is the root expression.
feature - the feature that contains the expression.
output - the output.
Returns:
true if a text was appended.
appendInlineAnnotation(JvmAnnotationTarget,XtendExecutable)
def appendInlineAnnotation(JvmAnnotationTarget,XtendExecutable)
appendInlineAnnotation(JvmAnnotationTarget,ResourceSet,String,JvmTypeReference*)
def appendInlineAnnotation(JvmAnnotationTarget,ResourceSet,String,JvmTypeReference*)
appendInlineAnnotation(JvmAnnotationTarget,ResourceSet,String,boolean,boolean,JvmTypeReference*)
protected def appendInlineAnnotation(JvmAnnotationTarget,ResourceSet,String,boolean,boolean,JvmTypeReference*)
Append the inline annotation to the given operation.
Parameters:
target - the target of the annotation.
resourceSet - the resource set that is associated to the given operation.
inlineExpression - the inline expression.
isConstantExpression - indicates if the expression is a constant.
isStatementExpression - indicates if the expression is a statement.
types - the types to import if the inline expression is used. The references are cloned by this function.
generate(XExpression,XExpression,XtendExecutable,InlineAnnotationTreeAppendable)
protected def generate(XExpression,XExpression,XtendExecutable,InlineAnnotationTreeAppendable) : boolean
Append the inline annotation to the given operation.
Parameters:
expression - the expression of the operation.
parentExpression - is the expression that contains this one, or null if the current expression is the root expression.
feature - the feature that contains the expression.
output - the inline code.
Returns:
true if a text was appended.
newAppendable(ImportManager)
protected def newAppendable(ImportManager) : InlineAnnotationTreeAppendable
Create an appendable.
Parameters:
imports - the import manager.
Returns:
the appendable.