Tutorials, news and informations on the parser generator ANTLR

Migrating from ANTLR2 to ANTLR4

ANTLR is a popular parser generator or “compiler-compiler”, developed by prof. Terence Parr and several contributors. It’s been around since 1992, as an evolution of PCCTS. It’s gone through multiple major versions. The latest incarnation of ANTLR is version branch 4.x, the first release of which is from 2013. Here at Strumenta, we use ANTLR4 […]

Getting started with ANTLR: building a simple expression language

This post is part of a series. The goal of the series is to describe how to create a useful language and all the supporting tools. Building a lexer Building a parser Creating an editor with syntax highlighting Build an editor with autocompletion Mapping the parse tree to the abstract syntax tree Model to model […]

Building and testing a parser with ANTLR and Kotlin

This post is part of a series. The goal of the series is to describe how to create a useful language and all the supporting tools. Building a lexer Building a parser Creating an editor with syntax highlighting Build an editor with autocompletion Mapping the parse tree to the abstract syntax tree Model to model […]

Parsing SQL

You can find the code presented in this article in the companion repository SQL is a language to handle data in a relational database. If you worked with data you have probably worked with SQL. It is in the same league of HTML: maybe you never learned it formally but you kinda know how to […]

The Great New ANTLR 4.8

It has  been more than two years since the last major release of ANTLR, now version 4.8 is ready. ANTLR is a mature and well-tested project, but this release still manages to bring a new target, a fix for the C# packet, improvement on the compilation of the C++ runtime and a few fixes. New […]

Writing a browser based editor using Monaco and ANTLR

  This is a tutorial on creating a browser-based editor for a new language we are going to define. We are going to use two components: Monaco: it is a great browser-based editor (or a web editor: as you prefer to call it) ANTLR: it is the parser generator we love to use to build […]

Getting started with ANTLR in C++

Getting Started with ANTLR in C++

ANTLR can generate parsers in many languages: Java, C#, Python (2 and 3), JavaScript, Go, Swift, and C++. We have written an article to use an ANTLR C# parser and we have also written a mega tutorial to teach you how to use ANTLR with Java, C#, Python and JavaScript. In this article we are […]

Getting started with ANTLR in C#

Getting started with ANTLR in C#

Readers of this website will know that ANTLR is a great tool to quickly create parsers and help you in working with a known language or create your DSL. While the tool itself is written in Java, it can also be used to generate parsers in several other languages, for instance Python, C# or Javascript (with […]

ANTLR Mega Tutorial

The ANTLR Mega Tutorial

Parsers are powerful tools, and using ANTLR you could write all sort of parsers, usable from many different languages. In this complete tutorial we are going to: explain the basics: what a parser is, what it can be used for see how to setup ANTLR to be used from Javascript, Python, Java and C# discuss […]

The important changes in the new ANTLR 4.6

The Important Changes in the New ANTLR 4.6

After almost a year since the last major release, there is a new ANTLR version: 4.6. There are many news: new targets, better performance, better error handling and several improvements in the development of ANTLR itself. New targets The most impactful news is probably the new targets: C++, Go and Swift. Of course getting C++ […]

Do You Need a Parser?

We can design parsers for new languages, or rewrite parsers for existing languages built in house.

On top of parsers we can then help building interpreters, compilers, code generators, documentation generators, or translators (code converters) to other languages.