From: Doni Pracner Date: Sat, 15 Feb 2014 15:12:57 +0000 (+0100) Subject: docs - about the compiler in the lib folder, improvements X-Git-Tag: v0.1.5a~1 X-Git-Url: http://svarog.pmf.uns.ac.rs/gitweb/?p=mjc2wsl.git;a=commitdiff_plain;h=7be8f8cc16b49a01dc6124c61b4dd92ff0a89aa0;hp=5de2ecbf1f577332acba6313d8afeec1cec822f8 docs - about the compiler in the lib folder, improvements --- diff --git a/lib/compiler.txt b/lib/compiler.txt index 7171aac..99b136d 100644 --- a/lib/compiler.txt +++ b/lib/compiler.txt @@ -18,32 +18,50 @@ http://perun.pmf.uns.ac.rs/kurbalija/Teaching/kk.htm About the compiler and runner ----------------------------- -The source files for a functional MJ compiler are given in the compiler-src -folder. These are heavily based on the source templates that are used in -the Compiler Construction classes and finished by students during the -course. +A jar file "mj.jar" for a functional MJ compiler is given in +the lib folder. The implementation used is heavily based on +the source templates that are used in the Compiler +Construction classes and finished by students during the +course. -The original source templates were written by Moessenboeck and are available -on the sites given above, though there are posible updates. The version -given has the compiler finished by a student, and a few additional changes -(such as the optional decoding while writeing to file). +The original source templates were written by Moessenboeck +and are available on the sites given above, though there are +posible updates. The version given has the compiler finished +by a student, and a few additional changes (such as the +optional decoding while writeing to file). -Usage ------ +Usage of the compiler +--------------------- -An ant build script can be found in the root folder of the project and it -includes (among others) tasks for building the sources, as well as using -the compiler and runner. - -Otherwise calls can be made with: +Calls to the compiler can be made with: java MJ.Compiler [-print] + +"-print" is to output the bytecode generated to the screen + + +Calling the interpreter is done with: + java MJ.Run [-d] +"-d" is to decode the input file before running it. + + There is also a Decoder available: java MJ.Decode -You might want to include the "compiler-bin" into your CLASSPATH, or just -use "-cp compiler-bin" in the command line. + +You might want to include the "mj.jar" into your CLASSPATH, +or just use "-cp mj.jar" in the command line. + + +Ant +---- + +An ant build script can be found in the root folder of the +project and it includes tasks for building using the +compiler and runner. It also includes tasks for building a +compiler from and into the appropriate directories which +are then overrideing the jar file.