SlideShare ist ein Scribd-Unternehmen logo
1 von 37
Downloaden Sie, um offline zu lesen
http://live.eclipse.org/node/705

Eclipse Live Webinar on


     Sven Efftinge, Heiko Behrens
                 itemis
Agenda
      What is Xtext?
   DSLs - An Example
Underlying Technology
     Advanced Topics
Questions & Answers
?
What is
A Language Framework
Yet another
 Parser Generator?



JavaCC
Yet another
 Parser Generator?

                       t ha t!
             e th an
         smor
No,   it’
JavaCC
How does Xtext
      relate to ...

IDE Meta-tooling Platform (IMP)


Dynamic Language Toolkit (DLTK)
How does Xtext
      relate to ...

IDE Meta-tooling Platform (IMP) !
                             at
                   an   th
             ore th
        is m
 X   xt
   te Language Toolkit (DLTK)
Dynamic
Is it a language workbench?


JetBrains Meta Programming System




 Intentional Domain Workbench       Microsoft Oslo
Is it a language workbench?

                          le te ly
                      m p         rc e!
               it’s co     s  ou
            ut         en
JetBrains Meta Programming System
         ,b          op
    Y es        a nd
         as ed
 t ext-b
 Intentional Domain Workbench       Microsoft Oslo
Xtext is a complete environment
for development of textual
 - programming languages and
 - domain-specific languages.
It is implemented in Java and is
based on Eclipse, EMF, and Antlr.
Domain-Specific Language (DSL)
A DSL is a formal, processable language
  targeting at a specific viewpoint or
     aspect of a software system.
Its semantics, flexibility and notation is
 designed in order to support working
with that viewpoint as good as possible.
Rd2-c2
“ Queen to c7.
              Check.”




  “ Rd2-c2 ,
rook at d2 moves to c2.”
Moves in Chess:
!ook at a1 moves to a5.
    P
    iece           S   q uare      A
                                   ction
                                           De   stin ation


"ishop at c8 captures knight at h3.n
    P
    iece            S   q uare   io
                                           Action
                                                             D
                                                             es tinat


# b1 x c3
Piece S   qua re ction stination
              AD      e


$2 - g4
                      ation
S A D
quar
    e   ction e  stin
Rook     a1    move      a5
              Bishop   c8   capture    h3   Knight
              Knight   b1   capture    c3   Queen
               Pawn    g2    move      g4


    Game                     Move
                         Source                      «enum»
WhitePlayer
                       * Destination                  Piece
BlackPlayer
                         Piece
"ishop at c8 captures knight at h3

           " c8 x h3
Model (textfile)
White: "Mayfield"
Black: "Trinks"

pawn at e2 moves to e4
pawn at f7 moves to g5

K b1 - c3
f7 - f5

queen at d1 moves to h5
// 1-0
DEMO
Underlying Technology
ar
Model




                                    m
                                   m
                               ra
                               G
                             Generator



        Runtime
                  Superclass




                  Subclass              Class




 LL(*) Parser   ecore meta model                editor
Java Persistence API (JPA)
package templates;

import java.io.Serializable;
import java.util.*;
import javax.persistence.*;

@SuppressWarnings("serial")
@Entity
public class Customer implements Serializable {
!    private Long id;
!    private String name;
!    private Address address;
!    private Set<Order> orders = new HashSet<Order>();
!    // No-arg constructor
!    public Customer() {
!    }
!    @Id
!    public Long getId() {                               entity Customer {
!    !     return id;
!    }                                                   ! property name : String
!    public void setId(Long id) {                        ! property address : Address
!    !     this.id = id;
!    }                                                   ! property orders : Order[]
!    public String getName() {
!    !     return name;                                  }
!    }
!    public void setName(String name) {
!    !     this.name = name;
!    }
!    public Address getAddress() {
!    !     return address;
!    }
!    public void setAddress(Address address) {
!    !     this.address = address;
!    }
!    @OneToMany
!    public Collection<Order> getOrders() {
!    !     return orders;
!    }
!    public void setOrders(Set<Order> orders) {
!    !     this.orders = orders;
!    }
}
DEMO
ar
Model




                                    m
                                   m
                               ra
                               G
                                                Generator Fragments
                             Generator



        Runtime
                  Superclass




                  Subclass              Class




 LL(*) Parser   ecore meta model                      editor
