Instructions on Using the jBasic Interpreter: (Java-cup version) Download all files into a diretory. Make sure that the "CLASSPATH" environment variable includes the appropriate directories (probably your home directory and the current directory). Assuming that JFLex and Java_Cup have been properly installed, do the following: // WARNING: these instructions work with Cup version 10k, not v11, which has // no good examples and very poor documentation. // These instructions assume that directory ./ or ../ contains java_cup 0. Compile the interpreter's main classes: "javac jbclasses.java" 1. Create the parser source code with "java -cp ./:../ java_cup.Main < jbp.cup" Change directory to location of java_cup, if not on Path. 2. Create lexical scanner source code with "jflex jbl.flex" 3. Compile the lexer: "javac -cp ./:../ Lexer.java" classpath must contain location of java_cup package 4. Compile the parser: "javac -cp ./:../ parser.java" 5. Compile the interpreter: "javac -cp ./:../ jbinterp.java" 6. Test if it works: "java -cp ./:../ jbinterp < factorial.jb" If all went well you'll see "The factorial of 5 is 120" printed on the screen. NOTE: you should be wondering why you would process the parser before the lexer. It's because by processing the .cup file Java_Cup will produce a file called "sym.java" that defines constants for each type of token. The "sym" class is then used by JLex so that the object returned with each token corresponds with what the parser expects to get.