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

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


      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


  // Notify the compilation unit that it contains some functional types, taking care not to add any transient copies. this is assumed not to be a copy
  public int recordFunctionalType(Scope scope) {
    while (scope != null) {
      switch (scope.kind) {
        case Scope.METHOD_SCOPE :
          ReferenceContext context = ((MethodScope) scope).referenceContext;
          if (context instanceof LambdaExpression) {
            LambdaExpression expression = (LambdaExpression) context;
            if (expression != expression.original) // fake universe.
              return 0;
          }
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

      }
      throw new SelectionNodeFound(binding);
    } else if (this.inheritDocSelected) {
      // no selection node when inheritDoc tag is selected
      // But we need to detect it to enable code select on inheritDoc
      ReferenceContext referenceContext = scope.referenceContext();
      if (referenceContext instanceof MethodDeclaration) {
        throw new SelectionNodeFound(((MethodDeclaration) referenceContext).binding);
      }
    }
  }
View Full Code Here

 
      this.visibleLocalVariables = new ObjectVector();
      this.visibleFields = new ObjectVector();
      this.visibleMethods = new ObjectVector();
 
      ReferenceContext referenceContext = scope.referenceContext();
      if (referenceContext instanceof AbstractMethodDeclaration || referenceContext instanceof LambdaExpression) {
        // 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

      }
    }
    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

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.