Homework #3

Compiler Construction, WS0910

Please implement the following extensions to your interpreter:

  • identifiers longer than one character
  • floating point numbers

To do this, you have to implement a simple scanner, as demonstrated in the lecture. Create a Token class which contains information about a word. Tokens are created by the scanner using a finite automaton and then interpreted by the parser. As usual, create tests first!

I was asked what the criteria for evaluation of the homeworks are. The tests are very important, as is a consistent and readable code style. If the functionality is complete and working, and the tests make sense and cover most of the implementation, you will get full score. Comments are welcome, but not required, and I prefer meaningful method and variable names. In extreme cases, I may deduct points for code I’m not able to comprehend, so keep it simple 🙂