Tutorials, news and informations on the parser generator ANTLR

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 perfomance, 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++ […]

Kanvas: Generating a Simple IDE From Your ANTLR Grammar

What is an editor? An editor is, for me, the main tool I use for work. As a Language Engineer I create new languages, I use existing ones and I need different tools to work with them. I would like to be able to hack all of them together, in a customized IDE I can […]

Building a compiler for your own language: from the parse tree to the Abstract Syntax Tree

In this post we are going to see how process and transform the information obtained from the parser. The ANTLR parser recognizes the elements present in the source code and build a parse tree. From the parse tree we will obtain the Abstract Syntax Tree which we will use to perform validation and produce compiled code. Note […]

Building autocompletion for an editor based on ANTLR

Building autocompletion for an editor based on ANTLR

In this post we are going to see how to build autocompletion in our editor. We will derive the items to suggest automatically from our ANTLR grammar. This post is the 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 […]

Building and testing a parser with ANTLR and Kotlin

Building and testing a parser with ANTLR and Kotlin

This post is the 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 […]

Getting started with ANTLR: building a simple expression language

Getting started with ANTLR: building a simple expression language

This post is the 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 […]

On the need of a generic library around ANTLR_ using reflection to build a metamodel

On the need of a generic library around ANTLR: using reflection to build a metamodel

I am a Language Engineer: I use several tools to define and process languages. Among other tools I use ANTLR: it is simple, it is flexible, I can build things around it. However I find myself rebuilding similar tools around ANTLR for different projects. I see two problems with that: ANTLR is a very good […]

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.