X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/GlobalStatement.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/GlobalStatement.java index 6bb61fe..d50bafe 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/GlobalStatement.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/GlobalStatement.java @@ -1,10 +1,14 @@ package net.sourceforge.phpdt.internal.compiler.ast; import net.sourceforge.phpdt.internal.compiler.parser.Outlineable; +import net.sourceforge.phpdt.internal.compiler.ast.declarations.VariableUsage; import net.sourceforge.phpdt.internal.ui.PHPUiImages; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.text.Position; +import java.util.List; +import java.util.ArrayList; + /** * A GlobalStatement statement in php. * @author Matthieu Casanova @@ -18,7 +22,10 @@ public class GlobalStatement extends Statement implements Outlineable { private Position position; - public GlobalStatement(Object parent, String[] variables, int sourceStart, int sourceEnd) { + public GlobalStatement(final Object parent, + final String[] variables, + final int sourceStart, + final int sourceEnd) { super(sourceStart, sourceEnd); this.variables = variables; this.parent = parent; @@ -26,17 +33,17 @@ public class GlobalStatement extends Statement implements Outlineable { } public String toString() { - StringBuffer buff = new StringBuffer("global "); + final StringBuffer buff = new StringBuffer("global ");//$NON-NLS-1$ for (int i = 0; i < variables.length; i++) { if (i != 0) { - buff.append(", "); + buff.append(", ");//$NON-NLS-1$ } buff.append(variables[i]); } return buff.toString(); } - public String toString(int tab) { + public String toString(final int tab) { return tabString(tab) + toString(); } @@ -55,4 +62,32 @@ public class GlobalStatement extends Statement implements Outlineable { public Position getPosition() { return position; } + + /** + * Get the variables from outside (parameters, globals ...) + * @return the variables from outside + */ + public List getOutsideVariable() { + final ArrayList list = new ArrayList(variables.length); + for (int i = 0; i < variables.length; i++) { + list.add(new VariableUsage(variables[i],sourceStart)); + } + return list; + } + + /** + * get the modified variables. + * @return the variables modified + */ + public List getModifiedVariable() { + return new ArrayList(); + } + + /** + * Get the variables used. + * @return the variables used + */ + public List getUsedVariable() { + return new ArrayList(); + } }