O'Reilly logo

Implementing Domain-Specific Languages with Xtext and Xtend by Lorenzo Bettini

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

Generating code from your DSL sources is a typical task when developing a DSL. Xtend provides many interesting features that make writing a code generator really easy.

Xtext automatically integrates your code generator into the Eclipse building infrastructure so that building takes place incrementally upon file saving, just like in the Eclipse JDT. You can also get a command-line standalone compiler so that your DSL programs can be compiled without Eclipse.

In the next chapter you will learn about the Dependency Injection framework Google Guice, on which Xtext heavily relies for customizing all of its features. In particular, you will also see how to customize the runtime and the IDE concepts for your DSL.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required