CSE 401/M501 - Project V - Compiler Additions

Due: Thursday, December 5 at 11 pm. You will "turn in" your project as you did with previous assignments by pushing it to your GitLab repository and providing a suitable tag. The final code and tag must be committed and pushed by the deadline. See the end of this writeup for details.

Overview

For the final part of the project, extend your MiniJava compiler by adding support for IEEE-754 64-bit floating point numbers. The support should include the new type double, floating-point constants, output, assignment, and basic arithmetic operations. You do not need to implement conversions between ints and doubles; the doubles essentially live in a parallel numeric universe similar to that occupied by ints, but not interacting with them.

As with the rest of MiniJava, the resulting language should be a proper subset of standard Java, and programs executed with your MiniJava compiler should have the same behavior that they have when executed using javac/java.

You should make appropriate changes to your compiler to scan, parse, type-check, and generate code for programs that use these new floating-point additions.

You should continue to use your CSE 401 gitlab repository to store the code for this part of the compiler project.

Requirements

Restrictions and simplifying assumptions

Implementation

Extra credit

As with the rest of the compiler project, a small amount of extra credit will be awarded for extensions that go beyond these basic requirements. However, do not attempt extra credit extensions until you have the required compiler addition working properly. Extra credit will not be awarded to projects that do not include a substantially correct implementation of double. Some possibilities:

What to Hand In

As with previous parts of the project you should include a brief file, called additions-notes.txt this time, in the Notes/ top-level directory of your project describing anything unusual about your project, including notes about extensions, clever code generation strategies, or other interesting things in this phase of the compiler. You should give a brief description of how much is working and any major surprises (either good or bad) you encountered along the way. In particular, this phase of the project will involve making changes to previously implemented parts of the compiler. Include a brief description of what was done and why it was needed, and whether there were any unanticipated changes required. This file should only discuss this phase of the project. After finishing the project code you will be asked to prepare a (short) summary report about the entire compiler project. Details will be supplied in a separate assignment.

As before you will submit this part of the project by pushing code to your GitLab repository. Once you are satisfied that everything is working properly, create a additions-final tag and push that to the repository. Then we strongly suggest that you create a fresh clone of your repository in some completely different temporary directory, checkout the additions-final tag, and verify that everything works as expect. If necessary, fix any problems back in your regular working copy of the code, push the changes to the repository, and update the additions-final tag to refer to the correct commit in the repository.

Be sure that your boot.c runtime code is in src/runtime/boot.c, and that the number_converter.h and number_converter.c files are also copied into this directory. We will use your versions of these files to compile and test your compiler.