E --> number {E1.val = number.val}
E --> E+E {E.val = E.val+E.val}
E --> E*E {E.val = E.val*E.val}
The above grammar and the semantic rules are fed to a yacc tool (which is an LALR(1) parser generator) for parsing and evaluating arithmetic expressions. Which one of the following is true about the action of yacc for the given grammar?
A) It detects recursion and eliminates it.
B) It detects RR conflict and resolves in favor of Shift
C) It detects SR conflict and resolves in favor of Reduce
D) It detects SR conflict and resolves in favor of Shift
-----------------------------------------
I have little confusion in drawing the states for such recursive grammers. And what does it mean to resolve a conflict in favour of something???? (It will be very helpful if you also attact pic of state diagram along with the answer) Thnx