Package com.google.dart.engine.ast

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


    return false;
  }

  @Override
  public Boolean visitIfStatement(IfStatement node) {
    Expression conditionExpression = node.getCondition();
    Statement thenStatement = node.getThenStatement();
    Statement elseStatement = node.getElseStatement();
    if (nodeExits(conditionExpression)) {
      return true;
    }
View Full Code Here


    return nodeExits(thenStatement) && nodeExits(elseStatement);
  }

  @Override
  public Boolean visitIndexExpression(IndexExpression node) {
    Expression target = node.getRealTarget();
    if (nodeExits(target)) {
      return true;
    }
    if (nodeExits(node.getIndex())) {
      return true;
View Full Code Here

    return false;
  }

  @Override
  public Boolean visitMethodInvocation(MethodInvocation node) {
    Expression target = node.getRealTarget();
    if (target != null && target.accept(this)) {
      return true;
    }
    return nodeExits(node.getArgumentList());
  }
View Full Code Here

    return false;
  }

  @Override
  public Boolean visitPropertyAccess(PropertyAccess node) {
    Expression target = node.getRealTarget();
    if (target != null && target.accept(this)) {
      return true;
    }
    return false;
  }
View Full Code Here

    return false;
  }

  @Override
  public Boolean visitVariableDeclaration(VariableDeclaration node) {
    Expression initializer = node.getInitializer();
    if (initializer != null) {
      return initializer.accept(this);
    }
    return false;
  }
View Full Code Here

  @Override
  public Boolean visitWhileStatement(WhileStatement node) {
    boolean outerBreakValue = enclosingBlockContainsBreak;
    enclosingBlockContainsBreak = false;
    try {
      Expression conditionExpression = node.getCondition();
      if (conditionExpression.accept(this)) {
        return true;
      }
      // TODO(jwren) Do we want to take all constant expressions into account?
      if (conditionExpression instanceof BooleanLiteral) {
        BooleanLiteral booleanLiteral = (BooleanLiteral) conditionExpression;
View Full Code Here

  }

  private void parseCustomTag() {
    List<Expression> arguments = annotation.getArguments().getArguments();
    if (arguments.size() == 1) {
      Expression nameExpression = arguments.get(0);
      if (nameExpression instanceof SimpleStringLiteral) {
        SimpleStringLiteral nameLiteral = (SimpleStringLiteral) nameExpression;
        String name = nameLiteral.getValue();
        int nameOffset = nameLiteral.getValueOffset();
        PolymerTagDartElementImpl element = new PolymerTagDartElementImpl(
View Full Code Here

  }

  @Override
  public void apply(AngularHtmlUnitResolver resolver, XmlTagNode node) {
    XmlAttributeNode attribute = node.getAttribute(NG_MODEL);
    Expression expression = parseDartExpression(resolver, attribute);
    // identifiers have been already handled by "apply top"
    if (expression instanceof SimpleIdentifier) {
      return;
    }
    // resolve
View Full Code Here

   * This method is used to define top-level {@link VariableElement}s for each "ng-model" with
   * simple identifier model.
   */
  void applyTopDeclarations(AngularHtmlUnitResolver resolver, XmlTagNode node) {
    XmlAttributeNode attribute = node.getAttribute(NG_MODEL);
    Expression expression = parseDartExpression(resolver, attribute);
    // if not identifier, then not a top-level model, delay until "apply"
    if (!(expression instanceof SimpleIdentifier)) {
      return;
    }
    SimpleIdentifier identifier = (SimpleIdentifier) expression;
View Full Code Here

  }

  @Override
  public Void visitVariableDeclaration(VariableDeclaration node) {
    super.visitVariableDeclaration(node);
    Expression initializer = node.getInitializer();
    if (initializer != null && node.isConst()) {
      VariableElement element = node.getElement();
      if (element != null) {
        variableMap.put(element, node);
      }
View Full Code Here

TOP

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

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.