DSL Compiler

The goal of this project was to create a compiler for the WHILE language. As a challenge, we choosed to compile to an assembly language.

05/11/2018 - 27/01/2019  xText, xTend and NASM
Project of COMP course by Olivier RIDOUX

The first part of this project was to create a pretty-printer for the WHILE language. Since a pretty-printer is not more than a WHILE-to-WHILE compiler, this part of the project let us understand the basic process of compiling and also let us the time to choose the assembly language that will be our target for this project.

Since we worked on the TASM Assembler we thought about using this one, but it was only for 16-bits architectures and we wanted to be able tu run the program directly on our computer. We searched for an equivalent assembly language and we found the NASM Assembler. This assembly language use, as well as TASM, the intel syntax and can be used to write programs for 32 and 64-bits architechtures.

In the second part of the project, we had to create a first compiler that can compile a subset of the WHILE language. In fact, we knew that the program would contain only one function and no multiple variables assignment. It was in this part that the main issues were raised.