Book a Demo

Author Topic: New language template - only one output file?  (Read 4133 times)

danm

  • EA User
  • **
  • Posts: 88
  • Karma: +0/-0
    • View Profile
New language template - only one output file?
« on: November 19, 2007, 08:34:14 am »
Hi,
  I'm generating code for an unsupported language, which has two files (like .h .C). I copies over all the C++ templates to get started, and it's creating C++ files - or I should say file. Only the header.

  I can't find anything in the documentation or help - any idea why it's not generating a body file? Kind thanks for any help.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: New language template - only one output file?
« Reply #1 on: November 19, 2007, 11:23:53 am »
What you need is an MDG technology that includes Code Options. See http://www.sparxsystems.com/EAUserGuide/index.html?addingcodemodulesinmdgtec.htm

danm

  • EA User
  • **
  • Posts: 88
  • Karma: +0/-0
    • View Profile
Re: New language template - only one output file?
« Reply #2 on: November 19, 2007, 03:14:48 pm »
Fantastic! Thanks Simon. This is such a great product.

One question, if I'm using a MDG defined language in a project - then I modify the default language templates, then create a NEW MDG file of the same language - what do I get out?

I tried this and the templates got messed up, but maybe I did something incorrectly.
« Last Edit: November 19, 2007, 04:28:28 pm by danm »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: New language template - only one output file?
« Reply #3 on: November 19, 2007, 07:58:39 pm »
Sorry, I'm not exactly sure what you've done.  Could you detail your steps for me?

danm

  • EA User
  • **
  • Posts: 88
  • Karma: +0/-0
    • View Profile
Re: New language template - only one output file?
« Reply #4 on: November 19, 2007, 10:14:44 pm »
No Problem

- I create a new project
- In there I create a new language
- In there I edit the code gen templates for that language
- In there I create a new MDG technology file, containing and for that language

Now I create a new project
- I Import and use the MDG tech file just created
- I edit the same code templates (of the language I just created)
- Now, create a second, newer MDG tech file, just like before of the same templates

Does that make sense? I created the MDG tech file to get proper generation of my impl files, but I still need to develop the code templates. Then I want to wrap it up and create a new MDG again, and keep 'leapfrogging' myself.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: New language template - only one output file?
« Reply #5 on: November 20, 2007, 07:00:40 pm »
It should work that way, although when I have done this in the past I imported the technology into my original model.

More recently I have added my technology to the MDG Technology search path. (By default the MDGTechnologies directory where you installed EA)  This method of deployment (and testing) has the advantage that you get equivalent behaviour to the default templates EA provides.

danm

  • EA User
  • **
  • Posts: 88
  • Karma: +0/-0
    • View Profile
Re: New language template - only one output file?
« Reply #6 on: November 24, 2007, 10:33:06 am »
Simon,
  OK, I found the problem I believe. Luckily I have an excellent backup program so I didn't lose all my work after I created a MTS file. I believe what happens is that when you save a new language to an MDG - it only saves the templates that have been changed from the default.

  The problem is that if you are 'baselining' your MDG file by creating it, then working from it, you lose the templates you haven't changed. Here's what I mean.
  1. Make a new language
  2. Create MDG from it
  3. Restart using the MDG
  4. Make some further changes
  5. Generate a new MDG
  6. Use the new MDG - oops -  only the last changes are saved, not the originals!

  Your use model makes sense to only save deltas - but it can trip people up. The use model makes sense for modifying supported languages, but for added languages you need to be careful and modify all the templates to resave them.  Maybe just a documentation fix for this one?

  Also - my code datatypes aren't getting preserved in the MDG file for new languages.
« Last Edit: November 24, 2007, 02:51:59 pm by danm »

danm

  • EA User
  • **
  • Posts: 88
  • Karma: +0/-0
    • View Profile
Re: New language template - only one output file?
« Reply #7 on: December 05, 2007, 09:22:19 pm »
"Also - my code datatypes aren't getting preserved in the MDG file for new languages."

WRONG! My stupidity - they are being saved of course. What confused me was that I wasn't seeing them in the 'define datatypes' dialog for my language.