Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Text from Ecore
Text from Ecore [message #725926] Fri, 16 September 2011 08:03 Go to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
Hi,

I would like to generate Emfatic text from my Ecore model created programmatically in a standalone application. So my goal is to generate text from ecore in a standalone application.

For example the text should be like

class Library
{
attribute name : String[?];
property books#_'library' : Book[*] { composes };
property loans : Loan[*] { composes };
property members#_'library' : Member[*] { composes };
documentation 'this is just a documentation text';
documentation(sdfwd = 'this is text 2');
}

Please guide me
Re: Text from Ecore [message #725978 is a reply to message #725926] Fri, 16 September 2011 10:13 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
As a "ModelGeek" you should know that you have to write a code generator
to achieve this. You can use any code genertion you want, e.g. Xtend2.
Start reading the docs, there are lots of code generation examples....

Am 16.09.11 10:03, schrieb ModelGeek:
> Hi,
>
> I would like to generate Emfatic text from my Ecore model created
> programmatically in a standalone application. So my goal is to generate
> text from ecore in a standalone application.
>
> For example the text should be like
> class Library
> {
> attribute name : String[?];
> property books#_'library' : Book[*] { composes };
> property loans : Loan[*] { composes };
> property members#_'library' : Member[*] { composes };
> documentation 'this is just a documentation text';
> documentation(sdfwd = 'this is text 2');
> }
>
> Please guide me


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


---
Get professional support from the Xtext committers at www.typefox.io
Re: Text from Ecore [message #726008 is a reply to message #725978] Fri, 16 September 2011 11:57 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
Thank you so much for you help, I know i need to write code generator but i mean in Eclipse there is an editor call OCLinEcore which presents Emfatic text for Ecore model. So this means there is already a code generator with template and workflow that can generate Emfatic text from Ecore model.
So i just want to resuse that existing generator in my standalone application. I want to know how to do that... if it is not possible to reuse that then obvioulsy i will consider writing my own.

help will be highly appreciated.

regards

Re: Text from Ecore [message #726084 is a reply to message #726008] Fri, 16 September 2011 14:15 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
If OCL already provides for this, they likely have a resource
implementation for producing it. Ed W gave you a detailed answer that
assumed you wanted some kind of editor/viewer, rather than just the
ability to produce text. Make it clear to him you don't need all that
fancy stuff he talked about; you just want to reuse whatever he already
has (his resource implementation) for producing text so you could do
resource.save(System.out, null) and see that text...


On 16/09/2011 4:57 AM, ModelGeek wrote:
> Thank you so much for you help, I know i need to write code generator
> but i mean in Eclipse there is an editor call OCLinEcore which
> presents Emfatic text for Ecore model. So this means there is already
> a code generator with template and workflow that can generate Emfatic
> text from Ecore model.
> So i just want to resuse that existing generator in my standalone
> application. I want to know how to do that... if it is not possible to
> reuse that then obvioulsy i will consider writing my own.
>
> help will be highly appreciated.
>
> regards
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Node Model - Access Comment after element
Next Topic:[solved] Missing whitespace after XText serialization
Goto Forum:
  


Current Time: Fri Apr 19 21:25:52 GMT 2024

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

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

Back to the top