Compiler-Design

Question 38

(a) Remove left-recursion from the following grammar:

    S → Sa| Sb | a | b 

(b) Consider the following grammar:

    S → aSbS| bSaS |ε  

Construct all possible parse trees for the string abab. Is the grammar ambiguous?

A
Theory Explanation is given below.
Correct Answer: A
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: <b>Alert: </b>Content selection is disabled!!
OOPS
December 12, 2023
Software-Engineering
December 12, 2023
OOPS
December 12, 2023
Software-Engineering
December 12, 2023