A pedagogical attempt at recreating a chunk of LLVM's infrastructure from scratch.
Currently PANNICC supports the following subset of C:
- Variables and variable declarations
- Operators
- Assignment (=, +=, -=, *=, /=, &=, |=, ^=)
- Arithmetic operators (+, -, *, /)
- Shift operators (<<, >>, <<=, >>=)
- Some bitwise operators (&, |, ^)
- Some unary operators (+, -, ~)
- Pointer operators (&, *)
- Functions and scopes
- Some control flow (if, else, while)
- Return statements
- Pointers (just int***... for now)
- Comments
Refer to the grammar in the parser for more specifics.
This section assumes you are working in a unix environment.
Clone the repo:
git clone git@github.com:Golf0ned/PANNICC.git
cd PANNICC
To build and run tests, run:
make
To add to path, run:
source enable
To view the help message, run:
pannicc
When writing programs for PANNICC, there are a few things to note:
- The subset of C supported is very limited (see Language Support)
- Since the C standard library uses a lot of features not yet supported by PANNICC, use the runtime library instead.
The best way to support this project is by sponsoring me.
You are free to submit any issues or bug reports that you may encounter on GitHub. You are also free to submit new tests in the Discord.
Due to the pedagogical nature of this project, pull requests by users other than me (@golf0ned) that implement/fix compiler functionality will likely be closed.
If you still wish to submit changes anyways, there is a git hook to enforce formatting. You can install it with:
git config --local core.hooksPath .githooks/