ANTLR Changelog

New in version 4.5.1

July 18th, 2015
  • Bug fix and repo reorganization release:
  • We fixed number of important bugs but also combined the various target repositories, such as antlr/antlr4-python2, into the main antlr/antlr4 repository.
  • For the Java target only, there is also a new feature: a parser interpreter that tracks which alternative or label was match for a particular parse tree node, which is often useful during debugging. It is used in the 1.7 release of the ANTLR Intellij Plugin.
  • Summary of Major Changes:
  • Maven build was added back in, thanks to new contributor Jason van Zyl; you can just open the topmost pom.xml in your favorite IDE
  • We completely overhauled runtime test generation
  • We merged all existing target repositories such as antlr4-python2 into the main antlr4 repo so that everything is now included in a single spot.
  • We removed runtime jar dependency on Swing. Class org.antlr.v4.runtime.misc.TestRig has moved to org.antlr.v4.gui.TestRig but we left a proxy in so that org.antlr.v4.runtime.misc.TestRig still works. The org.antlr.v4.runtime.tree.gui package moved to org.antlr.v4.gui in the tool area from the runtime. A few classes from org.antlr.v4.runtime.misc had to move. Convenience methods for saving/viewing parse trees were moved from RuleContext (parse tree) and org.antlr.v4.runtime.tree.Trees to org.antlr.v4.gui.Trees.
  • You can view all Issues fixed in 4.5.1, all pull requests merged and all commits for this release.
  • Features:
  • Add goto to reserved words for java
  • Create functionality to get all possible parse trees for ambiguous input.
  • Makes TestRig's dialog to save and restore its state
  • Parser.setProfile() should keep settings like prediction mode
  • Make Grammar-object-aware ParserInterpreter (This interpreter will have parse tree nodes that know which alternative or label was matched for a particular parse tree subtree root.)
  • Check for nonconforming left-recursive rules.
  • Bug Fixes:
  • Null pointer in named alternative with attributes
  • NullPointerException in bad recursion
  • Parser.setProfile() should keep settings like prediction mode
  • Allow parsing decision override for (decision, input index) in parsers
  • Random ArrayIndexOutOfBounds exceptions coming from ParserATNSimulator
  • Empty rule matched first gives invalid source interval
  • EOF leaf not included in parent tree source interval
  • Rule parameter in left recursive rules disallowed
  • wrong location on import error message reference to undefined rule
  • NotNull import is not deleted in Java.stg

New in version 4.5 (January 23rd, 2015)

  • Bug Fixes:
  • Excess token consumption during recovery
  • exception when importing grammar
  • Generated tokenNames field in lexers is useless
  • Maven build has test failures due to order of token types
  • Suppress warning 109 for matching options during import
  • Parser.getTrace()
  • exception when importing grammar
  • ANTLRInputStream.getSourceName() has @NotNull annotation, but returns null
  • deprecate ErrorType.ALL_OPS_NEED_SAME_ASSOC
  • Multiline comments along with token declaration in lexer
  • NullUsageProcessor not compatible with java>6
  • Cannot start a new lexer mode right after some comments comment
  • Docstring for TokenStreamRewriter is incorrect

