0
$\begingroup$

I have difficulty / doubt in transforming a grammar into LL (1), I tried remove left recursion but grammar still not LL(1).

S → SAB | abA | baC
A → aSb | d
B → bSaC| c
C → cCd | b

Without left recursion

S - > abAS' | baCS'
S ' ABS'| ε
A → aSb | d
B → bSaC| c
C → cCd | b

After removing the left recursion I have a FIRST / FOLLOW SET CONFLICTS on production (S' -> ε) but if I remove the epsilon production I go into a "loop". What am I doing wrong?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.