Re: PostgreSQL-13.3 parser.y with positional references by named references - Mailing list pgsql-hackers

From Tom Lane
Subject Re: PostgreSQL-13.3 parser.y with positional references by named references
Date
Msg-id 1344380.1625414307@sss.pgh.pa.us
Whole thread Raw
In response to PostgreSQL-13.3 parser.y with positional references by named references  (Domingo Alvarez Duarte <mingodad@gmail.com>)
Responses Re: PostgreSQL-13.3 parser.y with positional references by named references  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
List pgsql-hackers
Domingo Alvarez Duarte <mingodad@gmail.com> writes:
> Here https://gist.github.com/mingodad/49291e0e9505522c66fcd3fcea4a939d I 
> posted the postgresql-13.3/src/backend/parser/gram.y with positional 
> references by named references that is supported by bison for some time now.

When is "some time now"?

Currently, we support bison versions back to 1.875.  While we'd be
willing to raise that bar as soon as a good reason to do so comes
along, I'm not sure that getting rid of $N notation is a sufficient
reason.

Indeed, I'd say getting rid of $$ is a strict loss; the changes you
show make actions much more verbose but certainly not any more
readable.  Having a special notation for a rule's output seems to me
like a good thing not a bad one.  The examples of named notation in
the Bison docs don't seem like unconditional wins either; they're not
very concise, and the contortions you're forced into when the same
nonterminal type is used more than once in a rule are just horrid.

I do see the point about it being annoying to update $N references
when a rule is changed.  But this solution has enough downsides that
I'm not sure it's a net win.  Maybe if it were applied selectively,
to just the longer DDL productions, it'd be worth doing?

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Increase value of OUTER_VAR
Next
From: Fabien COELHO
Date:
Subject: Re: rand48 replacement