CS 453 Programming Assignment #5 — MeggyJava local and member variables and assignmwent
Due Tuesday April 16 (by 11:59pm)
Introduction
This assignment can be done with your CS 453 programming partner.
For PA4, PA5, and PA6 joint and separate partner reports are required
if you are working with a partner (see below for details).
The joint report should be put in the README file and the
separate reports should be emailed to cs453@cs.colostate.edu.
Both are due with the assignment itself.
The partner joint and separate reports will be worth 10% of the programming
assignment grade for those of you working with a partner.
In this assignment you will be writing a compiler for the
PA5
subset of the MeggyJava language that includes local and member
variable declarations and assignment statements.
The main addition in terms of
functionality will be handling of classes, local and member variables,
and
the equality operator for references.
Variable declarations of type button, and hence assignments to button
variables, are not supported in MeggyJava.
You will
- add the PA5 grammar rules to the parser,
- and update the visitors to handle the new language
features.
You will need to extend the type checking for objects and (instance and local) variables.
Here are some example programs:
PA5loc.java and
PA5obj.java.
The Assignment
Your Makefile from PA4 creates a jar file, MJ.jar, that can be executed as follows:
java -jar MJ.jar InputFile.java
The input files can be any PA5 MeggyJava program. Start with the above simple examples.
Ultimately, the PA5 test cases you wrote for PA1 and
PA5PaddleBall.java are possible test cases for MJ.jar.
The output file named InputFile.java.s should be an AVR assembly program that using
the
provided build process will run on the MeggyJr device.
Additionally, the InputFile.java.s file must be such that we can run
it through the AVR simulator.
Errors found while type checking and building the symbol table
Your compiler should produce error messages for doubly defined symbols, e.g.
for PA5dupnameserror.java:
[23,16] Redefined symbol A
[27,17] Redefined symbol run
[40,16] Redefined symbol B
[45,17] Redefined symbol foo
[51,21] Redefined symbol run
[57,7] Redefined symbol A
Errors found while building symbol table
Code Generation
Your build symbol table visitor now annotates the instance and local variables
in the symbol table with offset and base information.
This information is used by the
AVR code generator to handle the new language features.
Design, implement, and test the symbol table and related classes step wise.
Submitting the Assignment
Report and Evaluation of Partner Work
The partner joint and separate reports will be worth 10% of the programming
assignment grade for those of you working with a partner.
- (joint) For each of PA4 through PA6, write a planning paragraph and
timeline together and submit with your assignment.
- Who is going to do what? The plan and the reality.
- How is the testing going to be done? What actually happened.
- Timeline for finishing portions of assignment.
- Meeting schedule.
- (separate) Email cs453@cs.colostate.edu for each of PA4 through PA6
an assessment of the partner work by the deadline of the assignment.
The assessment should be approximately 1/2 a page with information about
the following:
- What are some organizational strategies that you and your
partner are using that are working well?
- Specifically how did you and your partner divide the work?
(e.g., I wrote the type checker for the following set of grammar
rules...).
- How could the division of work between the partners
be improved?
- How could the interaction between the partners be
improved?
- Your joint and separate evaluations will be graded based on the
following criteria:
- Have all of the relevant questions been addressed in a
thoughtful manner.
- How well do the reports match in terms of the partners both
understanding who is doing what.
- Clarity and succinctness of the writing.
- There will be a subjective evaluation of how well the partners
attempted to make the group programming experience work.
Usual Late Policy
Late assignments will be accepted up to 48 hours past the due date for a 10%
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.
mstrout@cs.colostate.edu, 3/12/13, updated 3/25/13