Re: automatic parser generation for ecpg

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

Michael Meskes <meskes(at)postgresql(dot)org> writes:
> ... The only manual work I see in the
> future is adding some special ecpg handling. I fully expect this script to
> generate a working parser for every single change in gram.y. However, if some
> new rule needs a different aka non-default handling in ecpg that will remain
> manual, but the automatic process should nevertheless create a parser with
> default handling for this new rule, thus not breaking anything but the new
> feature in ecpg, which of course cannot get broken because it is new.

Hmm --- I hadn't really thought much about the need for the generation
script to make special transformations of some rules, but obviously that
is going to be needed in the places where you have to sew the SQL and
ecpg syntaxes together. Perhaps there is a good argument for going to
perl just to be sure that we don't get backed into a corner on what can
be done in such cases. awk is a great tool for certain kinds of tasks,
but it's pretty limited. For instance, AFAIK you'd be out of luck if
you needed to make two passes over the input.

So my vote at this point would be to convert the script to perl.

Also, never mind the idea about starting to require perl for all build
scenarios. We'll still ship preproc.y in tarballs because we will still
ship preproc.c in tarballs --- I don't think anyone was lobbying to
start requiring bison to be present for builds from tarballs. So if
the script is perl we'll have exactly the same build dependency
scenarios as now.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gianni Ciolli 2008-10-21 14:57:59 Bitmap Indexes: request for feedback
Previous Message Simon Riggs 2008-10-21 14:15:12 Re: [HACKERS] Hot Standby utility and administrator functions