In this course students get to implement an SVG interpreter for a small subset of SVG (scalable vector graphics) and a compiler for a subset of Java called MiniJava. All the programming in this class will be done with a partner and in Java. During the course of these significant programming assignments (PA#), we will work with many common data structures, implement algorithms, and practice the visitor design pattern. We will also learn about lexing, parsing, and semantic analysis.

Each homework assignment (HW#) will only contain a few questions with the goal of reinforcing the material covered in the reading assignments and in class. The homework questions also represent the kinds of questions that will be in the midterm and the final.

Post DateAssignmentDocumentationDue DateSubmission MethodPercentage of Course Grade
1/18/09HW1Review of regular expressions, context free grammars, and the run-time stack, Dr. Massey's lecture notes on NFA to DFA conversion, note that lambda and epsilon both indicate an empty string, Regular expressions, Deterministic finite state machines, Nondeterministic finite state machines, context-free grammar, stack frame example1/27/09 turn in before class starts2%
2/1/09HW2 Syntax-directed translation2/10/09 turn in before class starts2%
2/2/09PA2MiniJava and MIPS Warmup2/17/09checkin5%
2/19/09HW3Visitor design pattern: Email an example visitor that counts all of the AST node types in the ASTs you are constructing for PA3 (e.g. IntegerExp #3, etc.). Your example should be packaged in a jar file, and your email should indicate how to run the example on constant integer expressions.2/24/09 turn in before class starts2%
2/18/09PA3MiniJava Expression Evaluator3/3/09checkin5%
3/3/09PA4MiniJava: expressions, assignments and printfs3/10/09checkin5%
3/13/09HW4 Control Flow: Exercises 6.6.1a and 6.6.4 in book3/24/09 turn in before class starts2%
3/26/09HW5 PA5 test cases: with your partner, submit via email to Michelle 2 correct and 2 error test cases for PA5, submit the input files, make sure you get the expected output by running the test input files through the reference compiler3/31/09 turn in before class starts2%
3/23/09PA5Control flow and boolean expressions4/7/09checkin5%
4/16/09HW6 Parse tables: show the LR(1) state diagram and the LR(1) parse table for the grammar S -> S S + | S S * | a.4/28/09 turn in before class starts2%
4/20/09PA7Arrays and classes5/4/09checkin5%
4/16/09Extra CreditExtend your compiler (can be done with partner) (a) to handle a language feature that MiniJava doesn't currently have or we didn't implement in class (strings, floats, file I/0 and/or standard input, inheritance), (b) to perform register allocation, or (c) to generate x86 assembly for a subset of MiniJava. The extended compiler will need to be accompanied by a 2 page writeup describing what you did. For example, if you do register allocation, you can describe the register allocation strategy you used and show how performance improves.5/8/09checkinup to 5% extra
Michelle Strout
Last modified: April 20, 2009