use of de.prob.typechecker.exceptions.LTLParseException in project probparsers by bendisposto.
the class LTLFormulaVisitor method parseBPredicate.
private de.be4.classicalb.core.parser.node.Start parseBPredicate(String text) {
String bPredicate = "#PREDICATE " + text;
BParser parser = new BParser("Testing");
de.be4.classicalb.core.parser.node.Start start = null;
try {
start = parser.parse(bPredicate, false);
} catch (BCompoundException e) {
throw new LTLParseException(e.getMessage());
}
return start;
}
use of de.prob.typechecker.exceptions.LTLParseException in project probparsers by bendisposto.
the class LTLFormulaVisitor method parseDefinition.
public void parseDefinition(AExpressionDefinitionDefinition def) {
if (!(def.getRhs() instanceof AStringExpression)) {
throw new LTLParseException("Error: LTL formula is not in a string representation.");
}
AStringExpression stringNode = (AStringExpression) def.getRhs();
this.ltlFormula = stringNode.getContent().getText();
try {
this.ltlFormulaStart = parseLTLFormula(ltlFormula);
} catch (Exception e) {
String message = "Parsing definition " + name + " (line " + def.getStartPos().getLine() + "):\n";
throw new LTLParseException(message + e.getMessage());
}
}
Aggregations