The Tool Reference Compiler
The latest version is 1.2. You can obtain it from here.
You can run it as follows:
java -jar toolc-reference-1.2.jar program.tool
Available Options
By default, toolc
just compiles a Tool program to bytecode like your implementation will. You can however also use the reference implementation for other things. Try to run
java -jar toolc-reference-?.?.jar --help
for a list of available options. You can for instance print out some intermediate representations. Later in the project you will also be able to use the reference implementation to check that the operations you perform on the abstract syntax trees are valid.
The current options are:
--help display this message --tokens show tokens of input program --trees show trees of input program --pretty show pretty-printed source of input program --symbols show pretty-printed source with unique symbol IDs --lint checks the validity of the program without generating classes --main prints the name of the main object to stdout --check-symbols parse the program annotated with unique symbol IDs
Bug Reports
We welcome bug reports! Please use the forum on Moodle for this purpose.
History
2010-10-21 1.2 Fixed the positioning of DIV tokens. Also, more information is provided with --tokens (thanks to E. Kneuss) 2010-10-07 1.1 Fixed a bug with in the lexical analyzer with large integer literals (thanks to S. Vasey for pointing this out) 2010-09-28 1.0 First release