int (@NotNull ASTNode child) { LOG.assertTrue(child.getTreeParent() == this); IElementType i = child.getElementType(); if (i == FOR_KEYWORD) { return ChildRole.FOR_KEYWORD; } else if (i == LPARENTH) { return ChildRole.LPARENTH; } else if (i == RPARENTH) { return ChildRole.RPARENTH; } else if (i == SEMICOLON) { return ChildRole.FOR_SEMICOLON; } else { if (EXPRESSION_BIT_SET.contains(child.getElementType())) { return ChildRole.CONDITION; } else if (child.getPsi() instanceof PsiStatement) { int role = getChildRole(child, ChildRole.FOR_INITIALIZATION); if (role != ChildRoleBase.NONE) return role; role = getChildRole(child, ChildRole.FOR_UPDATE); if (role != ChildRoleBase.NONE) return role; return ChildRole.LOOP_BODY; } else { return ChildRoleBase.NONE; } } }