SlideShare una empresa de Scribd logo
1 de 45
Descargar para leer sin conexión
How To Install                               2.3M6?

                        • Grab      one of the USB keys

                        • Install   the Eclipse SDK for your platform

                        • Choose  File
                           > New
                           > Example...
                           > Eclipse Con 2012 - Xtext Tutorial




Mittwoch, 28. März 12
DSLS FOR JAVA DEVELOPERS
                        Sebastian Zarnekow - Jan Köhnlein




                               (c) itemis - Licensed under EPL

Mittwoch, 28. März 12
@ ECLIPSECON 2012
           Tomorrow
            •   DESAGN - A DSL for engineer-to-order
                Esa Ryhänen and Martin Nilsson - ERules; AB Sandvik Coromant
            •   Domain Specific Languages
                Sven Efftinge - itemis
            •   Spraying - a quick way to create Graphitis
                Karsten Thoms - itemis
            •   Xtext success story at Google
                Alex Ruiz - Google
            •   Bringing the power of Eclipse to Digital Hardware designers
                Hendrik Eeckhaut - Sigasi
            •   A Fresh Look at Graphical Editing
                Jan Köhnlein - itemis


Mittwoch, 28. März 12
EVEN MORE
           Wednesday
            •   e(fx)clipse - Eclipse Tooling and Runtime for JavaFX
                Tom Schindl - bestsolution.at
            •   Program, thou shalt behave!
                Birgit Engelmann and Sebastian Benz - BMW Car IT
            •   Win Friends and Influence People... with DSLs
                Vladimir Bacvanski and LloydMangnall - SciSpike; VHA, Inc.
            •   Xcore: Ecore Meets Xtext
                Ed Merks - itemis
           Thursday
            •   Eclipse Xtend - A Language Made For Java Developers
                Sven Efftinge - itemis
            •   Xtext - Best Practices
                Sebastian Zarnekow - itemis
Mittwoch, 28. März 12
OUTLINE
                                  meta
                           Outline

                        (1) Create a DSL using Xtext

                        (2) Make your DSL refer to Java

                        (3) Get acquainted with the JVM model

                        (4) Map your DSL to Java using Xtend

                        (5) Add expressions to your DSL


Mittwoch, 28. März 12
DSLs for Java Developers?




Mittwoch, 28. März 12
DSLs for Java Developers?
                          import java.util.*
                          package hello.world {
                          	 entity Person {
                          	 	 firstName: String
                          	 	 lastName: String
                          	 	 friends: List<Person>

                          	   	   op getFullName() : String {
                          	   	   	 firstName + ' ' + lastName
                          	   	   }
                          	   	
                          	   	   op sortedFriends() : List<Person> {
                          	   	    	 friends.sortBy [p | p.fullName]
                          	   	   }
                          	   }
                          }


Mittwoch, 28. März 12
DSLs for Java Developers?



                             DSL        Java




Mittwoch, 28. März 12
DSLs for Java Developers?
                         • Use Java’s type system
                         • Use Java libraries, frameworks and code




                                 DSL                Java




Mittwoch, 28. März 12
DSLs for Java Developers?
                         • Use Java’s type system
                         • Use Java libraries, frameworks and code




                                  DSL               Java


                         • Integrate
                                   DSL code into Java application
                         • Execute DSL on JVM



Mittwoch, 28. März 12
AST

               DSL




Mittwoch, 28. März 12
.class
                        AST    File

               DSL

                              .java
                               File



Mittwoch, 28. März 12
.class
                        AST                 File

               DSL            Type Model

                                           .java
                                            File



Mittwoch, 28. März 12
.class
                        AST                           File

               DSL                      Type Model
                         (po
                            int
                                  to)                .java
                                                      File



Mittwoch, 28. März 12
.class
                        AST                           File

               DSL                      Type Model
                         (po
                            int
                                  to)                 .java
                                                       File



                                                     Infrastructure
Mittwoch, 28. März 12
.class
                        AST                           File

               DSL                      Type Model
                         (po
                            int
                                  to)                 .java
                                                       File

                                                         for

                                                     Infrastructure
