Package com.google.dart.engine.ast

Examples of com.google.dart.engine.ast.Expression.accept()


      return true;
    }
    if (thenStatement == null || elseStatement == null) {
      return false;
    }
    return thenStatement.accept(this) && elseStatement.accept(this);
  }

  @Override
  public Boolean visitContinueStatement(ContinueStatement node) {
    return false;
View Full Code Here


  }

  @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

  }

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

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

  @Override
View Full Code Here

  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

            ReferenceFinder parameterReferenceFinder = new ReferenceFinder(
                parameter,
                referenceGraph,
                variableDeclarationMap,
                constructorDeclarationMap);
            defaultValue.accept(parameterReferenceFinder);
          }
        }
      }
    }
    for (InstanceCreationExpression expression : constructorInvocations) {
View Full Code Here

      if (constNode instanceof DefaultFormalParameter) {
        DefaultFormalParameter parameter = ((DefaultFormalParameter) constNode);
        ParameterElement element = parameter.getElement();
        Expression defaultValue = parameter.getDefaultValue();
        if (defaultValue != null) {
          EvaluationResultImpl result = defaultValue.accept(createConstantVisitor());
          ((ParameterElementImpl) element).setEvaluationResult(result);
        }
      }
    } else {
      // Should not happen.
View Full Code Here

    NodeList<Expression> superArguments = null;
    for (ConstructorInitializer initializer : initializers) {
      if (initializer instanceof ConstructorFieldInitializer) {
        ConstructorFieldInitializer constructorFieldInitializer = (ConstructorFieldInitializer) initializer;
        Expression initializerExpression = constructorFieldInitializer.getExpression();
        EvaluationResultImpl evaluationResult = initializerExpression.accept(initializerVisitor);
        if (evaluationResult instanceof ValidResult) {
          DartObjectImpl value = ((ValidResult) evaluationResult).getValue();
          String fieldName = constructorFieldInitializer.getFieldName().getName();
          fieldMap.put(fieldName, value);
        }
View Full Code Here

  }

  @Override
  public EvaluationResultImpl visitConditionalExpression(ConditionalExpression node) {
    Expression condition = node.getCondition();
    EvaluationResultImpl conditionResult = condition.accept(this);
    EvaluationResultImpl thenResult = node.getThenExpression().accept(this);
    EvaluationResultImpl elseResult = node.getElseExpression().accept(this);
    if (conditionResult instanceof ErrorResult) {
      return union(union((ErrorResult) conditionResult, thenResult), elseResult);
    } else if (!((ValidResult) conditionResult).isBool()) {
View Full Code Here

        FieldDeclaration fieldDeclaration = (FieldDeclaration) member;
        if (!fieldDeclaration.isStatic()) {
          for (VariableDeclaration variableDeclaration : fieldDeclaration.getFields().getVariables()) {
            Expression initializer = variableDeclaration.getInitializer();
            if (initializer != null) {
              EvaluationResultImpl result = initializer.accept(new ConstantVisitor(typeProvider));
              if (!(result instanceof ValidResult)) {
                errorReporter.reportErrorForNode(
                    CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST,
                    errorSite,
                    variableDeclaration.getName().getName());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.