In this project, we create a new programming language similar to C and design its compiler using LLVM.
-
Type your code in the
input.txtfile. For instance:int x = 0; int i, j; for (i = 1; i <= 5; i++) { for (j = 1; j <= 5; j++) { if (j % 3 == 1) { x += j; } else if (j % 3 == 2) { x += i; } else { x += i + j; } } } print(x);
-
To build the compiler, use this script.
./makeBuild.sh
-
To view the output of the code, run the script provided:
./makeRun.sh
-
To enable optimizer you should set the variable
optimizeto true.bool optimize = true;