Composable
    Code Generator
! generator is composed of “fragments”
! fragments can contribute to:
 ! Manifest.MF
 ! plugin.xml
 ! Guice modules
! Add your own fragments
ar
Model




                                    m
                                   m
                               ra
                               G
                             Generator



        Runtime




                                                         Google Guice
                  Superclass




                  Subclass              Class




 LL(*) Parser   ecore meta model                editor
licensed by http://www.wordle.net/
MyCustomLabelProvider




            licensed by http://www.wordle.net/
Dependency Injection with
            Googlee




!No dependency to concrete implementation
!No explicit construction
!Easy testing
!Easy composition
Configuration of Components
            in Xtext
/**
  * used to register components to be used within the IDE.
  */
public class DomainmodelUiModule
! ! extends GeneratedDomainmodelUiModule {
!
! @Override
! public Class<? extends ILabelProvider> bindILabelProvider() {
! ! return MySpecialLabelProvider.class;
! }
}
DEMO
Advanced Topics
Integration with EMF
                                                  eclipse

                                 Any EMF-based   modeling
Code Generator    GMF Editor                                P R O J E C T
                                  Component




                 <<abstract>>                    XMI
                                 XMIResource
                  Resource




                 XtextResource                   Text




    Parser          Linker         Serializer




ValueConverter   ScopeProvider     Formatter
Working with Xtext
// initialization and setup (only needed in standalone mode)
new EntityStandaloneSetup().createInjectorAndDoEMFRegistration();

// standard EMF API usage
ResourceSet resourceSet = new ResourceSet();
Resource resource = resourceSet.getResource(uriToModelFile, true);
Model model = (Model) resource.getContents().get(0);

// print the name of all types to the console
for (Type type : model.getElements()) {
  System.out.println(type.getName());
}
Eclipse Helios
•Model Index
• Grammar Mixins
• Base Language
• UI Features
Questions & Answers

Weitere ähnliche Inhalte

Was ist angesagt?

Javascript Basics
Javascript BasicsJavascript Basics
Javascript Basicsmsemenistyi
 
PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021Ayesh Karunaratne
 
Opaque Pointers Are Coming
Opaque Pointers Are ComingOpaque Pointers Are Coming
Opaque Pointers Are ComingNikita Popov
 
Learning from other's mistakes: Data-driven code analysis
Learning from other's mistakes: Data-driven code analysisLearning from other's mistakes: Data-driven code analysis
Learning from other's mistakes: Data-driven code analysisAndreas Dewes
 
Code is not text! How graph technologies can help us to understand our code b...
Code is not text! How graph technologies can help us to understand our code b...Code is not text! How graph technologies can help us to understand our code b...
Code is not text! How graph technologies can help us to understand our code b...Andreas Dewes
 
Rust Workshop - NITC FOSSMEET 2017
Rust Workshop - NITC FOSSMEET 2017 Rust Workshop - NITC FOSSMEET 2017
Rust Workshop - NITC FOSSMEET 2017 pramode_ce
 
Static Optimization of PHP bytecode (PHPSC 2017)
Static Optimization of PHP bytecode (PHPSC 2017)Static Optimization of PHP bytecode (PHPSC 2017)
Static Optimization of PHP bytecode (PHPSC 2017)Nikita Popov
 
Advanced Python, Part 1
Advanced Python, Part 1Advanced Python, Part 1
Advanced Python, Part 1Zaar Hai
 
eXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction TrainingeXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction TrainingHoat Le
 