Mittwoch, 28. März 12
.class
                        AST              File

               DSL
                         (po
                            int
                                  to)   .java
                                         File



Mittwoch, 28. März 12
.class
                               File


                        AST

               DSL




                              .java
                               File
Mittwoch, 28. März 12
.class
                                               File


                        AST   Inferred Java
                                     Types
               DSL




                                              .java
                                               File
Mittwoch, 28. März 12
.class
                                               File


                        AST   Inferred Java
                                     Types
               DSL




                                              .java
                                               File
Mittwoch, 28. März 12
.class
                                               File


                        AST   Inferred Java
                                     Types
               DSL




                                              .java
                                               File
Mittwoch, 28. März 12
.class
                                               File


                        AST   Inferred Java
                                     Types
               DSL




                                              .java
                                               File
Mittwoch, 28. März 12
.class
                         File



                        .java
               DSL
                         File



                        .java
                         File
Mittwoch, 28. März 12
.class
                         File



                        .java
               DSL
                         File



                        .java
                         File
Mittwoch, 28. März 12
OUTLINE

                        (1) Create a DSL using Xtext

                        (2) Make your DSL refer to Java

                        (3) Get acquainted with the JVM model

                        (4) Map your DSL to Java using Xtend

                        (5) Add expressions to your DSL


Mittwoch, 28. März 12
.class
                         File



                        .java
               DSL
                         File



                        .java
                         File
Mittwoch, 28. März 12
.class
                         File



                        .java




                                 EXERCISE #1
         DSL
                         File



                        .java
                         File




Mittwoch, 28. März 12
.class
                         File



                        .java




                                 EXERCISE #1
         DSL
                         File



                        .java
                         File



                                 import types.*

                                 package tutorial {
                                 	 entity Person {
                                 	 	 firstName: String
                                 	 	 lastName: String
                                 	 }		
                                 }

                                 package types {
                                 	 type String
                                 }



Mittwoch, 28. März 12
OUTLINE

                        (1) Create a DSL using Xtext

                        (2) Make your DSL refer to Java

                        (3) Get acquainted with the JVM model

                        (4) Map your DSL to Java using Xtend

                        (5) Add expressions to your DSL


Mittwoch, 28. März 12
.class
                         File



                        .java
               DSL
                         File



                        .java
                         File
Mittwoch, 28. März 12
.class
                         File



                        .java




                                 EXERCISE #2
         DSL
                         File



                        .java
                         File




Mittwoch, 28. März 12
.class
                         File



                        .java




                                 EXERCISE #2
         DSL
                         File



                        .java
                         File




                                 import java.util.*

                                 package tutorial {
                                 	 entity Person {
                                 	 	 firstName: String
                                 	 	 lastName: String
                                 	 	 birthday: Date
                                 	 }		
                                 }




Mittwoch, 28. März 12
OUTLINE

                        (1) Create a DSL using Xtext

                        (2) Make your DSL refer to Java

                        (3) Get acquainted with the JVM model

                        (4) Map your DSL to Java using Xtend

                        (5) Add expressions to your DSL


Mittwoch, 28. März 12
.class
                         File



                        .java
               DSL
                         File



                        .java
                         File
Mittwoch, 28. März 12
.class
                         File



                        .java




                                 EXERCISE #3
         DSL
                         File



                        .java
                         File




Mittwoch, 28. März 12
.class
                           File



                          .java




                                   EXERCISE #3
         DSL
                           File



                          .java
                           File




                        • Get familiar with the JVM model
                        • Learn about the JvmTypesBuilder
                        • Use Xtend to create a JVM model




Mittwoch, 28. März 12
OUTLINE

                        (1) Create a DSL using Xtext

                        (2) Make your DSL refer to Java

                        (3) Get acquainted with the JVM model

                        (4) Map your DSL to Java using Xtend

                        (5) Add expressions to your DSL


Mittwoch, 28. März 12
.class
                         File



                        .java
               DSL
                         File



                        .java
                         File
