RHODES UNIVERSITY


Computer Science 301 - 2013 - Programming Language Translation

You lucky people! Here is some more free information - a working solution to the problem posed earlier today.

The website now contains new versions of the grammar and support files, in the files free2j.zip (Java) or free2c.zip (C#), which you are free to copy and unpack. The files will allow you to build and execute a version of the criterion converter.

The Student class has not been altered, but an attributed grammar (Converter.atg), a symbol table class (Table), and simple code generator (CodeGen) have now been supplied.

Moving right along ....

I appreciate that some of the approach you have adopted today may differ from the route I have followed, but the questions in the examination itself have to be based on a common starting point.

So to prepare yourself to answer the examination tomorrow, you are encouraged to study the grammar, table class and code generator class in depth and, if you are sensible, to experiment with them further.

Yes, that's right, you heard me. Experiment with them further! Make quite sure you understand as much of what you now have as possible, because there may be "plums" in my source code (grammar and support classes) that relate to a more sophisticated solution than I expected you to produce today, such as pretty-printing. And there may be things which look very odd. Why, for example do the Double and Integer productions apparently throw away the converted numerical values? Why is no provision made for comments in the specification? Do you understand all of the (few) comments in my source?

Questions in the examination will probe your understanding, and you might be called on to make some modifications and extensions to one or other or all three of the grammar, the table handler and the code generation. You may well have thought of important issues that you might feel my solution overlooks, and you should spend some time comparing your work with mine to get to the bottom of this - perhaps by trying out any further test examples you may have derived to see whether my system handles (or rejects) them correctly.

You are still at liberty to continue discussions with your classmates, but not with staff or demonstrators, or previous survivors of this course.

That gives me a lot of scope, does it not? And, as you know by now, I have a vivid imagination. Do you?

Have fun, but get a good night's sleep, and don't be late tomorrow!

You will receive printed copies of this same grammar and support classes tomorrow, as well as machine readable copies of the entire system, and files containing the questions themselves. You could use these files to create your solutions in machine readable form if you wish.


Home  © P.D. Terry