GATE 2003
January 26, 2024
GATE 1992
January 26, 2024
GATE 2003
January 26, 2024
GATE 1992
January 26, 2024

Compiler-Design

Question 42

(a) Construct all the parse trees corresponding to i + j * k for the grammar

      E → E+E
      E → E*E
      E → id  
    (b) In this grammar, what is the precedence of the two operators * and +?
    (c) If only one parse tree is desired for any string in the same language, what
    changes are to be made so that the resulting LALR(1) grammar is non-ambiguous?
A
Theory Explanation is given below.
Correct Answer: A

Leave a Reply

Your email address will not be published. Required fields are marked *