home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / OS2_LEX.ZIP / COMMEN.C < prev    next >
C/C++ Source or Header  |  1980-01-01  |  615b  |  29 lines

  1. /*
  2.  * Bob Denny      28-Aug-82  Remove reference to stdio.h
  3.  * Scott Guthery 20-Nov-83    Adapt for IBM PC & DeSmet C
  4.  */
  5. #include <lex.h>
  6.  
  7. extern int yyline;
  8.  
  9. comment(mat)
  10. char *mat;
  11. {
  12.         register c;
  13.         register char *cp;
  14.         int lno;
  15.  
  16.         lno = yyline;
  17.         c = 1;
  18.         for (cp = mat; *cp && c>=0;) {
  19.                 if ((c = lexchar())=='\n')
  20.                         yyline++;
  21.                 if (c!=*cp++)
  22.                         cp = mat;
  23.         }
  24.         if (c < 0) {
  25.                 yyline = lno;
  26.                 lexerror("End of file in comment");
  27.         }
  28. }
  29.