<html>
 <head>
  <title> new document </title>
  <script>
function myEval(input){
var lookAhead=0;
c=input[0];
function xx(pram){
while(true){
//if(lookAhead>=input.length)return pram;
if(c==='['){
c=input[++lookAhead];
pram.push(xx([]));
}else if(c===']'){
c=input[++lookAhead];
return pram;
}else if(c===','){
c=input[++lookAhead];
}else if(isLetter(c)){
var name=getName();
pram.push(name);
}else{
throw "语法错误...";
}
}
return param;
}
if(c==='['){
var array;
c=input[++lookAhead];
array=xx([]);
return array;
}
function isLetter(input){
if((input>='a' && input<='z')|| (input>="A" && input<="Z")){
return true;
}
return false;
}
function getName(){
var x=c;
while(isLetter(c=input[++lookAhead])){
x+=c;
}
//c=input[lookAhead];
return x;
}
}
var arr=myEval("[aa,[a,b,[fs,[kSf,hfs]],[q,ws,e]],cc,[ca,cd]]");
document.write(JSON.stringify(arr));
  </script>
 </head> <body> </body>
</html>