SlideShare une entreprise Scribd logo
1  sur  92
Pragmatic DSL Design with



Sven Efftinge (itemis) / Sebastian Zarnekow (itemis) / Jan Köhnlein (itemis)
The plan for today :
The plan for today :

1. Xtext 2.0
   What is Xtext and what’s new in 2.0?
   Hands-On : Develop a DSL.
The plan for today :

1. Xtext 2.0
   What is Xtext and what’s new in 2.0?
   Hands-On : Develop a DSL.

2. Xbase
   What’s that and why should I care?
   Hands-On : Play with it and integrate it in a DSL.
The plan for today :

1. Xtext 2.0
   What is Xtext and what’s new in 2.0?
   Hands-On : Develop a DSL.

2. Xbase
   What’s that and why should I care?
   Hands-On : Play with it and integrate it in a DSL.

3. Xtend
   Yet another language? Are you serious?
   Hands-On :Write a codegenerator with Xtend.
What is


          ?
Eclipse Project
IDE Framework
Language Framework
(Domain-Specific)
Language Framework
Users
Users
Eclipse IDE Framework (JFace Text, etc.)
Java
  Development
     Tools
     (JDT)




Eclipse IDE Framework (JFace Text, etc.)
Java
  Development
     Tools
     (JDT)




Eclipse IDE Framework (JFace Text, etc.)
Java
  Development
     Tools
     (JDT)




Eclipse IDE Framework (JFace Text, etc.)   Eclipse Modeling Framework (EMF)
Java
  Development
     Tools
     (JDT)
                                                               Antlr Parser
                                                                Generator




Eclipse IDE Framework (JFace Text, etc.)   Eclipse Modeling Framework (EMF)
is Highly Adaptable
Advanced Language-Specific Editing Features
                                  by Default
Advanced Language-Specific Editing Features
                                   by Default




                             Syntax Coloring
Advanced Language-Specific Editing Features
                                   by Default




                             Syntax Coloring



  Wizards
Advanced Language-Specific Editing Features
                                   by Default




Content Assist

                             Syntax Coloring



  Wizards
Advanced Language-Specific Editing Features
                                   by Default




Content Assist

                             Syntax Coloring



                               Code Folding
  Wizards
Advanced Language-Specific Editing Features
                                   by Default




Content Assist
 Find References
                             Syntax Coloring



                               Code Folding
  Wizards
Advanced Language-Specific Editing Features
                                    by Default



                     Global Indexing
Content Assist
 Find References
                              Syntax Coloring



                                Code Folding
  Wizards
Advanced Language-Specific Editing Features
                                      by Default

                           Go To Declaration

                     Global Indexing
Content Assist
 Find References
                              Syntax Coloring



                                 Code Folding
  Wizards
Advanced Language-Specific Editing Features
                                                 by Default

                                      Go To Declaration

                           Global Indexing
Content Assist
 Find References
                                         Syntax Coloring



                                            Code Folding
  Wizards          Bracket Matching
Advanced Language-Specific Editing Features
                                                 by Default

                                      Go To Declaration

                           Global Indexing
Content Assist
 Find References
                                         Syntax Coloring

                               Auto Editing
                                            Code Folding
  Wizards          Bracket Matching
Advanced Language-Specific Editing Features
                                                     by Default

                                          Go To Declaration

                               Global Indexing
Content Assist
 Find References
                                             Syntax Coloring
Incremental Builders
                                   Auto Editing
                                                Code Folding
   Wizards             Bracket Matching
Advanced Language-Specific Editing Features
                                                     by Default

                                          Go To Declaration

                               Global Indexing
Content Assist                                   Outline View


 Find References
                                             Syntax Coloring
Incremental Builders
                                   Auto Editing
                                                Code Folding
   Wizards             Bracket Matching
Advanced Language-Specific Editing Features
                                                     by Default

                                          Go To Declaration

                               Global Indexing
Content Assist                                   Outline View


 Find References
Incremental Builders
                        Validation           Syntax Coloring

                                   Auto Editing
                                                Code Folding
   Wizards             Bracket Matching
Advanced Language-Specific Editing Features
                                                     by Default

                                          Go To Declaration
      Template Proposals
                               Global Indexing
Content Assist                                   Outline View


 Find References
Incremental Builders
                        Validation           Syntax Coloring

                                   Auto Editing
                                                Code Folding
   Wizards             Bracket Matching
Advanced Language-Specific Editing Features
                                                     by Default

                                          Go To Declaration
      Template Proposals
                               Global Indexing
Content Assist                                   Outline View
                         Quick Fixes
 Find References
Incremental Builders
                        Validation           Syntax Coloring

                                   Auto Editing
                                                Code Folding
   Wizards             Bracket Matching
Advanced Language-Specific Editing Features
                                                     by Default
                Refactoring               Go To Declaration
      Template Proposals
                               Global Indexing
Content Assist                                   Outline View
                         Quick Fixes
 Find References
Incremental Builders
                        Validation           Syntax Coloring

                                   Auto Editing
                                                Code Folding
   Wizards             Bracket Matching
