Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsC++ Code generation help needed?
https://www.eclipse.org/forums/index.php/mv/msg/668334/1266482/#msg_1266482
Because I am interested in C++ code generation I looked at
http://wiki.eclipse.org/Codegen_description and tried the code
generator. It sort of works but needs some work. I am willing to
contribute to the development.
Who is actually working on the generator and what could I do to help?
Joost]]>Joost Kraaijeveld2014-03-07T14:10:21-00:00Re: C++ Code generation help needed?
https://www.eclipse.org/forums/index.php/mv/msg/668334/1266497/#msg_1266497
help is always welcome
What are the things that are missing from your viewpoint. What could you contribute?]]>Ansgar Radermacher2014-03-07T14:35:26-00:00Re: C++ Code generation help needed?
https://www.eclipse.org/forums/index.php/mv/msg/668334/1266511/#msg_1266511
> Dear Joost,
>
> help is always welcome :)
> What are the things that are missing from your viewpoint. What could you
> contribute?
I am missing right now:
- installation instructions for the plugin/code generator
- some architectural documents or development plan that can guide me
through the current code base and that gives me an idea where you want
go to.
I am interested (have a need for the generator as part of my work and
studies) in working transformations from class, state and (hopefully)
activity diagrams into fully compilable C++ and runnable code ( or as
compilable and runnable as possible). I do not care much for any C
directed transformations.
Joost]]>Joost Kraaijeveld2014-03-07T15:00:08-00:00Re: C++ Code generation help needed?
https://www.eclipse.org/forums/index.php/mv/msg/668334/1266607/#msg_1266607
If you really mean "fully compilable C++ and runnable" then perhaps you
are interested in OCL to C++ as well.
The evolving OCL to Java is structured with the intention of supporting
other languages as well, but ... a far from trivial job, but possible.
Regards
Ed Willink
On 07/03/2014 15:00, Joost Kraaijeveld wrote:
> On 07-03-14 15:35, Ansgar Radermacher wrote:
>> Dear Joost,
>>
>> help is always welcome :)
>> What are the things that are missing from your viewpoint. What could you
>> contribute?
>
> I am missing right now:
> - installation instructions for the plugin/code generator
> - some architectural documents or development plan that can guide me
> through the current code base and that gives me an idea where you want
> go to.
>
> I am interested (have a need for the generator as part of my work and
> studies) in working transformations from class, state and (hopefully)
> activity diagrams into fully compilable C++ and runnable code ( or as
> compilable and runnable as possible). I do not care much for any C
> directed transformations.
>
>
> Joost
>
>]]>Ed Willink2014-03-07T18:07:39-00:00Re: C++ Code generation help needed?
https://www.eclipse.org/forums/index.php/mv/msg/668334/1266650/#msg_1266650
> Hi
>
> If you really mean "fully compilable C++ and runnable" then perhaps you
> are interested in OCL to C++ as well.
My ambitions are actually to create both a UML to C++ translator *and* a
UML to a (probabilistic) model checker (Prism or MRMC) so I am
definitely interested in OCL to something transformations.
>
> The evolving OCL to Java is structured with the intention of supporting
> other languages as well, but ... a far from trivial job, but possible.
I will look into it. But first a UML to C++ transformation. So much to
do, so little time....
Joost]]>Joost Kraaijeveld2014-03-07T19:33:26-00:00Re: C++ Code generation help needed?
https://www.eclipse.org/forums/index.php/mv/msg/668334/1271214/#msg_1271214
Qompass is available as Papyrus extension via the standard update-site. It comes with online-help, a cheat-sheet and some example. But the documentation is certainly far from perfect. Please contact my by private mail (firstname.lastname@cea.fr) for more information.
Ansgar (Radermacher)]]>Ansgar Radermacher2014-03-14T14:27:09-00:00Re: C++ Code generation help needed?
https://www.eclipse.org/forums/index.php/mv/msg/668334/1273202/#msg_1273202
I am just comming back to look at this again after several years. It has never been quite clear to me how all the Eclipse parts fit together but my hazy understanding of it is as follows. Please correct any misunderstandings or omissions that you see.
Papyrus is a Eclipse graphical editing tool that supports the UML2 standard (among others).
It's output is a Meta Object Facility (MOF) Model that adheres to the XMI standard.
The intent is that MOF Model-To-Text transformation (MOFM2T) tools take the Papyrus output model and generate code.
There are 3 MOFM2T tools currently supported by Eclipse: - Acceleo, JET2 and Xpand
Here is where I get lost. I don't find any reference to C++ in Acceleo, JET2 is specifically for Java code generation I'm not quite sure what XPand does.
You say that Qompass designer is available as a Papyrus extension but when I go to Help->Install Additional Papyrus Components it does not show up. I am running Papyrus version 0.10.2.v201402191554.
Thanks,
Steve]]>Stephen Blackwell2014-03-19T18:04:11-00:00Re: C++ Code generation help needed?
https://www.eclipse.org/forums/index.php/mv/msg/668334/1273322/#msg_1273322
All three are model to text tools that may be used to generate C++ text
(or Ada, or ...); you just have to write the program/templates.
Regards
Ed Willink
On 19/03/2014 20:10, Stephen Blackwell wrote:
> I too, am interested in C++ code generation from Papyrus. I am just
> comming back to look at this again after several years. It has never
> been quite clear to me how all the Eclipse parts fit together but my
> hazy understanding of it is as follows. Please correct any
> misunderstandings or omissions that you see.
>
> Papyrus is a Eclipse graphical editing tool that supports the UML2
> standard (among others).
> It's output is a Meta Object Facility (MOF) Model that adheres to the
> XMI standard. The intent is that MOF Model-To-Text transformation
> (MOFM2T) tools take the Papyrus output model and generate code.
> There are 3 MOFM2T tools currently supported by Eclipse: - Acceleo,
> JET2 and Xpand
>
> Here is where I get lost. I don't find any reference to C++ in
> Acceleo, JET2 is specifically for Java code generation I'm not quite
> sure what XPand does.
>
> You say that Qompass designer is available as a Papyrus extension but
> when I go to Help->Install Additional Papyrus Components it does not
> show up. I am running Papyrus version 0.10.2.v201402191554.
>
> Thanks,
> Steve]]>Ed Willink2014-03-19T22:17:29-00:00Re: C++ Code generation help needed?
https://www.eclipse.org/forums/index.php/mv/msg/668334/1273898/#msg_1273898
Quote:
...you just have to write the program/templates
Oh, is that all?
Has anybody made a basic "Hello world" project in Papyrus and used some M2T method to generate C++ code and run it successfully?
If so, please post the steps used. It would make a great very basic tutorial.
Steve]]>Stephen Blackwell2014-03-20T18:04:06-00:00Re: C++ Code generation help needed?
https://www.eclipse.org/forums/index.php/mv/msg/668334/1273928/#msg_1273928
What is an hello world project?
If you just want cout << "Hello world\n", then about 10 lines of Acceleo
will generate the 5 lines of C++.
Presumably you want models.
If you want the full reflective power of EMF in C++ then it's a huge
undertaking.
If you want something lightweight it's really easy and you get what you
want.
Regards
Ed Willink
On 20/03/2014 18:04, Stephen Blackwell wrote:
> Quote:
>> ...you just have to write the program/templates
>
>
> Oh, is that all? :roll:
> Has anybody made a basic "Hello world" project in Papyrus and used
> some M2T method to generate C++ code and run it successfully?
>
> If so, please post the steps used. It would make a great very basic
> tutorial.
>
> Steve]]>Ed Willink2014-03-20T19:00:12-00:00Re: C++ Code generation help needed?
https://www.eclipse.org/forums/index.php/mv/msg/668334/1274601/#msg_1274601
My Rhapsody models contain some complicated state charts including parallel states, embedded or sub-state charts and derived state charts.
My immediate goal to to determine if Eclipse/Papyrus/Acceleo/??? can do the job.
To that end I want to start creating the simplest project I can, my "hello world" project, and run through all the steps to build and validate a model, generate, compile and build a C++ program.
Then I will slowly start to increase the complexity of the model to see what limtations and problems I run into.
As far as I can tell from what I've read, this should be possible but I have not found any useful examples or tutorials to get started.
So again, if anybody knows or any such documentation, please post a link.
The documentation that I have read for both Papyrus and Acceleo is, shall we say, obtuse.
FWIW, I would be happy to help improve the documentation.
Thanks,
Steve]]>Stephen Blackwell2014-03-21T17:55:39-00:00Re: C++ Code generation help needed?
https://www.eclipse.org/forums/index.php/mv/msg/668334/1307464/#msg_1307464
1. The code generated has #include <...> for project based .h files that should possibly be "..." for MinGW maybe.
2. The includes also seem to add the folder name in front of each class .h file like #include <TestCDTintegration/class0.h> whereas the .h files are in ..\TestCDTintegration\class0.h etc.
3. Possibly also the forward slashes should be substituted by back slash - '\' in place of '/'...
A tutorial on how to create the C++ project, embed the UML model, apply C_Cpp profile, generate C++, then build with CDT would be definitely of great help.
Or, where the settings for codegen paths can be edited would be useful.
Anantha]]>Anantha Krishnan2014-04-21T15:32:55-00:00Re: C++ Code generation help needed?
https://www.eclipse.org/forums/index.php/mv/msg/668334/1309294/#msg_1309294
Papyrus comes with a Acceleo based C++ code generator, the CDT editing feature is still experimental. It would be good to hear your feedback what works and what does not.
Although the work has been done on a Linux machine, the use of "/" instead of "\" should not impose any problems on Windows with mingw, cygwin or Visual C++. But you need eventually setup your include paths properly in the CDT project settings.
There are two different ways to use the C++ code generation. The first is the direct production of a C++ file (.cpp/.h) that belongs to the model element, the 2nd a support for component based modeling, including the generation of code from a so-called deployment plan. The idea is that a deployment plan describes instances and their allocation to hardware nodes. This approach is inspired by the CORBA Component Model (CCM).
There is a HelloWorld sample model for the 2nd way. It requires to
(1) Install Qompass designer from the Papyrus extensions
(2) Create an empty project (could be a CDT project, but does not have to be)
(3) Select the created project and choose FILE>New>Example.
(4) Select "Qompass Hello World example" from the list.
(5) Open the created example and select the deployment tab. Generate code from the deployment plan with a right click on the selected plan and then choose "Generate deployment models and code" from the context menu.
(6) The generator will produce a model for each node. Each node corresponds to a CDT project containing this model and the code generated from it.
Whereas the 2nd way to produce code is more powerful, it is also more complicated. Therefore, I will also providing a Hello World example for a simple object-oriented model soon.
]]>Ansgar Radermacher2014-04-22T15:59:25-00:00Re: C++ Code generation help needed?
https://www.eclipse.org/forums/index.php/mv/msg/668334/1310533/#msg_1310533
"${workspace_loc:/<the name of your project>}"
b
Thus, all files will be found.
There are two improvements of the generation plugins that will be added soon
(1) Add an option that code generation on a single class will also generate the code on which the class depends such as the package or referenced types.
(2) Automatically configure the include path settings of the CDT project mentioned above.
]]>Ansgar Radermacher2014-04-23T08:36:12-00:00Re: C++ Code generation help needed?
https://www.eclipse.org/forums/index.php/mv/msg/668334/1352229/#msg_1352229
- generates into a separate CDT project, starting with a configurable prefix and the model name. This enables to have multiple models in the same project
- the created project is automatically configured for working with the code generation
- code is generated for required files as well.
- currently, the first code generation produces Acceleo errors. As a workaround, you need to reset the Acceleo driver after the first generation. Subsequent code generation will work.
There is a HelloWorld example available via the File->New->Examples (is must be placed into an existing project)
]]>Ansgar Radermacher2014-05-13T11:08:46-00:00Re: C++ Code generation help needed?
https://www.eclipse.org/forums/index.php/mv/msg/668334/1387840/#msg_1387840
Where do I find QCompass? I don't see it in the extensions.
I'm using v0.10.2.v201402191554 on a Windows 7 pltform which Help->Check for Updates says is the latest.
Help->Install Papyrus Additional Components does not show any QCompass.
Help->Install New Software... search for QCompass does not show anything.
Help->Install Modelling Components ...search for QCompass doe not show anything.
Thanks,
Steve
]]>Stephen Blackwell2014-06-25T17:10:46-00:00Re: C++ Code generation help needed?
https://www.eclipse.org/forums/index.php/mv/msg/668334/1391219/#msg_1391219
I have updated from Eclipse Kepler to Eclipse Luna and now QCompass is available.
Steve]]>Stephen Blackwell2014-06-30T15:57:55-00:00Re: C++ Code generation help needed?
https://www.eclipse.org/forums/index.php/mv/msg/668334/1745924/#msg_1745924
I am using Papyrus RT with its default code generator. I wanted to ask is it possible to somehow alter the code generator in such a way that I remap the data types of the generated methods. For instance, is it possible to somehow map type UMLRTOutSignal to integer?
Mia]]>Mia Petkovic2016-10-19T11:29:29-00:00Re: C++ Code generation help needed?
https://www.eclipse.org/forums/index.php/mv/msg/668334/1746151/#msg_1746151
Mia Petkovic wrote on Wed, 19 October 2016 11:29
Hi everyone,
I am using Papyrus RT with its default code generator. I wanted to ask is it possible to somehow alter the code generator in such a way that I remap the data types of the generated methods. For instance, is it possible to somehow map type UMLRTOutSignal to integer?
Mia
Hi,
I am not fully sure why you would like to do this, but shouldn't it be sufficient in your specific example to get the internal id (which basically is an int) of the UMLRTOutSignal? There is a method getId() that returns the internal id of an UMLRTOutSignal.
Keep in mind that the generated code is rather coupled with the run-time system itself, and changing types like what you are asking probably means that you will have an impact on the run-time system as well (which maybe is something that you actually want, not sure from the information you provided).
If you have more question specifically related to Papyrus-RT and its code-generator (and run-time), I suggest that you ask in the Papyrus-RT forum.