Computer Science, asked by mattasamyuktha, 7 months ago

write a C program to remove left recursion from single production.

Answers

Answered by shailjarathore
0

Explanation:

What is  Left Factoring ?

Consider a part of regular grammar,

E->aE+bcD

E->aE+cBD

Here, grammar is non-left recursive, and unambiguous but there is left factoring.

How to resolve ?

E=aB | aC | aD | ............

then,

E=aX

X=B | C | D |...........

So, the above grammar will be as :

E=aE+X

X=bcD | cBD

HOPE IT HELPS UHH....PLZ MARK ME AS BRAINLIEST^_^

Similar questions