The methods to get variables do not instantiate ArrayList each time, only one is...
[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 class LabeledStatement extends Statement {
9
10   public String label;
11
12   public 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    * @return a String
27    */
28   public String toString() {
29     return label + statement.toString();
30   }
31
32   /**
33    * Return the object into String.
34    * @param tab how many tabs (not used here
35    * @return a String
36    */
37   public String toString(final int tab) {
38     return tabString(tab) + toString();
39   }
40
41     /**
42    * Get the variables from outside (parameters, globals ...)
43    */
44   public void getOutsideVariable(final List list) {
45     statement.getOutsideVariable(list);
46   }
47
48   /**
49    * get the modified variables.
50    */
51   public void getModifiedVariable(final List list) {
52     statement.getModifiedVariable(list);
53   }
54
55   /**
56    * Get the variables used.
57    */
58   public void getUsedVariable(final List list) {
59     statement.getUsedVariable(list);
60   }
61 }