Project | Interpreter | Compiler |
---|---|---|
Current level | 2 | 2 |
Programming C-like language for iLab 2nd course.
by Derzhavin Andrey && Khaidari Farid && Shurygin Anton.
- Cmake
- flex
- bison (3.7 or higher)
After cloning, in root directory of a repo:
mkdir build
cd build
cmake ..
make # -j (optional)
cd ..
After that, in directory you will have two executables: ParaCL
- LLVMIR compiler,
ParaCLi
- interpreter.
Examples are located in directory test
- files .cl
.
Just run in root directory of a project:
./build/ParaCLi PARACL_FIILENAME
Just run in root directory of a project:
./build/ParaCL PARACL_FIILENAME
You will get a file PARACL_FIILENAME.ll
.
After that, for compiling you need
ParaCL standard library which is located in root directory of a project - file pcl_std.cc
.
To compile it, do
clang++ pcl_std.cc ll_file
You will get an executable file a.out
in your current directory. To run it:
./a.out
- Parsing by flex and bison
- Building AST
- Executing or codegeneration of LLVM IR