First try for AST structure. A lot of things to change
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / LabeledStatement.java
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/LabeledStatement.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/LabeledStatement.java
new file mode 100644 (file)
index 0000000..89838a8
--- /dev/null
@@ -0,0 +1,35 @@
+package net.sourceforge.phpdt.internal.compiler.ast;
+
+/**
+ * @author Matthieu Casanova
+ */
+public class LabeledStatement extends Statement {
+
+  public char[] label;
+
+  public Statement statement;
+
+  public LabeledStatement(char[] label, Statement statement, int sourceStart, int sourceEnd) {
+    super(sourceStart, sourceEnd);
+    this.label = label;
+    this.statement = statement;
+  }
+
+  /**
+   * Return the object into String.
+   * It should be overriden
+   * @return a String
+   */
+  public String toString() {
+    return new String(label) + statement.toString();
+  }
+
+  /**
+   * Return the object into String.
+   * @param tab how many tabs (not used here
+   * @return a String
+   */
+  public String toString(int tab) {
+    return tabString(tab) + toString();
+  }
+}