Interface IRichStringPartAcceptor
-
- All Known Implementing Classes:
AbstractRichStringPartAcceptor
,AbstractRichStringPartAcceptor.ForLoopOnce
,RichStringToLineModel
,ValidatingRichStringAcceptor
,XtendCompiler.RichStringPrepareCompiler
public interface IRichStringPartAcceptor
TheIRichStringPartAcceptor
can be passed into aRichStringProcessor
to handle the semantics of aRichString
for a specific use case. It's mainly an event sink but may influence the control flow of theRichStringProcessor
by means offorLoopHasNext()
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
acceptElse()
Announces that anvoid
acceptElseIfCondition(org.eclipse.xtext.xbase.XExpression condition)
Announces that anvoid
acceptEndFor(org.eclipse.xtext.xbase.XExpression after, java.lang.CharSequence indentation)
Announces that anvoid
acceptEndIf()
Announces that anvoid
acceptExpression(org.eclipse.xtext.xbase.XExpression expression, java.lang.CharSequence indentation)
Announces that anvoid
acceptForLoop(org.eclipse.xtext.common.types.JvmFormalParameter parameter, org.eclipse.xtext.xbase.XExpression expression)
Announces that avoid
acceptIfCondition(org.eclipse.xtext.xbase.XExpression condition)
Announces that anvoid
acceptSemanticLineBreak(int charCount, RichStringLiteral origin, boolean controlStructureSeen)
Indicates a semantic line break in a rich string literal.void
acceptSemanticText(java.lang.CharSequence text, RichStringLiteral origin)
void
acceptTemplateLineBreak(int charCount, RichStringLiteral origin)
Indicates a template line break in a rich string literal.void
acceptTemplateText(java.lang.CharSequence text, RichStringLiteral origin)
void
announceNextLiteral(RichStringLiteral literal)
Announces that a next literal will be processed.boolean
forLoopHasNext(org.eclipse.xtext.xbase.XExpression before, org.eclipse.xtext.xbase.XExpression separator, java.lang.CharSequence indentation)
Queried to determine whether the body of the for-loop should be evaluated (again).
-
-
-
Method Detail
-
acceptSemanticText
void acceptSemanticText(java.lang.CharSequence text, RichStringLiteral origin)
- Parameters:
text
- the semantic text. May not benull
.origin
- the value holder for the full text or null, if unknown.
-
acceptTemplateText
void acceptTemplateText(java.lang.CharSequence text, RichStringLiteral origin)
- Parameters:
text
- the template text. May not benull
.origin
- the value holder for the full text or null, if unknown.
-
acceptSemanticLineBreak
void acceptSemanticLineBreak(int charCount, RichStringLiteral origin, boolean controlStructureSeen)
Indicates a semantic line break in a rich string literal.- Parameters:
origin
- the instance holding the complete text value that contains the line break.charCount
- the number of characters in the line break.controlStructureSeen
- whether or not the line break occurs in a line that contains a control structure.
-
acceptTemplateLineBreak
void acceptTemplateLineBreak(int charCount, RichStringLiteral origin)
Indicates a template line break in a rich string literal.- Parameters:
origin
- the instance holding the complete text value that contains the line break.charCount
- the number of characters in the line break.
-
acceptIfCondition
void acceptIfCondition(org.eclipse.xtext.xbase.XExpression condition)
Announces that an«IF condition»
has been consumed.- Parameters:
condition
- the condition of anRichStringIf
.
-
acceptElseIfCondition
void acceptElseIfCondition(org.eclipse.xtext.xbase.XExpression condition)
Announces that an«ELSEIF condition»
has been consumed.- Parameters:
condition
- the condition of anRichStringElseIf
.
-
acceptElse
void acceptElse()
Announces that an«ELSE»
has been consumed.
-
acceptEndIf
void acceptEndIf()
Announces that an«ENDIF»
has been consumed.
-
acceptForLoop
void acceptForLoop(org.eclipse.xtext.common.types.JvmFormalParameter parameter, org.eclipse.xtext.xbase.XExpression expression)
Announces that a«FOR parameter: expression»
has been consumed.- Parameters:
parameter
- the declared parameter in the for-loop.expression
- the expression that produces anIterable
.
-
forLoopHasNext
boolean forLoopHasNext(org.eclipse.xtext.xbase.XExpression before, org.eclipse.xtext.xbase.XExpression separator, java.lang.CharSequence indentation)
Queried to determine whether the body of the for-loop should be evaluated (again).- Parameters:
before
- the expression that should be evaluated prior to the first item of the loop, if any.separator
- the expression that should be evaluated prior to the second and all subsequent items of the loop.indentation
- the additional indentation for any line besides the first one.- Returns:
true
if the for-loop body should be evaluated.
-
acceptEndFor
void acceptEndFor(org.eclipse.xtext.xbase.XExpression after, java.lang.CharSequence indentation)
Announces that an«ENDFOR»
has been consumed.- Parameters:
after
- the expression that should be evaluated after the last item of the loop, if any.indentation
- the additional indentation for any line besides the first one.
-
acceptExpression
void acceptExpression(org.eclipse.xtext.xbase.XExpression expression, java.lang.CharSequence indentation)
Announces that an«expression»
has been consumed. If the expression's evaluation result contains more than one line, any line besides the first one may be prefixed with the given indentation.- Parameters:
expression
- the consumed expression. May not benull
.indentation
- the additional indentation for any line besides the first one.
-
announceNextLiteral
void announceNextLiteral(RichStringLiteral literal)
Announces that a next literal will be processed.- Parameters:
literal
- the literal.
-
-