[ANN] antlr-ng the next generation of ANTLR

101 views
Skip to first unread message

Mike Lischke

unread,
Feb 22, 2025, 8:40:18 AMFeb 22
to 'ANTLR announcements
Announcement

It is my great pleasure to introduce the next generation of ANTLR: antlr-ng. See also https://www.antlr-ng.org.

This tool is a port of ANTLR to TypeScript, which makes Java unnecessary for parser generation. Instead, Node.js (more precisely npm) is now required, which makes it much easier to use (no more aliases and no more CLASSPATH or PATH manipulation). Instead, simply install it using `npm i -g antlr-ng` and then use it like any other terminal command.

For more information and details, go to the homepage https://www.antlr-ng.org. Of course, antlr-ng is also available under the BSD 3-clause license.

The port opens up completely new possibilities for the further development of ANTLR, in particular the integration into modern software development processes (monorepos, web development, etc.), old habits have been cut off (e.g. references to ANTLR v3 have been removed) and it is now much easier to implement new features. There are already a number of ideas in the Github repository https://github.com/mike-lischke/antlr-ng/issues and new ones are welcome.

One of the most important planned changes is the separation of tool and runtimes. In the future, these will exist as independent units (as is already the case with some runtimes in ANTLR4, such as antlr4ts, antlr4ng, antlr4cs).

The antlr-ng tool is now ready for production use and creates (with only minor differences) the same parser/lexer/listener/visitor files as the old ANTLR4 tool.

Special thanks go to Ken Domino (https://github.com/kaby76), who constantly checked antlr-ng for errors during the early development phase and tested it with all grammars in the grammar-v4 repository.

About me: I am a professional software developer at Oracle (30 years of experience) and have been using ANTLR for around 20 years. I am a member of the ANTLR core and runtime teams and have developed three runtimes myself: C++ as co-author, TypeScript and a WebAssembly variant that unfortunately does not work well.

I hope you like this new tool in the ANTLR landscape and if you are curious to see what features are planned check out: https://github.com/mike-lischke/antlr-ng/issues.

If you like to help with antlr-ng's development just open pull requests or issues with questions or changes.

All the best,


Sanyaade Adekoya

unread,
Feb 22, 2025, 2:38:17 PMFeb 22
to antlr-di...@googlegroups.com
Another step for ANTLR (Another Tool for Language Recognition) from PCCTS to ANTLR (C source) then port to Java but now to TypeScript(JavaScript source) meaning going back to the C family route.
Some tools like EDK II, etc... are still using PCCTS and have never adopted into the Java port of ANTLR. I, myself, still keep PCCTS (ANTLR 1.3 and old ones) for historical and research/pedagogy.
We could have a browser-based, maybe some LLM parsers, etc...

I will be satisfying my curiosity, pedagogy itching and what to hack-on

Many thanks!

God blesses!!!

Regards

--
You received this message because you are subscribed to the Google Groups "antlr-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to antlr-discussi...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/antlr-discussion/933A6BE8-3966-4513-A5C3-A73C8773F078%40googlemail.com.

Mike Lischke

unread,
Feb 23, 2025, 6:19:36 AMFeb 23
to antlr-di...@googlegroups.com
I'm working currently on the feature planning for major version 2, which will include running the tool in a web browser. In fact I already have a placeholder on the www.antlr-ng.org webpage for a playground which will allow to interact with grammars in a REPL fashion.

Alessio Stalla

unread,
Feb 24, 2025, 6:44:35 AMFeb 24
to antlr-di...@googlegroups.com
Hi Mike,

this is great news, my compliments for the release! I see it's been in the work for a couple of years, that's a lot of skill and dedication. How is antlr-ng related to your antlr4ng project? Is the latter going to be replaced by the former? Are there any plans to deviate from ANTLR4 behavior / semantics?

Mike Lischke

unread,
Feb 24, 2025, 7:07:14 AMFeb 24
to antlr-di...@googlegroups.com
Hi Alessio,

The project antlr4ng is the pure TypeScript runtime for ANTLR4 (hence the number), but works of course with antlr-ng. I should probably rename it to avoid confusion with the antlr-ng project. However, I have no intention currently to change anything in the runtime. It will work with both antlers (pun intended :-) ) in the foreseeable future. My main focus will be on establishing the new antlr-ng community and the conversion of my other projects from ANTLR4 go antlr-ng.

Both antlr4ng and antlr-ng belong to what I call the Next Generation ANTLR, a project that has the goal to develop ANTLR further without the restrictions imposed by the original tool. This allows for more radical changes like separating tool and runtimes and to replace target specific code in grammars by something better. In the long run this will also lead to a new grammar syntax, a change which would never be possible with ANTLR4.

Ken Domino

unread,
Feb 24, 2025, 3:52:05 PMFeb 24
to antlr-discussion

Mike, Thank you for this excellent contribution. As a developer, I often scan GitHub for the terms “parser generator”, “ebnf”, “antlr”, “bison”, “rascal”, “lbnf”, “tree-sitter”, “converter”, etc., to get a feel for what people worldwide are working on. I knew something was cooking two years ago: Mike was writing a Java to TypeScript converter. That converter was used to port the Antlr4 Tool from Java to TypeScript, resulting in antlr-ng. I am confident to say that the antlr-ng parser generator and the accompanying antlr4ng runtime are solid tools. I have tested antlr-ng with antlr4ng (TypeScript), and the existing 4.13.1 runtimes for Cpp, CSharp,  Dart, Go, Java, JavaScript, and Python3, across the 350+ grammars in https://github.com/antlr/grammars-v4. The plan is to add the antlr-ng tool to the regular testing of grammars in the grammars-v4 repo (https://github.com/antlr/grammars-v4/pull/4385). --Ken

Reply all
Reply to author
Forward
0 new messages