Pristine Ack-5.5
[Ack-5.5.git] / lang / pc / comp / desig.H
1 /* D E S I G N A T O R   D E S C R I P T I O N S */
2
3 /* Generating code for designators is not particularly easy, especially if
4    you don't know whether you want the address or the value.
5    The next structure is used to generate code for designators.
6    It contains information on how to find the designator, after generation
7    of the code that is common to both address and value computations.
8 */
9
10 struct desig    {
11         int     dsg_kind;
12 #define DSG_INIT        0       /* don't know anything yet */
13 #define DSG_LOADED      1       /* designator loaded on top of the stack */
14 #define DSG_PLOADED     2       /* designator accessible through pointer on
15                                    stack, possibly with an offset
16                                 */
17 #define DSG_FIXED       3       /* designator directly accessible */
18 #define DSG_PFIXED      4       /* designator accessible through directly
19                                    accessible pointer
20                                 */
21 #define DSG_INDEXED     5       /* designator accessible through array
22                                    operation. Address of array descriptor on
23                                    top of the stack, index beneath that, and
24                                    base address beneath that
25                                 */
26         arith   dsg_offset;     /* contains an offset for PLOADED,
27                                    or for FIXED or PFIXED it contains an
28                                    offset from dsg_name, if it exists,
29                                    or from the current Local Base
30                                 */
31         char    *dsg_name;      /* name of global variable, used for
32                                    FIXED and PFIXED
33                                 */
34         struct def *dsg_def;    /* def structure associated with this
35                                    designator, or 0
36                                 */
37         int dsg_packed;         /* designator is packed or not */
38 };
39
40 /* The next structure describes the designator in a with-statement.
41    We have a linked list of them, as with-statements may be nested.
42 */
43
44 struct withdesig        {
45         struct withdesig *w_next;
46         struct scope *w_scope;  /* scope in which fields of this record
47                                    reside
48                                 */
49         struct desig w_desig;   /* a desig structure for this particular
50                                    designator
51                                 */
52 };
53
54 /* ALLOCDEF "withdesig" 5 */
55
56 extern struct withdesig *WithDesigs;
57 extern struct desig     InitDesig;
58
59 #define NO_LABEL        ((label) 0)