CHANGES FOR 2.7.3 C# CHANGES By Anthony Oguntimehin, Kunle Odutola & Micheal Jordan -- Added in-built support for reusing instances of Lexers, Parsers and TreeParsers. See the following methods: a) resetState(Stream s) in the CharScanner class (for Lexers) resetState(TextReader tr) in the CharScanner class (for Lexers) b) resetState() in the Parser class c) resetState() in the TreeParser class The related XXXSharedInputState classes have reset() methods that do some of the heavy lifting. NOTE: If using TokenStreamSelector, call resetText() on the other lexers after calling resetState() on one of them. -- ***BREAKING***: Made the following changes after Rodrigo B. de Oliveira [rodrigobamboo -AT- hotmail -dot- com] submitted a patch and prodded Micheal about it. Repeatedly ;-). Ouch...erm...thanks Rodrigo!. a) TokenStreamSelector.cs: nextToken() now has a specific catch clause for TokenStreamRetryException b) Token.cs: setFilename() and getFilename(string) are now virtual c) CharScanner.cs: makeToken(int) now calls setFilename(string) on newly created tokens -- ***BREAKING***: CharScanner.nextToken() is now a virtual method so, CSharpCodeGenerator.java now generates nextToken() in generated lexers as an overridden method. -- Added a fix for a reported issue with un-compileable generated lexers -- Added the TokenStreamRewrite framework to the C# runtime library [See http://www.antlr.org/article/rewrite.engine/index.tml] -- Added the ParseTreeDebugParser framework to the C# runtime library [See http://www.antlr.org/article/parse.trees/index.tml] -- Added two new C# example projects to illustrate the two frameworks above: a) TokenStreamRewrite - demonstrates use of TokenStreamRewrite framework b) ParseTreeDebug - demonstrates use of the ParseTreeDebugParser framework -- C# VS.NET solution and project files & names have been updated to 2.7.3 -- Incorporated latest fixes for the java grammar into the C# example project -- ***BREAKING***: Method ToStringTree() of antlr.BaseAST now behaves correctly. It's output is the same as the Java and C++ versions. The current output that looks like a tree graphically has been moved to a new method ToTree(). -- The Nant build file should not be looking for AssemblyInfo.cs in the base directory. It's in the 'src' sub-directory. Fixed. Mar 13, 2004 Fixed nasty bug in FOLLOW computation. Robin Green pointed me in the right direction and motivated me to fix it ;) Added antlr.TokenStreamRewriteEngine, antlr.TokenWithIndex to the distribution. See http://www.antlr.org/article/rewrite.engine/index.tml Added derivation stuff to the distribution: o antlr.ParseTree.java o antlr.ParseTreeRule.java o antlr.ParseTreeToken.java o antlr.debug.ParseTreeDebugParser.java See http://www.antlr.org/article/parse.trees/index.tml C# version exists too for rewrite engine and derivation tree stuff. Fixed superclass for grammars. Can do this: class T extends Parser("a.b.MyParser"); Feb 5, 2004 Monty Zukowski sent me patch for problems with ANTLR 2.7.3rc using his cgram. MismatchedTokenException.java got a null pointer exception as a result of a tree walker failed backtrack. Ric's C++ Changes: - Added custom AST which supports line numbers to the C++ treewalk example. - Fixed antlr crash on empty commandline argument. - HP-UX fixes (thanks to Jerry Dy) - More fixes for cygwin/mingw. Untested DLL target for lib. (probably has name mangling issues if it builds at all) --- Includes a load of fixes for MSVC, I hope it will still build on VC7.0/7.1. MSVC 6 is I hope functional again. Please test this and report problems. I moved a lot of explicit instantiations to dll.cpp to get rid of the loads of MSVC ifdefs. No DSP/DSW files included. Check the lib/cpp/README on how to setup the project. --- Added feature request: make output directory if it does not exist yet (when used with -o option). --- Fixed configure build (should now be in sync with Terence's java build). --- Fixes for grey area static_casts that turn out to be illegal in gcc 3.3.1 and up. --- Redid getAST return type fix. getAST now always returns RefASTs. Newer compilers will not go for overriding the return type with the reference counter. possible incompatibility --- Fixes for octal character literals and C++ codegen for 16 bit char literals. --- Fix for a sign extension problem in CharScanner::match(std::string&) --- Fixed codegeneration bug introduced by the above quoting fix. --- Shut up the warning about an empty initializeASTFactory --- C++ Heterogeneous AST fix from Sebastian Hack, adds missing Ref prefix. --- Java Heterogenous AST fix. Thanks to Ives Landrieu for the report. --- Fix for default arguments by Michael Haupt. Since then reworked for gcj compatability. This may fail for some more complex default arguments. --- Changed LA(x) stuff to use unsigneds. --- Various examples fixed/tweaked. --- Fix for missing antlr namespace qualifier, when using wildcards in TreeParser. --- Doc updates. --- Fixes for gcj-3.2.2. --- RPM support for RH9. 12-05-2003 Fixed problem that preproc.g didn't allow class T extends Parser(MyParentParserJavaClass); 6-02-2003 Ric fixed this: -------------- On Tue, Apr 15, 2003 at 11:41:56PM -0000, martinkbraid wrote: Here is a fragment of code from antlr.RuleBlock.setOptions() } } else if (key.equals("generateAmbigWarnings")) { if (value.getText().equals("true")) { generateAmbigWarnings = true; I believe it should be key.getText().equals(" .... Without getText(), this is always false. This probably explain why I cannot set generateAmbigWarnings=false; Martin Braid -------------- 5-3-2003 Added getLine() to AST; had to change exception classes