Search code examples
parsinglanguage-agnosticcompiler-constructionrecursive-descentpeg

Are there PEG-based parser generators that support left recursion?


Left recursion seems to be a big problem for many parser generators that are built upon the foundations of recursive descent parsing. I'm looking for a PEG-based parser generator that supports it - in whatever language.


Solution

  • There is a paper on the topic available here: http://tratt.net/laurie/research/publications/papers/tratt__direct_left_recursive_parsing_expression_grammars.pdf

    The author describes multiple approaches for handling left-recursive rules in PEG/Packrat parsing.