CSE P 501 Project II - Parser

Due: Tuesday, July 13 by 5pm. Turnin your project using this turnin form.

Overview

For this assignment, construct a parser (recognizer) for MiniJava. You should use a parser generator tool that interfaces with your scanner (SableCC or CUP, assuming you are doing the project in Java). You should use a LALR (bottom-up) parser tool unless you have discussed doing something different with us. Be sure that your parser and scanner together can successfully parse legal MiniJava programs.

At this point, don't include any semantic actions in the parser.  Feel free to experiment with extensions or syntactic error recovery if you wish, but be sure to get the basic parser working first.

Details

You may need to massage the MiniJavagrammar to make it LALR(1) so that CUP can use it to produce a parser.  Please keep track of the changes you make and turn in a description of them with this part of the project (see below). Take advantage of precedence and associativity declarations in the parser specification to keep the overall size of the basic grammar small.

Your grammar should not contain any reduce-reduce conflicts, and should have as few shift-reduce conflicts as possible.  You should describe the remaining shift-reduce conflicts in your writeup.

You should test your parser by processing several MiniJava programs, both correct ones and ones with syntax errors. At this point your compiler will only indicate a successful parse or a syntax error.

As part of your testing, you should write at least two new MiniJava programs. Not only will this be useful for testing, but it will also help you be sure that you understand what is included in the MiniJava subset of Java and what is missing.

What to Hand In

Turn in at least the following:

You may turn in an archive containing your project if you wish. Be sure the writeup and test programs are easy to find if you do this.

If you are working with others, you should turn in only one copy per group, listing the group members in the same order each time you turn it in. (Multiple turnins are fine - we'll grade the last one you give us.)