org.eclipse.xtext.xtend2.compiler
Class Xtend2Compiler.RichStringPrepareCompiler

java.lang.Object
  extended by org.eclipse.xtext.xtend2.richstring.AbstractRichStringPartAcceptor
      extended by org.eclipse.xtext.xtend2.richstring.AbstractRichStringPartAcceptor.ForLoopOnce
          extended by org.eclipse.xtext.xtend2.compiler.Xtend2Compiler.RichStringPrepareCompiler
All Implemented Interfaces:
IRichStringPartAcceptor
Enclosing class:
Xtend2Compiler

public class Xtend2Compiler.RichStringPrepareCompiler
extends AbstractRichStringPartAcceptor.ForLoopOnce


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.xtext.xtend2.richstring.AbstractRichStringPartAcceptor
AbstractRichStringPartAcceptor.ForLoopOnce
 
Constructor Summary
Xtend2Compiler.RichStringPrepareCompiler(IAppendable appendable, java.lang.String variableName)
           
 
Method Summary
 void acceptElse()
          Announces that an «ELSE» has been consumed.
 void acceptElseIfCondition(XExpression condition)
          Announces that an «ELSEIF condition» has been consumed.
 void acceptEndFor(XExpression after, java.lang.CharSequence indentation)
          Announces that an «ENDFOR» has been consumed.
 void acceptEndIf()
          Announces that an «ENDIF» has been consumed.
 void acceptExpression(XExpression expression, java.lang.CharSequence indentation)
          Announces that an «expression» has been consumed.
 void acceptForLoop(JvmFormalParameter parameter, XExpression expression)
          Announces that a «FOR parameter: expression» has been consumed.
 void acceptIfCondition(XExpression condition)
          Announces that an «IF condition» has been consumed.
 void 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.
 boolean forLoopHasNext(XExpression before, XExpression separator, java.lang.CharSequence indentation)
          Queried to determine whether the body of the for-loop should be evaluated (again).
protected  void writeElse()
           
protected  void writeExpression(XExpression expression, java.lang.CharSequence indentation, boolean immediate)
           
protected  void writeIf(XExpression condition)
           
 
Methods inherited from class org.eclipse.xtext.xtend2.richstring.AbstractRichStringPartAcceptor
acceptTemplateText, announceNextLiteral
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Xtend2Compiler.RichStringPrepareCompiler

public Xtend2Compiler.RichStringPrepareCompiler(IAppendable appendable,
                                                java.lang.String variableName)
Method Detail

acceptSemanticLineBreak

public void acceptSemanticLineBreak(int charCount,
                                    RichStringLiteral origin,
                                    boolean controlStructureSeen)
Description copied from interface: IRichStringPartAcceptor
Indicates a semantic line break in a rich string literal.

Specified by:
acceptSemanticLineBreak in interface IRichStringPartAcceptor
Overrides:
acceptSemanticLineBreak in class AbstractRichStringPartAcceptor
Parameters:
charCount - the number of characters in the line break.
origin - the instance holding the complete text value that contains the line break.

acceptTemplateLineBreak

public void acceptTemplateLineBreak(int charCount,
                                    RichStringLiteral origin)
Description copied from interface: IRichStringPartAcceptor
Indicates a template line break in a rich string literal.

Specified by:
acceptTemplateLineBreak in interface IRichStringPartAcceptor
Overrides:
acceptTemplateLineBreak in class AbstractRichStringPartAcceptor
Parameters:
charCount - the number of characters in the line break.
origin - the instance holding the complete text value that contains the line break.

acceptSemanticText

public void acceptSemanticText(java.lang.CharSequence text,
                               RichStringLiteral origin)
Specified by:
acceptSemanticText in interface IRichStringPartAcceptor
Overrides:
acceptSemanticText in class AbstractRichStringPartAcceptor
Parameters:
text - the semantic text. May not be null.
origin - the value holder for the full text or null, if unknown.

acceptIfCondition

public void acceptIfCondition(XExpression condition)
Description copied from interface: IRichStringPartAcceptor
Announces that an
«IF condition»
has been consumed.

Specified by:
acceptIfCondition in interface IRichStringPartAcceptor
Overrides:
acceptIfCondition in class AbstractRichStringPartAcceptor
Parameters:
condition - the condition of an RichStringIf.

acceptElseIfCondition

public void acceptElseIfCondition(XExpression condition)
Description copied from interface: IRichStringPartAcceptor
Announces that an
«ELSEIF condition»
has been consumed.

Specified by:
acceptElseIfCondition in interface IRichStringPartAcceptor
Overrides:
acceptElseIfCondition in class AbstractRichStringPartAcceptor
Parameters:
condition - the condition of an RichStringElseIf.

writeIf

protected void writeIf(XExpression condition)

writeElse

protected void writeElse()

acceptElse

public void acceptElse()
Description copied from interface: IRichStringPartAcceptor
Announces that an
«ELSE»
has been consumed.

Specified by:
acceptElse in interface IRichStringPartAcceptor
Overrides:
acceptElse in class AbstractRichStringPartAcceptor

acceptEndIf

public void acceptEndIf()
Description copied from interface: IRichStringPartAcceptor
Announces that an
«ENDIF»
has been consumed.

Specified by:
acceptEndIf in interface IRichStringPartAcceptor
Overrides:
acceptEndIf in class AbstractRichStringPartAcceptor

acceptForLoop

public void acceptForLoop(JvmFormalParameter parameter,
                          XExpression expression)
Description copied from interface: IRichStringPartAcceptor
Announces that a
«FOR parameter: expression»
has been consumed.

Specified by:
acceptForLoop in interface IRichStringPartAcceptor
Overrides:
acceptForLoop in class AbstractRichStringPartAcceptor.ForLoopOnce
Parameters:
parameter - the declared parameter in the for-loop.
expression - the expression that produces an Iterable.

forLoopHasNext

public boolean forLoopHasNext(XExpression before,
                              XExpression separator,
                              java.lang.CharSequence indentation)
Description copied from interface: IRichStringPartAcceptor
Queried to determine whether the body of the for-loop should be evaluated (again).

Specified by:
forLoopHasNext in interface IRichStringPartAcceptor
Overrides:
forLoopHasNext in class AbstractRichStringPartAcceptor.ForLoopOnce
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

public void acceptEndFor(XExpression after,
                         java.lang.CharSequence indentation)
Description copied from interface: IRichStringPartAcceptor
Announces that an
«ENDFOR»
has been consumed.

Specified by:
acceptEndFor in interface IRichStringPartAcceptor
Overrides:
acceptEndFor in class AbstractRichStringPartAcceptor.ForLoopOnce
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

public void acceptExpression(XExpression expression,
                             java.lang.CharSequence indentation)
Description copied from interface: IRichStringPartAcceptor
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.

Specified by:
acceptExpression in interface IRichStringPartAcceptor
Overrides:
acceptExpression in class AbstractRichStringPartAcceptor
Parameters:
expression - the consumed expression. May not be null.
indentation - the additional indentation for any line besides the first one.

writeExpression

protected void writeExpression(XExpression expression,
                               java.lang.CharSequence indentation,
                               boolean immediate)