Robust Real-Time Synchronizationbetween Textual and Graphical EditorsOskar van RestGuido WachsmuthJim SteelJörn Guy SüßEel...
2 / 25Entity Language
3 / 25Behavior TreesModeling in terms of requirements and behavior
4 / 25SPARQLQuery RDF data textually or graphically
5 / 25Architecture
6 / 25Grammar-to-metamodellexical syntax[a-zA-Z][a-zA-Z0-9]* -> IDcontext-free syntax"module" ID Type* -> Start {"Module"}...
7 / 25Tree-to-model & Model-to-treeModule("Library", [ Entity("Book", [ Attribute("title", "String"), Reference("author", ...
8 / 25Runtime Architecturesynchronizetree-to-modeldiff calc. + mergediff calc. + mergemodel-to-treeparse
9 / 25Runtime Architecturereal-time= small changes = precise diff calc. = precise layout preservationtree-to-modeldiff cal...
10 / 25Graphical Layout Preservation (1)Conventional approach:●Replace entire model with new one●Re-link layout based on n...
11 / 25diff calc. + mergeGraphical Layout Preservation (2)New approach:Change rather than replace modelUpdate graph. repre...
12 / 25diff calc. + mergeTextual Layout Preservation (1)Compare ASTs and merge changes into text:●Preserve unchanged eleme...
13 / 25Textual Layout Preservation (2)Pretty-printers are generated from SDF3 definition:
14 / 25Textual Layout Preservation (3)Use origin information to:●Merge text (use origin position)●Improve diff calc. (try ...
15 / 25Error RecoveryApply recovery rules:●Recovery rules generated from the grammar●Malformed text → well-formed ASTParse...
16 / 25Error RecoveryTreat unrecoverable text regions as layout:●Layout preserved during graphical editing●Graphical layou...
17 / 25Error RecoveryLeave unresolved references out of model:●Violations of lower bound constraints allowed●Elements stil...
18 / 25Error RecoveryIntroduce defaults to avoid syntax errors:●Defaults can be user-defined●Defaults may result in temp. ...
19 / 25Editor ServicesUndo-Redo:●Maintain single (shared)operation historySelection sharing:Persistence:●Persist text and ...
20 / 25Structural heterogeneity (1)Generated metamodels not always suitable forparticular graphical syntax:context-free sy...
21 / 25Problem*:[textual syntax] ≈ [grammar] = [metamodel] ≈ [graphical syntax]Structural heterogeneity (2)*[x] = structur...
22 / 25Structural heterogeneity (3)Solution*:[textual syntax] ≈ [grammar] ≠ [metamodel] ≈ [graphical syntax]*[x] = structu...
23 / 25Future Work (1)Multi-file supportn files 1 view
24 / 25Future Work (2)Synchronization between textual editors
25 / 25The Spoofax Language Workbench – www.spoofax.orgRobust Real-Time Synchronizationbetween Textual and Graphical Editors
Upcoming SlideShare
Loading in …5
×

Robust Real-Time Synchronization between Textual and Graphical Editors

401 views

Published on

Slides for ICMT 2013 - Budapest, Hungary

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
401
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Robust Real-Time Synchronization between Textual and Graphical Editors

  1. 1. Robust Real-Time Synchronizationbetween Textual and Graphical EditorsOskar van RestGuido WachsmuthJim SteelJörn Guy SüßEelco Visser
  2. 2. 2 / 25Entity Language
  3. 3. 3 / 25Behavior TreesModeling in terms of requirements and behavior
  4. 4. 4 / 25SPARQLQuery RDF data textually or graphically
  5. 5. 5 / 25Architecture
  6. 6. 6 / 25Grammar-to-metamodellexical syntax[a-zA-Z][a-zA-Z0-9]* -> IDcontext-free syntax"module" ID Type* -> Start {"Module"}"entity" ID "{" Property* "}" -> Type {"Entity"}"datatype" ID -> Type {"DataType"}"attr" ID ":" ID -> Property {"Attribute"}"ref" ID ":" ID -> Property {"Reference"}namespacesModuleEntityDataTypePropertybinding rulesModule(n, _):defines Module nscopes Entity, DataTypeAttribute(n, t):defines Property nrefers to DataType t...
  7. 7. 7 / 25Tree-to-model & Model-to-treeModule("Library", [ Entity("Book", [ Attribute("title", "String"), Reference("author", "Author")]), Entity("Author", []), DataType("String")])
  8. 8. 8 / 25Runtime Architecturesynchronizetree-to-modeldiff calc. + mergediff calc. + mergemodel-to-treeparse
  9. 9. 9 / 25Runtime Architecturereal-time= small changes = precise diff calc. = precise layout preservationtree-to-modeldiff calc. + mergediff calc. + mergemodel-to-treeparsesynchronize
  10. 10. 10 / 25Graphical Layout Preservation (1)Conventional approach:●Replace entire model with new one●Re-link layout based on names/indices●Fails when names/indices changeentity Book2 {attr title : Stringref author : Author}entity Author {}entity Book {attr title : Stringref author : Author}entity Author {}sync.changesync.
  11. 11. 11 / 25diff calc. + mergeGraphical Layout Preservation (2)New approach:Change rather than replace modelUpdate graph. represent. accordingly34synchronize
  12. 12. 12 / 25diff calc. + mergeTextual Layout Preservation (1)Compare ASTs and merge changes into text:●Preserve unchanged elements●Pretty-print new elements●Pretty-print changed elements, but reassign layout
  13. 13. 13 / 25Textual Layout Preservation (2)Pretty-printers are generated from SDF3 definition:
  14. 14. 14 / 25Textual Layout Preservation (3)Use origin information to:●Merge text (use origin position)●Improve diff calc. (try match origin term, otherwise use heuristics)origin positionorigin termorigin termdiff calc. + merge
  15. 15. 15 / 25Error RecoveryApply recovery rules:●Recovery rules generated from the grammar●Malformed text → well-formed ASTParse errors (1)
  16. 16. 16 / 25Error RecoveryTreat unrecoverable text regions as layout:●Layout preserved during graphical editing●Graphical layout (currently) lostParse errors (2)
  17. 17. 17 / 25Error RecoveryLeave unresolved references out of model:●Violations of lower bound constraints allowed●Elements still visualized when possibleUnresolved references
  18. 18. 18 / 25Error RecoveryIntroduce defaults to avoid syntax errors:●Defaults can be user-defined●Defaults may result in temp. unresolved referencesGraphical syntax errors
  19. 19. 19 / 25Editor ServicesUndo-Redo:●Maintain single (shared)operation historySelection sharing:Persistence:●Persist text and graph●Persist text(auto-layout diagram)●Persist AST/model(auto-layout diagram + pretty-print text)
  20. 20. 20 / 25Structural heterogeneity (1)Generated metamodels not always suitable forparticular graphical syntax:context-free syntax"[" integers:{INT ","}* "]" -> Start {"IntSeq"}[5, 2, 6, 3]indefinablemappingtextual syntaxgrammargenerated and non-generated metamodelsgraphical syntax
  21. 21. 21 / 25Problem*:[textual syntax] ≈ [grammar] = [metamodel] ≈ [graphical syntax]Structural heterogeneity (2)*[x] = structure of x
  22. 22. 22 / 25Structural heterogeneity (3)Solution*:[textual syntax] ≈ [grammar] ≠ [metamodel] ≈ [graphical syntax]*[x] = structure of xnewnew
  23. 23. 23 / 25Future Work (1)Multi-file supportn files 1 view
  24. 24. 24 / 25Future Work (2)Synchronization between textual editors
  25. 25. 25 / 25The Spoofax Language Workbench – www.spoofax.orgRobust Real-Time Synchronizationbetween Textual and Graphical Editors

×