int (@NotNull ASTNode child) { LOG.assertTrue(child.getTreeParent() == this); IElementType i = child.getElementType(); if (i == IF_KEYWORD) { return ChildRole.IF_KEYWORD; } else if (i == ELSE_KEYWORD) { return ChildRole.ELSE_KEYWORD; } else if (i == LPARENTH) { return ChildRole.LPARENTH; } else if (i == RPARENTH) { return ChildRole.RPARENTH; } else { if (ElementType.EXPRESSION_BIT_SET.contains(child.getElementType())) { return ChildRole.CONDITION; } else if (child.getPsi() instanceof PsiStatement) { if (findChildByRoleAsPsiElement(ChildRole.THEN_BRANCH) == child) { return ChildRole.THEN_BRANCH; } return ChildRole.ELSE_BRANCH; } else { return ChildRoleBase.NONE; } } }