Package org.eclipse.jdt.internal.compiler.lookup

Examples of org.eclipse.jdt.internal.compiler.lookup.Scope


  /* (non-Javadoc)
   * @see ITypeBinding#isCastCompatible(ITypeBinding)
   */
  public boolean isCastCompatible(ITypeBinding type) {
    try {
      Scope scope = this.resolver.scope();
      if (scope == null) return false;
      if (!(type instanceof TypeBinding)) return false;
      org.eclipse.jdt.internal.compiler.lookup.TypeBinding expressionType = ((TypeBinding) type).binding;
      // simulate capture in case checked binding did not properly get extracted from a reference
      expressionType = expressionType.capture(scope, 0);
View Full Code Here


  public MethodScope getScope() {
    return this.scope;
  }
 
  private boolean enclosingScopesHaveErrors() {
    Scope skope = this.enclosingScope;
    while (skope != null) {
      ReferenceContext context = skope.referenceContext();
      if (context != null && context.hasErrors())
        return true;
      skope = skope.parent;
    }
    return false;
View Full Code Here

    return this.ignoreFurtherInvestigation;
  }

  public void tagAsHavingErrors() {
    this.ignoreFurtherInvestigation = true;
    Scope parent = this.enclosingScope.parent;
    while (parent != null) {
      switch(parent.kind) {
        case Scope.CLASS_SCOPE:
        case Scope.METHOD_SCOPE:
          parent.referenceContext().tagAsHavingErrors();
          return;
        default:
          parent = parent.parent;
          break;
      }
View Full Code Here

    CompilationUnitDeclaration previousUnitBeingCompleted = this.lookupEnvironment.unitBeingCompleted;
    this.lookupEnvironment.unitBeingCompleted = this.compilationUnitDeclaration;
    try {
      this.hasComputedVisibleElementBindings = true;
 
      Scope scope = this.assistScope;
      ASTNode astNode = this.assistNode;
      boolean notInJavadoc = this.completionContext.javadoc == 0;
 
      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

    InvocationSite invocationSite = CompletionEngine.FakeInvocationSite;

    boolean staticsOnly = false;
    // need to know if we're in a static context (or inside a constructor)

    Scope currentScope = scope;

    done1 : while (true) { // done when a COMPILATION_UNIT_SCOPE is found

      switch (currentScope.kind) {
View Full Code Here

  }

  public boolean canUseDiamond(String[] parameterTypes, char[] fullyQualifiedTypeName) {
    TypeBinding guessedType = null;
    char[][] cn = CharOperation.splitOn('.', fullyQualifiedTypeName);
    Scope scope = this.assistScope;
    if (scope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_7) return false;
    // If no LHS or return type expected, then we can safely use diamond
    char[][] expectedTypekeys= this.completionContext.getExpectedTypesKeys();
    if (expectedTypekeys == null || expectedTypekeys.length == 0)
      return true;
    // Next, find out whether any of the constructor parameters are the same as one of the
View Full Code Here

}
/**
* Check and/or redirect the field access to the delegate receiver if any
*/
public TypeBinding getReceiverType(BlockScope currentScope) {
  Scope scope = currentScope.parent;
  while (true) {
      switch (scope.kind) {
        case Scope.CLASS_SCOPE :
          return ((ClassScope) scope).referenceContext.binding;
        default:
View Full Code Here

        if (outerTrackerScope == scope) {
          // outerTracker is from same scope and already processed -> pick trackingVar now
          break;
        } else {
          // outer resource is from other (outer?) scope
          Scope currentScope = scope;
          while ((currentScope = currentScope.parent) instanceof BlockScope) {
            if (outerTrackerScope == currentScope) {
              // at end of block pass responsibility for inner resource to outer scope holding a wrapper
              varsOfScope.remove(trackingVar); // drop this one
              // pick a next candidate:
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.lookup.Scope

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.