Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Papyrus/Codegen/Adding a New Code Generator

< Papyrus
Revision as of 11:22, 17 October 2014 by Onder.gurcan.cea.fr (Talk | contribs) (The "org.eclipse.papyrus.x.codegen" project)

Papyrus has already have code generation support for C++ and Java programming languages. Besides, support for Ada and C programming languages are also on the way. However, it is possible to develop and integrate new code generators for other programming languages to Papyrus. In this article you will find how add a new code generator to Papyrus from scratch.

Preparing the Development Environment (Prerequisites)

This section provides a step-by-step guide to set up your development environment in order to be able to add a new code generator for Papyrus.

Assuming that you have already installed Papyrus, here are the steps you need to follow:

  • Install the "Qompass (Incubation)" modeler extension from the "Help > Install Papyrus Additional Components" menu.

Papyrus Additional Components Discovery.png

Developing a New Code Generator

To develop a new code generator for a programming language (let's say the X programming language), three projects need to be created.

  • An eclipse plug-in project for developing the code generator, which should be named as org.eclipse.papyrus.x.codegen
  • An eclipse plug-in project for connecting the code generator to the user interface of Qompass, which should be named as org.eclipse.papyrus.x.codegen.ui
  • Another eclipse plug-in project for developing the tests of the code generator, which should be name as org.eclipse.papyrus.x.codegen.tests

Now, let's create and prepare all these projects one by one.


The "org.eclipse.papyrus.x.codegen" project

Here are the steps for creating and setting the "org.eclipse.papyrus.x.codegen" project:

  • Create an eclipse plug-in project. name it as "org.eclipse.papyrus.x.codegen" (as shown) and then click "Next >".

CodeGen-Plugin-Project-Creation.png

  • Do not make any changes on the default property values and click "Finish".

CodeGen-Plugin-Project-Creation-2.png

  • Upon a successful project creation, you will switch to the Plug-in Development perspective and see a window like below.

CodeGen-Plugin-Project-Creation-3.png

Integrating the New Code Generator to Papyrus

Back to the top