473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Tool for partial C++ preprocessing

Where to get/buy tool for partial preprocessing?

1. What I mean by partial macro preprocessing. This is mode in which almost
sources (>99%) is not preprocessed. But some macros (setted by options) will
be "executed". This feature maybe used for:
a) exclude some (nonpublic, temple or test) parts of source code.
b) simplify source code (remove unused macros, replace some macros to better
undestanding).

Example (PRIVATE macro executed, all other not executed):

Source code:

#define PRIVATE 0
#define TESTING 0
#if PRIVATE
verify_registration_code();
#endif
#if PRIVATE || TESTING
self_test();
#endif

Source code after partial preprocessing:

#define TESTING 0
#if 0 || TESTING
self_test();
#endif

Alex.
Jul 22 '05 #1
1 2861
"Alex Sedow" <al*******@mail.ru> wrote in message
news:cd***********@gavrilo.mtu.ru...
Where to get/buy tool for partial preprocessing? 1. What I mean by partial macro preprocessing. This is mode in which almost sources (>99%) is not preprocessed.
See http://www.semdesigns.com/Products/F...pFrontEnd.html.
This parses C++ without expanding macros/conditionals/templates.
It builds a parse tree containing the C++ program *and* the
preprocessor conditionals; it also retains all the source comments.
The machinery (DMS Software Reengineering Toolkit)
on which it is built enables one to carry out arbitrary
analyses and/or source-to-source transformations
on the C++ trees, and then regenerate source text
for the modified code.

We've done tasks such as preprocessor simplification/
dead preprocessor code elimination (simple)
and C++-component source-code restructuring to move
code from a proprietary distributed platform to CORBA.
But some macros (setted by options) will be "executed".
Our tools could do this.
This feature maybe used for:
a) exclude some (nonpublic, temple or test) parts of source code.
b) simplify source code (remove unused macros, replace some macros to better undestanding).

Example (PRIVATE macro executed, all other not executed):

Source code:

#define PRIVATE 0
#define TESTING 0
#if PRIVATE
verify_registration_code();
#endif
#if PRIVATE || TESTING
self_test();
#endif

Source code after partial preprocessing:

#define TESTING 0
#if 0 || TESTING
self_test();
#endif

Alex.

--
Ira D. Baxter, Ph.D., CTO 512-250-1018
Semantic Designs, Inc. www.semdesigns.com
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andre Baresel | last post by:
Hello together, just a year ago I was searching arround for a tool supporting refactoring for c++. I've seen implementations for java and was impressed how an IDE can help with such a feature....
18
by: David Frank | last post by:
Is there a preprocessor (or utility) that has option to insert absent braces to clarify control syntax, ie for/while/if/else/etc ? for(.....) for(....) statement; to
2
by: Theron Stanford | last post by:
I've inherited a bunch of code that contains a lot of conditional preprocessing commands. Is there a way to run the preprocessor so that it processes the conditionals but leaves the rest of the...
12
by: Francois Grieu | last post by:
Can #include safely use a preprocessing token, as in #define HEADERFILE "stdio.h" #include HEADERFILE int main(void) {return printf("Hello, world\n")*0;} TIA, François Grieu
20
by: jvankay | last post by:
Does any C guru out there know of a C pre-processing tool that will allow limited pruning of C source based on a single #define variable. That is, in the code fragment below: XXX #ifdef...
7
by: reppisch | last post by:
Hi Ng, i am looking for a method of expanding a macro while the rest of the code remains untouched. I have some code which does macro voodo / ifdef's which i would like to strip and simplify. ...
4
by: Henrik Goldman | last post by:
I have an application which compiles on a number of different platforms. Now I'm trying to incorporate an external library which is only available to a subset of the platforms that my application...
5
by: Francois Grieu | last post by:
One of the C compiler that I use <OT>(Keil's CX51)</OTbarks at #define a(b) b int main(void){return a( #if 0 #endif 0);} More generally, this compiler seems confused by any preprocessing...
14
by: lagman | last post by:
All, I'm looking for a tool that is able to take my code base (which is full of preprocessor directives) and spit out source code that is "clean" of any preprocessor directives based on the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.