Which of the following grammars are ambiguous? For ambiguous grammars,
(a) justify your answer by giving two parse-trees for some string generated by the grammar and
(b) try to rewrite it as an equivalent unambiguous grammar. For unambiguous grammars, give an equivalent ambiguous grammar (remember to justify your answer by giving two parse-trees for some string derived from the new grammar).
G = ({S, A, B}, {0, 1}, R, S) where R is:
S -> 0A | 1B | ε
A -> 0AA | 1S | 1
B -> 1BB | 0S | 0



Answer :

Other Questions