AssignmentsIn 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 quizes, midterm, and final.
|Post Date||Assignment||Documentation||Due Date||Submission Method||Percentage of Course Grade||1/12/10||HW1||Review 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 example||1/26/10||turn in before class starts||2%|
|1/29/10||HW2||Syntax-directed translation||2/9/10||turn in before class starts||2%|
|1/29/10||PA2||MiniJava and MIPS Warmup||2/17/10||checkin||5%|
|2/15/10||HW3||Visitor design pattern: Email two example visitors that visit the constant expression ASTs you need to generate for PA3 (Yes, this means you need to generate the ASTs before you can do HW3). One of the visitors should print the AST nodes in a depth-first pre-order, and the other visitor should print the nodes in a depth-first post order. Your example including source code should be packaged in a jar file, and your email should indicate how to run the example on constant integer expressions.||2/24/10||email before 11:59pm||2%|
|2/15/10||PA3||MiniJava Expression Evaluator||3/3/10||checkin||5%|
|3/1/10||HW4||Control Flow: Exercises 6.6.1a and 6.6.4 in book||3/26/10||turn in before recitation starts||2%|
|3/1/10||PA4||MiniJava: expressions, assignments and printfs||3/24/10||checkin||5%|
|3/29/10||HW5||PA5 test cases: with your partner, submit via email to Michelle 1 correct and 3 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 compiler||4/1/10||turn in before class starts||2%|
|3/24/10||PA5||Control flow and boolean expressions||4/7/10||checkin||5%|
|4/21/10||HW6||Parse tables: show the LR(1) state diagram and the LR(1) parse table for the following grammar S -> S S ^ | S S @ | a||4/27/10||turn in before class starts||2%|
|4/21/10||PA7||Arrays and classes||5/5/10||checkin||5%|
|4/2/10||Extra Credit||Extend your compiler (can be done with group) (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, (c) to generate x86 assembly for a subset of MiniJava, (d) to generate working Java bytecode, or (e) some idea you discuss with Michelle ahead of time. The extended compiler will need to be accompanied by a 2 page writeup describing what you did and evaluate it. For example, if you do register allocation, you can describe the register allocation strategy you used and show how performance improves.||5/14/10||checkin||up to 5% extra|