Left recursion is not a problem for LR parsing
See discussion here: Left recursion in LR(1) parsers. Note that templatetypedef wrote:
LR(1) parsers can handle some types of left recursion, though not all left-recursive grammars are LR(1).
It sounds true, but vacuous, since there exist left-recursive yet ambiguous grammars. Ambiguity becomes the real obstacle in this case.
It’s also obvious that left recursive DCFLs is a subset of $LR(k) \setminus LL(k)$ languages
留下评论