Hello Marcin,
yes, you can define such EBNF like languages in Concrete.
For something like
Mult = Expr "*" Expr
you would have to create a class "Mult" which has two containment
features "expr1" and "expr2" which each can take an instance of class
"Expression" (which would be the super class of all expression classes
including "Mult". then in the DOM template, you would not use lables
"expr1" and "expr2" but merely the pure value and thus the position to
distinguish between them.
see ther formula editor for an example:
http://concrete-editor.org/concrete/example/formula_editor/formula_editor.html
One issue with this is that primitive values like numbers (1, 2, ..)
can not be instances of class "Expression" and thus you can not
directly put them where you would put other expression. Instead, there
has to be something like a "PrimitiveExpression" which has an
attribute "value" which then can take values like 1,2,..
This is due to the underlying ecore meta-metamodel. Also see the
formula editor example for this.
Another issue is that it can be cumbersome to create those kinds of
expression with the current editing mechanisms of Concrete.
(Especially with things like the first issue stated above)
Also see my other post on Concrete and Xtext:
http://groups.google.com/group/concrete-editor/browse_thread/thread/c70b8935b4f8f93c
Besides a potential future Xtext to Concrete converter, there could be
a simple converter which takes EBNF expressions and generates both
metamodel in json and the dom templates. So you would be able to
define your Concrete language in EBNF.
For the usability/editing issue, I was also thinking about something
like an interactive parser.
There could be a special edit mode where users can create a set of
model elements at once.
While users would type expressions like "(2 * 4) + x" in Concrete,
Concrete could act like a LL parser and construct the model elements
on the fly.
Of course the grammar would have to fit.
Any thoughts or help on this is very welcome.
Martin