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

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

Import path

import semmle.code.cpp.headers.PreprocBlock

Direct supertypes

Predicates

getAChild

Gets a PreprocessorBlock that’s directly inside this one.

getAMacro

Gets a macro definition that is directly in this PreprocessorBlock.

getAnInclude

Gets an include directive that is directly in this PreprocessorBlock.

getEndLine

Gets the end line number of this PreprocessorBlock.

getFile

Gets the file this PreprocessorBlock is located in.

getParent

Gets the PreprocessorBlock that’s directly surrounding this one. Has no result if this is a file.

getStartLine

Gets the start line number of this PreprocessorBlock.

hasLocationInfo

Holds if this element is at the specified location. The location spans column startcolumn of line startline to column endcolumn of line endline in file filepath. For more information, see Locations.

toString

Gets a textual representation of this element.

Charpred