This is an implementation of an interpreter for MiniJava, done for the Compilers course at Ca' Foscari University of Venice, master's degree in Computer science. It's written in Ocaml. I had a lot of fun.
On Unix systems, type `make` to compile the whole thing; type `make test` instead to interpret the two pieces of MiniJava code described below.Two pieces of MiniJava code are included to test the interpreter:
- test1.java tests methods with or without parameters, objects, arrays, arrays of objects, arrays of arrays. It's a small beast, but a beast nonetheless.
- test2.java tests arithmetic operations, booleans, conditionals. It's the easy-going brother of test1.
The irony of extending class Europe
with class England
is not lost to me.
A few things. Some comments are in Italian - just skip them until I translate them. The code could be restructured to be more compact and less redundant but I love it anyway.