Exploration of a Simple Compiler
- CaC, Chapter 2 (all)
For this assignment, you will need the studio2 source code (link), provided by the authors of our text.
The authors of our text have provided Java implementations of the pseudocode examples given throughout the book. The complete source code repository is available at http://www.cs.wustl.edu/~cytron/cacweb/. We will not, in general, use this code in our own projects, but they are good supportive learning resources.
Set up an Eclipse project
Save the studio2.zip file in your working directory, open Eclipse, and install the project in your Eclipse workspace:
- Existing Projects into Workspace
- Select archive file:
For this "getting started" assignment, you are to follow the instructions for the CaC "Studio 2" work, given at http://www.cs.wustl.edu/~cytron/cacweb/Chapters/2/studio.shtml
We will not usually follow the outline of our textbook this closely, but it is helpful to get a high-level view of the structure of our project before we dive in.
(Problem 2.2) Modify the Java implementation of the ac scanner (Figure 2.5, on page 40) as follows:
- A floatdcl can be represented with either the "keyword" f> or float.
- And intdcl can be represented as either i or int.
- A num can be given in exponential (scientific) form. Specifically, a num can be given with a signed or unsigned exponent suffix. For example, 1.0e10, 123e-22, 0.31415926535e1, and so on.
This work must be done individually. You are free to discuss any aspect of your investigation with your colleagues in the class, but the work you submit must be your own.