Project #2: Scanner

Submit: Turn in your Scanner.java source file using the turnin command on morbius.mscsnet.mu.edu or one of the other Systems Lab machines.

Work may be completed in teams of up to three students. Be certain to include all team members' names in the file. Include a comment block at the very top of each file that contains the following:

/**
 * COSC 4400 - Project 2
 * Explain briefly the functionality of the program.
 * @authors [your names]
 * Instructor [your instructor]
 * TA-BOT:MAILTO [your email addresses]
 */

The Scanner

Implement a Scanner for our dialect of the MiniJava programming language, as detailed below.

The Language

The Scanner should take a MiniJava program file name on the command line and write the token stream to stdout with a single token on each line. To capture the output to file, use the UNIX redirect operator:

javac Scanner.java; java Scanner < program.java > tokenStream.out

The tokens to be handled are listed below:

The exact names of all tokens can be found by running your testcases against the reference implementation at Morbius:~brylow/cosc4400/Projects/scanner.

There are several errors that you should identify and report. Please try to match error messages exactly.


[back]

[Revised 2020 Aug 28 22:35 DWB]