Pristine Ack-5.5
[Ack-5.5.git] / lang / basic / src / bem.c
1 /*
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".
4  */
5
6 #include "bem.h"
7
8 #ifndef NORSCID
9 static char rcs_id[]    = "$Id: bem.c,v 1.3 1994/06/24 11:30:31 ceriel Exp $" ;
10 static char rcs_bem[]   = RCS_BEM ;
11 static char rcs_symb[]  = RCS_SYMB ;
12 static char rcs_graph[] = RCS_GRAPH ;
13 #endif
14
15 /* Author: M.L. Kersten
16 **
17 ** This is the main routine for the BASIC-EM frontend.
18 ** Program parameters are decoded, the BASIC program is parsed
19 ** and compiled to an executable program
20 **
21 ** Bem expects at least three parameters. One ending with '.i' is considered
22 ** the input to the compiler, '.e' denotes the file to be generated,
23 ** and the last name denotes the name of the user supplied file name.
24 ** The latter is used to store the data entries.
25 ** Additional flags may be supplied, see parseparms.
26 */
27
28 char    *program;
29
30 char    datfname[MAXFILENAME] ;
31
32 char    *inpfile, *outfile;
33 int     BEMINTSIZE = EMINTSIZE;
34 int     BEMPTRSIZE = EMPTRSIZE;
35 int     BEMFLTSIZE = EMFLTSIZE;
36 main(argc,argv)
37 int argc;
38 char **argv;
39 {
40         extern int errorcnt;
41
42         /* parseparams */
43         parseparams(argc,argv);
44         /* initialize the system */
45         initialize();
46         /* compile source programs */
47         compileprogram();
48         linewarnings();
49         C_close();
50         if( errorcnt) sys_stop(S_EXIT);
51         /* process em object files */
52         sys_stop(S_END);   /* This was not done in the old compiler */
53 }