2 votes 2 votes Read the following grammar: $S \rightarrow Ka \mid bKc \mid dc \mid bda$ $K \rightarrow d$ This grammar is NOT: LALR(1) SLR(1) LR(1) None of the above Compiler Design tbb-cd-1 compiler-design grammar + – Bikram asked Nov 25, 2016 • retagged Sep 14, 2020 by ajaysoni1924 Bikram 567 views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply Neelesh Pandey commented Jan 1, 2017 reply Follow Share How option (b) is correct?? 0 votes 0 votes Bikram commented Jan 1, 2017 reply Follow Share see the first example http://people.cs.vt.edu/~ryder/515/f05/homework/hw1ans.pdf 2 votes 2 votes Neelesh Pandey commented Jan 1, 2017 reply Follow Share ok..thanx. 0 votes 0 votes Please log in or register to add a comment.
3 votes 3 votes Follow of $K$ contains $c$, hence it is not $SLR(1)$. Ashwani Kumar 2 answered Oct 5, 2019 Ashwani Kumar 2 comment Share Follow See 1 comment See all 1 1 comment reply Hira Thakur commented Sep 14, 2022 reply Follow Share The production $S\rightarrow d.c,K\rightarrow d.$ has SR conflict, because $follow(K)=a,c\in c$ is in shift move. The has production $S\rightarrow bd.a,K\rightarrow d.$ also has SR conflict. $\therefore$ given grammar is not SLR(1). 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes $[Closure]$ on $d$ would have $K\rightarrow d.$ and $S\rightarrow d.c$ So, there's one final item (reduce move/handle) and one shift move possible on c. => SR conflict for LR(0) Check $Follow(K)$. It has c. => SR conflict for SLR(1), too. Option B JashanArora answered Dec 22, 2019 JashanArora comment Share Follow See all 0 reply Please log in or register to add a comment.