Advanced Language-Specific Editing Features
                                                     by Default
                Refactoring               Go To Declaration
      Template Proposals
                               Global Indexing
Content Assist                                   Outline View
                         Quick Fixes
 Find References
Incremental Builders
                        Validation           Syntax Coloring


             Rich Hovers           Auto Editing
                                                Code Folding
   Wizards             Bracket Matching
... but there is a problem
       with external DSLs
What about
Expressions?
Expressions are
 complicated !
Protected Regions
Protected Regions
• generated and manually written code mixed
  up
Protected Regions
• generated and manually written code mixed
  up
• manual deletion of artifacts
Protected Regions
• generated and manually written code mixed
  up
• manual deletion of artifacts
• platform dependent information
Protected Regions
• generated and manually written code mixed
  up
• manual deletion of artifacts
• platform dependent information
• information is spreaded!
Generation Gap Pattern
Generation Gap Pattern
     technically required type hierarchies
Generation Gap Pattern
     technically required type hierarchies
                    additional complexity
Generation Gap Pattern
     technically required type hierarchies
                    additional complexity
         platform dependent information
Generation Gap Pattern
     technically required type hierarchies
                    additional complexity
         platform dependent information
             information spreaded!
Black box
target language literals
Black box
target language literals
• bound to target platform
Black box
target language literals
• bound to target platform
 • no option for MDA friends
Black box
target language literals
• bound to target platform
 • no option for MDA friends
• no tooling!
Black box
target language literals
• bound to target platform
 • no option for MDA friends
• no tooling!
• long turnarounds!
base
base
Modern Expression Language
base
Modern Expression Language
JVM-Integration
base
Modern Expression Language
JVM-Integration
Statically Typed
base
Modern Expression Language
JVM-Integration
Statically Typed
Highly Reusable
Your Language




                o.e.xtext.common.Terminals
EMF
Your Language




      common.Types
                               o.e.xtext.common.Terminals


JDT   JVM        EMF
Your Language


      Xbase Ecore
                                      Xbase Grammar
      common.Types


                                o.e.xtext.common.Terminals
JDT   JVM           EMF
@Override
protected IScope createLocalVarScope(~) {
    if (context instanceof Operation) {
        IScope actualScope =
          super.createLocalVarScope(~);
        Operation operation = (Operation) context;
        return createScope(operation.getParams(),
                          actualScope);
    }
    return super.createLocalVarScope(~);
}
Using Xbase
Using Xbase

Mixin the Grammar
Using Xbase

Mixin the Grammar
JVM Model Inference
Using Xbase

Mixin the Grammar
JVM Model Inference
Scoping
Using Xbase

Mixin the Grammar
JVM Model Inference
Scoping
Type System
Using Xbase

Mixin the Grammar
JVM Model Inference
Scoping
Type System
Compiler / Interpreter
A DSL for Generating Code
Model               Code




          Code
        Generator
Model                                Code
                    package base;



                    public   class Address {
                    	        private String street;
                    	        	
                    	        public String getStreet() {
                    	        	      return street;
                    	        }
                    	
                    	        public void setStreet(String street) {
                    	        	      this.street = street;
                    	        }
                    	
                    	        private String city;

          Code      	
                    	
                    	
                             	
                             public String getCity() {
                             	      return city;


        Generator
                    	        }
                    	
                    	        public void setCity(String city) {
                    	        	      this.city = city;
                    	        }
                    	
                    	        private String state;
                    	        	
                    	        public String getState() {
                    	        	      return state;
                    	        }
                    	
                    	        public void setState(String state) {
                    	        	      this.state = state;
                    	        }

                    	        private String postalCode;
                    	        	
                    	        public String getPostalCode() {
                    	        	      return postalCode;
                    	        }
                    	
                    	        public void setPostalCode(String postalCode) {
                    	        	      this.postalCode = postalCode;
                    	        }
                    	
                    }
BUT I CAN
DO THAT IN
package example.codegen;

import   org.eclipse.xtext.common.types.JvmFormalParameter;
import   org.eclipse.xtext.common.types.JvmTypeReference;
import   org.eclipse.xtext.example.domainmodel.domainmodel.Entity;
import   org.eclipse.xtext.example.domainmodel.domainmodel.Feature;
import   org.eclipse.xtext.example.domainmodel.domainmodel.Operation;
import   org.eclipse.xtext.example.domainmodel.domainmodel.Property;

public class JavaGenerator {

