protected void consumeReferenceExpressionTypeForm(boolean isPrimitive) { // actually Name or Type form.
// ReferenceExpression ::= PrimitiveType Dims '::' NonWildTypeArgumentsopt IdentifierOrNew
// ReferenceExpression ::= Name Dimsopt '::' NonWildTypeArgumentsopt IdentifierOrNew
ReferenceExpression referenceExpression = newReferenceExpression();
TypeReference [] typeArguments = null;
char [] selector;
int sourceEnd;
sourceEnd = (int) this.identifierPositionStack[this.identifierPtr];
referenceExpression.nameSourceStart = (int) (this.identifierPositionStack[this.identifierPtr] >>> 32);
selector = this.identifierStack[this.identifierPtr--];
this.identifierLengthPtr--;
int length = this.genericsLengthStack[this.genericsLengthPtr--];
if (length > 0) {
this.genericsPtr -= length;
System.arraycopy(this.genericsStack, this.genericsPtr + 1, typeArguments = new TypeReference[length], 0, length);
this.intPtr--; // pop type arguments source start.
}
int dimension = this.intStack[this.intPtr--];
boolean typeAnnotatedName = false;
for (int i = this.identifierLengthStack[this.identifierLengthPtr], j = 0; i > 0 && this.typeAnnotationLengthPtr >= 0; --i, j++) {
length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr - j];
if (length != 0) {
typeAnnotatedName = true;
break;
}
}
if (dimension > 0 || typeAnnotatedName) {
if (!isPrimitive) {
pushOnGenericsLengthStack(0);
pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
}
referenceExpression.initialize(this.compilationUnit.compilationResult, getTypeReference(dimension), typeArguments, selector, sourceEnd);
} else {
referenceExpression.initialize(this.compilationUnit.compilationResult, getUnspecifiedReference(), typeArguments, selector, sourceEnd);
}
consumeReferenceExpression(referenceExpression);
}