Java Reference
In-Depth Information
At the time of this writing, the TMF project is just underway, and the IMP
project is updating its support to allow for the generation of editors for the
Eclipse 3.3 platform. Unfortunately, much work remains to be done before a
comprehensive chapter on developing a DSL textual syntax can be written that
will not be outdated as soon as it is published. Therefore, this chapter introduces
each of the two TMF components at a high level, leaving details to the sample
projects and a subsequent version of this topic. In the meantime, you can visit
the TMF home page and wiki to get the latest information on the development
progress of these important components.
5.1 Xtext
Xtext is a component of TMF that supports the development of a DSL grammar
using an Extended Backus-Naur Form (EBNF)-like language, which can use this
to generate an Ecore-based metamodel, Eclipse-based text editor, and correspon-
ding ANTLR-based parser. Unfortunately, the default nature of Xtext is to begin
with a grammar and produce an Ecore model, rather than begin with an Ecore
model and derive the grammar. Nevertheless, it allows for transformation to and
from an Ecore-based model, thereby providing for interoperability with EMF-
based technologies such as QVT Operational Mapping Language (QVTO) and
Xpand. Additionally, Xtext allows a grammar specification to reference an exist-
ing metamodel by using an import mechanism, which gets us closer to the ideal
case.
The Checks language is used in the context of the generated metamodel to
validate the language semantics. The editor can provide validation to give the
user feedback in the form of error and warning messages, complete with the
expected Eclipse decorators and markers. Alternatively, validation can be pro-
vided during workflow of the model instances in the context of model-to-model
or model-to-text transformation. Furthermore, Xtext registers an EMF
ResourceFactory for the generated DSL file extension, allowing it to read in (but
not write) an instance of the model from the textual syntax.
Although Xtext is capable of generating a functional Eclipse textual editor,
complete with syntax highlighting, code assist, outline view, and so on, it does
not yet use the IMP project. Hopefully, Xtext and its TMF counterpart, Textual
Concrete Syntax (TCS), will provide interoperability with IMP in the future,
thereby supporting the proper separation of concerns and reducing duplicated
effort in the area of textual editor generation.
At the time of this writing, Xtext is available only from the GMT downloads
and includes dependencies to underlying technologies that are incompatible with
 
Search WWH ::




Custom Search