CSE P 501 Su04 - Project I - Scanner

Due: Tuesday, 7/6 Thursday, 7/8, at 11:00 pm. You should turn your project in using this online turnin form

Overview

The purpose of this assignment is to construct a scanner for MiniJava. We suggest you use the SableCC compiler generator described in the book, since you will want to interface your code to the LR parser part of this tool. Alternatively, if you want a more traditional Lex/Yacc/Flex/Bison tool set you can use JLex/CUP from the first edition of the book. Links to these tools are on the main CSE P 501 project page.

You will need to examine the source grammar to decide which symbols are terminals and which are non-terminals (hint: remember to include operators, brackets, and other punctuation in the terminal symbols).

You should test your scanner on a variety of files, including some that contain legal programs and others that contain random input. Be sure your scanner does something reasonable if it encounters junk in the input file.

What to Hand In

You should hand in your source files (SableCC or equivalent specification) and some sample source files and the files containing the corresponding token stream that your scanner test program produces. You do not need to hand in the intermediate file(s) produced by by the scanner generator -- machine generated code is generally unenlightening, if it is readable at all.

A turnin form is available online. You can either use it to turn in your files individually, or you can bundle all of your files in an archive (zip, jar, or tar format) and turn that in.