Tutorials, news and informations on the parser generator ANTLR

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 […]

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 […]

ANTLR and the web: a simple example

ANTLR on the web: why? I started writing my first programs on MS-DOS. So I am very used to have my tools installed on my machine. However in 2016 the web is ubiquitous and so our languages could be needed also there. Possible scenarios: ANTLR also on the web: users could want to access and […]

ANTLR and Jetbrains MPS: Parsing files and display the AST using the tree notation

  Itemis did it again: they just released a new very cool plugin for Jetbrains MPS. This one permits to define new tree editors. They look like this: In this post we are going to see: how to use ANTLR parsers inside MPS how to represent the parsed AST using the tree notation In particular we […]

Parsing Any Language in Java in 5 Minutes Using ANTLR: for Example Python

  I like processing code for several purposes, like static analysis or automated refactoring. The interesting part to me is to reason on the models you build from the Abstract Syntax Tree (AST). To get there you need a way to get the AST from your source files. This can be done easily using ANTLR and […]

Turin Programming Language for the JVM: building advanced lexers with ANTLR

Turin Programming Language for the JVM: Building Advanced Lexers with ANTLR

As I wrote in my last post, I recently started working on a new programming language named Turin. A working compiler for an initial version of the language is available on GitHub. I am currently improving the language and working on a Maven and an IntelliJ plugins. Here and in the next posts I will go over the […]

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.