Implementing domain-specific languages with Xtext and Xtend: learn how to implement a DSL with Xtext and Xtend using easy-to-understand examples and best practices
Gespeichert in:
1. Verfasser: | |
---|---|
Format: | Buch |
Sprache: | English |
Veröffentlicht: |
Birmingham ; Mumbai
Packt Publishing
August 2016
|
Ausgabe: | Second edition |
Schriftenreihe: | Community experience distilled
|
Schlagworte: | |
Online-Zugang: | Inhaltsverzeichnis |
Beschreibung: | Auf dem Umschlag: "Foreword by Sven Efftinge, Founder of Xtext and Xtend" Literaturverzeichnis Seite 389-390 |
Beschreibung: | xviii, 397 Seiten Illustrationen, Diagramme |
ISBN: | 9781786464965 |
Internformat
MARC
LEADER | 00000nam a2200000 c 4500 | ||
---|---|---|---|
001 | BV043825223 | ||
003 | DE-604 | ||
005 | 20190619 | ||
007 | t | ||
008 | 161013s2016 a||| |||| 00||| eng d | ||
020 | |a 9781786464965 |c pbk. |9 978-1-78646-496-5 | ||
035 | |a (OCoLC)965315593 | ||
035 | |a (DE-599)GBV86885039X | ||
040 | |a DE-604 |b ger |e rda | ||
041 | 0 | |a eng | |
049 | |a DE-523 |a DE-11 |a DE-858 |a DE-473 |a DE-703 | ||
050 | 0 | |a QA76.7 | |
084 | |a ST 240 |0 (DE-625)143625: |2 rvk | ||
084 | |a ST 250 |0 (DE-625)143626: |2 rvk | ||
100 | 1 | |a Bettini, Lorenzo |e Verfasser |0 (DE-588)1045679631 |4 aut | |
245 | 1 | 0 | |a Implementing domain-specific languages with Xtext and Xtend |b learn how to implement a DSL with Xtext and Xtend using easy-to-understand examples and best practices |c Lorenzo Bettini |
250 | |a Second edition | ||
264 | 1 | |a Birmingham ; Mumbai |b Packt Publishing |c August 2016 | |
300 | |a xviii, 397 Seiten |b Illustrationen, Diagramme | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
490 | 0 | |a Community experience distilled | |
500 | |a Auf dem Umschlag: "Foreword by Sven Efftinge, Founder of Xtext and Xtend" | ||
500 | |a Literaturverzeichnis Seite 389-390 | ||
650 | 0 | 7 | |a Eclipse |g Programmierumgebung |0 (DE-588)4768065-9 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a Domänenspezifische Programmiersprache |0 (DE-588)7585264-0 |2 gnd |9 rswk-swf |
689 | 0 | 0 | |a Domänenspezifische Programmiersprache |0 (DE-588)7585264-0 |D s |
689 | 0 | 1 | |a Eclipse |g Programmierumgebung |0 (DE-588)4768065-9 |D s |
689 | 0 | |5 DE-604 | |
856 | 4 | 2 | |m Digitalisierung UB Bamberg - ADAM Catalogue Enrichment |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=029236127&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
999 | |a oai:aleph.bib-bvb.de:BVB01-029236127 |
Datensatz im Suchindex
_version_ | 1804176683776868352 |
---|---|
adam_text | Table of Contents
Preface___________________________________________________________________ix
Chapter 1: Implementing a DSL______________________________________________1
Domain-Specific Languages 1
Need for a new language 2
Implementing a DSL 3
Parsing 4
The Abstract Syntax Tree (AST) 6
IDE integration 8
Syntax highlighting 8
Background validation 9
Error markers 9
Content assist 9
Hyperlinking 10
Quickfixes 10
Outline 10
Automatic build 11
Summarizing DSL implementation 11
Enter Xtext 12
Installing Xtext 12
Let s try Xtext 13
The aim of this book 19
Summary 20
Chapter 2: Creating Your First Xtext Language_____________________________21
A DSL for entities 21
Creating the project 22
Xtext projects 23
Modifying the grammar 23
Let s try the Editor 26
----------------------------------- [i] ------------------------------------
Table of Contents----------------------------------------------
The Xtext generator
The Eclipse Modeling Framework (EMF)
Improvements to the DSL
Dealing with types
Summary
Chapter 3: Working with the Xtend Programming Language
An introduction to Xtend
Using Xtend in your projects
Xtend - a better Java with less noise”
Types
Methods
Fields and Variables
Operators
Syntactic sugar
Static members and inner types
Literals
Extension methods
The implicit variable - it
Lambda expressions
Multi-line template expressions
Additional operators
Polymorphic method invocation
Enhanced switch expressions
Other Xtend expressions
30
32
35
36
40
41
41
42
44
45
46
47
48
48
48
49
50
53
53
57
60
62
63
65
Xtend IDE 66
Debugging Xtend code 66
Summary 68
Chapter 4: Validation 69
Validation in Xtext 69
Default validators 70
Custom validators 72
Quickfixes 77
Textual modification 80
Model modification 81
Quickfixes for default validators 82
Summary 85
Chapter 5: Code Generation 87
Introduction to code generation 87
Writing a code generator in Xtend 88
Integration with the Eclipse build mechanism 91
m
Table q[Contents
Standalone command-line compiler 94
Summary 97
Chapter 6: Customizing Xtext Components 99
Dependency injection 99
Google Guice in Xtext 104
Customizations of IDE concepts 106
Labels 106
The Outline view 110
Customizing other aspects 112
Custom formatting 112
Other customizations 118
Summary 121
Chapter 7: Testing 123
Introduction to testing 123
JUnit 4 125
The ISetup interface 126
Implementing tests for your DSL 127
Testing the parser 128
Testing the validator 130
Testing the formatter 133
Testing code generation 136
Test suite 140
Testing the Ul 140
Testing the content assist 141
Testing workbench integration 143
Testing the editor 145
Learning Tests 146
Testing the outline 149
Other testing frameworks 150
Testing and modularity 150
Clean code 153
Summary 154
Chapter 8: An Expression Language 155
The Expressions DSL 156
Creating the project 156
Digression on Xtext grammar rules 157
The grammar for the Expressions DSL 159
Left recursive grammars 162
Associativity 165
Precedence 168
[HU
Table of Contents ...-----
The complete grammar 171
Forward references 173
Custom Content Assist 176
Typing expressions 179
Loose type computation, strict type checking 180
Type computer 181
Validator 184
Writing an interpreter 188
Using the interpreter 191
Optimizations and fine tuning 194
Summary 197
Chapter 9: Type Checking 199
SmallJava 199
Creating the project 200
SmallJava grammar 200
Rules for declarations 201
Rules for statements and syntactic predicates 202
Rules for expressions 205
Rule fragments 208
The complete grammar 209
Utility methods 211
Testing the grammar 212
First validation rules 214
Checking cycles in class hierarchies 214
Checking member selections 216
Checking return statements 217
Checking for duplicates 219
Type checking 222
Type computer for SmallJava 222
Type conformance (subtyping) 225
Expected types 227
Checking type conformance 229
Checking method overriding 231
Improving the Ul 232
Summary 234
Chapter 10: Scoping 237
Cross-reference resolution in Xtext 237
Containments and cross-references 238
The index 238
Qualified names 239
Exported objects 240
[iv]
Table of Contents
The linker and the scope provider 242
Component interaction 246
Custom scoping 247
Scope for blocks 247
Scope for inheritance and member visibility 251
Visibility and accessibility 256
Filtering unwanted objects from the scope 260
Global scoping 261
Packages and imports 262
The index and the containers 266
Checking duplicates across files 268
Providing a library 270
Default imports 271
Using the library outside Eclipse 272
Using the library in the type system and scoping 275
Classes of the same package 278
Dealing with super 280
What to put in the index? 281
Additional automatic features 282
Providing a project wizard 283
Summary 284
Chapter 11: Continuous Integration________________________________________285
Eclipse features and p2 repositories 286
Release engineering 289
Headless builds 289
Target platforms 289
Continuous integration 290
Introduction to Maven/Tycho 291
Using the Xtext project wizard 292
Running the Maven build 296
Customizing the feature 298
Using and customizing the target platform 298
Customizing the pom files 302
Continuous Integration systems 302
Maintaining the examples of this book 303
Your DSL editor on the Web 303
IntelliJ and Gradle 305
Pitfalls with Maven/Tycho 308
Versioning 309
PDE test problems 309
----------------------------------- [v] -------------------------------------
Table of Contents
Concluding remarks
Installation requirements
Make contributions easy
Summary
310
310
311
312
313
V/napwr i*. auajc______ 313
Introduction to Xbase 315
The common Java type model 316
The Expressions DSL with Xbase 316
Creating the project 319
The IJvmModellnferrer interface 322
Code generation 323
Debugging 324
The Entities DSL with Xbase
Creating the project 324
Defining attributes 325
Defining operations 328
Imports 332
Validation 333
Additional Xbase features 334
Annotations 334
Reusing Java error markers 335
Using extension 337
Using type parameters 338
Formatter 340
Further Customizations 340
Summary 341
Chapter 13: Advanced Topics 343
Defining the Ecore model
Creating the Xtext project
Fixing the StandaloneSetup
Tweaking the Ecore model
Derived State
Adding new rules to the language
Switching to an imported Ecore model
Generating EMF classes during the build
Customizing the EMF Java classes
Xcore
Creating the Xcore project
Creating the Xtext project from an existing Xcore model
344
344
345
349
350
353
358
358
362
364
366
366
367
Table of Contents
Modifying the Xcore model 369
Extending Xbase 370
Overriding a rule in an Xtext grammar 370
Customizing the type system 372
Testing the type computer 373
Customizing the validator 374
Customizing the compiler 376
Using the type system in the compiler 381
Testing the compiled code 382
Improving code generation 383
Smoke tests 385
Summary 386
Chapter 14: Conclusions 387
Bibliography 389
Index 391
|
any_adam_object | 1 |
author | Bettini, Lorenzo |
author_GND | (DE-588)1045679631 |
author_facet | Bettini, Lorenzo |
author_role | aut |
author_sort | Bettini, Lorenzo |
author_variant | l b lb |
building | Verbundindex |
bvnumber | BV043825223 |
callnumber-first | Q - Science |
callnumber-label | QA76 |
callnumber-raw | QA76.7 |
callnumber-search | QA76.7 |
callnumber-sort | QA 276.7 |
callnumber-subject | QA - Mathematics |
classification_rvk | ST 240 ST 250 |
ctrlnum | (OCoLC)965315593 (DE-599)GBV86885039X |
discipline | Informatik |
edition | Second edition |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>01883nam a2200409 c 4500</leader><controlfield tag="001">BV043825223</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20190619 </controlfield><controlfield tag="007">t</controlfield><controlfield tag="008">161013s2016 a||| |||| 00||| eng d</controlfield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9781786464965</subfield><subfield code="c">pbk.</subfield><subfield code="9">978-1-78646-496-5</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)965315593</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)GBV86885039X</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield><subfield code="e">rda</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">eng</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-523</subfield><subfield code="a">DE-11</subfield><subfield code="a">DE-858</subfield><subfield code="a">DE-473</subfield><subfield code="a">DE-703</subfield></datafield><datafield tag="050" ind1=" " ind2="0"><subfield code="a">QA76.7</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 240</subfield><subfield code="0">(DE-625)143625:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 250</subfield><subfield code="0">(DE-625)143626:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Bettini, Lorenzo</subfield><subfield code="e">Verfasser</subfield><subfield code="0">(DE-588)1045679631</subfield><subfield code="4">aut</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">Implementing domain-specific languages with Xtext and Xtend</subfield><subfield code="b">learn how to implement a DSL with Xtext and Xtend using easy-to-understand examples and best practices</subfield><subfield code="c">Lorenzo Bettini</subfield></datafield><datafield tag="250" ind1=" " ind2=" "><subfield code="a">Second edition</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Birmingham ; Mumbai</subfield><subfield code="b">Packt Publishing</subfield><subfield code="c">August 2016</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">xviii, 397 Seiten</subfield><subfield code="b">Illustrationen, Diagramme</subfield></datafield><datafield tag="336" ind1=" " ind2=" "><subfield code="b">txt</subfield><subfield code="2">rdacontent</subfield></datafield><datafield tag="337" ind1=" " ind2=" "><subfield code="b">n</subfield><subfield code="2">rdamedia</subfield></datafield><datafield tag="338" ind1=" " ind2=" "><subfield code="b">nc</subfield><subfield code="2">rdacarrier</subfield></datafield><datafield tag="490" ind1="0" ind2=" "><subfield code="a">Community experience distilled</subfield></datafield><datafield tag="500" ind1=" " ind2=" "><subfield code="a">Auf dem Umschlag: "Foreword by Sven Efftinge, Founder of Xtext and Xtend"</subfield></datafield><datafield tag="500" ind1=" " ind2=" "><subfield code="a">Literaturverzeichnis Seite 389-390</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Eclipse</subfield><subfield code="g">Programmierumgebung</subfield><subfield code="0">(DE-588)4768065-9</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Domänenspezifische Programmiersprache</subfield><subfield code="0">(DE-588)7585264-0</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="689" ind1="0" ind2="0"><subfield code="a">Domänenspezifische Programmiersprache</subfield><subfield code="0">(DE-588)7585264-0</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2="1"><subfield code="a">Eclipse</subfield><subfield code="g">Programmierumgebung</subfield><subfield code="0">(DE-588)4768065-9</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">Digitalisierung UB Bamberg - ADAM Catalogue Enrichment</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=029236127&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="999" ind1=" " ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-029236127</subfield></datafield></record></collection> |
id | DE-604.BV043825223 |
illustrated | Illustrated |
indexdate | 2024-07-10T07:36:05Z |
institution | BVB |
isbn | 9781786464965 |
language | English |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-029236127 |
oclc_num | 965315593 |
open_access_boolean | |
owner | DE-523 DE-11 DE-858 DE-473 DE-BY-UBG DE-703 |
owner_facet | DE-523 DE-11 DE-858 DE-473 DE-BY-UBG DE-703 |
physical | xviii, 397 Seiten Illustrationen, Diagramme |
publishDate | 2016 |
publishDateSearch | 2016 |
publishDateSort | 2016 |
publisher | Packt Publishing |
record_format | marc |
series2 | Community experience distilled |
spelling | Bettini, Lorenzo Verfasser (DE-588)1045679631 aut Implementing domain-specific languages with Xtext and Xtend learn how to implement a DSL with Xtext and Xtend using easy-to-understand examples and best practices Lorenzo Bettini Second edition Birmingham ; Mumbai Packt Publishing August 2016 xviii, 397 Seiten Illustrationen, Diagramme txt rdacontent n rdamedia nc rdacarrier Community experience distilled Auf dem Umschlag: "Foreword by Sven Efftinge, Founder of Xtext and Xtend" Literaturverzeichnis Seite 389-390 Eclipse Programmierumgebung (DE-588)4768065-9 gnd rswk-swf Domänenspezifische Programmiersprache (DE-588)7585264-0 gnd rswk-swf Domänenspezifische Programmiersprache (DE-588)7585264-0 s Eclipse Programmierumgebung (DE-588)4768065-9 s DE-604 Digitalisierung UB Bamberg - ADAM Catalogue Enrichment application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=029236127&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA Inhaltsverzeichnis |
spellingShingle | Bettini, Lorenzo Implementing domain-specific languages with Xtext and Xtend learn how to implement a DSL with Xtext and Xtend using easy-to-understand examples and best practices Eclipse Programmierumgebung (DE-588)4768065-9 gnd Domänenspezifische Programmiersprache (DE-588)7585264-0 gnd |
subject_GND | (DE-588)4768065-9 (DE-588)7585264-0 |
title | Implementing domain-specific languages with Xtext and Xtend learn how to implement a DSL with Xtext and Xtend using easy-to-understand examples and best practices |
title_auth | Implementing domain-specific languages with Xtext and Xtend learn how to implement a DSL with Xtext and Xtend using easy-to-understand examples and best practices |
title_exact_search | Implementing domain-specific languages with Xtext and Xtend learn how to implement a DSL with Xtext and Xtend using easy-to-understand examples and best practices |
title_full | Implementing domain-specific languages with Xtext and Xtend learn how to implement a DSL with Xtext and Xtend using easy-to-understand examples and best practices Lorenzo Bettini |
title_fullStr | Implementing domain-specific languages with Xtext and Xtend learn how to implement a DSL with Xtext and Xtend using easy-to-understand examples and best practices Lorenzo Bettini |
title_full_unstemmed | Implementing domain-specific languages with Xtext and Xtend learn how to implement a DSL with Xtext and Xtend using easy-to-understand examples and best practices Lorenzo Bettini |
title_short | Implementing domain-specific languages with Xtext and Xtend |
title_sort | implementing domain specific languages with xtext and xtend learn how to implement a dsl with xtext and xtend using easy to understand examples and best practices |
title_sub | learn how to implement a DSL with Xtext and Xtend using easy-to-understand examples and best practices |
topic | Eclipse Programmierumgebung (DE-588)4768065-9 gnd Domänenspezifische Programmiersprache (DE-588)7585264-0 gnd |
topic_facet | Eclipse Programmierumgebung Domänenspezifische Programmiersprache |
url | http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=029236127&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT bettinilorenzo implementingdomainspecificlanguageswithxtextandxtendlearnhowtoimplementadslwithxtextandxtendusingeasytounderstandexamplesandbestpractices |