addEntities();
}
// After "<range variable declaration> "
else if (expression.hasRangeVariableDeclaration()) {
RangeVariableDeclaration rangeVariableDeclaration = findRangeVariableDeclaration(expression);
if ((rangeVariableDeclaration != null) &&
rangeVariableDeclaration.hasRootObject() &&
rangeVariableDeclaration.hasSpaceAfterRootObject()) {
length += rangeVariableDeclaration.getRootObject().getLength() + SPACE_LENGTH;
// Example: "UPDATE System s"
if (!expression.hasSet() &&
!rangeVariableDeclaration.hasAs() &&
isPositionWithin(position, length, SET)) {
addIdentifier(SET);
}
// Example: "UPDATE System s "
// Example: "UPDATE System AS s "
else {
if (rangeVariableDeclaration.hasAs()) {
length += 2;
}
if (rangeVariableDeclaration.hasSpaceAfterAs()) {
length++;
}
if (rangeVariableDeclaration.hasIdentificationVariable()) {
length += rangeVariableDeclaration.getIdentificationVariable().getLength();
}
if (expression.hasSpaceAfterRangeVariableDeclaration()) {
length++;
}
// Within "SET"
if ((rangeVariableDeclaration.hasAs() && rangeVariableDeclaration.hasIdentificationVariable() ||
!rangeVariableDeclaration.hasAs() && rangeVariableDeclaration.hasIdentificationVariable()) &&
isPositionWithin(position, length, SET)) {
addIdentifier(SET);
}
// After "SET "