Assignment 4: Loops: the Loop language
Overview
In this assignment, you will be extending the "Cond" language compiler from the last assignment to create the "Loop" language. This language will add the following features:
- loops (
whilestatements) - mutable variables (
set!statements) - sequence expressions (
beginstatements) - the
Voidtype and the(void)expression
Textbook coverage
This assignment is based on chapter 5 of Essentials of Compilation.
Due date
This assignment is due on Friday, November 14 at 6 PM.
Starting code base
The starting code base is the zipfile ch5.zip, which is posted on the
course Canvas site.
You should unzip this file in your Github repo, inside the src/ directory.
It contains partial implementations of all the code for the assignment.
Inside the ch5 directory will be the usual subdirectories:
-
The
tests/subdirectory contains the test programs for the compiler. -
The
reference/subdirectory contains the output from the instructor's version of the compiler. -
The
scripts/subdirectory contains scripts for testing your code.
README.md file
Create a README.md file in your ch5 directory,
and in it, identify which person wrote which passes.
(If both partners worked on a pass, indicate that too.)
Also, if you used any late days on the assignment,
indicate how many late days you used,
as well as the total number of late days used so far in the term.
New language features
The new language features are described in the textbook and the lectures, but in brief, they are:
- a
Voidtype - new expressions:
while(looping construct)begin(sequencing expression)set!(mutating (re-assigning) variables to new values)
- and a
printfunction has been added.