public static void printErrorContext(String prefix, OutputStream stream) {
    stream.nativeStream.print(prefix + "While ");
    if (((Keyword)(Stella.$TRANSLATIONPHASE$.get())) != null) {
      if (((Keyword)(Stella.$TRANSLATIONPHASE$.get())) == Stella.KWD_DEFINE) {
        stream.nativeStream.print("defining ");
      }
      else if (((Keyword)(Stella.$TRANSLATIONPHASE$.get())) == Stella.KWD_FINALIZE) {
        stream.nativeStream.print("finalizing ");
      }
      else if (((Keyword)(Stella.$TRANSLATIONPHASE$.get())) == Stella.KWD_WALK) {
        stream.nativeStream.print("walking ");
      }
      else if (((Keyword)(Stella.$TRANSLATIONPHASE$.get())) == Stella.KWD_TRANSLATE) {
        stream.nativeStream.print("translating ");
      }
      else {
        { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

          stream000.nativeStream.print("`" + ((Keyword)(Stella.$TRANSLATIONPHASE$.get())) + "' is not a valid case option");
          throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
        }
      }
    }
    else {
      stream.nativeStream.print("processing ");
    }
    if (((TranslationUnit)(Stella.$CURRENTTRANSLATIONUNIT$.get())) != null) {
      { Stella_Object renamed_Object = ((TranslationUnit)(Stella.$CURRENTTRANSLATIONUNIT$.get())).theObject;
        Symbol category = ((TranslationUnit)(Stella.$CURRENTTRANSLATIONUNIT$.get())).category;

        if (category == Stella.SYM_STELLA_CLASS) {
          stream.nativeStream.print("class ");
          if (Surrogate.subtypeOfClassP(Stella_Object.safePrimaryType(renamed_Object))) {
            { Stella_Class object000 = ((Stella_Class)(renamed_Object));

              stream.nativeStream.print(object000.name());
            }
          }
          else {
            stream.nativeStream.print(renamed_Object);
          }
        }
        else if (category == Stella.SYM_STELLA_SLOT) {
          stream.nativeStream.print("external slot ");
          { Surrogate testValue000 = Stella_Object.safePrimaryType(renamed_Object);

            if (testValue000 == Stella.SGT_STELLA_CONS) {
              { Cons object000 = ((Cons)(renamed_Object));

                stream.nativeStream.print(object000.rest.value + "." + object000.rest.rest.value);
              }
            }
            else if (Surrogate.subtypeOfStorageSlotP(testValue000)) {
              { StorageSlot object000 = ((StorageSlot)(renamed_Object));

                stream.nativeStream.print(object000.slotOwner + "." + object000.slotName.symbolName);
              }
            }
            else {
              { OutputStringStream stream001 = OutputStringStream.newOutputStringStream();

                stream001.nativeStream.print("`" + testValue000 + "' is not a valid case option");
                throw ((StellaException)(StellaException.newStellaException(stream001.theStringReader()).fillInStackTrace()));
              }
            }
          }
        }
        else if ((category == Stella.SYM_STELLA_METHOD) ||
            (category == Stella.SYM_STELLA_PRINT_METHOD)) {
          { Surrogate testValue001 = Stella_Object.safePrimaryType(renamed_Object);

            if (Surrogate.subtypeOfMethodSlotP(testValue001)) {
              { MethodSlot object000 = ((MethodSlot)(renamed_Object));

                if (((BooleanWrapper)(KeyValueList.dynamicSlotValue(object000.dynamicSlots, Stella.SYM_STELLA_METHOD_MACROp, Stella.FALSE_WRAPPER))).wrapperValue) {
                  stream.nativeStream.print("macro " + object000.slotName);
                }
                else if (object000.methodFunctionP) {
                  stream.nativeStream.print("function " + object000.slotName);
                }
                else {
                  stream.nativeStream.print("method " + object000.slotOwner + "." + object000.slotName.symbolName);
                }
              }
            }
            else if (testValue001 == Stella.SGT_STELLA_CONS) {
              { Cons object000 = ((Cons)(renamed_Object));

                { GeneralizedSymbol testValue002 = ((GeneralizedSymbol)(object000.value));

                  if (testValue002 == Stella.SYM_STELLA_DEFMETHOD) {
                    stream.nativeStream.print("method ");
                  }
                  else if (testValue002 == Stella.SYM_STELLA_DEFUN) {
                    stream.nativeStream.print("function ");
                  }
                  else {
                  }
                }
                stream.nativeStream.print(((Stella_Object.consP(object000.rest.value) ? ((Cons)(object000.rest.value)).value : object000.rest.value)));
              }
            }
            else {
              { OutputStringStream stream002 = OutputStringStream.newOutputStringStream();

                stream002.nativeStream.print("`" + testValue001 + "' is not a valid case option");
                throw ((StellaException)(StellaException.newStellaException(stream002.theStringReader()).fillInStackTrace()));
              }
            }
          }
        }
        else if (category == Stella.SYM_STELLA_GLOBAL_VARIABLE) {
          { Surrogate testValue003 = Stella_Object.safePrimaryType(renamed_Object);

            if (Surrogate.subtypeOfP(testValue003, Stella.SGT_STELLA_GLOBAL_VARIABLE)) {
              { GlobalVariable object000 = ((GlobalVariable)(renamed_Object));

                if (object000.variableConstantP) {
                  stream.nativeStream.print("constant ");
                }
                else {
                  if (object000.variableSpecialP) {
                    stream.nativeStream.print("special variable ");
                  }
                  else {
                    stream.nativeStream.print("global variable ");
                  }
                }
                stream.nativeStream.print(object000.variableName);
              }
            }
            else if (testValue003 == Stella.SGT_STELLA_CONS) {
              { Cons object000 = ((Cons)(renamed_Object));

                stream.nativeStream.print(object000.value + " " + object000.rest.value);
              }
            }
            else {
              { OutputStringStream stream003 = OutputStringStream.newOutputStringStream();

                stream003.nativeStream.print("`" + testValue003 + "' is not a valid case option");
                throw ((StellaException)(StellaException.newStellaException(stream003.theStringReader()).fillInStackTrace()));
              }
            }
          }
        }
        else if (category == Stella.SYM_STELLA_TYPE) {
          stream.nativeStream.print("type ");
          { Surrogate testValue004 = Stella_Object.safePrimaryType(renamed_Object);

            if (testValue004 == Stella.SGT_STELLA_CONS) {
              { Cons object000 = ((Cons)(renamed_Object));

                stream.nativeStream.print(object000.rest.value);
              }
            }
            else if (Surrogate.subtypeOfP(testValue004, Stella.SGT_STELLA_TYPE_SPEC)) {
              { StandardObject object000 = ((StandardObject)(renamed_Object));

                stream.nativeStream.print(StandardObject.yieldTypeSpecTree(object000));
              }
            }
            else {
              { OutputStringStream stream004 = OutputStringStream.newOutputStringStream();

                stream004.nativeStream.print("`" + testValue004 + "' is not a valid case option");
                throw ((StellaException)(StellaException.newStellaException(stream004.theStringReader()).fillInStackTrace()));
              }
            }
          }
        }
        else if (category == Stella.SYM_STELLA_MODULE) {
          stream.nativeStream.print("module ");
          { Surrogate testValue005 = Stella_Object.safePrimaryType(renamed_Object);

            if (Surrogate.subtypeOfP(testValue005, Stella.SGT_STELLA_MODULE)) {
              { Module object000 = ((Module)(renamed_Object));

                stream.nativeStream.print(object000.moduleName);
              }
            }
            else if (testValue005 == Stella.SGT_STELLA_CONS) {
              { Cons object000 = ((Cons)(renamed_Object));

                stream.nativeStream.print(object000.rest.value);
              }
            }
            else {
              { OutputStringStream stream005 = OutputStringStream.newOutputStringStream();

                stream005.nativeStream.print("`" + testValue005 + "' is not a valid case option");
                throw ((StellaException)(StellaException.newStellaException(stream005.theStringReader()).fillInStackTrace()));
              }
            }
          }
        }
        else {
          stream.nativeStream.print(category);
        }
      }
    }
    else {
      stream.nativeStream.print("top-level statement");
    }
    stream.nativeStream.print(":");
  }