Compilers (CS362 2004S)

Project, Phase 4: Translation to PAL

Assigned: Friday, 23 April 2004
Due: Friday, 7 May 2004

Summary: In this stage of the project, you will translate your parse trees into a simple intermediate code, PAL.

Group Work:

Core Assignment

Write a translator that traverses parse trees for a selected subset of Pascal programs and translates them to PAL. You should then print out the corresoponding PAL program (preferably to a file) and run it.

Your translator should deal with integer, real, and Boolean types as well as arrays of those types. You need to handle conditionals, assignment (with all types of expressions except record and arrays), procedure calls, function calls, while loops, and repeat loops.

You need not handle case statements, records, labels and gotos, pointers, variable parameters, array parameters, for loops, or nested function or procedure definitions.

You can assume that the program is type correct and that all variables are declared.

You can find information on PAL in the lab on PAL. You can find sample translation strategies in the lab on translation.

Extra Credit

For extra credit, do more than the minimum.

 

History

Friday, 1 November 2002 [Samuel A. Rebelsky]

Friday, 8 November 2002 [Samuel A. Rebelsky]

Friday, 23 April 2004 [Samuel A. Rebelsky]

 

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 Mon Apr 26 13:19:34 2004.
The source to the document was last modified on Mon Apr 26 13:19:29 2004.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS362/2004S/Project/translator.html.

You may wish to validate this document's HTML ; Valid CSS! ; Check with Bobby

Samuel A. Rebelsky, rebelsky@grinnell.edu