+++ /dev/null
-package net.sourceforge.phpdt.internal.compiler.ast;
-
-import net.sourceforge.phpdt.internal.compiler.parser.Outlineable;
-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
- */
-public class GlobalStatement extends Statement implements Outlineable {
-
- /** An array of the variables called by this global statement. */
- public AbstractVariable[] variables;
-
- private Object parent;
-
- private Position position;
-
- public GlobalStatement(final Object parent,
- final AbstractVariable[] variables,
- final int sourceStart,
- final int sourceEnd) {
- super(sourceStart, sourceEnd);
- this.variables = variables;
- this.parent = parent;
- position = new Position(sourceStart, sourceEnd);
- }
-
- public String toString() {
- final StringBuffer buff = new StringBuffer("global ");//$NON-NLS-1$
- for (int i = 0; i < variables.length; i++) {
- if (i != 0) {
- buff.append(", ");//$NON-NLS-1$
- }
- buff.append(variables[i].toStringExpression());
- }
- return buff.toString();
- }
-
- public String toString(final int tab) {
- return tabString(tab) + toString();
- }
-
- /**
- * This will return the image for the outline of the object.
- * @return an image
- */
- public ImageDescriptor getImage() {
- return PHPUiImages.DESC_INC;
- }
-
- public Object getParent() {
- return parent;
- }
-
- 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.addAll(variables[i].getUsedVariable());
- }
- return list;
- }
-
- /**
- * get the modified variables.
- * @return the variables modified
- */
- public List getModifiedVariable() {
- return new ArrayList(1);
- }
-
- /**
- * Get the variables used.
- * @return the variables used
- */
- public List getUsedVariable() {
- return new ArrayList(1);
- }
-}