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 526 views answer comment Share Follow See all 6 Comments See all 6 6 Comments reply Rahul Jain25 commented Jan 14, 2017 i moved by Rahul Jain25 Jan 14, 2017 reply Follow Share Grammar is LR(1), bcoz i checked for only LL(1) and it is LL(1). And if grammar is LL(1) then it is definately LaLr(1) and LR(1). And we have to select only one answer so no need to check other options. 0 votes 0 votes saurabh rai commented Jan 14, 2017 reply Follow Share ur logic is wrong it is nt LL(1) 0 votes 0 votes Rahul Jain25 commented Jan 14, 2017 reply Follow Share The first of both of them are {a,b} And these entries are filled by only one productions, ins't it??? 0 votes 0 votes 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.