コード例 #1
0
 public String[] getStack() {
   org.eclipse.emf.ecore.EObject next = interpreterDelegate.getNextObjectToInterprete();
   java.util.List<org.eclipse.emf.ecore.EObject> parents =
       new java.util.ArrayList<org.eclipse.emf.ecore.EObject>();
   org.eclipse.emf.ecore.EObject current = next;
   while (current != null) {
     parents.add(current);
     current = current.eContainer();
   }
   String[] stack = new String[parents.size()];
   int i = parents.size();
   for (org.eclipse.emf.ecore.EObject parent : parents) {
     String serializedStackElement =
         org.feature.multi.perspective.mapping.viewmapping.resource.mtext.util.MtextStringUtil
             .encode(
                 ',',
                 new String[] {
                   parent.eClass().getName(),
                   Integer.toString(stackFrameID),
                   parent.eResource().getURI().toString(),
                   Integer.toString(getLine(parent)),
                   Integer.toString(getCharStart(parent)),
                   Integer.toString(getCharEnd(parent))
                 });
     stack[--i] = serializedStackElement;
     stackFrameMap.put(stackFrameID++, parent);
   }
   return stack;
 }
コード例 #2
0
 private ResultType interprete(ContextType context) {
   startUpAndWait();
   // start interpretation when the debugger has sent the resume signal
   ResultType result = interpreterDelegate.interprete(context);
   terminate();
   return result;
 }
コード例 #3
0
 public void stepReturn() {
   org.eclipse.emf.ecore.EObject current = interpreterDelegate.getNextObjectToInterprete();
   final int parentLevel =
       org.feature.multi.perspective.mapping.viewmapping.resource.mtext.util.MtextEObjectUtil
               .getDepth(current)
           - 1;
   stopCondition =
       new org.feature.multi.perspective.mapping.viewmapping.resource.mtext.IMtextCommand<
           org.eclipse.emf.ecore.EObject>() {
         public boolean execute(org.eclipse.emf.ecore.EObject element) {
           // For step return, we stop at the next object that is at least one level higher
           int depth =
               org.feature.multi.perspective.mapping.viewmapping.resource.mtext.util
                   .MtextEObjectUtil.getDepth(element);
           return depth <= parentLevel;
         }
       };
   resume();
 }
コード例 #4
0
 public void stepOver() {
   final org.eclipse.emf.ecore.EObject current = interpreterDelegate.getNextObjectToInterprete();
   final int currentLevel =
       org.feature.multi.perspective.mapping.viewmapping.resource.mtext.util.MtextEObjectUtil
           .getDepth(current);
   stopCondition =
       new org.feature.multi.perspective.mapping.viewmapping.resource.mtext.IMtextCommand<
           org.eclipse.emf.ecore.EObject>() {
         public boolean execute(org.eclipse.emf.ecore.EObject element) {
           // For step over, we stop at the next object that is at the same level or higher
           int depth =
               org.feature.multi.perspective.mapping.viewmapping.resource.mtext.util
                   .MtextEObjectUtil.getDepth(element);
           boolean sameOrHigher = depth <= currentLevel;
           boolean differentElement = element != current;
           return sameOrHigher && differentElement;
         }
       };
   resume();
 }
コード例 #5
0
 public void terminate() {
   interpreterDelegate.terminate();
   super.terminate();
 }