• Tom Lane's avatar
    Add simple script to check for right recursion in Bison grammars. · 756a4ed5
    Tom Lane authored
    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
    756a4ed5
check_bison_recursion.pl 2.18 KB