org.eclipse.internal.xpand2.debug
Class ExpandSpecial

java.lang.Object
  extended by org.eclipse.internal.xtend.expression.debug.BaseSpecialTreatment
      extended by org.eclipse.internal.xpand2.debug.ExpandSpecial

public class ExpandSpecial
extends BaseSpecialTreatment

An ExpandStatement calls monitor.preTask() always twice in case of isForeach. The first call is for the Statement itself and the second for every execution of the included definition.
We remember each call on a Stack and use the first entry to store count and number of loops.
This (outer) frame is hiddened.

We do this whole mechanism (different from the Java behavior) that the user can go over one execution of the EXPAND with Step_Over and go over all loops with Step_Return. In Java this behavior is not possible. There is the Ctrl+R functionality, what is not implemented for our debug model.

We can't use an empty iterator as in Foreach, because an expand could be called iteratively.
Therefore we remember each 2nd time the statement together with it's target element count.

Author:
Clemens Kadura (zAJKa)

Constructor Summary
ExpandSpecial()
           
 
Method Summary
 java.lang.String adaptElementName(ISyntaxElement se, ExecutionContext context)
          add syntax element specific content to the element name that will be shown in Launch view
 void adaptSyntaxElement(org.eclipse.emf.mwe.core.debug.model.SyntaxElement to, java.lang.Object element)
           
 ISyntaxElement getSpecialEndSyntaxElement(ISyntaxElement se)
           
 boolean shallNotSuspend(java.lang.Object element, int flag, ExecutionContext ctx)
           
 
Methods inherited from class org.eclipse.internal.xtend.expression.debug.BaseSpecialTreatment
getElementNameLength
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpandSpecial

public ExpandSpecial()
Method Detail

shallNotSuspend

public boolean shallNotSuspend(java.lang.Object element,
                               int flag,
                               ExecutionContext ctx)
Overrides:
shallNotSuspend in class BaseSpecialTreatment

adaptSyntaxElement

public void adaptSyntaxElement(org.eclipse.emf.mwe.core.debug.model.SyntaxElement to,
                               java.lang.Object element)
Overrides:
adaptSyntaxElement in class BaseSpecialTreatment

adaptElementName

public java.lang.String adaptElementName(ISyntaxElement se,
                                         ExecutionContext context)
Description copied from class: BaseSpecialTreatment
add syntax element specific content to the element name that will be shown in Launch view

Overrides:
adaptElementName in class BaseSpecialTreatment
Parameters:
se - the syntax element
context - the execution context
Returns:
the special text to add to the name

getSpecialEndSyntaxElement

public ISyntaxElement getSpecialEndSyntaxElement(ISyntaxElement se)
Overrides:
getSpecialEndSyntaxElement in class BaseSpecialTreatment