Releases: antlr/antlr4
ANTLR 4.5.1 beta 1
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 mainantlr4
repo so that everything is now included in a single spot.
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
Download Binaries
Download the ANTLR tool and all target runtimes at the antlr.org site.
The Java jars are OSGi compatible so you should be able to use them within Eclipse.
Runtime Libraries for Language Targets
- Java is embedded with the tool, but is also available from maven-central
- C# (zipped .dll) is a download from antlr.org. Might be in NuGet too in the future.
- JavaScript is a download from antlr.org. Might also be registered as a npm package for node.js
- Python2 and Python 3 are in PyPi
- Sam Harwell's alternative C# target is available through NuGet. Note that this alternative target is distributed with a standalone copy of the ANTLR Tool, and only works with code generated by that standalone copy.
Documentation
Language Targets Info
As of 4.5, the standard distribution of ANTLR can generate code in the following languages:
In addition, the following languages are supported by standalone release(s) of the tool.
4.5
Major Milestone Release
This release is primarily about the new JavaScript code generation target and the integration of a C# target derived from Sam Harwell's ANTLR project. Sam's is still available of course but we wanted a single tool that would generate Java, C#, Python2, Python3, and JavaScript. There are also a number of bug fixes in 4.5 as you can see below.
You need to regenerate your lexers and parsers using the latest version of the 4.5 Tool to use the 4.5 runtime.
Download Binaries
Download the ANTLR tool and all target runtimes at the antlr.org site.
The Java jars are OSGi compatible so you should be able to use them within Eclipse.
Runtime Libraries for Language Targets
- Java is embedded with the tool, but is also available from maven-central (will be but you can get 4.5-SNAPSHOT right now until I figure out deploying.)
- C# (zipped .dll) is a download from antlr.org. Might be in NuGet too in the future.
- JavaScript is a download from antlr.org. Might also be registered as a npm package for node.js
- Python2 and Python 3 are in PyPi
- Sam Harwell's alternative C# target is available through NuGet. Note that this alternative target is distributed with a standalone copy of the ANTLR Tool, and only works with code generated by that standalone copy.
Documentation
Summary of Changes
You can view all issues closed for this release, all pull requests merged and all commits for this release.
Be aware that we no longer deploy a maven antlr4-annotations artifact and in fact we no longer use Java annotations in the Java runtime and so that code is disappeared.
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
Language Targets Info
As of 4.5, the standard distribution of ANTLR can generate code in the following languages:
In addition, the following languages are supported by standalone release(s) of the tool.
Also, Sam Harwell has an ANTLR 4 "Optimized" fork, which is currently consistent with ANTLR 4.4.
ANTLR 4.5 release candidate 2
This version has an important bug fix, #670, and a big update to the build system while we try to accommodate maven and its deployed mechanism.
Also be aware that we no longer deploy a maven antlr4-annotations artifact, which is only used at compile time for runtime and the ANTLR tool itself. If you use the runtime jars, you should not needed at all. If you need to compile/build, grab stuff from github.
ANTLR 4.5 release candidate 1
Major Milestone Release (release candidate)
This release is primarily about the new JavaScript code generation target and the integration of a C# target derived from Sam Harwell's ANTLR project. Sam's is still available of course but we wanted a single tool that would generate Java, C#, Python2, Python3, and JavaScript. There are also a number of bug fixes in 4.5 as you can see below.
We highly recommend that you regenerate your lexers and parsers using the latest version of the Tool.
Download Binaries
Download ANTLR jars at the antlr.org site.
Runtime Libraries for Language Targets
- Java is embedded with the tool, but is also available from maven-central (will be)
- C# (zipped .dll) is a download from antlr.org. Might be in NuGet too in the future.
- JavaScript is a download from antlr.org. Might also be registered as a npm package for node.js
- Python2 and Python 3 are in PyPi
- C# (Sam Harwell's version) is available through NuGet. Note that this release is distributed with a standalone copy of the ANTLR Tool, and does not work with code generated by this combined distribution.
Documentation
- Java runtime API (4.5)
- Java Tool API (4.5)
- ANTLR 4 Maven plugin (4.3) we'll update mvn stuff once we are sure that this release candidate is okay.
Summary of Changes
You can view all issues closed for this release, all pull requests merged and all commits for this release.
Bug Fixes
- 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
IDE Support
We have not updated the IDE plugins for this prerelease.
Language Targets
As of 4.5, the standard distribution of ANTLR can generate code in the following languages:
In addition, the following languages are supported by standalone release(s) of the tool.
Also, Sam Harwell has an ANTLR 4 "Optimized" fork, which is currently consistent with ANTLR 4.4.
4.4
Major Milestone Release
ANTLR 4.4 is a major feature and minor bugfix update to ANTLR 4. The primary enhancement is the introduction of both Python2 and Python3 language targets, which you can access with -Dlanguage=Python2 from the ANTLR command line. For C#, please use Visual Studio plugin/tool that Sam Harwell has built.
Please note that tool error messages have been altered to remove unnecessary single quotes and we have added some more specific error messages.
This release includes a new build script called bild.py and was not build using maven. bild.py is a Python script I made that looks like a makefile and self bootstraps by pulling in the required bilder.py library from the net. See http://bildtool.org. On a unix box, just type "./bild.py all" to build antlr from source (if you are so inclined).
We highly recommend that you regenerate your lexers and parsers using the latest version of the Tool.
Download Binaries
Download ANTLR jars at the antlr.org site.
Documentation
Summary of Changes
You can view all issues closed for this release here, and all commits for this release here.
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)
IDE Support
Project | Release which Supports ANTLR 4.4 |
---|---|
ANTLRWorks 2 | |
IntelliJ Plugin | 1.5 |
Eclipse Plugin | |
Visual Studio Extension | 1.2.1 |
Alternate Language Targets
As of 4.4, ANTLR can generate code in the following languages:
Also, Sam Harwell has an ANTLR 4 "Optimized" fork, which is currently consistent with ANTLR 4.3.
4.3
Major Milestone Release
ANTLR 4.3 is a major feature and bugfix update to ANTLR 4. For most users upgrading from ANTLR 4.2, this is a source- and binary-compatible update. However, to maximize the benefits provided by the update, we highly recommend that you regenerate your lexers and parsers using the latest version of the Tool.
Download Binaries
Download ANTLR jars at the antlr.org site.
Documentation
Summary of Changes
You can view all issues closed for this release here, and all commits for this release here.
Features
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
<assoc=right>
(#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.
Related Projects
The following tables list several related projects, along with the version number corresponding to this release. The tables will be updated as each of the projects release updates to support this release of ANTLR 4.
IDE Support
Project | Release which Supports ANTLR 4.3 |
---|---|
ANTLRWorks 2 | |
IntelliJ Plugin | |
Eclipse Plugin | |
Visual Studio Extension | 1.2.1 |
Alternate Language Targets
Project | Release which Supports ANTLR 4.3 |
---|---|
ANTLR 4 "Optimized" fork | 4.3-opt |
C# Target | 4.3 |
4.2.2
Minor Bug Fix Release
ANTLR 4.2.2 is a minor bugfix update to ANTLR 4. This update is source- and binary-compatible with ANTLR 4.2 for virtually all users (see the Breaking Changes section at the end). Users updating from earlier versions are encouraged to read the release notes for ANTLR 4.2.
Documentation
Summary of Changes
You can view all issues closed for this release here, and all commits for this release here.
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#134, #538)
- Other minor fixes and cleanup (#528, #532, #538, #540)
Breaking Changes
The signature of the following methods changed to support the proper handling of grammars with multiple explicit references to EOF
. These methods are rarely, if ever, overridden in client applications.
LexerATNSimulator.closure
LexerATNSimulator.getEpsilonTarget
ParserATNSimulator.closure
ParserATNSimulator.closureCheckingStopState
ParserATNSimulator.closure_
ParserATNSimulator.getEpsilonTarget
Related Projects
The following tables list several related projects, along with the version number corresponding to this release. The tables will be updated as each of the projects release updates to support this release of ANTLR 4.
IDE Support
Project | Release which Supports ANTLR 4.2.2 |
---|---|
ANTLRWorks 2 | 2.2.2 |
IntelliJ Plugin | 1.1 |
Eclipse Plugin | 0.3.0 |
Visual Studio Extension | 1.2.1 |
Alternate Language Targets
Project | Release which Supports ANTLR 4.2.2 |
---|---|
ANTLR 4 "Optimized" fork | 4.2.2-opt |
C# Target | 4.2.2-alpha001 |
4.2.1
Minor Bug Fix Release
ANTLR 4.2.1 is a minor bugfix update to ANTLR 4. This update is source- and binary-compatible with ANTLR 4.2. Users updating from earlier versions are encouraged to read the release notes for ANTLR 4.2.
Documentation
Please see the latest release for links to the current documentation.
Summary of Changes
You can view all issues closed for this release here, and all commits for this release here.
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)
4.2
Major Milestone Release
ANTLR 4.2 is a major feature and bugfix update to ANTLR 4. For most users upgrading from ANTLR 4.1, this is a source- and binary-compatible update. However, to maximize the benefits provided by the update, we highly recommend that you regenerate your lexers and parsers using the latest version of the Tool.
Documentation
Please see the latest release for links to the current documentation.
Summary of Changes
You can view all issues closed for this release here, and all commits for this release here.
Features
- XPath-like syntax for selecting parse tree nodes
- Parse tree pattern matching using concrete syntax
LexerInterpreter
andParserInterpreter
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
4.2-SNAPSHOT
Major Milestone Release (Preview Release)
ANTLR 4.2 is a major feature and bugfix update to ANTLR 4. For most users upgrading from ANTLR 4.1, this is a source- and binary-compatible update. However, to maximize the benefits provided by the update, we highly recommend that you regenerate your lexers and parsers using the latest version of the Tool.
Prerelease Library
Download the pre-release jar for non-maven users.
The current prerelease build of ANTLR 4.2 is available through Sonatype's Maven snapshot repository. To enable your Maven builds to use the snapshot releases, include the following in your projects pom.xml
or in your system ~/.m2/settings.xml
.
<profiles>
<profile>
<id>allow-snapshots</id>
<activation><activeByDefault>true</activeByDefault></activation>
<repositories>
<repository>
<id>snapshots-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
</profile>
</profiles>
With the snapshot repository enabled, you can reference the ANTLR 4 runtime with the following:
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.2-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
Documentation
Please see the latest release for links to the current documentation.
Summary of Changes
You can view all issues closed for this release here, and all commits for this release here.
Features
- XPath-like syntax for selecting parse tree nodes
- Parse tree pattern matching using concrete syntax
LexerInterpreter
andParserInterpreter
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) - 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