use of de.bmoth.antlr.BMoThParser 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();
}
}
use of de.bmoth.antlr.BMoThParser in project bmoth by hhu-stups.
the class Parser method getParser.
private BMoThParser getParser(String inputString) {
CodePointCharStream fromString = CharStreams.fromString(inputString);
final BMoThLexer lexer = new BMoThLexer(fromString);
// create a buffer of tokens pulled from the lexer
CommonTokenStream tokens = new CommonTokenStream(lexer);
BMoThParser bMoThParser = new BMoThParser(tokens);
bMoThParser.removeErrorListeners();
ErrorListener errorListener = new ErrorListener();
bMoThParser.addErrorListener(errorListener);
return bMoThParser;
}
Aggregations