Compiling with C# and Java - Exercises (Statements of problems posed)
Pat Terry, Rhodes University, 2021
This collection of exercises for a course in programming language translation (and their solutions) was devised to
support and supplement the material in my book "Compiling with C# and Java". (Addison-Wesley, 2005. ISBN
0 321 26360 X)
The material is heavily based on the use of a compiler generator Coco/R, developed at the University of Linz by
Hanspeter Mössenböck, and which is now freely available in implementations for many programming languages.
The present collection has been developed in C# and Java, but incorporates material devised over some 20 years,
including some developed earlier in Pascal, Modula-2 and C++, but now converted to C# and Java.
Follow the links below to read the text of the problems for each section.
- HTML PDF Chapter 01 Introduction (course layout)
- HTML PDF Chapter 02 Installing Coco/R
- HTML PDF Chapter 03 Familiarity with the PVM
- HTML PDF Chapter 04 Developing Cocol grammars
- HTML PDF Chapter 05 Adding actions to Cocol grammars
- HTML PDF Chapter 06 Extending the level 1 Parva language and compiler
- HTML PDF Chapter 07 The 24 hour examination model
- HTML PDF Chapter 08 A very simple mixed language compiler
- HTML PDF Chapter 09 A truth table generator
- HTML PDF Chapter 10 A toy Fortran compiler for the PVM
- HTML PDF Chapter 11 ParvaDoc - a documentation generator for Parva
- HTML PDF Chapter 12 A Parva to Java high level compiler
- HTML PDF Chapter 13 A Forth-like assembler for the PVM (stage 1)
- HTML PDF Chapter 14 A Forth-like assembler for the PVM (stage 2)
- HTML PDF Chapter 15 An assembler for a single accumulator 8-bit machine (stage 1)
- HTML PDF Chapter 16 An assembler for a single accumulator 8-bit machine (stage 2)
- HTML PDF Chapter 17 Adding enumeration types to Parva (stage 1)
- HTML PDF Chapter 18 Adding enumeration types to Parva (stage 2)
- HTML PDF Chapter 19 Pretty-printers and high level translators (Parva/Mikra) (stage 1)
- HTML PDF Chapter 20 Pretty-printers and high level translators (Parva/Mikra) (stage 2)
- HTML PDF Chapter 21 A multifunction calculator (stage 1)
- HTML PDF Chapter 22 A multifunction calculator (stage 2)
- HTML PDF Chapter 23 Analysing student examination performance (stage 1)
- HTML PDF Chapter 24 Analysing student examination performance (stage 2)
- HTML PDF Chapter 25 Adding class types to Parva (stage 1)
- HTML PDF Chapter 26 Adding class types to Parva (stage 2)
- HTML PDF Chapter 27 Adding Turtle Graphics to Parva (stage 1)
- HTML PDF Chapter 28 Adding Turtle Graphics to Parva (stage 2)
- HTML PDF Chapter 29 Adding set types to Parva (stage 1)
- HTML PDF Chapter 30 Adding set types to Parva (stage 2)
- HTML PDF Chapter 31 Boolean expressions and truth tables (stage 1)
- HTML PDF Chapter 32 Boolean expressions and truth tables (stage 2)
- HTML PDF Appendix 1 Coco/R user manual (PDF only)
- HTML PDF Appendix 2 Assorted Coco/R pitfalls and tips
- HTML PDF Appendix 3 C# support libraries developed for use in these exercises
- HTML PDF Appendix 4 Java support libraries developed for use in these exercises