Book Image

Implementing Domain-Specific Languages with Xtext and Xtend

By : Lorenzo Bettini
Book Image

Implementing Domain-Specific Languages with Xtext and Xtend

By: Lorenzo Bettini

Overview of this book

Xtext is an open source Eclipse framework for implementing domain-specific languages together with its IDE functionalities. It lets you implement languages really quickly, and, most of all, it covers all aspects of a complete language infrastructure, starting from the parser, code generator, interpreter, and more. "Implementing Domain-Specific Languages with Xtext and Xtend" will teach you how to develop a DSL with Xtext, an Eclipse framework for implementing domain-specific languages. The chapters are like tutorials that describe the main concepts of Xtext such as grammar definition, validation, code generation, customizations, and many more, through uncomplicated and easy-to-understand examples. Starting with briefly covering the features of Xtext that are involved in a DSL implementation, including integration in an IDE, the book will then introduce you to Xtend as this language will be used in all the examples throughout the book. We then proceed by explaining the main concepts of Xtext, such as validation, code generation, and customizations of runtime and UI aspects. By the end of the book, you will have learned how to test a DSL implemented in Xtext with Junit, in order to follow a test-driven development strategy that will help the developer implement maintainable code that is much faster and cleaner. A test-driven approach is used throughout the book when presenting advanced concepts such as type checking and scoping. The book also shows you how to build and release a DSL so that it can be installed in Eclipse, and gives you hints on how to build the DSL headlessly in a continuous integration server. "Implementing Domain-Specific Languages with Xtext and Xtend" aims to complement the official Xtext documentation to explain the main concepts through simplified examples and to teach the best practices for a DSL implementation in Xtext. It is a Beginner's Guide which should set you up for professional development DSL and its Eclipse IDE tooling.
Table of Contents (21 chapters)
Implementing Domain-Specific Languages with Xtext and Xtend
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
13
Bibliography
Index

Acknowledgement

First of all, I would like to thank the main reviewers of this book, Jan Koehnlein, Henrik Lindberg, Pedro J. Molina, and Sebastian Zarnekow. Their constructive criticism, extensive suggestions, and careful error reporting helped extremely in improving the book. I also thank the additional reviewers, Marian Edu, Mayur Hule, and Neeshma Ramakrishnan.

I'm also grateful to all the people from Packt I dealt with, Shiksha Chaturvedi, Amber Dsouza, James Jones, James Keane, Anita Nayak, Hardik Patel, Neeshma Ramakrishnan, and Sonali S. Vernekar.

This book would not have been possible without the efforts that all the skilled Xtext developers have put in this framework. Most of them are always present in the Xtext forum and are very active in providing help to the users. Many other people not necessarily involved with Xtext development are always present in the forum and are willing to provide help and suggestions in solving typical problems about Xtext. They also regularly write on their own blogs about examples and best practices with Xtext. Most of the contents in this book is inspired by the material found on the forum and on such blogs. The list would be quite long, so I will only mention the ones with whom I interacted most: Meinte Boersma, Christian Dietrich, Moritz Eysholdt, Peter Friese, Dennis Huebner, Dr. Jan Koehnlein, Henrik Lindberg, Ed Merks, Alexander Nittka, Karsten Thoms, Hallvard Trætteberg, and Sebastian Zarnekow.

A very special thanks to Sven Efftinge, the project lead for Xtext and Xtend, for creating Xtext.

I'm also grateful to itemis Schweiz for sponsoring the writing of this book, and in particular, I'm thankful to Serano Colameo.

Last but not least, a big thank you to my parents for always supporting me through all these years. A warm thank you to my Silvia, the "rainbow" of my life, for being there and for not complaining about all the spare time that this book has stolen from us.