CSE 401 Compilers Class (Fall '99)

[Home] [Admin] [Details] [Help]

Assignments / #8 (Optional, Extra Credit, No Groups)


Due Friday, 12/10/99

This is an optional, extra credit, individual assignment (no groups). No one has to do it. Doing it can only help you grade, but not doing it will not hurt your grade. (I set my grading curve before factoring in any extra credit.) The amount of extra credit is variable, depending on what you do, but the general goal is that you can get a max of about 5% extra, compared to 40% for the overall project component of the course, and you need to do more than 5/40 = 12.5% extra work to reach the max.

What do you need to do, you ask? Well, you tell me: You must design and implement some non-trivial extension to the pl/0 language. Ideally, whatever you do will effect all phases of the compiler, from lex to codegen. Here's one half-baked example: add goto's. Lots of details need to be specified: syntax and scope of labels, syntax for goto's, can you jump into/out of a loop, a procedure, a function, how does that effect the stack, etc., etc. There are lots and lots of other possibilities (strings, array slices, pointers, exceptions, objects, multiple inheritence, first-class functions, logic programming, Real Time Streaming ActiveMediaX Beans, ...), but do think it through; some of those are a wee bit complicated.

Step 1: Prepare a written description of your proposed language change, together with a sketch of what needs to be changed in the compiler. (What new tokens are needed? What parts of the parser need to change and will the basic pseudo-LL(1) style parser suffice? What semantic checks need to be added? Will the symbol table change? What kinds of test cases will you need to test it? Etc.) This should run 2-3 pages, typed. Schedule a time to meet with me to review this before you begin implementation.

Step 2: Implement and test it.

Step 3: Turn in, both electronically and on paper:

  1. Code, printouts, and test cases as usual.
  2. Include a synopsis of what you had to change in each module.
  3. Also turn in your documentation from step 1, modified if necessary to reflect changes you made and why ("Feature X turned out to be much harder to do than anticipated because of Y, so I only did the more limited X' statement...").
  4. Finally, I'd like to see a page or so of your reflections on what you learned during this assignment. For example, did you learn things you hadn't seen before as a result of looking over the whole compiler at once, rather than a phase at a time? Was the open-ended nature of the assignment a good thing or not?


cse401-webmaster@cs.washington.edu (Last modified: 11/12/99)