* @return Stella_Object
   */
  public static Stella_Object incrementallyTranslate(Stella_Object tree) {
    { boolean toplevelinvocationP = ((List)(Stella.$TRANSLATIONUNITS$.get())) == null;
      Stella_Object ocode = null;
      boolean declarationP = Stella_Object.consP(tree) &&
          Cons.declarationTreeP(((Cons)(tree)));

      { Object old$Translationunits$000 = Stella.$TRANSLATIONUNITS$.get();
        Object old$Translationverbositylevel$000 = Stella.$TRANSLATIONVERBOSITYLEVEL$.get();
        Object old$Translationphase$000 = Stella.$TRANSLATIONPHASE$.get();
        Object old$Translationerrors$000 = Stella.$TRANSLATIONERRORS$.get();
        Object old$Translationwarnings$000 = Stella.$TRANSLATIONWARNINGS$.get();
        Object old$Translationnotes$000 = Stella.$TRANSLATIONNOTES$.get();

        try {
          Native.setSpecial(Stella.$TRANSLATIONUNITS$, List.newList());
          Native.setIntSpecial(Stella.$TRANSLATIONVERBOSITYLEVEL$, 0);
          Native.setSpecial(Stella.$TRANSLATIONPHASE$, null);
          Native.setIntSpecial(Stella.$TRANSLATIONERRORS$, 0);
          Native.setIntSpecial(Stella.$TRANSLATIONWARNINGS$, 0);
          Native.setIntSpecial(Stella.$TRANSLATIONNOTES$, 0);
          if (declarationP) {
            Native.setSpecial(Stella.$TRANSLATIONPHASE$, Stella.KWD_DEFINE);
            Cons.walkTopLevelTree(((Cons)(tree)), false);
            if (Stella.translationErrorsP()) {
              Stella.summarizeTranslationErrors();
              return (Stella.NIL);
            }
            ((List)(Stella.$TRANSLATIONUNITS$.get())).reverse();
            Native.setSpecial(Stella.$TRANSLATIONPHASE$, Stella.KWD_FINALIZE);
            Stella.finalizeClassesAndSlots();
            Native.setSpecial(Stella.$TRANSLATIONPHASE$, Stella.KWD_WALK);
            if (!(Stella.useHardcodedSymbolsP())) {
              Stella.clearSymbolRegistry();
            }
            Stella.walkAllPhaseOneUnits();
          }
          else {
            Native.setSpecial(Stella.$TRANSLATIONPHASE$, Stella.KWD_WALK);
            { Object old$UsehardcodedsymbolsP$000 = Stella.$USEHARDCODEDSYMBOLSp$.get();

              try {
                Native.setBooleanSpecial(Stella.$USEHARDCODEDSYMBOLSp$, true);
                ocode = Stella_Object.walkTopLevelExpression(tree);

              } finally {
                Stella.$USEHARDCODEDSYMBOLSp$.set(old$UsehardcodedsymbolsP$000);
              }
            }
          }
          if (Stella.translationErrorsP()) {
            Stella.summarizeTranslationErrors();
            return (Stella.NIL);
          }
          Native.setSpecial(Stella.$TRANSLATIONPHASE$, Stella.KWD_TRANSLATE);
          if (declarationP) {
            Stella.translateAllUnits();
            ocode = Stella.combineTranslatedTrees();
          }
          else {
            { Object old$UsehardcodedsymbolsP$001 = Stella.$USEHARDCODEDSYMBOLSp$.get();

              try {
                Native.setBooleanSpecial(Stella.$USEHARDCODEDSYMBOLSp$, true);
                ocode = Stella_Object.translateWalkedTree(ocode);

              } finally {
                Stella.$USEHARDCODEDSYMBOLSp$.set(old$UsehardcodedsymbolsP$001);
              }
            }
          }
          if (Stella.translationErrorsP()) {
            Stella.summarizeTranslationErrors();
            return (Stella.NIL);
          }
          if (((Keyword)(Stella.$TRANSLATOROUTPUTLANGUAGE$.get())) == Stella.KWD_COMMON_LISP) {
          }
          else if (((Keyword)(Stella.$TRANSLATOROUTPUTLANGUAGE$.get())) == Stella.KWD_IDL) {
            Cons.idlOutputParseTree(((Cons)(ocode)));
            ocode = Stella.NIL;
          }
          else if (((Keyword)(Stella.$TRANSLATOROUTPUTLANGUAGE$.get())) == Stella.KWD_JAVA) {
            Cons.javaOutputParseTree(((Cons)(ocode)));
            ocode = Stella.NIL;
          }
          else if ((((Keyword)(Stella.$TRANSLATOROUTPUTLANGUAGE$.get())) == Stella.KWD_CPP) ||
              (((Keyword)(Stella.$TRANSLATOROUTPUTLANGUAGE$.get())) == Stella.KWD_CPP_STANDALONE)) {
            Cons.cppOutputParseTree(((Cons)(ocode)));
            ocode = Stella.NIL;
          }
          else {
            { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

              stream000.nativeStream.print("`" + ((Keyword)(Stella.$TRANSLATOROUTPUTLANGUAGE$.get())) + "' is not a valid case option");
              throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
            }
          }
          { TranslationUnit unit = null;
            Cons iter000 = ((List)(Stella.$TRANSLATIONUNITS$.get())).theConsList;

            for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
              unit = ((TranslationUnit)(iter000.value));
              unit.free();
            }
          }
          ((List)(Stella.$TRANSLATIONUNITS$.get())).clear();
          if (toplevelinvocationP) {
            Stella.sweepTransients();
          }
          Stella.summarizeTranslationErrors();
          return (ocode);

        } finally {
          Stella.$TRANSLATIONNOTES$.set(old$Translationnotes$000);
          Stella.$TRANSLATIONWARNINGS$.set(old$Translationwarnings$000);
          Stella.$TRANSLATIONERRORS$.set(old$Translationerrors$000);
          Stella.$TRANSLATIONPHASE$.set(old$Translationphase$000);
          Stella.$TRANSLATIONVERBOSITYLEVEL$.set(old$Translationverbositylevel$000);
          Stella.$TRANSLATIONUNITS$.set(old$Translationunits$000);
        }
      }
    }
  }