I recently came across parsers in the systems software course. I read that, to make the top down parsing using backtracking efficient, it is needed to eliminate the left recursion in the production rules (for eliminating the infinite looping). For eliminating the left recursion we replace the production rule with left recursion with a pair of production rules using another non-terminal, this way:
if the existing rule is:
A -> Aa|b
then it is replace with:
A -> bR
R -> aR | epsilon
Wouldn't such a rule cause right recursion? which in turn can cause infinite looping? Can anyone tell me why this is done?