CS 5363 Programming Languages and Compilers
Translating Functions and Parameters


Special Note: Several students submitted programs for the last assignment so similar to one another that copying must be suspected. It is completely all right to discuss the assignment with others and even to help out someone else with ideas. You are not permitted to trade code. It is completely unacceptable to submit a program that you did not write and do not understand as your own work, even if it has extensive trivial changes: changing variable names, recommenting, reformatting, and making other trivial alterations. In such a case I will take official disciplinary measures.

Initial Work on Assignment: This is the final assignment translating the language described by the recursive descent parser into MIPS assembly code.

This assignment deals only with function definitions and function calls. We will leave the exponentiation operator ^ unimplemented. This assignment can still use single-character identifiers and single-character integers.

Portions of the Grammar to Implement (new features with this assignment are highlighted in red bold below):

Sample Source: So far I've only supplied one source program involving functions:

This is a recursive greatest common divisor algorithm. Here is a similar non-recursive version that does the extended gcd algorithm (although only returns the gcd):


Issues arising during compilation:

What to turn in: You should turn in the program source with extra introductory documentation. You should show runs of the two sample programs above, along with the MIPS output for one of them. In case you can't get your program to work for the source above, but can for simpler source, just turn this in instead. In case the MIPS code looks OK but doesn't run or doesn't run correctly, you should still turn in the program and the MIPS output for substantial partial credit. In case you have worked on the assignment, but have nothing that executes correctly, you should still turn in what you have (with an explanation in the introductory documentation) for partial credit.

The introductory documentation is required and must be in "bulleted" form, rather than long paragraphs of discussion, and must not be hand-written. It should answer the various questions that I would naturally be interested in about your program:


Revision date: 2002-12-01. (Use ISO 8601, an International Standard.)