This project consists of a compiler developed in C as a practical work for the "Software Design Workshop" course. The compiler takes as input programs written in the LP Language and generates x86-64 assembly code.
The project has the following folder structure:
- src/: Source code of the compiler divided into modules
- backend/: Intermediate and assembly code generation
- error-handling/: Error handler
- frontend/: Lexical, syntactic and semantic analysis
- structures/: Data structures used
- tests/: Test suite
- accept/: Valid test cases that should be accepted
- reject/: Invalid test cases that should be rejected
- build.sh: Script to build the compiler
- test.sh: Script to execute the test suite
- loopi.sh: Script to compile, link and execute .lp programs
- report/: Documentation and project report
The following dependencies are required to build and execute the compiler:
- CMake >= 3.10
- C Compiler (GCC recommended)
- In some cases g++
./build.sh
This will generate the Compiler executable inside build/ that can be used to compile .lp programs.
./test.sh
Test results will be informed via standard error output.
./loopi.sh path/to/program.lp
For example, to execute tests/accept/test_fib.lp:
./loopi.sh tests/accept/test_fib.lp
The report/ folder contains a detailed report of the project development, configurations, relevant decisions and limitations.
- Brenda Dichiara
- Lucio Mansilla