Creating Domain Specific Languages in Python
Creating Domain Specific Languages in PythonCreating Domain Specific Languages in Python
Creating Domain Specific Languages in PythonSiddhi
 
Create your own PHP extension, step by step - phpDay 2012 Verona
Create your own PHP extension, step by step - phpDay 2012 VeronaCreate your own PHP extension, step by step - phpDay 2012 Verona
Create your own PHP extension, step by step - phpDay 2012 VeronaPatrick Allaert
 
Codegeneration Goodies
Codegeneration GoodiesCodegeneration Goodies
Codegeneration Goodiesmeysholdt
 
A Sceptical Guide to Functional Programming
A Sceptical Guide to Functional ProgrammingA Sceptical Guide to Functional Programming
A Sceptical Guide to Functional ProgrammingGarth Gilmour
 
What's new in PHP 8.0?
What's new in PHP 8.0?What's new in PHP 8.0?
What's new in PHP 8.0?Nikita Popov
 
Advanced python
Advanced pythonAdvanced python
Advanced pythonEU Edge
 
What I Love About Ruby
What I Love About RubyWhat I Love About Ruby
What I Love About RubyKeith Bennett
 
Objective-Cひとめぐり
Objective-CひとめぐりObjective-Cひとめぐり
Objective-CひとめぐりKenji Kinukawa
 

Was ist angesagt? (20)

Polyglot JVM
Polyglot JVMPolyglot JVM
Polyglot JVM
 
Parte II Objective C
Parte II   Objective CParte II   Objective C
Parte II Objective C
 
Javascript Basics
Javascript BasicsJavascript Basics
Javascript Basics
 
PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021
 
Opaque Pointers Are Coming
Opaque Pointers Are ComingOpaque Pointers Are Coming
Opaque Pointers Are Coming
 
Learning from other's mistakes: Data-driven code analysis
Learning from other's mistakes: Data-driven code analysisLearning from other's mistakes: Data-driven code analysis
Learning from other's mistakes: Data-driven code analysis
 
Code is not text! How graph technologies can help us to understand our code b...
Code is not text! How graph technologies can help us to understand our code b...Code is not text! How graph technologies can help us to understand our code b...
Code is not text! How graph technologies can help us to understand our code b...
 
Rust Workshop - NITC FOSSMEET 2017
Rust Workshop - NITC FOSSMEET 2017 Rust Workshop - NITC FOSSMEET 2017
Rust Workshop - NITC FOSSMEET 2017
 
Static Optimization of PHP bytecode (PHPSC 2017)
Static Optimization of PHP bytecode (PHPSC 2017)Static Optimization of PHP bytecode (PHPSC 2017)
Static Optimization of PHP bytecode (PHPSC 2017)
 
Advanced Python, Part 1
Advanced Python, Part 1Advanced Python, Part 1
Advanced Python, Part 1
 
eXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction TrainingeXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction Training
 
Creating Domain Specific Languages in Python
Creating Domain Specific Languages in PythonCreating Domain Specific Languages in Python
Creating Domain Specific Languages in Python
 
Iphone course 1
Iphone course 1Iphone course 1
Iphone course 1
 
Create your own PHP extension, step by step - phpDay 2012 Verona
Create your own PHP extension, step by step - phpDay 2012 VeronaCreate your own PHP extension, step by step - phpDay 2012 Verona
Create your own PHP extension, step by step - phpDay 2012 Verona
 
Codegeneration Goodies
Codegeneration GoodiesCodegeneration Goodies
Codegeneration Goodies
 
A Sceptical Guide to Functional Programming
A Sceptical Guide to Functional ProgrammingA Sceptical Guide to Functional Programming
A Sceptical Guide to Functional Programming
 
What's new in PHP 8.0?
What's new in PHP 8.0?What's new in PHP 8.0?
What's new in PHP 8.0?
 
