Package org.eclipse.jdt.internal.compiler.ast

Examples of org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference


    nodeSourceStart(field, fieldRef),
    nodeSourceEnd(field, fieldRef));
}
public void invalidField(NameReference nameRef, FieldBinding field) {
  if (nameRef instanceof QualifiedNameReference) {
    QualifiedNameReference ref = (QualifiedNameReference) nameRef;
    if (isRecoveredName(ref.tokens)) return;
  } else {
    SingleNameReference ref = (SingleNameReference) nameRef;
    if (isRecoveredName(ref.token)) return;
  }
View Full Code Here


      break;
  }

  int end = location.sourceEnd;
  if (location instanceof QualifiedNameReference) {
    QualifiedNameReference ref = (QualifiedNameReference) location;
    if (isRecoveredName(ref.tokens)) return;
    if (ref.indexOfFirstFieldBinding >= 1)
      end = (int) ref.sourcePositions[ref.indexOfFirstFieldBinding - 1];
  } else if (location instanceof ParameterizedQualifiedTypeReference) {
    // must be before instanceof ArrayQualifiedTypeReference
View Full Code Here

}
private int nodeSourceEnd(Binding field, ASTNode node, int index) {
  if (node instanceof ArrayTypeReference) {
    return ((ArrayTypeReference) node).originalSourceEnd;
  } else if (node instanceof QualifiedNameReference) {
    QualifiedNameReference ref = (QualifiedNameReference) node;
    if (ref.binding == field) {
      if (index == 0) {
        return (int) (ref.sourcePositions[ref.indexOfFirstFieldBinding-1]);
      } else {
        int length = ref.sourcePositions.length;
View Full Code Here

private int nodeSourceStart(Binding field, ASTNode node, int index) {
  if (node instanceof FieldReference) {
    FieldReference fieldReference = (FieldReference) node;
    return (int) (fieldReference.nameSourcePosition >> 32);
  } else   if (node instanceof QualifiedNameReference) {
    QualifiedNameReference ref = (QualifiedNameReference) node;
    if (ref.binding == field) {
      if (index == 0) {
        return (int) (ref.sourcePositions[ref.indexOfFirstFieldBinding-1] >> 32);
      } else {
        return (int) (ref.sourcePositions[index] >> 32);
View Full Code Here

*/
  String[] arguments = new String[] {new String(binding.readableName())};
  int end = nameRef.sourceEnd;
  int sourceStart = nameRef.sourceStart;
  if (nameRef instanceof QualifiedNameReference) {
    QualifiedNameReference ref = (QualifiedNameReference) nameRef;
    if (isRecoveredName(ref.tokens)) return;
    if (ref.indexOfFirstFieldBinding >= 1)
      end = (int) ref.sourcePositions[ref.indexOfFirstFieldBinding - 1];
  } else {
    SingleNameReference ref = (SingleNameReference) nameRef;
View Full Code Here

  synchronized ITypeBinding resolveTypeBindingForName(Name name) {
    org.eclipse.jdt.internal.compiler.ast.ASTNode node = (org.eclipse.jdt.internal.compiler.ast.ASTNode) this.newAstToOldAst.get(name);
    int index = name.index;
    if (node instanceof QualifiedNameReference) {
      QualifiedNameReference qualifiedNameReference = (QualifiedNameReference) node;
      final char[][] tokens = qualifiedNameReference.tokens;
      if (tokens.length == index) {
        return this.getTypeBinding(qualifiedNameReference.resolvedType);
      }
      int indexOfFirstFieldBinding = qualifiedNameReference.indexOfFirstFieldBinding; // one-based
      if (index < indexOfFirstFieldBinding) {
        // an extra lookup is required
        BlockScope internalScope = (BlockScope) this.astNodesToBlockScope.get(name);
        Binding binding = null;
        try {
          if (internalScope == null) {
            if (this.scope == null) return null;
            binding = this.scope.getTypeOrPackage(CharOperation.subarray(tokens, 0, index));
          } else {
            binding = internalScope.getTypeOrPackage(CharOperation.subarray(tokens, 0, index));
          }
        } catch (AbortCompilation e) {
          // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=53357
          // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=63550
          // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=64299
        }
        if (binding instanceof org.eclipse.jdt.internal.compiler.lookup.PackageBinding) {
          return null;
        } else if (binding instanceof org.eclipse.jdt.internal.compiler.lookup.TypeBinding) {
          // it is a type
          return this.getTypeBinding((org.eclipse.jdt.internal.compiler.lookup.TypeBinding)binding);
        }
      } else if (index == indexOfFirstFieldBinding) {
        if (qualifiedNameReference.isTypeReference()) {
          return this.getTypeBinding(qualifiedNameReference.resolvedType);
        } else {
          // in this case we want to get the next field declaring's class
          if (qualifiedNameReference.otherBindings == null) {
            return null;
View Full Code Here

   */
  synchronized IBinding resolveName(Name name) {
    org.eclipse.jdt.internal.compiler.ast.ASTNode node = (org.eclipse.jdt.internal.compiler.ast.ASTNode) this.newAstToOldAst.get(name);
    int index = name.index;
    if (node instanceof QualifiedNameReference) {
      QualifiedNameReference qualifiedNameReference = (QualifiedNameReference) node;
      final char[][] tokens = qualifiedNameReference.tokens;
      int indexOfFirstFieldBinding = qualifiedNameReference.indexOfFirstFieldBinding; // one-based
      if (index < indexOfFirstFieldBinding) {
        // an extra lookup is required
        BlockScope internalScope = (BlockScope) this.astNodesToBlockScope.get(name);
        Binding binding = null;
        try {
          if (internalScope == null) {
            if (this.scope == null) return null;
            binding = this.scope.getTypeOrPackage(CharOperation.subarray(tokens, 0, index));
          } else {
            binding = internalScope.getTypeOrPackage(CharOperation.subarray(tokens, 0, index));
          }
        } catch (AbortCompilation e) {
          // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=53357
          // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=63550
          // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=64299
        }
        if (binding instanceof org.eclipse.jdt.internal.compiler.lookup.PackageBinding) {
          return getPackageBinding((org.eclipse.jdt.internal.compiler.lookup.PackageBinding)binding);
        } else if (binding instanceof org.eclipse.jdt.internal.compiler.lookup.TypeBinding) {
          // it is a type
          return this.getTypeBinding((org.eclipse.jdt.internal.compiler.lookup.TypeBinding)binding);
        }
      } else if (index == indexOfFirstFieldBinding) {
        if (qualifiedNameReference.isTypeReference()) {
          return this.getTypeBinding(qualifiedNameReference.resolvedType);
        } else {
          Binding binding = qualifiedNameReference.binding;
          if (binding != null) {
            if (binding.isValidBinding()) {
View Full Code Here

          resizeContents(5);
        }
        this.contents[this.contentsOffset++] = (byte) 'e';
        FieldBinding fieldBinding = null;
        if (defaultValue instanceof QualifiedNameReference) {
          QualifiedNameReference nameReference = (QualifiedNameReference) defaultValue;
          fieldBinding = (FieldBinding) nameReference.binding;
        } else if (defaultValue instanceof SingleNameReference) {
          SingleNameReference nameReference = (SingleNameReference) defaultValue;
          fieldBinding = (FieldBinding) nameReference.binding;
        } else {
View Full Code Here

  synchronized ITypeBinding resolveTypeBindingForName(Name name) {
    org.eclipse.jdt.internal.compiler.ast.ASTNode node = (org.eclipse.jdt.internal.compiler.ast.ASTNode) this.newAstToOldAst.get(name);
    int index = name.index;
    if (node instanceof QualifiedNameReference) {
      QualifiedNameReference qualifiedNameReference = (QualifiedNameReference) node;
      final char[][] tokens = qualifiedNameReference.tokens;
      if (tokens.length == index) {
        return this.getTypeBinding(qualifiedNameReference.resolvedType);
      }
      int indexOfFirstFieldBinding = qualifiedNameReference.indexOfFirstFieldBinding; // one-based
      if (index < indexOfFirstFieldBinding) {
        // an extra lookup is required
        BlockScope internalScope = (BlockScope) this.astNodesToBlockScope.get(name);
        Binding binding = null;
        try {
          if (internalScope == null) {
            if (this.scope == null) return null;
            binding = this.scope.getTypeOrPackage(CharOperation.subarray(tokens, 0, index));
          } else {
            binding = internalScope.getTypeOrPackage(CharOperation.subarray(tokens, 0, index));
          }
        } catch (AbortCompilation e) {
          // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=53357
          // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=63550
          // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=64299
        }
        if (binding instanceof org.eclipse.jdt.internal.compiler.lookup.PackageBinding) {
          return null;
        } else if (binding instanceof org.eclipse.jdt.internal.compiler.lookup.TypeBinding) {
          // it is a type
          return this.getTypeBinding((org.eclipse.jdt.internal.compiler.lookup.TypeBinding)binding);
        }
      } else if (index == indexOfFirstFieldBinding) {
        if (qualifiedNameReference.isTypeReference()) {
          return this.getTypeBinding(qualifiedNameReference.resolvedType);
        } else {
          // in this case we want to get the next field declaring's class
          if (qualifiedNameReference.otherBindings == null) {
            return null;
View Full Code Here

   */
  synchronized IBinding resolveName(Name name) {
    org.eclipse.jdt.internal.compiler.ast.ASTNode node = (org.eclipse.jdt.internal.compiler.ast.ASTNode) this.newAstToOldAst.get(name);
    int index = name.index;
    if (node instanceof QualifiedNameReference) {
      QualifiedNameReference qualifiedNameReference = (QualifiedNameReference) node;
      final char[][] tokens = qualifiedNameReference.tokens;
      int indexOfFirstFieldBinding = qualifiedNameReference.indexOfFirstFieldBinding; // one-based
      if (index < indexOfFirstFieldBinding) {
        // an extra lookup is required
        BlockScope internalScope = (BlockScope) this.astNodesToBlockScope.get(name);
        Binding binding = null;
        try {
          if (internalScope == null) {
            if (this.scope == null) return null;
            binding = this.scope.getTypeOrPackage(CharOperation.subarray(tokens, 0, index));
          } else {
            binding = internalScope.getTypeOrPackage(CharOperation.subarray(tokens, 0, index));
          }
        } catch (AbortCompilation e) {
          // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=53357
          // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=63550
          // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=64299
        }
        if (binding instanceof org.eclipse.jdt.internal.compiler.lookup.PackageBinding) {
          return getPackageBinding((org.eclipse.jdt.internal.compiler.lookup.PackageBinding)binding);
        } else if (binding instanceof org.eclipse.jdt.internal.compiler.lookup.TypeBinding) {
          // it is a type
          return this.getTypeBinding((org.eclipse.jdt.internal.compiler.lookup.TypeBinding)binding);
        }
      } else if (index == indexOfFirstFieldBinding) {
        if (qualifiedNameReference.isTypeReference()) {
          return this.getTypeBinding(qualifiedNameReference.resolvedType);
        } else {
          Binding binding = qualifiedNameReference.binding;
          if (binding != null) {
            if (binding.isValidBinding()) {
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.