CS 453 Homework Assignment #8 — Symbol Table Design and Programming
For PA4, your compiler will need a symbol table data structure
that it passes around with the AST. For HW8, you will be doing the following:
- Designing and implementing a Symbol Table for the PA4 MeggyJava grammar.
Design this Symbol Table on your own. The Symbol Table should consist
of some set of data structure definitions in Haskell and functions that
manipulate the Symbol Table data structure.
- Illustrate with Haskell code snippets how to use your Symbol
Table data structure to do the following:
- Reflect on your design and implementation. How might you want to
add to the design or modify it for the PA5 grammar where there are member and
local variables? For this <1/2 page paragraph, you can talk with other
people in the class and compare designs (but it is not required).
Groups for HW8
There should be NO groups for HW8. Resist the urge to collaborate
until you have a design and implementation for symbol table.
Prove to yourself that you can do it.
You can create a github repository for HW8
by going to the HW8 assignment in the
github classroom for cs453.
Submitting the Assignment
For this assignment, you are going to create a text file called HW8.txt
where you introduce and present your Symbol Table data structure and
your code snippets that show how to use its functionality.
To present your Symbol Table data structure, include the actual
Haskell code that declares that data structure "data SymTab = ... deriving(Show)"
in HW8.txt.
Also show the type signatures for the required functionality and examples
of how you would use it for the following MeggyJava program:
import meggy.Meggy;
class PA4ByteToIntParam {
public static void main(String[] whatever){
Meggy.setPixel((byte)(new Other().foo( (byte)4 )),
(byte)1, Meggy.Color.GREEN) ;
}
}
class Other {
public int foo( int a ) {
return a + 3;
}
}
You will also have a paragraph that evaluates your
design and implementation in terms of what changes might be
needed to use it in PA4 and/or PA5.
If you compared your design with someone else in the class, then
specify who.
The text file should be about 2 pages. Use full sentences and work
on making the two pages easy to read.
Submit your HW8.txt file using turnin on lectura.
turnin cs453HW8 HW8.txt
Grading
The grade will be based on whether your writeup includes all requested
pieces and the readability.
Late Policy
Late assignments will be accepted up
to 24 hours past the due date for a 20%
deduction. The assignment will not be accepted past this period.
Late means anything after 11:59pm
on the day the assignment is due, including 12 midnight and 11:59pm and one second.
mstrout@cs.arizona.edu, 10/31/16