Building Your Own DSL with Xtext

GlobalLogic Ukraine
GlobalLogic UkraineGlobalLogic Ukraine
©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
– Eclipse RCP
• Interested in software architecture
• tomasz.kleszczynski@globallogic.com
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?
• Examples:
– SQL
– Css (LESS / SASS)
– MATLAB
YourOwn
select * from Named n where n.name =
”foo*” and n.used order by n.name desc
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
• 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
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
Demo
All demos are based on Xtext 2.9.2
• Formatting
• Generation
• Scoping
• Validation
• Content assist
• Labels / outline
• Quick fix
• Web editor
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
Q & A
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
Thank you
1 de 12

Recomendados

FIWARE Big Data Ecosystem : Cygnus por
FIWARE Big Data Ecosystem : CygnusFIWARE Big Data Ecosystem : Cygnus
FIWARE Big Data Ecosystem : Cygnusfisuda
2.1K visualizações33 slides
Container Network Interface: Network Plugins for Kubernetes and beyond por
Container Network Interface: Network Plugins for Kubernetes and beyondContainer Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyondKubeAcademy
14.1K visualizações20 slides
DevOps: Age Of CI/CD por
DevOps: Age Of CI/CDDevOps: Age Of CI/CD
DevOps: Age Of CI/CDMoogleLabs default
129 visualizações29 slides
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v... por
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...
Orion Context Broker NGSI-v2 Overview for Developers That Already Know NGSI-v...Fermin Galan
300 visualizações58 slides
Operator SDK for K8s using Go por
Operator SDK for K8s using GoOperator SDK for K8s using Go
Operator SDK for K8s using GoCloudOps2005
1.6K visualizações34 slides
GitOps & the deployment branching models - DevOps D-day Marseille 2021 por
GitOps & the deployment branching models - DevOps D-day Marseille 2021GitOps & the deployment branching models - DevOps D-day Marseille 2021
GitOps & the deployment branching models - DevOps D-day Marseille 2021SoKube
369 visualizações27 slides

Mais conteúdo relacionado

Mais procurados

What is Jenkins | Jenkins Tutorial for Beginners | Edureka por
What is Jenkins | Jenkins Tutorial for Beginners | EdurekaWhat is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | EdurekaEdureka!
1.8K visualizações30 slides
Spring Framework - Data Access por
Spring Framework - Data AccessSpring Framework - Data Access
Spring Framework - Data AccessDzmitry Naskou
4.3K visualizações74 slides
NestJS por
NestJSNestJS
NestJSWilson Su
1.3K visualizações19 slides
Single-Page-Application & REST security por
Single-Page-Application & REST securitySingle-Page-Application & REST security
Single-Page-Application & REST securityIgor Bossenko
21K visualizações43 slides
Elasticsearch por
ElasticsearchElasticsearch
ElasticsearchHermeto Romano
255 visualizações31 slides
The Xtext Grammar Language por
The Xtext Grammar LanguageThe Xtext Grammar Language
The Xtext Grammar LanguageDr. Jan Köhnlein
5K visualizações32 slides

Mais procurados(20)

