Java Reference
In-Depth Information
CHAPTER 3
Developing a DSL Abstract
Syntax
In this chapter, we walk through the development of a domain-specific language (DSL)
using the Eclipse Modeling Framework (EMF) and supporting components. Specifically,
we develop the DSL's abstract syntax using the Ecore metamodel. But first we cover some
basics on what to consider when creating a DSL and the different implementation strate-
gies you might want to employ when using EMF. Next, we provide an overview of EMF,
leaving detailed information to the topic [38] dedicated to this purpose. We cover some
additional components of EMF and Model Development Tools (MDT) that enable you to
further refine DSLs, and we develop a series of domain models for use in the sample
projects.
DISCLAIMER
The domain models developed as samples are constructed to illustrate
certain features of the associated tooling and, as such, should not neces-
sarily be considered “best practices” in some cases.
3.1 DSL Considerations
Many considerations are involved in creating a DSL. Does a model already exist
that is close enough? If so, can an existing model be extended, or is it fixed? Does
the model need to be based on a standard? Does the DSL lend itself to graphical
display and editing? Does the DSL require a textual syntax and editor? Will a
29
 
 
 
 
Search WWH ::




Custom Search