|Parsing some but not all of SQL firstname.lastname@example.org (GuaGuaHuang) (2002-09-25)|
|Re: Parsing some but not all of SQL Mark.van.den.Brand@cwi.nl (M.G.J. van den Brand) (2002-10-13)|
|Re: Parsing some but not all of SQL email@example.com (Hannes liesen) (2002-10-13)|
|From:||"Hannes liesen" <firstname.lastname@example.org>|
|Date:||13 Oct 2002 16:41:07 -0400|
|Posted-Date:||13 Oct 2002 16:41:07 EDT|
> I am using yacc&lex to analysis a SQL batch. I only want to find out
> the SELECT statements in the batch and make some transformation to
> them. Other statements will not be changed.
> Must I write a full syntax of SQL, or are there some other simple
> [Since it's usually pretty simple to find the statement boundaries in SQL,
> you can probably look at the first token of each statement, if it's
> SELECT parse it and change it, if not just skip up to the next statement.
There is an sql parser in the lex&yacc book (you know this have some
animals on the cover .. in a nutshell company)
[Yes, I wrote it. It's for a 10 year old version of SQL so it's a
reasonable starting point, but I'd still do some ad hoc peeking so it
only tries to parse SELECT statements and doesn't waste time with the
other half of SQL. -John]
Return to the
Search the comp.compilers archives again.