1 /* T Y P E D E S C R I P T O R S T R U C T U R E */
5 struct paramlist { /* structure for parameterlist of a PROCEDURE */
6 struct paramlist *next;
7 struct def *par_def; /* "df" of parameter */
8 #define IsVarParam(xpar) ((xpar)->par_def->df_flags & D_VARPAR)
9 #define TypeOfParam(xpar) ((xpar)->par_def->df_type)
12 /* ALLOCDEF "paramlist" 50 */
16 unsigned int en_ncst; /* number of constants */
17 label en_rck; /* label of range check descriptor */
18 #define enm_enums tp_value.tp_enum.en_enums
19 #define enm_ncst tp_value.tp_enum.en_ncst
20 #define enm_rck tp_value.tp_enum.en_rck
24 arith su_lb, su_ub; /* lower bound and upper bound */
25 label su_rck; /* label of range check descriptor */
26 #define sub_lb tp_value.tp_subrange.su_lb
27 #define sub_ub tp_value.tp_subrange.su_ub
28 #define sub_rck tp_value.tp_subrange.su_rck
32 struct type *ar_elem; /* type of elements */
34 struct { /* normal array */
35 arith ar_elsize; /* size of elements */
36 label ar_descr; /* label of array descriptor */
38 struct { /* conformant array */
39 int cf_sclevel; /* scope level of declaration */
40 arith cf_descr; /* offset array descriptor */
43 #define arr_elem tp_value.tp_arr.ar_elem
44 #define arr_elsize tp_value.tp_arr.ar_type.norm_arr.ar_elsize
45 #define arr_ardescr tp_value.tp_arr.ar_type.norm_arr.ar_descr
46 #define arr_cfdescr tp_value.tp_arr.ar_type.conf_arr.cf_descr
47 #define arr_sclevel tp_value.tp_arr.ar_type.conf_arr.cf_sclevel
51 struct type *sel_type; /* type of the selector of a variant */
52 arith sel_ncst; /* number of values of selector type */
53 arith sel_lb; /* lower bound of selector type */
54 struct selector **sel_ptrs; /* tagvalue table with pointers to
55 nested variant-selectors */
59 struct scope *rc_scope; /* scope of this record */
60 /* members are in the symbol table */
61 struct selector *rc_selector; /* selector of variant (if present) */
62 #define rec_scope tp_value.tp_record.rc_scope
63 #define rec_sel tp_value.tp_record.rc_selector
67 struct paramlist *pr_params;
69 #define prc_params tp_value.tp_proc.pr_params
70 #define prc_nbpar tp_value.tp_proc.pr_nbpar
74 struct type *next; /* used with ARRAY, PROCEDURE, FILE, SET,
76 int tp_fund; /* fundamental type or constructor */
77 #define T_ENUMERATION 0x0001
78 #define T_INTEGER 0x0002
81 #define T_PROCEDURE 0x0010
82 #define T_FUNCTION 0x0020
84 #define T_STRINGCONST 0x0080
85 #define T_SUBRANGE 0x0100
87 #define T_ARRAY 0x0400
88 #define T_RECORD 0x0800
89 #define T_POINTER 0x1000
91 #define T_STRING 0x4000
92 #define T_ERROR 0x8000 /* bad type */
93 #define T_NUMERIC (T_INTEGER | T_REAL | T_LONG)
94 #define T_INDEX (T_SUBRANGE | T_ENUMERATION | T_CHAR | T_INTEGER )
95 #define T_ORDINAL (T_INDEX | T_LONG)
96 #define T_CONSTRUCTED (T_ARRAY | T_SET | T_RECORD | T_FILE | T_STRINGCONST)
97 #define T_ROUTINE (T_FUNCTION | T_PROCEDURE)
98 unsigned short tp_flags;
99 #define T_HASFILE 0x1 /* set if type has a filecomponent */
100 #define T_PACKED 0x2 /* set if type is packed */
101 #define T_CHECKED 0x4 /* set if array has been checked */
103 short tp_dbindex; /* index in debugger symbol table */
105 int tp_align; /* alignment requirement of this type */
106 int tp_palign; /* in packed structures */
107 arith tp_size; /* size of this type */
108 arith tp_psize; /* in packed structures */
110 struct enume tp_enum;
111 struct subrange tp_subrange;
113 struct record tp_record;
118 /* ALLOCDEF "type" 50 */
132 *error_type; /* All from type.c */
136 #include "target_sizes.h"
137 #define word_align (AL_WORD)
138 #define int_align (AL_INT)
139 #define long_align (AL_LONG)
140 #define pointer_align (AL_POINTER)
141 #define real_align (AL_REAL)
142 #define struct_align (AL_STRUCT)
144 #define word_size (SZ_WORD)
145 #define int_size (SZ_INT)
146 #define long_size (SZ_LONG)
147 #define pointer_size (SZ_POINTER)
148 #define real_size (SZ_REAL)
156 struct_align; /* All from type.c */
163 real_size; /* All from type.c */
175 *subr_type(); /* All from type.c */
177 #define NULLTYPE ((struct type *) 0)
179 #define bounded(tpx) ((tpx)->tp_fund & T_INDEX)
180 #define WA(sz) (align(sz, (int) word_size))
181 #define ResultType(tpx) (assert((tpx)->tp_fund & T_ROUTINE),(tpx)->next)
182 #define ElementType(tpx) (assert((tpx)->tp_fund & T_SET), (tpx)->next)
183 #define BaseType(tpx) ((tpx)->tp_fund & T_SUBRANGE ? (tpx)->next :\
185 #define IndexType(tpx) (assert((tpx)->tp_fund == T_ARRAY), (tpx)->next)
186 #define IsConstructed(tpx) ((tpx)->tp_fund & T_CONSTRUCTED)
187 #define IsConformantArray(tpx) ((tpx)->tp_fund & T_ARRAY &&\
189 #define IsPacked(tpx) ((tpx)->tp_flags & T_PACKED)
190 #define PointedtoType(tpx) (assert((tpx)->tp_fund == T_POINTER ||\
191 (tpx)->tp_fund == T_FILE), (tpx)->next)
192 #define ParamList(tpx) (assert((tpx)->tp_fund & T_ROUTINE),\
195 extern long full_mask[];
197 #define ufit(n, i) (((n) & ~full_mask[(i)]) == 0)