ASTNode (int role) { LOG.assertTrue(ChildRole.isUnique(role)); switch(role){ default: return null; case ChildRole.ASSERT_KEYWORD: return findChildByType(ASSERT_KEYWORD); case ChildRole.CONDITION: return findChildByType(EXPRESSION_BIT_SET); case ChildRole.COLON: return findChildByType(COLON); case ChildRole.ASSERT_DESCRIPTION: ASTNode colon = findChildByRole(ChildRole.COLON); if (colon == null) return null; ASTNode child; for(child = colon.getTreeNext(); child != null; child = child.getTreeNext()){ if (EXPRESSION_BIT_SET.contains(child.getElementType())) break; } return child; case ChildRole.CLOSING_SEMICOLON: return findChildByType(SEMICOLON); } }