Book Image

Implementing Domain-Specific Languages with Xtext and Xtend - Second Edition

By : Lorenzo Bettini
4 (1)
Book Image

Implementing Domain-Specific Languages with Xtext and Xtend - Second Edition

4 (1)
By: Lorenzo Bettini

Overview of this book

Xtext is an open source Eclipse framework for implementing domain-specific languages together with IDE functionalities. It lets you implement languages really quickly; most of all, it covers all aspects of a complete language infrastructure, including the parser, code generator, interpreter, and more. This book will enable you to implement Domain Specific Languages (DSL) efficiently, together with their IDE tooling, with Xtext and Xtend. Opening with brief coverage of Xtext features involved in 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. You will then explore the typical programming development workflow with Xtext when we modify the grammar of the DSL. Further, the Xtend programming language (a fully-featured Java-like language tightly integrated with Java) will be introduced. We then explain the main concepts of Xtext, such as validation, code generation, and customizations of runtime and UI aspects. You will have learned how to test a DSL implemented in Xtext with JUnit and will progress to advanced concepts such as type checking and scoping. You will then integrate the typical Continuous Integration systems built in to Xtext DSLs and familiarize yourself with Xbase. By the end of the book, you will manually maintain the EMF model for an Xtext DSL and will see how an Xtext DSL can also be used in IntelliJ.
Table of Contents (25 chapters)
Implementing Domain-Specific Languages with Xtext and Xtend - Second Edition
Credits
Foreword
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface
Preface to the second edition
14
Conclusions
Bibliography
Index

Acknowledgments

First of all, I would like to thank the reviewer of this book, Jan Koehnlein. His constructive criticism, extensive suggestions, and careful error reporting helped extremely in improving the book. Since this is a second edition, which contains some material from the previous edition, I am also grateful to the reviewers of the first edition, Henrik Lindberg, Pedro J. Molina, and Sebastian Zarnekow.

I'm also grateful to all the people from Packt I dealt with, Sweta Basu and Reshma Raman. I would also like to thank Divij Kotian and Rutuja Vaze for their continuous support throughout the book.

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. Many contents in this book are 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: Christian Dietrich, Moritz Eysholdt, Dennis Huebner, Jan Koehnlein, Anton Kosyakov, Henrik Lindberg, Ed Merks, Holger Schill, Miro Spoenemann, and Karsten Thoms.

I am particularly grateful to Sebastian Zarnekow, one of the main Xtext committers. In the last few years, he has always been willing to help me to get familiar with most of the things about Xtext and Xbase internals I know today.

A very special thank you to Sven Efftinge, the project lead of Xtext, for creating such a cool and impressive framework. Not to mention the nice foreword Sven wrote for this second edition. I am also grateful to Sven for nominating me as an Xtext committer.

I am grateful to itemis Schweiz for sponsoring the writing of this book, and in particular, I am 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.