Subversion Repositories tendra.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
    		 Crown Copyright (c) 1997
3
 
4
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
12
 
13
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
15
 
16
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
19
 
20
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
22
        these conditions;
23
 
24
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
27
        it may be put.
28
*/
29
 
30
 
31
/**********************************************************************
32
$Author: release $
33
$Date: 1998/01/17 15:55:45 $
34
$Revision: 1.1.1.1 $
35
$Log: toktypes.h,v $
36
 * Revision 1.1.1.1  1998/01/17  15:55:45  release
37
 * First version to be checked into rolling release.
38
 *
39
 * Revision 1.3  1997/08/23  13:31:10  pwe
40
 * no invert order, and initial ANDF-DE
41
 *
42
 * Revision 1.2  1995/06/22  09:21:11  currie
43
 * Signatures on tokens
44
 *
45
 * Revision 1.1  1995/04/06  10:43:34  currie
46
 * Initial revision
47
 *
48
***********************************************************************/
49
#ifndef toktypes_key
50
#define toktypes_key 1
51
 
52
 
53
 
54
/* definitions of types used in read_fns.c */
55
 
56
struct place_t {
57
  int  flag;  /* false if reading from stream, true if reading from pl_mem */
58
  char *pl_mem;	/* pointer to the characters */
59
  int  bits_on; /* bit_index displacement of the start */
60
};
61
 
62
typedef struct place_t  place;
63
typedef place bitstream;
64
typedef place bytestream;
65
 
66
typedef struct sortname_t
67
  {int code;	/* code number for the sort - see sortmacs.h */
68
   int result;	/* if code is TOKEN this is the code for the result */
69
   struct sortname_list_t {struct sortname_t * elems;
70
                           int number;
71
                          } pars;
72
	/* pars.elems is an array of pars.number parameter sorts 
73
	   if the code is TOKEN */
74
  } sortname;
75
 
76
typedef struct sortname_list_t sortname_list;
77
 
78
	/* dummy definition types */
79
typedef int token_defn;
80
typedef int capsule;
81
typedef int tokextern_list;
82
typedef int tagextern_list;
83
typedef int tokdef_list;
84
typedef int tagdec_list;
85
typedef int tagdef_list;
86
typedef int al_tagdef_list;
87
typedef int unit;
88
typedef int info;
89
typedef int info_list;
90
typedef int linkunit;
91
typedef int linkunit_list;
92
typedef int toklink_list;
93
typedef int taglink_list;
94
typedef int allink_list;
95
typedef int tokdec_list;
96
typedef int tokdec_unit;
97
typedef int tokdef_unit;
98
typedef int tagdec_unit;
99
typedef int tagdef_unit;
100
typedef int aldef_unit;
101
typedef int tokdec_unit_list;
102
typedef int tokdef_unit_list;
103
typedef int tagdec_unit_list;
104
typedef int tagdef_unit_list;
105
typedef int linkinfo_props;
106
 
107
 
108
typedef char usage;
109
 
110
struct tok_define_t;
111
 
112
#include "sort_union.h"
113
 
114
#define LOCAL_TOKS 4
115
 
116
typedef struct t_tag_con {
117
	dec * namet;
118
	exp e;
119
	struct t_tag_con * rest;
120
} tag_con;
121
 
122
typedef struct t_lab_con {
123
	label namel;
124
	exp e;
125
	struct t_lab_con * rest;
126
} lab_con;
127
 
128
 
129
typedef union tokval_u tokval;
130
 
131
struct tok_define_t {
132
     dec * * my_tagtab;		/* the tagtab current at the definition */
133
     aldef * * my_altab;	/* the altab current at the definition */
134
     exp * my_labtab;		/* the labtab current at the definition */
135
     struct tok_define_t * * my_toktab;
136
		/* the toktab current at the definition */
137
     diag_tagdef * * my_diagtab;	/* OLD DIAGS */
138
		/* the diagtab current at the definition */
139
     dgtag_struct * * my_dgtab;		/* NEW DIAGS */
140
		/* the dgtab current at the definition */
141
     char * tok_name;	/* the identifier (if any) for the token */
142
     struct tokformals_list_t	/* description of formal parameters */
143
       {
144
        sortname * par_sorts;	/* sorts of parameters */
145
        int * par_names;	/* token index for parameters */
146
        int number;		/* total number of parameters */
147
       } params;
148
     sortname tdsort;		/* sort of token result */
149
     place tdplace;		/* place to read definition from */
150
     int unit_number;		/* number of unit in which defined */
151
     union tokval_u tdvalue;	/* preserved value if valpresent */
152
     int tok_index;		/* index number of this token */
153
     int   tdtoken;		/* the token */
154
     struct t_context * tok_context;     /* the context at the token definition */
155
     char * signature; 
156
     unsigned int re_evaluate :1;	/* needs to be reevaluated */
157
     unsigned int defined : 1;
158
         /* for diagnostic purposes, remove later */
159
     unsigned int is_capsule_token :1;	/* it is a capsule level token */
160
     unsigned int recursive :1;	/* used to check against recursion */
161
     unsigned int valpresent :1;/* the value is constant and has been
162
				   computed already */
163
     unsigned int tok_special :1; /* locally defined token */
164
   };
