next up previous
Next: About this document Up: CS471 Programming Languages I Previous: CS471 Programming Languages I

Homework 1

  1. Monkey language consists of the terminal symbols a, b, d, tex2html_wrap_inline18 , where tex2html_wrap_inline20 is a space. Its grammar is:
    tex2html_wrap_inline22
    tex2html_wrap_inline24
    tex2html_wrap_inline26
    tex2html_wrap_inline28
    tex2html_wrap_inline30

    Which of the following speakers is a monkey in disguise? i.e. which of the following utterances cannot be generated by the grammar?

    Gibbon: tex2html_wrap_inline32
    Spider: tex2html_wrap_inline34
    Rhesus: tex2html_wrap_inline36
  2. Augment or otherwise change the grammar to include the imposter, i.e. so that the quoted sentences can be generated from the same grammar.
  3. Rewrite the original monkey grammar (not your changed version) in EBNF form, by replacing all possible recursions by repetitions, and using grouping and optional forms as appropriate.
  4. Redraw you EBNF grammar in syntax diagram form.

Assignment due: Tuesday, February 6th., in class.



Roger Hartley
Tue Feb 20 11:42:07 MST 1996