Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Using an Xtext editor for maninpulating an Ecore model
Using an Xtext editor for maninpulating an Ecore model [message #803278] Tue, 21 February 2012 05:52 Go to next message
Hugo A. Garcia is currently offline Hugo A. GarciaFriend
Messages: 258
Registered: July 2009
Senior Member
Hi

We have a GMF editor for creating a structural representation of a
component based application. The Ecore model is used for various M2M/M2T
code generation steps. Now we would like to have a scripting language
for deployment of the components.

Is it possible to create an XText DSL that can load/use/modify our Ecore
model. For example, and this is overly simplified:

//We load a component model in the Xtext based edtior
myComponentApp = load model("myapp.model");

waitUntil(initAllComponents());

//We would like code completion here:
myComponentApp.componentA.start();

waitUntil(myComponentApp.componentB.start());

//This file will be saved and later parsed by our
//deployment application which is in C++

-H
Re: Using an Xtext editor for maninpulating an Ecore model [message #803437 is a reply to message #803278] Tue, 21 February 2012 10:51 Go to previous messageGo to next message
Gerald Preissler is currently offline Gerald PreisslerFriend
Messages: 1
Registered: February 2012
Junior Member
Ed Mercks has started XCore, an XText-based DSL for ECore models. I can't post links right now, but the tutorial is at wiki.eclipse.org/Xcore - maybe this is what you're looking for?

Regards
Jerry
Re: Using an Xtext editor for maninpulating an Ecore model [message #803529 is a reply to message #803437] Tue, 21 February 2012 13:03 Go to previous messageGo to next message
Hugo A. Garcia is currently offline Hugo A. GarciaFriend
Messages: 258
Registered: July 2009
Senior Member
On 02/21/2012 11:51 AM, Gerald Preissler wrote:
> Ed Mercks has started XCore, an XText-based DSL for ECore models. I
> can't post links right now, but the tutorial is at
> wiki.eclipse.org/Xcore - maybe this is what you're looking for?
>
> Regards
> Jerry

Not sure... since we would like to develop a specific DSL that defines
how to interact with a predefined Ecore model.

Here is another example and work flow:

* Create a model of a graph (just Vertices and Edges) and persist it
using Ecore. (Maybe use XCore??)
* Create a script to interact with the model. (Using a Xtext edtior??).
[The script (DSL) knows about the model and is meant to use the model
but not necessarily modify it.]
Example would instructions on how to navigate the graph.
* Save the script.
* Run the script using some other program. This program loads the model
and the script and executes the scripts based on the model.

We are still new to Xtext and are not sure if we can achieve the above
as our basic use case.

-H
Re: Using an Xtext editor for maninpulating an Ecore model [message #804290 is a reply to message #803529] Wed, 22 February 2012 12:36 Go to previous message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
Sounds like you're looking for an executable language referring to your
models.

Short answer: Yes you can build such a language with Xtext, because it
allows to refer to other EMF based models.
- You may want to import your language's ecore in the Xtext grammar and
make cross-references to model elements.
- You might to have to adapt the scoping of your language to access the
right elements using specific names.
- You will have to build an interpreter or compiler to execute your
language on a given input model.
- You may want to use Xbase to evaluate expressions involving your model
elements. There's a generator and an interpreter for Xbase, so this will
also help you in the actual execution.

I suggest looking at the example and reading the Xtext docs a bit, as
your question is pretty vague.


Am 21.02.12 14:03, schrieb Hugo Garcia:
> On 02/21/2012 11:51 AM, Gerald Preissler wrote:
>> Ed Mercks has started XCore, an XText-based DSL for ECore models. I
>> can't post links right now, but the tutorial is at
>> wiki.eclipse.org/Xcore - maybe this is what you're looking for?
>>
>> Regards
>> Jerry
>
> Not sure... since we would like to develop a specific DSL that defines
> how to interact with a predefined Ecore model.
>
> Here is another example and work flow:
>
> * Create a model of a graph (just Vertices and Edges) and persist it
> using Ecore. (Maybe use XCore??)
> * Create a script to interact with the model. (Using a Xtext edtior??).
> [The script (DSL) knows about the model and is meant to use the model
> but not necessarily modify it.]
> Example would instructions on how to navigate the graph.
> * Save the script.
> * Run the script using some other program. This program loads the model
> and the script and executes the scripts based on the model.
>
> We are still new to Xtext and are not sure if we can achieve the above
> as our basic use case.
>
> -H
>
>


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


---
Get professional support from the Xtext committers at www.typefox.io
Previous Topic:Xtend -> Java transformation bug? (scoping of type names)
Next Topic:Editor -> Compiler
Goto Forum:
  


Current Time: Thu Apr 18 13:20:19 GMT 2024

Powered by FUDForum. Page generated in 0.01522 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top