1 package net.sourceforge.phpdt.internal.compiler.ast;
4 import java.util.ArrayList;
8 * @author Matthieu Casanova
10 public class ReturnStatement extends Statement {
12 public Expression expression;
14 public ReturnStatement(final Expression expression, final int sourceStart, final int sourceEnd) {
15 super(sourceStart, sourceEnd);
16 this.expression = expression;
19 public String toString(final int tab) {
20 final String s = tabString(tab);
21 if (expression == null) {
22 return s + "return";//$NON-NLS-1$
24 return s + "return " + expression.toStringExpression();//$NON-NLS-1$
28 * Get the variables from outside (parameters, globals ...)
30 public void getOutsideVariable(final List list) {
34 * get the modified variables.
36 public void getModifiedVariable(final List list) {
37 if (expression != null) {
38 expression.getModifiedVariable(list);
43 * Get the variables used.
45 public void getUsedVariable(final List list) {
46 if (expression != null) {
47 expression.getUsedVariable(list);