package net.sourceforge.phpdt.internal.compiler.ast;
import java.util.List;
-import java.util.ArrayList;
/**
* A Function call.
public class FunctionCall extends AbstractSuffixExpression {
/** the function name. */
- public Expression prefix;
+ public Expression functionName;
/** the arguments. */
public Expression[] args;
public FunctionCall(final Expression prefix,
final Expression[] args,
final int sourceEnd) {
- super(prefix.getSourceStart(), sourceEnd);
- this.prefix = prefix;
+ super(prefix.sourceStart, sourceEnd);
+ this.functionName = prefix;
this.args = args;
}
* @return the expression
*/
public String toStringExpression() {
- final StringBuffer buff = new StringBuffer(prefix.toStringExpression());
+ final StringBuffer buff = new StringBuffer(functionName.toStringExpression());
buff.append('(');
if (args != null) {
for (int i = 0; i < args.length; i++) {
/**
* Get the variables from outside (parameters, globals ...)
- * @return the variables from outside
*/
- public List getOutsideVariable() {
- return new ArrayList(1);
+ public void getOutsideVariable(final List list) {
}
/**
* 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());
+ public void getModifiedVariable(final List list) {
+ if (args != null) {
+ for (int i = 0; i < args.length; i++) {
+ args[i].getModifiedVariable(list);
+ }
}
- return list;
}
/**
* Get the variables used.
- * @return the variables used
*/
- public List getUsedVariable() {
- final List list = prefix.getUsedVariable();
+ public void getUsedVariable(final List list) {
+ functionName.getUsedVariable(list);
if (args != null) {
for (int i = 0; i < args.length; i++) {
- list.addAll(args[i].getUsedVariable());
+ args[i].getUsedVariable(list);
}
}
- return list;
}
}