Skip to content

106-inc/ParaCL

Repository files navigation

ParaCL

GitHub repo size GitHub last commit GitHub lines

Project Interpreter Compiler
Current level 2 2

Programming C-like language for iLab 2nd course.

by Derzhavin Andrey && Khaidari Farid && Shurygin Anton.

Install

Requirements

  • Cmake
  • flex
  • bison (3.7 or higher)

Installation

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.

Usage

Interpreter

Just run in root directory of a project:

./build/ParaCLi PARACL_FIILENAME

Compiler

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

How it works

  • Parsing by flex and bison
  • Building AST
  • Executing or codegeneration of LLVM IR