#
# parse the menu selection line
#

BEGIN {
   print "CompSelectStart"
}

{
   naccum = 0;
   rstart = -1;
   for (i=1; i<=length($0); i++) {
      n=substr($0,i,1);

      if (n >= "0" && n <= "9" ) {
         if (wflag == 1 && naccum > 0) {
            if (rstart > -1) {
               for (j = rstart; j <= naccum; j++) {
                  print j;
               }
            } else {
               print naccum;
            }
            naccum = 0;
	    wflag = 0;
         }
         naccum = naccum*10 + n;

      }

      if (n == ";" || n == "\t" || n == "," || n == " " ) {
         wflag = 1;
         if (rstart > -1) {
            for (j = rstart; j <= naccum; j++) {
               print j;
            }
         } else {
              if (naccum >0){
              print naccum;
              }
           }
         rstart = -1;
         naccum = 0;
         wflag = 0;
      }


      if (n == "-" && naccum > 0) {
         rstart = naccum;
         naccum=0;
      }

   }

   if (naccum > 0) {
      if (rstart > -1) {
         for (j = rstart; j <= naccum; j++) {
             print j;
         }
      } else {
           print naccum;
      }
   }

}

END {
  print "CompSelectEnd"
}
