View | Details | Raw Unified | Return to bug 110987 | Differences between
and this patch

Collapse All | Expand All

(-)codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java (-4 / +4 lines)
Lines 532-540 Link Here
532
		listLength++;
532
		listLength++;
533
	} 	
533
	} 	
534
}
534
}
535
protected void consumeInstanceOfExpression(int op) {
535
protected void consumeInstanceOfExpression() {
536
	if (indexOfAssistIdentifier() < 0) {
536
	if (indexOfAssistIdentifier() < 0) {
537
		super.consumeInstanceOfExpression(op);
537
		super.consumeInstanceOfExpression();
538
	} else {
538
	} else {
539
		getTypeReference(intStack[intPtr--]);
539
		getTypeReference(intStack[intPtr--]);
540
		this.isOrphanCompletionNode = true;
540
		this.isOrphanCompletionNode = true;
Lines 542-550 Link Here
542
		this.lastIgnoredToken = -1;
542
		this.lastIgnoredToken = -1;
543
	}
543
	}
544
}
544
}
545
protected void consumeInstanceOfExpressionWithName(int op) {
545
protected void consumeInstanceOfExpressionWithName() {
546
	if (indexOfAssistIdentifier() < 0) {
546
	if (indexOfAssistIdentifier() < 0) {
547
		super.consumeInstanceOfExpressionWithName(op);
547
		super.consumeInstanceOfExpressionWithName();
548
	} else {
548
	} else {
549
		getTypeReference(intStack[intPtr--]);
549
		getTypeReference(intStack[intPtr--]);
550
		this.isOrphanCompletionNode = true;
550
		this.isOrphanCompletionNode = true;
(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java (-7 / +4 lines)
Lines 665-673 Link Here
665
							case NOT_EQUAL :
665
							case NOT_EQUAL :
666
								operatorExpression = new EqualExpression(left, expression, info);
666
								operatorExpression = new EqualExpression(left, expression, info);
667
								break;
667
								break;
668
							case INSTANCEOF :
669
								// should never occur
670
								break;
671
							default :
668
							default :
672
								operatorExpression = new BinaryExpression(left, expression, info);
669
								operatorExpression = new BinaryExpression(left, expression, info);
673
								break;
670
								break;
Lines 1946-1953 Link Here
1946
	
1943
	
1947
	pushOnElementStack(K_CAST_STATEMENT);
1944
	pushOnElementStack(K_CAST_STATEMENT);
1948
}
1945
}
1949
protected void consumeInstanceOfExpression(int op) {
1946
protected void consumeInstanceOfExpression() {
1950
	super.consumeInstanceOfExpression(op);
1947
	super.consumeInstanceOfExpression();
1951
	popElement(K_BINARY_OPERATOR);
1948
	popElement(K_BINARY_OPERATOR);
1952
	
1949
	
1953
	InstanceOfExpression exp = (InstanceOfExpression) expressionStack[expressionPtr];
1950
	InstanceOfExpression exp = (InstanceOfExpression) expressionStack[expressionPtr];
Lines 1955-1962 Link Here
1955
		assistNodeParent = exp;
1952
		assistNodeParent = exp;
1956
	}
1953
	}
1957
}
1954
}
1958
protected void consumeInstanceOfExpressionWithName(int op) {
1955
protected void consumeInstanceOfExpressionWithName() {
1959
	super.consumeInstanceOfExpressionWithName(op);
1956
	super.consumeInstanceOfExpressionWithName();
1960
	popElement(K_BINARY_OPERATOR);
1957
	popElement(K_BINARY_OPERATOR);
1961
	
1958
	
1962
	InstanceOfExpression exp = (InstanceOfExpression) expressionStack[expressionPtr];
1959
	InstanceOfExpression exp = (InstanceOfExpression) expressionStack[expressionPtr];
(-)compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java (-12 / +7 lines)
Lines 3316-3322 Link Here
3316
protected void consumeInsideCastExpressionWithQualifiedGenerics() {
3316
protected void consumeInsideCastExpressionWithQualifiedGenerics() {
3317
	// InsideCastExpressionWithQualifiedGenerics ::= $empty
3317
	// InsideCastExpressionWithQualifiedGenerics ::= $empty
3318
}
3318
}
3319
protected void consumeInstanceOfExpression(int op) {
3319
protected void consumeInstanceOfExpression() {
3320
	// RelationalExpression ::= RelationalExpression 'instanceof' ReferenceType
3320
	// RelationalExpression ::= RelationalExpression 'instanceof' ReferenceType
3321
	//optimize the push/pop
3321
	//optimize the push/pop
3322
3322
Lines 3325-3342 Link Here
3325
	this.expressionStack[this.expressionPtr] = exp =
3325
	this.expressionStack[this.expressionPtr] = exp =
3326
		new InstanceOfExpression(
3326
		new InstanceOfExpression(
3327
			this.expressionStack[this.expressionPtr],
3327
			this.expressionStack[this.expressionPtr],
3328
			getTypeReference(this.intStack[this.intPtr--]),
3328
			getTypeReference(this.intStack[this.intPtr--]));
3329
			op);
3330
	if (exp.sourceEnd == 0) {
3329
	if (exp.sourceEnd == 0) {
3331
		//array on base type....
3330
		//array on base type....
3332
		exp.sourceEnd = this.scanner.startPosition - 1;
3331
		exp.sourceEnd = this.scanner.startPosition - 1;
3333
	}
3332
	}
3334
	//the scanner is on the next token already....
3333
	//the scanner is on the next token already....
3335
}
3334
}
3336
/**
3335
protected void consumeInstanceOfExpressionWithName() {
3337
 * @param op
3338
 */
3339
protected void consumeInstanceOfExpressionWithName(int op) {
3340
	// RelationalExpression_NotName ::= Name instanceof ReferenceType
3336
	// RelationalExpression_NotName ::= Name instanceof ReferenceType
3341
	//optimize the push/pop
3337
	//optimize the push/pop
3342
3338
Lines 3347-3354 Link Here
3347
	this.expressionStack[this.expressionPtr] = exp =
3343
	this.expressionStack[this.expressionPtr] = exp =
3348
		new InstanceOfExpression(
3344
		new InstanceOfExpression(
3349
			this.expressionStack[this.expressionPtr],
3345
			this.expressionStack[this.expressionPtr],
3350
			reference,
3346
			reference);
3351
			op);
3352
	if (exp.sourceEnd == 0) {
3347
	if (exp.sourceEnd == 0) {
3353
		//array on base type....
3348
		//array on base type....
3354
		exp.sourceEnd = this.scanner.startPosition - 1;
3349
		exp.sourceEnd = this.scanner.startPosition - 1;
Lines 5458-5464 Link Here
5458
			break;
5453
			break;
5459
 
5454
 
5460
    case 424 : if (DEBUG) { System.out.println("InstanceofExpression ::= InstanceofExpression instanceof"); }  //$NON-NLS-1$
5455
    case 424 : if (DEBUG) { System.out.println("InstanceofExpression ::= InstanceofExpression instanceof"); }  //$NON-NLS-1$
5461
		    consumeInstanceOfExpression(OperatorIds.INSTANCEOF);  
5456
		    consumeInstanceOfExpression();  
5462
			break;
5457
			break;
5463
 
5458
 
5464
    case 426 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression EQUAL_EQUAL..."); }  //$NON-NLS-1$
5459
    case 426 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression EQUAL_EQUAL..."); }  //$NON-NLS-1$
Lines 5982-5992 Link Here
5982
			break;
5977
			break;
5983
 
5978
 
5984
    case 617 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::= Name instanceof..."); }  //$NON-NLS-1$
5979
    case 617 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::= Name instanceof..."); }  //$NON-NLS-1$
5985
		    consumeInstanceOfExpressionWithName(OperatorIds.INSTANCEOF);  
5980
		    consumeInstanceOfExpressionWithName();  
5986
			break;
5981
			break;
5987
 
5982
 
5988
    case 618 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::=..."); }  //$NON-NLS-1$
5983
    case 618 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::=..."); }  //$NON-NLS-1$
5989
		    consumeInstanceOfExpression(OperatorIds.INSTANCEOF);  
5984
		    consumeInstanceOfExpression();  
5990
			break;
5985
			break;
5991
 
5986
 
5992
    case 620 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); }  //$NON-NLS-1$
5987
    case 620 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); }  //$NON-NLS-1$
(-)compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java (-3 / +2 lines)
Lines 22-33 Link Here
22
22
23
	public InstanceOfExpression(
23
	public InstanceOfExpression(
24
		Expression expression,
24
		Expression expression,
25
		TypeReference type,
25
		TypeReference type) {
26
		int operator) {
27
26
28
		this.expression = expression;
27
		this.expression = expression;
29
		this.type = type;
28
		this.type = type;
30
		this.bits |= operator << OperatorSHIFT;
29
		this.bits |= INSTANCEOF << OperatorSHIFT;
31
		this.sourceStart = expression.sourceStart;
30
		this.sourceStart = expression.sourceStart;
32
		this.sourceEnd = type.sourceEnd;
31
		this.sourceEnd = type.sourceEnd;
33
	}
32
	}

Return to bug 110987