Worth 6% 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.
If you work on Linux/MacOS, you need to download the archive file pcat.tgz on your home directory and unpack it using tar xfz pcat.tgz. If you work on Windows, you need to download the zip file pcat.zip and unzip it on your home directory. The top-level pcat directory contains the file pcat.lex, plus some other files that you will need for the next projects. Inside this directory there is another directory tests that contains the PCAT test files for your scanner. For this project, you should only modify the file pcat.lex that contains your scanner.
The tokens that your scanner needs to recognize are given at the top of the file pcat.gen.
To compile the Java files in the directory pcat, run the script:
buildThen, to use your scanner on a PCAT source file tests/hello.pcat, run:
run 1 hellowhere 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 helloYou need to test your scanner against all the test files *.pcat in the directory tests.
After ensuring that your program compiles and executes correctly, cleanup your pcat directory by running
cleanThen, 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.
Last modified: 01/23/14 by Leonidas Fegaras