parser.ReInit(new StringReader(statement));
builder = new JCRSQLQueryBuilder(parser.Query(), resolver);
}
return builder.getRootNode();
} catch (ParseException e) {
throw new InvalidQueryException(e.getMessage());
} catch (IllegalArgumentException e) {
throw new InvalidQueryException(e.getMessage());
} catch (Throwable t) {
// javacc parser may also throw an error in some cases
throw new InvalidQueryException(t.getMessage());
}
}