Implementing Domain-Specific Languages with Xtext and Xtend
暫譯: 使用 Xtext 和 Xtend 實現領域特定語言

Lorenzo Bettini

  • 出版商: Packt Publishing
  • 出版日期: 2013-06-20
  • 售價: $2,210
  • 貴賓價: 9.5$2,100
  • 語言: 英文
  • 頁數: 342
  • 裝訂: Paperback
  • ISBN: 1782160302
  • ISBN-13: 9781782160304
  • 海外代購書籍(需單獨結帳)

相關主題

商品描述

If you know Eclipse then learning how to implement a DSL using Xtext is a natural progression. And this guide makes it easy to get started through a step-by-step approach accompanied with simple examples.

Overview

  • Learn to quickly develop a domain-specific language with Xtext
  • Implement any aspect of a DSL using Xtend, a fully featured Java-like programming language
  • Discover how to test a DSL implementation and how to customize runtime and IDE aspects of the DSL

In Detail

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.

What you will learn from this book

  • Learn to write an Xtext grammar for a DSL
  • Use Xtend as an alternative to Java to write cleaner, easier-to-read, and more maintainable code
  • Write constraint checks for a DSL using the validator mechanism
  • Learn how to write a code generator and an interpreter for a DSL
  • Discover how automatic symbol resolution works in Xtext and how to customize it
  • Build and deploy a DSL implementation so that others can install it
  • Get well versed with the typical Xtext development workflow

Approach

A step-by-step guide that enables you to quickly implement a DSL with Xtext and Xtend in a test-driven way with the aid of simplified examples.

商品描述(中文翻譯)

如果你熟悉 Eclipse,那麼學習如何使用 Xtext 實現一個領域特定語言(DSL)將是自然而然的進展。本指南通過逐步的方法和簡單的範例,使你能輕鬆入門。

概述
- 學習如何快速使用 Xtext 開發領域特定語言
- 使用 Xtend(一種功能齊全的類 Java 編程語言)實現 DSL 的各個方面
- 探索如何測試 DSL 實現,以及如何自定義 DSL 的運行時和 IDE 方面

詳細內容
Xtext 是一個開源的 Eclipse 框架,用於實現領域特定語言及其 IDE 功能。它讓你能夠非常快速地實現語言,最重要的是,它涵蓋了完整語言基礎設施的所有方面,從解析器、代碼生成器、解釋器等。

《使用 Xtext 和 Xtend 實現領域特定語言》將教你如何使用 Xtext 開發 DSL,這是一個用於實現領域特定語言的 Eclipse 框架。各章節如同教程,通過簡單易懂的範例描述 Xtext 的主要概念,如語法定義、驗證、代碼生成、自定義等。

本書首先簡要介紹與 DSL 實現相關的 Xtext 功能,包括在 IDE 中的集成,然後將介紹 Xtend,因為本書中的所有範例都將使用這種語言。接著,我們將解釋 Xtext 的主要概念,如驗證、代碼生成以及運行時和 UI 方面的自定義。到本書結束時,你將學會如何使用 Junit 測試在 Xtext 中實現的 DSL,以遵循測試驅動開發策略,幫助開發者實現可維護的代碼,並且更快、更乾淨。

本書在介紹高級概念(如類型檢查和範圍)時,採用了測試驅動的方法。書中還展示了如何構建和發布 DSL,以便其他人可以在 Eclipse 中安裝,並提供了如何在持續集成伺服器中無頭構建 DSL 的提示。

《使用 Xtext 和 Xtend 實現領域特定語言》旨在補充官方 Xtext 文檔,通過簡化的範例解釋主要概念,並教授在 Xtext 中實現 DSL 的最佳實踐。這是一本初學者指南,應該能幫助你為專業的 DSL 開發及其 Eclipse IDE 工具做好準備。