private static int[][] parse(String members){
  Vector theRanges=new Vector();
  int n=(members == null ? 0 : members.length());
  int i=0;
  int state=0;
  int lb=0;
  int ub=0;
  char c;
  int digit;
  while (i < n) {
    c=members.charAt(i++);
switch (state) {
case 0:
      if (Character.isWhitespace(c)) {
        state=0;
      }
 else       if ((digit=Character.digit(c,10)) != -1) {
        lb=digit;
        state=1;
      }
 else {
        throw new IllegalArgumentException();
      }
    break;
case 1:
  if (Character.isWhitespace(c)) {
    state=2;
  }
 else   if ((digit=Character.digit(c,10)) != -1) {
    lb=10 * lb + digit;
    state=1;
  }
 else   if (c == '-' || c == ':') {
    state=3;
  }
 else   if (c == ',') {
    accumulate(theRanges,lb,lb);
    state=6;
  }
 else {
    throw new IllegalArgumentException();
  }
break;
case 2:
if (Character.isWhitespace(c)) {
state=2;
}
 else if (c == '-' || c == ':') {
state=3;
}
 else if (c == ',') {
accumulate(theRanges,lb,lb);
state=6;
}
 else {
throw new IllegalArgumentException();
}
break;
case 3:
if (Character.isWhitespace(c)) {
state=3;
}
 else if ((digit=Character.digit(c,10)) != -1) {
ub=digit;
state=4;
}
 else {
throw new IllegalArgumentException();
}
break;
case 4:
if (Character.isWhitespace(c)) {
state=5;
}
 else if ((digit=Character.digit(c,10)) != -1) {
ub=10 * ub + digit;
state=4;
}
 else if (c == ',') {
accumulate(theRanges,lb,ub);
state=6;
}
 else {
throw new IllegalArgumentException();
}
break;
case 5:
if (Character.isWhitespace(c)) {
state=5;
}
 else if (c == ',') {
accumulate(theRanges,lb,ub);
state=6;
}
 else {
throw new IllegalArgumentException();
}
break;
case 6:
if (Character.isWhitespace(c)) {
state=6;
}
 else if ((digit=Character.digit(c,10)) != -1) {
lb=digit;
state=1;
}
 else {
throw new IllegalArgumentException();
}
break;
}
}
switch (state) {
case 0:
break;
case 1:
case 2:
accumulate(theRanges,lb,lb);
break;
case 4:
case 5:
accumulate(theRanges,lb,ub);
break;
case 3:
case 6:
throw new IllegalArgumentException();
}
return canonicalArrayForm(theRanges);
}

private static int [ ] [ ] parse ( String members ) { Vector theRanges = new Vector ( ) ; int n = ( members == null ? 0 : members . length ( ) ) ; int i = 0 ; int state = 0 ; int lb = 0 ; int ub = 0 ; char c ; int digit ; while ( i < n ) { c = members . charAt ( i ++ ) ; switch ( state ) { case 0 : if ( Character . isWhitespace ( c ) ) { state = 0 ; } else if ( ( digit = Character . digit ( c , 10 ) ) != - 1 ) { lb = digit ; state = 1 ; } else { throw new IllegalArgumentException ( ) ; } break ; case 1 : if ( Character . isWhitespace ( c ) ) { state = 2 ; } else if ( ( digit = Character . digit ( c , 10 ) ) != - 1 ) { lb = 10 * lb + digit ; state = 1 ; } else if ( c == '-' || c == ':' ) { state = 3 ; } else if ( c == ',' ) { accumulate ( theRanges , lb , lb ) ; state = 6 ; } else { throw new IllegalArgumentException ( ) ; } break ; case 2 : if ( Character . isWhitespace ( c ) ) { state = 2 ; } else if ( c == '-' || c == ':' ) { state = 3 ; } else if ( c == ',' ) { accumulate ( theRanges , lb , lb ) ; state = 6 ; } else { throw new IllegalArgumentException ( ) ; } break ; case 3 : if ( Character . isWhitespace ( c ) ) { state = 3 ; } else if ( ( digit = Character . digit ( c , 10 ) ) != - 1 ) { ub = digit ; state = 4 ; } else { throw new IllegalArgumentException ( ) ; } break ; case 4 : if ( Character . isWhitespace ( c ) ) { state = 5 ; } else if ( ( digit = Character . digit ( c , 10 ) ) != - 1 ) { ub = 10 * ub + digit ; state = 4 ; } else if ( c == ',' ) { accumulate ( theRanges , lb , ub ) ; state = 6 ; } else { throw new IllegalArgumentException ( ) ; } break ; case 5 : if ( Character . isWhitespace ( c ) ) { state = 5 ; } else if ( c == ',' ) { accumulate ( theRanges , lb , ub ) ; state = 6 ; } else { throw new IllegalArgumentException ( ) ; } break ; case 6 : if ( Character . isWhitespace ( c ) ) { state = 6 ; } else if ( ( digit = Character . digit ( c , 10 ) ) != - 1 ) { lb = digit ; state = 1 ; } else { throw new IllegalArgumentException ( ) ; } break ; } } switch ( state ) { case 0 : break ; case 1 : case 2 : accumulate ( theRanges , lb , lb ) ; break ; case 4 : case 5 : accumulate ( theRanges , lb , ub ) ; break ; case 3 : case 6 : throw new IllegalArgumentException ( ) ; } return canonicalArrayForm ( theRanges ) ; }
parse the given string , returning canonical array form .
