forLoopSimple

Coverity Documentation

Version
latest

Matches simple for loops of the form for (int i = 0; i < 10; ++i).

This pattern only matches nodes of type statement.

Properties

forLoopSimple produces a record that contains the following properties:

Name Type Description
bodyStatement statement The statement that the loop repeatedly executes. Frequently, this is a blockStatement.
conditionExpression expression The condition that causes the loop to terminate
initializationStatement statement Initialization clause of the for loop
kind enum Always `simple`
updateStatement statement The expression statement to update the loop value (frequently something like i++)

Inherits properties from:

Example

The forLoopSimple pattern matches the following for loop:

JavaScript code follows
    for (let i = 0; i < 10; ++i) {
        // ...
    };

See also

forLoopIn, forLoopOf