1 package net.sourceforge.phpdt.internal.compiler.ast;
4 import java.util.ArrayList;
7 * Superclass of case statement that we can find in a switch.
8 * @author Matthieu Casanova
10 public abstract class AbstractCase extends Statement {
12 /** The statements in the case. */
13 public Statement[] statements;
16 * Create a case statement
17 * @param statements the statements array
18 * @param sourceStart the beginning source offset
19 * @param sourceEnd the ending offset
21 public AbstractCase(final Statement[] statements,
22 final int sourceStart,
23 final int sourceEnd) {
24 super(sourceStart, sourceEnd);
25 this.statements = statements;
30 * Get the variables from outside (parameters, globals ...)
32 public void getOutsideVariable(final List list) {
33 for (int i = 0; i < statements.length; i++) {
34 statements[i].getOutsideVariable(list);
39 * get the modified variables.
41 public void getModifiedVariable(final List list) {
42 for (int i = 0; i < statements.length; i++) {
43 statements[i].getModifiedVariable(list);
48 * Get the variables used.
50 public void getUsedVariable(final List list) {
51 for (int i = 0; i < statements.length; i++) {
52 statements[i].getUsedVariable(list);