************************************************************* * Java-Lex README Version 1.1.1 * ************************************************************* Written by Elliot Berk [edited by A. Appel]. Contact ejberk@princeton.edu or appel@princeton.edu with any problems relating to Java-Lex. The following steps describe the compilation and usage of Java-Lex. (1) Choose some directory that is on your CLASSPATH, where you install Java utilities such as JavaLex. I will refer to this directory as "J", for example. (2) Make a directory "J/JavaLex" and put the sourcefile Main.java in J/JavaLex. (3) Compile JavaLex.java as you would any Java source file: javac Main.java This should produce a number of Java class files, including Main.class. (4) To run Java-Lex with a Java-Lex specification file, the usage is: java JavaLex.Main where is the name of the Java-Lex specification file. Java-Lex will produce diagnostic output to inform you of its progress and, upon completion, will produce a Java source file that contains the lexical analyzer. The name of the lexical analyzer file will be the name of the Java-Lex specification file, with the string ".java" added to the end. (So if the Java-Lex specification file is called foo.lex, the lexical analyzer source file that Java-Lex produces will be called foo.lex.java.) (5) The resulting lexical analyzer source file should be compiled with the Java compiler: javac where is the name of the lexical analyzer source file. This produces a lexical analyzer class file, which can then be used in your applications. If the default settings have not been changed, the lexical analyzer class will be called Yylex and the class file will named Yylex.class.