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 generato开发者_StackOverflow社区r that supports it - in whatever language.
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.
My parser generator AustenX (scratchy.nz/austen.php) supports left recursion (including indirect), where option order matters (though I have never gotten around to writing up how this works). It is Packrat parser at heart, but memorisation can be dropped, and it makes no difference.
精彩评论