6 votes 6 votes Consider the grammar given below S⟶ SS | a | ∈ The number of inadequate states in the DFA of LR(1) items is (a) 1 (b) 2 (c) 3 (d) 4 Compiler Design compiler-design grammar parsing lr-parser + – srestha asked Apr 16, 2016 • retagged Jun 20, 2022 by Lakshman Bhaiya srestha 7.3k views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply Amit Sharma commented Jun 2, 2016 reply Follow Share What would be the answer for LR(o) items in same question ? 1 votes 1 votes shekhar chauhan commented Jun 2, 2016 reply Follow Share see my Answer Below . 0 votes 0 votes sudsho commented Jan 21, 2017 reply Follow Share state having conflict...draw its dfa..there will be 3 such states 1 votes 1 votes Please log in or register to add a comment.
Best answer 7 votes 7 votes Ans 3 ManojK answered Apr 16, 2016 • selected May 23, 2016 by srestha ManojK comment Share Follow See all 5 Comments See all 5 5 Comments reply Show 2 previous comments ManojK commented Apr 17, 2016 reply Follow Share both are different state how will u merge.rt? 0 votes 0 votes srestha commented May 20, 2016 reply Follow Share @Manoj @Vamsi check my one where is the 3rd conflict? :o 0 votes 0 votes sudharshan commented Jan 24, 2019 reply Follow Share what is meant by inadequate states given in question. and how the answer is 3. didn't get the explanation. help please. 0 votes 0 votes Please log in or register to add a comment.
8 votes 8 votes In state 1 : 1 -SR conflict In state 2 : 1 -SR conflict In state 3 : 1 -SR conflict + 1 RR conflict shekhar chauhan answered Jun 2, 2016 • reshown Jun 2, 2016 by shekhar chauhan shekhar chauhan comment Share Follow See all 0 reply Please log in or register to add a comment.
3 votes 3 votes Number of inadequate states is nothing but states which has S/R or R/R conflicts Ref:http://www.cs.nuim.ie/~jpower/Courses/Previous/parsing/node64.html Prajwal Bhat answered Jan 21, 2017 Prajwal Bhat comment Share Follow See all 2 Comments See all 2 2 Comments reply Sarvottam Patel commented Jan 21, 2017 reply Follow Share How to draw the dfa? 0 votes 0 votes Prajwal Bhat commented Jan 21, 2017 reply Follow Share After getting LR(0) items what you do is DFA diagram(something looks below(not for this grammar)) 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes finding no of conflict srestha answered May 20, 2016 • edited May 20, 2016 by srestha srestha comment Share Follow See all 10 Comments See all 10 10 Comments reply Show 7 previous comments srestha commented May 23, 2016 reply Follow Share ok means any one state I1 can go in input S, (either I1 or I3) rt? 0 votes 0 votes ManojK commented May 23, 2016 reply Follow Share yes 0 votes 0 votes Priyanshu Dubey commented Nov 26, 2022 reply Follow Share In i1 state the first production is S’ → S. , $ which will not be genrated again by [i1,S] , So how its self loop can be correct ?? 0 votes 0 votes Please log in or register to add a comment.