This repository contains the compiler designed in C following the language specifications provided in Language Specifications.pdf , as part of the course Compiler Construction at BITS Pilani.
The compiler parses input files according to the language specifications, and if the input is syntactically and semantically correct, it is capable of generating corresponding assembly-level code. Some testcases have been provided in Compiler/testcases.
As required for the project, the code is compatible for GCC version 5.4.0. and has been tested on Ubuntu 16.04
To run it on Windows, you will have to use cygwin.
cd Compilermake- This will create an executable file named compiler
- Ensure you are in the directory containing the compiler executable
- Run
./compiler <RELATIVE_PATH_TO_TESTCASE_FILE> <NAME_OF_ASM_FILE> - Choose among the 11 options to test the feature you want.
- To create assembly-level code , choose option 10.
- Choose option 0 to exit. (Ctrl + C would result with no output in the ASM file)
- To run the asm file
nasm -felf64 code.asm && gcc code.o && ./a.out(Using code.asm as the name of the asm file in this example)
The team members of this project were:
- Aashish Singh
- Gunraj Singh
- Venkat Reddy
- Arnav Sailesh
