Implementing a DSL

For the end user, using a DSL is surely easier than writing XML code; however, the developer of the DSL is now left with the task of implementing it.

Implementing a DSL means developing a program that is able to read text written in that DSL, parse it, process it, and then possibly interpret it or generate code in another language. Depending on the aim of the DSL, this may require several phases, but most of these phases are typical of all implementations.

In this section we only hint at the main concepts of implementing a DSL.


From now on, throughout the book we will not distinguish, unless strictly required by the context, between DSL and programming language.


First of all, when reading a program written in a programming ...

Get Implementing Domain-Specific Languages with Xtext and Xtend now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.