Package org.eclipse.jdt.internal.compiler.impl

Examples of org.eclipse.jdt.internal.compiler.impl.ReferenceContext


  int priority = 10000 - problem.getSourceLineNumber(); // early problems first
  if (priority < 0) priority = 0;
  if (problem.isError()){
    priority += P_ERROR;
  }
  ReferenceContext context = this.problemsMap == null ? null : (ReferenceContext) this.problemsMap.get(problem);
  if (context != null){
    if (context instanceof AbstractMethodDeclaration){
      AbstractMethodDeclaration method = (AbstractMethodDeclaration) context;
      if (method.isStatic()) {
        priority += P_STATIC;
View Full Code Here


      if(this.typePtr > -1) {
        length = this.typePtr + 1;
        foundTypes = new TypeDeclaration[length];
        System.arraycopy(this.types, 0, foundTypes, 0, length);
      }
      ReferenceContext oldContext = Parser.this.referenceContext;
      Parser.this.recoveryScanner.resetTo(initializer.bodyStart, initializer.bodyEnd);
      Scanner oldScanner = Parser.this.scanner;
      Parser.this.scanner = Parser.this.recoveryScanner;
      parseStatements(
          this.enclosingType,
          initializer.bodyStart,
          initializer.bodyEnd,
          foundTypes,
          Parser.this.compilationUnit);
      Parser.this.scanner = oldScanner;
      Parser.this.referenceContext = oldContext;

      for (int i = 0; i < length; i++) {
        foundTypes[i].traverse(this.typeVisitor, scope);
      }
    }
    public void endVisit(MethodDeclaration methodDeclaration, ClassScope scope) {
      endVisitMethod(methodDeclaration, scope);
    }
    private void endVisitMethod(AbstractMethodDeclaration methodDeclaration, ClassScope scope) {
      TypeDeclaration[] foundTypes = null;
      int length = 0;
      if(this.typePtr > -1) {
        length = this.typePtr + 1;
        foundTypes = new TypeDeclaration[length];
        System.arraycopy(this.types, 0, foundTypes, 0, length);
      }
      ReferenceContext oldContext = Parser.this.referenceContext;
      Parser.this.recoveryScanner.resetTo(methodDeclaration.bodyStart, methodDeclaration.bodyEnd);
      Scanner oldScanner = Parser.this.scanner;
      Parser.this.scanner = Parser.this.recoveryScanner;
      parseStatements(
          methodDeclaration,
View Full Code Here

 
      this.visibleLocalVariables = new ObjectVector();
      this.visibleFields = new ObjectVector();
      this.visibleMethods = new ObjectVector();
 
      ReferenceContext referenceContext = scope.referenceContext();
      if (referenceContext instanceof AbstractMethodDeclaration) {
        // completion is inside a method body
        searchVisibleVariablesAndMethods(scope, this.visibleLocalVariables, this.visibleFields, this.visibleMethods, notInJavadoc);
      } else if (referenceContext instanceof TypeDeclaration) {
        TypeDeclaration typeDeclaration = (TypeDeclaration) referenceContext;
View Full Code Here

  private JavaElement getJavaElement(LocalVariableBinding binding) {
    LocalDeclaration local = binding.declaration;

    JavaElement parent = null;
    ReferenceContext referenceContext = binding.declaringScope.referenceContext();
    if (referenceContext instanceof AbstractMethodDeclaration) {
      AbstractMethodDeclaration methodDeclaration = (AbstractMethodDeclaration) referenceContext;
      parent = this.getJavaElementOfCompilationUnit(methodDeclaration, methodDeclaration.binding);
    } else if (referenceContext instanceof TypeDeclaration){
      // Local variable is declared inside an initializer
View Full Code Here

  private TypeBinding getTypeFromSignature(String typeSignature, Scope scope) {
    TypeBinding assignableTypeBinding = null;

    TypeVariableBinding[] typeVariables = Binding.NO_TYPE_VARIABLES;
    ReferenceContext referenceContext = scope.referenceContext();
    if (referenceContext instanceof AbstractMethodDeclaration) {
      AbstractMethodDeclaration methodDeclaration = (AbstractMethodDeclaration) referenceContext;
      TypeParameter[] typeParameters = methodDeclaration.typeParameters();
      if (typeParameters != null && typeParameters.length > 0) {
        int length = typeParameters.length;
View Full Code Here

  }

  if (type.isParameterizedType()) {
    List missingTypes = type.collectMissingTypes(null);
    if (missingTypes != null) {
      ReferenceContext savedContext = this.referenceContext;
      for (Iterator iterator = missingTypes.iterator(); iterator.hasNext(); ) {
        try {
          invalidType(location, (TypeBinding) iterator.next());
        } finally {
          this.referenceContext = savedContext;
View Full Code Here

      if(this.typePtr > -1) {
        length = this.typePtr + 1;
        foundTypes = new TypeDeclaration[length];
        System.arraycopy(this.types, 0, foundTypes, 0, length);
      }
      ReferenceContext oldContext = Parser.this.referenceContext;
      Parser.this.recoveryScanner.resetTo(initializer.bodyStart, initializer.bodyEnd);
      Scanner oldScanner = Parser.this.scanner;
      Parser.this.scanner = Parser.this.recoveryScanner;
      parseStatements(
          this.enclosingType,
View Full Code Here

      if(this.typePtr > -1) {
        length = this.typePtr + 1;
        foundTypes = new TypeDeclaration[length];
        System.arraycopy(this.types, 0, foundTypes, 0, length);
      }
      ReferenceContext oldContext = Parser.this.referenceContext;
      Parser.this.recoveryScanner.resetTo(methodDeclaration.bodyStart, methodDeclaration.bodyEnd);
      Scanner oldScanner = Parser.this.scanner;
      Parser.this.scanner = Parser.this.recoveryScanner;
      parseStatements(
          methodDeclaration,
View Full Code Here

      }
    }
    this.resolvedType = returnType;
  }
  if (this.receiver.isSuper() && compilerOptions.getSeverity(CompilerOptions.OverridingMethodWithoutSuperInvocation) != ProblemSeverities.Ignore) {
    final ReferenceContext referenceContext = scope.methodScope().referenceContext;
    if (referenceContext instanceof AbstractMethodDeclaration) {
      final AbstractMethodDeclaration abstractMethodDeclaration = (AbstractMethodDeclaration) referenceContext;
      MethodBinding enclosingMethodBinding = abstractMethodDeclaration.binding;
      if (enclosingMethodBinding.isOverriding()
          && CharOperation.equals(this.binding.selector, enclosingMethodBinding.selector)
View Full Code Here

  */
  public final boolean isDefinedInMethod(MethodBinding method) {
    Scope scope = this;
    do {
      if (scope instanceof MethodScope) {
        ReferenceContext refContext = ((MethodScope) scope).referenceContext;
        if (refContext instanceof AbstractMethodDeclaration)
          if (((AbstractMethodDeclaration) refContext).binding == method)
            return true;
      }
      scope = scope.parent;
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.impl.ReferenceContext

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.