Book a Demo

Author Topic: How to genrate code for a new language?  (Read 3885 times)

x527771

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
How to genrate code for a new language?
« on: October 13, 2008, 06:30:02 pm »
EA support C, C++,C#,java, ... Now, I want to create a new type laguage code, such as Tcl, [incr tcl]. How to do?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: How to genrate code for a new language?
« Reply #1 on: October 14, 2008, 09:01:34 am »
Start by defining at least one datatype for the language (Settings | Code Datatypes)

You can then select that language in the code template editor to start writing code generation templates.  Using examples from the other languages is a great way to get started.

Eventually you will nearly certainly want to package the datatypes and templates into an MDG technology as that also provides you the option of setting file extensions etc.

I'll leave you to look at the relevant help pages.

Tanjona

  • Guest
Re: How to genrate code for a new language?
« Reply #2 on: October 16, 2008, 02:20:18 am »
Hi,
I m actually working on Code templateTransformation from a Java PSM,
Its about how to get a Hibernate configuration file from a Java DAO Class.

i would like to know who to get the multiplicity in a relationship.
 
I know how to get the Target's multiplicity (with %linkCard%)

But i got no idea how to get the Source's multiplicity (i need it for creating the tags<many-to-many.../> etc... so I need the both multiplicity)

Best Regards
Tanjona

Tanjona

  • Guest
Re: How to genrate code for a new language?
« Reply #3 on: October 16, 2008, 06:59:44 pm »
and a second little question,
On a modele with several class, when i m performing a transformation on a class. I can't get any informations from the others class.

I would like to know if there is a way to get informations about the others class ?

thanks.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: How to genrate code for a new language?
« Reply #4 on: October 17, 2008, 09:22:10 am »
Both problems should be solved by listing over connectors instead.  You'll then get a range of macros including %connectorSourceMultiplicity%, %connectorDestMultiplicity%, %connectorDestElemAlias% and %connectorSourceElemAuthor%.

x527771

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: How to genrate code for a new language?
« Reply #5 on: October 17, 2008, 05:40:05 pm »
If I define a new language, Could I do the Synchronize Model with Code function with the language.

Tanjona

  • Guest
Re: How to genrate code for a new language?
« Reply #6 on: October 17, 2008, 06:31:25 pm »
thanks you, it works perfectly.
I just had to add a new custom template with a template type connector and call from inside the correct macros


« Last Edit: October 18, 2008, 02:30:08 am by Tanjona »