1 /*******************************************************************************
2 * Copyright (c) 2000, 2001, 2002 International Business Machines Corp. and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v0.5
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v05.html
9 * IBM Corporation - initial API and implementation
10 ******************************************************************************/
11 package net.sourceforge.phpdt.internal.codeassist.select;
14 * Selection node build by the parser in any case it was intending to
15 * reduce a qualified super reference containing the assist identifier.
21 * X.[start]super[end].bar();
29 * <SelectOnQualifiedSuper:X.super>
36 import net.sourceforge.phpdt.internal.compiler.ast.QualifiedSuperReference;
37 import net.sourceforge.phpdt.internal.compiler.ast.TypeReference;
38 import net.sourceforge.phpdt.internal.compiler.lookup.BlockScope;
39 import net.sourceforge.phpdt.internal.compiler.lookup.TypeBinding;
41 public class SelectionOnQualifiedSuperReference extends QualifiedSuperReference {
42 public SelectionOnQualifiedSuperReference(TypeReference name, int pos, int sourceEnd) {
43 super(name, pos, sourceEnd);
45 public TypeBinding resolveType(BlockScope scope) {
46 TypeBinding binding = super.resolveType(scope);
48 if (binding == null || !binding.isValidBinding())
49 throw new SelectionNodeFound();
51 throw new SelectionNodeFound(binding);
53 public String toStringExpression(){
55 StringBuffer buffer = new StringBuffer("<SelectOnQualifiedSuper:"); //$NON-NLS-1$
56 buffer.append(super.toStringExpression());
57 buffer.append(">"); //$NON-NLS-1$
58 return buffer.toString();