Skip to content
Snippets Groups Projects
Select Git revision
  • benchmark-tools
  • postgres-lambda
  • master default
  • REL9_4_25
  • REL9_5_20
  • REL9_6_16
  • REL_10_11
  • REL_11_6
  • REL_12_1
  • REL_12_0
  • REL_12_RC1
  • REL_12_BETA4
  • REL9_4_24
  • REL9_5_19
  • REL9_6_15
  • REL_10_10
  • REL_11_5
  • REL_12_BETA3
  • REL9_4_23
  • REL9_5_18
  • REL9_6_14
  • REL_10_9
  • REL_11_4
23 results

check_bison_recursion.pl

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