Question 12384 – Compiler-Design
May 17, 2024
Question 13945 – Compiler-Design
May 17, 2024
Question 12384 – Compiler-Design
May 17, 2024
Question 13945 – Compiler-Design
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
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!