Subversion Repositories tendra.SVN

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 7
Line -... Line 1...
-
 
1
/*
-
 
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
 */
1
/*
31
/*
2
    		 Crown Copyright (c) 1997
32
    		 Crown Copyright (c) 1997
3
    
33
 
4
    This TenDRA(r) Computer Program is subject to Copyright
34
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
35
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
36
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
37
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
38
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
39
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
40
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
41
    shall be deemed to be acceptance of the following conditions:-
12
    
42
 
13
        (1) Its Recipients shall ensure that this Notice is
43
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
44
        reproduced upon any copies or amended versions of it;
15
    
45
 
16
        (2) Any amended version of it shall be clearly marked to
46
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
47
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
48
        for the relevant amendment or amendments;
19
    
49
 
20
        (3) Its onward transfer from a recipient to another
50
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
51
        party shall be deemed to be that party's acceptance of
22
        these conditions;
52
        these conditions;
23
    
53
 
24
        (4) DERA gives no warranty or assurance as to its
54
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
55
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
56
        no liability whatsoever in relation to any use to which
27
        it may be put.
57
        it may be put.
28
*/
58
*/
Line 52... Line 82...
52
#ifndef diagtypes_key
82
#ifndef diagtypes_key
53
#define diagtypes_key 1
83
#define diagtypes_key 1
54
 
84
 
55
 
85
 
56
#ifdef NEWDIAGS
86
#ifdef NEWDIAGS
57
 
87
 
58
typedef dg_name diag_descriptor;
88
typedef dg_name diag_descriptor;
59
typedef dg_name_list diag_descriptor_list;
89
typedef dg_name_list diag_descriptor_list;
60
typedef dg_name_list diag_unit;
90
typedef dg_name_list diag_unit;
61
typedef dg_tag diag_tag;
91
typedef dg_tag diag_tag;
62
typedef dgtag_struct diag_tagdef;
92
typedef dgtag_struct diag_tagdef;
Line 68... Line 98...
68
typedef dg_classmem diag_field;
98
typedef dg_classmem diag_field;
69
typedef dg_classmem_list diag_field_list;
99
typedef dg_classmem_list diag_field_list;
70
typedef int diag_tq;
100
typedef int diag_tq;
71
typedef dg_filename filename;
101
typedef dg_filename filename;
72
typedef dg_sourcepos sourcemark;
102
typedef dg_sourcepos sourcemark;
73
typedef int diag_type_unit;
103
typedef int diag_type_unit;
74
 
104
 
75
 
105
 
76
#else
106
#else
77
 
107
 
78
				/* temp hacsk to check syntax */
108
				/* temp hacsk to check syntax */
79
 
109
 
80
				/* end hacks */
110
				/* end hacks */
81
				/* dummy defs of lists */
111
				/* dummy defs of lists */
82
 
112
 
83
				/* end dummy defs */
113
				/* end dummy defs */
84
				/* forward defns for compiler pacification */
114
				/* forward defns for compiler pacification */
85
 
115
 
86
#include "diagtypes1.h"
116
#include "diagtypes1.h"
87
 
-
 
88
 
117
 
89
				/* end forward defns */
-
 
90
 
118
 
91
struct filename_t 
-
 
92
{
-
 
93
  nat		date;
-
 
94
  tdfstring	machine;
-
 
95
  tdfstring	file;
119
				/* end forward defns */
96
};
-
 
97
 
120
 
98
typedef	struct sourcemark_t
121
struct filename_t {
-
 
122
	nat		date;
-
 
123
	tdfstring	machine;
-
 
124
	tdfstring	file;
-
 
125
};
99
{
126
 
-
 
127
typedef	struct sourcemark_t {
100
  filename	file;
128
	filename	file;
101
  nat		line_no;
129
	nat		line_no;
102
  nat		char_off;
130
	nat		char_off;
103
} sourcemark;
131
} sourcemark;
104
 
132
 
105
struct enum_values_t
133
struct enum_values_t {
106
{
-
 
107
  exp		val;
134
	exp		val;
108
  tdfstring	nme;
135
	tdfstring	nme;
109
};
136
};
110
 
137
 
111
typedef struct enum_values_t *	enum_values;
138
typedef struct enum_values_t *enum_values;
112
 
-
 
113
struct enum_values_list_t 
-
 
114
{
-
 
115
  int		len;
-
 
116
  int		lastused;
-
 
117
  enum_values *		array;
-
 
118
};
-
 
119
 
-
 
120
typedef struct enum_values_list_t *	enum_values_list;
-
 
121
 
-
 
122
struct diag_field_t
-
 
123
{
-
 
124
  tdfstring	field_name;
-
 
125
  exp		where;
-
 
126
  diag_type	field_type;
-
 
127
};
-
 
