Re: Parser Cruft in gram.y

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: "McDevitt, Charles" <Charles(dot)McDevitt(at)emc(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, Kevin Grittner <kgrittn(at)mail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parser Cruft in gram.y
Date: 2012-12-20 23:47:32
Message-ID: 27479.1356047252@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> On 2012-12-20 23:12:55 +0000, McDevitt, Charles wrote:
>>> Another way of attack along these lines might be to use the %glr-parser
>>> and then try to cut back on all those redundant rules that were put in
>>> to avoid conflicts. The number of key words categories and such could
>>> perhaps also be reduced that way.

>> The GLR output from Bison is licensed under the GPL (unlike the LALR output).
>> So using Bison's GLR mode isn't an option.

> Thats not the case anymore:
> http://www.gnu.org/software/bison/manual/html_node/Conditions.html

This does mean that we'd have to specify a minimum bison version of 2.2
in order to be squeaky-clean license wise, if we went over to using the
GLR mode. However, that would likely be a good idea anyway from a
technical standpoint --- the GLR mode may exist in ancient bison
versions, but who knows how bug-free it is.

Anyway, this is all merest speculation until somebody actually tries it
and sees if a performance gain is possible. Having just re-read
the description of GLR mode, I wouldn't be surprised if any savings in
table size is squandered by its handling of ambiguous cases (ie, the
need to track and merge multiple parser states).

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thom Brown 2012-12-20 23:50:46 Re: Switching timeline over streaming replication
Previous Message Fujii Masao 2012-12-20 23:37:15 Re: ThisTimeLineID in checkpointer and bgwriter processes