Re: question on parsing postgres sql queries

From: Jerome Wagner <jerome(dot)wagner(at)laposte(dot)net>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: question on parsing postgres sql queries
Date: 2016-07-27 10:16:29
Message-ID: CA+=V_fPVq_OrTyDcsa7cD5E0mvWmhVaObPrcmos_H5-QWS3zqQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> What problem are you trying to solve here?​ to whit not everything that
can be parsed is documented - usually intentionally.

I am tyring to see whether we could use the documentation as a kind of
formal specification of the language but I understand that the devil is
in the details and that even formal specifications can lead to incompatible
implementations,

I would have found it nice if the clean documentation of the project could
be used as a meta-grammar sufficient to maybe generate the grammar but I
will have to dig further into the Bison grammar files.

The project I mentioned that isolates the parser from PostgreSQL binary as
a re-usable library is probably the closest you can get currently to a
parser matching the real engine.

Otherwise, yes, parsing the synopsis could maybe lead to a sanity check on
the fact that the documentation is in line with the grammar. This could
lead to warnings or help uncover unexpected corner cases not mentioned in
the documentation.

Thanks for your answers
Jerome

On Tue, Jul 26, 2016 at 9:52 PM, David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Tue, Jul 26, 2016 at 3:20 PM, Jerome Wagner <jerome(dot)wagner(at)laposte(dot)net>
> wrote:
>
>>
>> Would it make sense to use these sgml synopsis as some kind of source of
>> truth, parse them, and automatically generate a parser for a specifc
>> language ?
>>
>
> ​What problem are you trying to solve here?​ to whit not everything that
> can be parsed is documented - usually intentionally.
>
>
>> Could the parser commiters share some lights on how the documentation
>> process interacts with the parser commits ?
>>
>>
> ​Commits that modify the parser are expected to have manual modifications
> to the relevant documentation ​as well.
>
> David J.
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2016-07-27 12:11:02 Re: low perfomances migrating from 9.3 to 9.5
Previous Message thomas veymont 2016-07-27 09:22:56 Re: low perfomances migrating from 9.3 to 9.5