
CSCI 531 Spring 2008
Programming Assignment 2
Assigned Friday, 2008-02-22. Due Friday, 2008-02-29
The purposes of this exercise are to insure that you can run the JLex lexical
analyzer generator. Please use the Unix dropbox, not the Blackboard dropbox.
1. Review the discussion of JLex in the handout. Refer to
http://www.cs.princeton.edu/~appel/modern/java/JLex/current/manual.html
for more information on JLex.
2. Make sure that your .cshrc or .tcshrc file include the line
source /usr/local/etc/csce531/csce531-spring07.csh
3. Copy the sample JLex specification in
http://www.cs.princeton.edu/~appel/modern/java/JLex/current/sample.lex
4. Run JLex by issuing the following command at the Unix prompt: java
JLex.Main sample.lex
5. Save your interaction in a file (call it jlex1, either by cutting and pasting
or by using the Unix script command.
6. Repeat using the file in Figure 2.9 (Section 2.5) of the lexical analysis
handout. Rename the file containing this interaction jlex2. (There is a
small error. Find it!)
7. Paste jlex1,jlex2 and the file of Figure 2.9 into a single file, name that
file jlex, and submit using dropbox.
1