a DSL for writing rules for Xtext languages

Xsemantics moving to Xtext 2.4

March 21st, 2013 | Posted by lorenzo in Uncategorized - (Comments Off)

Xtext 2.4 was released yesterday!

However, Xsemantics is still not ready for it (i.e., not compatible with it).

I’ve started the moving to Xtext 2.4, hope it will be ready soon :)

Xsemantics 1.2.0

October 9th, 2012 | Posted by lorenzo in Uncategorized - (Comments Off)

In this new release there are some new features

Injected fields

It is now possible to define injected fields in the system; these will correspond to @Inject fields in the generated Java code. These fields will then be usable in the rules of the system

validatorExtends clause

When defining the system, one can specify the base class of the generated validator; this allows the generated abstract declarative validator to be used directly in your DSL (since it inherits all the basic settings required by a declarative validator). The idea is that you should specify as the base validator the one that Xtext generated for you in the src-gen folder.

System Extension

It is now possible to specify that a system extends another Xsemantics system (in the generated code this will correspond to class inheritance); with this feature is then possible to reuse all the judgments and rules of the base system, and also to override judgments and rules (besides specifying new rules for a judgment with more specific parameters)

When overriding a judgment, one can specify different error specifications (but the parameters types cannot be changed)

Auxiliary Functions

Besides judgments and rules, it is now possible to define auxiliary descriptions and the corresponding auxiliary functions, which can then be used in the system as standard Java methods.

Here’s an example of auxiliary descriptions

Once the auxiliary descriptions are provided you can define auxiliary functions implementations

Of course, for the same auxiliary description, multiple auxiliary functions implementations for different parameters can be provided


You can find all the details of these new features in the documentation (and in the examples).

Xsemantics is now completely ported to Xtext 2.3.0.

Xsemantics now completely relies on Xtext’s JvmModelInferrer so that a partial debugging support is now supported (but this feature has still to be completed).

Xsemantics examples can now be imported in the workspace using the wizards:

For each example language included in Xsemantics, you will then find a wizard which creates a project to experiment with that example language, and a wizard to materialize in the workspace the sources of the projects for that example language.

The documentation is now complete!

You can install Xsemantics plugins directly from the update site (this requires Xtext 2.3.0 SDK to be already installed):


If you still have not Xtext installed in your eclipse, you might want to use this composite site which also has links to Xtext official update sites (so that you can install both Xtext and Xsemantics from this site):


You might want to install the whole Xsemantics SDK (and possibly its sources), which includes all the features for developing with Xsemantics (and the examples).


Xsemantics documentation almost finished

April 10th, 2012 | Posted by lorenzo in Uncategorized - (Comments Off)

The documentation has still to be completed, but at least for the moment there’s some reference documentation and two examples fully detailed: an expression language and Featherweight Java. See the Documentation page.

Xsemantics moving to Xtext 2.3

March 25th, 2012 | Posted by admin in Uncategorized - (0 Comments)

If you’re already using Xtext 2.3 (which will be officially released on June), you may want to update Xsemantics as well.

Using this alternative update site


(This update site is temporary and will be removed when Xtext 2.3 will be officially released).

In that case you need to have Xtext 2.3; in particular the version of Xsemantics built against Xtext 2.3 is using this update site for Xtext



Xsemantics is out!

March 15th, 2012 | Posted by admin in Uncategorized - (0 Comments)

Xsemantics is finally out!

XSemantics is a DSL (implemented in Xtext itself) for writing type systems, reduction rules, interpreters (and in general relation rules) for languages implemented in Xtext. It then generates Java code that can be used in your language implemented in Xtext for scoping and validation (it can also generate a validator in Java).

Xsemantics is the successor of XTypeS, and completely replaces it (and it is not compatible with XTypeS syntax).

With respect to XTypeS, Xsemantics provides more features:

  • complete access to Java types
  • rich syntax for rules, by relying on Xtext’s Xbase (thus you basically have a richer Java syntax)
  • Java code generation takes place using Eclipse building mechanism
  • You can write any kind of rules, not only type systems, but also operational semantics rules (e.g., for the interpreter), etc.
  • Rules are not limited to exactly two parameters