public static void helpSignalPropositionError(OutputStream stream, Keyword warningorerror) {
    { Stella_Object bestoutputobject = ((Stella_Object)(Logic.$TERMUNDERCONSTRUCTION$.get()));
      String typename = ((bestoutputobject != null) ? "proposition" : "relation");

      if (bestoutputobject == null) {
        bestoutputobject = ((Stella_Object)(Logic.$DESCRIPTIONUNDERCONSTRUCTION$.get()));
      }
      if ((bestoutputobject == null) &&
          (((String)(Logic.$TERMSOURCEBEINGPARSED$.get())) != null)) {
        bestoutputobject = StringWrapper.wrapString(((String)(Logic.$TERMSOURCEBEINGPARSED$.get())));
      }
      if (bestoutputobject != null) {
        stream.nativeStream.print("   ");
        if (warningorerror == Logic.KWD_ERROR) {
          stream.nativeStream.print("Error");
        }
        else if (warningorerror == Logic.KWD_WARNING) {
          stream.nativeStream.print("Warning");
        }
        else {
          { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

            stream000.nativeStream.print("`" + warningorerror + "' is not a valid case option");
            throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
          }
        }
        stream.nativeStream.print(" occurred while parsing the " + typename + ": ");
        { Surrogate testValue000 = Stella_Object.safePrimaryType(bestoutputobject);

          if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_NAMED_DESCRIPTION)) {
            { NamedDescription bestoutputobject000 = ((NamedDescription)(bestoutputobject));

              stream.nativeStream.println(NamedDescription.relationName(bestoutputobject000));
              return;
            }
          }
          else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_PROPOSITION)) {
            { Proposition bestoutputobject000 = ((Proposition)(bestoutputobject));

              {
                stream.nativeStream.println();
                stream.nativeStream.print("   ");
              }
;
              Logic.printFormulaContainingError(((Stella_Object)(Logic.$TERMUNDERCONSTRUCTION$.get())), stream);
            }
          }
          else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_DESCRIPTION)) {
            { Description bestoutputobject000 = ((Description)(bestoutputobject));

              {
                stream.nativeStream.println();
                stream.nativeStream.print("   ");
              }
;
              Logic.printFormulaContainingError(((Stella_Object)(Logic.$TERMUNDERCONSTRUCTION$.get())), stream);
            }
          }
          else if (testValue000 == Logic.SGT_STELLA_CONS) {
            { Cons bestoutputobject000 = ((Cons)(bestoutputobject));

              {
                stream.nativeStream.println();
                stream.nativeStream.print("   ");
              }
;
              Logic.printFormulaContainingError(((Stella_Object)(Logic.$TERMUNDERCONSTRUCTION$.get())), stream);
            }
          }
          else if (Surrogate.subtypeOfStringP(testValue000)) {
            { StringWrapper bestoutputobject000 = ((StringWrapper)(bestoutputobject));

              stream.nativeStream.println();
              { Stella_Object sexpression = Stella.readSExpressionFromString(bestoutputobject000.wrapperValue);

                Logic.printFormulaContainingError(sexpression, stream);
              }
            }
          }
          else {
          }
        }
        stream.nativeStream.println();
      }
    }
  }