Assignments

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 quizes, midterm, and final.

Post DateAssignmentDocumentationDue DateSubmission MethodPercentage of Course Grade
1/12/10HW1Review 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/26/10turn in before class starts2%
1/12/10PA1MiniSVG2/3/10checkin10%
1/29/10HW2Syntax-directed translation2/9/10turn in before class starts2%
1/29/10PA2MiniJava and MIPS Warmup2/17/10checkin5%
2/15/10HW3Visitor 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/10email before 11:59pm2%
2/15/10PA3MiniJava Expression Evaluator3/3/10checkin5%
3/1/10HW4 Control Flow: Exercises 6.6.1a and 6.6.4 in book3/26/10 turn in before recitation starts2%
3/1/10PA4MiniJava: expressions, assignments and printfs3/24/10checkin5%
3/29/10HW5 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 compiler4/1/10turn in before class starts2%
3/24/10PA5Control flow and boolean expressions4/7/10checkin5%
4/4/10PA6Functions4/21/10checkin5%
4/21/10HW6 Parse tables: show the LR(1) state diagram and the LR(1) parse table for the following grammar S -> S S ^ | S S @ | a4/27/10turn in before class starts2%
4/21/10PA7Arrays and classes5/5/10checkin5%
4/2/10Extra CreditExtend 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/10checkinup to 5% extra
Michelle Strout
Last modified: April 21, 2010