1 1 vote Which of the following is true while converting CFG to an LL(1) grammar?Removing left recursion aloneFactoring the grammar aloneRemoving left recursion and factoring the grammarNone of the above Compiler Design ugcnetcse-dec2012-paper2 compiler-design parsing + – Arjun 7.2k views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
Best answer 4 4 votes Answer : while converting CFG to LL(I) grammar we have to see Remove left recursion Factoring grammar Reference : information about Conversion from CFG to LL(1) Grammar is Here It must be noted that even after the above 2 steps there is no guarantee that we get an LL(1) grammar as for that our grammar must be unambiguous as well. See one related question here. shekhar chauhan answered Jul 10, 2016 • selected Jul 10, 2016 by Arjun shekhar chauhan comment Share Follow See all 11 Comments 11 11 Comments reply Show 8 previous comments Arjun commented Jul 10, 2016 reply Follow flag @shekhar you are correct. I'll restore. Missed the "suffices". 0 0 replyShare srestha commented Jul 10, 2016 reply Follow flag yes in GATE the word "suffices" makes difference https://gateoverflow.in/906/gate2003-16 3 3 replyShare Rajesh Raj commented Oct 14, 2016 reply Follow flag sir left factoring convert non-deterministic to deterministic and a deterministic is always unambigious I think so why not option C is sufficient ? 0 0 replyShare Please log in or register to add a comment.
0 0 votes Option C will be right option for it. Bcz when we will convert any CFG such grammar do not have the propert of the Left recrsion along with there does not exist any non-deterministic grammar for it. So option C will be right option for it. Paras Nath answered Oct 14, 2016 Paras Nath comment Share Follow 0 reply Please log in or register to add a comment.