CS 4980 CC: Assignment 2

The goal of this assignment is to give you experience using SableCC and regular expressions to specify lexemes for a simple programming language.

The textbook defines a language it calls "MiniJava". See the appendix for basic information. You are being given a starting point of some code to recognize the complete set of tokens in this language; the goal is to extend this to cover additional cases. The two files you are being given are

When complete, your solution should work on the following test files: (These cases are also used by esubmit.) To get it to work on these examples, you will extend mjava.grammar to include a number of missing tokens such as while. You will also extend it to allow multi-character identifiers, multi-digit numbers, and more types of comments. esubmit will have additional test cases; remember you can download all test cases directly from esubmit. For full credit, your solution must have no differences for any tests; this may mean adjusting the names of tokens in your mjava.grammar file so that you match the printed names in the output.

Submit your solution to esubmit.msoe.edu. If you are on campus, you can access the server directly. If you are off campus, you must run GlobalProtect to get behind the campus firewall. Log in using your campus username and standard password. Then browse to cs4980cc-h, select as2lexer as the assignment, submit Main.java as the "main", and add mjava.grammar as an additional file. Click on the Submit button and it will build and test your code.

Notes and Additional Requirements