An LLVM based C-like language compiler
To build this repo, you need:
- LLVM 10.0.0
- Flexc++ 2.07.07
- Bisonc++ 6.03.00
Use commands below to install:
sudo apt install llvm-dev
sudo apt install flexc++
sudo apt install bisonc++
Use commands below to build:
git clone https://github.com/ClubieDong/C-Compiler.git
cd C-Compiler
./build.sh
The generated executable file accepts only one argument, the C-language file:
build/exe <file>
It outputs:
- <file>.lex, which contains the result of scanner
- <file>.ast, which contains the Abstract Syntax Tree(AST)
- <file>.ir, which contains the generated LLVM IR code
Directory tests
contains all test cases, use test.sh
to run one of those, for example:
./test.sh Basic/Test1
The project is licensed under MIT license.
Email: 810443053@qq.com