Changes:
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / AbstractCase.java
1 package net.sourceforge.phpdt.internal.compiler.ast;
2
3 import java.util.List;
4
5 /**
6  * Superclass of case statement that we can find in a switch.
7  * @author Matthieu Casanova
8  */
9 public abstract class AbstractCase extends Statement {
10
11   /** The statements in the case. */
12   public Statement[] statements;
13
14   /**
15    * Create a case statement
16    * @param statements the statements array
17    * @param sourceStart the beginning source offset
18    * @param sourceEnd the ending offset
19    */
20   public AbstractCase(final Statement[] statements,
21                       final int sourceStart,
22                       final int sourceEnd) {
23     super(sourceStart, sourceEnd);
24     this.statements = statements;
25   }
26
27
28   /**
29    * Get the variables from outside (parameters, globals ...)
30    */
31   public void getOutsideVariable(final List list) {
32     for (int i = 0; i < statements.length; i++) {
33       statements[i].getOutsideVariable(list);
34     }
35   }
36
37   /**
38    * get the modified variables.
39    */
40   public void getModifiedVariable(final List list) {
41     for (int i = 0; i < statements.length; i++) {
42       statements[i].getModifiedVariable(list);
43     }
44   }
45
46   /**
47    * Get the variables used.
48    */
49   public void getUsedVariable(final List list) {
50     for (int i = 0; i < statements.length; i++) {
51       statements[i].getUsedVariable(list);
52     }
53   }
54 }