Pristine Ack-5.5
[Ack-5.5.git] / util / ego / ic / ic.h
1 /* $Id: ic.h,v 1.7 1994/06/24 10:24:03 ceriel Exp $ */
2 /*
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".
5  */
6 /*  I N T E R M E D I A T E   C O D E
7  *
8  *  G L O B A L   C O N S T A N T S  &  V A R I A B L E S
9  */
10
11
12 /* Data structures for Intermediate Code generation */
13
14 typedef struct sym *sym_p;
15 typedef struct prc *prc_p;
16 typedef struct num *num_p;
17
18
19 struct sym {
20         sym_p    sy_next;       /* link                                 */
21         char     *sy_name;      /* name of the symbol                   */
22         dblock_p sy_dblock;     /* pointer to dblock struct             */
23 };
24 struct prc {
25         prc_p    pr_next;       /* link                                 */
26         char     *pr_name;      /* name of the procedure                */
27         proc_p   pr_proc;       /* pointer tto proc struct              */
28 };
29
30
31 struct num {
32         num_p    n_next;        /* link                                 */
33         unsigned n_number;      /* EM repr. e.g. 120 in 'BRA *120'      */
34         lab_id   n_labid;       /* sequential integer repr. of  IC      */
35 };
36
37
38
39 /* macros used by ic_lib.c and ic_io.c: */
40
41 #define ARCHIVE 0
42 #define NO_ARCHIVE 1
43
44
45 /*
46  * The next constants are close to sp_cend for fast switches
47  */
48 #define INST    256     /* instruction:         number in tabval */
49 #define PSEU    257     /* pseudo:              number in tabval */
50 #define ILBX    258     /* label:               number in tabval */
51 #define DLBX    259     /* symbol:              name in string[] */
52 #define CSTX1   260     /* short constant:      stored in tabval */
53 #define CSTX2   261     /* offset:              value in tabval2 */
54 #define VALX1   262     /* symbol+short:        in string[] and tabval */
55 #define VALX2   263     /* symbol+offset:       in string[] and tabval2 */
56 #define ATEOF   264     /* bumped into end of file */
57
58 /* Global variables */
59
60 extern dblock_p db;
61 extern dblock_p hol0_db;                /* ABS block */
62 extern dblock_p         ldblock;        /* last dblock processed so  far   */
63 extern proc_p           lproc;          /* last proc processed so far  */
64 extern short            tabval;         /* used by table1, table2 and table3 */
65 extern offset           tabval2;
66 extern char             string[];
67 extern line_p           lastline;       /* last line read */
68 extern int              labelcount;     /* # labels in current procedure */
69 extern obj_id           lastoid;        /* last object identifier used  */
70 extern proc_id          lastpid;        /* last proc   identifier used  */
71 extern lab_id           lastlid;        /* last label  identifier used  */
72 extern dblock_id        lastdid;        /* last dblock identifier used  */
73
74 extern byte em_flag[];
75