Data-Structures
November 15, 2023UGC NET June-2019 CS Paper-2
November 16, 2023Question 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.
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.
Grammar is not ambiguous
Priority of + over * is ensured
Right to left evaluation of * and + happens
None of these
Subscribe
Login
0 Comments