First try for AST structure. A lot of things to change
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / PHPEchoBlock.java
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/PHPEchoBlock.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/PHPEchoBlock.java
new file mode 100644 (file)
index 0000000..80da2cf
--- /dev/null
@@ -0,0 +1,27 @@
+package net.sourceforge.phpdt.internal.compiler.ast;
+
+/**
+ * @author Matthieu Casanova
+ */
+public class PHPEchoBlock extends AstNode {
+
+  public Expression expr;
+
+  public PHPEchoBlock(Expression expr,int sourceStart, int sourceEnd) {
+    super(sourceStart, sourceEnd);
+    this.expr = expr;
+  }
+
+  /**
+   * Return the object into String.
+   * @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("?>");
+    return buff.toString();
+  }
+}