University of the West Indies

Dept. Mathematics and Computer Science


The University of the West Indies

Welcome to the CS34Q home page! This page is intended to be a distribution site for any electronic information relevant to the course. This is the top level course page, select a year to get the content specific to your version of the course.

Resources

Listed here are some of the resources that you may find useful for this course. See the notes below on installing the cup.jar and JLex.jar files in a way that relieves you of having to set your classpath (jdk1.2 or higher).

Notes on setting up jar files for Java CUP and JLex

Annoyed at having to set your CLASSPATH environment variable? Follow these instructions to install Java CUP and JLex without having to set CLASSPATH.
  1. Download the Java CUP and JLex jar files (they are linked above)
  2. Move them to the directory $JAVA_HOME/jre/lib/ext where $JAVA_HOME refers to the JDK install directory (which contains directories such as bin and lib).
  3. That's it for the setup. If you're running some form of Unix, and you can run bash scripts, download the scripts and copy them to /usr/bin or /usr/local/bin (or wherever your local machine policy dictates they should go)

    Type cup -parser parser class name < cup specification file
    at the prompt to call Java CUP on your specification file and have it generate your parser's java source file and the sym.java file.

    Type jlex lexer specification file
    at the prompt to call JLex on your specification file to produce your lexer's java source file.