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 JFlex. Read the JFLex 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/main/scala/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/main/scala/edu/uta/pcat/pcat.cup.
To compile the source files in the directory pcat, do:
mvn clean installThen, to use your scanner on the PCAT source file tests/hello.pcat, run:
scala lib/pcat.jar 1 tests/hello.pcatwhere 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:
scala pcat-solution.jar 1 tests/hello.pcatYou need to test your scanner against all the test files *.pcat in the directory tests. You can do this using: scala lib/pcat.jar 1 tests/*.pcat.
After ensuring that your program compiles and executes correctly, cleanup your pcat directory by running
mvn cleanThen, go one level up to the directory that contains the pcat directory. Zip the directory into the file pcat.zip. Use the form below to submit your pcat.zip file. 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: 02/02/2017 by Leonidas Fegaras