/* Generated By:JJTree: Do not edit this line. ASTForeachStatement.java */

package org.apache.commons.jexl.parser;

public class ASTForeachStatement extends SimpleNode {
  public ASTForeachStatement(int id) {
    super(id);
  }

  public ASTForeachStatement(Parser p, int id) {
    super(p, id);
  }


  /** Accept the visitor. **/
  public Object jjtAccept(ParserVisitor visitor, Object data) {
    return visitor.visit(this, data);
  }
}

@@ -114,62 +114,441 @@
 r;%0A%0A
-public class ASTForeachStatement extends SimpleNode %7B%0A
+import java.util.Iterator;%0A%0Aimport org.apache.commons.jexl.JexlContext;%0Aimport org.apache.commons.jexl.util.Introspector;%0Aimport org.apache.commons.jexl.util.introspection.Info;%0A%0A/**%0A * ForEach statement.%0A * Syntax:%0A *      foreach (var in iterable) Statement()%0A * @author Dion Gillard%0A *%0A */%0Apublic class ASTForeachStatement extends SimpleNode %7B%0A    /** dummy velocity info */%0A    private static Info DUMMY = new Info(%22%22, 1, 1);%0A%0A  
   pu
@@ -582,24 +582,28 @@
 t id) %7B%0A    
+   
+ 
 super(id);%0A 
@@ -601,21 +601,25 @@
 er(id);%0A
+  
   %7D%0A%0A
+  
   public
@@ -659,24 +659,28 @@
 t id) %7B%0A    
+ 
+   
 super(p, id)
@@ -685,14 +685,18 @@
 d);%0A
+  
   %7D%0A%0A%0A
+  
   /*
@@ -721,16 +721,18 @@
 or. **/%0A
+  
   public
@@ -791,16 +791,20 @@
 ) %7B%0A    
+   
+ 
 return v
@@ -829,14 +829,1210 @@
  data);%0A
+    %7D%0A  %0A    public Object value(JexlContext jc) throws Exception %7B%0A        Object result = null;%0A        /* first child is the loop variable */%0A        ASTReference loopVariable = (ASTReference) jjtGetChild(0); %0A        /* second child is the variable to iterate */%0A        SimpleNode iterable = (SimpleNode) jjtGetChild(1);%0A        Object iterableValue = iterable.value(jc);%0A        // make sure there is a value to iterate on and a statement to execute%0A        if (iterableValue != null && jjtGetNumChildren() %3E= 3) %7B%0A            /* third child is the statement to execute */%0A            SimpleNode statement = (SimpleNode) jjtGetChild(2);%0A            // get an iterator for the collection/array etc via the introspector.%0A            Iterator itemsIterator = Introspector.getUberspect().getIterator(iterableValue, DUMMY);%0A            while (itemsIterator.hasNext())%0A            %7B%0A                // set loopVariable to value of iterator%0A                Object value = itemsIterator.next();%0A                jc.getVars().put(loopVariable.getRootString(), value);%0A                // execute statement%0A                result = statement.value(jc);%0A            %7D%0A        %7D%0A        return result;%0A  
   %7D%0A%7D%0A

Implement basic foreach