elimination of indirect left recursion
问题 I'm having problems understanding an online explanation of how to remove the left recursion in this grammar. I know how to remove direct recursion, but I'm not clear how to handle the indirect. Could anyone explain it? A --> B x y | x B --> C D C --> A | c D --> d 回答1: The way I learned to do this is to replace one of the offending non-terminal symbols with each of its expansions. In this case, we first replace B with its expansions: A --> B x y | x B --> C D becomes A --> C x y | D x y | x