Variable[] parseArgumentList(Functions func) {
    Interpreter interp = func.interp;

    Variable[] vArray = new Variable[argTypes.length];
    int i=0;
    do {
      if (i >= argTypes.length) {
        interp.error("too many arguments (expected "+argTypes.length+")");
        return null;
      }
      boolean output   = isOutputArg(argTypes[i]);

      Variable v;
      if (output) {
        v = func.getVariable();
      } else {
        v = new Variable();
        switch (getRawType(argTypes[i])) {
        case MacroExtension.ARG_STRING:
          v.setString(func.getString());
          break;
        case MacroExtension.ARG_NUMBER:
          v.setValue(interp.getExpression());
          break;
        case MacroExtension.ARG_ARRAY:
          v.setArray(func.getArray());
          break;
        }
      }
      vArray[i] = v;
      ++i;
      interp.getToken();
    } while (interp.token == ',');
    
    if (interp.token!=')')
      interp.error("')' expected");

    if (i < argTypes.length && !isOptionalArg(argTypes[i])) {
      interp.error("too few arguments, expected "+argTypes.length+" but found "+i);
    }
    
    return vArray;
  }