Concrete and Xtext

56 views
Skip to first unread message

mthiede

unread,
Feb 27, 2011, 3:13:15 PM2/27/11
to Concrete Model Editor
Hello,

the topic was just brought up by @acherm on twitter: How can Concrete
and Xtext connect, can they be compatible?

First of all Xtext is a parser based approach which uses a grammar,
whereas Concrete is a projectional approach which does not use a
parser and grammar. However, both tools are based on ECore.

As far as I know, with Xtext, you get an ECore metamodel as a
byproduct of the grammar. This metamodel could be used with Concrete
and this should enable users to build the same models with an instance
of Concrete that can be done with the corresponding instance of Xtext.
However, the look and feel will be a lot different.

I think there are two major issues:
1. (concrete) syntax
2. usability

1. The default concrete syntax of Concrete would probably be different
from the syntax in Xtext defined by the grammar. Concrete syntax in
Concrete is very flexible. So it should be possible, to create a
syntax for the Concrete DSL which resembles the syntax of the Xtext
DSL. Basically I am thinking of taking Xtext grammar rules, extracting
the "syntactic sugar" parts and generating a concrete syntax
definition for Concrete (i.e. HTML snippets).

2. At present the usability in Concrete will be a lot different from
Xtext. In Xtext you can just write text of the DSL fluently, whereas
in Concrete, you need to create model elements more or less explicitly
(e.g. by pressing <enter>). The Concrete approach is ok for editing
models with a focus on describing structure but it is probably not
ideal for editing models which are more like expressions in a
programming language (see the formula editor example on concrete-
editor.org).

I really like to improve this second point. MPS shows how a
projectional model editor can feel much like a text editor. I am
thinking of simple trigger rules associated with language elements
which would end the editing of the current model element, create a new
model element and start editing it. In the simplest case, think of a
language where you can write words where each word is a separate model
element. The rule could be to trigger on whitespace, finish the
current word, create a new one and start editing it.

Especially the second topic is very huge. So any thoughts or help on
this are very welcome!

Martin
Reply all
Reply to author
Forward
0 new messages