home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / program / c / yaccsrc2 / yskpcm.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-05-19  |  592 b   |  29 lines

  1.  
  2. # include "y2.h" 
  3.  
  4. int skipcom( )
  5. {
  6.   /* skip over comments */
  7.   register c,
  8.            i; /* i is the number of lines skipped */
  9.   i = 0; /*01*/
  10.   /* skipcom is called after reading a / */
  11.  
  12.   if ( unix_getc( finput ) != '*' )
  13.     error( "illegal comment" );
  14.   c = unix_getc( finput );
  15.   while ( c != EOF )
  16.     {
  17.       while ( c == '*' )
  18.         {
  19.           if ( ( c = unix_getc( finput ) ) == '/' )
  20.             return ( i );
  21.         }
  22.       if ( c == '\n' )
  23.         ++i;
  24.       c = unix_getc( finput );
  25.     }
  26.   error( "EOF inside comment" );
  27.   /* NOTREACHED */
  28. }
  29.