home *** CD-ROM | disk | FTP | other *** search
- /*
- HEADER: CUG nnn.nn;
- TITLE: YACC - Yet Another Compilier-Compilier
- VERSION: 1.0 for IBM-PC
- DATE: JAN 28, 1985
- DESCRIPTION: LALR(1) Parser Generator. From UNIX
- KEYWORDS: Parser Generator Compilier-Compilier YACC
- SYSTEM: IBM-PC and Compatiables
- FILENAME: YHDPRD.3C
- WARNINGS: This program is not for the casual user. It will
- be useful primarily to expert developers.
- CRC: N/A
- SEE-ALSO: LEX and PREP
- AUTHORS: Scott Guthery 11100 leafwood lane Austin, TX 78750
- COMPILERS: DESMET-C
- REFERENCES: UNIX Systems Manuals
- */
-
- #include "y1.h"
- #include "y3.h"
-
- void hideprod( void )
- {
- /* in order to free up the mem and amem arrays for the optimizer,
- /* and still be able to output yyr1, etc., after the sizes of
- /* the action array is known, we hide the nonterminals
- /* derived by productions in levprd.
- */
-
- register i, j;
-
- j = 0;
- levprd[0] = 0;
- PLOOP(1,i)
- {
- if( !(levprd[i] & REDFLAG) )
- {
- ++j;
- if( foutput != NULL )
- {
- fprintf( foutput, "Rule not reduced: %s\n", writem( prdptr[i] ) );
- }
- }
- levprd[i] = *prdptr[i] - NTBASE;
- }
- if( j ) fprintf( stdout, "%d rules never reduced\n", j );
- }
-