Author Topic: Imporitng a new OOP language not listed  (Read 2414 times)

jfzouain

  • EA User
  • **
  • Posts: 151
  • Karma: +6/-1
    • View Profile
Imporitng a new OOP language not listed
« on: November 27, 2012, 08:13:01 am »
Hi all,

I would like to import a new OOP (Object Oriented Programming) Language not listed in the Source Code Engineering like C, C# and all others. Also would like to generate code to another one also not listed, like Ruby or any other.

What would be the process. I see that I can add a new language and create new code template for this language.

My question is, how can import the code to create classes and so on, if when creating the new language there is no place to add the extension of the language.

Also do I have to use the Import Source Directory to do this, I see that I can change the extension but not the source type. How will EA know what templates to use or what extension of the file to look for.
Any help on this will be appreciated.

Thanks
Best regards

Jose Zouain

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: Imporitng a new OOP language not listed
« Reply #1 on: November 27, 2012, 09:37:55 am »
Hi,

You can specify the language specific extension when you're exporting your definions (Profile/Datatype/Code Generation Templates) as MDG technology. You'll need to specify a CodeOptions.xml with the following content:
Code: [Select]
<CodeOptions>
      <CodeOption name="DefaultExtension">.@your ext@</CodeOption>
      <!-- CodeOption name="Editor">C:\Windows\notepad.exe</CodeOption-->
      <PackagePathSeparator>.</PackagePathSeparator>
</CodeOptions>

in the 'Tools->Generate MDG Technology' wizard dialog (see also : Add Code Modules)

Regarding reverse engineering existing code you have 2 options:

1. You have a language parser that is well accessible from an EA AddIn written in C# or a different supported COM enabled language that
     produces a usable AST .

In this case you can create the EA UML model from scratch  providing your own 'Code Import' action. This might be quite tedious and lots of efforts. Though you might find this librariy helpful:
Enterprise-Architect-Add-in-Framework

2. You trade on this option coming up for you right in time: http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1351628011

HTH
Günther
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/