% tar xf PA3-start.tar
It should unpack into the following:
PA3-start/
JLex/
...
MJLexerStart/
src/
LexDriver.java
mjparser/
TokenValue.java
java-cup-11a.jar
java-cup-11a-runtime.jar
minijava.cup
minijava.lex
TestCases/
File -> New -> Project
Use project specific JRE (1.5 or 5.0)
Build project from existing source files (MJLexer-groupname)
Remove TestCases from the buildpath
Eclipse -> Preferences -> Java -> Build Path -> Classpath Variables
JAVA_CUP
Path: put in full path for java-cup-11a-runtime.jar,
which is in the mjparser/ subdirectory
Project -> Properties -> Libraries -> Add Variable
select JAVA_CUP
% cd PA3-start
% mv JLex MJLexer-groupname/src/mjparser/
[1, 0] AND
[1, 2] BOOLEAN
[1, 9] SEMI
We recommend you specify one token at a time and then unit test each token with a file that contains instances of that token.
Hints
MYRE=a|b|c
HELLO=zz{MYRE}
is equivalent to
MYRE=a|b|c
HELLO=zza|b|c
and can generate the strings zza, b, or c, but not zzb or zzc.
svn log and svn info with the checkin utility
~cs453/bin/checkin PA3_svnlog subversion_groupname.txt
Main-Class: LexDriver Class-Path: java-cup-11a-runtime.jar
% javac -classpath .:mjparser/java-cup-11a-runtime.jar LexDriver.java
% jar cmf mainClass.txt MJLexer-groupname.jar *.class */*.class */*/*.class mjparser/minijava.* README subversion.txt
svn log
svn info
svnlook tree REPOSITORY_PATH svnlook must be issued on a department machine
~cs453/bin/checkin PA3 MJLexer-groupname.jar
% java -classpath java-cup-11a-runtime.jar -jar MJLexer-groupname.jar Test.java % mkdir MJLexer-groupname/src/ % cd MJLexer-groupname/src/ % cp ../../MJLexer-groupname.jar . % jar xf MJLexer-groupname.jarNote that you need to have a copy of the java-cup-11a-runtime.jar file in the same directory as the MJLexer-groupname.jar file. We will provide our own copy of the runtime jar file for testing. We will be running your lexer on multiple test files. Also, the TA will be looking at the source files and possibly running JLex on the minijava.lex file.