home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_07_07 / v7n7075b.txt < prev    next >
Text File  |  1989-05-29  |  884b  |  39 lines

  1. #include <stdio.h>
  2. FILE *pfd = 0;
  3. FILE *efd = 0;
  4. FILE *ifd = stdin;
  5. extern int column;
  6. extern int lineno;
  7. extern char file_name[132];
  8.  
  9. main()
  10.     {
  11.     int yyparse();
  12.     int result;
  13.  
  14.     initsymtab();
  15.     preloadsyms();      /* load in int, char, etc types */
  16.     efd = fopen("ed.out","w");
  17.     if ( efd == NULL )
  18.     fprintf(stderr,"Could not open file ed.out\n");
  19.     pfd = fopen("proto.out","w");
  20.     if ( pfd == NULL )
  21.     fprintf(stderr,"Could not open file proto.out\n");
  22.     result = yyparse();
  23.     if ( efd )
  24.     fclose(efd);
  25.     if ( pfd )
  26.     fclose(pfd);
  27.     return result;
  28.     }
  29.  
  30. /*-----------------------------------------------------------*/
  31. yyerror(s)
  32.     char *s;
  33.     {
  34.     fprintf(stderr,"\n%s at line %d in column %d of file %s\n",s,lineno,column,file_name);
  35.     fprintf(stderr,"This is a fatal error, exiting ...\n");
  36.     exit(2);
  37.     }
  38.  
  39.