What is Jenkins | Jenkins Tutorial for Beginners | Edureka por Edureka!
What is Jenkins | Jenkins Tutorial for Beginners | EdurekaWhat is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
Edureka!1.8K visualizações
Spring Framework - Data Access por Dzmitry Naskou
Spring Framework - Data AccessSpring Framework - Data Access
Spring Framework - Data Access
Dzmitry Naskou4.3K visualizações
NestJS por Wilson Su
NestJSNestJS
NestJS
Wilson Su1.3K visualizações
Single-Page-Application & REST security por Igor Bossenko
Single-Page-Application & REST securitySingle-Page-Application & REST security
Single-Page-Application & REST security
Igor Bossenko21K visualizações
Elasticsearch por Hermeto Romano
ElasticsearchElasticsearch
Elasticsearch
Hermeto Romano255 visualizações
The Xtext Grammar Language por Dr. Jan Köhnlein
The Xtext Grammar LanguageThe Xtext Grammar Language
The Xtext Grammar Language
Dr. Jan Köhnlein5K visualizações
Gradle Introduction por Dmitry Buzdin
Gradle IntroductionGradle Introduction
Gradle Introduction
Dmitry Buzdin7.8K visualizações
Building a CICD pipeline for deploying to containers por Amazon Web Services
Building a CICD pipeline for deploying to containersBuilding a CICD pipeline for deploying to containers
Building a CICD pipeline for deploying to containers
Amazon Web Services851 visualizações
Multi Stage Docker Build por Prasenjit Sarkar
Multi Stage Docker Build Multi Stage Docker Build
Multi Stage Docker Build
Prasenjit Sarkar195 visualizações
게임을 위한 DynamoDB 사례 및 팁 - 김일호 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming por Amazon Web Services Korea
게임을 위한 DynamoDB 사례 및 팁 - 김일호 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming게임을 위한 DynamoDB 사례 및 팁 - 김일호 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
게임을 위한 DynamoDB 사례 및 팁 - 김일호 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
Amazon Web Services Korea2.3K visualizações
Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021 por AWSKRUG - AWS한국사용자모임
Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021
Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021
AWSKRUG - AWS한국사용자모임1.9K visualizações
ArgoCD and Tekton: Match made in Kubernetes heaven | DevNation Tech Talk por Red Hat Developers
ArgoCD and Tekton: Match made in Kubernetes heaven | DevNation Tech TalkArgoCD and Tekton: Match made in Kubernetes heaven | DevNation Tech Talk
ArgoCD and Tekton: Match made in Kubernetes heaven | DevNation Tech Talk
Red Hat Developers8.6K visualizações
Elastic Kubernetes Services (EKS) por sriram_rajan
Elastic Kubernetes Services (EKS)Elastic Kubernetes Services (EKS)
Elastic Kubernetes Services (EKS)
sriram_rajan1.2K visualizações
MySQL Monitoring using Prometheus & Grafana por YoungHeon (Roy) Kim
MySQL Monitoring using Prometheus & GrafanaMySQL Monitoring using Prometheus & Grafana
MySQL Monitoring using Prometheus & Grafana
YoungHeon (Roy) Kim4.3K visualizações
FIWARE Global Summit - NGSI-LD – an Evolution from NGSIv2 por FIWARE
FIWARE Global Summit - NGSI-LD – an Evolution from NGSIv2FIWARE Global Summit - NGSI-LD – an Evolution from NGSIv2
FIWARE Global Summit - NGSI-LD – an Evolution from NGSIv2
FIWARE1.2K visualizações
Mastering Java Bytecode With ASM - 33rd degree, 2012 por Anton Arhipov
Mastering Java Bytecode With ASM - 33rd degree, 2012Mastering Java Bytecode With ASM - 33rd degree, 2012
Mastering Java Bytecode With ASM - 33rd degree, 2012
Anton Arhipov8K visualizações
Azure Redis Cache por Chourouk HJAIEJ
Azure Redis CacheAzure Redis Cache
Azure Redis Cache
Chourouk HJAIEJ1.4K visualizações
Angular - Chapter 1 - Introduction por WebStackAcademy
 Angular - Chapter 1 - Introduction Angular - Chapter 1 - Introduction
Angular - Chapter 1 - Introduction
WebStackAcademy961 visualizações
Delivering Quality at Speed with GitOps por Weaveworks
Delivering Quality at Speed with GitOpsDelivering Quality at Speed with GitOps
Delivering Quality at Speed with GitOps
Weaveworks1.3K visualizações

Similar a Building Your Own DSL with Xtext

Linq To XML Overview por
Linq To XML OverviewLinq To XML Overview
Linq To XML OverviewDale Hawthorne
208 visualizações7 slides
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund por
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel ZikmundKarel Zikmund
185 visualizações20 slides
Best DotNet Training in Delhi por
Best   DotNet Training  in DelhiBest   DotNet Training  in Delhi
Best DotNet Training in DelhiInformation Technology
381 visualizações43 slides
Eclipse JDT Embraces Java 9 – An Insider’s View por
Eclipse JDT Embraces Java 9 – An Insider’s ViewEclipse JDT Embraces Java 9 – An Insider’s View
Eclipse JDT Embraces Java 9 – An Insider’s ViewDev_Events
439 visualizações17 slides
Evalution about programming language part 1 por
Evalution about programming language part 1Evalution about programming language part 1
Evalution about programming language part 1Synapseindiappsdevelopment
322 visualizações10 slides
Microsoft .NET (dotnet) Framework 2003 - 2004 overview and web services… por
Microsoft .NET (dotnet) Framework 2003 - 2004 overview and web services…Microsoft .NET (dotnet) Framework 2003 - 2004 overview and web services…
Microsoft .NET (dotnet) Framework 2003 - 2004 overview and web services…Lorenz Lo Sauer
962 visualizações27 slides

