retagged by
1,306 views

1 Answer

0 votes
0 votes
If the grammar is of the form A ->  A alpha / beta;

then it is causing left recursion . To remove the left recursion do the steps as follows.

A ->beta A';

A' -> alpha A';

A' -> epsilon;

example:  E -> E+T/T

                T -> T*F/F

                F -> id

first two stmts contains left recusion so remove it

here A=E; alpha=+T and beta=T so,

E -> TE'

E' ->+TE'/epsilon

T -> FT'

T -> *FT'/epsilon

Related questions

2 votes
2 votes
3 answers
1
1 votes
1 votes
2 answers
2
Parshu gate asked Sep 17, 2017
1,237 views
1 votes
1 votes
1 answer
3
4 votes
4 votes
1 answer
4