Parsing Considerations

Having symbols found by error-tolerant pattern matching rather than strict language parsing has important implications:

The source files can have syntax errors. They don’t have to be compiled. That means symbols will be found in source code that doesn’t even compile or is in an intermediate state, which is most of the time!

Preprocessor macros are not expanded before Source Insight parses the code. This may sound bad, but in reality it works quite well. Source Insight parses your program at its most abstract level - at the same level as it was written. Among other things, this also allows call trees to contain function-like macros.

Symbol declarations are parsed from all of the source code, not just what was active at the time of compilation. For example, C/C++ code inside of #ifdef-#endif clauses are also added to the symbol database, even if the #ifdef branch is not active when you compile. This can be a great help if you are working on a multi-state program, and you need to be aware of all cases, not only what the compiler sees. If you do want to omit inactive code blocks, you can define condition values with the Edit Condition command, or in the Preferences: Languages dialog box.

The text in comments and constants is also indexed for searching. Source Insight is focused on source level code; not just what the compiler transforms into object code.

All header files are assumed accessible in all source files. Source Insight does not notice what header files are included in each particular source file. Therefore, all symbols are known at all points. This is technically inaccurate with respect to how a compiler will see your program, but in most cases it works well.

Some programming styles may cause symbols not to be found by Source Insight. The default parsing that Source Insight uses works very well with most programming styles. In the event that you have some declarations types that Source Insight can’t recognize, you can add Token Macros, which expand during a preprocessing phase, or you can add a custom parsing regular expression pattern.