function my_split(separator, str){
var exp = {};
arr = str.split(separator)
if( arr.length > 1 ){
first_val = arr[0];
str = str.substr(first_val.length+separator.length);
exp[ first_val ] = my_split(separator, str)
return exp;
} else {
return str;
}
}
str = 'a.b.c.d';
res = my_split('.', str);