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;
14 * Completion node build by the parser in any case it was intending to
15 * reduce an access to a member (field reference or message send)
16 * containing the completion identifier.
27 * <CompleteOnMemberAccess:bar().fred>
31 * The source range of the completion node denotes the source range
32 * which should be replaced by the completion.
35 import net.sourceforge.phpdt.internal.compiler.ast.FieldReference;
36 import net.sourceforge.phpdt.internal.compiler.lookup.BlockScope;
37 import net.sourceforge.phpdt.internal.compiler.lookup.TypeBinding;
39 public class CompletionOnMemberAccess extends FieldReference {
41 public CompletionOnMemberAccess(char[] source, long pos) {
45 public TypeBinding resolveType(BlockScope scope) {
46 TypeBinding receiverType = receiver.resolveType(scope);
47 if (receiverType == null || receiverType.isBaseType())
48 throw new CompletionNodeFound();
50 throw new CompletionNodeFound(this, receiverType, scope);
51 // array types are passed along to find the length field
54 public String toStringExpression() {
56 return "<CompleteOnMemberAccess:" //$NON-NLS-1$
57 + super.toStringExpression() + ">"; //$NON-NLS-1$