Advanced python
Advanced pythonAdvanced python
Advanced python
 
What I Love About Ruby
What I Love About RubyWhat I Love About Ruby
What I Love About Ruby
 
Objective-Cひとめぐり
Objective-CひとめぐりObjective-Cひとめぐり
Objective-Cひとめぐり
 

Andere mochten auch

Jazoon 2010 - Building DSLs with Eclipse
Jazoon 2010 - Building DSLs with EclipseJazoon 2010 - Building DSLs with Eclipse
Jazoon 2010 - Building DSLs with EclipsePeter Friese
 
Enhancing Xtext for General Purpose Languages
Enhancing Xtext for General Purpose LanguagesEnhancing Xtext for General Purpose Languages
Enhancing Xtext for General Purpose LanguagesUniversity of York
 
Eclipse DemoCamp in Paris: Language Development with Xtext
Eclipse DemoCamp in Paris: Language Development with XtextEclipse DemoCamp in Paris: Language Development with Xtext
Eclipse DemoCamp in Paris: Language Development with XtextSebastian Zarnekow
 
From Stairway to Heaven onto the Highway to Hell with Xtext
From Stairway to Heaven onto the Highway to Hell with XtextFrom Stairway to Heaven onto the Highway to Hell with Xtext
From Stairway to Heaven onto the Highway to Hell with XtextKarsten Thoms
 
Pragmatic DSL Design with Xtext, Xbase and Xtend 2
Pragmatic DSL Design with Xtext, Xbase and Xtend 2Pragmatic DSL Design with Xtext, Xbase and Xtend 2
Pragmatic DSL Design with Xtext, Xbase and Xtend 2Dr. Jan Köhnlein
 
Building Your Own DSL with Xtext
Building Your Own DSL with XtextBuilding Your Own DSL with Xtext
Building Your Own DSL with XtextGlobalLogic Ukraine
 
Introduction to Google AdWords Ad Extensions
Introduction to Google AdWords Ad ExtensionsIntroduction to Google AdWords Ad Extensions
Introduction to Google AdWords Ad ExtensionsBoom Online Marketing
 
How to Spur Growth & Efficiency Gains with Dynamic Search Ads
How to Spur Growth & Efficiency Gains with Dynamic Search AdsHow to Spur Growth & Efficiency Gains with Dynamic Search Ads
How to Spur Growth & Efficiency Gains with Dynamic Search AdsTinuiti
 
No API? No problem! Excel e AdWords Editor per il tuo e-commerce
No API? No problem! Excel e AdWords Editor per il tuo e-commerceNo API? No problem! Excel e AdWords Editor per il tuo e-commerce
No API? No problem! Excel e AdWords Editor per il tuo e-commerceChiara Francesca Storti
 
Application of Game Theory in Google adwords bidding
Application of Game Theory in Google adwords biddingApplication of Game Theory in Google adwords bidding
Application of Game Theory in Google adwords biddingRohit Kumar
 
How To Use Editor to Set Up Google Adwords PPC
How To Use Editor to Set Up Google Adwords PPCHow To Use Editor to Set Up Google Adwords PPC
How To Use Editor to Set Up Google Adwords PPCAnn Stanley
 
How Dynamic Search Ads Can Supercharge Your SEM Campaigns
How Dynamic Search Ads Can Supercharge Your SEM CampaignsHow Dynamic Search Ads Can Supercharge Your SEM Campaigns
How Dynamic Search Ads Can Supercharge Your SEM CampaignsAdStage
 
Google ad words bidding process
Google ad words bidding processGoogle ad words bidding process
Google ad words bidding processKumar Abhishek
 
Recipes to build Code Generators for Non-Xtext Models with Xtend
Recipes to build Code Generators for Non-Xtext Models with XtendRecipes to build Code Generators for Non-Xtext Models with Xtend
Recipes to build Code Generators for Non-Xtext Models with XtendKarsten Thoms
 

Andere mochten auch (20)

