Compiling with C# and Java - Resources

P.D. Terry, Rhodes University

(25 September 2021)

A complete revision of my earlier book (Compilers and Compiler Generators (1997)), using C# and Java and versions of the compiler generator Coco/R for those languages, was published as "Compiling with C# and Java" by Pearson Education on 5th November 2004. Following standard publisher practice, the book records a publication year of 2005, and the ISBN is 0-321-26360-X.

A feature of the book is that it demonstrated the use of the compiler generator Coco/R to implement compilers for the JVM and CLR platforms, as well as for a simpler interpretive PVM platform.

For reasons best known to Pearson Education, the book was not distributed initially in the USA, and in particular was not available from http://www.amazon.com for a long time. It went out of print, and the copyright reverted to me. A copy of the final draft as submitted to the publishers, along with associated software, may be read and downloaded from this website.

It is a pleasure to record the help and friendship of Professor Hanspeter Mössenböck of the University of Linz in Austria, developer of Coco/R, who has freely shared his software and expertise, and who carefully reviewed the manuscript.

Just before the book was published, Hanspeter Mössenböck released a new version of Coco/R, one in which the system generated instantiable scanners and parsers, rather than the static ones of the earlier release of Coco/R. Furthermore, the original release from Linz had been extended at Rhodes University to add a few features designed to make it still easier to use. The publishing schedule was too tight to revise the entire book to match the new Linz release, although its associated software for this version has been provided online (see below).

Development of the "instantiable" version of Coco/R has continued at Linz, and the present official system may be found by visiting https://ssw.jku.at/Research/Projects/Coco/

The 2005 book was used successfully for several years at Rhodes University. Over the years the material was modified, parts of the book were rewritten to enhance clarity, and an abbreviated edition (without the compilers for the JVM and CLR platforms) was produced for student use. This material is also freely downloadable from this site in terms of the GPL licence, as is a mass of examples and courseware developed over the years. This has been made available "as is", with the caveat that, as time progressed and the version of Coco/R and the language and compiler for Parva described in the book changed, the later material inevitably may show minor inconsistencies with the earlier material.

This material may be viewed on-line, although it may be found more convenient to download and install it onto your own computer.

  • View the on-line version of the original 2005 edition    
  • Download and install the components of the "static" resourcekit (Coco/R generating static classes)
  • Download and install the components of the "instantiable" resourcekit (Coco/R generating instantiable classes)

  • View the on-line version of the abridged and revised 2017 edition    
  • Download and install the components of the 2017 resource kit (Coco/R generating static classes)

    A large collection of exercises, with their possible solutions worked in full, has been provided:

  • View the on-line version of these exercises    
  • Download and install the components of the exercises resource kit (static classes)

  • View the on-line version of their solutions    
  • Download and install the components of the solutions resource kit (static classes)