Multiple Choice
Consider the following expression grammar. The seman-tic rules for expressioncalculation are stated next to each grammar production.
E ? number E.val = number. val
| E '+' E E(1) .val = E(2) .val + E(3) .val
| E '×' E E(1) .val = E(2) .val × E(3) .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 thefollowing is true about the action of yacc for the given grammar?
A) It detects recursion and eliminates recursion
B) It detects reduce-reduce conflict, and resolves
C) It detects shift-reduce conflict, and resolves the conflict in favor of a shift over a reduce action
D) It detects shift-reduce conflict, and resolves the conflict in favor of a reduce over a shift action
Correct Answer:

Verified
Correct Answer:
Verified
Q14: Consider the grammar S ? (S) |
Q15: In compiler optimization, operator strength reduction uses
Q16: The grammar A ? AA | (A)
Q17: Which of the following describes a handle
Q18: Consider the following two sets of LR(1)
Q19: An LALR(1) parser for a grammar G
Q20: Consider the following two statements:<br>P: Every regular
Q21: Consider the following grammar:<br>S ? FR<br>R ?
Q23: Debugger is a program that<br>A)allows to examine
Q24: A canonical set of items is given