Skip to content

Golf0ned/PANNICC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

693 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PANNICC: Prototype And Non-Negligibly Instructive C Compiler

A pedagogical attempt at recreating a chunk of LLVM's infrastructure from scratch.

Language Support

Currently PANNICC supports the following subset of C:

  • Variables and variable declarations
  • Operators
    • Assignment (=, +=, -=, *=, /=, &=, |=, ^=)
    • Arithmetic operators (+, -, *, /)
    • Shift operators (<<, >>, <<=, >>=)
    • Some bitwise operators (&, |, ^)
    • Some unary operators (+, -, ~)
  • Functions and scopes
  • Some control flow (if, else, while)
  • Return statements
  • Comments

Refer to the grammar in parser.cpp for more specifics.

Installation/Usage

Clone the repo:

git clone git@github.com:Golf0ned/PANNICC.git
cd PANNICC

To build and run tests, run:

make

To view the help message, run:

./build/bin/pannicc

Contributing

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/

Star History

Star History Chart

About

Prototype And Non-Negligibly Instructive C Compiler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

 
 
 

Contributors