*** empty log message ***
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / PHPEchoBlock.java
index 80da2cf..674f9d1 100644 (file)
@@ -1,13 +1,29 @@
 package net.sourceforge.phpdt.internal.compiler.ast;
 
+import net.sourceforge.phpdt.internal.compiler.ast.declarations.VariableUsage;
+
+import java.util.List;
+import java.util.ArrayList;
+
 /**
+ * a php echo block.
+ * <?= someexpression ?>
  * @author Matthieu Casanova
  */
 public class PHPEchoBlock extends AstNode {
 
+  /** the expression. */
   public Expression expr;
 
-  public PHPEchoBlock(Expression expr,int sourceStart, int sourceEnd) {
+  /**
+   * Create a new php echo block.
+   * @param expr the expression
+   * @param sourceStart the starting offset
+   * @param sourceEnd the ending offset
+   */
+  public PHPEchoBlock(final Expression expr,
+                      final int sourceStart,
+                      final int sourceEnd) {
     super(sourceStart, sourceEnd);
     this.expr = expr;
   }
@@ -17,11 +33,40 @@ public class PHPEchoBlock extends AstNode {
    * @param tab how many tabs (not used here
    * @return a String
    */
-  public String toString(int tab) {
-    final StringBuffer buff = new StringBuffer(tabString(tab));
-    buff.append("<?=");
-    buff.append(expr.toStringExpression());
-    buff.append("?>");
+  public String toString(final int tab) {
+    final String tabs = tabString(tab);
+    final String expression = expr.toStringExpression();
+    final StringBuffer buff = new StringBuffer(tabs.length() +
+                                               expression.length() +
+                                               5);
+    buff.append(tabs);
+    buff.append("<?=");//$NON-NLS-1$
+    buff.append(expression);
+    buff.append("?>");//$NON-NLS-1$
     return buff.toString();
   }
+
+  /**
+   * Get the variables from outside (parameters, globals ...)
+   * @return an empty list
+   */
+  public List getOutsideVariable() {
+    return new ArrayList();
+  }
+
+  /**
+   * get the modified variables.
+   * @return an empty list
+   */
+  public List getModifiedVariable() {
+    return new ArrayList();
+  }
+
+  /**
+   * Get the variables used.
+   * @return the used variables are the used variables from the expression
+   */
+  public List getUsedVariable() {
+    return expr.getUsedVariable();
+  }
 }