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

  1.  
  2. # include "y1.h" 
  3.  
  4. /*
  5.  * yptitm.1c
  6.  *
  7.  * Modified to make debug code conditionally compile.
  8.  * 28-Aug-81
  9.  * Bob Denny
  10.  */
  11.  
  12. void putitem( ptr, lptr )
  13. int             * ptr;
  14. struct looksets * lptr;
  15.  
  16.  
  17. {
  18.   register struct item * j;
  19.  
  20.   # ifdef debug
  21.   if ( foutput != NULL )
  22.  
  23.     {
  24.       fprintf( foutput,
  25.                "putitem(%s), state %d\n",
  26.                writem( ptr ),
  27.                nstate );
  28.     }
  29.     # endif 
  30.   j        = pstate[ nstate + 1 ];
  31.   j->pitem = ptr;
  32.   if ( !nolook )
  33.     j->look = flset( lptr );
  34.   pstate[ nstate + 1 ] = ++j;
  35.   if ( ( int * )j > zzmemsz )
  36.  
  37.     {
  38.       zzmemsz = ( int * )j;
  39.       if ( zzmemsz >= &mem0[ MEMSIZE ] )
  40.         error( "out of state space" );
  41.     }
  42. }
  43.