public static void printContext(Context self, PrintableStringWriter stream) {
    { String typestring = null;
      String name = null;
      int number = self.contextNumber;

      if (!Stella.$CLASS_HIERARCHY_BOOTEDp$) {
        stream.print("|MDL|" + ((Module)(self)).moduleName);
        return;
      }
      { Surrogate testValue000 = Stella_Object.safePrimaryType(self);

        if (Surrogate.subtypeOfP(testValue000, Stella.SGT_STELLA_MODULE)) {
          { Module self000 = ((Module)(self));

            name = self000.moduleFullName;
            if ((((self000.contextNumber) % 2) == 1)) {
              typestring = "|DeLeTeD MDL|";
            }
            else {
              typestring = "|MDL|";
            }
          }
        }
        else if (Surrogate.subtypeOfP(testValue000, Stella.SGT_STELLA_WORLD)) {
          { World self000 = ((World)(self));

            name = ((StringWrapper)(KeyValueList.dynamicSlotValue(self000.dynamicSlots, Stella.SYM_STELLA_WORLD_NAME, Stella.NULL_STRING_WRAPPER))).wrapperValue;
            if ((((self000.contextNumber) % 2) == 1)) {
              typestring = "|DeLeTeD WLD|";
            }
            else {
              typestring = "|WLD|";
            }
          }
        }
        else {
          { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

            stream000.nativeStream.print("`" + testValue000 + "' is not a valid case option");
            throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
          }
        }
      }
      if ((((self.contextNumber) % 2) == 1)) {
        number = number + 1;
      }
      if (((Boolean)(Stella.$PRINTREADABLYp$.get())).booleanValue()) {
        if (name != null) {
          stream.print(name);
        }
        else {
          stream.print("#<" + typestring + number + ">");
        }
      }
      else {
        if (name != null) {
          stream.print(typestring + name);
        }
        else {
          stream.print(typestring + number);
        }
      }
    }
  }