Mittwoch, 28. März 12
.class
                         File



                        .java




                                 EXERCISE #4
         DSL
                         File



                        .java
                         File




Mittwoch, 28. März 12
.class
                         File



                        .java




                                 EXERCISE #4
         DSL
                         File



                        .java
                         File




                                 Map your DSL to Java!




Mittwoch, 28. März 12
OUTLINE

                        (1) Create a DSL using Xtext

                        (2) Make your DSL refer to Java

                        (3) Get acquainted with the JVM model

                        (4) Map your DSL to Java using Xtend

                        (5) Add expressions to your DSL


Mittwoch, 28. März 12
.class
                         File



                        .java
               DSL
                         File



                        .java
                         File
Mittwoch, 28. März 12
.class
                         File



                        .java




                                 EXERCISE #5
         DSL
                         File



                        .java
                         File




Mittwoch, 28. März 12
.class
                         File



                        .java




                                      EXERCISE #5
         DSL
                         File



                        .java
                         File




                        import java.util.*
                        package hello.world {
                        	 entity Person {
                        	 	 firstName: String
                        	 	 lastName: String
                        	 	 friends: List<Person>

                        	        	   op getFullName() : String {
                        	        	   	 firstName + ' ' + lastName
                        	        	   }
                        	        	
                        	        	   op sortedFriends() : List<Person> {
                        	        	    	 friends.sortBy [p | p.fullName]
                        	        	   }
                        	        }
                        }


Mittwoch, 28. März 12
Mittwoch, 28. März 12

Más contenido relacionado

Destacado

Xtend - A Language Made for Java Developers
Xtend - A Language Made for Java DevelopersXtend - A Language Made for Java Developers
Xtend - A Language Made for Java DevelopersSebastian Zarnekow
 
Serializing EMF models with Xtext
Serializing EMF models with XtextSerializing EMF models with Xtext
Serializing EMF models with Xtextmeysholdt
 
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
 
ARText - Driving Developments with Xtext
ARText - Driving Developments with XtextARText - Driving Developments with Xtext
ARText - Driving Developments with XtextSebastian Benz
 
Language Engineering With Xtext
Language Engineering With XtextLanguage Engineering With Xtext
Language Engineering With XtextSven Efftinge
 
Codegeneration Goodies
Codegeneration GoodiesCodegeneration Goodies
Codegeneration Goodiesmeysholdt
 
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
 
Executable specifications for xtext
Executable specifications for xtextExecutable specifications for xtext
Executable specifications for xtextmeysholdt
 
Parsing Expression With Xtext
Parsing Expression With XtextParsing Expression With Xtext
Parsing Expression With XtextSven Efftinge
 

Destacado (20)

EMF Tips n Tricks
EMF Tips n TricksEMF Tips n Tricks
EMF Tips n Tricks
 
Xtend - A Language Made for Java Developers
Xtend - A Language Made for Java DevelopersXtend - A Language Made for Java Developers
Xtend - A Language Made for Java Developers
 
Serializing EMF models with Xtext
Serializing EMF models with XtextSerializing EMF models with Xtext
Serializing EMF models with Xtext
 
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
 
ARText - Driving Developments with Xtext
ARText - Driving Developments with XtextARText - Driving Developments with Xtext
ARText - Driving Developments with Xtext
 
Language Engineering With Xtext
Language Engineering With XtextLanguage Engineering With Xtext
Language Engineering With Xtext
 
What's Cooking in Xtext 2.0
What's Cooking in Xtext 2.0What's Cooking in Xtext 2.0
What's Cooking in Xtext 2.0
 
Scoping
ScopingScoping
Scoping
 
Scoping Tips and Tricks
Scoping Tips and TricksScoping Tips and Tricks
Scoping Tips and Tricks
 
Codegeneration Goodies
Codegeneration GoodiesCodegeneration Goodies
Codegeneration Goodies
 
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
 
Executable specifications for xtext
Executable specifications for xtextExecutable specifications for xtext
Executable specifications for xtext
 
