Re: Call for objections: revision of keyword classification - Mailing list pgsql-patches

From Tom Lane
Subject Re: Call for objections: revision of keyword classification
Date
Msg-id 21036.1005330358@sss.pgh.pa.us
Whole thread Raw
In response to Re: Call for objections: revision of keyword classification  (Thomas Lockhart <lockhart@fourpalms.org>)
List pgsql-patches
Thomas Lockhart <lockhart@fourpalms.org> writes:
>> BTW, another thing in the back of my mind is that we should try to
>> figure out some way to unify ecpg's SQL grammar with the backend's.
>> Maintaining that thing is an even bigger headache than getting the
>> backend's own parser right.

> That would be nice. Unfortunately that would lead to the main parser
> having the same machinations used in ecpg, with separate subroutine
> calls for *every* production. Yuck.

The thing is that most of the actions in ecpg's grammar could easily be
generated mechanically.  My half-baked idea here is some sort of script
that would take the backend grammar, strip out the backend's actions and
replace 'em with mechanically-generated actions that reconstruct the
query string, and finally merge with a small set of hand-maintained
rules that reflect ecpg's distinctive features.

You're quite right that nothing like this will reduce the amount that
maintainers have to know.  But I think it could reduce the amount of
tedious, purely mechanical, and error-prone maintenance work that we
have to do to keep various files and lists in sync.

            regards, tom lane

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Patch for Makefile race against current cvs
Next
From: Tom Lane
Date:
Subject: Re: Call for objections: revision of keyword classification