CharStream input;
try {
input = new ANTLRInputStream(new ByteArrayInputStream(sql.getBytes("UTF-8")));
} catch (Exception e) {
Logger.error(SQLQueryFactory.class,e.getMessage(),e);
throw new DotRuntimeException(e.getMessage(), e);
}
TokenSource lexer = new CmisSqlLexer(input);
TokenStream tokens = new CommonTokenStream(lexer);
CommonTree tree;
try {
tree = (CommonTree) new CmisSqlParser(tokens).query().getTree();
} catch (RecognitionException e) {
Logger.error(SQLQueryFactory.class,e.getMessage(),e);
throw new DotRuntimeException(e.getMessage(), e);
}
CommonTreeNodeStream nodes = new CommonTreeNodeStream(tree);
// new Bufferedt
nodes.setTokenStream(tokens);
// CmisSqlSimpleWalker walker = new CmisSqlSimpleWalker(nodes);