src/main/java/org/semgus/java/event/EventParser.java
public static SpecEvent parseEvent(JSONObject eventDto) throws DeserializationException {
        String eventType = JsonUtils.getString(eventDto, "$event");
        return switch (eventType) {
            case "set-info" -> parseSetInfo(eventDto);
            case "end-of-stream" -> new MetaSpecEvent.StreamEndEvent();
            case "check-synth" -> new CheckSynthEvent();
            case "declare-term-type" -> parseDeclareTermType(eventDto);
            case "define-term-type" -> parseDefineTermType(eventDto);
            case "chc" -> parseHornClause(eventDto);
            case "constraint" -> parseConstraint(eventDto);
            case "synth-fun" -> parseSynthFun(eventDto);
            default -> throw new DeserializationException(
                    String.format("Unknown specification event \"%s\"", eventType), "$event");
        };
    }
/**
     * Deserializes a JSON object as a parser event.
     *
     * @param eventDto The JSON object.
     * @return The deserialized parser event.
     * @throws DeserializationException If {@code eventDto} is not a valid representation of a parser event.
     */
Deserializes a JSON object as a parser event.
@param eventDto The JSON object.
@return The deserialized parser event.
@throws DeserializationException If  eventDto is not a valid representation of a parser event.
Deserializes a JSON object as a parser event . @param eventDto The JSON object . @return The deserialized parser event . @throws DeserializationException If eventDto is not a valid representation of a parser event .
public static SpecEvent parseEvent(JSONObject eventDto) throws DeserializationException {
        String eventType = JsonUtils.getString(eventDto, "$event");
        return switch (eventType) {
            case "set-info" -> parseSetInfo(eventDto);
            case "end-of-stream" -> new MetaSpecEvent.StreamEndEvent();
            case "check-synth" -> new CheckSynthEvent();
            case "declare-term-type" -> parseDeclareTermType(eventDto);
            case "define-term-type" -> parseDefineTermType(eventDto);
            case "chc" -> parseHornClause(eventDto);
            case "constraint" -> parseConstraint(eventDto);
            case "synth-fun" -> parseSynthFun(eventDto);
            default -> throw new DeserializationException(
                    String.format("Unknown specification event \"%s\"", eventType), "$event");
        };
    }
public static SpecEvent parseEvent ( JSONObject eventDto ) throws DeserializationException { String eventType = JsonUtils . getString ( eventDto , "$event" ) ; return switch ( eventType ) { case "set-info" -> parseSetInfo ( eventDto ) ; case "end-of-stream" -> new MetaSpecEvent . StreamEndEvent ( ) ; case "check-synth" -> new CheckSynthEvent ( ) ; case "declare-term-type" -> parseDeclareTermType ( eventDto ) ; case "define-term-type" -> parseDefineTermType ( eventDto ) ; case "chc" -> parseHornClause ( eventDto ) ; case "constraint" -> parseConstraint ( eventDto ) ; case "synth-fun" -> parseSynthFun ( eventDto ) ; default -> throw new DeserializationException ( String . format ( "Unknown specification event \"%s\"" , eventType ) , "$event" ) ; } ; }
Deserializes a JSON object as a parser event.
Deserializes a JSON object as a parser event .