C++ implementation of the Lox programming language
Explore the docs »
Report Bug
·
Request Feature
A C++ implementation of the Lox programming language. This is an interpretation of the C implementation of clox in Section III of Bob Nystrom's site Crafting Interpreters.
As the project grows, a standard library and new language features will be added. Expect this implementation to deviate from the original Lox specification in the future.
To get a local copy up and running follow these simple steps. The instructions assume you are on a Linux or Unix-like system. I can verify this will work on macOS as well.
Cloxplus requires the {fmt} and Catch2 libraries to be installed and able to be found by cmake.
- {fmt} - Download and unzip the library first. You can follow the latest instructions or try:
$ cd fmt-7.0.3 # Change to the library directory
$ mkdir build
$ cd build
$ cmake ..
$ make
$ make test
$ sudo make install
- Catch2 - Follow the latest instructions or try:
$ git clone https://github.com/catchorg/Catch2.git
$ cd Catch2
$ cmake -Bbuild -H. -DBUILD_TESTING=OFF
$ sudo cmake --build build/ --target install
- Clone the repo
git clone https://github.com/bigangryguy/cloxplus.git
- Install prerequisites (see above)
- Create your build files (run these commands in the cloxplus root directory)
$ cmake -DCMAKE_BUILD_TYPE=Debug -G "YOUR_PREFERRED_IDE" PATH_TO_SOURCE
For now, reference the Lox grammar appendix on the Crafting Interpreters site. In the future, as cloxplus adds new features and forks from the original language specification, a full grammar reference will be included here.
See the open issues for a list of proposed features (and known issues).
- Complete the virtual machine
- Implement the language
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
David Wilcox - @davidtwilcox - [email protected]
Project Link: https://github.com/bigangryguy/cloxplus
- Bob Nystrom - Author of Crafting Interpreters