128
 
-
 
129
typedef struct diag_field_t *diag_field;
-
 
130
 
-
 
131
struct diag_field_list_t 
-
 
132
{
-
 
133
  int		len;
-
 
134
  int		lastused;
-
 
135
  diag_field *	array;
-
 
136
};
-
 
137
 
-
 
138
typedef struct diag_field_list_t *	diag_field_list;
-
 
139
 
139
 
-
 
140
struct enum_values_list_t {
-
 
141
	int		len;
-
 
142
	int		lastused;
-
 
143
	enum_values	*array;
-
 
144
};
-
 
145
 
-
 
146
typedef struct enum_values_list_t *enum_values_list;
-
 
147
 
-
 
148
struct diag_field_t {
-
 
149
	tdfstring	field_name;
-
 
150
	exp		where;
-
 
151
	diag_type	field_type;
-
 
152
};
-
 
153
 
-
 
154
typedef struct diag_field_t *diag_field;
-
 
155
 
140
struct diag_type_list_t
156
struct diag_field_list_t {
-
 
157
	int		len;
-
 
158
	int		lastused;
-
 
159
	diag_field	*array;
-
 
160
};
-
 
161
 
-
 
162
typedef struct diag_field_list_t *diag_field_list;
141
{
163
 
-
 
164
struct diag_type_list_t {
142
  int		len;
165
	int		len;
143
  int		lastused;
166
	int		lastused;
144
  diag_type 		*array;
167
	diag_type 		*array;
145
};
168
};
146
 
169
 
147
typedef struct diag_type_list_t *diag_type_list;
170
typedef struct diag_type_list_t *diag_type_list;
148
 
171
 
149
typedef struct 
172
typedef struct {
150
{	 	
-
 
151
  unsigned	is_const:1;
173
	unsigned	is_const:1;
152
  unsigned	is_volatile:1;
174
	unsigned	is_volatile:1;
153
} diag_tq;
175
} diag_tq;
154
 
176
 
155
 
177
 
156
typedef tdfint diag_tag;
178
typedef tdfint diag_tag;
157
 
179
 
158
struct diag_tagdef_t
180
struct diag_tagdef_t {
159
{
-
 
160
  diag_tag	d_tag;
181
	diag_tag	d_tag;
161
  char        *	ext_name;
182
	char        	*ext_name;
162
  diag_type	d_type;
183
	diag_type	d_type;
163
};
184
};
164
 
185
 
165
typedef struct diag_tagdef_t diag_tagdef;
186
typedef struct diag_tagdef_t diag_tagdef;
166
 
187
 
167
typedef enum 
188
typedef enum {
168
{
-
 
169
  DIAG_TYPE_UNINIT,
189
	DIAG_TYPE_UNINIT,
170
  DIAG_TYPE_ARRAY,
190
	DIAG_TYPE_ARRAY,
171
  DIAG_TYPE_BITFIELD,
191
	DIAG_TYPE_BITFIELD,
172
  DIAG_TYPE_ENUM,
192
	DIAG_TYPE_ENUM,
173
  DIAG_TYPE_FLOAT,
193
	DIAG_TYPE_FLOAT,
174
  DIAG_TYPE_LOC,
194
	DIAG_TYPE_LOC,
175
  DIAG_TYPE_PROC,
195
	DIAG_TYPE_PROC,
176
  DIAG_TYPE_PTR,
196
	DIAG_TYPE_PTR,
177
  DIAG_TYPE_STRUCT,
197
	DIAG_TYPE_STRUCT,
178
  DIAG_TYPE_NULL,
198
	DIAG_TYPE_NULL,
179
  DIAG_TYPE_UNION,
199
	DIAG_TYPE_UNION,
180
  DIAG_TYPE_VARIETY,
200
	DIAG_TYPE_VARIETY,
181
  DIAG_TYPE_INITED
201
	DIAG_TYPE_INITED
182
} diag_type_key;
202
} diag_type_key;
183
 
203
 