Future of Xtext
Future of XtextFuture of Xtext
Future of Xtext
 
Parsing Expression With Xtext
Parsing Expression With XtextParsing Expression With Xtext
Parsing Expression With Xtext
 
Java DSLs with Xtext
Java DSLs with XtextJava DSLs with Xtext
Java DSLs with Xtext
 

Más de Dr. Jan Köhnlein

The Eclipse Layout Kernel sirius con 2017
The Eclipse Layout Kernel   sirius con 2017The Eclipse Layout Kernel   sirius con 2017
The Eclipse Layout Kernel sirius con 2017Dr. Jan Köhnlein
 
A New Approach Towards Web-based IDEs
A New Approach Towards Web-based IDEsA New Approach Towards Web-based IDEs
A New Approach Towards Web-based IDEsDr. Jan Köhnlein
 
A fresh look at graphical editing
A fresh look at graphical editingA fresh look at graphical editing
A fresh look at graphical editingDr. Jan Köhnlein
 
A fresh look at graphical editing
A fresh look at graphical editingA fresh look at graphical editing
A fresh look at graphical editingDr. Jan Köhnlein
 
A fresh look at graphical editing
A fresh look at graphical editingA fresh look at graphical editing
A fresh look at graphical editingDr. Jan Köhnlein
 
Android tutorial - Xtext slides
Android tutorial - Xtext slidesAndroid tutorial - Xtext slides
Android tutorial - Xtext slidesDr. Jan Köhnlein
 
Combining Text and Graphics in Eclipse-based Modeling Tools
Combining Text and Graphics in Eclipse-based Modeling ToolsCombining Text and Graphics in Eclipse-based Modeling Tools
Combining Text and Graphics in Eclipse-based Modeling ToolsDr. Jan Köhnlein
 
Combining Graphical and Textual
Combining Graphical and TextualCombining Graphical and Textual
Combining Graphical and TextualDr. Jan Köhnlein
 
Domain Specific Languages With Eclipse Modeling
Domain Specific Languages With Eclipse ModelingDomain Specific Languages With Eclipse Modeling
Domain Specific Languages With Eclipse ModelingDr. Jan Köhnlein
 
Domänenspezifische Sprachen mit Xtext
Domänenspezifische Sprachen mit XtextDomänenspezifische Sprachen mit Xtext
Domänenspezifische Sprachen mit XtextDr. Jan Köhnlein
 

Más de Dr. Jan Köhnlein (18)

The Eclipse Layout Kernel sirius con 2017
The Eclipse Layout Kernel   sirius con 2017The Eclipse Layout Kernel   sirius con 2017
The Eclipse Layout Kernel sirius con 2017
 
A New Approach Towards Web-based IDEs
A New Approach Towards Web-based IDEsA New Approach Towards Web-based IDEs
A New Approach Towards Web-based IDEs
 
Responsiveness
ResponsivenessResponsiveness
Responsiveness
 
Getting rid of backtracking
Getting rid of backtrackingGetting rid of backtracking
Getting rid of backtracking
 
XRobots
XRobotsXRobots
XRobots
 
Code Generation With Xtend
Code Generation With XtendCode Generation With Xtend
Code Generation With Xtend
 
A fresh look at graphical editing
A fresh look at graphical editingA fresh look at graphical editing
A fresh look at graphical editing
 
A fresh look at graphical editing
A fresh look at graphical editingA fresh look at graphical editing
A fresh look at graphical editing
 
A fresh look at graphical editing
A fresh look at graphical editingA fresh look at graphical editing
A fresh look at graphical editing
 
Android tutorial - Xtext slides
Android tutorial - Xtext slidesAndroid tutorial - Xtext slides
Android tutorial - Xtext slides
 
Eclipse meets e4
Eclipse meets e4Eclipse meets e4
Eclipse meets e4
 
Combining Text and Graphics in Eclipse-based Modeling Tools
Combining Text and Graphics in Eclipse-based Modeling ToolsCombining Text and Graphics in Eclipse-based Modeling Tools
Combining Text and Graphics in Eclipse-based Modeling Tools
 
