This is a compiler for the Jack programming language, written in Python. It translates Jack code to VM assembly code, which can then be run on the Hack computer simulator.
To use the compiler, simply run the following command:
python JackCompiler.py path_to_input_file
For example, to compile the file my_program.jack, you would run the following command:
python compile.py my_program.jack
The compiler will output the VM assembly code to a file called my_program.vm.
The compiler supports the following features of the Jack language:
- Objects
- Methods
- Variables
- Expressions
- Statements
- Control flow
The compiler is designed to be used as part of the Nand to Tetris course. However, it can also be used to compile Jack code for any other purpose.