-
Book Overview & Buying
-
Table Of Contents
Implementing Domain-Specific Languages with Xtext and Xtend
By :
As we have seen in the previous chapters, the first aspect you need to customize in your DSL implementation in Xtext is the validator. Typically, the second aspect you need to customize is scoping, which is the main mechanism behind visibility and cross-reference resolution. As soon as the DSL needs some constructs for structuring the code, a custom scoping implementation is required. In particular, scoping and typing are often strictly connected and interdependent especially for object-oriented languages. For this reason, in this chapter, we will continue developing the SmallJava DSL introduced in the previous chapter. We will describe both local and global scoping and explain how to customize scoping using SmallJava as a case study.
All the components that deal with scoping are fully documented in the Xtext documentation. However, it looks like scoping is one of the hardest topics to fully understand when developing with Xtext (it is one of the most common subjects in...