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 an explicit constructor call containing the cursor.
20 * Y.[start]super[end](1, 2)
26 * <SelectOnExplicitConstructorCall:Y.super(1, 2)>
32 import net.sourceforge.phpdt.internal.compiler.ast.*;
33 import net.sourceforge.phpdt.internal.compiler.lookup.*;
35 public class SelectionOnExplicitConstructorCall extends ExplicitConstructorCall {
36 public SelectionOnExplicitConstructorCall(int accessMode) {
39 public void resolve(BlockScope scope) {
42 // tolerate some error cases
43 if (binding == null ||
44 !(binding.isValidBinding() ||
45 binding.problemId() == ProblemReasons.NotVisible))
46 throw new SelectionNodeFound();
48 throw new SelectionNodeFound(binding);
50 public String toString(int tab) {
51 String s = tabString(tab);
52 s += "<SelectOnExplicitConstructorCall:"; //$NON-NLS-1$
53 if (qualification != null)
54 s = s + qualification.toStringExpression() + "."; //$NON-NLS-1$
55 if (accessMode == This) {
56 s = s + "this("; //$NON-NLS-1$
58 s = s + "super("; //$NON-NLS-1$
60 if (arguments != null) {
61 for (int i = 0; i < arguments.length; i++) {
62 s += arguments[i].toStringExpression();
63 if (i != arguments.length - 1) {
64 s += ", "; //$NON-NLS-1$
68 s += ")>"; //$NON-NLS-1$