1987-03-09 19:15:41 +00:00
|
|
|
/*
|
|
|
|
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
*/
|
1985-01-08 09:59:28 +00:00
|
|
|
#ifndef NORCSID
|
1994-06-24 11:31:16 +00:00
|
|
|
static char rcsid[]= "$Id$";
|
1985-01-08 09:59:28 +00:00
|
|
|
#endif
|
|
|
|
|
2006-07-18 17:18:42 +00:00
|
|
|
#include <stdlib.h>
|
1985-01-08 09:59:28 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
char *filename;
|
1992-06-26 12:47:07 +00:00
|
|
|
char *beg_sbrk;
|
|
|
|
extern char *sbrk();
|
1985-01-08 09:59:28 +00:00
|
|
|
|
|
|
|
main(argc,argv) char **argv; {
|
|
|
|
extern int nerrors;
|
|
|
|
extern int code_in_c;
|
|
|
|
extern int tabledebug;
|
|
|
|
extern int verbose;
|
|
|
|
|
1992-06-26 12:47:07 +00:00
|
|
|
beg_sbrk = sbrk(0);
|
|
|
|
|
1985-01-08 09:59:28 +00:00
|
|
|
while (argc >1 && argv[1][0]=='-') {
|
|
|
|
switch(argv[1][1]) {
|
|
|
|
case 'c':
|
|
|
|
code_in_c = 0;
|
|
|
|
break;
|
|
|
|
case 'd':
|
|
|
|
tabledebug++;
|
|
|
|
break;
|
|
|
|
case 'v':
|
|
|
|
verbose++;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
error("Unknown flag -%c",argv[1][1]);
|
|
|
|
}
|
|
|
|
argc--; argv++;
|
|
|
|
}
|
|
|
|
if (argc==2) {
|
|
|
|
if (freopen(argv[1],"r",stdin)==NULL) {
|
|
|
|
error("Can't open %s",argv[1]);
|
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
filename = argv[1];
|
1987-01-12 14:38:45 +00:00
|
|
|
}
|
|
|
|
else if (argc == 1) {
|
|
|
|
filename = "";
|
1985-01-08 09:59:28 +00:00
|
|
|
} else
|
1987-01-12 14:38:45 +00:00
|
|
|
error("Usage: %s [-c] [-d] [-v] [table]",argv[0]);
|
1985-01-08 09:59:28 +00:00
|
|
|
initemhash();
|
|
|
|
enterkeyw();
|
|
|
|
initnodes();
|
|
|
|
initio();
|
|
|
|
yyparse();
|
|
|
|
if (nerrors==0) {
|
|
|
|
finishio();
|
|
|
|
statistics();
|
|
|
|
if (verbose)
|
|
|
|
hallverbose();
|
|
|
|
} else {
|
|
|
|
errorexit();
|
|
|
|
}
|
1987-03-09 14:22:45 +00:00
|
|
|
exit(nerrors==0 ? 0 : -1);
|
1985-01-08 09:59:28 +00:00
|
|
|
}
|