44 votes 44 votes A canonical set of items is given below $S \to L .> R $ $Q \to R.$ On input symbol $<$ the set has a shift-reduce conflict and a reduce-reduce conflict. a shift-reduce conflict but not a reduce-reduce conflict. a reduce-reduce conflict but not a shift-reduce conflict. neither a shift-reduce nor a reduce-reduce conflict. Compiler Design gatecse-2014-set1 compiler-design parsing normal + – go_editor asked Sep 26, 2014 edited Jan 17 by Arjun go_editor 24.3k views answer comment Share Follow See all 12 Comments See all 12 12 Comments reply Show 9 previous comments Souvik33 commented Dec 3, 2022 reply Follow Share A rare example, when the question setter decided to conduct a small prank, and the answer key along with the answer prints the line “Look at the camera and say Hi!” You’ve been pranked. 2 votes 2 votes iamsubhrajit commented Jan 8, 2023 reply Follow Share @Souvik33 hahaha 1 votes 1 votes Sachin Mittal 1 commented Jul 28, 2023 reply Follow Share I think the given state itself is invalid. Which means we can not have that as a state in any parsing. $S \rightarrow L .> R :$ This item indicates that the parser is in a state where it has derived the L. $Q \rightarrow R.$ : This item indicates that the parser is in a state where it has derived the R. Having both items in the same state is not possible and violates the rules of a valid parsing state. 4 votes 4 votes Please log in or register to add a comment.
Best answer 48 votes 48 votes The question is asked with respect to the symbol ' $<$ ' which is not present in the given canonical set of items. Hence it is neither a shift-reduce conflict nor a reduce-reduce conflict on symbol '$<$'. Hence D is the correct option. But if the question would have asked with respect to the symbol ' $>$ ' then it would have been a shift-reduce conflict. Regina Phalange answered Apr 7, 2017 edited Jun 21, 2021 by Lakshman Bhaiya Regina Phalange comment Share Follow See all 11 Comments See all 11 11 Comments reply Show 8 previous comments Abhrajyoti00 commented Dec 27, 2022 reply Follow Share @abir_banerjee Why do you think so? It is a collection of LR(0) items, then? 0 votes 0 votes Ray Tomlinson commented Jan 17 reply Follow Share I also think @abir_banerjee is correct 0 votes 0 votes pranavbhosle_ commented Feb 2 reply Follow Share I also think that there will not be any shift reduce conflict even if they had asked about '>'. It's because, on input '>', only first production rulw gets into next item(state). Isn't that right ? 0 votes 0 votes Please log in or register to add a comment.
25 votes 25 votes Ans : The given input symbol no where in the given grammar so with given symbol we have neither a shift-reduce nor a reduce-reduce conflict. So, correct answer is (D.) ... Card Wizard answered Dec 15, 2014 edited Dec 11, 2017 by kenzou Card Wizard comment Share Follow See all 15 Comments See all 15 15 Comments reply Show 12 previous comments habedo007 commented Dec 7, 2017 reply Follow Share Even if the question had ">", there won't be any conflict on its canonical collection. There will only be shift to $S\rightarrow L>.R$ and enumerations of R. The current state itself is in SR conflict, and that's a different matter. 0 votes 0 votes Barney Ross commented Sep 10, 2018 reply Follow Share Can someone send some resources for this topic? 0 votes 0 votes Rajesh Panwar commented Dec 11, 2018 reply Follow Share may be printing mistake in the question? but according to the question Option D is right 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes The input symbol is “<” which is not in canonical set of item, so it is neither a shift-reduce nor a reduce-reduce conflict with reference to “<” symbol. But if it would have asked about “>” then it will be a SR conflict. varunrajarathnam answered Sep 19, 2020 varunrajarathnam comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes d ans as <. is not in the grammer akankshadewangan24 answered Apr 22, 2017 akankshadewangan24 comment Share Follow See 1 comment See all 1 1 comment reply paraskk commented Mar 29, 2019 reply Follow Share this question is just to trap students marking in a hurry! 2 votes 2 votes Please log in or register to add a comment.