CodeQL library for C/C++
codeql/cpp-all 0.12.12-dev (changelog, source)
Search

Module PreprocBlock

This library offers a view of preprocessor branches (#if, #ifdef, #ifndef, #elif and #else) as blocks of code between the opening and closing directives, with navigable parent-child relationships to other blocks. The main class is PreprocessorBlock.

Import path

import semmle.code.cpp.headers.PreprocBlock

Imports

cpp

Provides classes and predicates for working with C/C++ code.

Classes

PreprocessorBlock

A chunk of code from one preprocessor branch (#if, #ifdef, #ifndef, #elif or #else) to the directive that closes it (#elif, #else or #endif). The getParent() method allows these blocks to be navigated as a tree, with the root being the entire file.