Logo University of Washington Department of Computer Science & Engineering
 CSE 401Au '02: Assignment #2, Due Friday, 10/18/02
  CSE Home  About Us    Search    Contact Info 

    Individual homework

    #1-#2 should be done and turned in individually, not as a group.

  1. ASU 4.2a-d

  2. ASU 4.3a-c

    Project

    The following is to be done by your group; turn in only one solution per group.

  3. For the PL/0 original BNF, compute the FIRST set for the right hand side of each rule. Please list these sets in the same order as given on the original BNF page.

  4. Compute the FOLLOW set for each variable (left hand side). Again, please list in order.

  5. Is the grammar LL(1)? Why or why not? If not, outline one place in the base compiler where it deviates from strict adherence to the base grammar in order to avoid non-LL(1)-ness and sketch how it works.

  6. Code pulp! Add comments to the PL/0 language. A comment is introduced by "//" and extends to the end of the current line, much like in C++.

  7. Code pulp! Add 'else' to the PL/0 language. Make a choice on how to solve the dangling else ambiguity. Write a test program to check the functioning of the new feature.

  8. Code pulp! Design and add the 'for' statement to the PL/0 language. Try to make it as nicely integrated within the current language as possible.

    For the added statements you don't need to generate code. They just must parse correctly.

    What to Turn In


CSE logo Department of Computer Science & Engineering
University of Washington
Box 352350
Seattle, WA  98195-2350
(206) 543-1695 voice, (206) 543-2969 FAX
[comments to cse401-webmaster at cs.washington.edu]