Tool for partial C++ preprocessing

A

Alex Sedow

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.
 
I

Ira Baxter

Alex Sedow said:
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/FrontEnds/CppFrontEnd.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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top