Re: automatic parser generation for ecpg

From: Mike Aubury <mike(dot)aubury(at)aubit(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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:54:39
Message-ID: 200810211354.39378.mike.aubury@aubit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Perl code thats readable and maintainable ;-)

In reality - it doesn't look too disimilar from the awk original. I didn't
appreciate that we'd probably need to keep 2 versions (one for unix and one
for windows). In that case - I'd argue that we only need to "maintain" one
and regenerate the other when required. Provided they both work the same, I'd
say it doesn't matter what the perl one looked like, because thats not the
one that'd be maintained :-)

Personally - I'd be tempted to keep this as a background process for the ecpg
maintiner anyway rather than a normal end user. Probably using something like
a 'syncparser' make target and keep the generation separate from the normal
build process.
That way - awk/perl (you could then pick just one) would only be a requirement
if you want to regenerate the grammer via the 'syncparser' target. This does
have the benefit that the ecpg maintainer can then control when the sync'ing
is done and that its less likely to inadvertantly break the ecpg branch of
source tree.
At the end of the day - this is something Michael has just been doing manually
already and we're trying to help automate the process..

(ducks for cover)

> 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.

--
Mike Aubury

http://www.aubit.com/
Aubit Computing Ltd is registered in England and Wales, Number: 3112827
Registered Address : Clayton House,59 Piccadilly,Manchester,M1 2AQ

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-10-21 12:57:25 Re: pg_stat_statements in core
Previous Message Decibel! 2008-10-21 12:53:48 Re: contrib/pg_stat_statements