boolean (PsiExpression element) { if (element instanceof PsiReferenceExpression) { final PsiReferenceExpression expression = (PsiReferenceExpression)element; final PsiElement resolved = expression.resolve(); return resolved instanceof PsiVariable; } if (element instanceof PsiParenthesizedExpression) { return isLValue(((PsiParenthesizedExpression)element).getExpression()); } if (element instanceof PsiArrayAccessExpression) { final PsiArrayAccessExpression arrayAccessExpression = (PsiArrayAccessExpression)element; final PsiExpression arrayExpression = arrayAccessExpression.getArrayExpression(); final PsiType type = arrayExpression.getType(); if (!(type instanceof PsiArrayType)) return false; final PsiExpression indexExpression = arrayAccessExpression.getIndexExpression(); if (indexExpression == null) return false; final PsiType indexType = indexExpression.getType(); if (indexType == null) return false; return getTypeRank(indexType) <= INT_RANK; } return false; }