public static Cons walkPrefixForeachTree(Cons tree, Object [] MV_returnarray) {
    { Cons tail = null;
      Cons iteratorclauses = null;
      Cons valueclauses = null;
      Cons bumpclauses = null;
      Stella_Object continuationtest = null;
      Stella_Object wheretest = null;
      Cons doactions = Stella.NIL;

      { Object [] caller_MV_returnarray = new Object[3];

        iteratorclauses = Cons.walkCursorsTree(((Cons)(tree.rest.value)), false, caller_MV_returnarray);
        valueclauses = ((Cons)(caller_MV_returnarray[0]));
        bumpclauses = ((Cons)(caller_MV_returnarray[1]));
        continuationtest = ((Stella_Object)(caller_MV_returnarray[2]));
      }
      tail = ((Cons)(tree.rest.rest));
      if (((Cons)(tail.value)).value == Stella.SYM_STELLA_WHERE) {
        wheretest = ((Cons)(tail.value)).rest.value;
        tail = tail.rest;
      }
      if (((Cons)(tail.value)).value == Stella.SYM_STELLA_DO) {
        doactions = ((Cons)(tail.value)).rest;
        tail = tail.rest;
      }
      if (!(tail == Stella.NIL)) {
        { Object [] caller_MV_returnarray = new Object[1];

          iteratorclauses = Cons.walkPrefixCollectIntoTree(((Cons)(tail.value)), iteratorclauses, doactions, caller_MV_returnarray);
          doactions = ((Cons)(caller_MV_returnarray[0]));
        }
      }
      { Cons _return_temp = Cons.list$(Cons.cons(Stella.SYM_STELLA_SYS_FOREACH, Cons.cons(iteratorclauses, Cons.cons(Cons.cons(valueclauses, Cons.cons(bumpclauses, Cons.cons(continuationtest, Cons.walkPrefixForeachBody(iteratorclauses, wheretest, doactions).concatenate(Stella.NIL, Stella.NIL)))), Stella.NIL))));

        MV_returnarray[0] = Stella.SGT_STELLA_VOID;
        return (_return_temp);
      }
    }
  }