assignmentOperator

Coverity Documentation

Version
latest

Matches all forms of assignment.

CAUTION:
This pattern does not appear in pattern decomposition: Use assignmentStatement instead. For more about decomposition, see Decomposing a Pattern to Match Specific Properties.

This pattern only matches nodes of type expression.

Properties

assignmentOperator produces a record that contains the following properties:

Name Type Description
operator enum One of `=`, `+`, `-`, `*`, `/`, `|`, `&`, `%`, `^`, `>>`, or `<<`
sourceExpression expression The source of the new value (the right-hand side of the operator)
targetExpression expression The expression to which the new value is assigned (the left-hand side of the operator)

Inherits properties from:

Example

The following CodeXM pattern matches only assignments made using the + operator:

CXM code follows
    pattern incrementAssignmentOperator {
        assignmentOperator {
            .operator == `+`
        }
    };