whileLoop

Coverity Documentation

Version
latest

Matches while loop statements.

This pattern only matches nodes of type statement.

Properties

whileLoop produces a record that contains the following properties:

Name Type Description
bodyStatement statement The statement in the loop. Often this is a block statement.
conditionExpression expression The loop condition
elseStatement list<statement>? The statements executed when the loop terminates; null if there are none

Inherits properties from:

Example

The following CodeXM pattern finds all while loops whose condition is the Boolean value True:

CXM code follows
    pattern whileTrueLoop {
        whileLoop {
            .conditionExpression == booleanLiteral {
                .value == true
            }
        }
    };