X-Git-Url: http://git.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..cb0b5dd 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,5 +1,8 @@ package net.sourceforge.phpdt.internal.compiler.ast; +import java.util.List; +import java.util.ArrayList; + /** * @author Matthieu Casanova */ @@ -8,9 +11,9 @@ public class FunctionCall extends AbstractSuffixExpression { public Expression prefix; 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 +28,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 +38,37 @@ 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(); + } + + /** + * get the modified variables. + * @return the variables from we change value + */ + public List getModifiedVariable() { + 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 ArrayList list = new ArrayList(); + list.addAll(prefix.getUsedVariable()); + for (int i = 0; i < args.length; i++) { + list.addAll(args[i].getUsedVariable()); + } + return list; + } }