Search in sources :

Example 1 with ProBParseException

use of de.prob.parserbase.ProBParseException in project probparsers by bendisposto.

the class ClassicalBParser method parsePredicate.

@Override
public void parsePredicate(final IPrologTermOutput pto, final String predicate, final boolean wrap) throws ProBParseException {
    try {
        Start ast = new BParser().parsePredicate(predicate);
        printAst(pto, ast, wrap, WRAPPER_PRED);
    } catch (BCompoundException e) {
        throw new ProBParseException(e.getFirstException().getLocalizedMessage());
    }
}
Also used : Start(de.be4.classicalb.core.parser.node.Start) ProBParseException(de.prob.parserbase.ProBParseException) BCompoundException(de.be4.classicalb.core.parser.exceptions.BCompoundException)

Example 2 with ProBParseException

use of de.prob.parserbase.ProBParseException in project probparsers by bendisposto.

the class ClassicalBParser method parseExpression.

@Override
public void parseExpression(final IPrologTermOutput pto, final String expression, final boolean wrap) throws ProBParseException {
    try {
        Start ast = new BParser().parseExpression(expression);
        printAst(pto, ast, wrap, WRAPPER_EXPR);
    } catch (BCompoundException e) {
        throw new ProBParseException(e.getFirstException().getLocalizedMessage());
    }
}
Also used : Start(de.be4.classicalb.core.parser.node.Start) ProBParseException(de.prob.parserbase.ProBParseException) BCompoundException(de.be4.classicalb.core.parser.exceptions.BCompoundException)

Example 3 with ProBParseException

use of de.prob.parserbase.ProBParseException in project probparsers by bendisposto.

the class ClassicalBParser method parseTransitionPredicate.

@Override
public void parseTransitionPredicate(final IPrologTermOutput pto, final String trans, final boolean wrap) throws ProBParseException {
    try {
        Start ast = new BParser().parseTranstion(trans);
        printAst(pto, ast, wrap, WRAPPER_TRANS);
    } catch (BCompoundException e) {
        throw new ProBParseException(e.getFirstException().getLocalizedMessage());
    }
}
Also used : Start(de.be4.classicalb.core.parser.node.Start) ProBParseException(de.prob.parserbase.ProBParseException) BCompoundException(de.be4.classicalb.core.parser.exceptions.BCompoundException)

Example 4 with ProBParseException

use of de.prob.parserbase.ProBParseException in project prob2 by bendisposto.

the class EventBParserBase method parseTransitionPredicate.

@Override
public void parseTransitionPredicate(IPrologTermOutput pto, String transPredicate, boolean wrap) throws ProBParseException {
    Start ast;
    try {
        ast = BParser.parse(BParser.OPERATION_PATTERN_PREFIX + transPredicate);
    } catch (BCompoundException e) {
        throw (ProBParseException) new ProBParseException(e.getLocalizedMessage()).initCause(e);
    }
    toPrologTerm(pto, ast, wrap, TRANS_WRAPPER);
}
Also used : Start(de.be4.classicalb.core.parser.node.Start) ProBParseException(de.prob.parserbase.ProBParseException) BCompoundException(de.be4.classicalb.core.parser.exceptions.BCompoundException)

Aggregations

BCompoundException (de.be4.classicalb.core.parser.exceptions.BCompoundException)4 Start (de.be4.classicalb.core.parser.node.Start)4 ProBParseException (de.prob.parserbase.ProBParseException)4