New in version 4.4 (July 17th, 2014)

  • Bug Fixes:
  • NullPtr and bad tree parse upon parser rule ref in lexer rule in combined grammar (#661)
  • Specifying an unknown target crashed the tool. (163ec98)

New in version 4.3 (July 10th, 2014)

  • Features:
  • Parser profiler (#583)
  • Tool/Runtime version mismatch detection (#572, #601, #634, #635)
  • Improvements:
  • Improved support for additional targets (#554, #566, #569, #609, #610)
  • Add clearDFA() method to easily clear the DFA cache (#584)
  • Improved documentation
  • Bug Fixes:
  • Fix issue with tokens named ATN (#561)
  • Fix generated JavaDoc for listener and visitor methods for context objects created by labeled alternatives in a rule (#543)
  • Fix errors in support for parsing off-channel tokens (#544, #622, #626)
  • Fix references that alias the enclosing rule name (#571)
  • Fix issues with use of (#542)
  • Fix issues with unsupported and/or ignored semantic predicates (#588, #590)
  • Allow multiple actions and/or predicates to appear at the end of alternatives in a left-recursive rule (#625)
  • Fix bugs in infrequently used IntervalSet code (#623)
  • Fix issues with file encoding handling (#563, #618)
  • Breaking Changes:
  • Within an embedded action or semantic predicate, references to the enclosing rule can no longer be written as $ruleName. Instead, use the special symbol $ctx to refer to the enclosing rule. Parsers already generated from grammars prior to this change are not affected, but the grammar will need to be updated prior to generating code with ANTLR 4.3. This change was required as part of correcting #571.
  • IntervalSet.getMinElement now returns the first element, even if that element is negative. Code which relied on this method to return a non-negative value even if the set contained negative values will need to be updated.

New in version 4.2.2 (April 7th, 2014)

  • Bug Fixes:
  • Improve the handling of grammars containing multiple explicit references to EOF (#531, #534, #537, #539)
  • Improve the ability of generated parsers to report localized errors in the presence of semantic predicates (#529, #530, #533, parrt/antlr4#134, #538)
  • Other minor fixes and cleanup (#528, #532, #538, #540)

New in version 4.2.1 (March 27th, 2014)

  • Bug Fixes:
  • Fix the ParserRuleContext which is returned by the parser interpreter when parsing starts with a left-recursive rule (#461)
  • Fix the accessor methods generated for rules where multiple alternatives use the same label (#433)
  • Add new warning and error messages to help users (#472, #489, #500)
  • Fix lexer action execution in the middle of rules (#469)
  • Fix bug in adaptivePredict for certain left recursive rules (#509)
  • Other smaller fixes (#474, #495)

New in version 4.2 (February 5th, 2014)

  • Features:
  • XPath-like syntax for selecting parse tree nodes
  • Parse tree pattern matching using concrete syntax
  • LexerInterpreter and ParserInterpreter are much more powerful and now part of the runtime library (details)
  • Improvements:
  • Improved left-recursion elimination algorithm in the Tool (#268, #303, #313, #314, #355)
  • Substantial performance improvements for grammars containing left-recursive rules (#97, #192, #300, #400, #401)
  • antlr4-maven-plugin now prints proper error messages, and is now compatible with Eclipse m2e out-of-the-box (#319, #342)
  • A new annotation processor verifies correct use of @NotNull and @Nullable at compile time, and is available through Maven separately from the rest of ANTLR 4 in the new antlr4-annotations artifact (#434, #435) Note: This feature is only available for Maven users; not as part of the standalone ANTLR downloads.
  • Initial support for Java 8 (#337, #430)
  • The Tool supports grammar files in UTF-8 encoding with a byte order mark, a common default for text editors on Windows systems (#175)
  • Bug Fixes:
  • Many other bug fixes

New in version 4.1 (July 1st, 2013)

  • Resize after reading a file with fewer characters than bytes
  • Fix ATN created for non-greedy optional block with multiple alternatives
  • Support Unicode escape sequences with indirection in JavaUnicodeInputStream (fixes #287)
  • Remove the ParserRuleContext.altNum field (fixes #288)
  • PredictionContext no longer implements Iterable
  • PredictionContext no longer implements Comparable
  • Add the EPSILON_CLOSURE error and EPSILON_OPTIONAL warning
  • Optimized usage of closureBusy set (fixes #282)

New in version 4.0 (January 22nd, 2013)

  • Updated PredictionContext Javadocs
  • Updated Maven site documentation
  • Minor tweaks in Java.stg

New in version 3.5 (January 8th, 2013)

  • Improve error reporting and recovery for STRAY_BRACKET, fixes antlr/antlr3#42
  • Do not write output files if errors were reported, fixes antlr/antlr3#61
  • Fix AST operator on labeled set of terminals e.g. x=(A|B)^
  • Fix labeled set of terminals with rewrite e.g. x=(A|B) -> $x