void (PsiElement first, PsiElement last) { boolean inside = false; for (ASTNode node = getFirstChildNode(); node != null; node = node.getTreeNext()) { if (node.getPsi() == first) { inside = true; } if (inside) { int role = getChildRole(node); if (role == ChildRole.OPERATION_SIGN || role == ChildRole.LOPERAND) { LOG.error("Unable to remove child with role " + role + "(" + node.getElementType() + ")"); } } if (node.getPsi() == last) { inside = false; } } }