Graphical Views For Xtext
Graphical Views For XtextGraphical Views For Xtext
Graphical Views For Xtext
 
Jazoon 2010 - Building DSLs with Eclipse
Jazoon 2010 - Building DSLs with EclipseJazoon 2010 - Building DSLs with Eclipse
Jazoon 2010 - Building DSLs with Eclipse
 
Enhancing Xtext for General Purpose Languages
Enhancing Xtext for General Purpose LanguagesEnhancing Xtext for General Purpose Languages
Enhancing Xtext for General Purpose Languages
 
Eclipse DemoCamp in Paris: Language Development with Xtext
Eclipse DemoCamp in Paris: Language Development with XtextEclipse DemoCamp in Paris: Language Development with Xtext
Eclipse DemoCamp in Paris: Language Development with Xtext
 
From Stairway to Heaven onto the Highway to Hell with Xtext
From Stairway to Heaven onto the Highway to Hell with XtextFrom Stairway to Heaven onto the Highway to Hell with Xtext
From Stairway to Heaven onto the Highway to Hell with Xtext
 
Pragmatic DSL Design with Xtext, Xbase and Xtend 2
Pragmatic DSL Design with Xtext, Xbase and Xtend 2Pragmatic DSL Design with Xtext, Xbase and Xtend 2
Pragmatic DSL Design with Xtext, Xbase and Xtend 2
 
Building Your Own DSL with Xtext
Building Your Own DSL with XtextBuilding Your Own DSL with Xtext
Building Your Own DSL with Xtext
 
Future of Xtext
Future of XtextFuture of Xtext
Future of Xtext
 
Xtext Best Practices
Xtext Best PracticesXtext Best Practices
Xtext Best Practices
 
Introduction to Google AdWords Ad Extensions
Introduction to Google AdWords Ad ExtensionsIntroduction to Google AdWords Ad Extensions
Introduction to Google AdWords Ad Extensions
 
How to Spur Growth & Efficiency Gains with Dynamic Search Ads
How to Spur Growth & Efficiency Gains with Dynamic Search AdsHow to Spur Growth & Efficiency Gains with Dynamic Search Ads
How to Spur Growth & Efficiency Gains with Dynamic Search Ads
 
No API? No problem! Excel e AdWords Editor per il tuo e-commerce
No API? No problem! Excel e AdWords Editor per il tuo e-commerceNo API? No problem! Excel e AdWords Editor per il tuo e-commerce
No API? No problem! Excel e AdWords Editor per il tuo e-commerce
 
Google AdWords Editorで広告文を変更する方法
Google AdWords Editorで広告文を変更する方法Google AdWords Editorで広告文を変更する方法
Google AdWords Editorで広告文を変更する方法
 
Application of Game Theory in Google adwords bidding
Application of Game Theory in Google adwords biddingApplication of Game Theory in Google adwords bidding
Application of Game Theory in Google adwords bidding
 
How To Use Editor to Set Up Google Adwords PPC
How To Use Editor to Set Up Google Adwords PPCHow To Use Editor to Set Up Google Adwords PPC
How To Use Editor to Set Up Google Adwords PPC
 
How Dynamic Search Ads Can Supercharge Your SEM Campaigns
How Dynamic Search Ads Can Supercharge Your SEM CampaignsHow Dynamic Search Ads Can Supercharge Your SEM Campaigns
How Dynamic Search Ads Can Supercharge Your SEM Campaigns
 
Google Adwords
Google AdwordsGoogle Adwords
Google Adwords
 
Google ad words bidding process
Google ad words bidding processGoogle ad words bidding process
Google ad words bidding process
 
Recipes to build Code Generators for Non-Xtext Models with Xtend
Recipes to build Code Generators for Non-Xtext Models with XtendRecipes to build Code Generators for Non-Xtext Models with Xtend
Recipes to build Code Generators for Non-Xtext Models with Xtend
 
