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(final Expression prefix,
return buff.toString();
}
- /**
+ /**
* Get the variables from outside (parameters, globals ...)
* @return the variables from outside
*/
public List getOutsideVariable() {
- return new ArrayList();
+ return new ArrayList(1);
}
/**
* @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 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());
+ final List list = prefix.getUsedVariable();
+ if (args != null) {
+ for (int i = 0; i < args.length; i++) {
+ list.addAll(args[i].getUsedVariable());
+ }
}
return list;
}