Coding Tips for Good Parsing Results

Because regular C/C++ preprocessing is not performed by Source Insight’s parsers, you might want to keep the following thoughts in mind as you write new code.

Try not to have #ifdef-#endif blocks break up an individual declaration. If it cannot be avoided, and Source Insight doesn’t parse the code correctly, you will need to define the condition value using Edit Condition, so that Source Insight will disable the inactive block of code causing the confusion. See also “Conditional Parsing”.

For example:

void MyFunc
#ifdef XYZ
    (int param1, int param2)
    (long param1, long param2)

Try not to replace standard language keywords or combinations with #define’d substitutions. If you cannot avoid this, then you will need to define Token Macros to support them. See also “Preprocessor Token Macros”.

For example:

#define ourpublic public
class D : ourpublic B { … }

This causes a problem because Source Insight doesn’t know that the keyword ourpublic really means public.