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

  1.  
  2. # include "y3.h" 
  3.  
  4. void hideprod( )
  5. {
  6.   /* in order to free up the mem and amem arrays for the optimizer,
  7.      and still be able to output yyr1, etc., after the sizes of
  8.      the action array is known, we hide the nonterminals
  9.      derived by productions in levprd.
  10.   */
  11.  
  12.   register i,
  13.            j;
  14.  
  15.   j = 0;
  16.   levprd[ 0 ] = 0;
  17.   PLOOP( 1, i )
  18.     {
  19.       if ( !( levprd[ i ] & REDFLAG ) )
  20.         {
  21.           ++j;
  22.           if ( foutput != NULL )
  23.             {
  24.               fprintf( foutput,
  25.                        "Rule not reduced:   %s\n",
  26.                        writem( prdptr[ i ] ) );
  27.             }
  28.         }
  29.       levprd[ i ] = *prdptr[ i ] - NTBASE;
  30.     }
  31.   if ( j )
  32.     fprintf( stdout, "%d rules never reduced\n", j );
  33. }
  34.