home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / OS2-YACC.ZIP / YPTITM.1C < prev    next >
Text File  |  1989-09-29  |  1KB  |  52 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:      YPTITM.1C
  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.  
  21. /*
  22.  * yptitm.1c
  23.  *
  24.  * Modified to make debug code conditionally compile.
  25.  * 28-Aug-81
  26.  * Bob Denny
  27.  */
  28.  
  29. void putitem( int *ptr, struct looksets *lptr )
  30.  
  31.    {
  32.    register struct item *j;
  33.  
  34. #ifdef debug
  35.    if( foutput!=NULL ) 
  36.  
  37.       {
  38.       fprintf( foutput, "putitem(%s), state %d\n", writem(ptr), nstate );
  39.       }
  40. #endif
  41.    j = pstate[nstate+1];
  42.    j->pitem = ptr;
  43.    if( !nolook ) j->look = flset( lptr );
  44.    pstate[nstate+1] = ++j;
  45.    if( (int *)j > zzmemsz )
  46.  
  47.       {
  48.       zzmemsz = (int *)j;
  49.       if( zzmemsz >=  &mem0[MEMSIZE] ) error( "out of state space" );
  50.       }
  51.    }
  52.