Google Guice in Xtext

All Xtext components rely on Google Guice dependency injection, even the classes that Xtext generates for your DSL. This means that in your classes, if you need to use a class from Xtext, you just have to declare a field of such type with the @Inject annotation.

The injection mechanism allows a DSL developer to customize basically every component of the Xtext framework.

When running the MWE2 workflow, Xtext generates both a fully configured module and an empty module derived from the generated one. Customizations are added to the empty stub module. The generated module should not be touched. Xtext generates one runtime module that defines the non-user interface related parts of the configuration and one specific for usage in ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.