British Inside

An Englishman living in small town America

James Shaw

News

  • Copyright James Shaw 2004-2007

    Creative Commons License

    View James Shaw's profile on LinkedIn

Preprocessing in C#

I need your help. If you work for a company with other developers, mention this around the coke machine (like you even know where the water cooler is)..

In the good old days, there was a C++ compiler command line option to preprocess your file(s) to an *.i file. You could use /P /EP /C and get your comments preserved and your code preprocessed.

Those options aren't there in the C# command line compiler - only /define remains.

But this is C# remember, so I'm not interested in preprocessing macros or include files - just simple #if-#else-#endif  processing would be sufficient (no need to support #elif even).

The intent is to run my code through a tool with different #define's and get the correct C# code out the other side, as similar as possible to the original but with all # and unnecessary code removed.

I'd do it myself, but there must be some tool out there that is built for this purpose and would save me time and handle all the necessary nested definitions, etc. I'll pay for the tool.

Thoughts?

Posted: Thursday, June 09, 2005 10:08 AM by James
Filed under:

Comments

No Comments

New Comments to this post are disabled