This is the compiler frontend for the orchid language.
The frontend responsibilities are to:
- Tokenize a file
- Parse the tokens into an AST
- Analyze the AST for errors
- Optimize the AST to not recompute constants
Contributions are always welcome!
Here is a step-by-step guide on how you can contribute!
- Read the
CONTRIBUTING
file so you know what you want do is actually something that is wanted or possible. - Fork the repo.
- Create a new branch. (
git checkout -b feature
) - Make, commit, and push your changes.
- Create a pull request with your changes!
This is a guide to just build the frontend.
The recommended way is to use Microsoft Visual Studio 2022 (You can probably use any version but that is what it was made with).
From there you can open the project, then use the build in build tools.
The build tools should be in the bar on the top of the screen :)
To compile the code on linux (or without visual studio) you need to have g++ 13 or later installed.
on debian based systems you can install it like this:
sudo apt update
sudo apt install g++-13
You also need to have cmake installed, this can be done on debian based distros with
sudo apt install cmake
To build the project you can make a directory called out
, enter it, then run cmake.
mkdir out
cd out
cmake ..
Then you can build the project to manually test with make.
make frontend
You can build the tests with
make lexer_tests
Then run them with
make test
You can view all the make targets if needed with make help
.
The orchid compiler frontend is licensed under the Mozilla Public License 2.0 (MPL 2.0).