Package com.google.dart.engine.internal.scope

Examples of com.google.dart.engine.internal.scope.Scope


   * @param identifier the identifier that might have been imported using a prefix
   * @return the element that was found
   */
  private Element findImportWithoutPrefix(SimpleIdentifier identifier) {
    Element element = null;
    Scope nameScope = resolver.getNameScope();
    for (ImportElement importElement : definingLibrary.getImports()) {
      PrefixElement prefixElement = importElement.getPrefix();
      if (prefixElement != null) {
        Identifier prefixedIdentifier = new SyntheticIdentifier(prefixElement.getName() + "."
            + identifier.getName());
        Element importedElement = nameScope.lookup(prefixedIdentifier, definingLibrary);
        if (importedElement != null) {
          if (element == null) {
            element = importedElement;
          } else {
            element = MultiplyDefinedElementImpl.fromElements(
View Full Code Here


   * Pushes a new {@link Scope} into the visitor.
   *
   * @return the new {@link Scope}.
   */
  public Scope pushNameScope() {
    Scope newScope = new EnclosedScope(nameScope);
    nameScope = newScope;
    return nameScope;
  }
View Full Code Here

    return nameScope;
  }

  @Override
  public Void visitBlock(Block node) {
    Scope outerScope = nameScope;
    try {
      EnclosedScope enclosedScope = new EnclosedScope(nameScope);
      hideNamesDefinedInBlock(enclosedScope, node);
      nameScope = enclosedScope;
      super.visitBlock(node);
View Full Code Here

  @Override
  public Void visitCatchClause(CatchClause node) {
    SimpleIdentifier exception = node.getExceptionParameter();
    if (exception != null) {
      Scope outerScope = nameScope;
      try {
        nameScope = new EnclosedScope(nameScope);
        nameScope.define(exception.getStaticElement());
        SimpleIdentifier stackTrace = node.getStackTraceParameter();
        if (stackTrace != null) {
View Full Code Here

  }

  @Override
  public Void visitClassDeclaration(ClassDeclaration node) {
    ClassElement classElement = node.getElement();
    Scope outerScope = nameScope;
    try {
      if (classElement == null) {
        AnalysisEngine.getInstance().getLogger().logInformation(
            "Missing element for class declaration " + node.getName().getName() + " in "
                + getDefiningLibrary().getSource().getFullName(),
View Full Code Here

    return null;
  }

  @Override
  public Void visitClassTypeAlias(ClassTypeAlias node) {
    Scope outerScope = nameScope;
    try {
      ClassElement element = node.getElement();
      nameScope = new ClassScope(new TypeParameterScope(nameScope, element), element);
      super.visitClassTypeAlias(node);
    } finally {
View Full Code Here

  }

  @Override
  public Void visitConstructorDeclaration(ConstructorDeclaration node) {
    ConstructorElement constructorElement = node.getElement();
    Scope outerScope = nameScope;
    try {
      if (constructorElement == null) {
        StringBuilder builder = new StringBuilder();
        builder.append("Missing element for constructor ");
        builder.append(node.getReturnType().getName());
View Full Code Here

    return null;
  }

  @Override
  public Void visitForEachStatement(ForEachStatement node) {
    Scope outerNameScope = nameScope;
    LabelScope outerLabelScope = labelScope;
    try {
      nameScope = new EnclosedScope(nameScope);
      labelScope = new LabelScope(outerLabelScope, false, false);
      visitForEachStatementInScope(node);
View Full Code Here

    return null;
  }

  @Override
  public Void visitForStatement(ForStatement node) {
    Scope outerNameScope = nameScope;
    LabelScope outerLabelScope = labelScope;
    try {
      nameScope = new EnclosedScope(nameScope);
      labelScope = new LabelScope(outerLabelScope, false, false);
      visitForStatementInScope(node);
View Full Code Here

  }

  @Override
  public Void visitFunctionDeclaration(FunctionDeclaration node) {
    ExecutableElement functionElement = node.getElement();
    Scope outerScope = nameScope;
    try {
      if (functionElement == null) {
        AnalysisEngine.getInstance().getLogger().logInformation(
            "Missing element for top-level function " + node.getName().getName() + " in "
                + getDefiningLibrary().getSource().getFullName(),
View Full Code Here

TOP

Related Classes of com.google.dart.engine.internal.scope.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.