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
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
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
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
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
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
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