We say a grammar is e-free if either it has no


We say a grammar is e-free if either it has no e-productions or there is exactly one e-production S -+ E and then the start symbol S does not appear on the right side of any production. a) Write an algorithm to convert a given grammar into an equivalent s-free grammar. Hint. First determine all nonterminals that can generate the empty string. b) Apply your algorithm to the grammar in Exercise 4.2.

Exercise 4.2. Consider the grammar

a) Show that this grammar is ambiguous by constructing two different leftmost derivations for the sentence abab.

b) Construct the corresponding rightmost derivations for abab.

c) Construct the corresponding parse trees for obob.

*d) What ,language does this grammar generate'!

Request for Solution File

Ask an Expert for Answer!!
Finance Basics: We say a grammar is e-free if either it has no
Reference No:- TGS01477233

Expected delivery within 24 Hours