From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Add simple script to check for right recursion in Bison grammars |
Date: | 2011-10-27 17:51:19 |
Message-ID: | E1RJU6p-0004jH-3g@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Add simple script to check for right recursion in Bison grammars.
We should generally use left-recursion not right-recursion to parse lists.
Bison hasn't got any built-in way to check for this type of inefficiency,
and I didn't find anything on the net in a quick search, so I wrote a
little Perl script to do it. Add to src/tools/ so we don't have to
re-invent this wheel next time we wonder if we're doing anything stupid.
Currently, the only place that seems to need fixing is plpgsql's stmt_else
production, so the problem doesn't appear to be common enough to warrant
trying to include such a test in our standard build process. If we did
want to do that, we'd need a way to ignore some false positives, such as
a_expr := '-' a_expr
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/756a4ed5ad3e57c26a247234de371a6ca21806cd
Modified Files
--------------
src/tools/check_bison_recursion.pl | 74 ++++++++++++++++++++++++++++++++++++
1 files changed, 74 insertions(+), 0 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2011-10-27 19:22:05 | pgsql: Avoid recursion while processing ELSIF lists in plpgsql. |
Previous Message | Tom Lane | 2011-10-26 22:04:55 | pgsql: Typo fixes. |