Re: automatic parser generation for ecpg

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mike Aubury <mike(dot)aubury(at)aubit(dot)com>
Cc: Michael Meskes <meskes(at)postgresql(dot)org>, PostgreSQL Hacker <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: automatic parser generation for ecpg
Date: 2008-10-21 12:31:54
Message-ID: 18015.1224592314@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Mike Aubury <mike(dot)aubury(at)aubit(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2008-10-21 12:34:58 Re: SSL cleanups/hostname verification
Previous Message Tom Lane 2008-10-21 12:10:00 Re: [HACKERS] Hot Standby utility and administrator functions