EMF - Beyond The Basics
EMF - Beyond The BasicsEMF - Beyond The Basics
EMF - Beyond The Basics
 

Ähnlich wie Xtext Webinar

Extension and Evolution
Extension and EvolutionExtension and Evolution
Extension and EvolutionEelco Visser
 
PIL - A Platform Independent Language
PIL - A Platform Independent LanguagePIL - A Platform Independent Language
PIL - A Platform Independent Languagezefhemel
 
The craft of meta programming on JVM
The craft of meta programming on JVMThe craft of meta programming on JVM
The craft of meta programming on JVMIgor Khotin
 
Introduction to D programming language at Weka.IO
Introduction to D programming language at Weka.IOIntroduction to D programming language at Weka.IO
Introduction to D programming language at Weka.IOLiran Zvibel
 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Guillaume Laforge
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLsintelliyole
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy CodeRowan Merewood
 
Go 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX GoGo 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX GoRodolfo Carvalho
 
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...Maarten Balliauw
 
Domänenspezifische Sprachen mit Xtext
Domänenspezifische Sprachen mit XtextDomänenspezifische Sprachen mit Xtext
Domänenspezifische Sprachen mit XtextDr. Jan Köhnlein
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Guillaume Laforge
 
Specialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingSpecialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingPositive Hack Days
 
Going to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGoing to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGuillaume Laforge
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011YoungSu Son
 
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...Tudor Dragan
 
Game development
Game developmentGame development
Game developmentAsido_
 
Iron Languages - NYC CodeCamp 2/19/2011
Iron Languages - NYC CodeCamp 2/19/2011Iron Languages - NYC CodeCamp 2/19/2011
Iron Languages - NYC CodeCamp 2/19/2011Jimmy Schementi
 

Ähnlich wie Xtext Webinar (20)

Xtext Webinar
Xtext WebinarXtext Webinar
Xtext Webinar
 
Eclipse meets e4
Eclipse meets e4Eclipse meets e4
Eclipse meets e4
 
Extension and Evolution
Extension and EvolutionExtension and Evolution
Extension and Evolution
 
PIL - A Platform Independent Language
PIL - A Platform Independent LanguagePIL - A Platform Independent Language
PIL - A Platform Independent Language
 
The craft of meta programming on JVM
The craft of meta programming on JVMThe craft of meta programming on JVM
The craft of meta programming on JVM
 
Introduction to D programming language at Weka.IO
Introduction to D programming language at Weka.IOIntroduction to D programming language at Weka.IO
Introduction to D programming language at Weka.IO
 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLs
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy Code
 
Go 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX GoGo 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX Go
 
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
 
Domänenspezifische Sprachen mit Xtext
Domänenspezifische Sprachen mit XtextDomänenspezifische Sprachen mit Xtext
Domänenspezifische Sprachen mit Xtext
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
 
Specialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingSpecialized Compiler for Hash Cracking
Specialized Compiler for Hash Cracking
 
Going to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGoing to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific Languages
 
Tml for Objective C
Tml for Objective CTml for Objective C
Tml for Objective C
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
 
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
 
Game development
Game developmentGame development
Game development
 
Iron Languages - NYC CodeCamp 2/19/2011
Iron Languages - NYC CodeCamp 2/19/2011Iron Languages - NYC CodeCamp 2/19/2011
Iron Languages - NYC CodeCamp 2/19/2011
 

Mehr von Heiko Behrens

beyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Webbeyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than WebHeiko Behrens
 
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with EclipseEclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with EclipseHeiko Behrens
 
MDSD for iPhone and Android
MDSD for iPhone and AndroidMDSD for iPhone and Android
MDSD for iPhone and AndroidHeiko Behrens
 
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010Heiko Behrens
 
MDSD on iPhone - EclipseCon 2010
MDSD on iPhone - EclipseCon 2010MDSD on iPhone - EclipseCon 2010
MDSD on iPhone - EclipseCon 2010Heiko Behrens
 
