2 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
6 static char rcsid1[] = "$Id: main.c,v 2.8 1994/06/24 11:14:10 ceriel Exp $";
9 /* This is the main program for the stand-alone version of the
15 char *filename; /* Name of input file */
16 int errors; /* Number of errors */
21 static struct e_instr buff;
22 register p_instr p = &buff;
28 if (!EM_open(filename)) {
32 O_init((arith) EM_wordsize, (arith) EM_pointersize);
34 if (!O_open(argv[2])) {
35 fatal("O_open failed");
38 else if (!O_open( (char *) 0)) fatal("O_open failed");
43 EM_getinstr(p=GETNXTPATT());
49 switch(p->em_argtype) {
51 p->em_dnam = OO_freestr(p->em_dnam);
54 p->em_pnam = OO_freestr(p->em_pnam);
60 p->em_string = OO_freestr(p->em_string);
65 switch(p->em_opcode) {
82 error("%s", EM_error);
85 fatal("%s", EM_error);
101 filename ? filename : "standard input",
103 fprintf(stderr,s,a1,a2,a3,a4);
104 fprintf(stderr, "\n");
112 error(s,a1,a2,a3,a4);