Similar a Building Your Own DSL with Xtext(20)

Linq To XML Overview por Dale Hawthorne
Linq To XML OverviewLinq To XML Overview
Linq To XML Overview
Dale Hawthorne208 visualizações
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund por Karel Zikmund
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
Karel Zikmund185 visualizações
Eclipse JDT Embraces Java 9 – An Insider’s View por Dev_Events
Eclipse JDT Embraces Java 9 – An Insider’s ViewEclipse JDT Embraces Java 9 – An Insider’s View
Eclipse JDT Embraces Java 9 – An Insider’s View
Dev_Events439 visualizações
Microsoft .NET (dotnet) Framework 2003 - 2004 overview and web services… por Lorenz Lo Sauer
Microsoft .NET (dotnet) Framework 2003 - 2004 overview and web services…Microsoft .NET (dotnet) Framework 2003 - 2004 overview and web services…
Microsoft .NET (dotnet) Framework 2003 - 2004 overview and web services…
Lorenz Lo Sauer962 visualizações
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund por Karel Zikmund
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
Karel Zikmund166 visualizações
Taking Care of Business at Office Depot with Elastic Cloud Enterprise por Elasticsearch
Taking Care of Business at Office Depot with Elastic Cloud Enterprise Taking Care of Business at Office Depot with Elastic Cloud Enterprise
Taking Care of Business at Office Depot with Elastic Cloud Enterprise
Elasticsearch1.9K visualizações
How to Create Your Own Product-Modeling Environment por Tim Geisler
How to Create Your Own Product-Modeling EnvironmentHow to Create Your Own Product-Modeling Environment
How to Create Your Own Product-Modeling Environment
Tim Geisler666 visualizações
Experiences with Evangelizing Java Within the Database por Marcelo Ochoa
Experiences with Evangelizing Java Within the DatabaseExperiences with Evangelizing Java Within the Database
Experiences with Evangelizing Java Within the Database
Marcelo Ochoa484 visualizações
PapyrusRT: Modelling and Code Generation por Ernesto Posse
PapyrusRT: Modelling and Code GenerationPapyrusRT: Modelling and Code Generation
PapyrusRT: Modelling and Code Generation
Ernesto Posse992 visualizações
Apache Drill (ver. 0.2) por Camuel Gilyadov
Apache Drill (ver. 0.2)Apache Drill (ver. 0.2)
Apache Drill (ver. 0.2)
Camuel Gilyadov2.2K visualizações
COMMitMDE'18: Eclipse Hawk: model repository querying as a service por Antonio García-Domínguez
COMMitMDE'18: Eclipse Hawk: model repository querying as a serviceCOMMitMDE'18: Eclipse Hawk: model repository querying as a service
COMMitMDE'18: Eclipse Hawk: model repository querying as a service
Antonio García-Domínguez132 visualizações
Let's server your Data por Frank van der Linden
Let's server your DataLet's server your Data
Let's server your Data
Frank van der Linden1.5K visualizações
Pune-Cocoa: Blocks and GCD por Prashant Rane
Pune-Cocoa: Blocks and GCDPune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCD
Prashant Rane1.3K visualizações
mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds por Istvan Rath
mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worldsmbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds
mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds
Istvan Rath1.6K visualizações
Introduction to dot net por QIANG XU
Introduction to dot netIntroduction to dot net
Introduction to dot net
QIANG XU35 visualizações
.NET Core: a new .NET Platform por Alex Thissen
.NET Core: a new .NET Platform.NET Core: a new .NET Platform
.NET Core: a new .NET Platform
Alex Thissen1.4K visualizações
Programming the Semantic Web por Luigi De Russis
Programming the Semantic WebProgramming the Semantic Web
Programming the Semantic Web
Luigi De Russis1.5K visualizações
Flexible Indexing in Lucene 4.0 por Lucidworks (Archived)
Flexible Indexing in Lucene 4.0Flexible Indexing in Lucene 4.0
Flexible Indexing in Lucene 4.0
Lucidworks (Archived)5.3K visualizações

Mais de GlobalLogic Ukraine

