public static void javaOutputCommentString(String comment, String commentStart, String commentContinuation, String commentEnd, boolean javadocCommentP, Cons caseConvertedNameList) {
    { boolean returnP = false;
      boolean escapeP = false;
      boolean eolLastP = false;
      boolean insideQuoteP = false;
      OutputStream savedStream = ((OutputStream)(Stella.$CURRENT_STREAM$.get()));
      OutputStringStream stringStream = null;
      String stellaName = null;

      ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print(commentStart);
      { char renamed_Char = Stella.NULL_CHARACTER;
        String vector000 = comment;
        int index000 = 0;
        int length000 = vector000.length();

        loop000 : for (;index000 < length000; index000 = index000 + 1) {
          renamed_Char = vector000.charAt(index000);
          switch (renamed_Char) {
            case '\n': 
              if (!(returnP)) {
                if (eolLastP &&
                    javadocCommentP) {
                  ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.println("<p>");
                }
                else {
                  ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.println();
                }
                eolLastP = true;
                Stella.javaIndent();
                ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print(commentContinuation);
              }
              escapeP = false;
              returnP = false;
            break;
            case '\r': 
              if (eolLastP &&
                  javadocCommentP) {
                ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.println("<p>");
              }
              else {
                ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.println();
              }
              Stella.javaIndent();
              ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print(commentContinuation);
              eolLastP = true;
              returnP = true;
              escapeP = false;
              continue loop000;
            case '`': 
              if (escapeP) {
                ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print(renamed_Char);
              }
              else if (insideQuoteP) {
                Stella.STANDARD_WARNING.nativeStream.println("Warning: Encountered unescaped ` inside ` form in comment `" + comment + "'");
                ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print(renamed_Char);
              }
              else {
                stringStream = OutputStringStream.newOutputStringStream();
                Native.setSpecial(Stella.$CURRENT_STREAM$, stringStream);
                insideQuoteP = true;
              }
              escapeP = false;
              returnP = false;
              eolLastP = false;
            break;
            case '\'': 
              if (escapeP) {
                ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print(renamed_Char);
              }
              else if (insideQuoteP) {
                Native.setSpecial(Stella.$CURRENT_STREAM$, savedStream);
                stellaName = stringStream.theStringReader();
                if (javadocCommentP) {
                  ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print("<code>");
                }
                else {
                  ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print("`");
                }
                ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print(Stella.javaHeuristicallyTranslateName(stellaName, caseConvertedNameList));
                if (javadocCommentP) {
                  ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print("</code>");
                }
                else {
                  ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print("'");
                }
                insideQuoteP = false;
              }
              else {
                ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print(renamed_Char);
              }
              escapeP = false;
              returnP = false;
              eolLastP = false;
            break;
            case '\\': 
              if (escapeP) {
                {
                  ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print(renamed_Char);
                  escapeP = false;
                }
              }
              else {
                escapeP = true;
              }
              returnP = false;
              eolLastP = false;
            break;
            default:
              if (insideQuoteP ||
                  (!javadocCommentP)) {
                ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print(renamed_Char);
              }
              else {
                Stella.writeHtmlCharacterQuotingSpecialCharacters(((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream, renamed_Char);
              }
              returnP = false;
              escapeP = false;
              eolLastP = false;
            break;
          }
        }
      }
      if (insideQuoteP) {
        Stella.STANDARD_WARNING.nativeStream.println("Warning: Comment ended while inside a ` form in comment `" + comment + "'");
        Native.setSpecial(Stella.$CURRENT_STREAM$, savedStream);
        ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print("`");
        ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print(stringStream.theStringReader());
      }
      if ((commentEnd != null) &&
          (!Stella.stringEqlP(commentEnd, ""))) {
        {
          Stella.javaIndent();
          ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.print(commentEnd);
        }
      }
      else {
        ((OutputStream)(Stella.$CURRENT_STREAM$.get())).nativeStream.println();
      }
    }
  }