Package com.google.dart.engine.element

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


   * @return the elements associated with the parameters
   */
  private ParameterElement[] getElements(FormalParameterList parameterList) {
    ArrayList<ParameterElement> elements = new ArrayList<ParameterElement>();
    for (FormalParameter parameter : parameterList.getParameters()) {
      ParameterElement element = (ParameterElement) parameter.getIdentifier().getStaticElement();
      // TODO(brianwilkerson) Understand why the element would be null.
      if (element != null) {
        elements.add(element);
      }
    }
View Full Code Here


  }

  @Override
  public Void visitDefaultFormalParameter(DefaultFormalParameter node) {
    SimpleIdentifier parameterName = node.getParameter().getIdentifier();
    ParameterElement element = getElementForParameter(node, parameterName);
    Expression defaultValue = node.getDefaultValue();
    if (defaultValue != null) {
      ExecutableElement outerExecutable = enclosingExecutable;
      try {
        if (element == null) {
          // TODO(brianwilkerson) Report this internal error.
        } else {
          enclosingExecutable = element.getInitializer();
        }
        defaultValue.accept(this);
      } finally {
        enclosingExecutable = outerExecutable;
      }
    }
    ParameterElement outerParameter = enclosingParameter;
    try {
      enclosingParameter = element;
      return super.visitDefaultFormalParameter(node);
    } finally {
      enclosingParameter = outerParameter;
View Full Code Here

  @Override
  public Void visitFieldFormalParameter(FieldFormalParameter node) {
    if (!(node.getParent() instanceof DefaultFormalParameter)) {
      SimpleIdentifier parameterName = node.getIdentifier();
      ParameterElement element = getElementForParameter(node, parameterName);
      ParameterElement outerParameter = enclosingParameter;
      try {
        enclosingParameter = element;
        return super.visitFieldFormalParameter(node);
      } finally {
        enclosingParameter = outerParameter;
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;
        return super.visitFunctionTypedFormalParameter(node);
      } finally {
        enclosingParameter = outerParameter;
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;
        return super.visitSimpleFormalParameter(node);
      } finally {
        enclosingParameter = outerParameter;
View Full Code Here

      parameters = enclosingExecutable.getParameters();
    }
    if (parameters == null && enclosingAlias != null) {
      parameters = enclosingAlias.getParameters();
    }
    ParameterElement element = parameters == null ? null
        : findIdentifier(parameters, parameterName);
    if (element == null) {
      @SuppressWarnings("resource")
      PrintStringWriter writer = new PrintStringWriter();
      writer.println("Invalid state found in the Analysis Engine:");
View Full Code Here

TOP

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

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.