1 /* $Id: main.c,v 1.5 1994/06/24 10:42:10 ceriel Exp $ */
3 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4 * See the copyright notice in the ACK home directory, in the file "Copyright".
8 * Contains the main program, the error reporting routine, and a routine
9 * to check wether a constraint consists only of space
13 extern int lineno, newline;
15 FILE *genc, *genh, *input;
17 char *linedir = "#line %d \"%s\"\n"; /* format of line directive */
20 main(argc,argv) char *argv[]; {
24 fprintf(stderr,"Usage : %s targetoptimizerdescription\n",argv[0]);
27 if ((input = fopen(argv[1],"r")) == NULL) {
28 fprintf(stderr,"Fatal error : couldn't open %s\n",argv[1]);
31 if ((genc = fopen("gen.c","w")) == NULL) {
32 fputs("Fatal error : couldn't open gen.c\n",stderr);
35 if ((genh = fopen("gen.h","w")) == NULL) {
36 fputs("Fatal error : couldn't open gen.h\n",stderr);
39 inpfile = argv[1]; /* needed for line directives and errors */
45 error(s, s1) char *s, *s1; {
48 fprintf(stderr,"\"%s\", line %d: ",inpfile,lineno);
53 onlyspace(s) register char *s; {
56 if (*s != ' ' && *s != '\t' && *s != '\n') return 0;