Book a Demo

Author Topic: generation generates .c and .h  (Read 4663 times)

MREA

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
generation generates .c and .h
« on: November 07, 2012, 01:03:26 am »
what template correspond to the generation of the .c file?

My problem is:

I've a class with a collection of enums
now i wanna create only a .h file of this for including it in other files.
It worked bevor, but something changed that
« Last Edit: November 07, 2012, 01:03:51 am by EAIFM »
Support- Languages: German, English, French

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: generation generates .c and .h
« Reply #1 on: November 07, 2012, 01:23:10 am »
All of the templates ending with 'Impl'

HTH
Günther

MREA

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
Re: generation generates .c and .h
« Reply #2 on: November 07, 2012, 01:38:33 am »
yes but why he take IMPL?

he only have to generate a .h file no .c file!
the default template do that, so what did I changed?
Support- Languages: German, English, French

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: generation generates .c and .h
« Reply #3 on: November 07, 2012, 02:39:52 am »
I think it doesn't matter what the input elements are, the generator will take the templates and look what's inside. If you have s.th. like
Code: [Select]
%if classStereotype == "enum"%
%endTemplate%
nothing should be generated for elements with stereotype <<enum>>.
Besides C there are other languages that might want to implement s.th. for enums.
May be you have accidentially removed some part as described above  when you changed the code generation templates.

MREA

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
Re: generation generates .c and .h
« Reply #4 on: November 07, 2012, 05:15:32 pm »
that's it!
I didn't marked the class as Stereotype "enumeration"

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

MREA

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
Re: generation generates .c and .h
« Reply #5 on: November 07, 2012, 06:30:27 pm »
But than I've another problem!

I've
class enumcollection
                    - enum
                     -enum
                    - enum
                     -enum


the output is than

enum enumcollection
{

/* this is not needed*/
};
enum
{}
enum{}

and I get dublicities
« Last Edit: November 07, 2012, 06:38:24 pm by EAIFM »
Support- Languages: German, English, French

MREA

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
Re: generation generates .c and .h
« Reply #6 on: November 12, 2012, 05:51:33 pm »
Ok I tried it with tagged values.
but if I put this

Code: [Select]
$comment = "create only *.h file"
%if classTag:"onlyHeader" =="true"%
%endTemplate%
%endIf%

in file Impl he generates me a .c file without contents.
so who is calling file Impl, that seams to be the one that create the .c files.
Support- Languages: German, English, French

MREA

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
Re: generation generates .c and .h
« Reply #7 on: November 16, 2012, 05:03:17 pm »
what does the EA-support mean with

"An implementation file is written for all types with the exception of
those hard coded to prevent it."

--> I can't do anything?,because it'shardcoded in EA
--> or do I have to hard code it in the template?
Support- Languages: German, English, French