Book a Demo

Author Topic: how to create ClassName_OpName()  (Read 2777 times)

MREA

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
how to create ClassName_OpName()
« on: October 30, 2012, 12:48:33 am »
hi
in the template I put
 %className%_%opName%(%list="Parameter" @separator=", "%)

so I get in my C code ClassName_operationname

Why can't EA see on reverse engeneering that this is the same fct?

How do EA read the .c files? without templates`?
Support- Languages: German, English, French

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: how to create ClassName_OpName()
« Reply #1 on: October 30, 2012, 01:40:32 am »
Code generation and reverse engineering of source code are two completely separate processing pathes in EA. Any changes you put in the code generation templates won't be respected in any way in the reverse engineering. This is more or less done by specialized parsers for the various programming languages supported by EA, and there are only very sparse options to control these (e.g. by specifying language macro definitions).

Regards,
Günther

PS.: BTW, you should design C classes that way, that the functions take a struct parameter (pointer) to the class attributes as first parameter to express they're belonging to that particular class.
« Last Edit: October 30, 2012, 01:44:13 am by Makulik »

MREA

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
Re: how to create ClassName_OpName()
« Reply #2 on: October 30, 2012, 01:43:56 am »
so do you have any advise?
What could I do to handle this?

But Thank you very much
Support- Languages: German, English, French

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: how to create ClassName_OpName()
« Reply #3 on: October 30, 2012, 01:50:40 am »
The only advise I can give is not to rename the methods with code generation. If you need to have them this naming scheme (e.g. because of your coding conventions) you'll need to use the same naming scheme in the model.

Another opportunity could be to have a programming language independent model that you use to transform to a C specific model. With the transformation you could automate to generate this naming scheme. But there's no way to 'reverse engineer' the transformed model to the original one, and keeping these in sync could be even harder.

HTH
Günther