Java Reference
In-Depth Information
the versions used to develop the samples in this topic. Therefore, this topic does
not include Xtext examples; you can visit the Xtext component Web site for
examples and additional information.
5.2
TCS
The TCS component of TMF provides an alternative to Xtext in defining a tex-
tual concrete syntax for a DSL. TCS is itself a DSL that facilitates specifying a
textual syntax by linking syntactic information to a metamodel. In doing so, it
allows an Ecore-based model to be used with a TCS model to generate a gram-
mar. Sufficient richness of definition allows TCS to generate both model-to-text
and text-to-model capabilities.
TCS can produce an annotated grammar using an ATL transformation to be
used by the ANTLR parser generator. This provides the injector component for
text-to-model translation. An extractor is derived from the language metamodel
and TCS model and is used to provide model-to-text translation. The extractor
is based on an interpreter that may be used for any language, although it is pos-
sible to generate an extractor per DSL.
As with Xtext, TCS does not yet use the IMP project for production of its
text editor. Instead, TCS uses the Textual Generic Editor (TGE), which builds
upon TCS to provide the editor, outline view, and text-to-model traceability. TCS
does provide a “zoo” of languages that have been defined and are available from
the project Web site.
At the time of this writing, no downloads are available for TCS, although
code is present in the CVS repository. Therefore, this topic does not provide
detailed examples or sample projects at this time. When TCS and Xtext mature
and provide integration with IMP, the topic's sample applications likely will
include a textual syntax using one of these components.
5.3 Summary
The ability to define and generate support for textual concrete syntaxes is essen-
tial for the future of DSL tooling. With Xtext and TCS providing the beginnings
of this last major element in our Eclipse DSL Toolkit, look to the TMF project
website and future editions of this topic for detailed information on their usage.
Next, we'll explore model transformation, beginning with model-to-model
transformation using QVT Operational Mapping Language.
 
 
 
Search WWH ::




Custom Search