home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_01_06 / 1n06040b < prev    next >
Text File  |  1990-10-02  |  314b  |  27 lines

  1.  
  2. Listing 7
  3.  
  4. static int c;
  5.  
  6. int yylex(void)
  7.     {
  8.     int tc;
  9.  
  10.     while (isspace(c) && c != '\n')
  11.         c = getchar();
  12.     if (isdigit(c))
  13.         {
  14.         yylval = 0;
  15.         do
  16.             yylval = 10 * yylval + c - '0';
  17.         while (isdigit(c = getchar()));
  18.         return INT;
  19.         }
  20.     else
  21.         {
  22.         tc = c;
  23.         c = getchar();
  24.         return tc;
  25.         }
  26.  
  27.