[antlr-interest] bridging the gap - PL/SQL

Andy Tripp antlr at jazillian.com
Thu Aug 14 15:39:29 PDT 2008


Unfortunately, the official SQL language is a monster, right
up there with C++ in complexity (IMO). I have a translator that
converts embedded SQL into equivalent Java JDBC calls, but it 
only works for simple SQL statements.

You're right to be afraid that your PL/SQL may have stuff that's not
handled by the example parsers. Again, same problems as C++ - the
standard is way too complex, each vendor (Oracle in this case)
implements their own non-standard features, and developers use those features.

Seems like writing a general PL/SQL - to - Java translator would take a
lifetime, but a translator that works only with your existing PL/SQL code might
be doable.

Andy

jhking at airmail.net wrote:
> I have the "Definitive Guide..." book and have learned quite a bit from it.  What
> I'm looking for (and this may be a "how to parse" question not an ANTLR question
> is something more involved than the calc example that's explained.
> I'm an MIS not CS guy so never got formal parser/language generation training but
> have several itches that I think Antlr can help me scratch.
> 
> Our primary environment is PL/SQL (which looks a lot like Ada-83 + sql elements)
> and I want to build two things:
> 1)  A comparison utility that compares parse trees or something that can ignore
> insignificant changes.  PL/SQL is case-insensitive except within quoted strings
> and its a bear to get a file comparison utility to deal with that.
> 2)  A pl/sql to java conversion utility, this is a long way off but I think if I
> can learn enough to do #1 then I'm better than half-way to this.
> 
> I see example pl/sql grammars and I want to utilize those but at this point I
> don't know enough to fully understand them, which means I'll have a hard time
> extending them or understanding the errors if the pl/sql source I'm parsing has
> features not yet in the example grammars.
> 
> I'm not asking anybody to do either of these things for me (that would be a
> professional engagement worth more money than I can afford) I just need some kind
> of a "parsers for dummies" book to get me further along.
> 
> Thanks for your kind attention.
> ---- Msg sent via Internet America Webmail - www.internetamerica.com
> 



More information about the antlr-interest mailing list