Extra Code -- Homework 3

Converting BigRig Programs to 3-Address Code


810:155
Translation of Programming Languages



OUT: Thursday, April 28
DUE: Friday, May 8



Background

In Session 23 and Session 24, we learned about three-address code as an intermediate representation between the AST and the target code. This assignment gives you a chance to practice representing programs in three-address code even though you will not write code for your compiler that generates three-address code.



Tasks

Write a three-address code version of the BigRig program primes, which computes prime numbers in a range using brute-force.

Use the three-address code elements defined in Session 23. If you need to create a three-address code element not defined there, be sure to describe it in your write-up.



Miscellaneous Notes

This is an individual assignment. While you may certainly discuss the assignment with others, you must write your own three-address code.



Deliverables

By 12:00 noon on the due date, submit the following:

Make your electronic submission using the on-line submission system.



Eugene Wallingford ..... wallingf@cs.uni.edu ..... April 28, 2009