3acad54800355b65f5e705f8ce27aae3c3206e97
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / LabeledStatement.java
1 package net.sourceforge.phpdt.internal.compiler.ast;
2
3 import java.util.List;
4
5 /**
6  * @author Matthieu Casanova
7  */
8 public final class LabeledStatement extends Statement {
9
10   private final String label;
11
12   private final Statement statement;
13
14   public LabeledStatement(final String label,
15                           final Statement statement,
16                           final int sourceStart,
17                           final int sourceEnd) {
18     super(sourceStart, sourceEnd);
19     this.label = label;
20     this.statement = statement;
21   }
22
23   /**
24    * Return the object into String.
25    * It should be overriden
26    * 
27    * @return a String
28    */
29   public String toString() {
30     return label + statement.toString();
31   }
32
33   /**
34    * Return the object into String.
35    * 
36    * @param tab how many tabs (not used here
37    * @return a String
38    */
39   public String toString(final int tab) {
40     return tabString(tab) + toString();
41   }
42
43   /**
44    * Get the variables from outside (parameters, globals ...)
45    *
46    * @param list the list where we will put variables
47    */
48   public void getOutsideVariable(final List list) {
49     statement.getOutsideVariable(list);
50   }
51
52   /**
53    * get the modified variables.
54    *
55    * @param list the list where we will put variables
56    */
57   public void getModifiedVariable(final List list) {
58     statement.getModifiedVariable(list);
59   }
60
61   /**
62    * Get the variables used.
63    *
64    * @param list the list where we will put variables
65    */
66   public void getUsedVariable(final List list) {
67     statement.getUsedVariable(list);
68   }
69 }