SableCC version 2.8

ReadMe

Welcome to SableCC version 2.8.

Please read this document carefully.

Content

top

Getting Started

content

Here are the minimal steps to get SableCC running.

  1. If it is not already done, download and install the Sun Java Development Kit (JDK) version 1.1 or newer from http://java.sun.com/.

  2. If it is not already done, download the latest version of SableCC ("sablecc-2.8.jar") from http://www.sable.mcgill.ca/sablecc/.
  3. Using the jar packager utility (that comes with the JDK 1.1), uncompress the file "sablecc-2.8.jar". This will create a subdirectory called "sablecc-2.8" in the current directory.
    Example (Windows 95/NT):
    cd \
    
    jar -xvf DownloadDirectory\sablecc-2.8.jar
    
    Example (Unix):
    cd ~
    
    jar -xvf DownloadDirectory/sablecc-2.8.jar
    
  4. Go to the "sablecc-2.8" subdirectory.

    Example:
    cd sablecc-2.8
    
  5. (optional) If you have PGP version 5.0 or newer installed, you can verify the integrity of the uncompressed files in the "sablecc" subdirectory using the "*.sig" files. You can fin the signing public key at: http://www.sable.mcgill.ca/~gagnon/pgpkey.html.

  6. Read the "Readme.html" and the "License.html" files using a web browser.

  7. Uncompress the "examples.jar" file.
    Example:
    jar -xvf examples.jar
    
  8. Set the CLASSPATH environment variable to contain the files "sablecc.jar" and "sableutil.jar".
    Example (Windows 95/NT):
    set CLASSPATH=.;c:\sablecc-2.8\sablecc.jar;c:\sablecc-2.8\sableutil.jar
    
    Example (Unix csh):
    setenv CLASSPATH .:$HOME/sablecc-2.8/sablecc.jar:$HOME/sablecc-2.8/sableutil.jar
    
    Example (Unix bash):
    CLASSPATH=.:$HOME/sablecc-2.8/sablecc.jar:$HOME/sablecc-2.8/sableutil.jar
    export CLASSPATH
    
  9. Verify that SableCC works. (It is important to use the -mx option to avoid out of memory problems).
    Example:
    java -mx1024m SableCC -license
    
  10. Try to generate, compile, and execute the MiniBasic example.
    Example:
    cd examples
    cd MiniBasic
    java -mx1024m SableCC minibasic.txt
    javac -J-mx1024m Main.java
    java -mx1024m Main test.basic
    

License

content

SableCC and the SableUtil library are covered by the GNU Library General Public License. You can view the copyright notice and the exact terms of the license in the file License.html.

Integrity of Distribution

content

If you have PGP version 5.0 or newer (USA/Canada: http://web.mit.edu/network/pgp.html, International: http://www.pgpi.com/), you can verify the integrity of this distribution using the signature files (*.sig). You can find the public key of the author at http://www.sable.mcgill.ca/~gagnon/pgpkey.html.

Documentation

content

You can find complete and detailed documentation on the SableCC framework and syntax at the following site: http://www.sable.mcgill.ca/sablecc/.

Examples

content

Some example grammars are included in the file "examples.jar".

Be warned: The Java 1.02 and Java 1.1 grammars are correct from a parsing point of view. BUT, the name of tokens, productions and alternatives should be changed and simplified before you build a compiler or pretty-printer using these grammars. For example, the existing grammars would generate the following class: AContinueStatementStatementWithoutTrailingSubstatement. This is clearly unusable!!! It would be nice if someone could fix this, and send the result to the SableCC mailing-list.

Source Code

content

SableCC is distributed along with its source code. To get the source code you need only to uncompress the "sablecc.jar" file .

Example:
jar -xvf sablecc.jar

The same applies to SableUtil.

Getting Help

content

The easiest way of obtaining help is to get on the SableCC mailing-list. Many SableCC users around the world are already on this mailing-list. This is the best pool of information available to you.

Mailing-list

To get on the SableCC mailing-list, send an e-mail message to sablecc-list-request@sable.mcgill.ca. Put 'subscribe sablecc-list your@email.address' in the body of the message. Once you are on the list, you can send your questions.

Paid Support

If you have a pressing need for SableCC to include an additional feature that is key to your work, or if you want some help with a grammar, you get paid support from the author of SableCC. For further information, send an email to Etienne Gagnon (gagnon@sable.mcgill.ca).

Bug reports and wish-list

You are welcome to send your comments and bug reports using the SableCC mailing-list. This helps improving SableCC.