The science, tools, strategies, patterns and tools behind the creation and processing of languages

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

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

Interesting things happening in Language Engineering

If you read this blog you will know that I strongly believe in the power of languages. So I am very biased, of course, but I have the feeling that the Language Engineering community is growing and more interesting stuff is coming up. For this I thought it was a good idea to finish the […]

Writing a very simple JS editor

  There are nice web editors out there which are ready to be used: you just download them and plug them in your page. I have used myself both CodeMirror and ACE in the past. For example I wrote a plugin for CodeMirror to support PlantUML. However there is an issue with these editors: they […]

Getting started with Roslyn: transforming C# code

The code for this post is on GitHub: getting-started-roslyn Under the hood Making a programming language actually useful is not simply about designing it well. It is also about providing supporting tools around the language: compilers, obviously, but also editors, build systems, etc. There are few languages that give you tools to play under the hood. […]

Review of the second edition of Implementing Domain-Specific Languages with Xtext and Xtend

Review of the second edition of Implementing Domain-Specific Languages with Xtext and Xtend

I am a proud owner of the first version of this book and I intended to buy a copy of the second edition at some point. So when I was contacted by the publisher to write a review of the second edition I was very happy to accept the offer. Thank you to the author, Lorenzo […]

Generating bytecode

In this post we are going to see how to generate bytecode for our language. So far we have seen how to build a language to express what we want, how to validate that language, how to build an editor for that language but yet we cannot actually run the code. Time to fix that. […]

Building a compiler for your own language: validation

So you have parsed your code and built a clean AST for it. Now it is time to check if what the user has expressed make sense at all. We should perform validation, identifying semantical errors, to communicate together with lexical and syntactical errors (provided by the parser). This post is the part of a […]

Building a compiler for your own language: model-to-model transformations

Most of the work done in tools supporting a language consists in manipulating the AST. In this post we are going to see how to perform transformation and processing on the Abstract Syntax Tree through model-to-model transformations. These techniques will be useful to perform operation like: validation: finding errors in the AST remove syntax sugar: […]

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