![]() |
ANTLR 2.7.0 Release Notes "The Millenium release" (A2K?) January 19, 2000 The ANTLR 2.7.0 release is a big feature release, but also fixes a number of bugs. See http://www.antlr.org/bug for the current list of bugs/suggestions and the bugs fixed for this version. Brought to you by those hip cats at jGuru.com. Binary IncompatibilityYOU MUST REGENERATE PARSERS/LEXERS FROM 2.6.0 GRAMMAR FILES TO BE COMPATIBLE WITH 2.7.0 CLASSES--SOME CLASS NAME HAS CHANGED. Source IncompatibilityThe exception names have changed. If you trapped exceptions such as ParserException emanating from the parser in your main() or wherever, you will have to change the invocation code; e.g., use RecognitionException. EnhancementsANTLR 2.7.0 has the following enhancements:
New Exception HierarchyI have radically changed the exception hierarchy from 2.6.x. The ANTLR source is compatible, but if you trap exceptions in your main() or wherever, have to change use new exception names. See ANTLR Exception Hierarchy and note the following:
C++ OutputAccording to Pete Wells, the C++ output has been updated to include the 2.7.0 functionality and fix a few bugs in the C++ code generator. A big thanks to Pete for his hard work on the C++ code generator. Pete says:
New! Sather Code GeneratorMika Illouz has
generously developed and released a Sather code-generator for ANTLR. The Sather code
generation option sports: Hakki Dogusan has written and donated a cool Pascal grammar. See examples/java/pascal. New TinyBasic InterpreterSinan Karasu has written and donated a TinyBasic interpreter; see examples/java/tinybasic. It's pretty cool! He says:
ANTLR Emacs modeChristoph Wedler wrote a nice emacs mode for ANTLR. Check it out! Perforce Revision ControlTerence is now using Perforce's groovy source code control system. They have graciously granted the ANTLR project a 100-user license, which means that up to 100 active ANTLR folks will have access via the net. Some users will have write access to update bugs they find, letting all the other users get immediate fixes. Also, you'll note the file revision now in source and documentation files. Perforce is an absolutely great tool for distributed development. We use it at jGuru.com commercially to collaborate, to develop software, and to keep all of our gurus and operations folks in sync. The advent of this system for the ANTLR project will dramatically improve collaboration between all of us. I will put together a description of how to gain access (there is a perforce client for just about everything...ok not the timex sinclair zx-80) when I get the chance. Miscellaneous updates(not including the bugs fixes described at http://www.antlr.org/bug):
If you want to change the file/line error prefix, set Tool.fileLineFormatter to the object of your choice. The default FileLineFormatter for emacs-style errors is defined as: public static FileLineFormatter fileLineFormatter = new FileLineFormatter() { public String getFormatString( String fileName, int line) { if ( fileName != null ) { return fileName+":"+line+": "; } else { return "line "+line+": "; } } } }; ANTLR InstallationANTLR comes as a single zip or compressed tar file. Unzipping the file you receive will produce a directory called antlr-2.7.0 with subdirectories antlr, doc, examples, cpp, and examples.cpp. You need to place the antlr-2.7.0 directory in your CLASSPATH environment variable. For example, if you placed antlr-2.7.0 in directory /tools, you need to append
to your CLASSPATH or.
if you work on an NT or Win95 box. References to antlr.* will map to /tools/antlr-2.7.0/antlr/*.class. You must have at least JDK 1.1 installed properly on your machine. The ASTFrame AST viewer uses Swing 1.1. JAR FILETry using the runtime library antlr.jar file. Place it in your CLASSPATH instead of the antlr-2.7.0 directory. The jar includes all parse-time files needed (if it is missing a file, email parrt@jguru.com) You cannot run the antlr tool itself with the jar, but your parsers should run with just this jar file. It's pretty small, around 50k uncompressed. RUNNING ANTLRANTLR 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.
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. Options -trace, -traceParser, -traceTreeParser may be used to track the lexer, parser, and tree parser invocations. Try the new -html option to generate HTML output of your grammar(s); this is only partially done. If you have trouble running ANTLR, ensure that you have Java installed correctly and then ensure that you have the appropriate CLASSPATH set. Version: $Id: //depot/code/org.antlr/release/antlr-2.7.0/doc/antlr270release.html#3 $ |