165
 
166
 
167
 /* struct holding a token definition */
168
typedef struct tok_define_t  tok_define;
169
 
170
typedef tok_define * token;
171
 
172
typedef struct t_context{
173
        tok_define loctoks[LOCAL_TOKS];    
174
	tok_define * othertoks; /* most tokens have <=LOCAL_TOKS parameters and
175
				are not recursive so use of local space in
176
				apply_tok for 'tok_context' to avoid lots of
177
				mallocs ....*/ 
178
	short no_toks;
179
	short recursive;
180
	tag_con * tags;	   /* ... don't know how many tag & labs defined in token
181
			      so have to keep list; NB used only if recursive */
182
	lab_con * labs;
183
	struct t_context * outer;
184
} context;
185
 
186
extern context * crt_context;
187
 
188
	/* dummy definitions */
189
typedef int taglink;
190
typedef int allink;
191
typedef int toklink;
192
 
193
 
194
typedef int tokextern;
195
 
196
typedef int tagextern;
197
typedef int alextern;
198
 
199
typedef int tokdec;
200
 
201
typedef struct tokformals_t
202
  {sortname sn;
203
   int tk;
204
  } tokformals;	/* formal parameter during reading */
205
 
206
typedef struct tokformals_list_t  tokformals_list;
207
 
208
typedef int tokdef;
209
 
210
typedef struct tagdec_t
211
  {tag tg;		/* identifying tag */
212
   shape sha;		/* the shape of the tag */
213
   access_option acc;	/* its access_options */
214
   bool is_variable;	/* 1 for variable, 0 for identity */
215
   bool is_common;	/* 1 for common_tagdec */
216
  } tagdec;
217
 
218
typedef struct tagdef_t
219
 {
220
  tag tg;		/* identifying tag */
221
  exp def;		/* the associated exp definition */
222
  bool var;		/* 1 for variable, 0 for identity */
223
  bool is_common;	/* 1 for common_tagdef */
224
  } tagdef;
225
 
226
typedef int al_tagdef;
227
 
228
 
229
typedef struct tdfstring_list_t
230
  {int number;
231
   tdfstring * elems;
232
  } tdfstring_list;	/* number tdfstrings */
233
 
234
typedef tdfstring tdfident;
235
 
236
typedef tdfstring_list tdfident_list;
237
 
238
typedef tdfident_list unique;
239
 
240
union external_u {unique u; tdfstring id;};
241
 
242
typedef struct external_t {union external_u ex; bool isstring;} external;
243
 
244
typedef struct capsule_link_t
245
  {
246
    char * id;	/* name */
247
    tdfint n;	/* index */
248
  } capsule_link;
249
 
250
typedef struct capsule_link_list_t 
251
  {
252
    int number;
253
    capsule_link * members;
254
 
255
  } capsule_link_list;	/* number capsule_links */
256
 
257
typedef struct tdfint_list_t 
258
  {
259
    int number;
260
    tdfint * members;
261
 
262
  } tdfint_list;	/* number tdfints */
263
 
264
	/* dummy definitions */
265
typedef int group_list;
266
typedef int extern_link_list;
267
typedef int linkextern_list;
268
typedef int extern_link;
269
typedef int group;
270
typedef int unit_list;
271
typedef int link;
272
typedef int linkextern;
273
typedef int links;
274
typedef int link_list;
275
typedef int tokdec_props;
276
typedef int tokdef_props;
277
typedef int tagdec_props;
278
typedef int tagdef_props;
279
typedef int al_tagdef_props;
280
typedef int tokdef_bd;
281
typedef int links_list;
282
 
283
typedef struct capsule_frees_t
284
  {void * ptr;
285
   struct capsule_frees_t * next;
286
  } capsule_frees;
287
 
288
 
289
#endif