Package com.google.dart.engine.ast

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


   * If given {@link Annotation} has one argument and it is {@link SimpleStringLiteral}, returns it,
   * otherwise returns {@code null}.
   */
  private static SimpleStringLiteral getOnlySimpleStringLiteralArgument(Annotation annotation) {
    SimpleStringLiteral nameLiteral = null;
    ArgumentList argsNode = annotation.getArguments();
    if (argsNode != null) {
      NodeList<Expression> args = argsNode.getArguments();
      if (args.size() == 1) {
        Expression arg = args.get(0);
        if (arg instanceof SimpleStringLiteral) {
          nameLiteral = (SimpleStringLiteral) arg;
        }
View Full Code Here


            CompileTimeErrorCode.NON_CONSTANT_ANNOTATION_CONSTRUCTOR,
            node);
        return null;
      }
      // should have arguments
      ArgumentList argumentList = node.getArguments();
      if (argumentList == null) {
        errorReporter.reportErrorForNode(
            CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS,
            node);
        return null;
View Full Code Here

   */
  private void validateInstanceCreationArguments(InstanceCreationExpression node) {
    if (!node.isConst()) {
      return;
    }
    ArgumentList argumentList = node.getArgumentList();
    if (argumentList == null) {
      return;
    }
    validateConstantArguments(argumentList);
  }
View Full Code Here

    // TODO(brianwilkerson) Can we ever resolve the function being invoked?
    Expression expression = node.getFunction();
    if (expression instanceof FunctionExpression) {
      FunctionExpression functionExpression = (FunctionExpression) expression;
      ExecutableElement functionElement = functionExpression.getElement();
      ArgumentList argumentList = node.getArgumentList();
      ParameterElement[] parameters = resolveArgumentsToFunction(
          false,
          argumentList,
          functionElement);
      if (parameters != null) {
        argumentList.setCorrespondingStaticParameters(parameters);
      }
    }
    return null;
  }
View Full Code Here

  @Override
  public Void visitInstanceCreationExpression(InstanceCreationExpression node) {
    ConstructorElement invokedConstructor = node.getConstructorName().getStaticElement();
    node.setStaticElement(invokedConstructor);
    ArgumentList argumentList = node.getArgumentList();
    ParameterElement[] parameters = resolveArgumentsToFunction(
        node.isConst(),
        argumentList,
        invokedConstructor);
    if (parameters != null) {
      argumentList.setCorrespondingStaticParameters(parameters);
    }
    return null;
  }
View Full Code Here

    //
    // Record the results.
    //
    methodName.setStaticElement(staticElement);
    methodName.setPropagatedElement(propagatedElement);
    ArgumentList argumentList = node.getArgumentList();
    if (staticElement != null) {
      ParameterElement[] parameters = computeCorrespondingParameters(argumentList, staticElement);
      if (parameters != null) {
        argumentList.setCorrespondingStaticParameters(parameters);
      }
    }
    if (propagatedElement != null) {
      ParameterElement[] parameters = computeCorrespondingParameters(
          argumentList,
          propagatedElement);
      if (parameters != null) {
        argumentList.setCorrespondingPropagatedParameters(parameters);
      }
    }
    //
    // Then check for error conditions.
    //
View Full Code Here

    }
    if (name != null) {
      name.setStaticElement(element);
    }
    node.setStaticElement(element);
    ArgumentList argumentList = node.getArgumentList();
    ParameterElement[] parameters = resolveArgumentsToFunction(false, argumentList, element);
    if (parameters != null) {
      argumentList.setCorrespondingStaticParameters(parameters);
    }
    return null;
  }
View Full Code Here

    }
    if (name != null) {
      name.setStaticElement(element);
    }
    node.setStaticElement(element);
    ArgumentList argumentList = node.getArgumentList();
    ParameterElement[] parameters = resolveArgumentsToFunction(
        isInConstConstructor(),
        argumentList,
        element);
    if (parameters != null) {
      argumentList.setCorrespondingStaticParameters(parameters);
    }
    return null;
  }
View Full Code Here

    }
  }

  private void resolveAnnotationConstructorInvocationArguments(Annotation annotation,
      ConstructorElement constructor) {
    ArgumentList argumentList = annotation.getArguments();
    // error will be reported in ConstantVerifier
    if (argumentList == null) {
      return;
    }
    // resolve arguments to parameters
    ParameterElement[] parameters = resolveArgumentsToFunction(true, argumentList, constructor);
    if (parameters != null) {
      argumentList.setCorrespondingStaticParameters(parameters);
    }
  }
View Full Code Here

TOP

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

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.