I am new here and I have just started the compiler construction course and I am just a beginner. So my question is about removing left recursion from the following grammar:
E → E + B | E - B | (E) | B
E → B / F | B * F | (B) | F
F → id
I know the rule for removing left recursion which is
IF A → Aα | β than
A → βA'
A'→ α A'| ε
And in the above grammar there is left recursion only in the first line. I am confused about (E) because I can’t figure out if (E) is β or not. I would appreciate if someone can remove the recursion and explain it.
Thank you
(UPDATE) So i tried to eliminate the left recursion according to my understanding as follows:
E → (E)E' | BE'
E' → +BE' | -BE' | ɛ
E → B / F | B * F | (B) | F
F → id
Is it OK or am i doing it wrong