Please help me. I need to parse .sql file to tree and I can't find how to do it.
(We apply sql files by sqlplus and we have some problems with '/': after anonymous blocks - it haven't applied without '/'; Also not-anonymous block applied twice when we have both ';' and '/'. I need to report about problems before file will apply.)
I've tried to use ANTLR with it grammar but it build awful tree.
Sorry for my english
I don't really have an answer for you, but you are likely to get more help in the SQL and PL/SQL forum.
Somthing simpler like a regular expression search might help.
Looking for ; and / on consecutive lines (or with only blank lines in between) would help the second problem. (if the ; isn't attached to an "end")