Assignment 7: Mutable variables
1 Problem description
2 Submission
7.2

Assignment 7: Mutable variables

Due: Fri 03/01 at 9:00pm

1 Problem description

All real programming languages have mutable variables, right? So why doesn’t ours?

Building off of Taipan (and assuming that your implementation of Taipan was flawless and implemented all features according to the specification), add support for mutable variables. Additionally, because mutation is primarily useful as a statement rather than an expression, add sequencing of expressions to your language (similar to ML’s semicolon operator). Consider all the necessary changes to our compiler toolchain to implement these features.

  1. In written form (i.e. primarily English, not ML/C/assembly), explain at least the following:

    • Concrete syntax, in the style of the grammars given in the lecture notes or assignments (you do not need to provide a modified parser.mly file), of any new expression(s) you add

    • Abstract syntax expressions

    • Semantics for the new expression(s) you add, in the form of short example programs demonstrating the behavior, and/or invalid programs demonstrating problems

    • Explain which phases of the compiler are affected, and explain what changes are necessary to each phase.

    Your submission should be roughly 1–2 typed pages. Any longer is probably too detailed and probably missing the higher-level design point; any shorter is probably missing some important information.

2 Submission

Wait! Please read the assignment again and verify that you have not forgotten anything!

Your submission should be either a plain text file (please make sure your paragraphs are line-wrapped neatly), a markdown file (again, neatly formatted), or a PDF file. Do not submit actual implementations.

Please submit your homework to https://handins.ccs.neu.edu/ by the above deadline.