Question 12384 – Compiler-Design
May 17, 2024Question 13945 – Compiler-Design
May 17, 2024Question 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.
Statement – B is not ambiguous.
Statement – C is ambiguous.
(A) and (C) only
(B) only
(B) and (C) only
(A) and (B) only
Subscribe
Login
0 Comments