2 |
7u83 |
1 |
<!-- Crown Copyright (c) 1998 -->
|
|
|
2 |
<HTML>
|
|
|
3 |
<HEAD>
|
|
|
4 |
<TITLE>Diagnostic SORTs</TITLE>
|
|
|
5 |
</HEAD>
|
|
|
6 |
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#400080" ALINK="#FF0000">
|
|
|
7 |
<H1><A NAME=S4>TDF Diagnostic Specification, Issue 3.0</A></H1>
|
|
|
8 |
<H3>January 1998</H3>
|
|
|
9 |
<A HREF="diag5.html"><IMG SRC="../images/next.gif" ALT="next section"></A>
|
|
|
10 |
<A HREF="diag1.html"><IMG SRC="../images/prev.gif" ALT="previous section"></A>
|
|
|
11 |
<A HREF="diag1.html"><IMG SRC="../images/top.gif" ALT="current document"></A>
|
|
|
12 |
<A HREF="../index.html"><IMG SRC="../images/home.gif" ALT="TenDRA home page">
|
|
|
13 |
</A>
|
|
|
14 |
<IMG SRC="../images/no_index.gif" ALT="document index"><P>
|
|
|
15 |
<HR>
|
|
|
16 |
<DL>
|
|
|
17 |
<DT><A HREF="#S5"><B>2.1</B> - DIAG_DESCRIPTOR</A><DD>
|
|
|
18 |
<DL>
|
|
|
19 |
<DT><A HREF="#S6"><B>2.1.1</B> - diag_desc_id</A><DD>
|
|
|
20 |
<DT><A HREF="#S7"><B>2.1.2</B> - diag_desc_struct</A><DD>
|
|
|
21 |
<DT><A HREF="#S8"><B>2.1.3</B> - diag_desc_typedef</A><DD>
|
|
|
22 |
</DL>
|
|
|
23 |
<DT><A HREF="#S9"><B>2.2</B> - DIAG_UNIT</A><DD>
|
|
|
24 |
<DL>
|
|
|
25 |
<DT><A HREF="#S10"><B>2.2.1</B> - build_diag_unit</A><DD>
|
|
|
26 |
</DL>
|
|
|
27 |
<DT><A HREF="#S11"><B>2.3</B> - DIAG_TAG</A><DD>
|
|
|
28 |
<DL>
|
|
|
29 |
<DT><A HREF="#S12"><B>2.3.1</B> - make_diag_tag</A><DD>
|
|
|
30 |
</DL>
|
|
|
31 |
<DT><A HREF="#S13"><B>2.4</B> - DIAG_TAGDEF</A><DD>
|
|
|
32 |
<DL>
|
|
|
33 |
<DT><A HREF="#S14"><B>2.4.1</B> - make_diag_tagdef</A><DD>
|
|
|
34 |
</DL>
|
|
|
35 |
<DT><A HREF="#S15"><B>2.5</B> - DIAG_TYPE_UNIT</A><DD>
|
|
|
36 |
<DL>
|
|
|
37 |
<DT><A HREF="#S16"><B>2.5.1</B> - build_diagtype_unit</A><DD>
|
|
|
38 |
</DL>
|
|
|
39 |
<DT><A HREF="#S17"><B>2.6</B> - DIAG_TYPE</A><DD>
|
|
|
40 |
<DL>
|
|
|
41 |
<DT><A HREF="#S18"><B>2.6.1</B> - diag_type_apply_token</A><DD>
|
|
|
42 |
<DT><A HREF="#S19"><B>2.6.2</B> - diag_array</A><DD>
|
|
|
43 |
<DT><A HREF="#S20"><B>2.6.3</B> - diag_bitfield</A><DD>
|
|
|
44 |
<DT><A HREF="#S21"><B>2.6.4</B> - diag_enum</A><DD>
|
|
|
45 |
<DT><A HREF="#S22"><B>2.6.5</B> - diag_floating_variety</A><DD>
|
|
|
46 |
<DT><A HREF="#S23"><B>2.6.6</B> - diag_loc</A><DD>
|
|
|
47 |
<DT><A HREF="#S24"><B>2.6.7</B> - diag_proc</A><DD>
|
|
|
48 |
<DT><A HREF="#S25"><B>2.6.8</B> - diag_ptr</A><DD>
|
|
|
49 |
<DT><A HREF="#S26"><B>2.6.9</B> - diag_struct</A><DD>
|
|
|
50 |
<DT><A HREF="#S27"><B>2.6.10</B> - diag_type_null</A><DD>
|
|
|
51 |
<DT><A HREF="#S28"><B>2.6.11</B> - diag_union</A><DD>
|
|
|
52 |
<DT><A HREF="#S29"><B>2.6.12</B> - diag_variety</A><DD>
|
|
|
53 |
<DT><A HREF="#S30"><B>2.6.13</B> - use_diag_tag</A><DD>
|
|
|
54 |
</DL>
|
|
|
55 |
<DT><A HREF="#S31"><B>2.7</B> - ENUM_VALUES</A><DD>
|
|
|
56 |
<DL>
|
|
|
57 |
<DT><A HREF="#S32"><B>2.7.1</B> - make_enum_values_list</A><DD>
|
|
|
58 |
</DL>
|
|
|
59 |
<DT><A HREF="#S33"><B>2.8</B> - DIAG_FIELD</A><DD>
|
|
|
60 |
<DL>
|
|
|
61 |
<DT><A HREF="#S34"><B>2.8.1</B> - make_diag_field</A><DD>
|
|
|
62 |
</DL>
|
|
|
63 |
<DT><A HREF="#S35"><B>2.9</B> - DIAG_TQ</A><DD>
|
|
|
64 |
<DL>
|
|
|
65 |
<DT><A HREF="#S36"><B>2.9.1</B> - add_diag_const</A><DD>
|
|
|
66 |
<DT><A HREF="#S37"><B>2.9.2</B> - add_diag_volatile</A><DD>
|
|
|
67 |
<DT><A HREF="#S38"><B>2.9.3</B> - diag_tq_null</A><DD>
|
|
|
68 |
</DL>
|
|
|
69 |
<DT><A HREF="#S39"><B>2.10</B> - FILENAME</A><DD>
|
|
|
70 |
<DL>
|
|
|
71 |
<DT><A HREF="#S40"><B>2.10.1</B> - filename_apply_token</A><DD>
|
|
|
72 |
<DT><A HREF="#S41"><B>2.10.2</B> - make_filename</A><DD>
|
|
|
73 |
</DL>
|
|
|
74 |
<DT><A HREF="#S42"><B>2.11</B> - SOURCEMARK</A><DD>
|
|
|
75 |
<DL>
|
|
|
76 |
<DT><A HREF="#S43"><B>2.11.1</B> - make_sourcemark</A><DD>
|
|
|
77 |
</DL>
|
|
|
78 |
</DL>
|
|
|
79 |
<HR>
|
|
|
80 |
<H1>2. Diagnostic SORTs</H1>
|
|
|
81 |
As a summary of this section<P>
|
|
|
82 |
<UL>
|
|
|
83 |
<LI><CODE>DIAG_TYPE</CODE>s describe programming language types (e.g.
|
|
|
84 |
arrays, structs...). <CODE>DIAG_TQ</CODE>s are qualifiers of <CODE>DIAG_TYPE
|
|
|
85 |
</CODE>s used for attributes like volatile and const.
|
|
|
86 |
<LI><CODE>FILENAME</CODE>s and<CODE> SOURCEMARK</CODE>s describe source
|
|
|
87 |
files and locations within them.
|
|
|
88 |
<LI><CODE>DIAG_TAG</CODE>s associate integers with <CODE>DIAG_TYPE</CODE>s.
|
|
|
89 |
They are used in a similar manner to normal TDF <CODE>TAG</CODE>s,
|
|
|
90 |
and are held in a (TDF) linkable unit called a <CODE>DIAG_TYPE_UNIT</CODE>.
|
|
|
91 |
<LI><CODE>DIAG_UNIT</CODE>s hold a collection of <CODE>DIAG_DESCRIPTOR</CODE>s,
|
|
|
92 |
used for information outside procedure bodies.
|
|
|
93 |
</UL>
|
|
|
94 |
|
|
|
95 |
<HR>
|
|
|
96 |
<H2><A NAME=S5>2.1. DIAG_DESCRIPTOR</A></H2>
|
|
|
97 |
<B>Number of encoding bits</B>: 2<BR>
|
|
|
98 |
<B>Is coding extendable</B>: yes<P>
|
|
|
99 |
<CODE>DIAG_DESCRIPTOR</CODE>s are used to associate names in the source
|
|
|
100 |
program with diagnostic items.<P>
|
|
|
101 |
|
|
|
102 |
<H3><A NAME=S6>2.1.1. diag_desc_id</A></H3>
|
|
|
103 |
<B>Encoding number</B>: 1<P>
|
|
|
104 |
<PRE>
|
|
|
105 |
<I>src_name</I>: TDFSTRING<I>(k, n)</I>
|
|
|
106 |
<I>whence</I>: SOURCEMARK
|
|
|
107 |
<I>found_at</I>: EXP POINTER(<I>al</I>)
|
|
|
108 |
<I>type</I>: DIAG_TYPE
|
|
|
109 |
-> DIAG_DESCRIPTOR
|
|
|
110 |
</PRE>
|
|
|
111 |
Generates a descriptor for an identifier (of <CODE>DIAG_TYPE</CODE>
|
|
|
112 |
<I>type</I>), whose source name was <I>src_name</I> from source location
|
|
|
113 |
<I>whence</I>. The <CODE>EXP </CODE><I>found_at</I> describes how
|
|
|
114 |
to access the value. Note that the <CODE>EXP</CODE> need not be unique
|
|
|
115 |
(e.g. FORTRAN EQUIVALENCE might be implemented this way).<P>
|
|
|
116 |
|
|
|
117 |
<H3><A NAME=S7>2.1.2. diag_desc_struct</A></H3>
|
|
|
118 |
<B>Encoding number</B>: 2<P>
|
|
|
119 |
<PRE>
|
|
|
120 |
<I>src_name</I>: TDFSTRING<I>(k, n)</I>
|
|
|
121 |
<I>whence</I>: SOURCEMARK
|
|
|
122 |
<I>new_type</I>: DIAG_TYPE
|
|
|
123 |
-> DIAG_DESCRIPTOR
|
|
|
124 |
</PRE>
|
|
|
125 |
Generates a descriptor whose source name was <I>src_name</I>. <I>new_type</I>
|
|
|
126 |
must be either a <CODE>DIAG_STRUCT</CODE>, <CODE>DIAG_UNION</CODE>
|
|
|
127 |
or <CODE>DIAG_ENUM</CODE>.<P>
|
|
|
128 |
This construct is obsolete.<P>
|
|
|
129 |
|
|
|
130 |
<H3><A NAME=S8>2.1.3. diag_desc_typedef</A></H3>
|
|
|
131 |
<B>Encoding number</B>: 3<P>
|
|
|
132 |
<PRE>
|
|
|
133 |
<I>src_name</I>: TDFSTRING<I>(k, n)</I>
|
|
|
134 |
<I>whence</I>: SOURCEMARK
|
|
|
135 |
<I>new_type</I>: DIAG_TYPE
|
|
|
136 |
-> DIAG_DESCRIPTOR
|
|
|
137 |
</PRE>
|
|
|
138 |
Generates a descriptor for a type <I>new_type</I> whose source name
|
|
|
139 |
was <I>src_name</I>. Note that <I>diag_desc_typedef</I> is used for
|
|
|
140 |
associating a name with a type, rather than for any name given in
|
|
|
141 |
the initial description of the type (e.g. in C this is used for typedef,
|
|
|
142 |
not for struct/union/enum tags).<P>
|
|
|
143 |
|
|
|
144 |
<HR>
|
|
|
145 |
<H2><A NAME=S9>2.2. DIAG_UNIT</A></H2>
|
|
|
146 |
<B>Number of encoding bits</B>: 0<BR>
|
|
|
147 |
<B>Is coding extendable</B>: no<BR>
|
|
|
148 |
<B>Unit identification</B>: <I>diagdef</I><P>
|
|
|
149 |
A <CODE>DIAG_UNIT</CODE> is a TDF unit containing <CODE>DIAG_DESCRIPTOR</CODE>s.
|
|
|
150 |
A <CODE>DIAG_UNIT</CODE> is used to contain descriptions of items
|
|
|
151 |
outside procedure bodies (e.g. global variables, global type definitions).<P>
|
|
|
152 |
|
|
|
153 |
<H3><A NAME=S10>2.2.1. build_diag_unit</A></H3>
|
|
|
154 |
<B>Encoding number</B>: 0<P>
|
|
|
155 |
<PRE>
|
|
|
156 |
<I>no_labels</I>: TDFINT
|
|
|
157 |
<I>descriptors</I>: SLIST(DIAG_DESCRIPTOR)
|
|
|
158 |
-> DIAG_UNIT
|
|
|
159 |
</PRE>
|
|
|
160 |
Create a <CODE>DIAG_UNIT</CODE> containing <CODE>DIAG_DESCRIPTOR</CODE>s.
|
|
|
161 |
<I>no_labels</I> is the number of local labels used in <I>descriptors</I>
|
|
|
162 |
(for conditionals).<P>
|
|
|
163 |
|
|
|
164 |
<HR>
|
|
|
165 |
<H2><A NAME=S11>2.3. DIAG_TAG</A></H2>
|
|
|
166 |
<B>Number of encoding bits</B>: 1<BR>
|
|
|
167 |
<B>Is coding extendable</B>: yes<BR>
|
|
|
168 |
<B>Linkable entity identification</B>: <I>diagtag</I><P>
|
|
|
169 |
<CODE>DIAG_TAG</CODE>s are used <I>inter alia</I> to break cyclic
|
|
|
170 |
diagnostic types. They are (TDF) linkable entities. A <CODE>DIAG_TAG</CODE>
|
|
|
171 |
is made from a number, and used in <I>use_diag_tag</I> to obtain the
|
|
|
172 |
<CODE>DIAG_TYPE</CODE> associated with that number by <I>make_diag_tagdef</I>.
|
|
|
173 |
<P>
|
|
|
174 |
|
|
|
175 |
<H3><A NAME=S12>2.3.1. make_diag_tag</A></H3>
|
|
|
176 |
<B>Encoding number</B>: 1<P>
|
|
|
177 |
<PRE>
|
|
|
178 |
<I>num</I>: TDFINT
|
|
|
179 |
-> DIAG_TAG
|
|
|
180 |
</PRE>
|
|
|
181 |
Create a <CODE>DIAG_TAG</CODE> from <I>num</I>.<P>
|
|
|
182 |
|
|
|
183 |
<HR>
|
|
|
184 |
<H2><A NAME=S13>2.4. DIAG_TAGDEF</A></H2>
|
|
|
185 |
<B>Number of encoding bits</B>: 1<BR>
|
|
|
186 |
<B>Is coding extendable</B>: yes<P>
|
|
|
187 |
<CODE>DIAG_TAGDEF</CODE>s associate <CODE>DIAG_TAG</CODE>s with <CODE>DIAG_TYPE
|
|
|
188 |
</CODE>s.<P>
|
|
|
189 |
|
|
|
190 |
<H3><A NAME=S14>2.4.1. make_diag_tagdef</A></H3>
|
|
|
191 |
<B>Encoding number</B>: 1<P>
|
|
|
192 |
<PRE>
|
|
|
193 |
<I>tno</I>: TDFINT
|
|
|
194 |
<I>dtype</I>: DIAG_TYPE
|
|
|
195 |
-> DIAG_TAGDEF
|
|
|
196 |
</PRE>
|
|
|
197 |
Associates tag number <I>tno</I> with <I>dtype</I>.<P>
|
|
|
198 |
|
|
|
199 |
<HR>
|
|
|
200 |
<H2><A NAME=S15>2.5. DIAG_TYPE_UNIT</A></H2>
|
|
|
201 |
<B>Number of encoding bits</B>: 0<BR>
|
|
|
202 |
<B>Is coding extendable</B>: no<BR>
|
|
|
203 |
<B>Unit identification</B>: <I>diagtype</I><P>
|
|
|
204 |
A <CODE>DIAG_TYPE_UNIT</CODE> is a TDF unit containing <CODE>DIAG_TAGDEF</CODE>s.
|
|
|
205 |
<P>
|
|
|
206 |
|
|
|
207 |
<H3><A NAME=S16>2.5.1. build_diagtype_unit</A></H3>
|
|
|
208 |
<B>Encoding number</B>: 0<P>
|
|
|
209 |
<PRE>
|
|
|
210 |
<I>no_labels</I>: TDFINT
|
|
|
211 |
<I>tagdefs</I>: SLIST(DIAG_TAGDEF)
|
|
|
212 |
-> DIAG_TYPEUNIT
|
|
|
213 |
</PRE>
|
|
|
214 |
Create a <CODE>DIAG_TYPEUNIT</CODE> containing <CODE>DIAG_TAGDEF</CODE>s.
|
|
|
215 |
<I>no_labels</I> is the number of local labels used in <I>tagdefs</I>
|
|
|
216 |
(for conditionals).<P>
|
|
|
217 |
|
|
|
218 |
<HR>
|
|
|
219 |
<H2><A NAME=S17>2.6. DIAG_TYPE</A></H2>
|
|
|
220 |
<B>Sortname</B>: <I>foreign_sort("diag_type")</I><BR>
|
|
|
221 |
<B>Number of encoding bits</B>: 4<BR>
|
|
|
222 |
<B>Is coding extendable</B>: yes<P>
|
|
|
223 |
<CODE>DIAG_TYPE</CODE>s are used to provide diagnostic information
|
|
|
224 |
about data types.<P>
|
|
|
225 |
|
|
|
226 |
<H3><A NAME=S18>2.6.1. diag_type_apply_token</A></H3>
|
|
|
227 |
<B>Encoding number</B>: 1<P>
|
|
|
228 |
<PRE>
|
|
|
229 |
<I>token_value</I>: TOKEN
|
|
|
230 |
<I>token_args</I>: BITSTREAM
|
|
|
231 |
-> DIAG_TYPE
|
|
|
232 |
</PRE>
|
|
|
233 |
The token is applied to the arguments to give a <CODE>DIAG_TYPE</CODE>.
|
|
|
234 |
If there is a definition for <I>token_value</I> in the <CODE>CAPSULE</CODE>
|
|
|
235 |
then <I>token_args</I> is a <CODE>BITSTREAM</CODE> encoding of the
|
|
|
236 |
<CODE>SORT</CODE>s of its parameters, in the order specified.<P>
|
|
|
237 |
|
|
|
238 |
<H3><A NAME=S19>2.6.2. diag_array</A></H3>
|
|
|
239 |
<B>Encoding number</B>: 2<P>
|
|
|
240 |
<PRE>
|
|
|
241 |
<I>element_type</I>: DIAG_TYPE
|
|
|
242 |
<I>stride</I>: EXP OFFSET(<I>p</I>,<I>p</I>)
|
|
|
243 |
<I>lower_bound</I>: EXP INTEGER(<I>v</I>)
|
|
|
244 |
<I>upper_bound</I>: EXP INTEGER(<I>v</I>)
|
|
|
245 |
<I>index_type</I>: DIAG_TYPE
|
|
|
246 |
-> DIAG_TYPE
|
|
|
247 |
</PRE>
|
|
|
248 |
An array of <I>element_type</I> objects. <I>stride</I> is the <CODE>OFFSET
|
|
|
249 |
</CODE>
|
|
|
250 |
between elements of the array (i.e. <I>p</I> is described by <I>element_type</I>).
|
|
|
251 |
The bounds are in general not runtime constants, hence the values
|
|
|
252 |
are <CODE>EXP</CODE>s (not say <CODE>SIGNED_NAT</CODE>). The <CODE>VARIETY
|
|
|
253 |
</CODE>
|
|
|
254 |
<I>v</I> is described by <I>index_type</I>. As in TDF there is no
|
|
|
255 |
multi-dimensional array primitive.<P>
|
|
|
256 |
|
|
|
257 |
<H3><A NAME=S20>2.6.3. diag_bitfield</A></H3>
|
|
|
258 |
<B>Encoding number</B>: 3<P>
|
|
|
259 |
<PRE>
|
|
|
260 |
<I>type</I>: DIAG_TYPE
|
|
|
261 |
<I>number_of_bits</I>: NAT
|
|
|
262 |
-> DIAG_TYPE
|
|
|
263 |
</PRE>
|
|
|
264 |
Describes <I>number_of_bits</I>, which when extracted will have <CODE>DIAG_TYPE
|
|
|
265 |
</CODE>
|
|
|
266 |
<I>type</I>.<P>
|
|
|
267 |
|
|
|
268 |
<H3><A NAME=S21>2.6.4. diag_enum</A></H3>
|
|
|
269 |
<B>Encoding number</B>: 4<P>
|
|
|
270 |
<PRE>
|
|
|
271 |
<I>base_type</I>: DIAG_TYPE
|
|
|
272 |
<I>enum_name</I>: TDFSTRING<I>(k, n)</I>
|
|
|
273 |
<I>values</I>: LIST(ENUM_VALUES)
|
|
|
274 |
-> DIAG_TYPE
|
|
|
275 |
</PRE>
|
|
|
276 |
An enumeration to be stored in an object of type <I>base_type</I>.
|
|
|
277 |
If <I>enum_name</I> is a string contining zero characters this signifies
|
|
|
278 |
no source tag.<P>
|
|
|
279 |
|
|
|
280 |
<H3><A NAME=S22>2.6.5. diag_floating_variety</A></H3>
|
|
|
281 |
<B>Encoding number</B>: 5<P>
|
|
|
282 |
<PRE>
|
|
|
283 |
<I>var</I>: FLOATING_VARIETY
|
|
|
284 |
-> DIAG_TYPE
|
|
|
285 |
</PRE>
|
|
|
286 |
Creates a <CODE>DIAG_TYPE</CODE> to describe an <CODE>FLOATING_VARIETY</CODE>
|
|
|
287 |
<I>var</I>.<P>
|
|
|
288 |
|
|
|
289 |
<H3><A NAME=S23>2.6.6. diag_loc</A></H3>
|
|
|
290 |
<B>Encoding number</B>: 6<P>
|
|
|
291 |
<PRE>
|
|
|
292 |
<I>object</I>: DIAG_TYPE
|
|
|
293 |
<I>qualifier</I>: DIAG_TQ
|
|
|
294 |
-> DIAG_TYPE
|
|
|
295 |
</PRE>
|
|
|
296 |
Records the existence of an item of <CODE>DIAG_TYPE</CODE> <I>object</I>,
|
|
|
297 |
qualified by <I>qualifier</I>. <I>diag_loc</I> is used for variables
|
|
|
298 |
(which may of course not actually occupy a memory location).<P>
|
|
|
299 |
|
|
|
300 |
<H3><A NAME=S24>2.6.7. diag_proc</A></H3>
|
|
|
301 |
<B>Encoding number</B>: 7<P>
|
|
|
302 |
<PRE>
|
|
|
303 |
<I>params</I>: LIST(DIAG_TYPE)
|
|
|
304 |
<I>optional_args</I>: BOOL
|
|
|
305 |
<I>result_type</I>: DIAG_TYPE
|
|
|
306 |
-> DIAG_TYPE
|
|
|
307 |
</PRE>
|
|
|
308 |
Describes a procedure taking <I>n</I> parameters. <I>optional_args</I>
|
|
|
309 |
is true if and only if the <I>make_proc</I> which this <I>diag_proc</I>
|
|
|
310 |
describes had <I>vartag</I> present.<P>
|
|
|
311 |
|
|
|
312 |
<H3><A NAME=S25>2.6.8. diag_ptr</A></H3>
|
|
|
313 |
<B>Encoding number</B>: 8<P>
|
|
|
314 |
<PRE>
|
|
|
315 |
<I>object</I>: DIAG_TYPE
|
|
|
316 |
<I>qualifier</I>: DIAG_TQ
|
|
|
317 |
-> DIAG_TYPE
|
|
|
318 |
</PRE>
|
|
|
319 |
Describes a pointer to an object of <CODE>DIAG_TYPE</CODE> <I>object</I>.
|
|
|
320 |
The <CODE>DIAG_TQ</CODE> qualifier <I>qualifier</I> qualifies the
|
|
|
321 |
pointer, not the object pointed to.<P>
|
|
|
322 |
|
|
|
323 |
<H3><A NAME=S26>2.6.9. diag_struct</A></H3>
|
|
|
324 |
<B>Encoding number</B>: 9<P>
|
|
|
325 |
<PRE>
|
|
|
326 |
<I>tdf_shape</I>: SHAPE
|
|
|
327 |
<I>src_name</I>: TDFSTRING<I>(k, n)</I>
|
|
|
328 |
<I>fields</I>: LIST(DIAG_FIELD)
|
|
|
329 |
-> DIAG_TYPE
|
|
|
330 |
</PRE>
|
|
|
331 |
Describes a structure. If <I>src_name</I> is a string contining zero
|
|
|
332 |
characters this signifies no source tag for the whole structure. <I>tdf_shape
|
|
|
333 |
</I>
|
|
|
334 |
allows the total size to be computed.<P>
|
|
|
335 |
|
|
|
336 |
<H3><A NAME=S27>2.6.10. diag_type_null</A></H3>
|
|
|
337 |
<B>Encoding number</B>: 10<P>
|
|
|
338 |
<PRE>
|
|
|
339 |
-> DIAG_TYPE
|
|
|
340 |
</PRE>
|
|
|
341 |
A null <CODE>DIAG_TYPE</CODE>.<P>
|
|
|
342 |
|
|
|
343 |
<H3><A NAME=S28>2.6.11. diag_union</A></H3>
|
|
|
344 |
<B>Encoding number</B>: 11<P>
|
|
|
345 |
<PRE>
|
|
|
346 |
<I>tdf_shape</I>: SHAPE
|
|
|
347 |
<I>src_name</I>: TDFSTRING<I>(k, n)</I>
|
|
|
348 |
<I>fields</I>: LIST(DIAG_FIELD)
|
|
|
349 |
-> DIAG_TYPE
|
|
|
350 |
</PRE>
|
|
|
351 |
Describes a union. If <I>src_name</I> is a string contining zero characters
|
|
|
352 |
this signifies no source tag for the whole union. <I>tdf_shape</I>
|
|
|
353 |
allows the total size to be computed.<P>
|
|
|
354 |
|
|
|
355 |
<H3><A NAME=S29>2.6.12. diag_variety</A></H3>
|
|
|
356 |
<B>Encoding number</B>: 12<P>
|
|
|
357 |
<PRE>
|
|
|
358 |
<I>var</I>: VARIETY
|
|
|
359 |
-> DIAG_TYPE
|
|
|
360 |
</PRE>
|
|
|
361 |
Creates a <CODE>DIAG_TYPE</CODE> to describe an integer <CODE>VARIETY</CODE>
|
|
|
362 |
<I>var</I>.<P>
|
|
|
363 |
|
|
|
364 |
<H3><A NAME=S30>2.6.13. use_diag_tag</A></H3>
|
|
|
365 |
<B>Encoding number</B>: 13<P>
|
|
|
366 |
<PRE>
|
|
|
367 |
<I>dtag</I>: DIAG_TAG
|
|
|
368 |
-> DIAG_TYPE
|
|
|
369 |
</PRE>
|
|
|
370 |
Obtains the <CODE>DIAG_TYPE</CODE> associated with <CODE>DIAG_TAG</CODE>
|
|
|
371 |
<I>dtag</I>.<P>
|
|
|
372 |
|
|
|
373 |
<HR>
|
|
|
374 |
<H2><A NAME=S31>2.7. ENUM_VALUES</A></H2>
|
|
|
375 |
<B>Number of encoding bits</B>: 0<BR>
|
|
|
376 |
<B>Is coding extendable</B>: no<P>
|
|
|
377 |
|
|
|
378 |
<H3><A NAME=S32>2.7.1. make_enum_values_list</A></H3>
|
|
|
379 |
<B>Encoding number</B>: 0<P>
|
|
|
380 |
<PRE>
|
|
|
381 |
<I>value</I>: EXP <I>sh</I>
|
|
|
382 |
<I>src_name</I>: TDFSTRING<I>(k, n)</I>
|
|
|
383 |
-> ENUM_VALUES
|
|
|
384 |
</PRE>
|
|
|
385 |
<CODE>ENUM_VALUES</CODE> describe elements of an enumerated type.
|
|
|
386 |
<I>src_name</I> is the source language name. <I>value</I> evaluates
|
|
|
387 |
to a value of <CODE>SHAPE</CODE> <I>sh</I>. Note that all members
|
|
|
388 |
of a <CODE>LIST(ENUM_VALUES</CODE>) must have the same <I>sh</I>.<P>
|
|
|
389 |
|
|
|
390 |
<HR>
|
|
|
391 |
<H2><A NAME=S33>2.8. DIAG_FIELD</A></H2>
|
|
|
392 |
<B>Number of encoding bits</B>: 0<BR>
|
|
|
393 |
<B>Is coding extendable</B>: no<P>
|
|
|
394 |
|
|
|
395 |
<H3><A NAME=S34>2.8.1. make_diag_field</A></H3>
|
|
|
396 |
<B>Encoding number</B>: 0<P>
|
|
|
397 |
<PRE>
|
|
|
398 |
<I>field_name</I>: TDFSTRING<I>(k, n)</I>
|
|
|
399 |
<I>found_at</I>: EXP OFFSET( ALIGNMENT <I>whole</I>, ALIGNMENT <I>this_field
|
|
|
400 |
</I>)
|
|
|
401 |
<I>field_type</I>: DIAG_TYPE
|
|
|
402 |
-> DIAG_FIELD
|
|
|
403 |
</PRE>
|
|
|
404 |
<CODE>DIAG_FIELD</CODE>s describe one field of a structure or union.
|
|
|
405 |
<I>field_name</I> is the source language name. <I>found_at</I> is
|
|
|
406 |
the <CODE>OFFSET</CODE> between <I>whole</I> (the enclosing structure
|
|
|
407 |
or union), and this field (<I>this_field</I>). <I>field_type</I> is
|
|
|
408 |
the <CODE>DIAG_TYPE</CODE> of the field.<P>
|
|
|
409 |
|
|
|
410 |
<HR>
|
|
|
411 |
<H2><A NAME=S35>2.9. DIAG_TQ</A></H2>
|
|
|
412 |
<B>Number of encoding bits</B>: 2<BR>
|
|
|
413 |
<B>Is coding extendable</B>: yes<P>
|
|
|
414 |
<CODE>DIAG_TQ</CODE>s are type qualifiers, used to qualify <CODE>DIAG_TYPE
|
|
|
415 |
</CODE>s. A <CODE>DIAG_TQ</CODE> is constructed from <I>diag_tq_null</I>
|
|
|
416 |
and the various <I>add_diag_XXX</I> operations.<P>
|
|
|
417 |
|
|
|
418 |
<H3><A NAME=S36>2.9.1. add_diag_const</A></H3>
|
|
|
419 |
<B>Encoding number</B>: 1<P>
|
|
|
420 |
<PRE>
|
|
|
421 |
<I>qual</I>: DIAG_TQ
|
|
|
422 |
-> DIAG_TQ
|
|
|
423 |
</PRE>
|
|
|
424 |
Marks a <CODE>DIAG_TQ</CODE> type qualifier as being <I>const</I>
|
|
|
425 |
in the ANSI C sense.<P>
|
|
|
426 |
|
|
|
427 |
<H3><A NAME=S37>2.9.2. add_diag_volatile</A></H3>
|
|
|
428 |
<B>Encoding number</B>: 2<P>
|
|
|
429 |
<PRE>
|
|
|
430 |
<I>qual</I>: DIAG_TQ
|
|
|
431 |
-> DIAG_TQ
|
|
|
432 |
</PRE>
|
|
|
433 |
Marks a <CODE>DIAG_TQ</CODE> type qualifier as being <I>volatile</I>
|
|
|
434 |
in the ANSI C sense.<P>
|
|
|
435 |
|
|
|
436 |
<H3><A NAME=S38>2.9.3. diag_tq_null</A></H3>
|
|
|
437 |
<B>Encoding number</B>: 3<P>
|
|
|
438 |
<PRE>
|
|
|
439 |
-> DIAG_TQ
|
|
|
440 |
</PRE>
|
|
|
441 |
Create a null <CODE>DIAG_TQ</CODE> type qualifier.<P>
|
|
|
442 |
|
|
|
443 |
<HR>
|
|
|
444 |
<H2><A NAME=S39>2.10. FILENAME</A></H2>
|
|
|
445 |
<B>Sortname</B>: <I>foreign_sort("~diag_file")</I><BR>
|
|
|
446 |
<B>Number of encoding bits</B>: 2<BR>
|
|
|
447 |
<B>Is coding extendable</B>: yes<P>
|
|
|
448 |
<CODE>FILENAME </CODE>record details of source files used in producing
|
|
|
449 |
a <CODE>CAPSULE</CODE>. They can be tokenised for abbreviation.<P>
|
|
|
450 |
|
|
|
451 |
<H3><A NAME=S40>2.10.1. filename_apply_token</A></H3>
|
|
|
452 |
<B>Encoding number</B>: 1<P>
|
|
|
453 |
<PRE>
|
|
|
454 |
<I>token_value</I>: TOKEN
|
|
|
455 |
<I>token_args</I>: BITSTREAM
|
|
|
456 |
-> FILENAME
|
|
|
457 |
</PRE>
|
|
|
458 |
The token is applied to the arguments to give a <CODE>FILENAME</CODE>.
|
|
|
459 |
If there is a definition for <I>token_value</I> in the <CODE>CAPSULE</CODE>
|
|
|
460 |
then <I>token_args</I> is a <CODE>BITSTREAM</CODE> encoding of the
|
|
|
461 |
<CODE>SORT</CODE>s of its parameters, in the order specified.<P>
|
|
|
462 |
|
|
|
463 |
<H3><A NAME=S41>2.10.2. make_filename</A></H3>
|
|
|
464 |
<B>Encoding number</B>: 2<P>
|
|
|
465 |
<PRE>
|
|
|
466 |
<I>date</I>: NAT
|
|
|
467 |
<I>machine</I>: TDFSTRING<I>(k1, n1)</I>
|
|
|
468 |
<I>file</I>: TDFSTRING<I>(k2, n2)</I>
|
|
|
469 |
-> FILENAME
|
|
|
470 |
</PRE>
|
|
|
471 |
Create a <CODE>FILENAME</CODE> for file <I>file</I>, dated <I>date</I>
|
|
|
472 |
(a UNIX timestamp; seconds since 1 Jan 1970) on machine <I>machine</I>.<P>
|
|
|
473 |
|
|
|
474 |
<HR>
|
|
|
475 |
<H2><A NAME=S42>2.11. SOURCEMARK</A></H2>
|
|
|
476 |
<B>Number of encoding bits</B>: 1<BR>
|
|
|
477 |
<B>Is coding extendable</B>: yes<P>
|
|
|
478 |
A <CODE>SOURCEMARK</CODE> records a location in the source program.
|
|
|
479 |
Present <CODE>SOURCEMARK</CODE>s assume that a location can be described
|
|
|
480 |
by one or two numbers within a <CODE>FILENAME</CODE>.<P>
|
|
|
481 |
|
|
|
482 |
<H3><A NAME=S43>2.11.1. make_sourcemark</A></H3>
|
|
|
483 |
<B>Encoding number</B>: 1<P>
|
|
|
484 |
<PRE>
|
|
|
485 |
<I>file</I>: FILENAME
|
|
|
486 |
<I>line_no</I>: NAT
|
|
|
487 |
<I>char_offset</I>: NAT
|
|
|
488 |
-> SOURCEMARK
|
|
|
489 |
</PRE>
|
|
|
490 |
Create a <CODE>SOURCEMARK</CODE> referencing the <I>char_offset</I>'th
|
|
|
491 |
character on line <I>line_no</I> in file <I>file</I>.<P>
|
|
|
492 |
<I>char_offset</I> is counted from 1, 0 meaning that no character
|
|
|
493 |
offset is available.<P>
|
|
|
494 |
<HR>
|
|
|
495 |
<P><I>Part of the <A HREF="../index.html">TenDRA Web</A>.<BR>Crown
|
|
|
496 |
Copyright © 1998.</I></P>
|
|
|
497 |
</BODY>
|
|
|
498 |
</HTML>
|