Source:
<code>protected int rwInExpression(IASTExpression expr, IASTNode node, int indirection) { if (expr instanceof IASTIdExpression) { return rwAnyNode(expr, indirection); } if (expr instanceof IASTBinaryExpression) { return rwInBinaryExpression(node, (IASTBinaryExpression) expr, indirection); } if (expr instanceof IASTFieldReference) { return rwInFieldReference(node, (IASTFieldReference) expr, indirection); } if (expr instanceof IASTCastExpression) { return rwAnyNode(expr, indirection); } if (expr instanceof IASTUnaryExpression) { return rwInUnaryExpression(node, (IASTUnaryExpression) expr, indirection); } if (expr instanceof IASTArraySubscriptExpression) { if (indirection > 0 && node.getPropertyInParent() == IASTArraySubscriptExpression.ARRAY) { return rwAnyNode(expr, indirection - 1); } if (expr.getParent() instanceof IASTBinaryExpression && isAssignment((IASTBinaryExpression) expr.getParent())) { <START> return READ | WRITE; <END> } return READ; } if (expr instanceof IASTConditionalExpression) { if (node.getPropertyInParent() == IASTConditionalExpression.LOGICAL_CONDITION) { return READ; } return rwAnyNode(expr, indirection); } if (expr instanceof IASTExpressionList) { final IASTExpression[] expressions = ((IASTExpressionList) expr).getExpressions(); if (expressions.length > 0 && expressions[0] == node) { return rwAnyNode(expr, indirection); } return 0; } if (expr instanceof IASTFunctionCallExpression) { if (node.getPropertyInParent() == IASTFunctionCallExpression.FUNCTION_NAME) { return rwInFunctionName((IASTExpression) node); } return rwArgumentForFunctionCall((IASTFunctionCallExpression) expr, node, indirection); } if (expr instanceof IASTProblemExpression) { return READ | WRITE; } if (expr instanceof IASTTypeIdExpression) { return 0; } return READ | WRITE; }</code><technical_language>need check LHS of assignment. "a = b[c]" is a write access of "b"</technical_language>

Target:
protected int rwInExpression(IASTExpression expr, IASTNode node, int indirection) { if (expr instanceof IASTIdExpression) { return rwAnyNode(expr, indirection); } if (expr instanceof IASTBinaryExpression) { return rwInBinaryExpression(node, (IASTBinaryExpression) expr, indirection); } if (expr instanceof IASTFieldReference) { return rwInFieldReference(node, (IASTFieldReference) expr, indirection); } if (expr instanceof IASTCastExpression) { return rwAnyNode(expr, indirection); } if (expr instanceof IASTUnaryExpression) { return rwInUnaryExpression(node, (IASTUnaryExpression) expr, indirection); } if (expr instanceof IASTArraySubscriptExpression) { if (indirection > 0 && node.getPropertyInParent() == IASTArraySubscriptExpression.ARRAY) { return rwAnyNode(expr, indirection - 1); } if (expr.getParent() instanceof IASTBinaryExpression && expr.getPropertyInParent() == IASTBinaryExpression.OPERAND_ONE && isAssignment((IASTBinaryExpression) expr.getParent())) { return READ | WRITE; } return READ; } if (expr instanceof IASTConditionalExpression) { if (node.getPropertyInParent() == IASTConditionalExpression.LOGICAL_CONDITION) { return READ; } return rwAnyNode(expr, indirection); } if (expr instanceof IASTExpressionList) { final IASTExpression[] expressions = ((IASTExpressionList) expr).getExpressions(); if (expressions.length > 0 && expressions[0] == node) { return rwAnyNode(expr, indirection); } return 0; } if (expr instanceof IASTFunctionCallExpression) { if (node.getPropertyInParent() == IASTFunctionCallExpression.FUNCTION_NAME) { return rwInFunctionName((IASTExpression) node); } return rwArgumentForFunctionCall((IASTFunctionCallExpression) expr, node, indirection); } if (expr instanceof IASTProblemExpression) { return READ | WRITE; } if (expr instanceof IASTTypeIdExpression) { return 0; } return READ | WRITE; }