1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler.ast;
13 import net.sourceforge.phpdt.internal.compiler.IAbstractSyntaxTreeVisitor;
14 import net.sourceforge.phpdt.internal.compiler.lookup.BlockScope;
15 import net.sourceforge.phpdt.internal.compiler.lookup.SourceTypeBinding;
16 import net.sourceforge.phpdt.internal.compiler.lookup.TypeBinding;
18 public class SuperReference extends ThisReference {
20 public SuperReference(int sourceStart, int sourceEnd) {
21 super(sourceStart, sourceEnd);
23 public static ExplicitConstructorCall implicitSuperConstructorCall() {
24 return new ExplicitConstructorCall(ExplicitConstructorCall.ImplicitSuper);
26 public boolean isImplicitThis() {
30 public boolean isSuper() {
34 public boolean isThis() {
38 public TypeBinding resolveType(BlockScope scope) {
39 constant = NotAConstant;
40 if (!checkAccess(scope.methodScope()))
42 SourceTypeBinding enclosingTb = scope.enclosingSourceType();
43 if (scope.isJavaLangObject(enclosingTb)) {
44 scope.problemReporter().cannotUseSuperInJavaLangObject(this);
47 return this.resolvedType = enclosingTb.superclass;
49 public String toStringExpression(){
51 return "super"; //$NON-NLS-1$
54 public void traverse(IAbstractSyntaxTreeVisitor visitor, BlockScope blockScope) {
55 visitor.visit(this, blockScope);
56 visitor.endVisit(this, blockScope);