home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / OS2-YACC.ZIP / YSKPCM.2C < prev    next >
Text File  |  1989-09-29  |  1KB  |  43 lines

  1. /*
  2.   HEADER: CUG     nnn.nn;
  3.   TITLE:     YACC - Yet Another Compilier-Compilier
  4.   VERSION:     1.0 for IBM-PC
  5.   DATE:      JAN 28, 1985
  6.   DESCRIPTION:     LALR(1) Parser Generator. From UNIX
  7.   KEYWORDS:     Parser Generator Compilier-Compilier YACC
  8.   SYSTEM:     IBM-PC and Compatiables
  9.   FILENAME:      YSKPCM.2C
  10.   WARNINGS:     This program is not for the casual user. It will
  11.          be useful primarily to expert developers.
  12.   CRC:         N/A
  13.   SEE-ALSO:     LEX and PREP
  14.   AUTHORS:     Scott Guthery 11100 leafwood lane Austin, TX 78750
  15.   COMPILERS:     DESMET-C
  16.   REFERENCES:     UNIX Systems Manuals
  17. */
  18.  
  19. #include "y1.h"
  20. #include "y2.h"
  21.  
  22. int skipcom( void )
  23.    {
  24.    /* skip over comments */
  25.    register c, i;  /* i is the number of lines skipped */
  26.    i=0;                                                         /*01*/
  27.    /* skipcom is called after reading a / */
  28.  
  29.    if( unix_getc(finput) != '*' ) error( "illegal comment" );
  30.    c = unix_getc(finput);
  31.    while( c != EOF )
  32.       {
  33.       while( c == '*' )
  34.          {
  35.          if( (c=unix_getc(finput)) == '/' ) return( i );
  36.          }
  37.       if( c == '\n' ) ++i;
  38.       c = unix_getc(finput);
  39.       }
  40.    error( "EOF inside comment" );
  41.    /* NOTREACHED */
  42.    }
  43.