Package com.google.dart.engine.context

Examples of com.google.dart.engine.context.AnalysisException


              } else if (directive instanceof PartDirective) {
                if (!referencedSource.equals(source)) {
                  includedSources.add(referencedSource);
                }
              } else {
                throw new AnalysisException(getClass().getSimpleName() + " failed to handle a "
                    + directive.getClass().getName());
              }
            }
          }
        }
View Full Code Here


        builder.append(classNode.getName().getName());
      }
      builder.append(" in ");
      builder.append(getSource().getFullName());
      builder.append(" was not set while trying to resolve types.");
      AnalysisEngine.getInstance().getLogger().logError(builder.toString(), new AnalysisException());
    } else {
      ClassElement definingClass = (ClassElement) element.getEnclosingElement();
      element.setReturnType(definingClass.getType());
      FunctionTypeImpl type = new FunctionTypeImpl(element);
      type.setTypeArguments(definingClass.getType().getTypeArguments());
View Full Code Here

      builder.append("The element for the top-level function ");
      builder.append(node.getName());
      builder.append(" in ");
      builder.append(getSource().getFullName());
      builder.append(" was not set while trying to resolve types.");
      AnalysisEngine.getInstance().getLogger().logError(builder.toString(), new AnalysisException());
    }
    element.setReturnType(computeReturnType(node.getReturnType()));
    FunctionTypeImpl type = new FunctionTypeImpl(element);
    ClassElement definingClass = element.getAncestor(ClassElement.class);
    if (definingClass != null) {
View Full Code Here

        builder.append(classNode.getName().getName());
      }
      builder.append(" in ");
      builder.append(getSource().getFullName());
      builder.append(" was not set while trying to resolve types.");
      AnalysisEngine.getInstance().getLogger().logError(builder.toString(), new AnalysisException());
    }
    element.setReturnType(computeReturnType(node.getReturnType()));
    FunctionTypeImpl type = new FunctionTypeImpl(element);
    ClassElement definingClass = element.getAncestor(ClassElement.class);
    if (definingClass != null) {
View Full Code Here

      //
      buildElementModels();
      instrumentation.metric("buildElementModels", "complete");
      LibraryElement coreElement = coreLibrary.getLibraryElement();
      if (coreElement == null) {
        throw new AnalysisException("Could not resolve dart:core");
      }
      buildDirectiveModels();
      instrumentation.metric("buildDirectiveModels", "complete");
      typeProvider = new TypeProviderImpl(coreElement);
      buildTypeHierarchies();
View Full Code Here

      //
      buildElementModels();
      instrumentation.metric("buildElementModels", "complete");
      LibraryElement coreElement = coreLibrary.getLibraryElement();
      if (coreElement == null) {
        throw new AnalysisException("Could not resolve dart:core");
      }
      buildDirectiveModels();
      instrumentation.metric("buildDirectiveModels", "complete");
      typeProvider = new TypeProviderImpl(coreElement);
      buildEnumMembers();
View Full Code Here

   */
  public void resolve(AstNode node) throws AnalysisException {
    AstNode rootNode = findResolutionRoot(node);
    Scope scope = ScopeBuilder.scopeFor(rootNode, errorListener);
    if (elementModelChanged(rootNode.getParent())) {
      throw new AnalysisException("Cannot resolve node: element model changed");
    }
    resolveTypes(node, scope);
    resolveVariables(node, scope);
    resolveReferences(node, scope);
  }
View Full Code Here

   * @throws AnalysisException if the correctness of the element model cannot be determined
   */
  private boolean elementModelChanged(AstNode node) throws AnalysisException {
    Element element = getElement(node);
    if (element == null) {
      throw new AnalysisException("Cannot resolve node: a " + node.getClass().getSimpleName()
          + " does not define an element");
    }
    DeclarationMatcher matcher = new DeclarationMatcher();
    return !matcher.matches(node, element);
  }
View Full Code Here

    while (parent != null && !canBeResolved(parent)) {
      result = parent;
      parent = result.getParent();
    }
    if (parent == null) {
      throw new AnalysisException("Cannot resolve node: no resolvable node");
    }
    return result;
  }
View Full Code Here

      }
      instrumentation.data("coreLibraryPath", coreLibrarySource.getFullName());
    } finally {
      instrumentation.log();
    }
    throw new AnalysisException("Could not resolve dart:core");
  }
View Full Code Here

TOP

Related Classes of com.google.dart.engine.context.AnalysisException

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.