Book a Demo

Author Topic: how to create #ifdef  (Read 2840 times)

MREA

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
how to create #ifdef
« on: November 09, 2012, 09:20:35 pm »
how to creat stuff like this?

=== Attr Declarations ====
#ifdef PREPROCESS

static   int     x= 0;
static   int    y= 0;
static   int     z = 0;

#endif
Support- Languages: German, English, French

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: how to create #ifdef
« Reply #1 on: November 10, 2012, 04:57:41 am »
Again for code generation you could use tagged values on class level (e.g. something like 'optionalSections' with all the necessary code specified in the value), or on the attribute level (e.g. 'withOption' and the #ifdef tag as value) to steer these attributes being generated inside a section corresponding to the #ifdef tag and adding a list of these tags with another tagged value at class level. That's just a rough first shot idea ...

But you might get in trouble with reverse engineered / synchronized code that duplicates for such stuff could be generated (I didn't try this actually).

As long not more is available on how to control EA's code parsing process it might be a tough task to implement it correctly.

HTH
Günther
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

MREA

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
Re: how to create #ifdef
« Reply #2 on: November 12, 2012, 05:17:34 pm »
that's why I'm asking!
I fear to destroy the template :D
But thanks, now I know that this is really the only chance to do  it :(

Actually I've the Problem at where I have to implement it.
because its 3 attr. in a class with normal attr..
so i've to save the #ifdef attr to print them later.
But normaly EA gives a list of all attr. back.
« Last Edit: November 12, 2012, 05:25:16 pm by EAIFM »
Support- Languages: German, English, French