184
struct diag_type_t 
204
struct diag_type_t {
185
{
-
 
186
  diag_type_key	key;
205
	diag_type_key	key;
187
  OUTPUT_REC been_outed;
206
	OUTPUT_REC been_outed;
188
  union
207
	union {
189
  {
-
 
190
    struct
208
		struct {
191
    {
-
 
192
      diag_type		element_type;
209
			diag_type		element_type;
193
      exp		stride;
210
			exp			stride;
194
      exp		lower_b;
211
			exp			lower_b;
195
      exp		upper_b;
212
			exp			upper_b;
196
      diag_type		index_type;
213
			diag_type		index_type;
197
    } array;
214
		} array;
198
    struct
215
		struct {
199
    {
-
 
200
      diag_type		result_type;
216
			diag_type		result_type;
201
      nat		no_of_bits;
217
			nat			no_of_bits;
202
    } bitfield;
218
		} bitfield;
203
    struct
219
		struct {
204
    {
-
 
205
      diag_type		base_type;
220
			diag_type		base_type;
206
      tdfstring		nme;
221
			tdfstring		nme;
207
      enum_values_list	values;
222
			enum_values_list	values;
208
    } t_enum;
223
		} t_enum;
209
    floating_variety	f_var;
224
		floating_variety		f_var;
210
    struct
225
		struct {
211
    {
-
 
212
      diag_type		object;
226
			diag_type		object;
213
      diag_tq		qualifier;
227
			diag_tq			qualifier;
214
    } loc;
228
		} loc;
215
    struct
229
		struct {
216
    {
-
 
217
      diag_type_list	params;
230
			diag_type_list		params;
218
      bool 		opt_args;
231
			bool 			opt_args;
219
      diag_type		result_type;
232
			diag_type		result_type;
220
    } proc;
233
		} proc;
221
    struct
234
		struct {
222
    {
-
 
223
      diag_type		object;
235
			diag_type		object;
224
      diag_tq		qualifier;
236
			diag_tq			qualifier;
225
    } ptr;
237
		} ptr;
226
    struct
238
		struct {
227
    {
-
 
228
      shape		tdf_shape;
239
			shape			tdf_shape;
229
      tdfstring		nme;
240
			tdfstring		nme;
230
      diag_field_list fields;
241
			diag_field_list 	fields;
231
    } t_struct;
242
		} t_struct;
232
    struct
243
		struct {
233
    {
-
 
234
      shape		tdf_shape;
244
			shape			tdf_shape;
235
      tdfstring		nme;
245
			tdfstring		nme;
236
      diag_field_list fields;
246
			diag_field_list 	fields;
237
    } t_union;
247
		} t_union;
238
    variety		var;
248
		variety		var;
239
  } data;
249
	} data;
240
};
250
};
241
 
251
 
242
typedef enum 
252
typedef enum {
243
{
-
 
244
  DIAG_UNINIT,
253
	DIAG_UNINIT,
245
  DIAG_ID_KEY,
254
	DIAG_ID_KEY,
246
  DIAG_STRUCT_KEY,
255
	DIAG_STRUCT_KEY,
247
  DIAG_TYPEDEF_KEY
256
	DIAG_TYPEDEF_KEY
248
} diag_desc_key;
257
} diag_desc_key;
249
 
258
 
250
typedef struct diagdef_t
259
typedef struct diagdef_t {
251
{
-
 
252
  diag_desc_key 	key;
260
	diag_desc_key 	key;
253
  char * 		ext_name;
261
	char		*ext_name;
254
  union	
262
	union {
255
  {
-
 
256
    struct 
263
		struct {
257
    {
-
 
258
      tdfstring 	nme;
264
			tdfstring 	nme;
259
      diag_type 	new_type;
265
			diag_type 	new_type;
260
      sourcemark 	whence;
266
			sourcemark 	whence;
261
      exp		access;
267
			exp		access;
262
    } id;
268
		} id;
263
    struct
269
		struct {
264
    {
-
 
265
      tdfstring 	nme;
270
			tdfstring 	nme;
266
      diag_type		new_type;
271
			diag_type	new_type;
267
      sourcemark 	whence;
272
			sourcemark 	whence;
268
    } struc;
273
		} struc;
269
    struct
274
		struct {
270
    {
-
 
271
      tdfstring		nme;
275
			tdfstring	nme;
272
      diag_type		new_type;
276
			diag_type	new_type;
273
      sourcemark 	whence;
277
			sourcemark 	whence;
274
    } typ;
278
		} typ;
275
  } data;
279
	} data;
276
} diagdef;
280
} diagdef;
277
				/* diag_descriptor is in diagtypes1.h */
281
				/* diag_descriptor is in diagtypes1.h */
278
 
282
 
279
typedef struct diag_unit_t
283
typedef struct diag_unit_t {
280
{
-
 
281
  int		len;
284
	int		len;
282
  int		lastused;
285
	int		lastused;
283
  diag_descriptor *	array;
286
	diag_descriptor *array;
284
} diag_unit;
287
} diag_unit;
285
 
288
 
286
typedef diag_unit diag_descriptor_list;
289
typedef diag_unit diag_descriptor_list;
287
 
290
 
288
typedef int diag_type_unit;
291
typedef int diag_type_unit;
Line 290... Line 293...
290
 
293
 
291
#include "diaginfo.h"
294
#include "diaginfo.h"
292
 
295
 
293
#endif
296
#endif
294
#endif
297
#endif
295
 
-