iPhonical and model-driven software development for the iPhone
iPhonical and model-driven software development for the iPhoneiPhonical and model-driven software development for the iPhone
iPhonical and model-driven software development for the iPhoneHeiko Behrens
 
Xtext at Eclipse DemoCamp London in June 2009
Xtext at Eclipse DemoCamp London in June 2009Xtext at Eclipse DemoCamp London in June 2009
Xtext at Eclipse DemoCamp London in June 2009Heiko Behrens
 
Mastering Differentiated MDSD Requirements at Deutsche Boerse AG
Mastering Differentiated MDSD Requirements at Deutsche Boerse AGMastering Differentiated MDSD Requirements at Deutsche Boerse AG
Mastering Differentiated MDSD Requirements at Deutsche Boerse AGHeiko Behrens
 
Xtext - und was man damit anstellen kann
Xtext - und was man damit anstellen kannXtext - und was man damit anstellen kann
Xtext - und was man damit anstellen kannHeiko Behrens
 

Mehr von Heiko Behrens (9)

beyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Webbeyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
 
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with EclipseEclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
 
MDSD for iPhone and Android
MDSD for iPhone and AndroidMDSD for iPhone and Android
MDSD for iPhone and Android
 
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
 
MDSD on iPhone - EclipseCon 2010
MDSD on iPhone - EclipseCon 2010MDSD on iPhone - EclipseCon 2010
MDSD on iPhone - EclipseCon 2010
 
iPhonical and model-driven software development for the iPhone
iPhonical and model-driven software development for the iPhoneiPhonical and model-driven software development for the iPhone
iPhonical and model-driven software development for the iPhone
 
Xtext at Eclipse DemoCamp London in June 2009
Xtext at Eclipse DemoCamp London in June 2009Xtext at Eclipse DemoCamp London in June 2009
Xtext at Eclipse DemoCamp London in June 2009
 
Mastering Differentiated MDSD Requirements at Deutsche Boerse AG
Mastering Differentiated MDSD Requirements at Deutsche Boerse AGMastering Differentiated MDSD Requirements at Deutsche Boerse AG
Mastering Differentiated MDSD Requirements at Deutsche Boerse AG
 
Xtext - und was man damit anstellen kann
Xtext - und was man damit anstellen kannXtext - und was man damit anstellen kann
Xtext - und was man damit anstellen kann
 

Kürzlich hochgeladen

How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 

Kürzlich hochgeladen (20)

How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 

