protected Pair < ParserRuleContext , CommonTokenStream > prepareParser ( final JQLContext jqlContext , final String jql ) { JqlLexer lexer = new JqlLexer ( CharStreams . fromString ( jql ) ) ; CommonTokenStream tokens = new CommonTokenStream ( lexer ) ; JqlParser parser = new JqlParser ( tokens ) ; parser . removeErrorListeners ( ) ; parser . addErrorListener ( new JQLBaseErrorListener ( ) { @ Override public void syntaxError ( Recognizer < ? , ? > recognizer , Object offendingSymbol , int line , int charPositionInLine , String msg , RecognitionException e ) { AssertKripton . assertTrue ( false , jqlContext . getContextDescription ( ) + ": unespected char at pos %s of SQL '%s'" , charPositionInLine , jql ) ; } } ) ; ParserRuleContext context = parser . parse ( ) ; return new Pair <> ( context , tokens ) ; }
Prepare parser .