Chapter 7: Syntax-Directed Translation


Getting Started (5 minutes)

In each of the following sections, go as far as you can in the time allotted, but move on to the next section so you'll have a chance to work on each section while in studio.

Warm Up: (10 minutes)

  1. Follow the instructions for ant builds.
    The ant build is relatively complex for this studio. Take a look at the build.xml file if you have time.
    • As you work on each of the problems below, simply rerun the ant build, and the results will be displayed on the console. (Recall you can click on the toolbox green button to rerun the build.)
    • If things seem to be messed up, run the clean task followed by the default (run) build, and that should fix any problems.
  2. Open the CUP User Manual for quick reference.

Main Problems

You will consider a sequence of problems to be solved by bottom-up parsing. This studio also includes a preview of the syntax-directed parsing material from Chapter 7, which means that we will be translating inputs into some form as we parse.

Your work will be done in the various cup files found in the root directory for this studio.

Part 1 (20 minutes)

Part 2 (20 minutes)

Part 3 (20 minutes)

Finishing Up

Submit your work as directed by your instructor.

Copyright 2010 by Ron K. Cytron
Last modified 14:32:05 CDT 13 August 2010