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.complete;
13 import net.sourceforge.phpdt.internal.compiler.ast.Expression;
14 import net.sourceforge.phpdt.internal.compiler.ast.LocalDeclaration;
15 import net.sourceforge.phpdt.internal.compiler.lookup.BlockScope;
16 import net.sourceforge.phpdt.internal.compiler.util.CharOperation;
19 public class CompletionOnLocalName extends LocalDeclaration {
20 private static final char[] FAKENAMESUFFIX = " ".toCharArray(); //$NON-NLS-1$
21 public char[] realName;
22 public CompletionOnLocalName(Expression expr,char[] name, int sourceStart, int sourceEnd){
23 super(expr, CharOperation.concat(name, FAKENAMESUFFIX), sourceStart, sourceEnd);
27 public void resolve(BlockScope scope) {
30 throw new CompletionNodeFound(this, scope);
32 public String toString(int tab) {
33 String s = tabString(tab);
34 s += "<CompleteOnLocalName:"; //$NON-NLS-1$
35 if (type != null) s += type.toString() + " "; //$NON-NLS-1$
36 s += new String(realName);
37 if (initialization != null) s += " = " + initialization.toStringExpression(); //$NON-NLS-1$
38 s += ">"; //$NON-NLS-1$