home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / OS2-YACC.ZIP / YERROR.1C < prev    next >
Text File  |  1989-09-29  |  1KB  |  43 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:      YERROR.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 <stdio.h>
  20. # include <stdarg.h>
  21. # include "y1.h"
  22.  
  23. /*
  24.  * 12-Apr-83 (RBD) Add symbolic exit status
  25.  */
  26. /* VARARGS1 */
  27. void error( char *s )
  28.    {
  29.    va_list a1;
  30.  
  31.    /* write out error comment */
  32.  
  33.    ++nerrors;
  34.    fprintf( stderr, "\n fatal error: ");
  35.    va_start( a1, s );
  36.    vfprintf( stderr, s, a1 );
  37.    va_end( a1 );
  38.    fprintf( stderr, ", line %d\n", lineno );
  39.    if( !fatfl ) return;
  40.    summary();
  41.    exit(EX_ERR);
  42.    }
  43.