0 votes 0 votes Compiler Design compiler-design grammar ambiguous-grammar test-series + – Ankita Shingala asked Jan 14, 2017 • retagged Jul 18, 2022 by makhdoom ghaya Ankita Shingala 557 views answer comment Share Follow See all 6 Comments See all 6 6 Comments reply Show 3 previous comments saurabh rai commented Jan 14, 2017 reply Follow Share No first(TE)=a,b first(a)=a 1 more thing there is left recursion.... 0 votes 0 votes Rahul Jain25 commented Jan 14, 2017 reply Follow Share Oh yes, really a bad silly mistake. My bad. 0 votes 0 votes Ankita Shingala commented Jan 15, 2017 reply Follow Share what should be the answer? D) none? 0 votes 0 votes Please log in or register to add a comment.
Best answer 3 votes 3 votes This grammar is ambiguous so a LR parsers cannot parse it for string bbaba it gives two parse trees 1st $E\rightarrow $ $TE\\ Ta\\ ETa\\ Eba\\ TEba\\ bEba\\ bTEba\\ bbaba$ 2nd $E\rightarrow $ $TE\\ bE\\ bTE\\ bTa\\ bETa\\ bEba\\ bTEba\\ bbaba$ Lokesh . answered Jan 16, 2017 • selected Jan 16, 2017 by Ankita Shingala Lokesh . comment Share Follow See 1 comment See all 1 1 comment reply Ankita Shingala commented Jan 16, 2017 reply Follow Share thanks. 0 votes 0 votes Please log in or register to add a comment.