Java Reference
In-Depth Information
CHAPTER 5
Developing a DSL Textual
Syntax
You've seen how it's possible to create a graphical concrete syntax using Graphical
Modeling Framework (GMF), but a graphical notation might not always be appropriate or
sufficient for a domain-specific language (DSL). In software development, textual syntaxes
are the most popular and well-supported means by which to work with programming lan-
guages, both general purpose and domain specific. Tools to generate parsers, abstract syn-
tax trees, and semantic analysis are quite mature and plentiful. Frameworks designed to
support editing, refactoring, versioning, comparison, and merging of textual languages are
also common, with Eclipse representing perhaps the most popular on the planet today.
As discussed already, expressing an abstract syntax using metamodels is superior
in many ways to using traditional methods of grammar definition. Fortunately,
it's possible to combine abstract syntax definition, grammar specification, and
the generation of textual editors that leverage a common underlying framework.
Given the importance of textual syntaxes, their support in a DSL Toolkit is essen-
tial. An attractive goal is to provide support for simultaneous editing of textual
and graphical elements for any language.
In the context of the Modeling project, two components within the Textual
Modeling Framework (TMF) project support the development of textual syn-
taxes for DSLs. Furthermore, as the concept of “language workbenches”
becomes increasingly popular, support continues to grow for the generation of
high-quality textual editors for a provided language grammar. Within Eclipse,
the IDE Meta-Tooling Platform (IMP) project aims to provide such support. In
the future, the components of TMF are expected to use IMP as a complementary
component for developing textual editors for languages based on an underlying
Ecore-based abstract syntax.
227
 
 
Search WWH ::




Custom Search