Examples of ArrayDeclarationGoal


Examples of org.eclipse.php.internal.core.typeinference.goals.ArrayDeclarationGoal

        for (int i = 0; i < decls.length; ++i) {
          Declaration decl = decls[i];
          // TODO check ArrayCreation and its element type
          if (decl instanceof ArrayDeclaration) {
            ArrayDeclaration arrayDeclaration = (ArrayDeclaration) decl;
            subGoals.add(new ArrayDeclarationGoal(context,
                arrayDeclaration));
          } else if (decl.getNode() instanceof GlobalStatement) {
            mergeWithGlobalScope = true;
          } else {
            ASTNode declNode = decl.getNode();
View Full Code Here

Examples of org.eclipse.php.internal.core.typeinference.goals.ArrayDeclarationGoal

  public ArrayDeclarationGoalEvaluator(IGoal goal) {
    super(goal);
  }

  public IGoal[] init() {
    ArrayDeclarationGoal typedGoal = (ArrayDeclarationGoal) goal;

    List<IGoal> subGoals = new LinkedList<IGoal>();

    if ((typedGoal.getExpression().getNode() instanceof Assignment)) {

      if ((((Assignment) typedGoal.getExpression().getNode()).getValue() instanceof ArrayCreation)) {
        ArrayCreation arrayCreation = (ArrayCreation) ((Assignment) typedGoal
            .getExpression().getNode()).getValue();

        for (ArrayElement arrayElement : arrayCreation.getElements()) {
          subGoals.add(new ExpressionTypeGoal(typedGoal.getContext(),
              arrayElement.getValue()));
        }
        subGoals.toArray(new IGoal[subGoals.size()]);

        List<Declaration> decls = typedGoal.getExpression()
            .getDeclarations();

        IContext context = goal.getContext();
        for (int i = 0; i < decls.size(); ++i) {
          Declaration decl = decls.get(i);
          // TODO check ArrayCreation and its element type
          if (decl instanceof ArrayDeclaration) {
            ArrayDeclaration arrayDeclaration = (ArrayDeclaration) decl;
            subGoals.add(new ArrayDeclarationGoal(context,
                arrayDeclaration));
          } else {
            ASTNode declNode = decl.getNode();
            if (declNode instanceof ForEachStatement) {
              subGoals.add(new ForeachStatementGoal(context,
                  ((ForEachStatement) declNode)
                      .getExpression()));
            } else {
              subGoals.add(new ExpressionTypeGoal(context,
                  declNode));
            }
          }
        }

      } else if ((((Assignment) typedGoal.getExpression().getNode())
          .getValue() instanceof PHPCallExpression)) {
        // https://bugs.eclipse.org/bugs/show_bug.cgi?id=336995
        // TODO $form['path_redirect']['table'] =
        // path_redirect_list_redirects(array(), array('redirect' =>
        // 'node/' . $form['#node']->nid));
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.