Customizations

Depending on the complexity of your DSL, you might want to customize the default implementation of several components of Xbase, such as scoping and validation. This can be achieved by subclassing the corresponding Xbase classes and by specifying the bindings in the Guice module. Note that the Xbase scope provider implementation is not based on AbstractDeclarativeScopeProvider, thus, you cannot rely on the convention for method names that we used in Chapter 10, Scoping; you will have to redefine the getScope method. Moreover, you will have to inspect the implementation of Xbase scope provider and validator to understand which method to override.

It is also possible to override some rules of the Xbase grammar in order to change the ...

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.