*** empty log message ***
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / ReturnStatement.java
1 package net.sourceforge.phpdt.internal.compiler.ast;
2
3 import net.sourceforge.phpdt.internal.compiler.ast.declarations.VariableUsage;
4
5 import java.util.List;
6 import java.util.ArrayList;
7
8 /**
9  * A return statement.
10  * @author Matthieu Casanova
11  */
12 public class ReturnStatement extends Statement {
13
14   public Expression expression;
15
16   public ReturnStatement(final Expression expression, final int sourceStart, final int sourceEnd) {
17     super(sourceStart, sourceEnd);
18     this.expression = expression;
19   }
20
21   public String toString(final int tab) {
22     final String s = tabString(tab);
23     if (expression == null) {
24       return s + "return";//$NON-NLS-1$
25     }
26     return s + "return " + expression.toStringExpression();//$NON-NLS-1$
27   }
28
29     /**
30    * Get the variables from outside (parameters, globals ...)
31    * @return the variables from outside
32    */
33   public List getOutsideVariable() {
34     return new ArrayList();
35   }
36
37   /**
38    * get the modified variables.
39    * @return the variables modified
40    */
41   public List getModifiedVariable() {
42     return expression.getModifiedVariable();
43   }
44
45   /**
46    * Get the variables used.
47    * @return the variables used
48    */
49   public List getUsedVariable() {
50     return expression.getUsedVariable();
51   }
52 }