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.
Difference between revisions of "MoDisco/CSharpDiscoverer"
(→Team) |
|||
(3 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | + | This CSharp Discoverer plug-in allows models of a C# application to be converted into [[MoDisco/Components/KDM|KDM models]] ([http://www.omg.org/technology/kdm/index.htm OMG specifications]). | |
− | + | ||
− | + | This version doesn't provide the capability to create CSharp models from C# code. | |
== Description == | == Description == | ||
− | + | The [[MoDisco/CSharp|CSharp metamodel]] can be used to create models containing the full abstract syntax tree of the CSharp program : each statement such as attribute definition, method invocation or loop can be described. In addition, links between elements can be resolved (by resolved link we mean for instance a link between a method invocation and the declaration of this method, or between the usage of a variable and its declaration). The model can thus be seen as an abstract syntax graph (ASG). | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | The [[MoDisco/KDM|KDM model]] represents only the structure of the CSharp application. The mapping between CSharp concepts and elements of [[MoDisco/CSharp|CSharp]] and [[MoDisco/KDM|KDM]] metamodels is described in the following table. | + | The [[MoDisco/Components/KDM|KDM model]] represents only the structure of the CSharp application. The mapping between CSharp concepts and elements of the [[MoDisco/CSharp|CSharp]] and [[MoDisco/Components/KDM|KDM]] metamodels is described in the following table. |
[[Image:Modisco-CSharptoKDMmapping.jpg|frame|center|CSharp to KDM mapping]] | [[Image:Modisco-CSharptoKDMmapping.jpg|frame|center|CSharp to KDM mapping]] | ||
− | In this version, the only data flow elements (below the method declaration) described in the [[MoDisco/KDM|KDM model]] are : | + | In this version, the only data flow elements (below the method declaration) described in the [[MoDisco/Components/KDM|KDM model]] are : |
− | + | * The creation of instances (Creates) | |
− | + | * The method invocations (Calls) | |
− | + | * The return statements returning a variable (UsesType) | |
− | The mapping to [[MoDisco/KDM|KDM]] can be changed or completed easily by updating the [[ | + | The mapping to [[MoDisco/Components/KDM|KDM]] can be changed or completed easily by updating the [[ATL]] rules. |
== Requirements == | == Requirements == | ||
Line 28: | Line 22: | ||
To use the plug-in you need: | To use the plug-in you need: | ||
* JDK 1.5 or above | * JDK 1.5 or above | ||
− | * a version of Eclipse 3.3 or above with the following set of | + | * a version of Eclipse 3.3 or above with the following set of plug-ins installed |
:* [[EMF|EMF]] 2.3.0 or higher | :* [[EMF|EMF]] 2.3.0 or higher | ||
:* [[ATL|ATL]] 2.0.0 or higher | :* [[ATL|ATL]] 2.0.0 or higher | ||
:* [[MoDisco/CSharp|CSharp metamodel]] | :* [[MoDisco/CSharp|CSharp metamodel]] | ||
− | :* [[MoDisco/KDM|KDM metamodel]] | + | :* [[MoDisco/Components/KDM|KDM metamodel]] |
== Team == | == Team == | ||
Line 43: | Line 37: | ||
== Install == | == Install == | ||
− | You will find a version of this plug-in attached in [https://bugs.eclipse.org/bugs/show_bug.cgi?id=258281 following bug]. | + | You will find a version of this plug-in attached in [https://bugs.eclipse.org/bugs/show_bug.cgi?id=258281 the following bug]. |
− | As IP review of this | + | As IP review of this plug-in is not finished, here are installation instructions : |
− | * Extract archive file in your Eclipse workspace, then use "import" menu to import this project. | + | * Extract the archive file in your Eclipse workspace, then use the "import" menu to import this project. |
− | * Use "export" menu to export this project as a | + | * Use the "export" menu to export this project as a plug-in (Deployable plug-ins and fragments) in your Eclipse installation. Don't forget to choose the "Package plug-ins as individual jar archives" option. |
− | * re-start your Eclipse to take | + | * re-start your Eclipse to take this plug-in into account |
== User manual == | == User manual == | ||
− | The | + | The plug-in provides the user with a contextual menu to easily create a KDM model using an existing CSharp model : right-click on a CSharp model file and select “Convert CSharp to KDM Model” (see next Figure). |
− | + | ||
− | + | ||
[[Image:MoDisco-CSharpDiscoverer CSharp to Kdm popup menu.jpg|frame|center|Menus in Eclipse to create KDM model from CSharp model]] | [[Image:MoDisco-CSharpDiscoverer CSharp to Kdm popup menu.jpg|frame|center|Menus in Eclipse to create KDM model from CSharp model]] | ||
Line 71: | Line 63: | ||
[[Image:MoDisco-CSharpDiscoverer CSharp and KDM model in EMF browser.jpg|frame|center|CSharp and KDM models viewed with EMF browser]] | [[Image:MoDisco-CSharpDiscoverer CSharp and KDM model in EMF browser.jpg|frame|center|CSharp and KDM models viewed with EMF browser]] | ||
− | They | + | They can also be opened in the MoDisco model browser (see next Figure) which brings some graphical improvements. |
[[Image:MoDisco-CSharpDiscoverer example CSharp SimpleModel.jpg|frame|center|CSharp model viewed with MoDisco browser]] | [[Image:MoDisco-CSharpDiscoverer example CSharp SimpleModel.jpg|frame|center|CSharp model viewed with MoDisco browser]] | ||
Line 78: | Line 70: | ||
== Current limitations == | == Current limitations == | ||
− | + | This version doesn't provide the capability to create CSharp models from C# code. | |
+ | |||
+ | [[Category:MoDisco]] |
Latest revision as of 06:42, 7 September 2010
This CSharp Discoverer plug-in allows models of a C# application to be converted into KDM models (OMG specifications).
This version doesn't provide the capability to create CSharp models from C# code.
Description
The CSharp metamodel can be used to create models containing the full abstract syntax tree of the CSharp program : each statement such as attribute definition, method invocation or loop can be described. In addition, links between elements can be resolved (by resolved link we mean for instance a link between a method invocation and the declaration of this method, or between the usage of a variable and its declaration). The model can thus be seen as an abstract syntax graph (ASG).
The KDM model represents only the structure of the CSharp application. The mapping between CSharp concepts and elements of the CSharp and KDM metamodels is described in the following table.
In this version, the only data flow elements (below the method declaration) described in the KDM model are :
- The creation of instances (Creates)
- The method invocations (Calls)
- The return statements returning a variable (UsesType)
The mapping to KDM can be changed or completed easily by updating the ATL rules.
Requirements
To use the plug-in you need:
- JDK 1.5 or above
- a version of Eclipse 3.3 or above with the following set of plug-ins installed
- EMF 2.3.0 or higher
- ATL 2.0.0 or higher
- CSharp metamodel
- KDM metamodel
Team
Gabriel Barbier (Mia-Software)
Fabien Giquel (Mia-Software)
Frédéric Madiot (Mia-Software)
Install
You will find a version of this plug-in attached in the following bug.
As IP review of this plug-in is not finished, here are installation instructions :
- Extract the archive file in your Eclipse workspace, then use the "import" menu to import this project.
- Use the "export" menu to export this project as a plug-in (Deployable plug-ins and fragments) in your Eclipse installation. Don't forget to choose the "Package plug-ins as individual jar archives" option.
- re-start your Eclipse to take this plug-in into account
User manual
The plug-in provides the user with a contextual menu to easily create a KDM model using an existing CSharp model : right-click on a CSharp model file and select “Convert CSharp to KDM Model” (see next Figure).
A progress bar will appear at the bottom of the window as soon as the operation begins. Depending on the size of your application, the reverse engineering and transformation might take some time to complete (see next Figure).
At the end of the process, the newly created model files are added at the root of your project and are automatically opened in the default editor (see next Figure).
.kdm files and .csharp files could be opened in the Sample Reflexive Ecore Model Editor (see next Figure).
They can also be opened in the MoDisco model browser (see next Figure) which brings some graphical improvements.
Current limitations
This version doesn't provide the capability to create CSharp models from C# code.