(expression.hasSpaceAfterDistinct() ? 1 : 0);
addProblem(expression, startPosition, AbstractSelectClause_MissingSelectExpression);
}
else {
Expression selectExpression = expression.getSelectExpression();
// Check for collection expression first
if (isCollectionExpression(selectExpression)) {
// The SELECT clause does not support a collection of select expressions
if (!multipleSelectItemsAllowed) {
int startPosition = position(expression) +
6 /* SELECT */ +
(expression.hasSpaceAfterSelect() ? 1 : 0) +
(expression.hasDistinct() ? 8 : 0) +
(expression.hasSpaceAfterDistinct() ? 1 : 0);
int endPosition = startPosition + length(selectExpression);
addProblem(selectExpression, startPosition, endPosition, SimpleSelectClause_NotSingleExpression);
}
// Visit the select expression
else {
selectExpression.accept(this);
}
}
// The select expression is not valid
else if (!isValid(selectExpression, expression.selectItemBNF())) {
int startPosition = position(expression) +
6 /* SELECT */ +
(expression.hasSpaceAfterSelect() ? 1 : 0) +
(expression.hasDistinct() ? 8 : 0) +
(expression.hasSpaceAfterDistinct() ? 1 : 0);
int endPosition = startPosition + length(selectExpression);
addProblem(expression, startPosition, endPosition, AbstractSelectClause_InvalidSelectExpression);
}
// Visit the select expression
else {
selectExpression.accept(this);
}
}
}