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 Arjun commented Dec 15, 2014 reply Follow Share its just an error and not a conflict rt? 8 votes 8 votes Gate Keeda commented Dec 15, 2014 reply Follow Share Even if we consider that as an typing error or so, then even for '>' this symbol I don't see any option. As Q-->R does not have a '.' So that we can tell if it is reduced or not. 0 votes 0 votes Card Wizard commented Dec 15, 2014 reply Follow Share Yes Arjun sir , in actuall question as Gate Keeda has mention below comment even for > symbol in actuall paper there is no any symbol that's why it is an error as there is no any entry in parse table so no any conflict but error.. 1 votes 1 votes Arjun commented Dec 15, 2014 reply Follow Share @Gate-keeda I was not telling about typo. Error during parsing. 6 votes 6 votes Gate Keeda commented Dec 15, 2014 reply Follow Share That's for sure will be an error. But I'm saying that the question itself is wrong. 0 votes 0 votes Prashant Singh commented Dec 15, 2014 reply Follow Share hmm q->r in not canonical form..."." is not there.....but if we ignore that nd take q->.r then option (d ) is correct 0 votes 0 votes Rohan Mundhey commented Sep 26, 2016 reply Follow Share Are Canonical Set of items and LR(0) items same ? 0 votes 0 votes Dulqar commented Oct 23, 2016 reply Follow Share Given state itself suffer from SR conflict , right ? Correct me if wrong . 1 votes 1 votes Samujjal Das commented Nov 8, 2016 reply Follow Share Yes SR conflict if Q->R. is the second production and we have ">". 0 votes 0 votes Nit9 commented Nov 28, 2016 reply Follow Share what is the meaning of this line "The given input symbol no where in the given grammar.." symbol no where?!? 0 votes 0 votes sushmita commented Feb 4, 2017 reply Follow Share yes on input > it has SR conflict for sure. 0 votes 0 votes Venkat Sai commented Nov 30, 2017 reply Follow Share that cannot be confirmed till we know wheter the parser is lr (0) or slr (1 ) and if > is in follow of Q then it s confirmed to have SR conflict 1 votes 1 votes 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.