OS | Build & Test Pipeline Status |
---|---|
Linux | |
MacOS | |
Windows |
This is a C++-implementation of a compiler for the Jack programming language defined in project 9 of the nand2tetris-course.
The program takes as argument either a single .jack
-file or a directory containing such files, compiles the file(s) into Hack virtual-machine language code and writes the result to one or more .vm
-file(s).
Note: To build this program, a compiler that supports C++17 and std::filesystem
is required (e.g. gcc version ≥ 8).
git clone https://github.com/mfl28/JackCompiler.git
cd JackCompiler
cmake -B build # Use option "-D BUILD_TESTING=OFF" if you do not want to build the unit-tests.
cmake --build build
After you built the program, do the following from within the build
-directory:
./JackCompiler path/to/filename.jack # Or "./JackCompiler path/to/directory"
cd Debug # Or "cd Release" if you built using Release-configuration.
.\JackCompiler.exe path\to\filename.jack # Or ".\JackCompiler path\to\directory"
If you built the program including the unit-tests, then these can be run from within the build
-directory by doing the following:
ctest -V
ctest -C Debug -V # Or "ctest -C Release -V" if you built using Release-configuration.