Tutorials Xtext, Xbase

Xtext is a framework for development of programming languages and domain specific languages. It covers all aspects of a complete language infrastructure, from parsers, over linker, compiler or interpreter to fully-blown top-notch Eclipse IDE integration. It comes with good defaults for all these aspects and at the same time every single aspect can be tailored to your needs.
Xbase is a partial programming language implemented in Xtext and is meant to be embedded and extended within other programming languages and domain-specific languages (DSL) written in Xtext. Xbase is not a new programming language! It’s the basis for a plethora of new programming languages and domain-specific languages.

The JvmModelInferrer, the debugger and Xbase in Xtext 2.3

In previous posts, I had blogged about some experiments done with Xtext 2 wonderful mechanisms to access Java types and to reuse Xbase expressions; however, when generating code, I was using the "manual way". That is to say, I was not using the JvmModelInferrer mechanism; the mechanism of JvmModelInferrer allows to define a mapping from your DSL elements to Java elements. You'll then have for free a complete integration of Java into your DSL, and viceversa (yes, from Java you can jump directly to your DSL elements starting from generated classes, methods, etc.). And by the way, you'll also have [...]

Di |2020-04-27T09:08:21+00:00maggio 22nd, 2012|

Xtext 2.1: using Xbase variables

On a previous post, I started to blog about how Xtext 2.1 made it extremely easy to have a powerful integration with Java thanks to Xbase, a new expression language library which allows to integrate (Java-like) expressions in your DSL. I had also blogged about using JVM types from your DSL. In this post, IÔÇÖd like to continue to inspect how to use only a small part of Xbase and still have the control on the generation part: in particular (for other projects) I would like to retain the control on the generation for my model, while relying on the [...]

Di |2012-06-08T11:14:50+00:00dicembre 26th, 2011|

Xtext 2.1: using Xbase expressions

On a previous post, I started to blog about how Xtext 2.1 made it extremely easy to have a powerful integration with Java in your DSL. In this post I'd like to continue to experiment with this mechanism, and in particular I'll start to use Xbase, a new expression language library which allows to integrate (Java-like) expressions in your DSL. If you take a look at the Five simple steps to your JVM language, you'll see the power of Xbase! Moreover, in Xtext 2.1, using Xbase is even easier since by writing only a AbstractModelInferrer you'll get a full integration [...]

Di |2012-06-08T11:15:15+00:00novembre 23rd, 2011|

Using JVM Types in Xtext 2.1 and the ImportManager

Xtext 2.1 made it even easier to access Java types from your DSL; you can find some paragraphs in the documentation. In particular, the new features of Xbase seem to make this integration even more powerful! This paragraph in the documentation briefly describe how to refer to Java elements using JVM Types, and then dedicates much more room to accessing Java Types using Xbase. In this post, I'd like to document some my experiments/experiences in accessing JVM Types without using Xbase, and in particular, not by using the good ol' Domainmodel example, but something even more simpler, so that I [...]

Di |2012-06-08T11:15:38+00:00novembre 21st, 2011|
Torna in cima