Package com.google.dart.engine.ast

Examples of com.google.dart.engine.ast.SimpleIdentifier


  @Override
  public Void visitFunctionTypeAlias(FunctionTypeAlias node) {
    FunctionTypeAliasElement outerAlias = enclosingAlias;
    try {
      SimpleIdentifier aliasName = node.getName();
      enclosingAlias = findIdentifier(enclosingUnit.getFunctionTypeAliases(), aliasName);
      processElement(enclosingAlias);
      return super.visitFunctionTypeAlias(node);
    } finally {
      enclosingAlias = outerAlias;
View Full Code Here


  }

  @Override
  public Void visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
    if (!(node.getParent() instanceof DefaultFormalParameter)) {
      SimpleIdentifier parameterName = node.getIdentifier();
      ParameterElement element = getElementForParameter(node, parameterName);
      ParameterElement outerParameter = enclosingParameter;
      try {
        enclosingParameter = element;
        processElement(enclosingParameter);
View Full Code Here

  }

  @Override
  public Void visitLabeledStatement(LabeledStatement node) {
    for (Label label : node.getLabels()) {
      SimpleIdentifier labelName = label.getLabel();
      LabelElement element = findIdentifier(enclosingExecutable.getLabels(), labelName);
      processElement(element);
    }
    return super.visitLabeledStatement(node);
  }
View Full Code Here

  @Override
  public Void visitMethodDeclaration(MethodDeclaration node) {
    ExecutableElement outerExecutable = enclosingExecutable;
    try {
      Token property = node.getPropertyKeyword();
      SimpleIdentifier methodName = node.getName();
      String nameOfMethod = methodName.getName();
      if (nameOfMethod.equals(TokenType.MINUS.getLexeme())
          && node.getParameters().getParameters().size() == 0) {
        nameOfMethod = "unary-";
      }
      if (property == null) {
        enclosingExecutable = findWithNameAndOffset(
            enclosingClass.getMethods(),
            nameOfMethod,
            methodName.getOffset());
        methodName.setStaticElement(enclosingExecutable);
      } else {
        PropertyAccessorElement accessor = findIdentifier(enclosingClass.getAccessors(), methodName);
        if (((KeywordToken) property).getKeyword() == Keyword.SET) {
          accessor = accessor.getVariable().getSetter();
          methodName.setStaticElement(accessor);
        }
        enclosingExecutable = accessor;
      }
      processElement(enclosingExecutable);
      return super.visitMethodDeclaration(node);
View Full Code Here

  }

  @Override
  public Void visitSimpleFormalParameter(SimpleFormalParameter node) {
    if (!(node.getParent() instanceof DefaultFormalParameter)) {
      SimpleIdentifier parameterName = node.getIdentifier();
      ParameterElement element = getElementForParameter(node, parameterName);
      ParameterElement outerParameter = enclosingParameter;
      try {
        enclosingParameter = element;
        processElement(enclosingParameter);
View Full Code Here

  }

  @Override
  public Void visitSwitchCase(SwitchCase node) {
    for (Label label : node.getLabels()) {
      SimpleIdentifier labelName = label.getLabel();
      LabelElement element = findIdentifier(enclosingExecutable.getLabels(), labelName);
      processElement(element);
    }
    return super.visitSwitchCase(node);
  }
View Full Code Here

  }

  @Override
  public Void visitSwitchDefault(SwitchDefault node) {
    for (Label label : node.getLabels()) {
      SimpleIdentifier labelName = label.getLabel();
      LabelElement element = findIdentifier(enclosingExecutable.getLabels(), labelName);
      processElement(element);
    }
    return super.visitSwitchDefault(node);
  }
View Full Code Here

    return super.visitSwitchDefault(node);
  }

  @Override
  public Void visitTypeParameter(TypeParameter node) {
    SimpleIdentifier parameterName = node.getName();
    TypeParameterElement element = null;
    if (enclosingClass != null) {
      element = findIdentifier(enclosingClass.getTypeParameters(), parameterName);
    } else if (enclosingAlias != null) {
      element = findIdentifier(enclosingAlias.getTypeParameters(), parameterName);
View Full Code Here

  }

  @Override
  public Void visitVariableDeclaration(VariableDeclaration node) {
    VariableElement element = null;
    SimpleIdentifier variableName = node.getName();
    if (enclosingExecutable != null) {
      element = findIdentifier(enclosingExecutable.getLocalVariables(), variableName);
    }
    if (element == null && enclosingClass != null) {
      element = findIdentifier(enclosingClass.getFields(), variableName);
View Full Code Here

    return null;
  }

  @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) {
          nameScope.define(stackTrace.getStaticElement());
        }
        super.visitCatchClause(node);
      } finally {
        nameScope = outerScope;
      }
View Full Code Here

TOP

Related Classes of com.google.dart.engine.ast.SimpleIdentifier

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.