Штучний інтелект як допомога в навчанні, а не замінник.pptx por
Штучний інтелект як допомога в навчанні, а не замінник.pptxШтучний інтелект як допомога в навчанні, а не замінник.pptx
Штучний інтелект як допомога в навчанні, а не замінник.pptxGlobalLogic Ukraine
47 visualizações26 slides
Задачі AI-розробника як застосовується штучний інтелект.pptx por
Задачі AI-розробника як застосовується штучний інтелект.pptxЗадачі AI-розробника як застосовується штучний інтелект.pptx
Задачі AI-розробника як застосовується штучний інтелект.pptxGlobalLogic Ukraine
46 visualizações56 slides
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptx por
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptxЩо треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptx
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptxGlobalLogic Ukraine
81 visualizações25 slides
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven... por
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...GlobalLogic Ukraine
33 visualizações18 slides
JavaScript Community Webinar #14 "Why Is Git Rebase?" por
JavaScript Community Webinar #14 "Why Is Git Rebase?"JavaScript Community Webinar #14 "Why Is Git Rebase?"
JavaScript Community Webinar #14 "Why Is Git Rebase?"GlobalLogic Ukraine
30 visualizações26 slides
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi... por
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...GlobalLogic Ukraine
13 visualizações21 slides

Mais de GlobalLogic Ukraine(20)

Штучний інтелект як допомога в навчанні, а не замінник.pptx por GlobalLogic Ukraine
Штучний інтелект як допомога в навчанні, а не замінник.pptxШтучний інтелект як допомога в навчанні, а не замінник.pptx
Штучний інтелект як допомога в навчанні, а не замінник.pptx
GlobalLogic Ukraine47 visualizações
Задачі AI-розробника як застосовується штучний інтелект.pptx por GlobalLogic Ukraine
Задачі AI-розробника як застосовується штучний інтелект.pptxЗадачі AI-розробника як застосовується штучний інтелект.pptx
Задачі AI-розробника як застосовується штучний інтелект.pptx
GlobalLogic Ukraine46 visualizações
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptx por GlobalLogic Ukraine
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptxЩо треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptx
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptx
GlobalLogic Ukraine81 visualizações
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven... por GlobalLogic Ukraine
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...
GlobalLogic Ukraine33 visualizações
JavaScript Community Webinar #14 "Why Is Git Rebase?" por GlobalLogic Ukraine
JavaScript Community Webinar #14 "Why Is Git Rebase?"JavaScript Community Webinar #14 "Why Is Git Rebase?"
JavaScript Community Webinar #14 "Why Is Git Rebase?"
GlobalLogic Ukraine30 visualizações
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi... por GlobalLogic Ukraine
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...
GlobalLogic Ukraine13 visualizações
Страх і сила помилок - IT Inside від GlobalLogic Education por GlobalLogic Ukraine
Страх і сила помилок - IT Inside від GlobalLogic EducationСтрах і сила помилок - IT Inside від GlobalLogic Education
Страх і сила помилок - IT Inside від GlobalLogic Education
GlobalLogic Ukraine15 visualizações
GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity” por GlobalLogic Ukraine
GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”
GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”
GlobalLogic Ukraine19 visualizações
GlobalLogic QA Webinar “What does it take to become a Test Engineer” por GlobalLogic Ukraine
GlobalLogic QA Webinar “What does it take to become a Test Engineer”GlobalLogic QA Webinar “What does it take to become a Test Engineer”
GlobalLogic QA Webinar “What does it take to become a Test Engineer”
GlobalLogic Ukraine590 visualizações
“How to Secure Your Applications With a Keycloak? por GlobalLogic Ukraine
“How to Secure Your Applications With a Keycloak?“How to Secure Your Applications With a Keycloak?
“How to Secure Your Applications With a Keycloak?
GlobalLogic Ukraine239 visualizações
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear... por GlobalLogic Ukraine
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...
GlobalLogic Ukraine288 visualizações
GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi... por GlobalLogic Ukraine
GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...
GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...
GlobalLogic Ukraine383 visualizações
GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer” por GlobalLogic Ukraine
GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”
GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”
GlobalLogic Ukraine751 visualizações
Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development" por GlobalLogic Ukraine
Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"
Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"
GlobalLogic Ukraine394 visualizações
GlobalLogic Webinar "Introduction to Embedded QA" por GlobalLogic Ukraine
GlobalLogic Webinar "Introduction to Embedded QA"GlobalLogic Webinar "Introduction to Embedded QA"
GlobalLogic Webinar "Introduction to Embedded QA"
GlobalLogic Ukraine912 visualizações
C++ Webinar "Why Should You Learn C++ in 2021-22?" por GlobalLogic Ukraine
C++ Webinar "Why Should You Learn C++ in 2021-22?"C++ Webinar "Why Should You Learn C++ in 2021-22?"
C++ Webinar "Why Should You Learn C++ in 2021-22?"
GlobalLogic Ukraine302 visualizações
GlobalLogic Test Automation Live Testing Session “Android Behind UI — Testing... por GlobalLogic Ukraine
GlobalLogic Test Automation Live Testing Session “Android Behind UI — Testing...GlobalLogic Test Automation Live Testing Session “Android Behind UI — Testing...
GlobalLogic Test Automation Live Testing Session “Android Behind UI — Testing...
GlobalLogic Ukraine191 visualizações
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per... por GlobalLogic Ukraine
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Ukraine187 visualizações
GlobalLogic Azure TechTalk ONLINE “Marketing Data Lake in Azure” por GlobalLogic Ukraine
GlobalLogic Azure TechTalk ONLINE “Marketing Data Lake in Azure”GlobalLogic Azure TechTalk ONLINE “Marketing Data Lake in Azure”
GlobalLogic Azure TechTalk ONLINE “Marketing Data Lake in Azure”
GlobalLogic Ukraine168 visualizações
GlobalLogic Test Automation Online TechTalk “Playwright — A New Hope” por GlobalLogic Ukraine
GlobalLogic Test Automation Online TechTalk “Playwright — A New Hope”GlobalLogic Test Automation Online TechTalk “Playwright — A New Hope”
GlobalLogic Test Automation Online TechTalk “Playwright — A New Hope”
GlobalLogic Ukraine317 visualizações

