Contents

Software engineering project | Ensimag's Project

What is the project about ?

The goal is to build in Java a compiler with no default for a language called Deca (Java like language)

The compilation process is divided into 3 steps :

  • The syntax analysis (Lexer and Parser)
    • input : source program
    • output : primitive abstract tree
  • The contextual verification
    • input : primitive abstract tree
    • output : abstract tree decorated
  • The code generation for an abstract machine
    • input : abstract tree decorated
    • output : assembly program

Finally, the project is also composed of a theme of our choice. We decided to make our compiler also generate Java Bytecode.

I teamed up with 4 other students for this project.

It was the perfect occasion to use the Scrum agile technique. We divided the work into 5 sprints, and we had a daily meeting every day at 10AM. We decided to use test driven developpement to make sure we had the lowest number of errors in the compiler, but also to always be ready to give a working but not finished compiler. We used gitlab CI/CD and unary and software tests to generate a convenient test structure, built with more than 800 tests.

A part of the project consists of lowering float operations errors,. In fact, due to the way floats are stored in memory, there are always errors when computing, but we want it to be as negligible as possible.

The two main subjects were formal language and developing, but the project also requires algorithmic, maths, OOP knowledge.

We used Maven to handle every dependency of the projet, ANTLR for the Lexer and Parser and Jacoco to check the test coverage.

The final product

We successfully deliver on time the compiler 🤑!
Even though there were still errors and deviations from what was expected, our compiler was still close to what was expected.
We were also asked to deliver an energetic analysis (6 pages), a team management review (13 pages), a project review (13 pages), the software development documentation (12 pages), a user manual (12 pages) and finally a documentation for the Bytecode part of the compiler (23 pages) which contains a bibliographic research and a development documentation.

Some more info?
The compiler is more than 16000 lines long and the test bench is more than 18000 lines long 😄