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 basis: 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 how to test your parser ...
Read More »Home »
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++ support is a big deal. ...
Read More »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 grow for me. This is ...
Read More »How to create an editor with syntax highlighting for your language using ANTLR and Kotlin
What we are going to build In this post we are going to see how to build a standalone editor with syntax highlighting for our language. The syntax highlighting feature will be based on the ANTLR lexer we have built in the first post. The code will be in Kotlin, however it should be easily convertible to Java. The editor ...
Read More »Building and testing a parser with ANTLR and Kotlin
This post is part of a series on how to create a useful language and all the supporting tools. Building a lexer Code Code is available on GitHub. The code described in this post is associated to the tag 02_parser The parser The parser is simply defined as an ANTLR grammar. We have previously built a separate lexer. ...
Read More »Getting started with ANTLR: building a simple expression language
This post is the first one of a series. The goal of the series is to describe how to create a useful language and all the supporting tools. In this post we will start working on a very simple expression language. We will build it in our language sandbox and therefore we will call the language Sandy. I think that tool support is ...
Read More »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 building block but with ANTLR ...
Read More »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 possibly to minor changes files ...
Read More »ANTLR and Jetbrains MPS: Parsing files and display the AST usign 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 ...
Read More »