Search in sources :

Example 1 with LtlAdapterException

use of de.be4.ltl.core.parser.internal.LtlAdapterException in project probparsers by bendisposto.

the class TemporalLogicParser method generatePrologTerm.

public PrologTerm generatePrologTerm(final String formula, final String stateID) throws LtlParseException {
    T ast;
    try {
        ast = parseFormula(formula);
    } catch (IOException e) {
        String msg = "StringReader should not cause IOExceptions";
        throw new IllegalStateException(msg);
    }
    StructuredPrologOutput pto = new StructuredPrologOutput();
    try {
        applyPrologGenerator(pto, stateID, specParser, ast);
    } catch (LtlAdapterException e) {
        throw e.getOriginalException();
    }
    pto.fullstop();
    return pto.getSentences().iterator().next();
}
Also used : StructuredPrologOutput(de.prob.prolog.output.StructuredPrologOutput) LtlAdapterException(de.be4.ltl.core.parser.internal.LtlAdapterException) IOException(java.io.IOException)

Aggregations

LtlAdapterException (de.be4.ltl.core.parser.internal.LtlAdapterException)1 StructuredPrologOutput (de.prob.prolog.output.StructuredPrologOutput)1 IOException (java.io.IOException)1