1 11 package org.eclipse.jdt.internal.compiler.ast; 12 13 import org.eclipse.jdt.internal.compiler.ASTVisitor; 14 import org.eclipse.jdt.internal.compiler.lookup.*; 15 16 public class QualifiedSuperReference extends QualifiedThisReference { 17 18 public QualifiedSuperReference(TypeReference name, int pos, int sourceEnd) { 19 super(name, pos, sourceEnd); 20 } 21 22 public boolean isSuper() { 23 24 return true; 25 } 26 27 public boolean isThis() { 28 29 return false; 30 } 31 32 public StringBuffer printExpression(int indent, StringBuffer output) { 33 34 return qualification.print(0, output).append(".super"); } 36 37 public TypeBinding resolveType(BlockScope scope) { 38 39 if ((this.bits & ParenthesizedMASK) != 0) { 40 scope.problemReporter().invalidParenthesizedExpression(this); 41 return null; 42 } 43 super.resolveType(scope); 44 if (currentCompatibleType == null) 45 return null; 47 if (currentCompatibleType.id == T_JavaLangObject) { 48 scope.problemReporter().cannotUseSuperInJavaLangObject(this); 49 return null; 50 } 51 return this.resolvedType = currentCompatibleType.superclass(); 52 } 53 54 public void traverse( 55 ASTVisitor visitor, 56 BlockScope blockScope) { 57 58 if (visitor.visit(this, blockScope)) { 59 qualification.traverse(visitor, blockScope); 60 } 61 visitor.endVisit(this, blockScope); 62 } 63 public void traverse( 64 ASTVisitor visitor, 65 ClassScope blockScope) { 66 67 if (visitor.visit(this, blockScope)) { 68 qualification.traverse(visitor, blockScope); 69 } 70 visitor.endVisit(this, blockScope); 71 } 72 } 73
| Popular Tags
|