Java Reference
In-Depth Information
1.5.1 Abstract Syntax Development
The core of a DSL is its abstract syntax, which is used in the development of
almost every artifact that follows, including graphical concrete syntax, model-to-
model transformations, and model-to-text transformations. Typically, the first
element of a DSL to be developed is its abstract syntax; for this we use the Eclipse
Modeling Framework (EMF).
EMF Project
EMF's Ecore model serves as the metamodel for defining our DSL. We can fur-
ther refine the structure and semantics of our DSL using Object Constraint
Language (OCL), in addition to providing support for transactions, query, and
validation.
Much has been written on the subject of little languages, domain-specific lan-
guages, language workbenches [29], and so on. Models provide a superior
language-definition format to traditional approaches such as BNF because a
model described in terms of Ecore is more expressive and can have a number of
concrete syntaxes defined for generating textual and graphical editors. Chapter
3, “Developing a DSL Abstract Syntax,” covers the use of EMF in developing a
DSL abstract syntax.
Several components available from the Modeling project extend and com-
plement the core capabilities of EMF. Within EMF are components that provide
query, validation, and transaction features, in addition to an implementation of
Service Data Objects (SDOs). An incubation project named EMF Technology
(EMFT) exists for the sole purpose of providing extensions to the core function-
ality of EMF. When technologies developed within the EMFT project mature suf-
ficiently, they can graduate into EMF itself or another project within Modeling,
or they can become full-fledged projects on their own.
Model Transaction
The Model Transaction component of EMF provides transactional support for
editing EMF models. Managing access to a transactional editing domain enables
multiple clients to read and write models. A transaction workspace integration
allows the transaction layer to work with the Eclipse undoable operations frame-
work. Section 10.7, “Command Infrastructure,” includes more information on
the transaction framework in the context of its use in GMF.
Model Validation
A Model Validation framework complements the transaction framework, to pro-
vide model integrity support. Although EMF core provides basic validation
Search WWH ::




Custom Search