// Lexer splits input into tokens
ANTLRStringStream input = new ANTLRStringStream(bqlStmt);
TokenStream tokens = new CommonTokenStream(new BQLLexer(input));
// Parser generates abstract syntax tree
BQLParser parser = new BQLParser(tokens, _facetInfoMap);
_parser.set(parser);
BQLParser.statement_return ret = parser.statement();
// Acquire parse result
CommonTree ast = (CommonTree) ret.tree;
JSONObject json = (JSONObject) ret.json;