Re: PostgreSQL-13.3 parser.y with positional references by named references

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Domingo Alvarez Duarte <mingodad(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: PostgreSQL-13.3 parser.y with positional references by named references
Date: 2021-07-04 15:58:27
Message-ID: 1344380.1625414307@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Domingo Alvarez Duarte <mingodad(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2021-07-04 16:03:56 Re: rand48 replacement
Previous Message Tom Lane 2021-07-04 15:37:29 Re: Increase value of OUTER_VAR