Your SlideShare is downloading. ×
0
The Spoofax
Language Workbench

    Lennart Kats   Eelco Visser
Software Engineering


          implement

Problem                Software
            validate
High-level languages reduce
   problem/solution gap

Problem
                HLL    Machine
Domain
Domain-Specific Languages


Problem
                    DSL                HLL             Machine
Domain




DSLs further ...
Example DSL:
paradigm: linguistic abstraction
making languages should be cheap
Compiler Ingredients
Syntax definition
   ★ concrete syntax
   ★ abstract syntax       parser
Static semantics         gene...
Editor Services
syntactic editor services         semantic editor services

•   syntax highlighting           •   error ma...
Syntax definition
Static semantics
Model-to-model transformation        Language
Code generation                    workben...
Language Workbench:

integrated environment for language definition
Holy Grail of Software Language Definition




  Automatically derive efficient,
scalable, incremental compiler +
 usable ID...
Stratego


SDF              Eclipse


        IMP
Stratego

                    on by
               ni ti
SDF        D efi ion   Eclipse
        ge
      ua form   at
    n...
• <spoofax screenshot: lang def and lang use
  in Eclipse workspace>
SDF:
Declarative
  Syntax
 Definition
A   syntax definition
specifies a transformation
       from text to trees
Syntax as Transformation
Syntax as Transformation
Syntax as Transformation




                     transform
Syntax as Transformation




                     transform
Syntax as Transformation




                     transform
Semantics
      =
transformation
Error Marking is a
 Transformation




                     transform
Error Marking is a
 Transformation




                     transform
Error Marking is a
 Transformation




                     transform
     transform
Error Marking is a
 Transformation




                     transform
     transform
Error Marking is a
 Transformation




                     transform
     transform
Outline View is a
Transformation



      transform
Hyperlinking is a
   Transformation
      m
 sfor
tran
Content Completion is a
   Transformation
             orm
      tsfa rm
       ro nsf
  tran
Code Generation is a
  Transformation



         transform
Need for single, unified language specification:
• Editor services
• Model transformations
• Code generation
Stratego:
Rewriting
Language
Rewrite rules


 Strategies
Error Marking with Rewrite Rules
Error Marking with Rewrite Rules
Error Marking with Rewrite Rules




                                  transform
                Origin tracking


       ...
Analysis with Rewrite Rules
Code Generation with Rewrite Rules
Conclusion

• Co-evolution of language and IDE
• Pure and declarative syntax definition
• Language definition by transformat...
The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)
Upcoming SlideShare
Loading in...5
×

The Spoofax Language Workbench (SPLASH 2010)

4,205

Published on

Spoofax is a language workbench for efficient, agile development of textual domain-specific languages with state-of-the-art IDE support. It provides a comprehensive environment that integrates syntax definition, program transformation, code generation, and declarative specification of IDE components.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
4,205
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
39
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "The Spoofax Language Workbench (SPLASH 2010)"

  1. 1. The Spoofax Language Workbench Lennart Kats Eelco Visser
  2. 2. Software Engineering implement Problem Software validate
  3. 3. High-level languages reduce problem/solution gap Problem HLL Machine Domain
  4. 4. Domain-Specific Languages Problem DSL HLL Machine Domain DSLs further reduce gap between problem domain and implementation
  5. 5. Example DSL:
  6. 6. paradigm: linguistic abstraction
  7. 7. making languages should be cheap
  8. 8. Compiler Ingredients Syntax definition ★ concrete syntax ★ abstract syntax parser Static semantics generators meta- ★ error checking programming ★ name resolution libraries ★ type analysis meta- programming Model-to-model transformation languages ★ express constructs in core language template Code generation engines ★ translate core language models to implementation
  9. 9. Editor Services syntactic editor services semantic editor services • syntax highlighting • error marking • syntax checking • reference resolving • outline view • hover help • bracket matching, insertion • mark occurrences • automatic indentation • content completion • syntax completion • refactoring • ... • ...
  10. 10. Syntax definition Static semantics Model-to-model transformation Language Code generation workbenches Syntactic Editor Services [Fowler ’05] Semantic Editor Services how can we make these things cheaply?
  11. 11. Language Workbench: integrated environment for language definition
  12. 12. Holy Grail of Software Language Definition Automatically derive efficient, scalable, incremental compiler + usable IDE from high-level, declarative language definition
  13. 13. Stratego SDF Eclipse IMP
  14. 14. Stratego on by ni ti SDF D efi ion Eclipse ge ua form at ng ns La ra T IMP
  15. 15. • <spoofax screenshot: lang def and lang use in Eclipse workspace>
  16. 16. SDF: Declarative Syntax Definition
  17. 17. A syntax definition specifies a transformation from text to trees
  18. 18. Syntax as Transformation
  19. 19. Syntax as Transformation
  20. 20. Syntax as Transformation transform
  21. 21. Syntax as Transformation transform
  22. 22. Syntax as Transformation transform
  23. 23. Semantics = transformation
  24. 24. Error Marking is a Transformation transform
  25. 25. Error Marking is a Transformation transform
  26. 26. Error Marking is a Transformation transform transform
  27. 27. Error Marking is a Transformation transform transform
  28. 28. Error Marking is a Transformation transform transform
  29. 29. Outline View is a Transformation transform
  30. 30. Hyperlinking is a Transformation m sfor tran
  31. 31. Content Completion is a Transformation orm tsfa rm ro nsf tran
  32. 32. Code Generation is a Transformation transform
  33. 33. Need for single, unified language specification: • Editor services • Model transformations • Code generation
  34. 34. Stratego: Rewriting Language
  35. 35. Rewrite rules Strategies
  36. 36. Error Marking with Rewrite Rules
  37. 37. Error Marking with Rewrite Rules
  38. 38. Error Marking with Rewrite Rules transform Origin tracking transform
  39. 39. Analysis with Rewrite Rules
  40. 40. Code Generation with Rewrite Rules
  41. 41. Conclusion • Co-evolution of language and IDE • Pure and declarative syntax definition • Language definition by transformation • www.spoofax.org: papers, tour, download
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×