	   public String compile(Entity e) {
	   	 StringBuilder b = new StringBuilder();
	   	 b.append("package " + packageName(e) + "n");
	   	 b.append("n");
	   	 b.append("/**n");
	   	 b.append(" * Automatically generated. Direct modification is futile.n");
	   	 b.append(" */n");
	   	 b.append("public class ").append(e.getName());
	   	 if(e.getSuperType() != null) {
	   	 	 b.append(" extends ").append(compile(e.getSuperType()));
	   	 }
	   	 b.append(" {n");
	   	 for(Feature f: e.getFeatures()) {
	   	 	 if(f instanceof Property)
	   	 	 	 feature((Property)f);
	   	 	 else if(f instanceof Operation)
	   	 	 	 feature((Operation)f);
	   	 }
	   	 b.append("}n");
	   	 return b.toString();
package example.codegen;

import   org.eclipse.xtext.common.types.JvmFormalParameter;
import   org.eclipse.xtext.common.types.JvmTypeReference;
import   org.eclipse.xtext.example.domainmodel.domainmodel.Entity;
import   org.eclipse.xtext.example.domainmodel.domainmodel.Feature;
import   org.eclipse.xtext.example.domainmodel.domainmodel.Operation;
import   org.eclipse.xtext.example.domainmodel.domainmodel.Property;

public class JavaGenerator {                             No Multiline
	
	
    public String compile(Entity e) {
    	 StringBuilder b = new StringBuilder();
                                                         String Literals
	   	 b.append("package " + packageName(e) + "n");
	   	 b.append("n");
	   	 b.append("/**n");
	   	 b.append(" * Automatically generated. Direct modification is futile.n");
	   	 b.append(" */n");
	   	 b.append("public class ").append(e.getName());
	   	 if(e.getSuperType() != null) {
	   	 	 b.append(" extends ").append(compile(e.getSuperType()));
	   	 }
	   	 b.append(" {n");
	   	 for(Feature f: e.getFeatures()) {
	   	 	 if(f instanceof Property)
	   	 	 	 feature((Property)f);
	   	 	 else if(f instanceof Operation)
	   	 	 	 feature((Operation)f);
	   	 }
	   	 b.append("}n");
	   	 return b.toString();
public String compile(Entity e) {
	   	 StringBuilder b = new StringBuilder();
	   	 b.append("package " + packageName(e) + "n");
	   	 b.append("n");
	   	 b.append("/**n");
	   	 b.append(" * Automatically generated. Direct modification is futile.n");
	   	 b.append(" */n");
	   	 b.append("public class ").append(e.getName());
	   	 if(e.getSuperType() != null) {
	   	 	 b.append(" extends ").append(compile(e.getSuperType()));
	   	 }
	   	 b.append(" {n");
	   	 for(Feature f: e.getFeatures()) {
	
	
    	 	 if(f instanceof Property)
    	 	 	 feature((Property)f);
                                            Instanceof
	
	
    	 	 else if(f instanceof Operation)
    	 	 	 feature((Operation)f);
                                             Cascades
	   	 }
	   	 b.append("}n");
	   	 return b.toString();
	   }
	
	   public String feature(Property property) {
	   	 StringBuilder b = new StringBuilder();
	   	 String type = compile(property.getType());
	   	 String name = property.getName();
	   	 b.append("// property ").append(name).append("n");
	   	 b.append("private ").append(type).append(" ").append(name).append("n");
	   	 b.append("n");
	   	 b.append("public ").append(type).append("get").append(name).append("() {n");
	   	 b.append(" return ").append(name).append(";n");
}
	   	   b.append("}n");
	   	   return b.toString();
	   }
	
	   public String feature(Property property) {
	   	 StringBuilder b = new StringBuilder();
	   	 String type = compile(property.getType());
	   	 String name = property.getName();
	   	 b.append("// property ").append(name).append("n");
	   	 b.append("private ").append(type).append(" ").append(name).append("n");
	   	 b.append("n");
	   	 b.append("public ").append(type).append("get").append(name).append("() {n");
	   	 b.append(" return ").append(name).append(";n");
	   	 b.append("}n");
	   	 b.append("n");
	   	 b.append("public ").append("set").append(name)
	   	 	 .append("(").append(type).append(" ").append(name).append("){n");
	   	 b.append(" this.").append(name).append(" = ").append(name).append(";n");
	   	 b.append("}n");
	   	 b.append("n");
	   	 return b.toString();
	   }
                                                       Noisy String
	
	
    public String feature(Operation operation) {
    	 StringBuilder b = new StringBuilder();          Concatenation
	   	 String name = operation.getName();
	   	 b.append("// operation ").append(name).append("n");
	   	 b.append(compile(operation.getType())).append(" ").append(name).append("(");
	   	 boolean isFirst = true;
	   	 for(JvmFormalParameter p: operation.getParams()) {
Statically
  Typed
Statically     Xbase
  Typed      Expressions
« RICH STRINGS »
POLYMORPHIC
 dispatch
COMPILES TO
DEPENDENCY
@InjectION
TOOLING
Indigo - June 22nd

Contenu connexe

Tendances

Lessons learned on localization testing
Lessons learned on localization testingLessons learned on localization testing
Lessons learned on localization testinggaoliang641
 
Introduction to programming world
Introduction to programming worldIntroduction to programming world
Introduction to programming worldJaskaran Singh
 
High Level Application Scripting With EFL and LuaJIT
High Level Application Scripting With EFL and LuaJITHigh Level Application Scripting With EFL and LuaJIT
High Level Application Scripting With EFL and LuaJITSamsung Open Source Group
 
Ipt655 Wk6 Word Powerpoint
Ipt655 Wk6 Word PowerpointIpt655 Wk6 Word Powerpoint
Ipt655 Wk6 Word PowerpointSaraJoy
 

Tendances (6)

DevOps
DevOpsDevOps
DevOps
 
Lessons learned on localization testing
Lessons learned on localization testingLessons learned on localization testing
Lessons learned on localization testing
 
Deep learning for NLP
Deep learning for NLPDeep learning for NLP
Deep learning for NLP
 
Introduction to programming world
Introduction to programming worldIntroduction to programming world
Introduction to programming world
 
High Level Application Scripting With EFL and LuaJIT
High Level Application Scripting With EFL and LuaJITHigh Level Application Scripting With EFL and LuaJIT
High Level Application Scripting With EFL and LuaJIT
 
Ipt655 Wk6 Word Powerpoint
Ipt655 Wk6 Word PowerpointIpt655 Wk6 Word Powerpoint
Ipt655 Wk6 Word Powerpoint
 

En vedette

Xbase - Implementing Domain-Specific Languages for Java
Xbase - Implementing Domain-Specific Languages for JavaXbase - Implementing Domain-Specific Languages for Java
Xbase - Implementing Domain-Specific Languages for Javameysholdt
 
Building Your Own DSL with Xtext
Building Your Own DSL with XtextBuilding Your Own DSL with Xtext
Building Your Own DSL with XtextGlobalLogic Ukraine
 
Extending the Xbase Typesystem
Extending the Xbase TypesystemExtending the Xbase Typesystem
Extending the Xbase TypesystemSebastian Zarnekow
 
Executable specifications for xtext
Executable specifications for xtextExecutable specifications for xtext
Executable specifications for xtextmeysholdt
 
Introduction to Xbase
Introduction to XbaseIntroduction to Xbase
Introduction to XbaseHolger Schill
 
Using Xcore with Xtext
Using Xcore with XtextUsing Xcore with Xtext
Using Xcore with XtextHolger Schill
 
Xtext's new Formatter API
Xtext's new Formatter APIXtext's new Formatter API
Xtext's new Formatter APImeysholdt
 
Building a Python IDE with Xtext
Building a Python IDE with XtextBuilding a Python IDE with Xtext
Building a Python IDE with XtextSebastian Zarnekow
 
Jazoon 2010 - Building DSLs with Eclipse
Jazoon 2010 - Building DSLs with EclipseJazoon 2010 - Building DSLs with Eclipse
Jazoon 2010 - Building DSLs with EclipsePeter Friese
 
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
 
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
 
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
 
Codegeneration Goodies
Codegeneration GoodiesCodegeneration Goodies
Codegeneration Goodiesmeysholdt
 

En vedette (20)

Xbase - Implementing Domain-Specific Languages for Java
Xbase - Implementing Domain-Specific Languages for JavaXbase - Implementing Domain-Specific Languages for Java
Xbase - Implementing Domain-Specific Languages for Java
 
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
 
Scoping
ScopingScoping
Scoping
 
Scoping Tips and Tricks
Scoping Tips and TricksScoping Tips and Tricks
Scoping Tips and Tricks
 
Extending the Xbase Typesystem
Extending the Xbase TypesystemExtending the Xbase Typesystem
Extending the Xbase Typesystem
 
Executable specifications for xtext
Executable specifications for xtextExecutable specifications for xtext
Executable specifications for xtext
 
Java DSLs with Xtext
Java DSLs with XtextJava DSLs with Xtext
Java DSLs with Xtext
 
Introduction to Xbase
Introduction to XbaseIntroduction to Xbase
Introduction to Xbase
 
Using Xcore with Xtext
Using Xcore with XtextUsing Xcore with Xtext
Using Xcore with Xtext
 
Xtext's new Formatter API
Xtext's new Formatter APIXtext's new Formatter API
Xtext's new Formatter API
 
Building a Python IDE with Xtext
Building a Python IDE with XtextBuilding a Python IDE with Xtext
Building a Python IDE with Xtext
 
Jazoon 2010 - Building DSLs with Eclipse
Jazoon 2010 - Building DSLs with EclipseJazoon 2010 - Building DSLs with Eclipse
Jazoon 2010 - Building DSLs with Eclipse
 
Graphical Views For Xtext
Graphical Views For XtextGraphical Views For Xtext
Graphical Views For Xtext
 
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
 
Enhancing Xtext for General Purpose Languages
Enhancing Xtext for General Purpose LanguagesEnhancing Xtext for General Purpose Languages
Enhancing Xtext for General Purpose Languages
 
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
 
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
 
Codegeneration Goodies
Codegeneration GoodiesCodegeneration Goodies
Codegeneration Goodies
 

Similaire à Pragmatic DSL Design with Xtext 2.0, Xbase and Xtend

Павел Фатин и Александр Подхалюзин «Scala plugin for IntelliJ IDEA»
Павел Фатин и Александр Подхалюзин «Scala plugin for IntelliJ IDEA»Павел Фатин и Александр Подхалюзин «Scala plugin for IntelliJ IDEA»
Павел Фатин и Александр Подхалюзин «Scala plugin for IntelliJ IDEA»e-Legion
 
The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)lennartkats
 
VA Code Completion
VA Code CompletionVA Code Completion
VA Code CompletionESUG
 
DSL, the absolute weapon for the development
DSL, the absolute weapon for the developmentDSL, the absolute weapon for the development
DSL, the absolute weapon for the developmentESUG
 
WIAD2012 A2 - Letting go of perfection: Developing IA agility
WIAD2012 A2 - Letting go of perfection: Developing IA agilityWIAD2012 A2 - Letting go of perfection: Developing IA agility
WIAD2012 A2 - Letting go of perfection: Developing IA agilityChris Farnum
 
Aras PLM Viewing Markup and Secure Social
Aras PLM Viewing Markup and Secure SocialAras PLM Viewing Markup and Secure Social
Aras PLM Viewing Markup and Secure SocialAras
 
Domain Specific Language Design
Domain Specific Language DesignDomain Specific Language Design
Domain Specific Language DesignMarkus Voelter
 
Mind Click Services
Mind Click ServicesMind Click Services
Mind Click ServicesMind Click
 
TERMINALFOUR t44u 2009 - University of St Andrews Case Study
TERMINALFOUR t44u 2009 - University of St Andrews Case StudyTERMINALFOUR t44u 2009 - University of St Andrews Case Study
TERMINALFOUR t44u 2009 - University of St Andrews Case StudyTerminalfour
 
Aras PLM Software Visualization
Aras PLM Software VisualizationAras PLM Software Visualization
Aras PLM Software VisualizationAras
 
Presenter manual web designing (specially for summer interns)
Presenter manual web designing (specially for summer interns)Presenter manual web designing (specially for summer interns)
Presenter manual web designing (specially for summer interns)XPERT INFOTECH
 
HTML5 and Timed Media Playback
HTML5 and Timed Media PlaybackHTML5 and Timed Media Playback
HTML5 and Timed Media PlaybackSidra Abbasi
 
Visual Experience 360 Flex
Visual Experience 360 FlexVisual Experience 360 Flex
Visual Experience 360 FlexJuan Sanchez
 
MIX11アップデート ~Windows Phone 7, Silverlight 5, IE9, HTML5~ 前編
MIX11アップデート ~Windows Phone 7, Silverlight 5, IE9, HTML5~ 前編MIX11アップデート ~Windows Phone 7, Silverlight 5, IE9, HTML5~ 前編
MIX11アップデート ~Windows Phone 7, Silverlight 5, IE9, HTML5~ 前編Microsoft
 
Converging Textual and Graphical Editors
Converging Textual  and Graphical EditorsConverging Textual  and Graphical Editors
Converging Textual and Graphical Editorsmeysholdt
 
DSL Construction rith Ruby
DSL Construction rith RubyDSL Construction rith Ruby
DSL Construction rith RubyThoughtWorks
 

Similaire à Pragmatic DSL Design with Xtext 2.0, Xbase and Xtend (20)

Павел Фатин и Александр Подхалюзин «Scala plugin for IntelliJ IDEA»
Павел Фатин и Александр Подхалюзин «Scala plugin for IntelliJ IDEA»Павел Фатин и Александр Подхалюзин «Scala plugin for IntelliJ IDEA»
Павел Фатин и Александр Подхалюзин «Scala plugin for IntelliJ IDEA»
 
The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)
 
VA Code Completion
VA Code CompletionVA Code Completion
VA Code Completion
 
DSL, the absolute weapon for the development
DSL, the absolute weapon for the developmentDSL, the absolute weapon for the development
DSL, the absolute weapon for the development
 
Sapphire
SapphireSapphire
Sapphire
 
Language Weaver
Language WeaverLanguage Weaver
Language Weaver
 
WIAD2012 A2 - Letting go of perfection: Developing IA agility
WIAD2012 A2 - Letting go of perfection: Developing IA agilityWIAD2012 A2 - Letting go of perfection: Developing IA agility
WIAD2012 A2 - Letting go of perfection: Developing IA agility
 
Aras PLM Viewing Markup and Secure Social
Aras PLM Viewing Markup and Secure SocialAras PLM Viewing Markup and Secure Social
Aras PLM Viewing Markup and Secure Social
 
Domain Specific Language Design
Domain Specific Language DesignDomain Specific Language Design
Domain Specific Language Design
 
Mind Click Services
Mind Click ServicesMind Click Services
Mind Click Services
 
TERMINALFOUR t44u 2009 - University of St Andrews Case Study
TERMINALFOUR t44u 2009 - University of St Andrews Case StudyTERMINALFOUR t44u 2009 - University of St Andrews Case Study
TERMINALFOUR t44u 2009 - University of St Andrews Case Study
 
Aras PLM Software Visualization
Aras PLM Software VisualizationAras PLM Software Visualization
Aras PLM Software Visualization
 
Presenter manual web designing (specially for summer interns)
Presenter manual web designing (specially for summer interns)Presenter manual web designing (specially for summer interns)
Presenter manual web designing (specially for summer interns)
 
HTML5 and Timed Media Playback
HTML5 and Timed Media PlaybackHTML5 and Timed Media Playback
HTML5 and Timed Media Playback
 
Web Designing Syllabus
Web Designing SyllabusWeb Designing Syllabus
Web Designing Syllabus
 
Visual Experience 360 Flex
Visual Experience 360 FlexVisual Experience 360 Flex
Visual Experience 360 Flex
 
MIX11アップデート ~Windows Phone 7, Silverlight 5, IE9, HTML5~ 前編
MIX11アップデート ~Windows Phone 7, Silverlight 5, IE9, HTML5~ 前編MIX11アップデート ~Windows Phone 7, Silverlight 5, IE9, HTML5~ 前編
MIX11アップデート ~Windows Phone 7, Silverlight 5, IE9, HTML5~ 前編
 
Converging Textual and Graphical Editors
Converging Textual  and Graphical EditorsConverging Textual  and Graphical Editors
Converging Textual and Graphical Editors
 
DSL Construction rith Ruby
DSL Construction rith RubyDSL Construction rith Ruby
DSL Construction rith Ruby
 
Vb
VbVb
Vb
 

Plus 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
 
Graphical Views For Xtext With FXDiagram
Graphical Views For Xtext With FXDiagramGraphical Views For Xtext With FXDiagram
Graphical Views For Xtext With FXDiagramDr. Jan Köhnlein
 
Diagram Editors - The FXed Generation
Diagram Editors - The FXed GenerationDiagram Editors - The FXed Generation
Diagram Editors - The FXed GenerationDr. Jan Köhnlein
 
Eclipse Diagram Editors - An Endangered Species
Eclipse Diagram Editors - An Endangered SpeciesEclipse Diagram Editors - An Endangered Species
Eclipse Diagram Editors - An Endangered SpeciesDr. 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
 

Plus de Dr. Jan Köhnlein (20)

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
 
Graphical Views For Xtext With FXDiagram
Graphical Views For Xtext With FXDiagramGraphical Views For Xtext With FXDiagram
Graphical Views For Xtext With FXDiagram
 
XRobots
XRobotsXRobots
XRobots
 
Diagrams, Xtext and UX
Diagrams, Xtext and UXDiagrams, Xtext and UX
Diagrams, Xtext and UX
 
Xtext, diagrams and ux
Xtext, diagrams and uxXtext, diagrams and ux
Xtext, diagrams and ux
 
Diagram Editors - The FXed Generation
Diagram Editors - The FXed GenerationDiagram Editors - The FXed Generation
Diagram Editors - The FXed Generation
 
Code Generation With Xtend
Code Generation With XtendCode Generation With Xtend
Code Generation With Xtend
 
The Xtext Grammar Language
The Xtext Grammar LanguageThe Xtext Grammar Language
The Xtext Grammar Language
 
Eclipse Diagram Editors - An Endangered Species
Eclipse Diagram Editors - An Endangered SpeciesEclipse Diagram Editors - An Endangered Species
Eclipse Diagram Editors - An Endangered Species
 
DSLs for Java Developers
DSLs for Java DevelopersDSLs for Java Developers
DSLs for Java Developers
 
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
 

Dernier

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 

Dernier (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 

Pragmatic DSL Design with Xtext 2.0, Xbase and Xtend

  • 1. Pragmatic DSL Design with Sven Efftinge (itemis) / Sebastian Zarnekow (itemis) / Jan Köhnlein (itemis)
  • 2. The plan for today :
  • 3. The plan for today : 1. Xtext 2.0 What is Xtext and what’s new in 2.0? Hands-On : Develop a DSL.
  • 4. The plan for today : 1. Xtext 2.0 What is Xtext and what’s new in 2.0? Hands-On : Develop a DSL. 2. Xbase What’s that and why should I care? Hands-On : Play with it and integrate it in a DSL.
  • 5. The plan for today : 1. Xtext 2.0 What is Xtext and what’s new in 2.0? Hands-On : Develop a DSL. 2. Xbase What’s that and why should I care? Hands-On : Play with it and integrate it in a DSL. 3. Xtend Yet another language? Are you serious? Hands-On :Write a codegenerator with Xtend.
  • 12.
  • 13.
  • 14.
  • 15. Eclipse IDE Framework (JFace Text, etc.)
  • 16. Java Development Tools (JDT) Eclipse IDE Framework (JFace Text, etc.)
  • 17. Java Development Tools (JDT) Eclipse IDE Framework (JFace Text, etc.)
  • 18. Java Development Tools (JDT) Eclipse IDE Framework (JFace Text, etc.) Eclipse Modeling Framework (EMF)
  • 19. Java Development Tools (JDT) Antlr Parser Generator Eclipse IDE Framework (JFace Text, etc.) Eclipse Modeling Framework (EMF)
  • 21. Advanced Language-Specific Editing Features by Default
  • 22. Advanced Language-Specific Editing Features by Default Syntax Coloring
  • 23. Advanced Language-Specific Editing Features by Default Syntax Coloring Wizards
  • 24. Advanced Language-Specific Editing Features by Default Content Assist Syntax Coloring Wizards
  • 25. Advanced Language-Specific Editing Features by Default Content Assist Syntax Coloring Code Folding Wizards
  • 26. Advanced Language-Specific Editing Features by Default Content Assist Find References Syntax Coloring Code Folding Wizards
  • 27. Advanced Language-Specific Editing Features by Default Global Indexing Content Assist Find References Syntax Coloring Code Folding Wizards
  • 28. Advanced Language-Specific Editing Features by Default Go To Declaration Global Indexing Content Assist Find References Syntax Coloring Code Folding Wizards
  • 29. Advanced Language-Specific Editing Features by Default Go To Declaration Global Indexing Content Assist Find References Syntax Coloring Code Folding Wizards Bracket Matching
  • 30. Advanced Language-Specific Editing Features by Default Go To Declaration Global Indexing Content Assist Find References Syntax Coloring Auto Editing Code Folding Wizards Bracket Matching
  • 31. Advanced Language-Specific Editing Features by Default Go To Declaration Global Indexing Content Assist Find References Syntax Coloring Incremental Builders Auto Editing Code Folding Wizards Bracket Matching
  • 32. Advanced Language-Specific Editing Features by Default Go To Declaration Global Indexing Content Assist Outline View Find References Syntax Coloring Incremental Builders Auto Editing Code Folding Wizards Bracket Matching
  • 33. Advanced Language-Specific Editing Features by Default Go To Declaration Global Indexing Content Assist Outline View Find References Incremental Builders Validation Syntax Coloring Auto Editing Code Folding Wizards Bracket Matching
  • 34. Advanced Language-Specific Editing Features by Default Go To Declaration Template Proposals Global Indexing Content Assist Outline View Find References Incremental Builders Validation Syntax Coloring Auto Editing Code Folding Wizards Bracket Matching
  • 35. Advanced Language-Specific Editing Features by Default Go To Declaration Template Proposals Global Indexing Content Assist Outline View Quick Fixes Find References Incremental Builders Validation Syntax Coloring Auto Editing Code Folding Wizards Bracket Matching
  • 36. Advanced Language-Specific Editing Features by Default Refactoring Go To Declaration Template Proposals Global Indexing Content Assist Outline View Quick Fixes Find References Incremental Builders Validation Syntax Coloring Auto Editing Code Folding Wizards Bracket Matching
  • 37. Advanced Language-Specific Editing Features by Default Refactoring Go To Declaration Template Proposals Global Indexing Content Assist Outline View Quick Fixes Find References Incremental Builders Validation Syntax Coloring Rich Hovers Auto Editing Code Folding Wizards Bracket Matching
  • 38. ... but there is a problem with external DSLs
  • 40.
  • 42.
  • 44. Protected Regions • generated and manually written code mixed up
  • 45. Protected Regions • generated and manually written code mixed up • manual deletion of artifacts
  • 46. Protected Regions • generated and manually written code mixed up • manual deletion of artifacts • platform dependent information
  • 47. Protected Regions • generated and manually written code mixed up • manual deletion of artifacts • platform dependent information • information is spreaded!
  • 49. Generation Gap Pattern technically required type hierarchies
  • 50. Generation Gap Pattern technically required type hierarchies additional complexity
  • 51. Generation Gap Pattern technically required type hierarchies additional complexity platform dependent information
  • 52. Generation Gap Pattern technically required type hierarchies additional complexity platform dependent information information spreaded!
  • 54. Black box target language literals • bound to target platform
  • 55. Black box target language literals • bound to target platform • no option for MDA friends
  • 56. Black box target language literals • bound to target platform • no option for MDA friends • no tooling!
  • 57. Black box target language literals • bound to target platform • no option for MDA friends • no tooling! • long turnarounds!
  • 58. base
  • 63. Your Language o.e.xtext.common.Terminals EMF
  • 64. Your Language common.Types o.e.xtext.common.Terminals JDT JVM EMF
  • 65. Your Language Xbase Ecore Xbase Grammar common.Types o.e.xtext.common.Terminals JDT JVM EMF
  • 66. @Override protected IScope createLocalVarScope(~) { if (context instanceof Operation) { IScope actualScope = super.createLocalVarScope(~); Operation operation = (Operation) context; return createScope(operation.getParams(), actualScope); } return super.createLocalVarScope(~); }
  • 69. Using Xbase Mixin the Grammar JVM Model Inference
  • 70. Using Xbase Mixin the Grammar JVM Model Inference Scoping
  • 71. Using Xbase Mixin the Grammar JVM Model Inference Scoping Type System
  • 72. Using Xbase Mixin the Grammar JVM Model Inference Scoping Type System Compiler / Interpreter
  • 73. A DSL for Generating Code
  • 74. Model Code Code Generator
  • 75. Model Code package base; public class Address { private String street; public String getStreet() { return street; } public void setStreet(String street) { this.street = street; } private String city; Code public String getCity() { return city; Generator } public void setCity(String city) { this.city = city; } private String state; public String getState() { return state; } public void setState(String state) { this.state = state; } private String postalCode; public String getPostalCode() { return postalCode; } public void setPostalCode(String postalCode) { this.postalCode = postalCode; } }
  • 76. BUT I CAN DO THAT IN
  • 77.
  • 78. package example.codegen; import org.eclipse.xtext.common.types.JvmFormalParameter; import org.eclipse.xtext.common.types.JvmTypeReference; import org.eclipse.xtext.example.domainmodel.domainmodel.Entity; import org.eclipse.xtext.example.domainmodel.domainmodel.Feature; import org.eclipse.xtext.example.domainmodel.domainmodel.Operation; import org.eclipse.xtext.example.domainmodel.domainmodel.Property; public class JavaGenerator { public String compile(Entity e) { StringBuilder b = new StringBuilder(); b.append("package " + packageName(e) + "n"); b.append("n"); b.append("/**n"); b.append(" * Automatically generated. Direct modification is futile.n"); b.append(" */n"); b.append("public class ").append(e.getName()); if(e.getSuperType() != null) { b.append(" extends ").append(compile(e.getSuperType())); } b.append(" {n"); for(Feature f: e.getFeatures()) { if(f instanceof Property) feature((Property)f); else if(f instanceof Operation) feature((Operation)f); } b.append("}n"); return b.toString();
  • 79. package example.codegen; import org.eclipse.xtext.common.types.JvmFormalParameter; import org.eclipse.xtext.common.types.JvmTypeReference; import org.eclipse.xtext.example.domainmodel.domainmodel.Entity; import org.eclipse.xtext.example.domainmodel.domainmodel.Feature; import org.eclipse.xtext.example.domainmodel.domainmodel.Operation; import org.eclipse.xtext.example.domainmodel.domainmodel.Property; public class JavaGenerator { No Multiline public String compile(Entity e) { StringBuilder b = new StringBuilder(); String Literals b.append("package " + packageName(e) + "n"); b.append("n"); b.append("/**n"); b.append(" * Automatically generated. Direct modification is futile.n"); b.append(" */n"); b.append("public class ").append(e.getName()); if(e.getSuperType() != null) { b.append(" extends ").append(compile(e.getSuperType())); } b.append(" {n"); for(Feature f: e.getFeatures()) { if(f instanceof Property) feature((Property)f); else if(f instanceof Operation) feature((Operation)f); } b.append("}n"); return b.toString();
  • 80. public String compile(Entity e) { StringBuilder b = new StringBuilder(); b.append("package " + packageName(e) + "n"); b.append("n"); b.append("/**n"); b.append(" * Automatically generated. Direct modification is futile.n"); b.append(" */n"); b.append("public class ").append(e.getName()); if(e.getSuperType() != null) { b.append(" extends ").append(compile(e.getSuperType())); } b.append(" {n"); for(Feature f: e.getFeatures()) { if(f instanceof Property) feature((Property)f); Instanceof else if(f instanceof Operation) feature((Operation)f); Cascades } b.append("}n"); return b.toString(); } public String feature(Property property) { StringBuilder b = new StringBuilder(); String type = compile(property.getType()); String name = property.getName(); b.append("// property ").append(name).append("n"); b.append("private ").append(type).append(" ").append(name).append("n"); b.append("n"); b.append("public ").append(type).append("get").append(name).append("() {n"); b.append(" return ").append(name).append(";n");
  • 81. } b.append("}n"); return b.toString(); } public String feature(Property property) { StringBuilder b = new StringBuilder(); String type = compile(property.getType()); String name = property.getName(); b.append("// property ").append(name).append("n"); b.append("private ").append(type).append(" ").append(name).append("n"); b.append("n"); b.append("public ").append(type).append("get").append(name).append("() {n"); b.append(" return ").append(name).append(";n"); b.append("}n"); b.append("n"); b.append("public ").append("set").append(name) .append("(").append(type).append(" ").append(name).append("){n"); b.append(" this.").append(name).append(" = ").append(name).append(";n"); b.append("}n"); b.append("n"); return b.toString(); } Noisy String public String feature(Operation operation) { StringBuilder b = new StringBuilder(); Concatenation String name = operation.getName(); b.append("// operation ").append(name).append("n"); b.append(compile(operation.getType())).append(" ").append(name).append("("); boolean isFirst = true; for(JvmFormalParameter p: operation.getParams()) {
  • 82.
  • 83.
  • 84.
  • 86. Statically Xbase Typed Expressions

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n
  87. \n
  88. \n
  89. \n
  90. \n
  91. \n
  92. \n
  93. \n
  94. \n
  95. \n
  96. \n
  97. \n
  98. \n
  99. \n
  100. \n
  101. \n
  102. \n
  103. \n
  104. \n
  105. \n
  106. \n
  107. \n
  108. \n
  109. \n
  110. \n
  111. \n
  112. \n
  113. \n