Xtext Webinar

  • 1. http://live.eclipse.org/node/705 Eclipse Live Webinar on Sven Efftinge, Heiko Behrens itemis
  • 2. Agenda What is Xtext? DSLs - An Example Underlying Technology Advanced Topics Questions & Answers
  • 5. Yet another Parser Generator? JavaCC
  • 6. Yet another Parser Generator? t ha t! e th an smor No, it’ JavaCC
  • 7. How does Xtext relate to ... IDE Meta-tooling Platform (IMP) Dynamic Language Toolkit (DLTK)
  • 8. How does Xtext relate to ... IDE Meta-tooling Platform (IMP) ! at an th ore th is m X xt te Language Toolkit (DLTK) Dynamic
  • 9. Is it a language workbench? JetBrains Meta Programming System Intentional Domain Workbench Microsoft Oslo
  • 10. Is it a language workbench? le te ly m p rc e! it’s co s ou ut en JetBrains Meta Programming System ,b op Y es a nd as ed t ext-b Intentional Domain Workbench Microsoft Oslo
  • 11. Xtext is a complete environment for development of textual - programming languages and - domain-specific languages. It is implemented in Java and is based on Eclipse, EMF, and Antlr.
  • 12. Domain-Specific Language (DSL) A DSL is a formal, processable language targeting at a specific viewpoint or aspect of a software system. Its semantics, flexibility and notation is designed in order to support working with that viewpoint as good as possible.
  • 14. “ Queen to c7. Check.” “ Rd2-c2 , rook at d2 moves to c2.”
  • 15. Moves in Chess: !ook at a1 moves to a5. P iece S q uare A ction De stin ation "ishop at c8 captures knight at h3.n P iece S q uare io Action D es tinat # b1 x c3 Piece S qua re ction stination AD e $2 - g4 ation S A D quar e ction e stin
  • 16. Rook a1 move a5 Bishop c8 capture h3 Knight Knight b1 capture c3 Queen Pawn g2 move g4 Game Move Source «enum» WhitePlayer * Destination Piece BlackPlayer Piece
  • 17. "ishop at c8 captures knight at h3 " c8 x h3
  • 18. Model (textfile) White: "Mayfield" Black: "Trinks" pawn at e2 moves to e4 pawn at f7 moves to g5 K b1 - c3 f7 - f5 queen at d1 moves to h5 // 1-0
  • 19. DEMO
  • 21. ar Model m m ra G Generator Runtime Superclass Subclass Class LL(*) Parser ecore meta model editor
  • 22. Java Persistence API (JPA) package templates; import java.io.Serializable; import java.util.*; import javax.persistence.*; @SuppressWarnings("serial") @Entity public class Customer implements Serializable { ! private Long id; ! private String name; ! private Address address; ! private Set<Order> orders = new HashSet<Order>(); ! // No-arg constructor ! public Customer() { ! } ! @Id ! public Long getId() { entity Customer { ! ! return id; ! } ! property name : String ! public void setId(Long id) { ! property address : Address ! ! this.id = id; ! } ! property orders : Order[] ! public String getName() { ! ! return name; } ! } ! public void setName(String name) { ! ! this.name = name; ! } ! public Address getAddress() { ! ! return address; ! } ! public void setAddress(Address address) { ! ! this.address = address; ! } ! @OneToMany ! public Collection<Order> getOrders() { ! ! return orders; ! } ! public void setOrders(Set<Order> orders) { ! ! this.orders = orders; ! } }
  • 23. DEMO
  • 24. ar Model m m ra G Generator Fragments Generator Runtime Superclass Subclass Class LL(*) Parser ecore meta model editor
  • 25. Composable Code Generator ! generator is composed of “fragments” ! fragments can contribute to: ! Manifest.MF ! plugin.xml ! Guice modules ! Add your own fragments
  • 26. ar Model m m ra G Generator Runtime Google Guice Superclass Subclass Class LL(*) Parser ecore meta model editor
  • 28. MyCustomLabelProvider licensed by http://www.wordle.net/
  • 29. Dependency Injection with Googlee !No dependency to concrete implementation !No explicit construction !Easy testing !Easy composition
  • 30. Configuration of Components in Xtext /** * used to register components to be used within the IDE. */ public class DomainmodelUiModule ! ! extends GeneratedDomainmodelUiModule { ! ! @Override ! public Class<? extends ILabelProvider> bindILabelProvider() { ! ! return MySpecialLabelProvider.class; ! } }
  • 31. DEMO
  • 33. Integration with EMF eclipse Any EMF-based modeling Code Generator GMF Editor P R O J E C T Component <<abstract>> XMI XMIResource Resource XtextResource Text Parser Linker Serializer ValueConverter ScopeProvider Formatter
  • 34. Working with Xtext // initialization and setup (only needed in standalone mode) new EntityStandaloneSetup().createInjectorAndDoEMFRegistration(); // standard EMF API usage ResourceSet resourceSet = new ResourceSet(); Resource resource = resourceSet.getResource(uriToModelFile, true); Model model = (Model) resource.getContents().get(0); // print the name of all types to the console for (Type type : model.getElements()) { System.out.println(type.getName()); }
  • 35. Eclipse Helios •Model Index • Grammar Mixins • Base Language • UI Features
  • 36.