What to put in the index?

As explained earlier in this chapter, everything that can be given a name will have a corresponding entry in the index; moreover, by default, each element of the index can be referred through its fully qualified name. However, only the references that use the qualified name syntax can refer to these elements using the index. In SmallJava, only classes can be referred with qualified names.

Therefore, it makes no sense to index those elements that cannot be directly accessed through a qualified name. In our DSL, this means that only classes should be indexed. Although the presence of entries in the index for SmallJava methods, fields, and local variables does not harm, still it occupies some memory space uselessly. Moreover, ...

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.