Último

DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft... por
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...Deltares
7 visualizações18 slides
WebAssembly por
WebAssemblyWebAssembly
WebAssemblyJens Siebert
48 visualizações18 slides
Short_Story_PPT.pdf por
Short_Story_PPT.pdfShort_Story_PPT.pdf
Short_Story_PPT.pdfutkarshsatishkumarsh
5 visualizações16 slides
DSD-INT 2023 European Digital Twin Ocean and Delft3D FM - Dols por
DSD-INT 2023 European Digital Twin Ocean and Delft3D FM - DolsDSD-INT 2023 European Digital Twin Ocean and Delft3D FM - Dols
DSD-INT 2023 European Digital Twin Ocean and Delft3D FM - DolsDeltares
7 visualizações23 slides
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... por
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Marc Müller
37 visualizações83 slides
Headless JS UG Presentation.pptx por
Headless JS UG Presentation.pptxHeadless JS UG Presentation.pptx
Headless JS UG Presentation.pptxJack Spektor
7 visualizações24 slides

Último(20)

DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft... por Deltares
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...
Deltares7 visualizações
WebAssembly por Jens Siebert
WebAssemblyWebAssembly
WebAssembly
Jens Siebert48 visualizações
DSD-INT 2023 European Digital Twin Ocean and Delft3D FM - Dols por Deltares
DSD-INT 2023 European Digital Twin Ocean and Delft3D FM - DolsDSD-INT 2023 European Digital Twin Ocean and Delft3D FM - Dols
DSD-INT 2023 European Digital Twin Ocean and Delft3D FM - Dols
Deltares7 visualizações
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... por Marc Müller
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Marc Müller37 visualizações
Headless JS UG Presentation.pptx por Jack Spektor
Headless JS UG Presentation.pptxHeadless JS UG Presentation.pptx
Headless JS UG Presentation.pptx
Jack Spektor7 visualizações
Ports-and-Adapters Architecture for Embedded HMI por Burkhard Stubert
Ports-and-Adapters Architecture for Embedded HMIPorts-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMI
Burkhard Stubert6 visualizações
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra... por Marc Müller
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra....NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
Marc Müller38 visualizações
Airline Booking Software por SharmiMehta
Airline Booking SoftwareAirline Booking Software
Airline Booking Software
SharmiMehta6 visualizações
Keep por Geniusee
KeepKeep
Keep
Geniusee75 visualizações
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action por Márton Kodok
Gen Apps on Google Cloud PaLM2 and Codey APIs in ActionGen Apps on Google Cloud PaLM2 and Codey APIs in Action
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action
Márton Kodok5 visualizações
Copilot Prompting Toolkit_All Resources.pdf por Riccardo Zamana
Copilot Prompting Toolkit_All Resources.pdfCopilot Prompting Toolkit_All Resources.pdf
Copilot Prompting Toolkit_All Resources.pdf
Riccardo Zamana8 visualizações
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P... por NimaTorabi2
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
NimaTorabi28 visualizações
Quality Engineer: A Day in the Life por John Valentino
Quality Engineer: A Day in the LifeQuality Engineer: A Day in the Life
Quality Engineer: A Day in the Life
John Valentino6 visualizações
EV Charging App Case por iCoderz Solutions
EV Charging App Case EV Charging App Case
EV Charging App Case
iCoderz Solutions5 visualizações
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated... por TomHalpin9
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...
TomHalpin96 visualizações
FIMA 2023 Neo4j & FS - Entity Resolution.pptx por Neo4j
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptx
Neo4j7 visualizações
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko... por Deltares
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...
Deltares14 visualizações
AI and Ml presentation .pptx por FayazAli87
AI and Ml presentation .pptxAI and Ml presentation .pptx
AI and Ml presentation .pptx
FayazAli8711 visualizações

