home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_200
/
296_01
/
ctocxx.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-10-03
|
925b
|
40 lines
#include <stdio.h>
FILE *pfd = 0;
FILE *efd = 0;
FILE *ifd = stdin;
extern int column;
extern int lineno;
extern char file_name[132];
main()
{
int yyparse();
int result;
initsymtab();
preloadsyms(); /* load in int, char, etc types */
efd = fopen("ed.out","w");
if ( efd == NULL )
fprintf(stderr,"Could not open file ed.out\n");
pfd = fopen("proto.out","w");
if ( pfd == NULL )
fprintf(stderr,"Could not open file proto.out\n");
result = yyparse();
if ( efd )
fclose(efd);
if ( pfd )
fclose(pfd);
return result;
}
/*-----------------------------------------------------------*/
yyerror(s)
char *s;
{
fprintf(stderr,"\n%s at line %d in column %d of file
%s\n",s,lineno,column,file_name);
fprintf(stderr,"This is a fatal error, exiting ...\n");
exit(2);
}