X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/FunctionCall.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/FunctionCall.java index c91788d..19fcbee 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/FunctionCall.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/FunctionCall.java @@ -1,16 +1,23 @@ package net.sourceforge.phpdt.internal.compiler.ast; +import java.util.List; +import java.util.ArrayList; + /** + * A Function call. * @author Matthieu Casanova */ public class FunctionCall extends AbstractSuffixExpression { + /** the function name. */ public Expression prefix; + + /** the arguments. */ public Expression[] args; - public FunctionCall(Expression prefix, - Expression[] args, - int sourceEnd) { + public FunctionCall(final Expression prefix, + final Expression[] args, + final int sourceEnd) { super(prefix.sourceStart, sourceEnd); this.prefix = prefix; this.args = args; @@ -25,7 +32,7 @@ public class FunctionCall extends AbstractSuffixExpression { buff.append('('); if (args != null) { for (int i = 0; i < args.length; i++) { - Expression arg = args[i]; + final Expression arg = args[i]; if (i != 0) { buff.append(','); } @@ -35,4 +42,41 @@ public class FunctionCall extends AbstractSuffixExpression { buff.append(')'); return buff.toString(); } + + /** + * Get the variables from outside (parameters, globals ...) + * @return the variables from outside + */ + public List getOutsideVariable() { + return new ArrayList(1); + } + + /** + * get the modified variables. + * @return the variables from we change value + */ + public List getModifiedVariable() { + if (args == null) { + return new ArrayList(1); + } + final ArrayList list = new ArrayList(); + for (int i = 0; i < args.length; i++) { + list.addAll(args[i].getModifiedVariable()); + } + return list; + } + + /** + * Get the variables used. + * @return the variables used + */ + public List getUsedVariable() { + final List list = prefix.getUsedVariable(); + if (args != null) { + for (int i = 0; i < args.length; i++) { + list.addAll(args[i].getUsedVariable()); + } + } + return list; + } }