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.*;
 
  36 import net.sourceforge.phpdt.internal.compiler.lookup.*;
 
  38 public class CompletionOnMemberAccess extends FieldReference {
 
  40         public CompletionOnMemberAccess(char[] source, long pos) {
 
  44         public TypeBinding resolveType(BlockScope scope) {
 
  45                 TypeBinding receiverType = receiver.resolveType(scope);
 
  46                 if (receiverType == null || receiverType.isBaseType())
 
  47                         throw new CompletionNodeFound();
 
  49                         throw new CompletionNodeFound(this, receiverType, scope);
 
  50                 // array types are passed along to find the length field
 
  53         public String toStringExpression() {
 
  55                 return "<CompleteOnMemberAccess:" //$NON-NLS-1$
 
  56                                                 + super.toStringExpression() + ">"; //$NON-NLS-1$