ANTLR 2.7.2 Release Notes

January 19, 2003

The ANTLR 2.7.2 release is a feature enhancement and bug fix release, partially brought to you by those hip cats at jGuru.com. It has been about 2 years since the last release so expect lots of stuff to have been fixed and improved.

Enhancements

ANTLR 2.7.2 has a few enhancements:

Java Code Generation

C++ Code Generation

C# Code Generation

C# code generation added by Micheal Jordan, Kunle Odutola and Anthony Oguntimehin

Bug Fixes

ANTLR Installation

ANTLR comes as a single zip or compressed tar file. Unzipping the file you receive will produce a directory called antlr-2.7.2 with subdirectories antlr, doc, examples, cpp, and examples.cpp. You need to place the antlr-2.7.2 directory in your CLASSPATH environment variable. For example, if you placed antlr-2.7.2 in directory /tools, you need to append

/tools/antlr-2.7.2

to your CLASSPATH or.

\tools\antlr-2.7.2

if you work on Windoze.

References to antlr.* will map to /tools/antlr-2.7.2/antlr/*.class.

You must have at least JDK 1.1 installed properly on your machine.  The ASTFrame AST viewer uses Swing 1.1.

JAR FILE

Try using the runtime library antlr.jar file. Place it in your CLASSPATH instead of the antlr-2.7.2 directory. The jar includes all parse-time files needed (this jar includes every .class file associated with ANTLR) You can run the antlr tool itself with the jar and your parsers.

RUNNING ANTLR

ANTLR is a command line tool (although many development environments let you run ANTLR on grammar files from within the environment). The main method within antlr.Tool is the ANTLR entry point.

java antlr.Tool file.g

The command-line option is -diagnostic, which generates a text file for each output parser class that describes the lookahead sets. Note that there are number of options that you can specify at the grammar class and rule level.

Here are the command line arguments:

ANTLR Parser Generator   Version 2.7.2rc1 (20021221)   1989-2002 jGuru.com
usage: java antlr.Tool [args] file.g
  -o outputDir       specify output directory where all output generated.
  -glib superGrammar specify location of supergrammar file.
  -debug             launch the ParseView debugger upon parser invocation.
  -html              generate a html file from your grammar.
  -docbook           generate a docbook sgml file from your grammar.
  -diagnostic        generate a textfile with diagnostics.
  -trace             have all rules call traceIn/traceOut.
  -traceLexer        have lexer rules call traceIn/traceOut.
  -traceParser       have parser rules call traceIn/traceOut.
  -traceTreeParser   have tree parser rules call traceIn/traceOut.
  -h|-help|--help    this message

If you have trouble running ANTLR, ensure that you have Java installed correctly and then ensure that you have the appropriate CLASSPATH set.