CS362 2011F Compilers

Project, Phase 6: Control Structures

We now have working straight line intermediate code and understand the structure of STAC code.

It is now time to translate control structures.

Edit your pascal.y file so that the productions for the primary control structures generate code for those control structures. You should support the following structures:

You already have code written to translate expressions, so your main tasks are to (1) write procedures to generate labels; and (2) follow the patterns that we developed in class for translating these control structures.

Disclaimer: I usually create these pages on the fly, which means that I rarely proofread them and they may contain bad grammar and incorrect details. It also means that I tend to update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This document was generated by Siteweaver on Wed Nov 30 09:22:39 2011.
The source to the document was last modified on Wed Nov 30 09:22:35 2011.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS362/2011F/Handouts/phase-6.html.

Samuel A. Rebelsky, rebelsky@grinnell.edu