Book a Demo

Author Topic: Code Template Editor  (Read 2492 times)

ferran

  • EA User
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Code Template Editor
« on: November 22, 2019, 08:00:34 pm »
Dear experts,

I am tweaking the Code Template Editor in order to generate code from class diagrams.

I would like to have the operations of a class diagram that have no input parameters generated with 'void' word inside the brackets.

For example:


The generated .h file from EA has the following definition related to the highlighted operation:
ETHERNET_CONNECTION_STATUS_t EthernetIsConnected();

Where I would like to have the following generated method:
ETHERNET_CONNECTION_STATUS_t EthernetIsConnected(void);

In order to do this I was changing the "Parameter" template, but did not find the exact place to generate the 'void' word.

Could someone help me out with this one?


Kind regards,

Ferran.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Code Template Editor
« Reply #1 on: November 25, 2019, 09:49:43 am »
Edit the Operation and Operation Impl templates.

Code: [Select]
$params = %list="Parameter" @separator=", "%
%opName%(
%if $params != ""%
$params
$else%
void
%endIf%
)


Code: [Select]
$params = %list="ParameterImpl" @separator=", "%
%opName%(
%if $params != ""%
$params
$else%
void
%endIf%
)