Skip to content

A transpiler that converts custom AdvCalc language to LLVM-IR by using grammar parsing, developed within CmpE 230 in Bogazici University.

Notifications You must be signed in to change notification settings

mberkturgut/LLVM-IR-Transpiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CmpE230-Parser

This is an advance calculator performing the following basic & bitwise operations:

Operation Explanation
a + b Returns summation of a and b.
a * b Returns multiplication of a and b.
a - b Returns the subtraction of b from a.
a & b Returns bitwise a and b.
a | b Returns bitwise a or b.
xor(a, b) Returns bitwise a xor b.
ls(a, i) Returns the result of a shifted i bits to the left.
rs(a, i) Returns the result of a shifted i bits to the right.
lr(a, i) Returns the result of a rotated i times to the left.
rr(a, i) Returns the result of a rotated i times to the right.
not(a) Returns bitwise complement of a.

It takes inputs via an interpreter. It parses the input through a grammar that supports variable assignment, retriaval and expressions in parentheses. For more information refer to the project report.

image

To run the program simply compile advcalc.c, which will give you the interpreter mode. You can also run it on a text file via terminal (input.txt provided as an example) by the following command:

./advcalc < input.txt

About

A transpiler that converts custom AdvCalc language to LLVM-IR by using grammar parsing, developed within CmpE 230 in Bogazici University.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published