Maybe jsqlparser will work for you.
It is not as easy to find as you might think, as there are several minor projects there. In fact, I could not find it, so I did my own work (based on the h2 analyzer - you can contact me if all else fails). As a result, I do not know if this decoder has one, but writing one from above should be fairly straightforward.
It is based on grammar and JavaCC, so it's probably a better option than reusing this wheel with antlr anyway. You may find, if you need to support various sql dialects in complex statements, that any grammar based approach will not give you the opportunity.
mike g Feb 18 '09 at 5:46 2009-02-18 05:46
source share