Examples of ArrayCreation


Examples of org.eclipse.php.internal.core.ast.nodes.ArrayCreation

    String expected = "<?php array (0, 1, 3) ?>";
    parseAndCompare(str, expected, new ICodeManiplator() {
      public void manipulate(Program program) {
        ExpressionStatement statement = (ExpressionStatement) program
            .statements().get(0);
        ArrayCreation expression = (ArrayCreation) statement
            .getExpression();
        /* ArrayElement arrayElement = */expression.elements()
            .remove(2);
      }
    });
  }
 
View Full Code Here

Examples of org.eclipse.php.internal.core.ast.nodes.ArrayCreation

    String expected = "<?php array('Dafna'=>'Dodidu');?>";
    parseAndCompare(str, expected, new ICodeManiplator() {
      public void manipulate(Program program) {
        ExpressionStatement statement = (ExpressionStatement) program
            .statements().get(0);
        ArrayCreation expression = (ArrayCreation) statement
            .getExpression();
        /* ArrayElement arrayElement = */expression.elements()
            .remove(0);
      }
    });
  }
 
View Full Code Here

Examples of org.eclipse.php.internal.core.compiler.ast.nodes.ArrayCreation

                VariableReference reference = (VariableReference) ((InfixExpression) element.getValue()).getLeft();
                extractPsr0(namespace, path, reference);
                return false;
            } else if(element.getValue() instanceof ArrayCreation) {
                Scalar namespace = (Scalar) element.getKey();
                ArrayCreation paths = (ArrayCreation) element.getValue();
                for (ArrayElement elem  : paths.getElements()) {
                  if (elem.getValue() instanceof InfixExpression) {
                    Scalar path = (Scalar) ((InfixExpression) elem.getValue()).getRight();
                        VariableReference reference = (VariableReference) ((InfixExpression) elem.getValue()).getLeft();
                        extractPsr0(namespace, path, reference);
                  }
View Full Code Here

Examples of org.eclipse.php.internal.core.compiler.ast.nodes.ArrayCreation

    super(goal);
  }

  public IGoal[] init() {
    ExpressionTypeGoal typedGoal = (ExpressionTypeGoal) goal;
    ArrayCreation arrayCreation = (ArrayCreation) typedGoal.getExpression();

    List<IGoal> subGoals = new LinkedList<IGoal>();
    for (ArrayElement arrayElement : arrayCreation.getElements()) {
      subGoals.add(new ExpressionTypeGoal(typedGoal.getContext(),
          arrayElement.getValue()));
    }
    return subGoals.toArray(new IGoal[subGoals.size()]);
  }
View Full Code Here

Examples of org.eclipse.php.internal.core.compiler.ast.nodes.ArrayCreation

     
    List<ASTNode> nodes = call.getArgs().getChilds();
   
    if (nodes.size() == 1 && nodes.get(0) instanceof ArrayCreation) {
     
      ArrayCreation array = (ArrayCreation) nodes.get(0);     
      List<ASTNode> args = array.getChilds();
     
      for (ASTNode node : args) {       
        if (node instanceof ArrayCreation) {         
          for (Object subNode : ((ArrayCreation) node).getChilds()) {
           
View Full Code Here

Examples of org.eclipse.php.internal.core.compiler.ast.nodes.ArrayCreation

            if (list.getChilds().get(0) instanceof Scalar && list.getChilds().get(1) instanceof ArrayCreation) {

                Scalar scalar = (Scalar) list.getChilds().get(0);
                String viewPath = StringUtils.stripQuotes(scalar.getValue());
                ArrayCreation params = (ArrayCreation) list.getChilds().get(1);
                parseVariablesFromArray(params, viewPath);

            }
        }
View Full Code Here

Examples of org.eclipse.php.internal.core.compiler.ast.nodes.ArrayCreation

                    }

                    if (viewPath != null ) {

                        ArrayCreation array = (ArrayCreation) statement.getExpr();
                        parseVariablesFromArray(array, viewPath);
                    }
                }

            // a render call:
View Full Code Here

Examples of org.eclipse.php.internal.core.compiler.ast.nodes.ArrayCreation

                                statements.add(scalar.getValue().replaceAll(
                                        "['\"]", ""));

                            } else if (arg instanceof ArrayCreation) {

                                ArrayCreation array = (ArrayCreation) arg;

                                for (ArrayElement key : array.getElements()) {

                                    Expression value = key.getValue();

                                    if (value != null
                                            && value instanceof Scalar) {
View Full Code Here

Examples of org.netbeans.modules.php.editor.parser.astnodes.ArrayCreation

            } else {
                return;
            }

            if (expression instanceof ArrayCreation) {
                ArrayCreation array = (ArrayCreation) expression;
                List<ArrayElement> elements = array.getElements();
                for (ArrayElement element : elements) {
                    Expression key = element.getKey();
                    if (!(key instanceof Scalar)) {
                        continue;
                    }
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.