GMF and Xtext integration
This is proposal page for my GSoC idea to integrate Xtext and GMF
Xtext and GMF editor integration to support models with partially textual and partially graphical syntax
Aim of this project is to conduct research on how to integrate Xtext editors and GMF editors. Such integration would allow do define DSL that has both graphical and textual parts in its syntax. DSL that use mixed syntax already exists in some scope, e.g. UML use OCL for defining constraints. Many UML tools allow for editing class attributes in textual way, e.g. user can write "+books : Book [0..*]" and don't have to set visibility, bounds and type by using property editor. As output this project should show how to develop such integration and provide contribution or at least suggestion of changes to GMF and Xtext to ease such integration.
Project would be mostly based on research and proof-of-concept development. It aim to deliver:
Integration for implementing mixed GMF/XText editors that allow for
- Editing same model but describe different parts of metamodel (like editing attributes in UML tools)
- Editing different metamodels but one is linked with another (like OCL in UML)
Integration of Xtext dsl editor in GMF editor that
- Can be used as editor in property page (OCL like) - GMF need to be aware of it
- Can be used as embedded editor for diagram elements - e.g. when we try to edit name of element like in typical UML tool - GMF need to be aware of it
- Can be used as editor for selected diagram / model elements (TEF like, link below) - it could be a hover editor and integration would be working with all EMF enabled editors, e.g. tree editor, gmf editor.
There is a project that does such integration but with its own editor generator http://www2.informatik.hu-berlin.de/sam/meta-tools/tef/tool.html
This project seems hard and risky, but it can also bring great value IMHO.
In TEF like use case, it would be good to have grammar that cover whole metamodel. It is hard and time consuming to define it, but we can scaffold grammar from metamodel and refine interesting parts. There are some approaches to "universal" grammars like HUTN which is implemented in Epsilon
There are other textual representation for UML models (and meta models). Check http://cruise.site.uottawa.ca/umple/ HUNT, an OMG effort to create a standard textual notation for UML models, has been inactive for few years now.
We could generate HUTN-like Xtext grammar for given metamodel. This lead to kick start development of grammars for existing models.