Showing items from Xtext

Xtext vs ANTLR vs Parser Combinators

So you have decided that you need a parser, a real one. Now you need to decide what to use to implement that parser. There are several choices:

Each choice has advantages and disadvantages that I will discuss in this post.

Create your own parser manually

It your main interest is to have an extremely fast and flexible parser, this is the way to go. Manual parser are mostly used for programming languages or in places where every bit of performance is needed. However, creating your own parser is a tedious, slow and repetitive process.

Continue Reading

Changing gears: Enter Scala

I started writing this blog with a strong focus on language engineering and low code. I’m still fascinated by both but I’m starting a new job in the blockchain space and working with one of my favorite programming languages. Thus, I would like to broaden the topics of the blog and include some Scala coding from time to time. I think Scala has great untapped potencial for language engineering.

So, from now on, I will continue to write aboute language engineering but also spiced with a bit of Scala. I hope you enjoy it.

Continue Reading

Xtext Tip: Embrace Model-Driven Development

Xtext has a strong foundation in Model-Driven Development. Most people who start working with it do not realize that from the beginning and then find themselves in troubles because of that.

If you are using Xtext, it is worth learning:

  • what a metamodel is
  • The tooling around modeling in Eclipse, this is:
    • MWE2
    • EMF (Eclipse Modeling Framework)
  • At least the basics of Model Driven Engineering/Development

Knowing this will allow you to use Xtext in the way it was intended and work around its limitations.

Continue Reading

LSP and Xtext Tutorial: Creating the VS Code Client

This post is a continuation of my LSP and Xtext Tutorial. In my latest post I created a language in Xtext to be used with a client. In this post I am going to create VS Code plugin to connect to the language server created in the previous post. The full code for this example can be found here.

The VS Code Plugin

VS Code plugins are created using yeoman. Yeoman is a scaffolding tool, it creates the necessary files to start your project. For our VS Code plugin, we can use it to generate most of the plugin and then we proceed to customize it for our language. For those coming from the Eclipse world, yeoman is a wizard that we can launch from the command line. The installation of yeoman is outside of the scope of this tutorial.

Continue Reading

LSP and Xtext Tutorial: Creating the language

This post is a continuation of my LSP and Xtext Tutorial. In this post I present how to create the language to have all the necessary configurations to work. The full code for this example can be found here.

Create the project

The project is created as a standard Xtext project. The first part of the wizard is configured as usual. We use as an example the block project the I have used in a previous tip. Below is the first dialog for the wizard.

Continue Reading