[Skip to Body]
Primary:
[Front Door]
[Schedule]
[Piazza]
-
[Academic Honesty]
[Instructions]
Current:
[Current Outline]
[Current EBoard]
-
[Current Assignment]
[Current Lab]
Groupings:
[Assignments]
[Documents]
[EBoards]
[Examples]
[Exams]
[Handouts]
[Labs]
[Outlines]
[Readings]
Related Courses:
[CSC362 2004S (Rebelsky)]
[CSC362 2010S (Stone)]
Misc:
[SamR]
[GNU Coding Standards]
[Dragon Book]
[Pascal Standards]
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:
if_then_statement
;
safe_if_then_else_statement
and
unsafe_if_then_else_statement
;
safe_while_statement
and
unsafe_while_statement
; and
safe_for_statement
and
unsafesafe_for_statement
.
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.
[Skip to Body]
Primary:
[Front Door]
[Schedule]
[Piazza]
-
[Academic Honesty]
[Instructions]
Current:
[Current Outline]
[Current EBoard]
-
[Current Assignment]
[Current Lab]
Groupings:
[Assignments]
[Documents]
[EBoards]
[Examples]
[Exams]
[Handouts]
[Labs]
[Outlines]
[Readings]
Related Courses:
[CSC362 2004S (Rebelsky)]
[CSC362 2010S (Stone)]
Misc:
[SamR]
[GNU Coding Standards]
[Dragon Book]
[Pascal Standards]
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
.