home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / OS2-YACC.ZIP / YSUMRY.1C < prev    next >
Text File  |  1989-10-03  |  2KB  |  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:      YSUMRY.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. void summary(void)
  22.    {
  23.    /* output the summary on the tty */
  24.  
  25.    if( foutput!=NULL )
  26.       {
  27.       fprintf( foutput, "\n%d/%d terminals, %d/%d nonterminals\n", ntokens, NTERMS,
  28.       nnonter, NNONTERM );
  29.       fprintf( foutput, "%d/%d grammar rules, %d/%d states\n", nprod, NPROD, nstate, NSTATES );
  30.       fprintf( foutput, "%d shift/reduce, %d reduce/reduce conflicts reported\n", zzsrconf, zzrrconf );
  31.       fprintf( foutput, "%d/%d working sets used\n", zzcwp-wsets,  WSETSIZE );
  32.       fprintf( foutput, "memory: states,etc. %d/%d, parser %d/%d\n", zzmemsz-mem0, MEMSIZE,
  33.       memp-amem, ACTSIZE );
  34.       fprintf( foutput, "%d/%d distinct lookahead sets\n", nlset, LSETSIZE );
  35.       fprintf( foutput, "%d extra closures\n", zzclose - 2*nstate );
  36.       fprintf( foutput, "%d shift entries, %d exceptions\n", zzacent, zzexcp );
  37.       fprintf( foutput, "%d goto entries\n", zzgoent );
  38.       fprintf( foutput, "%d entries saved by goto default\n", zzgobest );
  39.       }
  40.    if( zzsrconf!=0 || zzrrconf!=0 )
  41.       {
  42.       fprintf( stdout,"\nconflicts: ");
  43.       if( zzsrconf )fprintf( stdout, "%d shift/reduce" , zzsrconf );
  44.       if( zzsrconf && zzrrconf )fprintf( stdout, ", " );
  45.       if( zzrrconf )fprintf( stdout, "%d reduce/reduce" , zzrrconf );
  46.       fprintf( stdout, "\n" );
  47.       }
  48.  
  49.    if( ftemp != NULL ) fclose( ftemp );
  50.    if( fdefine != NULL ) fclose( fdefine );
  51.    }
  52.