Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Enabling a DSL editor to open concrete model files
Enabling a DSL editor to open concrete model files [message #52492] Tue, 23 June 2009 15:55 Go to next message
Durga Prasana Sahoo is currently offline Durga Prasana SahooFriend
Messages: 20
Registered: July 2009
Junior Member
Hello All


I want to somehow facilate the opening of .xmi files of concrete model in
a DSL Editor.

For Example consider:
sample1.xml
------------
<?xml version="1.0" encoding="UTF-8"?>
<datatypes:PrimitiveDataType xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:datatypes="http://q-impress.eu/samm/datatype"
id="_e94SQF8FEd6mb4izF2cfPA" documentation="" name="pr_01" type="int"/>

------------------------------------------------------------ ---------
I want to be able to open this .xml file in the DSL editor as:

------------------------------------------------------------ ---------
PrimitiveDataType id:"_e94SQF8FEd6mb4izF2cfPA"{
name:"pr_01";
doc:"";
type:1;
}
------------------------------------------------------------ ---------

Is there any way that this can be accomplished?


If my objective is unclear then, pls let me know and I shall elaborate it.


Thanks.


Durga
Re: Enabling a DSL editor to open concrete model files [message #52603 is a reply to message #52492] Wed, 24 June 2009 11:10 Go to previous messageGo to next message
Andy Carpenter is currently offline Andy CarpenterFriend
Messages: 145
Registered: July 2009
Senior Member
Durga,

This is possible, but I don't think that it is simple. The main
issue arises because you have two concrete syntaxes for your
model. You could create an Xtext based DSL that uses your
'editor' syntax. However, this would also persist your model in
the same syntax.

One way to get around this would be to intercept the load
and save methods of the Xtext DSL and copy the contents
of the resource to/from one with an .xmi extension and use the
load and save methods on this resource. Note, this only
works if the two concrete syntaxes do truely share a single
meta-model.

Andy.

"Durga Prasana Sahoo" <durga.spirit@gmail.com> wrote in message
news:2870ff1edb4a9b70640b9edb8d362171$1@www.eclipse.org...
> Hello All
>
>
> I want to somehow facilate the opening of .xmi files of concrete model in
> a DSL Editor.
>
> For Example consider:
> sample1.xml
> ------------
> <?xml version="1.0" encoding="UTF-8"?>
> <datatypes:PrimitiveDataType xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:datatypes="http://q-impress.eu/samm/datatype"
> id="_e94SQF8FEd6mb4izF2cfPA" documentation="" name="pr_01" type="int"/>
>
> ------------------------------------------------------------ ---------
> I want to be able to open this .xml file in the DSL editor as:
>
> ------------------------------------------------------------ ---------
> PrimitiveDataType id:"_e94SQF8FEd6mb4izF2cfPA"{
> name:"pr_01";
> doc:"";
> type:1;
> }
> ------------------------------------------------------------ ---------
>
> Is there any way that this can be accomplished?
>
>
> If my objective is unclear then, pls let me know and I shall elaborate it.
>
>
> Thanks.
>
>
> Durga
>
Re: Enabling a DSL editor to open concrete model files [message #52793 is a reply to message #52492] Thu, 25 June 2009 07:49 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Durga,

I think I understood what you described, however I've no idea about the
usecase. Maybe there are other ways to achieve what you want. Would you
please be so kind an elaborate a bit on it from a more user oriented view?

Andy was right, there would be some work to do, if you want to create
such a projection-based editor for your xmi-file.

Regards,
Sebastian

Am 23.06.2009 17:55 Uhr, schrieb Durga Prasana Sahoo:
> Hello All
>
>
> I want to somehow facilate the opening of .xmi files of concrete model
> in a DSL Editor.
>
> For Example consider:
> sample1.xml
> ------------
> <?xml version="1.0" encoding="UTF-8"?>
> <datatypes:PrimitiveDataType xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:datatypes="http://q-impress.eu/samm/datatype"
> id="_e94SQF8FEd6mb4izF2cfPA" documentation="" name="pr_01" type="int"/>
>
> ------------------------------------------------------------ ---------
> I want to be able to open this .xml file in the DSL editor as:
>
> ------------------------------------------------------------ ---------
> PrimitiveDataType id:"_e94SQF8FEd6mb4izF2cfPA"{
> name:"pr_01";
> doc:"";
> type:1;
> }
> ------------------------------------------------------------ ---------
>
> Is there any way that this can be accomplished?
>
>
> If my objective is unclear then, pls let me know and I shall elaborate it.
>
>
> Thanks.
>
>
> Durga
>
Previous Topic:Visiting a Tree of a Model
Next Topic:Documentation question
Goto Forum:
  


Current Time: Sat Dec 21 14:33:06 GMT 2024

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

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

Back to the top