What is the difference between Left Factoring
and Left Recursion
? I understand that Left factoring
is a predictive top down parsing t
Here is a simple way to differentiate between both terms:
e.g. A -> Aα / Aβ
e.g. A -> αB / αC
Furthermore, If a Grammar is Left Recursive, it might result into infinite loop hence we need to Eliminate Left Recursion.
If a Grammar is Left Factoring, it confuses the parser hence we need to Remove Left Factoring as well.