|
Re: Entry & Validation of Text in a GMF Runtime [message #1115651 is a reply to message #1115150] |
Tue, 24 September 2013 11:42 |
|
Hi Greg,
What you're describing is a DSL that has a hybrid graphical/textual syntax. EVL - or more likely EOL - could be embedded as an expression language in your DSL but then any expressions/constraints would have to conform to EOL's syntax (e.g. 200hp wouldn't work).
Another alternative is to use a mixture of GMF/Xtext to specify the different concrete syntaxes and glue them together. A working example of doing this for an executable state machine DSL is available in the org.eclipse.epsilon.eugenia.examples.executablestatemachine.* projects under [1]. If you opt for this approach you'll need to implement the execution semantics of your textual constraint language from scratch. Xtend [2] may provide some reusable execution components but I know just enough about it to be dangerous.
Cheers,
Dimitris
[1] https://dev.eclipse.org/svnroot/modeling/org.eclipse.epsilon/trunk/examples/
[2] http://www.eclipse.org/Xtext/documentation.html#JvmDomainmodel
|
|
|
|
|
|
Re: Entry & Validation of Text in a GMF Runtime [message #1125332 is a reply to message #1117898] |
Fri, 04 October 2013 11:58 |
Louis Rose Messages: 440 Registered: July 2009 Location: York, United Kingdom |
Senior Member |
|
|
Hi Greg,
Are you perhaps using Kepler (Eclipse 4.3)? If so, I think that you'll need to use a slightly newer version of the example, which I've just committed to our SVN repository [1]. If you're using Eclipse Juno (4.2), the version you already have should work. If not, you could try regenerating the GMF code for the precise version of GMF that you have installed, by selecting the esm.emf file, right-clicking and then selecting Eugenia > Generate GMF editor.
Also, for this example to work, do be sure that you edit the transition's text by double-clicking on the labels in the canvas, rather than via the property sheet view. This example only binds the Xtext parser to the label editor used on the GMF editor's canvas. The property sheet view is contributed by a plug-in which is generated by EMF rather than Eugenia, so we don't currently have a good way to repeatedly edit the behaviour of the property sheet view.
I've attached a video showing how the example works. First, I change the label on the transition and we see that this change is reflected by the addition of a "Dec" element in the model. This "Dec" object is an instance of a class from the metamodel generated from the Xtext grammar. Then, I show that the label editor won't allow invalid statements such as "foo" to be set as transition labels. Finally, I show that the property sheet editor doesn't perform validation and will allow "foo" to be set as a transition label.
Hope this helps!
Cheers,
Louis.
[1] https://dev.eclipse.org/svnroot/modeling/org.eclipse.epsilon/trunk/examples/
[Updated on: Fri, 04 October 2013 12:02] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03651 seconds