Re: automatic parser generation for ecpg - Mailing list pgsql-hackers

From Tom Lane
Subject Re: automatic parser generation for ecpg
Date
Msg-id 18015.1224592314@sss.pgh.pa.us
Whole thread Raw
In response to Re: automatic parser generation for ecpg  (Mike Aubury <mike.aubury@aubit.com>)
Responses Re: automatic parser generation for ecpg
Re: automatic parser generation for ecpg
List pgsql-hackers
Mike Aubury <mike.aubury@aubit.com> writes:
> Also - for completeness (for the list) - I think the plan is to convert the 
> awk to perl (via a2p + some tweaking) if awk is not already used as part of  
> the build process (to avoid adding another prerequisite..)

Hmm.  I believe the current state of play on that is:

* awk is required to build from source on non-Windows platforms
(cf genbki.sh, Gen_fmgrtab.sh, and various random uses in the Makefiles)

* perl is required to build from source on Windows (all the build scripts)

* perl is required to build from a CVS pull on non-Windows too, but we
avoid requiring this for builds from a distribution tarball (by
including the relevant derived files in the tarball)

* we get around the awk requirement on Windows by maintaining parallel
code that does the same things in perl :-(

So it's all pretty messy and neither choice is exactly desirable.
I think maintaining parallel versions of an ecpg parser generator
would be no fun at all, though, so the perl choice seems more or less
forced.  We could either preserve the current state of play by shipping
the derived bison file in tarballs, or bite the bullet and say perl
is required to build from source in all cases (in which case I'd be
inclined to try to get rid of Gen_fmgrtab.sh etc).

As against that ... does a2p produce code that is readable/maintainable?
If the code wasn't perl to start with I'd be a little worried about
ending up with ugly hard-to-read code.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Theodore Wong
Date:
Subject: TSEARCH2 Thesaurus limitations
Next
From: Magnus Hagander
Date:
Subject: Re: SSL cleanups/hostname verification