1 votes 1 votes Eliminate the left recursion of the grammar: $S\rightarrow Bb / a$ $B\rightarrow Bc /Sd /e$ Compiler Design compiler-design left-recursion + – Anand. asked Jan 7, 2017 edited Nov 6, 2023 by Hira Thakur Anand. 2.4k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
4 votes 4 votes S->Bb/a B->Bc/Sd/e there is both direct (B->Bc)as well as indirect recursion(B->Sd,S->Bb) step i- S->Bb/a B->Bc/Bbd/e/ad step 2 S->Bb/a B->eB' /adB' B'->cB' /bdB'/ε saurabh rai answered Jan 7, 2017 edited Jan 7, 2017 by saurabh rai saurabh rai comment Share Follow See all 2 Comments See all 2 2 Comments reply Anup patel commented Jan 7, 2017 reply Follow Share it is wrong ... there should be epsilon also in last production rule...else how you will genere adbd . . .B' should have a terminating condition. 0 votes 0 votes saurabh rai commented Jan 7, 2017 reply Follow Share thnx for correction.... updated 0 votes 0 votes Please log in or register to add a comment.
2 votes 2 votes S=>Bb/a (No Left Recursion Here) B=>eB'/adB' B'=>cB'/bdB'/ε Anup patel answered Jan 7, 2017 edited Jan 7, 2017 by Anup patel Anup patel comment Share Follow See all 0 reply Please log in or register to add a comment.