Question 12384 – Compiler-Design
May 17, 2024
UGC NET JRF November 2020 Paper-2
May 17, 2024
Question 12384 – Compiler-Design
May 17, 2024
UGC NET JRF November 2020 Paper-2
May 17, 2024

Question 13919 – Compiler-Design

Which of the following grammars is (are) ambiguous?
(A) s → ss | asb | bsa | λ
(B) s → asbs | bsas | λ
(C) s → aAB
A → bBb
B → A | λ where λ denotes empty string
Choose the correct answer from the options given below:

Correct Answer: A

Question 350 Explanation: 
Statement – A is ambiguous because λ can be generated using leftmost derivations having two different parse trees.

Statement – B is not ambiguous.
Statement – C is ambiguous.
A
(A) and (C) only
B
(B) only
C
(B) and (C) only
D
(A) and (B) only

Leave a Reply

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