Building Your Own DSL with Xtext

  • 1. ©2016 GlobalLogic Inc. Build your own DSL with Xtext
  • 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 Agenda • Introduction of DSL • Eclipse Modelling Framework • Xtext • Demos • What’s new in Xtext 2.9
  • 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 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 • 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 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 Demo All demos are based on Xtext 2.9.2 • Formatting • Generation • Scoping • Validation • Content assist • Labels / outline • Quick fix • Web editor
  • 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
  • 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

Notas do Editor

  1. Zaczynamy. Na poczatek któtkie wprowadzenie do języków dziedzinowych czyli skupiajcych się na specyficznym problemie. Zanim rozpocznę o Xtext wprowadzę czym jest EMF – framework używany przez Xtext Powiem w kilku słowach czym jest Xtext w kontekście tworzenia języka. Następnie kilka słów o gramatyce oraz Jak Xtext ma się do EMFa Potem przejdziemy do demonstracji podstawowych elementów Xtext-a (takich jak formatowanie, generowanie nowych artefaktów, scoping, walidacja, content assist czy quick-fix,) Na koniec powiem o nowościach w Xtext 2.9
  2. This is an Eclipse project conducted mainly by itemis, started about 2008. Current version is 2.9. 2.9 in was released Nov 16, 2015 and it covers some new areas which I will try to show you later on. Behind the xtext is an ANTLR3 (ANother Tool for Language Recognition) as parser generator, EMF as the foundation of the model classes and google guice for dependency injection. Xtext is a language development framework – you can pick only those elements you want. - Provides API for configuring and describing elements of DSL Xtext components are independent of Eclipse and OSGi In 2.9 this distinction is better visible as you can pick project facets (IntelliJ plugins, Web support, Testing support, maven / grable build system, source code layout) – in 2.8 this separation is achievable but needs to be done manually. What does it contain? Parser – translates the string input into EMF model Abstract syntax tree – represents elements of your DSL in form of a tree Serializer – writing your EMF model back to textual form Code formatter – rules for formatting Scoping framework and linking. Eclipse – mature IntelliJ IDEA – new features I’will not cover binding to Java using Xbase. In general it allows using syntax which is close to java in your grammars.
  3. Xtext grammar is defined using its DSL. This file is then used by generator to create all language artifacts. Xtext uses Antlr under the hood in order to do the pure parsing. This is basically a two step process: At first, the input sequence of characters is split into tokens (often referred to as terminals) by a component that is called the lexer. The second step is to process the resulting list of tokens. The actual parser is responsible for that stage. It will create the abstract syntax tree from the token stream. Lexing – terminal rules (be careful, overrides the other, can be validated) Parsing – generates AST items Parser rules (production rules) – generated EClass Data type rules – generates Java primitives - The parser will not create those on its own but rather pass the consumed tokens as a string to a value converter. The language developer is responsible for converting the string to a data type. Terminal rules - an return the very same things as data type rules can. That is, they yield Strings, ints or other primitives Doesn’t have look ahead but is more performant Order matters
  4. Release candidate http://download.eclipse.org/modeling/tmf/xtext/idea/2.9.2/updatePlugins.xml - It’s it possible to design languages entirely in IDEA - Languages developed in Eclipse can target all available platforms (Eclipse, IDEA, web). It doesn’t worh the outer way round as IDEA is not well suited for Eclipse Plug-in devlelopment. Eclipse support is not going to be dropped Builds with Maven / Gradle You can select the elements (language / editor / build system during project generation). Web editors can be generated New grammar features Explicit rule calls – allows to use rules definitions from parent grammars without the need for redefining Parser rule fragments – allows to reuse common parts of the grammar Parameterized rule calls – lack of documentation, don’t have an idea where it would help