Homework #1

Compiler Construction, WS0910

For clarification, here is a what you need to do to complete your first homework assignment:

  1. Write unit tests for
    • parsing single digits
    • interpreting an addition of those digits and computing the correct result
    • interpreting subtraction, multiplication, and division
    • correctly computing order of operations (“Punkt vor Strich”)
    • parsing parentheses and interpreting them recursively (hint: separate parsing of factors, terms, and expressions)
  2. Once your tests are in place (and you have a red bar), start to implement the functionality required for each test. Start with the simple tests and approach the complicated ones from there, just as it was shown in the lecture.
  3. A GUI for the interpreter is not required, but you may add one if you like.
  4. To submit your homework, join the GForge project (see my previous entry on this page). I will contact you once your CVS is ready. Commit your project to CVS from Eclipse using Team/Share project.

Feel free to ask me if you have any questions. If the CVS doesn’t work or you have problems using it, you can submit your homework via Email.