*** empty log message ***
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / StaticStatement.java
1 package net.sourceforge.phpdt.internal.compiler.ast;
2
3 import java.util.List;
4 import java.util.ArrayList;
5
6 /**
7  * A GlobalStatement statement in php.
8  * @author Matthieu Casanova
9  */
10 public class StaticStatement extends Statement {
11
12   /** An array of the variables called by this global statement. */
13   public VariableDeclaration[] variables;
14
15   public StaticStatement(final VariableDeclaration[] variables, final int sourceStart, final int sourceEnd) {
16     super(sourceStart, sourceEnd);
17     this.variables = variables;
18   }
19
20   public String toString() {
21     final StringBuffer buff = new StringBuffer("static ");
22     for (int i = 0; i < variables.length; i++) {
23       if (i != 0) {
24         buff.append(", ");
25       }
26       buff.append(variables[i]);
27     }
28     return buff.toString();
29   }
30
31   public String toString(final int tab) {
32     return tabString(tab) + toString();
33   }
34
35   /**
36    * Get the variables from outside (parameters, globals ...)
37    * @return the variables from outside
38    */
39   public List getOutsideVariable() {
40     final ArrayList list = new ArrayList();
41     for (int i = 0; i < variables.length; i++) {
42       list.addAll(variables[i].getModifiedVariable());
43     }
44     return list;
45   }
46
47   /**
48    * get the modified variables.
49    * @return the variables modified
50    */
51   public List getModifiedVariable() {
52     return new ArrayList(1);
53   }
54
55   /**
56    * Get the variables used.
57    * @return the variables used
58    */
59   public List getUsedVariable() {
60     return new ArrayList(1);
61   }
62 }