Subversion Repositories tendra.SVN

Rev

Rev 5 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
6 7u83 2
 * Copyright (c) 2002-2005 The TenDRA Project <http://www.tendra.org/>.
3
 * All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions are met:
7
 *
8
 * 1. Redistributions of source code must retain the above copyright notice,
9
 *    this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright notice,
11
 *    this list of conditions and the following disclaimer in the documentation
12
 *    and/or other materials provided with the distribution.
13
 * 3. Neither the name of The TenDRA Project nor the names of its contributors
14
 *    may be used to endorse or promote products derived from this software
15
 *    without specific, prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
18
 * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
19
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
21
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22
 * EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
 *
29
 * $Id$
30
 */
31
/*
2 7u83 32
    		 Crown Copyright (c) 1997
6 7u83 33
 
2 7u83 34
    This TenDRA(r) Computer Program is subject to Copyright
35
    owned by the United Kingdom Secretary of State for Defence
36
    acting through the Defence Evaluation and Research Agency
37
    (DERA).  It is made available to Recipients with a
38
    royalty-free licence for its use, reproduction, transfer
39
    to other parties and amendment for any purpose not excluding
40
    product development provided that any such use et cetera
41
    shall be deemed to be acceptance of the following conditions:-
6 7u83 42
 
2 7u83 43
        (1) Its Recipients shall ensure that this Notice is
44
        reproduced upon any copies or amended versions of it;
6 7u83 45
 
2 7u83 46
        (2) Any amended version of it shall be clearly marked to
47
        show both the nature of and the organisation responsible
48
        for the relevant amendment or amendments;
6 7u83 49
 
2 7u83 50
        (3) Its onward transfer from a recipient to another
51
        party shall be deemed to be that party's acceptance of
52
        these conditions;
6 7u83 53
 
2 7u83 54
        (4) DERA gives no warranty or assurance as to its
55
        quality or suitability for any purpose and DERA accepts
56
        no liability whatsoever in relation to any use to which
57
        it may be put.
58
*/
59
 
60
 
61
/**********************************************************************
62
$Author: release $
63
$Date: 1998/01/17 15:55:46 $
64
$Revision: 1.1.1.1 $
65
$Log: diagtypes.h,v $
66
 * Revision 1.1.1.1  1998/01/17  15:55:46  release
67
 * First version to be checked into rolling release.
68
 *
69
 * Revision 1.4  1998/01/11  18:45:10  pwe
70
 * consistent new/old diags
71
 *
72
 * Revision 1.3  1997/12/04  19:36:45  pwe
73
 * ANDF-DE V1.9
74
 *
75
 * Revision 1.2  1997/08/23  13:27:17  pwe
76
 * initial ANDF-DE
77
 *
78
 * Revision 1.1  1995/04/06  10:42:55  currie
79
 * Initial revision
80
 *
81
***********************************************************************/
82
#ifndef diagtypes_key
83
#define diagtypes_key 1
84
 
85
 
86
#ifdef NEWDIAGS
87
 
88
typedef dg_name diag_descriptor;
89
typedef dg_name_list diag_descriptor_list;
90
typedef dg_name_list diag_unit;
91
typedef dg_tag diag_tag;
92
typedef dgtag_struct diag_tagdef;
93
typedef int diag_tagdef_list;
94
typedef dg_type diag_type;
95
typedef dg_type_list diag_type_list;
96
typedef dg_enum enum_values;
97
typedef dg_enum_list enum_values_list;
98
typedef dg_classmem diag_field;
99
typedef dg_classmem_list diag_field_list;
100
typedef int diag_tq;
101
typedef dg_filename filename;
102
typedef dg_sourcepos sourcemark;
103
typedef int diag_type_unit;
104
 
105
 
106
#else
107
 
108
				/* temp hacsk to check syntax */
109
 
110
				/* end hacks */
111
				/* dummy defs of lists */
112
 
113
				/* end dummy defs */
114
				/* forward defns for compiler pacification */
115
 
116
#include "diagtypes1.h"
117
 
118
 
119
				/* end forward defns */
120
 
6 7u83 121
struct filename_t {
122
	nat		date;
123
	tdfstring	machine;
124
	tdfstring	file;
2 7u83 125
};
126
 
6 7u83 127
typedef	struct sourcemark_t {
128
	filename	file;
129
	nat		line_no;
130
	nat		char_off;
2 7u83 131
} sourcemark;
132
 
6 7u83 133
struct enum_values_t {
134
	exp		val;
135
	tdfstring	nme;
2 7u83 136
};
137
 
6 7u83 138
typedef struct enum_values_t *enum_values;
2 7u83 139
 
6 7u83 140
struct enum_values_list_t {
141
	int		len;
142
	int		lastused;
143
	enum_values	*array;
2 7u83 144
};
145
 
