Showing items from eclipse

Xtext Tip: Migrating to manual EMF model

Xtext is very good at inferring a metamodel from a grammar but it has its limitations. After reaching a certain complexity, I think it is important to decouple the grammar from the metamodel. This is allows to separate concerns: the metamodel becomes the “business model layer”, and the grammar becomes the “presentation layer”.

Continue Reading

Xtext Tip: Context dependent FQNs in Xtext

One of my favorite features of Xtext is the ability to have context dependant FQNs. One application of the feature is the this keyword, which is used to refer to the current instance in languages like Java. The full code for this example can be found here. The basic block language We are using the same block langague that we used in a previous tip.

Continue Reading

Xtext Tip: How to change the default delimiter of your FQNs

In a previous tip I showed how to add FQN support to your Xtext DSL. In this tip, we are going to customize our FQN to have a different separator. The full code for this example can be found here. The basic block language I am using the block language of the previous tip, but this time we are using the characters -> as separator

Continue Reading