Skip to main content
summaryrefslogtreecommitdiffstats
blob: 1626c1ea1a5e79dd6990ab104a9b112bab276a64 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package org.eclipse.jdt.internal.compiler.ast;

/*
 * (c) Copyright IBM Corp. 2000, 2001.
 * All Rights Reserved.
 */
import org.eclipse.jdt.internal.compiler.IAbstractSyntaxTreeVisitor;
import org.eclipse.jdt.internal.compiler.codegen.*;
import org.eclipse.jdt.internal.compiler.lookup.*;

public class SuperReference extends ThisReference {
	public static final SuperReference Super = new SuperReference();
	
/**
 * SuperReference constructor comment.
 */
public SuperReference() {
	super();
}
public SuperReference(int pos, int sourceEnd) {
	super();
	sourceStart = pos;
	this.sourceEnd = sourceEnd;
}
public static ExplicitConstructorCall implicitSuperConstructorCall() {
	return new ExplicitConstructorCall(ExplicitConstructorCall.ImplicitSuper);
}
public boolean isSuper() {
	
	return true;
}
public boolean isThis() {
	
	return false ;
}
public TypeBinding resolveType(BlockScope scope) {
	constant = NotAConstant;
	if (!checkAccess(scope.methodScope()))
		return null;
	SourceTypeBinding enclosingTb = scope.enclosingSourceType();
	if (scope.isJavaLangObject(enclosingTb)) {
		scope.problemReporter().cannotUseSuperInJavaLangObject(this);
		return null;
	}
	return enclosingTb.superclass;
}
public String toStringExpression(){

	return "super";
	
}
public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope blockScope) {
	visitor.visit(this, blockScope);
	visitor.endVisit(this, blockScope);
}
}

Back to the top