Skip to main content



      Home
Home » Modeling » Papyrus » python code generator
python code generator [message #1827806] Sun, 24 May 2020 12:47 Go to next message
Eclipse UserFriend
Hello

Is there a possibility to generate python code from the sysml diagramms in papyrus.
Most important would be the generation to python code from an activity diagram.

Thank you for your help.

With kind regards
Re: python code generator [message #1827820 is a reply to message #1827806] Mon, 25 May 2020 02:26 Go to previous messageGo to next message
Eclipse UserFriend
Hi Andreas,

the only off the shelf code generator for Papyrus I am aware off is
https://wiki.eclipse.org/Papyrus_Software_Designer
But this generator (currently) only emits C++ and Java.

If you want to roll on your own generator, please have a look at
- https://www.eclipse.org/acceleo/
- https://www.eclipse.org/xtend/

/Carsten
Re: python code generator [message #1827821 is a reply to message #1827820] Mon, 25 May 2020 02:42 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for your information
Re: python code generator [message #1827932 is a reply to message #1827821] Wed, 27 May 2020 03:25 Go to previous messageGo to next message
Eclipse UserFriend
I´d recommend to use Xtend rather than Acceleo, You might also have a look at adding a new code generator (even if not up-to date).
Re: python code generator [message #1827936 is a reply to message #1827932] Wed, 27 May 2020 04:38 Go to previous messageGo to next message
Eclipse UserFriend
Both xtend and acceleo do the job.

The xtend programming language features more expression power and integrates with Java.

Acceleo for me has the huge advantage, it is also the base of GenDoc. Consequently I can use the programming language MOFM2T to generate code and to generate documents.

A hint: MOFM2T is an "isle". You have to use "bridges" to get in contact with the outside.

A second hint: MOFM2T is a purely functional programming language, side effects are impossible by language design. This is really helpful in some cases, but can also be hell in others.

/pica
Re: python code generator [message #1827939 is a reply to message #1827936] Wed, 27 May 2020 05:28 Go to previous messageGo to next message
Eclipse UserFriend
Hi

In the past I have much preferred Xtend migrating all my Acceleo templates to Xtend, but now it is a difficult choice.

Acceleo is barely supported with long outstanding bugs that affect me.

Xtend is deprecated. Hopefully at least its M2T functionality will survive.

Otherwise it's JET, which does now have an Xtext-based editor, but it's from another age.

Regards

Ed Willink
Re: python code generator [message #1827940 is a reply to message #1827939] Wed, 27 May 2020 05:48 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ed,
Hi Ansgar,

given that how would you rate

* directly interfacing to UML2 or even EMOF

* to base on the emitted XMI file (could by done with Python code, to close the loop to the originating post)

from your perspective.

/Carsten
Re: python code generator [message #1827942 is a reply to message #1827940] Wed, 27 May 2020 06:19 Go to previous message
Eclipse UserFriend
Hi

Trivial structural UML to text is well-suited as an M2T 101. But fuller UML, especiallyOCL, requires a proper code generator, and after attempting OCL2Java in Acceleo, then Xtend, I ended up in pure Java; there is just too much strategical planning to do which requires an M2M. My next rewrite will probably be two step QVTr ending up in a sensible Java metamodel that should have its own built-in M2T.

This reminds me, using the http://www.eclipse.org/qvt/2018/TextModel metamodel it is now possible to use QVTo or QVTr as an M2T [1]. However the support is only sufficient to make it possible rather than pleasant.

Regards

Ed Willink


[1] http://www.eclipse.org/mmt/qvt/docs/OCL2018TextM2M/TextM2M.pdf
Previous Topic:Is relationship matrix broken in version 4.15?
Next Topic:How to export views and tables definitions from Eclipse HANA Studio to Papyrus?
Goto Forum:
  


Current Time: Wed Jul 23 14:35:35 EDT 2025

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

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

Back to the top