Make sure you have bnfc, Happy, Alex, and GHC available.
To compile the interpreter:
make interpreter
To run the interpreter:
./runmini ../ex.mini
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.
runmini.hs
= top level interpreter
compilermini.hs
= top level compiler
Compiler.hs
= code generator
TypeChecker.hs
= type checker
Interpreter.hs
= interpreter
AnnotCompiler.hs
= code generator using type annotations
AnnotatingTypeChecker.hs
= type checker that produces annotations; not quite complete
../Mini.cf
= grammar of Mini, source file for bnfc
../ex.mini
= example Mini program
../Runtime.java
= runtime system for the compiler