CSCI 310 Spring 2004, Project 3

Use sableCC to build an LALR(1) parser for our minijava grammar.

There are conflicts throughout the grammar and you'll need to work on rewriting the grammar in ways that make it non-ambiguous and parseable in an LR manner.

It is important that you think about the semantics of the language so your re-writing does not change the intent of java.

You'll need to modify your sable file from project 2 to do this. here is an example sable file for grammar 3.30 in the text. The grammar is not LALR(1) so it doesn't work completely, but it shows the format.

Notice in particular that

testing the parser

MainParser is an example using the parser. The main issue here is packages so make sure I mention this in class. :-) (Hah, did you think I'd just let you be comatose? :-))
Gary Lewandowski
Last modified: Mon Feb 14 09:51:26 EST 2005