@Test public void testParser() throws Exception { for (String q : queries) { logger.debug("parsing {}\n", q); ParseBaseNode node = raptorParser.parse(q); printNode(node); } for (String q : stratusQuries) { ParseBaseNode node = stratusParser.parse(q); printNode(node); } }
public ParseBaseNode parse(String query) { CommonTree queryTree = parseAST(query); try { ParseBaseNode rootNode = parseQuery(queryTree, query); rootNode.validate(parseContext); postValidate(rootNode); return rootNode; } catch (QueryParseException e) { logger.error(e.getMessage()); throw e; } catch (Throwable t) { throw new QueryParseException(QueryErrCodeEnum.SYNTAX_ERROR, MessageFormat.format("{0}!Syntax Error: {1}", query, t.getMessage()), t); } }
QueryParser { public ParseBaseNode parse(String query) { CommonTree queryTree = parseAST(query); try { ParseBaseNode rootNode = parseQuery(queryTree, query); rootNode.validate(parseContext); postValidate(rootNode); return rootNode; } catch (QueryParseException e) { logger.error(e.getMessage()); throw e; } catch (Throwable t) { throw new QueryParseException(QueryErrCodeEnum.SYNTAX_ERROR, MessageFormat.format("{0}!Syntax Error: {1}", query, t.getMessage()), t); } } }
QueryParser { public ParseBaseNode parse(String query) { CommonTree queryTree = parseAST(query); try { ParseBaseNode rootNode = parseQuery(queryTree, query); rootNode.validate(parseContext); postValidate(rootNode); return rootNode; } catch (QueryParseException e) { logger.error(e.getMessage()); throw e; } catch (Throwable t) { throw new QueryParseException(QueryErrCodeEnum.SYNTAX_ERROR, MessageFormat.format("{0}!Syntax Error: {1}", query, t.getMessage()), t); } } QueryParser(QueryContext queryContext); }
QueryParser { public ParseBaseNode parse(String query) { CommonTree queryTree = parseAST(query); try { ParseBaseNode rootNode = parseQuery(queryTree, query); rootNode.validate(parseContext); postValidate(rootNode); return rootNode; } catch (QueryParseException e) { logger.error(e.getMessage()); throw e; } catch (Throwable t) { throw new QueryParseException(QueryErrCodeEnum.SYNTAX_ERROR, MessageFormat.format("{0}!Syntax Error: {1}", query, t.getMessage()), t); } } QueryParser(QueryContext queryContext); ParseBaseNode parse(String query); }
QueryParser { public ParseBaseNode parse(String query) { CommonTree queryTree = parseAST(query); try { ParseBaseNode rootNode = parseQuery(queryTree, query); rootNode.validate(parseContext); postValidate(rootNode); return rootNode; } catch (QueryParseException e) { logger.error(e.getMessage()); throw e; } catch (Throwable t) { throw new QueryParseException(QueryErrCodeEnum.SYNTAX_ERROR, MessageFormat.format("{0}!Syntax Error: {1}", query, t.getMessage()), t); } } QueryParser(QueryContext queryContext); ParseBaseNode parse(String query);  }