|
Compiler Project (Group 14)
This is a compiler built for a toy language as a part of the course CS F363 - Compiler Construction.
|
This project is a custom-built compiler designed to process a toy programming language as a part of the course CS F363 - Compiler Construction. The compiler consists of two phases, including lexical analysis and syntax analysis. It takes source code as input, processes it through these stages, and outputs either a Parse tree or meaningful error messages. The project is implemented in C.
make to build the project../bin/prog.exe to execute the project.make → Compiles the project, generating prog.exe in ./bin/. make test → Compiles and runs tester.exe with test_target.exe. make docs → Rebuilds documentation and launches the website locally. make clean → Removes all object files and executables. make debug → Compiles prog.exe and runs it with gdb for debugging. make help → Displays all available options. To execute the compiler, use:
where:
<testcase>.txt → Path to the file containing the source code. <output>.txt → Path to the file where the generated parse tree will be saved. Once executed with valid arguments, the program presents a menu with the following options:
0 → Exit the program. 1 → Remove comments and display the comment-free code. 2 → Print the token list generated by the lexer. 3 → Parse the input code and display the parse tree. 4 → Print the total execution time of the program. The contributing members are