1 /* $Id: type.hh,v 1.10 1994/06/24 11:01:43 ceriel Exp $ */
3 /* internal type representation */
5 /* structure for struct/union elements */
7 long fld_pos; /* position of field */
8 long fld_bitsize; /* size in bits */
9 struct type *fld_type; /* type of field */
10 char *fld_name; /* name of field */
13 /* structure for enumeration literals */
15 long lit_val; /* value of literal */
16 char *lit_name; /* name of literal */
19 /* structure for parameters */
21 struct type *par_type; /* type of parameter */
22 long par_off; /* offset of parameter */
23 char par_kind; /* kind of parameter ('p', 'i', or 'v') */
41 #define T_STRING 14 /* only for string constants ... */
42 #define T_CROSS 15 /* cross reference to type */
43 #define T_INCOMPLETE 100
45 struct symbol *ty_sym;
47 /* cross references */
48 struct type *typ_cross;
49 #define ty_cross ty_v.typ_cross
50 /* procedures/functions: */
53 struct type *typ_retval;
54 struct param *typ_params;
57 #define ty_nparams ty_v.ty_proc.typ_nparams
58 #define ty_retval ty_v.ty_proc.typ_retval
59 #define ty_params ty_v.ty_proc.typ_params
60 #define ty_nbparams ty_v.ty_proc.typ_nbparams
61 /* pointers, files: */
62 struct type *typ_ptrto;
63 #define ty_ptrto ty_v.typ_ptrto
64 #define ty_fileof ty_v.typ_ptrto
68 struct type *typ_index;
69 struct type *typ_elements;
71 #define ty_lb ty_v.ty_array.typ_lb
72 #define ty_hb ty_v.ty_array.typ_hb
73 #define ty_index ty_v.ty_array.typ_index
74 #define ty_elements ty_v.ty_array.typ_elements
79 struct type *typ_base;
81 #define ty_A ty_v.ty_subrange.typ_A
82 #define ty_low ty_v.ty_subrange.typ_low
83 #define ty_up ty_v.ty_subrange.typ_up
84 #define ty_base ty_v.ty_subrange.typ_base
85 /* structures/unions: */
87 unsigned typ_nfields; /* number of field structures */
88 struct fields *typ_fields;
90 #define ty_nfields ty_v.ty_struct.typ_nfields
91 #define ty_fields ty_v.ty_struct.typ_fields
94 unsigned typ_nenums; /* number of enumeration literals */
95 struct literal *typ_literals;
97 #define ty_nenums ty_v.ty_enum.typ_nenums
98 #define ty_literals ty_v.ty_enum.typ_literals
101 struct type *typ_setbase; /* base type of set elements */
102 long typ_setlow; /* low bound */
104 #define ty_setbase ty_v.ty_set.typ_setbase
105 #define ty_setlow ty_v.ty_set.typ_setlow
109 /* ALLOCDEF "type" 50 */
119 extern p_type char_type, uchar_type, bool_type, int_type,
120 long_type, double_type, string_type, address_type;
121 extern p_type void_type;
122 extern long int_size, short_size, pointer_size, long_size,
123 float_size, double_size;