Mini Interpreter / Compiler in Haskell

Programming Language Technology, 2015

Make sure you have bnfc, Happy, Alex, and GHC available.

Interpreter

To compile the interpreter:

  make interpreter

To run the interpreter:

  ./runmini ../ex.mini

Compiler

To compile the compiler:

  make compiler

To run the compiler:

  ./compilemini ../ex.mini

Make sure you have jasmin.jar available. This will create a Jasmin file (Foo.j) and call Java to compile it into a bytecode file (Foo.class). To run the generated JVM code:

  java Foo

Make sure you have Runtime.class available. You can produce it by

  javac ../Runtime.java -d .

Also make sure that your current directory (where Foo.class resides) is in the CLASSPATH.

Files