Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Domain Specific Languages
in Eclipse with Xtext
redefine.digital.design: Helping you deal with complexity in VHDL and Veri...
About
CTO at Sigasi @heeckhau
Sigasi Studio: Eclipse based IDE for
VHDL and Verilog (digital hardware design)
• Domain Specific Languages (DSL)
• Xtext
• Demo
Overview
Domain specific language
“A domain-specific language (DSL) is
a computer language
specialized to a particular application ...
Cold beer
● Optimize energy efficiency
● Lots of variants (size, components)
● Cooling algorithms
○ Straight forward
○ Exc...
Refrigerator control
Refrigerator description
Cooling algorithm
Code Generation
C-code
Documentation
Domain specific
simul...
Why DSLs
DSLs allow to express solutions at the
abstraction level of the problem domain.
⇒ Domain experts can understand, ...
How ?
Language definition (BNF)
Lexer and Parser
Abstract Syntax Tree
Linking, scoping, types
Validation
Code generator, i...
DSL Development Framework
Full DSL infrastructure (parser, linker, …)
Define DSL with a grammar language
⇩
+ Rich editing ...
Rich editing
●Syntax coloring
●Type time validation
●Content assist (autocomplete)
●Code formatting
●Find references
●Rena...
How
Language definition (BNF)
Lexer and Parser
Abstract Syntax Tree
Linking, scoping, types
Validation
Code generator, int...
To good to be true?
●Xtext contains default implementations for linking,
validation, …
●Can be fully customized
●Wired tog...
Demo
Small DSL to model entities and properties
1. datatype String
2.
3. entity Blog {
4. title: String
5. many posts: Pos...
Demo
1. datatype String
2.
3. entity Blog {
4. title: String
5. many posts: Post
6. }
7.
8. entity HasAuthor {
9. author: ...
Demo
1. datatype String
2.
3. entity Blog {
4. title: String
5. many posts: Post
6. }
7.
8. entity HasAuthor {
9. author: ...
Live Demo
Why Xtext
Very mature and complete system
Statically typed AST model
Open Source
Outro
DSLs?
●Very powerful
●Lots of work
Xtext
●Recommended DSL development framework
Sigasi is hiring: www.sigasi.com/car...
Hands on
Download Eclipse IDE for Java and DSL Developers
https://www.eclipse.org/downloads/
Start 15 Minutes tutorial fro...
Upcoming SlideShare
Loading in …5
×

Domain specific languages in eclipse with Xtext (Zeus, UGent)

222 views

Published on

DSL introduction and Xtext demo for the Zeus group at Gent University.

Published in: Technology
  • Be the first to comment

Domain specific languages in eclipse with Xtext (Zeus, UGent)

  1. 1. Domain Specific Languages in Eclipse with Xtext redefine.digital.design: Helping you deal with complexity in VHDL and Verilog. Dr. Ir. Hendrik Eeckhaut
  2. 2. About CTO at Sigasi @heeckhau Sigasi Studio: Eclipse based IDE for VHDL and Verilog (digital hardware design)
  3. 3. • Domain Specific Languages (DSL) • Xtext • Demo Overview
  4. 4. Domain specific language “A domain-specific language (DSL) is a computer language specialized to a particular application domain” Examples: ●Regular expressions: ^com.sigasi.*$ ●SQL: SELECT * FROM table_name https://en.wikipedia.org/wiki/Domain-specific_language
  5. 5. Cold beer ● Optimize energy efficiency ● Lots of variants (size, components) ● Cooling algorithms ○ Straight forward ○ Exceptions and interactions ○ Different for variants
  6. 6. Refrigerator control Refrigerator description Cooling algorithm Code Generation C-code Documentation Domain specific simulator http://www.voelter.de/data/presentations/RefrigeratorsAndDSLs.pdf ● Understand ? ● Validate ? ● Modify ?
  7. 7. Why DSLs DSLs allow to express solutions at the abstraction level of the problem domain. ⇒ Domain experts can understand, validate, modify and develop DSL programs
  8. 8. How ? Language definition (BNF) Lexer and Parser Abstract Syntax Tree Linking, scoping, types Validation Code generator, interpreter
  9. 9. DSL Development Framework Full DSL infrastructure (parser, linker, …) Define DSL with a grammar language ⇩ + Rich editing support for Eclipse, IntelliJ IDEA and web browser
  10. 10. Rich editing ●Syntax coloring ●Type time validation ●Content assist (autocomplete) ●Code formatting ●Find references ●Rename ●Outline
  11. 11. How Language definition (BNF) Lexer and Parser Abstract Syntax Tree Linking, scoping, types Validation Code generator, interpreter → Xtext grammar → ANTLR → Eclipse EMF (partially generated) Java
  12. 12. To good to be true? ●Xtext contains default implementations for linking, validation, … ●Can be fully customized ●Wired together with Dependency Injection (Google Guice)
  13. 13. Demo Small DSL to model entities and properties 1. datatype String 2. 3. entity Blog { 4. title: String 5. many posts: Post 6. } 7. 8. entity HasAuthor { 9. author: String 10. } 11. 12. entity Post extends HasAuthor { 13. title: String 14. content: String 15. many comments: Comment 16. } 17. 18. entity Comment extends HasAuthor { 19. content: String 20. }
  14. 14. Demo 1. datatype String 2. 3. entity Blog { 4. title: String 5. many posts: Post 6. } 7. 8. entity HasAuthor { 9. author: String 10. } 11. 12. entity Post extends HasAuthor { 13. title: String 14. content: String 15. many comments: Comment 16. } 17. 18. entity Comment extends HasAuthor { 19. content: String 20. } elements : Type (datatype or entity) features : Feature Domainmodel
  15. 15. Demo 1. datatype String 2. 3. entity Blog { 4. title: String 5. many posts: Post 6. } 7. 8. entity HasAuthor { 9. author: String 10. } 11. 12. entity Post extends HasAuthor { 13. title: String 14. content: String 15. many comments: Comment 16. } 17. 18. entity Comment extends HasAuthor { 19. content: String 20. }
  16. 16. Live Demo
  17. 17. Why Xtext Very mature and complete system Statically typed AST model Open Source
  18. 18. Outro DSLs? ●Very powerful ●Lots of work Xtext ●Recommended DSL development framework Sigasi is hiring: www.sigasi.com/careers
  19. 19. Hands on Download Eclipse IDE for Java and DSL Developers https://www.eclipse.org/downloads/ Start 15 Minutes tutorial from https://eclipse.org/Xtext/documentation/102_domainmodelwalkthrough.html

×