Combining Graphical and Textual
Combining Graphical and TextualCombining Graphical and Textual
Combining Graphical and Textual
 
Domain Specific Languages With Eclipse Modeling
Domain Specific Languages With Eclipse ModelingDomain Specific Languages With Eclipse Modeling
Domain Specific Languages With Eclipse Modeling
 
Domänenspezifische Sprachen mit Xtext
Domänenspezifische Sprachen mit XtextDomänenspezifische Sprachen mit Xtext
Domänenspezifische Sprachen mit Xtext
 
Workshop On Xtext
Workshop On XtextWorkshop On Xtext
Workshop On Xtext
 
EMF Index
EMF IndexEMF Index
EMF Index
 
Eclipse Modeling Overview
Eclipse Modeling OverviewEclipse Modeling Overview
Eclipse Modeling Overview
 

DSLs for Java Developers

  • 1. How To Install 2.3M6? • Grab one of the USB keys • Install the Eclipse SDK for your platform • Choose File > New > Example... > Eclipse Con 2012 - Xtext Tutorial Mittwoch, 28. März 12
  • 2. DSLS FOR JAVA DEVELOPERS Sebastian Zarnekow - Jan Köhnlein (c) itemis - Licensed under EPL Mittwoch, 28. März 12
  • 3. @ ECLIPSECON 2012 Tomorrow • DESAGN - A DSL for engineer-to-order Esa Ryhänen and Martin Nilsson - ERules; AB Sandvik Coromant • Domain Specific Languages Sven Efftinge - itemis • Spraying - a quick way to create Graphitis Karsten Thoms - itemis • Xtext success story at Google Alex Ruiz - Google • Bringing the power of Eclipse to Digital Hardware designers Hendrik Eeckhaut - Sigasi • A Fresh Look at Graphical Editing Jan Köhnlein - itemis Mittwoch, 28. März 12
  • 4. EVEN MORE Wednesday • e(fx)clipse - Eclipse Tooling and Runtime for JavaFX Tom Schindl - bestsolution.at • Program, thou shalt behave! Birgit Engelmann and Sebastian Benz - BMW Car IT • Win Friends and Influence People... with DSLs Vladimir Bacvanski and LloydMangnall - SciSpike; VHA, Inc. • Xcore: Ecore Meets Xtext Ed Merks - itemis Thursday • Eclipse Xtend - A Language Made For Java Developers Sven Efftinge - itemis • Xtext - Best Practices Sebastian Zarnekow - itemis Mittwoch, 28. März 12
  • 5. OUTLINE meta Outline (1) Create a DSL using Xtext (2) Make your DSL refer to Java (3) Get acquainted with the JVM model (4) Map your DSL to Java using Xtend (5) Add expressions to your DSL Mittwoch, 28. März 12
  • 6. DSLs for Java Developers? Mittwoch, 28. März 12
  • 7. DSLs for Java Developers? import java.util.* package hello.world { entity Person { firstName: String lastName: String friends: List<Person> op getFullName() : String { firstName + ' ' + lastName } op sortedFriends() : List<Person> { friends.sortBy [p | p.fullName] } } } Mittwoch, 28. März 12
  • 8. DSLs for Java Developers? DSL Java Mittwoch, 28. März 12
  • 9. DSLs for Java Developers? • Use Java’s type system • Use Java libraries, frameworks and code DSL Java Mittwoch, 28. März 12
  • 10. DSLs for Java Developers? • Use Java’s type system • Use Java libraries, frameworks and code DSL Java • Integrate DSL code into Java application • Execute DSL on JVM Mittwoch, 28. März 12
  • 11. AST DSL Mittwoch, 28. März 12
  • 12. .class AST File DSL .java File Mittwoch, 28. März 12
  • 13. .class AST File DSL Type Model .java File Mittwoch, 28. März 12
  • 14. .class AST File DSL Type Model (po int to) .java File Mittwoch, 28. März 12
  • 15. .class AST File DSL Type Model (po int to) .java File Infrastructure Mittwoch, 28. März 12
  • 16. .class AST File DSL Type Model (po int to) .java File for Infrastructure Mittwoch, 28. März 12
  • 17. .class AST File DSL (po int to) .java File Mittwoch, 28. März 12
  • 18. .class File AST DSL .java File Mittwoch, 28. März 12
  • 19. .class File AST Inferred Java Types DSL .java File Mittwoch, 28. März 12
  • 20. .class File AST Inferred Java Types DSL .java File Mittwoch, 28. März 12
  • 21. .class File AST Inferred Java Types DSL .java File Mittwoch, 28. März 12
  • 22. .class File AST Inferred Java Types DSL .java File Mittwoch, 28. März 12
  • 23. .class File .java DSL File .java File Mittwoch, 28. März 12
  • 24. .class File .java DSL File .java File Mittwoch, 28. März 12
  • 25. OUTLINE (1) Create a DSL using Xtext (2) Make your DSL refer to Java (3) Get acquainted with the JVM model (4) Map your DSL to Java using Xtend (5) Add expressions to your DSL Mittwoch, 28. März 12
  • 26. .class File .java DSL File .java File Mittwoch, 28. März 12
  • 27. .class File .java EXERCISE #1 DSL File .java File Mittwoch, 28. März 12
  • 28. .class File .java EXERCISE #1 DSL File .java File import types.* package tutorial { entity Person { firstName: String lastName: String } } package types { type String } Mittwoch, 28. März 12
  • 29. OUTLINE (1) Create a DSL using Xtext (2) Make your DSL refer to Java (3) Get acquainted with the JVM model (4) Map your DSL to Java using Xtend (5) Add expressions to your DSL Mittwoch, 28. März 12
  • 30. .class File .java DSL File .java File Mittwoch, 28. März 12
  • 31. .class File .java EXERCISE #2 DSL File .java File Mittwoch, 28. März 12
  • 32. .class File .java EXERCISE #2 DSL File .java File import java.util.* package tutorial { entity Person { firstName: String lastName: String birthday: Date } } Mittwoch, 28. März 12
  • 33. OUTLINE (1) Create a DSL using Xtext (2) Make your DSL refer to Java (3) Get acquainted with the JVM model (4) Map your DSL to Java using Xtend (5) Add expressions to your DSL Mittwoch, 28. März 12
  • 34. .class File .java DSL File .java File Mittwoch, 28. März 12
  • 35. .class File .java EXERCISE #3 DSL File .java File Mittwoch, 28. März 12
  • 36. .class File .java EXERCISE #3 DSL File .java File • Get familiar with the JVM model • Learn about the JvmTypesBuilder • Use Xtend to create a JVM model Mittwoch, 28. März 12
  • 37. OUTLINE (1) Create a DSL using Xtext (2) Make your DSL refer to Java (3) Get acquainted with the JVM model (4) Map your DSL to Java using Xtend (5) Add expressions to your DSL Mittwoch, 28. März 12
  • 38. .class File .java DSL File .java File Mittwoch, 28. März 12
  • 39. .class File .java EXERCISE #4 DSL File .java File Mittwoch, 28. März 12
  • 40. .class File .java EXERCISE #4 DSL File .java File Map your DSL to Java! Mittwoch, 28. März 12
  • 41. OUTLINE (1) Create a DSL using Xtext (2) Make your DSL refer to Java (3) Get acquainted with the JVM model (4) Map your DSL to Java using Xtend (5) Add expressions to your DSL Mittwoch, 28. März 12
  • 42. .class File .java DSL File .java File Mittwoch, 28. März 12
  • 43. .class File .java EXERCISE #5 DSL File .java File Mittwoch, 28. März 12
  • 44. .class File .java EXERCISE #5 DSL File .java File import java.util.* package hello.world { entity Person { firstName: String lastName: String friends: List<Person> op getFullName() : String { firstName + ' ' + lastName } op sortedFriends() : List<Person> { friends.sortBy [p | p.fullName] } } } Mittwoch, 28. März 12