CSE5317/4305 Project #1 (Scanner)

Due Thursday February 12 before midnight

Worth 10% of your project grade

This project must be done individually. No copying is permitted. The purpose of this project is to construct a scanner for PCAT using Jlex. Read the JLex manual, the scanner calc.lex for the simple calculator, and the PCAT manual.

The pcat/src/edu/uta/pcat/ directory of your project contains the file pcat.lex, plus some other files that you will need for the next projects. Inside the top-level directory pcat there is another directory tests that contains the PCAT test files for your scanner. For this project, you should only modify the file pcat/src/edu/uta/pcat/pcat.lex that contains your scanner.

The tokens that your scanner needs to recognize are given at the top of the file pcat/src/edu/uta/pcat/pcat.cup.

To compile the source files in the directory pcat, run the script:

Then, to use your scanner on the PCAT source file tests/hello.pcat, run:
run 1 tests/hello.pcat
where 1 indicates that you are testing the first project. The output will consist of the tokens produced by your scanner and the error messages (if any). You also need to compare your output with that of the solution:
solution 1 tests/hello.pcat
You need to test your scanner against all the test files *.pcat in the directory tests. You can do this using: run 1 tests/*.pcat.

What to Submit

After ensuring that your program compiles and executes correctly, cleanup your pcat directory by running

Then, go one level up to the directory that contains the pcat directory. If you are using Linux/MacOS, archive this directory using tar cfz pcat.tgz pcat. If you are using Windows, zip the directory into the file pcat.zip. Use the form below to submit your file (pcat.tgz or pcat.zip). We do not accept email submissions. You need a username and password to submit your project. You should have already received an email from your instructor at your mavs.uta.edu account with your username and password. You may submit multiple files, if you like, as long as they have different names. These files are automatically uploaded directly into your personal class account for this particular project, so you don't have to include your name or student ID or project number in the file name. You may submit your files as many times as you like, but only the most recently submitted files will be retained and evaluated (newly submitted files replace the old files under the same file name). After you submit the files, please double-check that your submitted files are correct by clicking on the Status link and by downloading your submitted file. If you cannot login or have a problem submitting the project using this form, ask the GTA for help.

Submit Project #1:

Last modified: 07/14/2014 by Leonidas Fegaras