*** empty log message ***
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / ForStatement.java
index 8a16b5e..f808542 100644 (file)
@@ -1,18 +1,25 @@
 package net.sourceforge.phpdt.internal.compiler.ast;
 
 /**
+ * A For statement.
+ * for(initializations;condition;increments) action
  * @author Matthieu Casanova
  */
 public class ForStatement extends Statement {
 
-  public Statement[] initializations;
+  /** the initializations. */
+  public Expression[] initializations;
+
+  /** the condition. */
   public Expression condition;
-  public Statement[] increments;
+  /** the increments. */
+  public Expression[] increments;
+
   public Statement action;
 
-  public ForStatement(Statement[] initializations,
+  public ForStatement(Expression[] initializations,
                       Expression condition,
-                      Statement[] increments,
+                      Expression[] increments,
                       Statement action,
                       int sourceStart,
                       int sourceEnd) {
@@ -29,8 +36,7 @@ public class ForStatement extends Statement {
     //inits
     if (initializations != null) {
       for (int i = 0; i < initializations.length; i++) {
-        //nice only with expressions
-        buff.append(initializations[i].toString());
+        buff.append(initializations[i].toStringExpression());
         if (i != (initializations.length - 1))
           buff.append(" , "); //$NON-NLS-1$
       }
@@ -45,7 +51,7 @@ public class ForStatement extends Statement {
     if (increments != null) {
       for (int i = 0; i < increments.length; i++) {
         //nice only with expressions
-        buff.append(increments[i].toString());
+        buff.append(increments[i].toStringExpression());
         if (i != (increments.length - 1))
           buff.append(" , "); //$NON-NLS-1$
       }
@@ -55,7 +61,7 @@ public class ForStatement extends Statement {
     if (action == null)
       buff.append("{}"); //$NON-NLS-1$
     else
-      buff.append( "\n").append(action.toString(tab + 1)); //$NON-NLS-1$
+      buff.append(action.toString(tab + 1)); //$NON-NLS-1$
     return buff.toString();
   }
 }