6 7u83 146
typedef struct enum_values_list_t *enum_values_list;
2 7u83 147
 
6 7u83 148
struct diag_field_t {
149
	tdfstring	field_name;
150
	exp		where;
151
	diag_type	field_type;
2 7u83 152
};
153
 
154
typedef struct diag_field_t *diag_field;
155
 
6 7u83 156
struct diag_field_list_t {
157
	int		len;
158
	int		lastused;
159
	diag_field	*array;
2 7u83 160
};
161
 
6 7u83 162
typedef struct diag_field_list_t *diag_field_list;
2 7u83 163
 
6 7u83 164
struct diag_type_list_t {
165
	int		len;
166
	int		lastused;
167
	diag_type 		*array;
2 7u83 168
};
169
 
170
typedef struct diag_type_list_t *diag_type_list;
171
 
6 7u83 172
typedef struct {
173
	unsigned	is_const:1;
174
	unsigned	is_volatile:1;
2 7u83 175
} diag_tq;
176
 
177
 
178
typedef tdfint diag_tag;
179
 
6 7u83 180
struct diag_tagdef_t {
181
	diag_tag	d_tag;
182
	char        	*ext_name;
183
	diag_type	d_type;
2 7u83 184
};
185
 
186
typedef struct diag_tagdef_t diag_tagdef;
187
 
6 7u83 188
typedef enum {
189
	DIAG_TYPE_UNINIT,
190
	DIAG_TYPE_ARRAY,
191
	DIAG_TYPE_BITFIELD,
192
	DIAG_TYPE_ENUM,
193
	DIAG_TYPE_FLOAT,
194
	DIAG_TYPE_LOC,
195
	DIAG_TYPE_PROC,
196
	DIAG_TYPE_PTR,
197
	DIAG_TYPE_STRUCT,
198
	DIAG_TYPE_NULL,
199
	DIAG_TYPE_UNION,
200
	DIAG_TYPE_VARIETY,
201
	DIAG_TYPE_INITED
2 7u83 202
} diag_type_key;
203
 
6 7u83 204
struct diag_type_t {
205
	diag_type_key	key;
206
	OUTPUT_REC been_outed;
207
	union {
208
		struct {
209
			diag_type		element_type;
210
			exp			stride;
211
			exp			lower_b;
212
			exp			upper_b;
213
			diag_type		index_type;
214
		} array;
215
		struct {
216
			diag_type		result_type;
217
			nat			no_of_bits;
218
		} bitfield;
219
		struct {
220
			diag_type		base_type;
221
			tdfstring		nme;
222
			enum_values_list	values;
223
		} t_enum;
224
		floating_variety		f_var;
225
		struct {
226
			diag_type		object;
227
			diag_tq			qualifier;
228
		} loc;
229
		struct {
230
			diag_type_list		params;
231
			bool 			opt_args;
232
			diag_type		result_type;
233
		} proc;
234
		struct {
235
			diag_type		object;
236
			diag_tq			qualifier;
237
		} ptr;
238
		struct {
239
			shape			tdf_shape;
240
			tdfstring		nme;
241
			diag_field_list 	fields;
242
		} t_struct;
243
		struct {
244
			shape			tdf_shape;
245
			tdfstring		nme;
246
			diag_field_list 	fields;
247
		} t_union;
248
		variety		var;
249
	} data;
2 7u83 250
};
251
 
6 7u83 252
typedef enum {
253
	DIAG_UNINIT,
254
	DIAG_ID_KEY,
255
	DIAG_STRUCT_KEY,
256
	DIAG_TYPEDEF_KEY
2 7u83 257
} diag_desc_key;
258
 
6 7u83 259
typedef struct diagdef_t {
260
	diag_desc_key 	key;
261
	char		*ext_name;
262
	union {
263
		struct {
264
			tdfstring 	nme;
265
			diag_type 	new_type;
266
			sourcemark 	whence;
267
			exp		access;
268
		} id;
269
		struct {
270
			tdfstring 	nme;
271
			diag_type	new_type;
272
			sourcemark 	whence;
273
		} struc;
274
		struct {
275
			tdfstring	nme;
276
			diag_type	new_type;
277
			sourcemark 	whence;
278
		} typ;
279
	} data;
2 7u83 280
} diagdef;
281
				/* diag_descriptor is in diagtypes1.h */
282
 
6 7u83 283
typedef struct diag_unit_t {
284
	int		len;
285
	int		lastused;
286
	diag_descriptor *array;
2 7u83 287
} diag_unit;
288
 
289
typedef diag_unit diag_descriptor_list;
290
 
291
typedef int diag_type_unit;
292
typedef diag_type_unit diag_tagdef_list;
293
 
294
#include "diaginfo.h"
295
 
296
#endif
297
#endif