万本电子书0元读

万本电子书0元读

顶部广告

Implementing Domain Specific Languages with Xtext and Xtend电子书

售       价:¥

3人正在读 | 0人评论 9.8

作       者:Lorenzo Bettini

出  版  社:Packt Publishing

出版时间:2013-08-21

字       数:185.1万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
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.This book is for programmers who want to learn about Xtext and how to use it to implement a DSL (or a programming language) together with Eclipse IDE tooling. It assumes that the user is familiar with Eclipse and its functionality. Existing basic knowledge of a compiler implementation would be useful, though not strictly required, since the book will explain all the stages of the development of a DSL.
目录展开

Implementing Domain-Specific Languages with Xtext and Xtend

Table of Contents

Implementing Domain-Specific Languages with Xtext and Xtend

Credits

About the Author

Acknowledgement

About the Reviewers

www.PacktPub.com

Support files, eBooks, discount offers, and more

Why Subscribe?

Free Access for Packt account holders

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Errata

Piracy

Questions

1. Implementing a DSL

Domain Specific Languages

So, why should you create a new language?

Implementing a DSL

Parsing

The Abstract Syntax Tree (AST)

IDE integration

Syntax highlighting

Background parsing

Error markers

Content assist

Hyperlinking

Quickfixes

Outline

Automatic build

Summarizing DSL implementation

Enter Xtext

Installing Xtext

Let's try Xtext

The aim of this book

Summary

2. Creating Your First Xtext Language

A DSL for entities

Creating the project

Xtext projects

Modifying the grammar

Let's try the Editor

The Xtext generator

The Eclipse Modeling Framework (EMF)

Improvements to the DSL

Dealing with types

Summary

3. The Xtend Programming Language

An introduction to Xtend

Using Xtend in your projects

Xtend – a better Java with less "noise"

Extension methods

The implicit variable – it

Lambda expressions

Multi-line template expressions

Additional operators

Polymorphic method invocation

Enhanced switch expressions

Debugging Xtend code

Summary

4. Validation

Validation in Xtext

Default validators

Custom validators

Quickfixes

Textual modification

Model modification

Quickfixes for default validators

Summary

5. Code Generation

Introduction to code generation

Writing a code generator in Xtend

Integration with the Eclipse build mechanism

Standalone command-line compiler

Summary

6. Customizations

Dependency injection

Google Guice in Xtext

Customizations of IDE concepts

Labels

The Outline view

Customizing other aspects

Custom formatting

Other customizations

Summary

7. Testing

Introduction to testing

Junit 4

The ISetup interface

Implementing tests for your DSL

Testing the parser

Testing the validator

Testing the formatter

Testing code generation

Test suite

Testing the UI

Testing the content assist

Testing workbench integration

Testing the editor

Other UI testing frameworks

Testing and modularity

Clean code

Summary

8. An Expression Language

The Expressions DSL

Creating the project

Digression on Xtext grammar rules

The grammar for the Expressions DSL

Left recursive grammars

Associativity

Precedence

The complete grammar

Forward references

Typing expressions

Type provider

Validator

Writing an interpreter

Using the interpreter

Summary

9. Type Checking

SmallJava

Creating the project

SmallJava grammar

Rules for declarations

Rules for statements and syntactic predicates

Rules for expressions

The complete grammar

Utility methods

Testing the grammar

First validation rules

Checking cycles in class hierarchies

Checking member selections

Checking return statements

Checking for duplicates

Type checking

Type provider for SmallJava

Type conformance (subtyping)

Expected types

Checking type conformance

Checking method overriding

Improving the UI

Summary

10. Scoping

Cross-reference resolution in Xtext

Containments and cross-references

The index

Qualified names

Exported objects

The linker and the scope provider

Component interaction

Custom scoping

Scope for blocks

Scope for inheritance and member visibility

Visibility and accessibility

Filtering unwanted objects from the scope

Global scoping

Packages and imports

The index and the containers

Checking duplicates across files

Providing a library

Default imports

Using the library outside Eclipse

Using the library in the type system and scoping

Dealing with super

What to put in the index?

Additional automatic features

Summary

11. Building and Releasing

Release engineering

Headless builds

Target platforms

Continuous integration

Introduction to Buckminster

Installing Buckminster

Using the Xtext Buckminster wizard

Building the p2 repository from Eclipse

Customizations

Defining the target platform

Build headlessly

Maintaining the examples of this book

Summary

12. Xbase

Getting introduced with Xbase

The Expressions DSL with Xbase

Creating the project

The IJvmModelInferrer interface

Code generation

Debugging

The Entities DSL with Xbase

Creating the project

Defining attributes

Defining operations

Imports

Customizations

Summary

13. Bibliography

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部