ifStatement

Coverity Documentation

Version
latest

Matches entire if statements, including their condition expressions and their true and false branches.

This pattern only matches nodes of type statement.

Properties

ifStatement produces a record that contains the following properties:

Name Type Description
conditionDeclaration variableDeclaration? The variable declared in the condition, if one exists; null otherwise
conditionExpression expression The condition of the if statement
falseStatement statement? The false branch of the if statement, or null if no false branch exists
trueStatement statement The true branch of the if statement

Inherits properties from:

Example

The following CodeXM pattern matches if statements that have no else clause:


CXM code follows
    pattern ifNoElse {
        ifStatement {
            .falseStatement == null
        }
    };