(String query)
| 39 | } |
| 40 | |
| 41 | public static Tree parse(String query) throws IOException, RecognitionException, ParsingFailureException { |
| 42 | CommonTokenStream tokens = tokenize( query ); |
| 43 | QueryParser parser = QueryParserUtils.createParser( tokens ); |
| 44 | QueryParser.query_return result = parser.query(); |
| 45 | Tree ast = (Tree)result.getTree(); |
| 46 | TreePrinter.printTree( (CommonTree)ast, 0 ); |
| 47 | |
| 48 | if( 0 < parser.getNumberOfSyntaxErrors() ) |
| 49 | throw new ParsingFailureException( QueryParser.class ); |
| 50 | |
| 51 | return ast; |
| 52 | } |
| 53 | |
| 54 | public static Tree validateAst(String query) |
| 55 | throws RecognitionException, ParsingFailureException, IOException { |
no test coverage detected