home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume12 / hershtools / part05 / h2s.l < prev    next >
Text File  |  1987-10-24  |  443b  |  28 lines

  1.     int lowh = 0;
  2.     int hnum  = 0;
  3.     int started = 0;
  4.     int ascchar = 32;
  5.     int ix;
  6.  
  7. %%
  8.  
  9. [0-9]+/-    {    lowh    =    atoi(yytext);
  10.         }
  11.  
  12. [0-9]+        {    if (!started) printf("charset\n");
  13.             started = 1;
  14.             hnum    =    atoi(yytext);
  15.             if (lowh) ix = lowh;
  16.                 else ix = hnum;
  17.             lowh  =  0;
  18.             for (; ix <= hnum; ix++,ascchar++)
  19.                if (ascchar > ' ' && ascchar < 127)
  20.                 printf("%d,%c\n", ix, ascchar);
  21.                else
  22.                 printf("%d,\\%o\n", ix, ascchar);
  23.         }
  24.  
  25. .    ;
  26. \n    ;
  27.  
  28.