Package com.google.dart.engine.ast

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


      HashMap<PrefixElement, ArrayList<ImportDirective>> prefixToDirectivesMap = new HashMap<PrefixElement, ArrayList<ImportDirective>>();
      for (int i = 0; i < count; i++) {
        Directive directive = directives.get(i);
        if (directive instanceof ImportDirective) {
          ImportDirective importDirective = (ImportDirective) directive;
          SimpleIdentifier prefix = importDirective.getPrefix();
          if (prefix != null) {
            Element element = prefix.getStaticElement();
            if (element instanceof PrefixElement) {
              PrefixElement prefixElement = (PrefixElement) element;
              ArrayList<ImportDirective> elements = prefixToDirectivesMap.get(prefixElement);
              if (elements == null) {
                elements = new ArrayList<ImportDirective>();
View Full Code Here


      }
    }
    // prepare class name
    Identifier className = typeName.getName();
    // report as named or default constructor absence
    SimpleIdentifier name = constructorName.getName();
    if (name != null) {
      errorReporter.reportErrorForNode(
          StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR,
          name,
          className,
View Full Code Here

   * @return {@code true} if and only if an error code is generated on the passed node
   * @see StaticWarningCode#NON_VOID_RETURN_FOR_OPERATOR
   */
  private boolean checkForNonVoidReturnTypeForOperator(MethodDeclaration node) {
    // check that []= operator
    SimpleIdentifier name = node.getName();
    if (!name.getName().equals("[]=")) {
      return false;
    }
    // check return type
    TypeName typeName = node.getReturnType();
    if (typeName != null) {
View Full Code Here

    // should be named parameter
    if (node.getKind() != ParameterKind.NAMED) {
      return false;
    }
    // name should start with '_'
    SimpleIdentifier name = node.getIdentifier();
    if (name.isSynthetic() || !StringUtilities.startsWithChar(name.getName(), '_')) {
      return false;
    }
    // report problem
    errorReporter.reportErrorForNode(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, node);
    return true;
View Full Code Here

      if (!superUnnamedConstructor.isDefaultConstructor()) {
        int offset;
        int length;
        {
          Identifier returnType = node.getReturnType();
          SimpleIdentifier name = node.getName();
          offset = returnType.getOffset();
          length = (name != null ? name.getEnd() : returnType.getEnd()) - offset;
        }
        errorReporter.reportErrorForOffset(
            CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT,
            offset,
            length,
View Full Code Here

    if (parameterList == null) {
      return false;
    }
    int numParameters = parameterList.getParameters().size();
    // prepare operator name
    SimpleIdentifier nameNode = node.getName();
    if (nameNode == null) {
      return false;
    }
    String name = nameNode.getName();
    // check for exact number of parameters
    int expected = -1;
    if ("[]=".equals(name)) {
      expected = 2;
    } else if ("<".equals(name) || ">".equals(name) || "<=".equals(name) || ">=".equals(name)
View Full Code Here

    return null;
  }

  @Override
  public Void visitBreakStatement(BreakStatement node) {
    SimpleIdentifier labelNode = node.getLabel();
    if (labelNode != null) {
      Element labelElement = labelNode.getStaticElement();
      if (labelElement instanceof LabelElementImpl
          && ((LabelElementImpl) labelElement).isOnSwitchMember()) {
        errorReporter.reportErrorForNode(ResolverErrorCode.BREAK_LABEL_ON_SWITCH_MEMBER, labelNode);
      }
    }
View Full Code Here

  @Override
  public Void visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
    isInConstructorInitializer = true;
    try {
      SimpleIdentifier fieldName = node.getFieldName();
      Element staticElement = fieldName.getStaticElement();
      checkForInvalidField(node, fieldName, staticElement);
      checkForFieldInitializerNotAssignable(node, staticElement);
      return super.visitConstructorFieldInitializer(node);
    } finally {
      isInConstructorInitializer = false;
View Full Code Here

    }
  }

  @Override
  public Void visitContinueStatement(ContinueStatement node) {
    SimpleIdentifier labelNode = node.getLabel();
    if (labelNode != null) {
      Element labelElement = labelNode.getStaticElement();
      if (labelElement instanceof LabelElementImpl
          && ((LabelElementImpl) labelElement).isOnSwitchStatement()) {
        errorReporter.reportErrorForNode(ResolverErrorCode.CONTINUE_LABEL_ON_SWITCH, labelNode);
      }
    }
View Full Code Here

  @Override
  public Void visitFunctionDeclaration(FunctionDeclaration node) {
    ExecutableElement outerFunction = enclosingFunction;
    try {
      SimpleIdentifier identifier = node.getName();
      String methodName = "";
      if (identifier != null) {
        methodName = identifier.getName();
      }

      enclosingFunction = node.getElement();
      TypeName returnType = node.getReturnType();
      if (node.isSetter() || node.isGetter()) {
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.