X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/AbstractCase.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/AbstractCase.java index e31da6b..0f26744 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/AbstractCase.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/AbstractCase.java @@ -1,13 +1,55 @@ package net.sourceforge.phpdt.internal.compiler.ast; +import java.util.List; +import java.util.ArrayList; + /** + * Superclass of case statement that we can find in a switch. * @author Matthieu Casanova */ public abstract class AbstractCase extends Statement { + + /** The statements in the case. */ public Statement[] statements; - public AbstractCase(Statement[] statements, int sourceStart, int sourceEnd) { + /** + * Create a case statement + * @param statements the statements array + * @param sourceStart the beginning source offset + * @param sourceEnd the ending offset + */ + public AbstractCase(final Statement[] statements, + final int sourceStart, + final int sourceEnd) { super(sourceStart, sourceEnd); this.statements = statements; } + + + /** + * Get the variables from outside (parameters, globals ...) + */ + public void getOutsideVariable(final List list) { + for (int i = 0; i < statements.length; i++) { + statements[i].getOutsideVariable(list); + } + } + + /** + * get the modified variables. + */ + public void getModifiedVariable(final List list) { + for (int i = 0; i < statements.length; i++) { + statements[i].getModifiedVariable(list); + } + } + + /** + * Get the variables used. + */ + public void getUsedVariable(final List list) { + for (int i = 0; i < statements.length; i++) { + statements[i].getUsedVariable(list); + } + } }