Chapter 2 Problems

1a. For the following grammar, provide parse trees that show that this grammar is, in fact, ambiguous.

<S> -><S><S> | (<S>) | ()

1b. Give an unambiguous grammar that generates the same language.

2. Write a BNF grammar for the language composed of all binary numbers that contain at least three consecutive 1s. (The language will include the strings 011101011, 000011110100, and 11111110, but not 0101011.)

3. Do textbook problem 2.23.

Submit your work on paper at the beginning of class.