-
Book Overview & Buying
-
Table Of Contents
Implementing Domain-Specific Languages with Xtext and Xtend
By :
Xtext has a default mechanism for global scoping that allows you to refer to elements defined in a different file, possibly in a different project of the workspace; in particular, it uses the dependencies of the Eclipse projects. For Java projects, it uses the classpath of the projects. Of course, this mechanism relies on the global index.
Global scoping is implied by the fact that the default scoping mechanism always relies on an outer scope that consists of the visible object descriptions in the index.
With the default configuration in the MWE2, this mechanism for global scoping works out of the box. You can experiment with a project with some Entities DSL files. You can see, as illustrated in the following screenshot, that you can refer to the entities of another file; content assist works accordingly:

Before proceeding to the use of global scoping, it is worthwhile to learn how to write Junit tests that concern several input programs.
As hinted in the section The index...