The last major update of ANTLR was in January 2019, now after almost two years we have a new update of ANTLR: 4.9, released on November 24. Finally this year has given us something good. The highlight of this release is a new target language: Dart.
New target: Dart
The big news of this release is the new target for ANTLR: Dart, thanks to the work of Larry Li.
A programming language optimized for building user interfaces with features such as the spread operator for expanding collections, and collection if for customizing UI for each platform
Now with one ANTLR grammar you can build parsers in:
- Python 2 and 3
- Kotlin (with our experimental target)
- TypeScript (with the experimental target by Tunnel Vision Laboratories)
That is a lot of languages, which means that you can learn the technology once and use it for all your parser needs. Now let’s see some other hightlights,
Improving Python import time
Rob McGregor has fixed a configuration bug affecting the Python runtime. Most of the loading time was spent importing the unittest module, that was not even used for the runtime. In his testing this fix has reduced the importing time from around 150ms to around 50ms. That is a big improvement if you need to build a Python application that loads quickly.
Improved debugging behavior in C#
A small but useful change is the improvement in behavior when debugging C# code. Before this change you would step into the generated ANTLR code when debugging your C# project. Now, the code is ignored unless you set the option to debug non-user code. This is a small change, but simplify your life a bit if you need to debug C# code.
ANTLR is the best tool to build parsers out there: it is well-tested, reliable enough to be used in an enterprise setting and usable enough so that you actually want to work with it. This release confirms this, by offering a few fixes and maintenance changes. Setting aside particular use cases, you will not see any significant change. That is because it already had all that you need for parsing. The only big news it is the support for a new target language: Dart.
To support you in polishing your parser you can use libraries like Kolasu:
Kolasu supplies the infrastructure to build a custom, possibly mutable, Abstract Syntax Tree (AST) using Kotlin. In particular it can be integrated easily with ANTLR, but it can also be used without.
You know it is good, because we made it.
If you still do not know how to use this wonderful tool, you can read our complete mega tutorial on ANTLR.
If you want to understand how to use ANTLR you can read our article The ANTLR MEga Tutorial.
The ANTLR Mega Tutorial as a PDF
Get the Mega Tutorial delivered to your email and read it when you want on the device you want