1. Engineering
  2. Computer Science
  3. exercise 3show that each of the following grammars is ambiguous...

Question: exercise 3show that each of the following grammars is ambiguous...

Question details

Exercise 3Show that each of the following grammars is ambiguous. (To show that a grammar is ambiguous, you must demonstrate that it can generate two parse trees for the same string.) a. The grammar G4, repeated here: cexp> * sexp> b. This grammar: <person><woman> <man> <woman ::wilma | betty | <empty> <man> ::- fred | barney | cempty> c. The following grammar for strings of balanced parentheses. (A language of any number of different kinds of balanced parentheses is called a Dyck lan- guage. This type of language plays an interesting role in the theory of formal languages.)
d. This grammar: <s» : := <round > <square > I cround<round () <square><square>I i <outer> ::= ( <outer> ] <inner> : := ) <inner> [ I ) [ couter> | ( <inner> ]
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution