Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
©2016 GlobalLogic Inc.
Build your own DSL with Xtext
2
About me - Tomasz Kleszczyński
• Software Engineer @ REC - a
GlobalLogic Company
• Focused in JVM technologies
– Java EE...
3
Agenda
• Introduction of DSL
• Eclipse Modelling Framework
• Xtext
• Demos
• What’s new in Xtext 2.9
4
Introduction of DSL
• What is a Domain-Specific Language?
• Internal or external?
• Is it difficult to build one?
• Exam...
5
Eclipse Modelling Framework
EMF Components
• Core Runtime
– Ecore metamodel
– Notification framework
– Persistence (XML/...
6
• Eclipse project – EPL license
– Uses ANTLR3, EMF, Google Guice
• Language development framework
– Set of DSLs and API ...
7
Grammar
• Language Declaration
• EPackage Declaration
– EPackage Generation
– EPackage Import
• Rules
– Terminal Rules
–...
8
Demo
All demos are based on Xtext 2.9.2
• Formatting
• Generation
• Scoping
• Validation
• Content assist
• Labels / out...
9
Xtext 2.9 - What’s new
• IntelliJ IDEA As An Alternative To Eclipse
– Language Editors for IntelliJ IDEA
• Headless Buil...
10
Q & A
11
References
• EMF Fundamentals
• www.eclipse.org/Xtext
• zarnekow.blogspot.de
• blog.efftinge.de
• Scoping and linking
E...
12
Thank you
Upcoming SlideShare
Loading in …5
×

Building Your Own DSL with Xtext

1,566 views

Published on

This presentation deals with the general description of Domain Specific Languages and the features and building blocks of Eclipse Xtext as a framework for building DSLs. Moreover, it contains a summary of the new features in the latest version of Xtext.

This presentation by Tomasz Kleszczyński (Software Engineer) was delivered at GlobalLogic Java Conference #2 in Krakow on April 23, 2016.

Published in: Software
  • Be the first to comment

Building Your Own DSL with Xtext

  1. 1. ©2016 GlobalLogic Inc. Build your own DSL with Xtext
  2. 2. 2 About me - Tomasz Kleszczyński • Software Engineer @ REC - a GlobalLogic Company • Focused in JVM technologies – Java EE – Eclipse RCP • Interested in software architecture • tomasz.kleszczynski@globallogic.com
  3. 3. 3 Agenda • Introduction of DSL • Eclipse Modelling Framework • Xtext • Demos • What’s new in Xtext 2.9
  4. 4. 4 Introduction of DSL • What is a Domain-Specific Language? • Internal or external? • Is it difficult to build one? • Examples: – SQL – Css (LESS / SASS) – MATLAB YourOwn select * from Named n where n.name = ”foo*” and n.used order by n.name desc
  5. 5. 5 Eclipse Modelling Framework EMF Components • Core Runtime – Ecore metamodel – Notification framework – Persistence (XML/XMI), validation, change model • EMF.Edit – Support for model-based editors and viewers – Default reflective editor • Codegen – Code generator for application models and editors – Extensible model importer / exporter framework
  6. 6. 6 • Eclipse project – EPL license – Uses ANTLR3, EMF, Google Guice • Language development framework – Set of DSLs and API to describe the different aspects of programming language – Compiler components independent of Eclipse or OSGi: • parser • type-safe abstract syntax tree (AST) • serializer • code formatter • scoping framework • linking – IDE components • Eclipse • IntelliJ IDEA – Translation to Java using XBase
  7. 7. 7 Grammar • Language Declaration • EPackage Declaration – EPackage Generation – EPackage Import • Rules – Terminal Rules – Parser Rules – Hidden Terminal Symbols – Data type Rules – Enum Rules • Ecore Model Inference – Epackage – EClass – EEnum – EStructuralFeature
  8. 8. 8 Demo All demos are based on Xtext 2.9.2 • Formatting • Generation • Scoping • Validation • Content assist • Labels / outline • Quick fix • Web editor
  9. 9. 9 Xtext 2.9 - What’s new • IntelliJ IDEA As An Alternative To Eclipse – Language Editors for IntelliJ IDEA • Headless Builds For Xtext Projects – Gradle / Maven – Target selection (Eclipse, IntelliJ IDEA, web) • New Project Wizard • Web Support • New Grammar Language Features – Explicit rule calls and super rule calls – Parser rule fragments
  10. 10. 10 Q & A
  11. 11. 11 References • EMF Fundamentals • www.eclipse.org/Xtext • zarnekow.blogspot.de • blog.efftinge.de • Scoping and linking Examples: • github.com/tkleszczynski/xtext-jug.git
  12. 12. 12 Thank you

×