Game Development Reference
In-Depth Information
External DSLs
Juxtaposed with internal DSLs, external DSLs are self-contained languages featuring their own grammar and a
standalone infrastructure. Hence, an external DSL can be tailored exactly to the requirements of the domain, using
semantically meaningful keywords and grammar rules. Similar to GPLs, a program written in an external DSL is
processed in the form of an abstract syntax tree (AST). As a consequence, one needs to define proper processing
tools in order to really benefit from an external DSL. The creation of external DSLs is increasingly supported by tools
commonly called language workbenches, like Xtext, MetaEdit+, MPS, and Microsoft's Software Factories, which,
among other things, feature rich support for the creation of IDE tooling. For example, based on a single syntax
definition file, Xtext creates the corresponding abstract syntax definition file, a fully featured parser, and a serializer, as
well as a rich plug-in editor with syntax highlighting, code completion and validation, and quick fixes by default
(see Figure 13-1 ).
Figure 13-1. Dialog language definition in Xtext (top) and complying sample program in generated default editor
(bottom)
Technical Orientation
In addition to their environment, DSLs differ in their technical orientation. This is a qualitative distinction compared
to the one above, but it proves useful to understand the potential in the application of DSLs. The internal DSL
integrated in LINQ, for example, is a highly technically oriented, internal DSL. It utilizes the ability to query structured
 
Search WWH ::




Custom Search