At 12:15 PM 12/08/2004, Tom Lane wrote:
>You might need to bite the bullet and implement a flex
>lexer.
I'd like to avoid this if I can; AFAICT, for statement detection on
pg_restore, I can require white space before the $tag. Since I also skip
over all quoted text, the bodies of functions are ignored. The only issues
will be attribute names with ' $' in them, but they will be quoted as well
(so ignored).
So to recognize a tag, I look for a '$' after white space, and assume it's
a tag start. If I subsequently read an invalid tag char, I just go back
into scan mode on that character and assume the '$...' was some other valid
sql element.
From other threads, it sounds like removing the statement detection code
entirely is not an option.
----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 03 5330 3172 | ___________ |
Http://www.rhyme.com.au | / \| | --________--
PGP key available upon request, | /
and from pgp.mit.edu:11371 |/