You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

KnownFieldReference.java 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* *******************************************************************
  2. * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Eclipse Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/epl-v10.html
  8. *
  9. * Contributors:
  10. * PARC initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.ajdt.internal.compiler.ast;
  13. import org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference;
  14. import org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant;
  15. import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding;
  16. import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
  17. import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
  18. import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
  19. public class KnownFieldReference extends QualifiedNameReference {
  20. public KnownFieldReference(FieldBinding binding, int startPos,int endPos) {
  21. super(new char[][] {binding.name},new long[1], startPos, endPos);
  22. this.binding = /*this.codegenBinding = */binding;
  23. this.constant = Constant.NotAConstant;
  24. this.actualReceiverType = binding.declaringClass;
  25. this.bits = Binding.FIELD;
  26. //this.receiver = AstUtil.makeTypeReference(binding.declaringClass);
  27. }
  28. //XXX handle source locations
  29. public KnownFieldReference(FieldBinding binding, long pos) {
  30. super(new char[][] {binding.name},new long[1], 0, 0);
  31. this.binding = /*this.codegenBinding = */binding;
  32. this.constant = Constant.NotAConstant;
  33. this.actualReceiverType = binding.declaringClass;
  34. this.bits = Binding.FIELD;
  35. //this.receiver = AstUtil.makeTypeReference(binding.declaringClass);
  36. }
  37. public TypeBinding resolveType(BlockScope scope) {
  38. return fieldBinding().type;
  39. }
  40. }