|
|
Textual DSLs - Concepts and Tooling
Domain Specific Languages are becoming important ingredients of software developers' tool chests. The mainstream is divided into two camps: external graphical DSLs (aka Modeling) and internal textual DSLs (via meta programming in languages like Ruby). As experience shows however, a sweet spot for DSLs is textual external DSLs: you can define any grammar you want, you can have domain specific constraint checks and error messages, and processing models is straight forward: generate code or interpret them based on the AST derived from the grammar. Another advantage - especially compared to graphical DSLs - is that they integrate natively with today's development infrastructure (CVS/SVN diff/merge). In this tutorial, I introduce DSLs in general, talk about advantages of textual external DSLs and explain how the Eclipse Xtext tool is used to develop editors for your custom DSLs that resemble modern IDEs with features such as syntax coloring, code completion, real-time constraint checking, customized outlines and inter-file navigation. I will also discuss how to process the models created with the editor. The goal is to provide you with all the concepts, tooling and pointers you need to build your own textual DSLs in a way that is efficient enough for practical project reality.
|