Computer Science 3 - 2003

Programming Language Translation


Optional Practical for Week 26, beginning 20 October 2003

In response to various requests I have made the source code for the Parva compiler described in chapter 14 available for people to study and to play with. There is no compulsion to do so, but if you would like to study the code in detail, go right ahead. You will not be expected to answer practical questions on this code in the examination. If we had had another week it might have been a different story!


Task 1 - Create a working directory and unpack the prac kit

There are several files zipped up in the file PRAC26.ZIP.


Task 2 - Try it all out

Make the compiler:

CMAKE Parva

Try it out, for example:

PARVA queens.pav

Look at the code in queens.cod in the usual way.

The interpreter in this kit can handle several extended opcodes like LDC_1 or LDGA_1, but the code generator and parser are not set up to do those optimizations (which would, of course take the same sort of form as you are supposed to be developing in Practical 25).

Have fun. Ask me if there is anything you do not understand or would like explained further.


Home  © P.D. Terry