Package com.google.dart.engine.element

Examples of com.google.dart.engine.element.Element


    }
  }

  @Override
  public Void visitFunctionDeclaration(FunctionDeclaration node) {
    Element element = node.getElement();
    recordElementDefinition(element, IndexConstants.DEFINES_FUNCTION);
    enterScope(element);
    try {
      return super.visitFunctionDeclaration(node);
    } finally {
View Full Code Here


    }
  }

  @Override
  public Void visitFunctionTypeAlias(FunctionTypeAlias node) {
    Element element = node.getElement();
    recordElementDefinition(element, IndexConstants.DEFINES_FUNCTION_TYPE);
    return super.visitFunctionTypeAlias(node);
  }
View Full Code Here

  }

  @Override
  public Void visitMethodInvocation(MethodInvocation node) {
    SimpleIdentifier name = node.getMethodName();
    Element element = name.getBestElement();
    if (element instanceof MethodElement || element instanceof PropertyAccessorElement) {
      Location location = createLocationFromNode(name);
      Relationship relationship;
      if (node.getTarget() != null) {
        relationship = IndexConstants.IS_INVOKED_BY_QUALIFIED;
      } else {
        relationship = IndexConstants.IS_INVOKED_BY_UNQUALIFIED;
      }
      recordRelationship(element, relationship, location);
    }
    if (element instanceof FunctionElement || element instanceof VariableElement) {
      Location location = createLocationFromNode(name);
      recordRelationship(element, IndexConstants.IS_INVOKED_BY, location);
    }
    // name invocation
    {
      Element nameElement = new NameElementImpl(name.getName());
      Location location = createLocationFromNode(name);
      Relationship kind = element != null ? IndexConstants.NAME_IS_INVOKED_BY_RESOLVED
          : IndexConstants.NAME_IS_INVOKED_BY_UNRESOLVED;
      store.recordRelationship(nameElement, kind, location);
    }
View Full Code Here

    }
  }

  @Override
  protected Element internalLookup(Identifier identifier, String name, LibraryElement referencingLibrary) {
    Element element = localLookup(name, referencingLibrary);
    if (element != null) {
      return element;
    }
    // May be there is a hidden Element.
    if (hasHiddenName) {
      Element hiddenElement = hiddenElements.get(name);
      if (hiddenElement != null) {
        getErrorListener().onError(
            new AnalysisError(
                getSource(identifier),
                identifier.getOffset(),
View Full Code Here

    return super.visitMethodInvocation(node);
  }

  @Override
  public Void visitPartDirective(PartDirective node) {
    Element element = node.getElement();
    Location location = createLocationFromNode(node.getUri());
    recordRelationship(element, IndexConstants.IS_REFERENCED_BY, location);
    return super.visitPartDirective(node);
  }
View Full Code Here

    return super.visitPrefixExpression(node);
  }

  @Override
  public Void visitSimpleIdentifier(SimpleIdentifier node) {
    Element nameElement = new NameElementImpl(node.getName());
    Location location = createLocationFromNode(node);
    // name in declaration
    if (node.inDeclarationContext()) {
      recordRelationship(nameElement, IndexConstants.IS_DEFINED_BY, location);
      return null;
    }
    // prepare information
    Element element = node.getBestElement();
    // qualified name reference
    recordQualifiedMemberReference(node, element, nameElement, location);
    // stop if already handled
    if (isAlreadyHandledName(node)) {
      return null;
View Full Code Here

  @Override
  public Void visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
    VariableDeclarationList variables = node.getVariables();
    for (VariableDeclaration variableDeclaration : variables.getVariables()) {
      Element element = variableDeclaration.getElement();
      recordElementDefinition(element, IndexConstants.DEFINES_VARIABLE);
    }
    return super.visitTopLevelVariableDeclaration(node);
  }
View Full Code Here

   * @param length the length of the location
   * @return the {@link Location} representing the given offset and length within the inner-most
   *         {@link Element}.
   */
  private Location createLocationFromOffset(int offset, int length) {
    Element element = peekElement();
    return new Location(element, offset, length);
  }
View Full Code Here

      return;
    }
    if (isIdentifierInPrefixedIdentifier(node)) {
      return;
    }
    Element element = node.getStaticElement();
    ImportElement importElement = internalGetImportElement(
        libraryElement,
        null,
        element,
        importElementsMap);
View Full Code Here

        name = "-";
      }
      if (StringUtilities.endsWithChar(name, '=') && !name.equals("==")) {
        name = name.substring(0, name.length() - 1);
      }
      Element nameElement = new NameElementImpl(name);
      Relationship relationship = element != null
          ? IndexConstants.IS_REFERENCED_BY_QUALIFIED_RESOLVED
          : IndexConstants.IS_REFERENCED_BY_QUALIFIED_UNRESOLVED;
      recordRelationship(nameElement, relationship, location);
    }
View Full Code Here

TOP

Related Classes of com.google.dart.engine.element.Element

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.