home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / C / YACCUNX.ZIP / YHDPRD.3C < prev    next >
Encoding:
Text File  |  1983-12-23  |  713 b   |  29 lines

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