Data-Structures
November 15, 2023
UGC NET June-2019 CS Paper-2
November 16, 2023
Data-Structures
November 15, 2023
UGC NET June-2019 CS Paper-2
November 16, 2023

Question 8932 – Compiler-Design

Given the grammar
s→ T*S | T
T → U + T | U
U → a | b
Which of the following statements is wrong?

Correct Answer: D

Question 312 Explanation: 
The grammar is unambiguous as it can be parsed by CLR(1) parser.
S-> T*S , since S has right recursion so * is right associative
T-> U+T , since T has right recursion so + is right associative
Hence right to left evaluation of * and + will happen.
+ is having more precedence than * so the precedence of + and * is clearly defined.
A
Grammar is not ambiguous
B
Priority of + over * is ensured
C
Right to left evaluation of * and + happens
D
None of these

Leave a Reply

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