Which one of the following is true about LALR(1) Parser ?
In LALR(1) parser(same as Yacc)
For S/R conflict it resolves in favour of shift.
For R/R conflict it resloves in favour of any reduce from both.
Option b) is correct.
One more option possible => Depends on the situation of conflict (If this is there it is most appropriate.
For more details follow link:- https://gateoverflow.in/33619/which-type-of-compiler-conflict-is-detected-and-resolving-it
Read this one
Refer : https://gateoverflow.in/1405/gate2005-83a
In case of RR Conflict we reduce using the first production that comes textually in the grammar.
Here : https://gateoverflow.in/87037/gate2005-83b
Thats why when we have : E x E + E -----(RR Conflict and E+E comes first HENCE) ==> (E X (E + E)) SO answer is 9
Correct me if i am wrong :)
Feedback for next edition (if ever there's...