Author Topic: can't generate code for a new language  (Read 3413 times)

jarnold30

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
can't generate code for a new language
« on: July 06, 2022, 03:57:46 am »
Hi all.
I have created a new language (prolog) for code generation.
The elements I am trying to generate off are classes with stereotypes.
I have created stereotyped overrides using 'add new stereotypes override'.  I have set the language for each element to 'prolog'.
When I try to generate code, nothing happens.  No files are created.

What am I doing wrong?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: can't generate code for a new language
« Reply #1 on: July 06, 2022, 07:12:17 am »
Set aside that I would not use that strange macro stuff, what are your exact steps? Just "it does onot work" is not enough for debugging.

q.

jarnold30

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: can't generate code for a new language
« Reply #2 on: July 06, 2022, 07:22:33 am »
When I select 'Generate', it claims success but no files are created.
I know that's not much to go on, but it's what I have.
John

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: can't generate code for a new language
« Reply #3 on: July 06, 2022, 02:36:28 pm »
Did you actually create the code generation templates?

Geert

jarnold30

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: can't generate code for a new language
« Reply #4 on: July 06, 2022, 05:50:59 pm »
I created a number of stereotype overrides

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: can't generate code for a new language
« Reply #5 on: July 06, 2022, 06:10:42 pm »
I created a number of stereotype overrides
On the templates for which language?

IIRC you first have to define the templates for your language, and then change the templates to match your language.
You can use stereotype overrides, to differentiate between different type of classes within your language.

Geert

jarnold30

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: can't generate code for a new language
« Reply #6 on: July 07, 2022, 02:58:24 am »
I don't understand what you mean.  I have defined some stereotype overrides, what more do I need to do?

Sorry, I'm definitely a noob at this

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: can't generate code for a new language
« Reply #7 on: July 07, 2022, 04:07:29 am »
When you create the stereotype override, what do you see in the dropdown on the top that says "Language"?

Geert

jarnold30

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: can't generate code for a new language
« Reply #8 on: July 07, 2022, 05:51:06 am »
It says 'prolog'

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1324
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: can't generate code for a new language
« Reply #9 on: July 07, 2022, 10:29:07 am »
You need to create templates to transform the model into Prolog otherwise you won't get any output.
This link explains about the code templates.
https://sparxsystems.com/enterprise_architect_user_guide/16.0/modeling_domains/codetemplates_2.html
Happy to help
:)

jarnold30

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: can't generate code for a new language
« Reply #10 on: July 08, 2022, 01:21:44 am »
Thanks.  I have read this doc, but it's still not clear to me what I need to do to actually generate code.  Are there any examples anywhere?

jarnold30

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: can't generate code for a new language
« Reply #11 on: July 08, 2022, 06:59:19 am »
OK, I found out how it all works by looking at the java templates.  Phew!
Thanks for your help everyone