use of de.bmoth.parser.ErrorListener.VisitorException in project bmoth by hhu-stups.
the class Parser method parseLTLFormula.
private LtlStartContext parseLTLFormula(String inputString) throws ParseErrorException {
CodePointCharStream fromString = CharStreams.fromString(inputString);
final BMoThLexer lexer = new BMoThLexer(fromString);
lexer.pushMode(BMoThLexer.LTL_MODE);
// create a buffer of tokens pulled from the lexer
CommonTokenStream tokens = new CommonTokenStream(lexer);
BMoThParser parser = new BMoThParser(tokens);
parser.removeErrorListeners();
ErrorListener errorListener = new ErrorListener();
parser.addErrorListener(errorListener);
try {
return parser.ltlStart();
} catch (VisitorException e) {
final Logger logger = Logger.getLogger(getClass().getName());
logger.log(Level.SEVERE, PARSE_ERROR, e);
throw e.getParseErrorException();
}
}
Aggregations