pgsql: Add simple script to check for right recursion in Bison grammars

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Add simple script to check for right recursion in Bison grammars
Дата
Msg-id E1RJU6p-0004jH-3g@gemulon.postgresql.org
обсуждение исходный текст
Список 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(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Typo fixes.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Avoid recursion while processing ELSIF lists in plpgsql.