Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Code generation (Ecore to Python)
Code generation (Ecore to Python) [message #1101815] Wed, 04 September 2013 21:24 Go to next message
Daniel Tahin is currently offline Daniel Tahin
Messages: 19
Registered: July 2013
Junior Member
Hello,

i'm a beginner with Acceleo. I have some ambiguity about the code-generation.

I downloaded the example-package (git://git.eclipse.org/gitroot/m2t/org.eclipse.acceleo.git/) for Acceleo, and i import the Ecore2Python collection in Eclipse (org.eclipse.acceleo/examples/org.eclipse.acceleo.module.example.ecore2python) to generate Python code.

I create a My.ecore file (New->Other->Eclipse Modeling Framework->Ecore Model). Then click on My.ecore->Initialize Ecore Diagram File. This produces the My.ecorediag file. In the diagrammeditor i create a class (AClass).
If i click on My.ecore, there should be an option "Model to Text Transformation".
If i click on My.ecore and Run->Run Configuration->Acceleo Application, then the class AClass is not generated in the python code. For the model, that is requested on the configuration dialog, i use the one found in "plugins\org.eclipse.acceleo.model\model\mtl.ecore" in the package that i got from the git-repository. (see on the attachment)
I can run My.ecore, but the generated python codes doesn't contain AClass.

On the other way: if i create a Debug-configuration (Run->Debug Configuration->Eclipse Application), say Edb, and click on the Bug-symbol, and start Edb, then a second Eclipse instance is started. In this one i create an ecore-modell (My.ecore) and initialize the diagramm file (My.ecorediag) and create a class (AClass).
And now the option "Model to Text Transformation" IS THERE, and clicking on it creates the python codes, that contains AClass as well.

Can you tell me what is the difference between the two ways?
Do i absolutely need the second solution? (on my computer the second Eclipsse instance is really unstable)
In the second case, do i need no modell (like mtl.ecore) at all?

Many Thanks,
Daniel
  • Attachment: snap.jpg
    (Size: 109.08KB, Downloaded 43 times)
Re: Code generation (Ecore to Python) [message #1104972 is a reply to message #1101815] Mon, 09 September 2013 03:04 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 3844
Registered: July 2009
Senior Member
Hi

Traditionally when you start Eclipse your configuration identifies many
bundles/plugins/Jars that contribute to your experience when using Eclipse.

When you generate Java code from an *.ecore model you create new
class/Jar files but they do not contribute to your Eclipse experience
and so can seem somewhat useless.

When you start a nested Eclipse you get an extended experience in which
your generated code can be used.

Regards

Ed Willink


On 05/09/2013 02:24, Daniel Tahin wrote:
> Hello,
>
> i'm a beginner with Acceleo. I have some ambiguity about the code-generation.
>
> I downloaded the example-package (git://git.eclipse.org/gitroot/m2t/org.eclipse.acceleo.git/) for Acceleo, and i import the Ecore2Python collection in Eclipse (org.eclipse.acceleo/examples/org.eclipse.acceleo.module.example.ecore2python) to generate Python code.
>
> I create a My.ecore file (New->Other->Eclipse Modeling Framework->Ecore Model). Then click on My.ecore->Initialize Ecore Diagram File. This produces the My.ecorediag file. In the diagrammeditor i create a class (AClass).
> If i click on My.ecore, there should be an option "Model to Text Transformation".
> If i click on My.ecore and Run->Run Configuration->Acceleo Application, then the class AClass is not generated in the python code. For the model, that is requested on the configuration dialog, i use the one found in "plugins\org.eclipse.acceleo.model\model\mtl.ecore" in the package that i got from the git-repository. (see on the attachment)
> I can run My.ecore, but the generated python codes doesn't contain AClass.
>
> On the other way: if i create a Debug-configuration (Run->Debug Configuration->Eclipse Application), say Edb, and click on the Bug-symbol, and start Edb, then a second Eclipse instance is started. In this one i create an ecore-modell (My.ecore) and initialize the diagramm file (My.ecorediag) and create a class (AClass).
> And now the option "Model to Text Transformation" IS THERE, and clicking on it creates the python codes, that contains AClass as well.
>
> Can you tell me what is the difference between the two ways?
> Do i absolutely need the second solution? (on my computer the second Eclipsse instance is really unstable)
> In the second case, do i need no modell (like mtl.ecore) at all?
>
> Many Thanks,
> Daniel
>
Re: Code generation (Ecore to Python) [message #1106223 is a reply to message #1104972] Tue, 10 September 2013 17:13 Go to previous messageGo to next message
Daniel Tahin is currently offline Daniel Tahin
Messages: 19
Registered: July 2013
Junior Member
Thanx.
The problem was, if i used Eclipse in nested mode under Windows, i get a lot of PermGen Space errors (java.lang.OutOfMemoryError) and it ends up with a crash. Setting the heap size for Eclipse didn't help.
But on Linux, there are no problems. Maybe some platform specific bug ...

Best Regards,
Daniel




Ed Willink wrote on Mon, 09 September 2013 03:04
Hi

Traditionally when you start Eclipse your configuration identifies many
bundles/plugins/Jars that contribute to your experience when using Eclipse.

When you generate Java code from an *.ecore model you create new
class/Jar files but they do not contribute to your Eclipse experience
and so can seem somewhat useless.

When you start a nested Eclipse you get an extended experience in which
your generated code can be used.

Regards

Ed Willink


On 05/09/2013 02:24, Daniel Tahin wrote:
> Hello,
>
> i'm a beginner with Acceleo. I have some ambiguity about the code-generation.
>
> I downloaded the example-package (git://git.eclipse.org/gitroot/m2t/org.eclipse.acceleo.git/) for Acceleo, and i import the Ecore2Python collection in Eclipse (org.eclipse.acceleo/examples/org.eclipse.acceleo.module.example.ecore2python) to generate Python code.
>
> I create a My.ecore file (New->Other->Eclipse Modeling Framework->Ecore Model). Then click on My.ecore->Initialize Ecore Diagram File. This produces the My.ecorediag file. In the diagrammeditor i create a class (AClass).
> If i click on My.ecore, there should be an option "Model to Text Transformation".
> If i click on My.ecore and Run->Run Configuration->Acceleo Application, then the class AClass is not generated in the python code. For the model, that is requested on the configuration dialog, i use the one found in "plugins\org.eclipse.acceleo.model\model\mtl.ecore" in the package that i got from the git-repository. (see on the attachment)
> I can run My.ecore, but the generated python codes doesn't contain AClass.
>
> On the other way: if i create a Debug-configuration (Run->Debug Configuration->Eclipse Application), say Edb, and click on the Bug-symbol, and start Edb, then a second Eclipse instance is started. In this one i create an ecore-modell (My.ecore) and initialize the diagramm file (My.ecorediag) and create a class (AClass).
> And now the option "Model to Text Transformation" IS THERE, and clicking on it creates the python codes, that contains AClass as well.
>
> Can you tell me what is the difference between the two ways?
> Do i absolutely need the second solution? (on my computer the second Eclipsse instance is really unstable)
> In the second case, do i need no modell (like mtl.ecore) at all?
>
> Many Thanks,
> Daniel
>

Re: Code generation (Ecore to Python) [message #1106486 is a reply to message #1106223] Wed, 11 September 2013 02:45 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 3844
Registered: July 2009
Senior Member
Hi

Try Googling "Eclipse PermGen".

Regards

Ed Willink


On 10/09/2013 22:13, Daniel Tahin wrote:
> Thanx.
> The problem was, if i used Eclipse in nested mode under Windows, i get
> a lot of PermGen Space errors (java.lang.OutOfMemoryError) and it ends
> up with a crash. Setting the heap size for Eclipse didn't help.
> But on Linux, there are no problems. Maybe some platform specific bug ...
>
> Best Regards,
> Daniel
>
>
>
>
> Ed Willink wrote on Mon, 09 September 2013 03:04
>> Hi
>>
>> Traditionally when you start Eclipse your configuration identifies
>> many bundles/plugins/Jars that contribute to your experience when
>> using Eclipse.
>>
>> When you generate Java code from an *.ecore model you create new
>> class/Jar files but they do not contribute to your Eclipse experience
>> and so can seem somewhat useless.
>>
>> When you start a nested Eclipse you get an extended experience in
>> which your generated code can be used.
>>
>> Regards
>>
>> Ed Willink
>>
>>
>> On 05/09/2013 02:24, Daniel Tahin wrote:
>> > Hello,
>> >
>> > i'm a beginner with Acceleo. I have some ambiguity about the
>> code-generation.
>> >
>> > I downloaded the example-package
>> (git://git.eclipse.org/gitroot/m2t/org.eclipse.acceleo.git/) for
>> Acceleo, and i import the Ecore2Python collection in Eclipse
>> (org.eclipse.acceleo/examples/org.eclipse.acceleo.module.example.ecore2python)
>> to generate Python code.
>> >
>> > I create a My.ecore file (New->Other->Eclipse Modeling
>> Framework->Ecore Model). Then click on My.ecore->Initialize Ecore
>> Diagram File. This produces the My.ecorediag file. In the
>> diagrammeditor i create a class (AClass).
>> > If i click on My.ecore, there should be an option "Model to Text
>> Transformation".
>> > If i click on My.ecore and Run->Run Configuration->Acceleo
>> Application, then the class AClass is not generated in the python
>> code. For the model, that is requested on the configuration dialog, i
>> use the one found in
>> "plugins\org.eclipse.acceleo.model\model\mtl.ecore" in the package
>> that i got from the git-repository. (see on the attachment)
>> > I can run My.ecore, but the generated python codes doesn't contain
>> AClass.
>> >
>> > On the other way: if i create a Debug-configuration (Run->Debug
>> Configuration->Eclipse Application), say Edb, and click on the
>> Bug-symbol, and start Edb, then a second Eclipse instance is started.
>> In this one i create an ecore-modell (My.ecore) and initialize the
>> diagramm file (My.ecorediag) and create a class (AClass).
>> > And now the option "Model to Text Transformation" IS THERE, and
>> clicking on it creates the python codes, that contains AClass as well.
>> >
>> > Can you tell me what is the difference between the two ways?
>> > Do i absolutely need the second solution? (on my computer the
>> second Eclipsse instance is really unstable)
>> > In the second case, do i need no modell (like mtl.ecore) at all?
>> >
>> > Many Thanks,
>> > Daniel
>> >
>
>
Re: Code generation (Ecore to Python) [message #1106721 is a reply to message #1106486] Wed, 11 September 2013 09:01 Go to previous message
Daniel Tahin is currently offline Daniel Tahin
Messages: 19
Registered: July 2013
Junior Member
I found a link (http://stackoverflow.com/questions/3743992/java-lang-outofmemoryerror-permgen-space), and the option -XX:MaxPermSize=1024m must be specified not only in eclipse.ini, but in Run->Debug Configuration->Arguments as well.
It works better. The problem is not came back until now.




Ed Willink wrote on Wed, 11 September 2013 02:45
Hi

Try Googling "Eclipse PermGen".

Regards

Ed Willink


On 10/09/2013 22:13, Daniel Tahin wrote:
> Thanx.
> The problem was, if i used Eclipse in nested mode under Windows, i get
> a lot of PermGen Space errors (java.lang.OutOfMemoryError) and it ends
> up with a crash. Setting the heap size for Eclipse didn't help.
> But on Linux, there are no problems. Maybe some platform specific bug ...
>
> Best Regards,
> Daniel
>
>
>
>
> Ed Willink wrote on Mon, 09 September 2013 03:04
>> Hi
>>
>> Traditionally when you start Eclipse your configuration identifies
>> many bundles/plugins/Jars that contribute to your experience when
>> using Eclipse.
>>
>> When you generate Java code from an *.ecore model you create new
>> class/Jar files but they do not contribute to your Eclipse experience
>> and so can seem somewhat useless.
>>
>> When you start a nested Eclipse you get an extended experience in
>> which your generated code can be used.
>>
>> Regards
>>
>> Ed Willink
>>
>>
>> On 05/09/2013 02:24, Daniel Tahin wrote:
>> > Hello,
>> >
>> > i'm a beginner with Acceleo. I have some ambiguity about the
>> code-generation.
>> >
>> > I downloaded the example-package
>> (git://git.eclipse.org/gitroot/m2t/org.eclipse.acceleo.git/) for
>> Acceleo, and i import the Ecore2Python collection in Eclipse
>> (org.eclipse.acceleo/examples/org.eclipse.acceleo.module.example.ecore2python)
>> to generate Python code.
>> >
>> > I create a My.ecore file (New->Other->Eclipse Modeling
>> Framework->Ecore Model). Then click on My.ecore->Initialize Ecore
>> Diagram File. This produces the My.ecorediag file. In the
>> diagrammeditor i create a class (AClass).
>> > If i click on My.ecore, there should be an option "Model to Text
>> Transformation".
>> > If i click on My.ecore and Run->Run Configuration->Acceleo
>> Application, then the class AClass is not generated in the python
>> code. For the model, that is requested on the configuration dialog, i
>> use the one found in
>> "plugins\org.eclipse.acceleo.model\model\mtl.ecore" in the package
>> that i got from the git-repository. (see on the attachment)
>> > I can run My.ecore, but the generated python codes doesn't contain
>> AClass.
>> >
>> > On the other way: if i create a Debug-configuration (Run->Debug
>> Configuration->Eclipse Application), say Edb, and click on the
>> Bug-symbol, and start Edb, then a second Eclipse instance is started.
>> In this one i create an ecore-modell (My.ecore) and initialize the
>> diagramm file (My.ecorediag) and create a class (AClass).
>> > And now the option "Model to Text Transformation" IS THERE, and
>> clicking on it creates the python codes, that contains AClass as well.
>> >
>> > Can you tell me what is the difference between the two ways?
>> > Do i absolutely need the second solution? (on my computer the
>> second Eclipsse instance is really unstable)
>> > In the second case, do i need no modell (like mtl.ecore) at all?
>> >
>> > Many Thanks,
>> > Daniel
>> >
>
>

Previous Topic:[Acceleo] Java code generation from the .xmi models of the OMG
Next Topic:M2T
Goto Forum:
  


Current Time: Fri Apr 18 10:13:37 EDT 2014

Powered by FUDForum. Page generated in 0.06369 seconds