Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – tendra.SVN – Blame – /branches/algol60/src/tools/tpl/syntax.sid – Rev 7

Subversion Repositories tendra.SVN

Rev

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

Rev Author Line No. Line
6 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
%types%
32
 
33
AL_TAGDEC ;
34
INT ;
35
LABDEC ;
36
NAME ;
37
PTR_TDF ;
38
STRING ;
39
SORT ;
40
TAGDEC ;
41
TDF ;
42
TOKDEC ;
43
TOKPAR ;
44
ULONG ;
45
 
46
 
47
%terminals%
48
 
49
access_cons ; access_sort ; access_tok ; addrop ; al_tag_sort ;
50
al_tag_tok ; al_tagdef ; alignment_cons ; alignment_sort ;
51
alignment_tok ; arithop ; bar ; !base ; bitfield_variety_cons ;
52
bitfield_variety_sort ; bitfield_variety_tok ; bool_cons ; bool_sort ;
53
bool_tok ; case_term ; ccurl ; char_term ; character ; check_stack ;
54
colon ; comma ; common_term ; commondec_term ; cons ; crd ; csq ;
55
dotdotdot ; double_term ; dynamic ; e_term ; eof ; equals ;
56
error_code_cons ; error_treatment_cons ; error_treatment_sort ;
57
error_treatment_tok ; exp_cons ; exp_sort ; exp_tok ; float_den ;
58
float_query ; float_term ; floating_variety_cons ;
59
floating_variety_sort ; floating_variety_tok ; general ; goesto ; hash ;
60
iddec ; ident ; int_den ; int_term ; keep ; lab ; label_sort ;
61
label_tok ; let ; line_term ; logop ; long_term ; !mantissa ; !maxexp ;
62
!minexp ; minus_term ; nat_cons ; nat_sort ; nat_tok ; !notaterminal ;
63
!ntest_cons ; ntest_sort ; ntest_tok ; ocurl ; offset_query ; ord ;
64
osq ; !point ; proc ; proc_query ; ptr ; ptr_query ; qstring ; query ;
65
relop ; rep ; rounding_mode_cons ; rounding_mode_sort ;
66
rounding_mode_tok ; same ; semi ; shape_cons ; shape_sort ; shape_tok ;
67
short_term ; signed_nat_cons ; signed_nat_sort ; signed_nat_tok ;
68
signed_term ; size_term ; star ; string_cons ; string_sort ;
69
string_term ; string_tok ; struct_term ; tag_cons ; tag_sort ; tag_tok ;
70
tail_call_term ; tokdec ; tokdef ; !token_cons ; token_sort ;
71
!token_tok ; transfer_mode_cons ; transfer_mode_sort ;
72
transfer_mode_tok ; unsigned_term ; untidy ; use ; var ; vardec ;
73
variety_cons ; variety_sort ; variety_tok ; varpar ;
74
 
75
%productions%
76
 
77
 
78
/* ACTION DECLARATIONS */
79
 
80
<access1> : ( :TDF, :TDF, :TDF, :PTR_TDF ) -> () ;
81
<access2> : ( :INT ) -> () ;
82
<acc_l1> : () -> () ;
83
<acc_l2_dec> : () -> ( :TDF, :TDF, :PTR_TDF ) ;
84
<acc_l3> : ( :TDF, :TDF, :PTR_TDF ) -> () ;
85
<alignment1> : ( :TDF, :TDF, :TDF, :PTR_TDF ) -> () ;
86
<alignment3> : ( :TDF, :PTR_TDF ) -> () ;
87
<alment2_dec> : () -> ( :TDF, :PTR_TDF ) ;
88
<al_list1_dec> : () -> ( :TDF, :PTR_TDF ) ;
89
<al_list2> : ( :TDF, :PTR_TDF ) -> () ;
90
<al_list_opt1> : () -> () ;
91
<al_tag1> : () -> () ;
92
<al_tagdef2> : ( :AL_TAGDEC, :TDF, :PTR_TDF, :INT ) -> () ;
93
<al_tgdf1_dec> : () -> ( :AL_TAGDEC, :TDF, :PTR_TDF, :INT ) ;
94
<bool1> : ( :TDF, :TDF, :TDF, :PTR_TDF ) -> () ;
95
<bvar3_dec> : () -> ( :TDF, :TDF, :PTR_TDF ) ;
96
<bvariety1> : ( :TDF, :TDF, :TDF, :PTR_TDF ) -> () ;
97
<bvariety2> : () -> () ;
98
<bvariety4> : ( :TDF, :TDF, :PTR_TDF ) -> () ;
99
<bvariety5> : ( :TDF, :TDF, :PTR_TDF ) -> () ;
100
<call1_dec> : () -> ( :TDF, :TDF, :TDF, :TDF ) ;
101
<call2> : ( :TDF ) -> () ;
102
<call3> : ( :TDF ) -> () ;
103
<call4> : ( :TDF, :TDF, :TDF, :TDF ) -> () ;
104
<callee1_dec> : () -> ( :TDF, :PTR_TDF ) ;
105
<callee2> : ( :TDF, :PTR_TDF ) -> () ;
106
<callee3_dec> : () -> ( :TDF, :TDF, :PTR_TDF ) ;
107
<callee4> : ( :TDF, :TDF, :PTR_TDF ) -> () ;
108
<callee5> : ( :TDF, :TDF, :PTR_TDF ) -> () ;
109
<callee6> : () -> () ;
110
<cevaropt1> : () -> () ;
111
<cevaropt2> : () -> () ;
112
<chvar1_dec> : () -> ( :TDF, :TDF, :PTR_TDF ) ;
113
<chvar2> : ( :TDF, :TDF, :PTR_TDF ) -> () ;
114
<chvar3> : ( :TDF, :TDF, :PTR_TDF ) -> () ;
115
<crvaropt1> : () -> () ;
116
<crvaropt2> : () -> () ;
117
<cseexp1_dec> : () -> ( :TDF, :TDF, :PTR_TDF ) ;
118
<cseexp2> : ( :TDF, :TDF, :PTR_TDF ) -> () ;
119
<cseexp3> : ( :TDF, :TDF, :PTR_TDF ) -> () ;
120
<ctag_def3> : ( :TDF, :TDF, :PTR_TDF, :TAGDEC ) -> () ;
121
<ctag_def6> : ( :TDF, :TDF, :PTR_TDF, :TAGDEC, :INT ) -> () ;
122
<dest_o1_dec> : () -> ( :PTR_TDF ) ;
123
<dest_opt2> : ( :PTR_TDF ) -> () ;
124
<empty_snl> : () -> () ;
125
<eopt1> : () -> () ;
126
<errc1> : () -> () ;
127
<errc2> : () -> () ;
128
<errt1> : ( :TDF, :TDF, :TDF, :PTR_TDF ) -> () ;
129
<errt2_dec> : () -> ( :TDF, :PTR_TDF ) ;
130
<errt3> : ( :TDF, :PTR_TDF ) -> () ;
131
<errt5> : ( :TDF, :PTR_TDF ) -> () ;
132
<exp1> : ( :TDF, :TDF, :TDF, :PTR_TDF ) -> () ;
133
<exp1_dec> : () -> ( :TDF, :TDF, :PTR_TDF, :STRING ) ;
134
<exp2> : ( :TDF, :TDF, :PTR_TDF, :STRING ) -> () ;
135
<exp3> : ( :TDF, :TDF, :PTR_TDF, :STRING ) -> () ;
136
<exp5> : ( :TDF, :TDF, :PTR_TDF, :STRING ) -> () ;
137
<exp6> : ( :TDF, :TDF, :PTR_TDF, :STRING ) -> () ;
138
<expcond1_dec> : () -> ( :TDF, :TDF, :TDF, :PTR_TDF, :INT, :LABDEC ) ;
139
<expcond2> : ( :TDF, :PTR_TDF ) -> () ;
140
<expcond3> : ( :TDF, :INT, :LABDEC ) -> () ;
141
<expcond4> : ( :TDF, :TDF, :TDF, :PTR_TDF ) -> () ;
142
<expcons1_dec> : () -> ( :TDF, :TDF, :PTR_TDF ) ;
143
<expcons2> : ( :TDF, :TDF, :PTR_TDF ) -> () ;
144
<expcons3> : ( :TDF, :TDF, :PTR_TDF ) -> () ;
145
<expdec1_dec> : () -> ( :TAGDEC ) ;
146
<expdec2> : ( :TAGDEC ) -> () ;
147
<expfail1> : () -> () ;
148
<exphold1_dec> : () -> ( :TDF, :PTR_TDF, :INT, :ULONG, :INT ) ;
149
<exphold2> : ( :TDF, :PTR_TDF, :INT, :ULONG, :INT ) -> () ;
150
<expl1> : () -> () ;
151
<expl2> : () -> () ;
152
<explab1_dec> : () -> ( :TDF, :TDF, :TDF, :PTR_TDF, :LABDEC ) ;
153
<explab2> : ( :TDF, :PTR_TDF ) -> () ;
154
<explab3> : ( :TDF, :TDF, :TDF, :PTR_TDF, :LABDEC ) -> () ;
155
<expneg1_dec> : () -> ( :TDF, :PTR_TDF ) ;
156
<expnegate2> : ( :TDF, :PTR_TDF ) -> () ;
157
<expproc1_dec> : () -> ( :TDF, :TDF, :TDF, :TDF, :PTR_TDF, :TAGDEC, :LABDEC ) ;
158
<expproc2> : ( :TDF, :PTR_TDF ) -> () ;
159
<expproc3> : ( :TDF, :PTR_TDF ) -> () ;
160
<expproc4> : ( :TDF, :PTR_TDF ) -> () ;
161
<expproc5> : ( :TDF, :TDF, :TDF, :TDF, :PTR_TDF, :TAGDEC, :LABDEC ) -> () ;
162
<exprep1_dec> : () -> ( :TDF, :TDF, :TDF, :PTR_TDF, :LABDEC, :INT ) ;
163
<exprep2> : ( :INT ) -> () ;
164
<exprep3> : ( :TDF, :TDF, :PTR_TDF ) -> () ;
165
<exprep4> : ( :TDF, :TDF, :TDF, :PTR_TDF, :LABDEC, :INT ) -> () ;
166
<expstar1> : () -> () ;
167
<expstar2_dec> : () -> ( :TDF, :TDF, :PTR_TDF ) ;
168
<expstar3> : ( :TDF, :PTR_TDF ) -> () ;
169
<expstar4> : ( :TDF, :TDF, :PTR_TDF ) -> () ;
170
<expstr1_dec> : () -> ( :TDF, :TDF, :PTR_TDF ) ;
171
<expstr2> : ( :TDF, :PTR_TDF ) -> () ;
172
<expstring2> : ( :TDF, :TDF, :PTR_TDF ) -> () ;
173
<exptag1> : () -> () ;
174
<exptst1_dec> : () -> ( :TDF, :TDF, :TDF, :PTR_TDF, :INT ) ;
175
<exptst2> : ( :TDF, :PTR_TDF ) -> () ;
176
<exptst3> : ( :TDF, :PTR_TDF ) -> () ;
177
<exptst4> : ( :TDF, :TDF, :TDF, :PTR_TDF, :INT ) -> () ;
178
<exp_sls1> : () -> () ;
179
<exp_sls2> : () -> () ;
180
<exp_sls3_dec> : () -> ( :TDF, :PTR_TDF ) ;
181
<exp_sls4> : ( :TDF, :PTR_TDF ) -> () ;
182
<exp_sls5> : () -> () ;
183
<fden1_dec> : () -> ( :TDF, :TDF, :TDF, :TDF, :PTR_TDF, :INT, :ULONG ) ;
184
<fden2_dec> : () -> ( :TDF, :TDF, :TDF, :TDF, :PTR_TDF, :INT, :ULONG ) ;
185
<fden3> : ( :TDF, :PTR_TDF ) -> () ;
186
<fden4> : ( :TDF, :PTR_TDF ) -> () ;
187
<fden5> : ( :TDF, :TDF, :TDF, :TDF, :PTR_TDF, :INT, :ULONG ) -> () ;
188
<field1_dec> : () -> ( :PTR_TDF, :TOKDEC, :TOKDEC ) ;
189
<field2> : ( :PTR_TDF, :TOKDEC, :TOKDEC ) -> () ;
190
<fvar1> : ( :TDF, :TDF, :TDF, :PTR_TDF ) -> () ;
191
<fvardouble> : () -> () ;
192
<fvarfloat> : () -> () ;
193
<gcall1_dec> : () -> ( :TDF, :TDF, :TDF, :INT, :INT, :TAGDEC, :TAGDEC, :TAGDEC ) ;
194
<gcall2> : ( :TDF, :INT, :TAGDEC, :TAGDEC ) -> () ;
195
<gcall3> : ( :TDF, :INT, :TAGDEC ) -> () ;
196
<gcall4> : ( :TDF, :TDF, :TDF, :TDF, :TDF, :INT, :INT, :TAGDEC ) -> () ;
197
<gencond1_dec> : () -> ( :TDF, :TDF, :TDF, :PTR_TDF ) ;
198
<gencond2> : ( :TDF, :PTR_TDF ) -> () ;
199
<gencond3> : ( :TDF, :PTR_TDF ) -> () ;
200
<gencons1_dec> : () -> ( :INT ) ;
201
<gencons2> : ( :INT ) -> () ;
202
<genhold1_dec> : () -> ( :TDF, :PTR_TDF, :INT ) ;
203
<genhold2> : ( :TDF, :PTR_TDF, :INT ) -> () ;
204
<gentok1_dec> : () -> ( :TOKDEC ) ;
205
<gentok2> : ( :TOKDEC ) -> () ;
206
<gproc1_dec> : () -> ( :TDF, :TDF, :TDF, :TDF, :PTR_TDF, :INT, :INT, :INT, :TAGDEC, :LABDEC ) ;
207
<gproc2> : ( :TDF, :PTR_TDF ) -> () ;
208
<gproc3> : ( :TDF, :PTR_TDF, :INT ) -> () ;
209
<gproc4> : ( :TDF, :PTR_TDF, :INT ) -> () ;
210
<gproc5> : ( :INT ) -> () ;
211
<gproc6> : ( :TDF, :TDF, :TDF, :TDF, :PTR_TDF, :INT, :INT, :INT, :TAGDEC, :LABDEC ) -> () ;
212
<ibody1_dec> : () -> ( :TDF, :TDF, :TDF, :PTR_TDF, :NAME, :INT ) ;
213
<integer1> : () -> () ;
214
<integer2> : () -> () ;
215
<intro1_dec> : () -> ( :TDF, :TDF, :PTR_TDF, :TAGDEC, :INT ) ;
216
<intro2> : ( :TDF, :PTR_TDF, :INT ) -> () ;
217
<intro3> : ( :PTR_TDF, :TAGDEC ) -> () ;
218
<intro4> : ( :TDF, :TDF, :PTR_TDF, :TAGDEC, :INT ) -> () ;
219
<intro5> : ( :TDF, :TDF, :PTR_TDF, :TAGDEC, :INT ) -> () ;
220
<intro6> : ( :TAGDEC ) -> () ;
221
<introbody2> : ( :TDF, :TDF, :TDF, :PTR_TDF, :NAME, :INT ) -> () ;
222
<keep1> : () -> () ;
223
<keep2> : () -> () ;
224
<keeps1> : () -> () ;
225
<keeps2> : () -> () ;
226
<label1> : () -> () ;
227
<llist1_dec> : () -> ( :TDF, :PTR_TDF ) ;
228
<llist2> : ( :TDF ) -> () ;
229
<llist3> : () -> () ;
230
<llist4> : () -> () ;
231
<llist5> : ( :TDF, :PTR_TDF ) -> () ;
232
<lset_o1> : () -> () ;
233
<lset_o2_dec> : () -> ( :PTR_TDF ) ;
234
<lset_o3> : ( :PTR_TDF ) -> () ;
235
<mint1_dec> : () -> ( :TDF, :TDF ) ;
236
<mint2> : ( :TDF, :TDF ) -> () ;
237
<nat1> : ( :TDF, :TDF, :TDF, :PTR_TDF ) -> () ;
238
<nat2> : () -> () ;
239
<natopt1> : ( :TDF, :PTR_TDF ) -> () ;
240
<natopt_dec> : () -> ( :TDF, :PTR_TDF ) ;
241
<newstring1> : () -> () ;
242
<newstring2> : ( :TDF, :TDF, :TDF, :PTR_TDF ) -> () ;
243
<newstr_opt1> : () -> () ;
244
<ntest1> : ( :TDF, :TDF, :TDF, :PTR_TDF ) -> () ;
245
<ntest2> : () -> () ;
246
<offexpl1> : () -> () ;
247
<offexpl2> : () -> () ;
248
<otagel1> : () -> () ;
249
<otagel2> : () -> () ;
250
<otagel_opt1> : () -> () ;
251
<otagexp1_dec> : () -> ( :TDF, :PTR_TDF ) ;
252
<otagexp2> : ( :TDF, :PTR_TDF ) -> () ;
253
<otagexp3> : ( :TDF, :PTR_TDF ) -> () ;
254
<plude1> : () -> () ;
255
<proc_def1> : ( :TDF, :PTR_TDF ) -> () ;
256
<proc_def2> : ( :TDF, :TDF, :PTR_TDF, :TAGDEC, :STRING, :INT ) -> () ;
257
<query_type1> : () -> () ;
258
<query_type2> : () -> () ;
259
<query_type3> : () -> () ;
260
<query_type4> : () -> () ;
261
<query_type5> : () -> () ;
262
<range1_dec> : () -> ( :PTR_TDF ) ;
263
<range2> : ( :PTR_TDF ) -> () ;
264
<range3> : ( :PTR_TDF ) -> () ;
265
<range4> : ( :PTR_TDF ) -> () ;
266
<rllist1_dec> : () -> ( :TDF, :PTR_TDF ) ;
267
<rllist2> : ( :TDF, :PTR_TDF ) -> () ;
268
<rllist3> : ( :TDF, :PTR_TDF ) -> () ;
269
<rllist4> : () -> () ;
270
<rmode1> : ( :TDF, :TDF, :TDF, :PTR_TDF ) -> () ;
271
<rmodeopt1> : () -> () ;
272
<shape1> : ( :TDF, :TDF, :TDF, :PTR_TDF ) -> () ;
273
<shapechar> : () -> () ;
274
<shapedouble> : () -> () ;
275
<shapefloat> : () -> () ;
276
<shapeint> : () -> () ;
277
<shapelong> : () -> () ;
278
<shapeptr2> : ( :TDF, :PTR_TDF ) -> () ;
279
<shapeshort> : () -> () ;
280
<shapetok2> : ( :PTR_TDF, :TDF, :PTR_TDF, :INT ) -> () ;
281
<shapetokchar> : () -> () ;
282
<shapetokint> : () -> () ;
283
<shapetoklong> : () -> () ;
284
<shptr1_dec> : () -> ( :TDF, :PTR_TDF ) ;
285
<shtok1_dec> : () -> ( :PTR_TDF, :TDF, :PTR_TDF, :INT ) ;
286
<shtokdb> : () -> () ;
287
<shtokflt> : () -> () ;
288
<shtokshrt> : () -> () ;
289
<signedornot1> : () -> () ;
290
<signedornot2> : () -> () ;
291
<signed_nat1> : ( :TDF, :TDF, :TDF, :PTR_TDF ) -> () ;
292
<signed_nat2> : () -> () ;
293
<signed_nat3> : () -> () ;
294
<signed_nat4> : () -> () ;
295
<signed_nat5_dec> : () -> ( :TDF, :PTR_TDF ) ;
296
<signed_nat6> : ( :TDF, :PTR_TDF ) -> () ;
297
<signed_nat7_dec> : () -> ( :TDF, :PTR_TDF ) ;
298
<signed_nat8> : ( :TDF, :PTR_TDF ) -> () ;
299
<sizeexp2> : ( :TDF, :PTR_TDF ) -> () ;
300
<sortname1> : () -> () ;
301
<sortname2> : () -> () ;
302
<sortname3_dec> : () -> ( :SORT, :TOKPAR, :TOKPAR ) ;
303
<sortname4> : ( :TOKPAR ) -> () ;
304
<sortname5> : ( :SORT, :TOKPAR, :TOKPAR ) -> () ;
305
<snl1> : () -> () ;
306
<snl2_dec> : () -> ( :SORT ) ;
307
<snl3> : ( :SORT ) -> () ;
308
<strtr1> : () -> () ;
309
<struct1_dec> : () -> ( :TOKDEC ) ;
310
<struct2> : ( :TOKDEC ) -> () ;
311
<szexp1_dec> : () -> ( :TDF, :PTR_TDF ) ;
312
<tag1> : () -> () ;
313
<tagsa1_dec> : () -> ( :TDF, :PTR_TDF, :TAGDEC, :INT ) ;
314
<tagshacc2> : ( :PTR_TDF, :TAGDEC, :INT ) -> () ;
315
<tagshacc3> : ( :TDF, :PTR_TDF, :TAGDEC, :INT ) -> () ;
316
<tagshacc_l1> : () -> () ;
317
<tagshacc_l2> : () -> () ;
318
<tag_dec1_dec> : () -> ( :TDF, :TDF, :PTR_TDF, :TAGDEC ) ;
319
<tag_dec2> : ( :TAGDEC ) -> () ;
320
<tag_dec3> : ( :TDF, :TDF, :PTR_TDF, :TAGDEC ) -> () ;
321
<tag_dec4> : ( :TDF, :TDF, :PTR_TDF, :TAGDEC ) -> () ;
322
<tag_dec5> : ( :TDF, :TDF, :PTR_TDF, :TAGDEC ) -> () ;
323
<tag_dec6> : ( :TDF, :PTR_TDF ) -> () ;
324
<tag_def1_dec> : () -> ( :TDF, :TDF, :PTR_TDF, :TAGDEC, :STRING, :INT ) ;
325
<tag_def2> : ( :TDF, :PTR_TDF, :TAGDEC, :STRING ) -> () ;
326
<tag_def3> : ( :TDF, :TDF, :PTR_TDF, :TAGDEC ) -> () ;
327
<tag_def4> : ( :PTR_TDF, :TAGDEC, :STRING ) -> () ;
328
<tag_def5> : ( :TDF, :PTR_TDF ) -> () ;
329
<tag_def6> : ( :TDF, :TDF, :PTR_TDF, :TAGDEC, :INT ) -> () ;
330
<tag_def7_dec> : () -> ( :TDF, :TDF, :PTR_TDF, :TAGDEC, :STRING, :INT ) ;
331
<tag_def8> : ( :TDF, :TDF, :PTR_TDF, :TAGDEC ) -> () ;
332
<tag_def9> : ( :TDF, :TDF, :PTR_TDF, :TAGDEC, :INT ) -> () ;
333
<tag_def10> : ( :TAGDEC ) -> () ;
334
<tag_def12> : ( :TDF, :PTR_TDF, :TAGDEC, :INT, :TDF, :STRING ) -> () ;
335
<tcall1_dec> : () -> ( :TDF ) ;
336
<tcall2> : ( :TDF ) -> () ;
337
<tgdef10_dec> : ( :PTR_TDF ) -> ( :TDF ) ;
338
<tgdef11_dec> : ( :TDF, :PTR_TDF, :TAGDEC, :STRING, :TDF ) -> ( :STRING ) ;
339
<tmode1> : ( :TDF, :TDF, :TDF, :PTR_TDF ) -> () ;
340
<tok1> : () -> () ;
341
<tok2_dec> : () -> ( :TDF ) ;
342
<tok3> : ( :TDF ) -> () ;
343
<tok_dec1_dec> : () -> ( :TDF, :PTR_TDF, :TOKDEC ) ;
344
<tok_dec2> : ( :TDF, :PTR_TDF, :TOKDEC ) -> () ;
345
<tok_def0> : () -> () ;
346
<tok_def1_dec> : () -> ( :TDF, :TDF, :PTR_TDF, :TOKDEC, :INT ) ;
347
<tok_def2> : ( :TDF, :TDF, :PTR_TDF, :TOKDEC, :INT ) -> () ;
348
<tok_dn1_dec> : () -> ( :TOKDEC ) ;
349
<tok_dn2> : ( :TOKDEC ) -> () ;
350
<tok_fml1_dec> : () -> ( :TOKDEC ) ;
351
<tok_fml2> : ( :TOKDEC ) -> () ;
352
<tok_fml3> : ( :TOKDEC ) -> () ;
353
<tok_fml_opt1> : () -> () ;
354
<untidy1> : () -> () ;
355
<untidy2> : () -> () ;
356
<untidy3> : () -> () ;
357
<untidy4> : () -> () ;
358
<variety1> : ( :TDF, :TDF, :TDF, :PTR_TDF ) -> () ;
359
<variety2_dec> : () -> ( :TDF, :TDF, :PTR_TDF ) ;
360
<variety3> : ( :TDF, :PTR_TDF ) -> () ;
361
<variety4> : ( :TDF, :TDF, :PTR_TDF ) -> () ;
362
<varietychar> : () -> () ;
363
<varietyint> : () -> () ;
364
<varietylong> : () -> () ;
365
<varietyopt1> : () -> () ;
366
<varietyshort> : () -> () ;
367
<vpar1> : () -> () ;
368
<vpar2> : () -> () ;
369
<syntax_error> : () -> () ;
370
 
371
 
372
/* PRODUCTION DECLARATIONS */
373
 
374
access_opt ;
375
alignment ;
376
bitfield_variety ;
377
bool ;
378
closed_exp ;
379
exp ;
380
label ;
381
unary_exp ;
382
nat ;
383
proc_def_body ;
384
proc_exp ;
385
shape ;
386
sortname_list_opt ;
387
string ;
388
variety_opt ;
389
 
390
 
391
/* SORT NAMES */
392
 
393
sortname = {
394
    	access_sort ;
395
    ||	al_tag_sort ;
396
    ||	alignment_sort ;
397
    ||	bitfield_variety_sort ;
398
    ||	bool_sort ;
399
    ||	error_treatment_sort ;
400
    ||	exp_sort ;
401
    ||	floating_variety_sort ;
402
    ||	label_sort ;
403
    ||	nat_sort ;
404
    ||	ntest_sort ;
405
    ||	rounding_mode_sort ;
406
    ||	shape_sort ;
407
    ||	signed_nat_sort ;
408
    ||	string_sort ;
409
    ||	tag_sort ;
410
    ||	token_sort ;
411
    ||	transfer_mode_sort ;
412
    ||	variety_sort ;
413
} ;
414
 
415
full_sortname = {
416
	<sortname1> ; sortname ; <sortname2> ;
417
    ||
418
	<sortname1> ; sortname ; ( a, b, c ) = <sortname3_dec> ;
419
	osq ; sortname_list_opt ; csq ; <sortname4> ( b ) ;
420
	full_sortname ; <sortname5> ( a, b, c ) ;
421
} ;
422
 
423
sortname_list = {
424
	full_sortname ; <snl1> ;
425
    ||
426
	full_sortname ; a = <snl2_dec> ;
427
	comma ; sortname_list ; <snl3> ( a ) ;
428
} ;
429
 
430
sortname_list_opt = {
431
	<empty_snl> ;
432
    ||	sortname_list ;
433
} ;
434
 
435
 
436
/* TOKEN DECLARATIONS */
437
 
438
signature_opt = {
439
	string ; <newstr_opt1> ;
440
    ||	$ ;
441
} ;
442
 
443
tok_dec = {
444
	tokdec ; ( a, b, c ) = <tok_dec1_dec> ;
445
	ident ; signature_opt ; colon ;
446
	osq ; sortname_list_opt ; csq ;
447
	full_sortname ; <tok_dec2> ( a, b, c ) ;
448
} ;
449
 
450
 
451
/* TOKEN DEFINITIONS */
452
 
453
tok_formal_list = {
454
	a = <tok_fml1_dec> ; ident ; colon ;
455
	full_sortname ; <tok_fml2> ( a ) ;
456
    ||
457
	tok_formal_list ; comma ;
458
	a = <tok_fml1_dec> ; ident ; colon ;
459
	full_sortname ; <tok_fml3> ( a ) ;
460
} ;
461
 
462
tok_formal_list_opt = {
463
	tok_formal_list ;
464
    ||	<tok_fml_opt1> ;
465
} ;
466
 
467
tok_def_body = {
468
 	a = <tok_dn1_dec> ; osq ; tok_formal_list_opt ; csq ;
469
	full_sortname ; <tok_dn2> ( a ) ;
470
} ;
471
 
472
tok_def = {
473
 	<tok_def0> ; tokdef ; ( a, b, c, d, e ) = <tok_def1_dec> ;
474
	ident ; equals ; tok_def_body ; <tok_def2> ( a, b, c, d, e ) ;
475
} ;
476
 
477
 
478
/* STRUCTURE DEFINITIONS */
479
 
480
field_list = {
481
	( a, b, c ) = <field1_dec> ;
482
	ident ; colon ; shape ; <field2> ( a, b, c ) ;
483
    ||
484
	( a, b, c ) = <field1_dec> ;
485
	ident ; colon ; shape ; <field2> ( a, b, c ) ; comma ;
486
	field_list ;
487
} ;
488
 
489
struct_def = {
490
	struct_term ; a = <struct1_dec> ; ident ; ord ;
491
	field_list ; <struct2> ( a ) ; crd ;
492
} ;
493
 
494
 
495
/* TAG SHAPES */
496
 
497
nonst_shape_body = {
498
	shape_sort ; query ; ( a, b, c, d ) = <gencond1_dec> ;
499
	ord ; exp ; <gencond2> ( b, d ) ; comma ;
500
	shape ; <gencond3> ( c, d ) ; comma ; shape ;
501
	<shape1> ( a, b, c, d ) ; crd ;
502
    ||
503
	shape_sort ; colon ; shape ;
504
    ||
505
	a = <gentok1_dec> ; shape_tok ; <gentok2> ( a ) ;
506
    ||
507
	a = <gencons1_dec> ; shape_cons ; <gencons2> ( a ) ;
508
    ||
509
	ptr ; ( a, b ) = <shptr1_dec> ; shape ; <shapeptr2> ( a, b ) ;
510
} ;
511
 
512
nonst_shape = {
513
	( a, b, c ) = <genhold1_dec> ;
514
	nonst_shape_body ; <genhold2> ( a, b, c ) ;
515
} ;
516
 
517
variety_sign = {
518
	<signedornot1> ;
519
    ||
520
	signed_term ; <signedornot1> ;
521
    ||
522
	unsigned_term ; <signedornot2> ;
523
} ;
524
 
525
shapetok = {
526
	( a, b, c, d ) = <shtok1_dec> ; nonst_shape ;
527
	<shapetok2> ( a, b, c, d ) ;
528
    ||
529
	float_term ; <shtokflt> ;
530
    ||
531
	double_term ; <shtokdb> ;
532
    ||
533
	variety_sign ; int_term ; <shapetokint> ;
534
    ||
535
	variety_sign ; long_term ; <shapetoklong> ;
536
    ||
537
	variety_sign ; short_term ; <shtokshrt> ;
538
    ||
539
	variety_sign ; char_term ; <shapetokchar> ;
540
} ;
541
 
542
 
543
/* STRINGS */
544
 
545
string = {
546
	<newstring1> ; qstring ;
547
    ||
548
	string_sort ; query ; ( a, b, c, d ) = <gencond1_dec> ;
549
	ord ; exp ; <gencond2> ( b, d ) ; comma ;
550
	string ; comma ; <gencond3> ( c, d ) ;
551
	string ; <newstring2> ( a, b, c, d ) ; crd ;
552
    ||
553
	string_sort ; colon ; string ;
554
    ||
555
	a = <gentok1_dec> ; string_tok ; <gentok2> ( a ) ;
556
    ||
557
	a = <gencons1_dec> ; string_cons ; <gencons2> ( a ) ;
558
    ##
559
	<syntax_error> ;
560
} ;
561
 
562
 
563
/* TAG DECLARATIONS */
564
 
565
tag_dec	= {
566
	vardec ; ( a, b, c, d ) = <tag_dec1_dec> ;
567
	ident ; access_opt ;
568
	<tag_dec6> ( b, c ) ; signature_opt ;
569
	<tag_dec2> ( d ) ; colon ; shapetok ; <tag_dec3> ( a, b, c, d ) ;
570
    ||
571
	iddec ; ( a, b, c, d ) = <tag_dec1_dec> ;
572
	ident ; access_opt ;
573
	<tag_dec6> ( b, c ) ; signature_opt ;
574
	<tag_dec2> ( d ) ; colon ; shapetok ; <tag_dec4> ( a, b, c, d ) ;
575
    ||
576
	commondec_term ; ( a, b, c, d ) = <tag_dec1_dec> ;
577
	ident ; access_opt ;
578
	<tag_dec6> ( b, c ) ; signature_opt ;
579
	<tag_dec2> ( d ) ; colon ; shapetok ; <tag_dec5> ( a, b, c, d ) ;
580
} ;
581
 
582
 
583
/* TAG DEFINITIONS */
584
 
585
tag_def = {
586
	var ; ( a, b, c, d, e, f ) = <tag_def1_dec> ;
587
	ident ; signature_opt ;
588
	<tag_def2> ( a, c, d, e ) ; equals ; exp ;
589
	<tag_def3> ( a, b, c, d ) ;
590
    ||
591
	var ; ( a, b, c, d, e, f ) = <tag_def1_dec> ;
592
	ident ; signature_opt ;
593
	<tag_def4> ( c, d, e ) ; colon ; shapetok ;
594
	<tag_def5> ( a, c ) ; equals ; exp ;
595
	<tag_def6> ( a, b, c, d, f ) ;
596
    ||
597
	var ; ( a, b, c, d, e, f ) = <tag_def1_dec> ;
598
	ident ; signature_opt ;
599
	<tag_def4> ( c, d, e ) ; colon ; shapetok ;
600
	<tag_def5> ( a, c ) ; <tag_def10> ( d ) ;
601
	<tag_def6> ( a, b, c, d, f ) ;
602
    ||
603
	common_term ; ( a, b, c, d, e, f ) = <tag_def1_dec> ;
604
	ident ; signature_opt ;
605
	<tag_def2> ( a, c, d, e ) ; equals ; exp ;
606
	<ctag_def3> ( a, b, c, d ) ;
607
    ||
608
	common_term ; ( a, b, c, d, e, f ) = <tag_def1_dec> ;
609
	ident ; signature_opt ;
610
	<tag_def4> ( c, d, e ) ; colon ; shapetok ;
611
	<tag_def5> ( a, c ) ; equals ; exp ;
612
	<ctag_def6> ( a, b, c, d, f ) ;
613
    ||
614
	common_term ; ( a, b, c, d, e, f ) = <tag_def1_dec> ;
615
	ident ; signature_opt ;
616
	<tag_def4> ( c, d, e ) ; colon ; shapetok ;
617
	<tag_def5> ( a, c ) ; <tag_def10> ( d ) ;
618
	<ctag_def6> ( a, b, c, d, f ) ;
619
    ||
620
	let ; ( a, b, c, d, e, f ) = <tag_def7_dec> ;
621
	ident ; signature_opt ; equals ;
622
	<tag_def2> ( a, c, d, e ) ; exp ;
623
	<tag_def8> ( a, b, c, d ) ;
624
    ||
625
	let ; ( a, b, c, d, e, f ) = <tag_def7_dec> ;
626
	ident ; signature_opt ;
627
	<tag_def4> ( c, d, e ) ; colon ; shapetok ;
628
	<tag_def5> ( a, c ) ; equals ; exp ;
629
	<tag_def9> ( a, b, c, d, f ) ;
630
    ||
631
	string_term ; ( a, b, c, d, e, f ) = <tag_def1_dec> ;
632
	ident ; signature_opt ;
633
	g = <tgdef10_dec> ( c ) ; variety_opt ; equals ;
634
	h = <tgdef11_dec> ( a, c, d, e, g ) ; qstring ;
635
	<tag_def12> ( a, c, d, f, g, h ) ;
636
} ;
637
 
638
 
639
/* PROCEDURE DEFINITIONS */
640
 
641
proc_def = {
642
	proc ; ( a, b, c, d, e, f ) = <tag_def7_dec> ;
643
	ident ; equals ; <proc_def1> ( a, c ) ;
644
	proc_def_body ; <proc_def2> ( a, b, c, d, e, f ) ;
645
} ;
646
 
647
 
648
/* ALIGNMENT TAG DEFINITIONS */
649
 
650
al_tag_def = {
651
	al_tagdef ; ( a, b, c, d ) = <al_tgdf1_dec> ; ident ; equals ;
652
	alignment ; <al_tagdef2> ( a, b, c, d ) ;
653
} ;
654
 
655
 
656
/* ACCESSES */
657
 
658
access = {
659
 	access_sort ; query ; ( a, b, c, d ) = <gencond1_dec> ;
660
	ord ; exp ; <gencond2> ( b, d ) ; comma ;
661
	access ; comma ; <gencond3> ( c, d ) ;
662
	access ; <access1> ( a, b, c, d ) ; crd ;
663
    ||
664
	access_sort ; colon ; access ;
665
    ||
666
	a = <gentok1_dec> ; access_tok ; <gentok2> ( a ) ;
667
    ||
668
	a = <gencons1_dec> ; access_cons ; <access2> ( a ) ; <gencons2> ( a ) ;
669
    ##
670
	<syntax_error> ;
671
} ;
672
 
673
access_list =	{
674
	access ; <acc_l1> ;
675
    ||
676
	access_list ; ( a, b, c ) = <acc_l2_dec> ; comma ;
677
	access ; <acc_l3> ( a, b, c ) ;
678
} ;
679
 
680
access_opt = {
681
	osq ; access_list ; csq ;
682
    ||	$ ;
683
} ;
684
 
685
 
686
/* ALIGNMENT TAGS */
687
 
688
al_tag = {
689
 	al_tag_sort ; colon ; al_tag ;
690
    ||
691
	a = <gentok1_dec> ; al_tag_tok ; <gentok2> ( a ) ;
692
    ||
693
	<al_tag1> ; ident ;
694
    ##
695
	<syntax_error> ;
696
} ;
697
 
698
 
699
/* ALIGNMENTS */
700
 
701
alignment_list = {
702
	alignment ;
703
    ||
704
	alignment_list ; ( a, b ) = <al_list1_dec> ; comma ;
705
	alignment ; <al_list2> ( a, b ) ;
706
} ;
707
 
708
alignment_list_opt = {
709
	<al_list_opt1> ;
710
    ||
711
	( a, b, c ) = <genhold1_dec> ;
712
	alignment_list ; <genhold2> ( a, b, c ) ;
713
} ;
714
 
715
alignment = {
716
 	alignment_sort ; query ; ( a, b, c, d ) = <gencond1_dec> ;
717
	ord ; exp ; comma ; <gencond2> ( b, d ) ;
718
	alignment ; comma ; <gencond3> ( c, d ) ;
719
	alignment ; <alignment1> ( a, b, c, d ) ; crd ;
720
    ||
721
	alignment_sort ; colon ; alignment ;
722
    ||
723
	a = <gentok1_dec> ; alignment_tok ; <gentok2> ( a ) ;
724
    ||
725
	( a, b ) = <alment2_dec> ; al_tag ; <alignment3> ( a, b ) ;
726
    ||
727
	a = <gencons1_dec> ; alignment_cons ; <gencons2> ( a ) ;
728
    ||
729
	ord ; alignment_list_opt ; crd ;
730
    ##
731
	<syntax_error> ;
732
} ;
733
 
734
 
735
/* BITFIELD VARIETIES */
736
 
737
after_bv_sort = {
738
	( a, b, c, d ) = <gencond1_dec> ; query ;
739
	ord ; exp ; comma ; <gencond2> ( b, d ) ;
740
	bitfield_variety ; comma ; <gencond3> ( c, d ) ;
741
	bitfield_variety ; <bvariety1> ( a, b, c, d ) ; crd ;
742
    ||
743
	colon ; bitfield_variety ;		   
744
} ;
745
 
746
bitfield_sign = {
747
	bool ;
748
    ||	variety_sign ; <bvariety2> ;
749
} ;
750
 
751
bitfield_variety = {
752
	bitfield_variety_sort ; after_bv_sort ;
753
    ||
754
	a = <gentok1_dec> ; bitfield_variety_tok ; <gentok2> ( a ) ;
755
    ||
756
	a = <gencons1_dec> ; bitfield_variety_cons ; <gencons2> ( a ) ;
757
    ||
758
	( a, b, c ) = <bvar3_dec> ; bitfield_sign ;
759
	<bvariety4> ( a, b, c ) ; nat ; <bvariety5> ( a, b, c ) ;
760
    ##
761
	<syntax_error> ;
762
} ;
763
 
764
 
765
/* BOOLS */
766
 
767
after_bool_sort = {
768
	( a, b, c, d ) = <gencond1_dec> ; query ;
769
	ord ; exp ; comma ; <gencond2> ( b, d ) ;
770
	bool ; comma ; <gencond3> ( c, d ) ;
771
	bool ; <bool1> ( a, b, c, d ) ; crd ;
772
    ||
773
	colon ; bool ;
774
} ;
775
 
776
bool = {
777
 	bool_sort ; after_bool_sort ;
778
    ||
779
	a = <gentok1_dec> ; bool_tok ; <gentok2> ( a ) ;
780
    ||
781
	a = <gencons1_dec> ; bool_cons ; <gencons2> ( a ) ;
782
    ##
783
	<syntax_error> ;
784
} ;
785
 
786
 
787
/* ERROR CODES */
788
 
789
error_code = {
790
	a = <gencons1_dec> ; error_code_cons ; <gencons2> ( a ) ;	
791
    ##
792
	<syntax_error> ;
793
} ;
794
 
795
error_code_list = {
796
	error_code ; <errc1> ;
797
    ||
798
	error_code_list ; comma ; error_code ; <errc2> ;
799
    ##
800
	<syntax_error> ;
801
} ;
802
 
803
 
804
/* ERROR TREATMENTS */
805
 
806
error_treatment = {
807
	error_treatment_sort ; ( a, b, c, d ) = <gencond1_dec> ; query ;
808
	ord ; exp ; comma ; <gencond2> ( b, d ) ;
809
	error_treatment ; comma ; <gencond3> ( c, d ) ;
810
	error_treatment ; <errt1> ( a, b, c, d ) ; crd ;
811
    ||
812
	error_treatment_sort ; colon ; error_treatment ;
813
    ||
814
	a = <gentok1_dec> ; error_treatment_tok ; <gentok2> ( a ) ;
815
    ||
816
	a = <gencons1_dec> ; error_treatment_cons ; <gencons2> ( a ) ;
817
    ||
818
	( a, b ) = <errt2_dec> ; label ; <errt3> ( a, b ) ;
819
    ||
820
	osq ; ( a, b ) = <errt2_dec> ; error_code_list ;
821
	<errt5> ( a, b ) ; csq ;
822
    ##
823
	<syntax_error> ;
824
} ;
825
 
826
 
827
/* FLOATING VARIETIES */
828
 
829
floating_variety = {
830
	floating_variety_sort ; ( a, b, c, d ) = <gencond1_dec> ; query ;
831
	ord ; exp ; comma ; <gencond2> ( b, d ) ;
832
	floating_variety ; comma ; <gencond3> ( c, d ) ;
833
	floating_variety ; <fvar1> ( a, b, c, d ) ; crd ;
834
    ||
835
	floating_variety_sort ; colon ; floating_variety ;
836
    ||
837
	a = <gentok1_dec> ; floating_variety_tok ; <gentok2> ( a ) ;
838
    ||
839
	a = <gencons1_dec> ; floating_variety_cons ; <gencons2> ( a ) ;
840
    ||
841
	double_term ; <fvardouble> ;
842
    ||
843
	float_term ; <fvarfloat> ;
844
    ##
845
	<syntax_error> ;
846
} ;
847
 
848
 
849
/* LABELS */
850
 
851
label = {		
852
	label_sort ; colon ; label ;
853
    ||
854
	a = <gentok1_dec> ; label_tok ; <gentok2> ( a ) ;
855
    ||
856
	<label1> ; ident ;
857
    ##
858
	<syntax_error> ;
859
} ;
860
 
861
 
862
 
863
/* NATS */
864
 
865
integer = {
866
	<integer1> ; int_den ;
867
    ||	<integer2> ; character ;
868
} ;
869
 
870
nat_not_int = {
871
	nat_sort ; query ; ( a, b, c, d ) = <gencond1_dec> ;
872
	ord ; exp ; <gencond2> ( b, d ) ; comma ;
873
	nat ; <gencond3> ( c, d ) ; comma ;
874
	nat ; <nat1> ( a, b, c, d ) ; crd ;
875
    ||
876
	nat_sort ; colon ; nat ;
877
    ||
878
	a = <gentok1_dec> ; nat_tok ; <gentok2> ( a ) ;
879
    ||
880
	a = <gencons1_dec> ; nat_cons ; <gencons2> ( a ) ;
881
} ;
882
 
883
nat = {
884
	integer ; <nat2> ;
885
    ||
886
	nat_not_int ;
887
    ##
888
	<syntax_error> ;
889
} ;
890
 
891
nat_option = {
892
	( a, b ) = <natopt_dec> ; nat ; <natopt1> ( a, b ) ;
893
    ||
894
	$ ;
895
    ##
896
	<syntax_error> ;
897
} ;
898
 
899
 
900
/* NTESTS */
901
 
902
ntest = {
903
	ntest_sort ; query ; ( a, b, c, d ) = <gencond1_dec> ;
904
	ord ; exp ; <gencond2> ( b, d ) ; comma ;
905
	ntest ; <gencond3> ( c, d ) ; comma ;
906
	ntest ; <ntest1> ( a, b, c, d ) ; crd ;
907
    ||
908
	ntest_sort ; colon ; ntest ;
909
    ||
910
	a = <gentok1_dec> ; ntest_tok ; <gentok2> ( a ) ;
911
    ||
912
	<ntest2> ; relop ;
913
    ##
914
	<syntax_error> ;
915
} ;
916
 
917
 
918
/* ROUNDING MODES */
919
 
920
rounding_mode = {
921
	rounding_mode_sort ; query ; ( a, b, c, d ) = <gencond1_dec> ;
922
	ord ; exp ; comma ; <gencond2> ( b, d ) ;
923
	rounding_mode ; comma ; <gencond3> ( c, d ) ;
924
	rounding_mode ; <rmode1> ( a, b, c, d ) ; crd ;
925
    ||
926
	rounding_mode_sort ; colon ; rounding_mode ;
927
    ||
928
	a = <gentok1_dec> ; rounding_mode_tok ; <gentok2> ( a ) ;
929
    ||
930
	a = <gencons1_dec> ; rounding_mode_cons ; <gencons2> ( a ) ;
931
    ##
932
	<syntax_error> ;
933
} ;
934
 
935
rounding_mode_opt = {
936
	rounding_mode ;
937
    ||	<rmodeopt1> ;
938
} ;
939
 
940
 
941
/* SHAPES */
942
 
943
shape_body = {
944
	shape_sort ; query ; ( a, b, c, d ) = <gencond1_dec> ;
945
	ord ; exp ; <gencond2> ( b, d ) ; comma ;
946
	shape ; <gencond3> ( c, d ) ; comma ;
947
	shape ; <shape1> ( a, b, c, d ) ; crd ;
948
    ||
949
	shape_sort ; colon ; shape ;
950
    ||
951
	a = <gentok1_dec> ; shape_tok ; <gentok2> ( a ) ;
952
    ||
953
	a = <gencons1_dec> ; shape_cons ; <gencons2> ( a ) ;
954
    ||
955
	float_term ; <shapefloat> ;
956
    ||
957
	double_term ; <shapedouble> ;
958
    ||
959
	variety_sign ; int_term ; <shapeint> ;
960
    ||
961
	variety_sign ; long_term ; <shapelong> ;
962
    ||
963
	variety_sign ; short_term ; <shapeshort> ;
964
    ||
965
	variety_sign ; char_term ; <shapechar> ;
966
    ||
967
	ptr ; ( a, b ) = <shptr1_dec> ; shape ; <shapeptr2> ( a, b ) ;
968
} ;
969
 
970
shape =	{
971
	( a, b, c ) = <genhold1_dec> ;
972
	shape_body ; <genhold2> ( a, b, c ) ;
973
    ##
974
	<syntax_error> ;
975
} ;
976
 
977
 
978
/* SIGNED NATS */
979
 
980
signed_nat_body = {
981
	signed_nat_sort ; query ; ( a, b, c, d ) = <gencond1_dec> ;
982
	ord ; exp ; <gencond2> ( b, d ) ; comma ;
983
	signed_nat_body ; <gencond3> ( c, d ) ; comma ;
984
	signed_nat_body ; <signed_nat1> ( a, b, c, d ) ; crd ;
985
    ||
986
	signed_nat_sort ; colon ; signed_nat_body ;
987
    ||
988
	a = <gentok1_dec> ; signed_nat_tok ; <gentok2> ( a ) ;
989
    ||
990
	a = <gencons1_dec> ; signed_nat_cons ; <gencons2> ( a ) ;
991
    ||
992
	integer ; <signed_nat2> ;
993
    ||
994
	minus_term ; integer ; <signed_nat3> ;
995
    ||
996
	minus_term ; ( a, b ) = <signed_nat5_dec> ;
997
	nat_not_int ; <signed_nat6> ( a, b ) ;
998
    ||
999
	( a, b ) = <signed_nat7_dec> ; arithop ;
1000
	nat_not_int ; <signed_nat8> ( a, b ) ;
1001
    ||
1002
	<signed_nat4> ; line_term ;
1003
} ;
1004
 
1005
signed_nat = {
1006
	signed_nat_body ;
1007
    ##
1008
	<syntax_error> ;
1009
} ;
1010
 
1011
 
1012
/* TAGS */
1013
 
1014
tag = {
1015
	tag_sort ; colon ; tag ;
1016
    ||
1017
	a = <gentok1_dec> ; tag_tok ; <gentok2> ( a ) ;
1018
    ||
1019
	a = <gencons1_dec> ; tag_cons ; <gencons2> ( a ) ;
1020
    ||
1021
	<tag1> ; ident ;
1022
    ##
1023
	<syntax_error> ;
1024
} ;
1025
 
1026
 
1027
/* TOKENS */
1028
 
1029
tok_item = {
1030
	access_tok ;
1031
    ||	al_tag_tok ;
1032
    ||	alignment_tok ;
1033
    ||	bitfield_variety_tok ;
1034
    ||	bool_tok ;
1035
    ||	error_treatment_tok ;
1036
    ||	exp_tok ;
1037
    ||	floating_variety_tok ;
1038
    ||	label_tok ;
1039
    ||	nat_tok ;
1040
    ||	ntest_tok ;
1041
    ||	rounding_mode_tok ;
1042
    ||	shape_tok ;
1043
    ||	signed_nat_tok ;
1044
    ||	tag_tok ;
1045
    ||	transfer_mode_tok ;
1046
    ||	variety_tok ;
1047
} ;
1048
 
1049
token = {
1050
	token_sort ; colon ; token ;
1051
    ||
1052
	<tok1> ; tok_item ;
1053
    ||
1054
	use ; a = <tok2_dec> ; tok_def_body ; <tok3> ( a ) ;
1055
    ##
1056
	<syntax_error> ;
1057
} ;
1058
 
1059
 
1060
/* TRANSFER MODES */
1061
 
1062
transfer_mode = {
1063
	transfer_mode_sort ; query ; ( a, b, c, d ) = <gencond1_dec> ;
1064
	ord ; exp ; <gencond2> ( b, d ) ; comma ;
1065
	transfer_mode ; <gencond3> ( c, d ) ; comma ;
1066
	transfer_mode ; <tmode1> ( a, b, c, d ) ; crd ;
1067
    ||
1068
	transfer_mode_sort ; colon ; transfer_mode ;
1069
    ||
1070
	a = <gentok1_dec> ; transfer_mode_tok ; <gentok2> ( a ) ;
1071
    ||
1072
	a = <gencons1_dec> ; transfer_mode_cons ; <gencons2> ( a ) ;
1073
    ##
1074
	<syntax_error> ;
1075
} ;
1076
 
1077
 
1078
/* VARIETIES */
1079
 
1080
variety = {
1081
	variety_sort ; query ; ( a, b, c, d ) = <gencond1_dec> ;
1082
	ord ; exp ; <gencond2> ( b, d ) ; comma ;
1083
	variety ; <gencond3> ( c, d ) ; comma ;
1084
	variety ; <variety1> ( a, b, c, d ) ; crd ;
1085
    ||
1086
	variety_sort ; colon ; variety ;
1087
    ||
1088
	a = <gentok1_dec> ; variety_tok ; <gentok2> ( a ) ;
1089
    ||
1090
	a = <gencons1_dec> ; variety_cons ; <gencons2> ( a ) ;
1091
    ||
1092
	( a, b, c ) = <variety2_dec> ;
1093
	signed_nat_body ; <variety3> ( b, c ) ;
1094
	colon ; signed_nat_body ; <variety4> ( a, b, c ) ;
1095
    ||
1096
	variety_sign ; int_term ; <varietyint> ;
1097
    ||
1098
	variety_sign ; long_term ; <varietylong> ;
1099
    ||
1100
	variety_sign ; short_term ; <varietyshort> ;
1101
    ||
1102
	variety_sign ; char_term ; <varietychar> ;
1103
    ##
1104
	<syntax_error> ;
1105
} ;
1106
 
1107
variety_opt = {
1108
	ord ; variety ; crd ;
1109
    ||	<varietyopt1> ;
1110
} ;
1111
 
1112
 
1113
 
1114
/* EXPRESSIONS */
1115
 
1116
binop = {
1117
	arithop ;
1118
    ||	star ;
1119
    ||	minus_term ;
1120
} ;
1121
 
1122
exp_body = {
1123
 	unary_exp ;
1124
    ||
1125
        unary_exp ; ( a, b, c, d ) = <exp1_dec> ; addrop ;
1126
	unary_exp ; <exp2> ( a, b, c, d ) ;
1127
    ||
1128
        unary_exp ; ( a, b, c, d ) = <exp1_dec> ; logop ;
1129
	unary_exp ; <exp3> ( a, b, c, d ) ;
1130
    ||
1131
        unary_exp ; ( a, b, c, d ) = <exp1_dec> ; binop ;
1132
	unary_exp ; <exp5> ( a, b, c, d ) ;
1133
    ||
1134
        unary_exp ; ( a, b, c, d ) = <exp1_dec> ; equals ;
1135
	unary_exp ; <exp6> ( a, b, c, d ) ;
1136
} ;
1137
 
1138
exp = {
1139
	( a, b, c, d, e ) = <exphold1_dec> ;
1140
	exp_body ; <exphold2> ( a, b, c, d, e ) ;
1141
    ##
1142
	<syntax_error> ;
1143
} ;
1144
 
1145
exp_sequence = {
1146
 	<exp_sls1> ;
1147
    ||
1148
	exp ; <exp_sls2> ;
1149
    ||
1150
	exp_sequence ; ( a, b ) = <exp_sls3_dec> ; semi ;
1151
	exp ; <exp_sls4> ( a, b ) ;
1152
    ||
1153
	exp_sequence ; ( a, b ) = <exp_sls3_dec> ; semi ;
1154
	<exp_sls5> ; <exp_sls4> ( a, b ) ;
1155
} ;
1156
 
1157
labset_opt = {
1158
	a = <lset_o2_dec> ; colon ; label ; colon ; <lset_o3> ( a ) ;
1159
    ||	<lset_o1> ;
1160
} ;
1161
 
1162
labelled_list = {
1163
	colon ; ( a, b ) = <llist1_dec> ; label ; <llist2> ( a ) ; colon ;
1164
	exp_sequence ; <llist5> ( a, b ) ;
1165
	<llist3> ;			
1166
    ||
1167
	colon ; ( a, b ) = <llist1_dec> ; label ; <llist2> ( a ) ; colon ;
1168
	exp_sequence ; <llist5> ( a, b ) ;
1169
	bar ; labelled_list ; <llist4> ;
1170
} ;
1171
 
1172
labdest_opt = {
1173
	bar ; a = <dest_o1_dec> ; label ; <dest_opt2> ( a ) ;
1174
    ||	<lset_o1> ;
1175
} ;
1176
 
1177
query_type = {
1178
	query ; <query_type1> ;
1179
    ||	float_query ; <query_type2> ;
1180
    ||	ptr_query ; <query_type3> ;
1181
    ||	proc_query ; <query_type4> ;
1182
    ||	offset_query ; <query_type5> ;
1183
} ;
1184
 
1185
range = {
1186
	a = <range1_dec> ; signed_nat_body ; <range2> ( a ) ;
1187
    ||
1188
	a = <range1_dec> ; signed_nat_body ; colon ;
1189
	<range3> ( a ) ; signed_nat_body ; <range4> ( a ) ;
1190
} ;
1191
 
1192
range_label_list = {
1193
	( a, b ) = <rllist1_dec> ; range ;
1194
	goesto ; label ; <rllist2> ( a, b ) ;
1195
    ||
1196
	( a, b ) = <rllist1_dec> ; range ;
1197
	goesto ; label ; <rllist3> ( a, b ) ; comma ;
1198
	range_label_list ; <rllist4> ;
1199
} ;
1200
 
1201
offset_exp_list = {
1202
	exp ; colon ; exp ; <offexpl1> ;
1203
    ||
1204
	exp ; colon ; exp ; comma ; offset_exp_list ; <offexpl2> ;
1205
} ;
1206
 
1207
exponent_opt = {
1208
	e_term ; signed_nat_body ;
1209
    ||	<eopt1> ;
1210
} ;
1211
 
1212
exp_comma_list = {
1213
	exp ; <expl2> ;
1214
    ||
1215
	exp_comma_list ; comma ; exp ; <expl2> ;
1216
} ;
1217
 
1218
exp_list = {
1219
	<expl1> ; exp_comma_list ;
1220
    ||
1221
	<expl1> ;
1222
    ##
1223
	<syntax_error> ;
1224
} ;
1225
 
1226
varpar_opt = {
1227
 	varpar ; exp ; <vpar1> ;
1228
    ||	<vpar2> ;
1229
} ;
1230
 
1231
tagshacc = {
1232
	( a, b, c, d ) = <tagsa1_dec> ;
1233
	ident ; access_opt ; <tagshacc2> ( b, c, d ) ;
1234
	colon ; shape ; <tagshacc3> ( a, b, c, d ) ;
1235
} ;
1236
 
1237
tagshacc_list = {
1238
	tagshacc ; <tagshacc_l2> ;
1239
    ||
1240
	tagshacc_list ; comma ; tagshacc ; <tagshacc_l2> ;
1241
} ;
1242
 
1243
tagshacc_list_opt = {
1244
	<tagshacc_l1> ; tagshacc_list ;
1245
    ||	<tagshacc_l1> ;
1246
} ;
1247
 
1248
varintro_opt = {
1249
	varpar ; tag ; colon ; alignment ;
1250
    ||	$ ;
1251
} ;
1252
 
1253
tag_intro = {
1254
	var ; ( a, b, c, d, e ) = <intro1_dec> ;
1255
	ident ; access_opt ; <intro2> ( b, c, e ) ;
1256
	equals ; exp ; <intro4> ( a, b, c, d, e ) ;
1257
    ||
1258
	var ; ( a, b, c, d, e ) = <intro1_dec> ;
1259
	ident ; access_opt ; <intro3> ( c, d ) ;
1260
	colon ; shape ; <intro2> ( b, c, e ) ;
1261
	equals ; exp ; <intro4> ( a, b, c, d, e ) ;
1262
    ||
1263
	var ; ( a, b, c, d, e ) = <intro1_dec> ;
1264
	ident ; access_opt ; <intro3> ( c, d ) ;
1265
	colon ; shape ; <intro2> ( b, c, e ) ;
1266
	<intro6> ( d ) ; <intro4> ( a, b, c, d, e ) ;
1267
    ||
1268
	let ; ( a, b, c, d, e ) = <intro1_dec> ;
1269
	ident ; access_opt ; <intro2> ( b, c, e ) ;
1270
	equals ; exp ; <intro5> ( a, b, c, d, e ) ;
1271
} ;
1272
 
1273
repeat_starter_opt = {
1274
	ord ; exp_sequence ; crd ;
1275
    ||	<strtr1> ;
1276
} ;
1277
 
1278
untidy_opt = {
1279
 	<untidy1> ;
1280
    ||	untidy ; <untidy2> ;
1281
    ||	untidy ; check_stack ; <untidy3> ;
1282
    ||	check_stack ; <untidy4> ;
1283
} ;
1284
 
1285
postlude_opt = {
1286
	semi ; exp ;
1287
    ||	<plude1> ;
1288
} ;
1289
 
1290
caller_var_opt = {
1291
	dotdotdot ; <crvaropt2> ;
1292
    ||	<crvaropt1> ;
1293
} ;
1294
 
1295
callee_var_opt = {
1296
	dotdotdot ; <cevaropt2> ;
1297
    ||	<cevaropt1> ;
1298
} ;
1299
 
1300
otagexp	= {
1301
	( a, b ) = <otagexp1_dec> ; exp ; <otagexp2> ( a, b ) ;
1302
    ||
1303
	( a, b ) = <otagexp1_dec> ; exp ; colon ;
1304
	<otagexp3> ( a, b ) ; ident ;
1305
} ;
1306
 
1307
otagexp_list = {
1308
	otagexp ; <otagel1> ;
1309
    ||
1310
	otagexp_list ; <otagel2> ; comma ; otagexp ;
1311
} ;
1312
 
1313
otagexp_list_opt = {
1314
	otagexp_list ;
1315
    ||	<otagel_opt1> ;
1316
} ;
1317
 
1318
callee = {
1319
 	( a, b ) = <callee1_dec> ; exp_list ; <callee2> ( a, b ) ;
1320
    ||
1321
	dynamic ; ( a, b, c ) = <callee3_dec> ;
1322
	ord ; exp ; <callee4> ( a, b, c ) ; comma ;
1323
	exp ; <callee5> ( a, b, c ) ; crd ;
1324
    ||
1325
	same ; <callee6> ;
1326
} ;
1327
 
1328
unary_exp = {
1329
	exp_sort ; query ; ( a, b, c, d ) = <gencond1_dec> ;
1330
	ord ; exp ; <gencond2> ( b, d ) ; comma ;
1331
	exp ; <gencond3> ( c, d ) ; comma ;
1332
	exp ; <exp1> ( a, b, c, d ) ; crd ;
1333
    ||
1334
	exp_sort ; colon ; unary_exp ;
1335
    ||
1336
	a = <gentok1_dec> ; exp_tok ; <gentok2> ( a ) ;
1337
    ||
1338
	a = <gencons1_dec> ; exp_cons ; <gencons2> ( a ) ;
1339
    ||
1340
	closed_exp ;
1341
    ||
1342
	ord ; exp ; crd ;
1343
    ||
1344
	minus_term ; ord ; ( a, b ) = <expneg1_dec> ; exp ;
1345
	<expnegate2> ( a, b ) ; crd ;
1346
    ||
1347
	size_term ; ord ; ( a, b ) = <szexp1_dec> ;
1348
	shape ; <sizeexp2> ( a, b ) ; crd ;
1349
    ||
1350
	tag ; <exptag1> ;
1351
    ||
1352
	star ; <expstar1> ; ident ;
1353
    ||
1354
	star ; ( a, b, c ) = <expstar2_dec> ; ord ; shape ; crd ;
1355
	<expstar3> ( b, c ) ; unary_exp ; <expstar4> ( a, b, c ) ;
1356
    ||
1357
	query_type ; ord ; ( a, b, c, d, e ) = <exptst1_dec> ;
1358
	exp ; <exptst2> ( b, d ) ; ntest ;
1359
	<exptst3> ( c, d ) ; exp ; labdest_opt ;
1360
	<exptst4> ( a, b, c, d, e ) ; crd ;
1361
    ||
1362
	case_term ; ( a, b, c ) = <cseexp1_dec> ; exp ;
1363
	ord ; <cseexp2> ( a, b, c ) ; range_label_list ;
1364
	<cseexp3> ( a, b, c ) ; crd ;
1365
    ||
1366
	cons ; osq ; ( a, b, c ) = <expcons1_dec> ; exp ;
1367
	<expcons2> ( a, b, c ) ; csq ;
1368
	ord ; offset_exp_list ; <expcons3> ( a, b, c ) ; crd ;
1369
    ||
1370
	osq ; ( a, b, c ) = <chvar1_dec> ; variety ;
1371
	<chvar2> ( a, b, c ) ; csq ;
1372
	unary_exp ; <chvar3> ( a, b, c ) ;
1373
    ||
1374
	signed_nat_body ; ( a, b ) = <mint1_dec> ;
1375
	ord ; variety ; <mint2> ( a, b ) ; crd ;
1376
    ||
1377
	( a, b, c, d, e, f, g ) = <fden1_dec> ;
1378
	float_den ; exponent_opt ;
1379
	ord ; <fden3> ( c, e ) ; floating_variety ; <fden4> ( d, e ) ;
1380
	rounding_mode_opt ; <fden5> ( a, b, c, d, e, f, g ) ; crd ;
1381
    ||
1382
	minus_term ; ( a, b, c, d, e, f, g ) = <fden2_dec> ;
1383
	float_den ; exponent_opt ;
1384
	ord ; <fden3> ( c, e ) ; floating_variety ; <fden4> ( d, e ) ;
1385
	rounding_mode_opt ; <fden5> ( a, b, c, d, e, f, g ) ; crd ;
1386
    ||
1387
	proc_exp ; ( a, b, c, d ) = <call1_dec> ;
1388
	osq ; shape ; <call2> ( b ) ; csq ;
1389
	ord ; exp_list ; <call3> ( c ) ; varpar_opt ;
1390
	<call4> ( a, b, c, d ) ; crd ;
1391
    ||
1392
	proc_exp ; ( a, b, c, d ) = <call1_dec> ;
1393
	osq ; shape ; <call2> ( b ) ; csq ;
1394
	osq ; ( e, f, g, h, i, j, k, l ) = <gcall1_dec> ;
1395
	otagexp_list_opt ;
1396
	caller_var_opt ; <gcall2> ( e, h, j, k ) ; semi ; 			
1397
	callee ; callee_var_opt ; <gcall3> ( f, i, k ) ;
1398
	postlude_opt ; csq ; untidy_opt ;
1399
	<gcall4> ( a, b, e, f, g, h, i, l ) ;
1400
    ||
1401
	proc_exp ; a = <tcall1_dec> ; tail_call_term ;
1402
	osq ; callee ; callee_var_opt ;	<tcall2> ( a ) ; csq ;
1403
    ||
1404
	proc ; proc_def_body ;
1405
    ||
1406
	( a, b, c ) = <expstr1_dec> ; string ; <expstr2> ( b, c ) ;
1407
	ord ; variety ; crd ; <expstring2> ( a, b, c ) ;
1408
    ||
1409
	hash ; <expfail1> ;
1410
} ;
1411
 
1412
closed_exp = {
1413
	ocurl ; exp_sequence ; ccurl ;
1414
    ||
1415
	query ; ( a, b, c, d, e, f ) = <expcond1_dec> ;
1416
	ocurl ; exp_sequence ; <expcond2> ( b, d ) ; bar ;
1417
	labset_opt ; <expcond3> ( c, e, f ) ;
1418
	exp_sequence ; <expcond4> ( a, b, c, d ) ; ccurl ;
1419
    ||
1420
	lab ; ( a, b, c, d, e ) = <explab1_dec> ;
1421
	ocurl ; exp_sequence ; <explab2> ( b, d ) ; bar ;
1422
	labelled_list ; ccurl ; <explab3> ( a, b, c, d, e ) ;
1423
    ||
1424
	rep ; ( a, b, c, d, e, f ) = <exprep1_dec> ;
1425
	repeat_starter_opt ; <exprep2> ( f ) ;
1426
	ocurl ; labset_opt ; <exprep3> ( b, c, d ) ;
1427
	exp_sequence ; <exprep4> ( a, b, c, d, e, f ) ;  ccurl ;
1428
    ||
1429
	a = <expdec1_dec> ; tag_intro ;
1430
	( b, c, d, e, f, g ) = <ibody1_dec> ;
1431
	closed_exp ; <introbody2> ( b, c, d, e, f, g ) ;
1432
	<expdec2> ( a ) ;
1433
} ;
1434
 
1435
proc_def_body = {
1436
	( a, b, c, d, e, f, g ) = <expproc1_dec> ;
1437
	shape ; <expproc2> ( a, e ) ;
1438
	ord ; tagshacc_list_opt ; <expproc3> ( b, e ) ;
1439
	varintro_opt ; <expproc4> ( c, e ) ; crd ;
1440
	closed_exp ; <expproc5> ( a, b, c, d, e, f, g ) ;
1441
    ||
1442
	general ; ( a, b, c, d, e, f, g, h, i, j ) = <gproc1_dec> ;
1443
	shape ; <gproc2> ( b, e ) ;
1444
	ord ; tagshacc_list_opt ;
1445
	caller_var_opt ; <gproc3> ( c, e, f ) ; semi ;
1446
	tagshacc_list_opt ; callee_var_opt ; <gproc4> ( d, e, g ) ; crd ;
1447
	untidy_opt ; <gproc5> ( h ) ; closed_exp ;
1448
	<gproc6> ( a, b, c, d, e, f, g, h, i, j ) ;
1449
} ;
1450
 
1451
proc_exp = {
1452
	ord ; exp ; crd ;
1453
    ||	tag ; <exptag1> ;
1454
} ;
1455
 
1456
 
1457
/* COMPILATION UNIT */
1458
 
1459
element	= {
1460
	tok_dec ;
1461
    ||	tok_def ;
1462
    ||	tag_dec ;
1463
    ||	tag_def ;
1464
    ||	al_tag_def ;
1465
    ||	struct_def ;
1466
    ||	proc_def ;
1467
} ;
1468
 
1469
element_list_opt = {
1470
	element ; semi ; element_list_opt ;
1471
    ||	$ ;
1472
} ;
1473
 
1474
keep_item = {
1475
	<keep1> ; tok_item ;
1476
    ||	<keep2> ; ident ;
1477
} ;
1478
 
1479
keep_list = {
1480
	keep_item ;
1481
    ||	keep_item ; comma ; keep_list ;
1482
} ;
1483
 
1484
keep_list_opt = {
1485
	keep_list ;
1486
    ||	$ ;
1487
} ;
1488
 
1489
program = {
1490
	element_list_opt ;
1491
	keep ; ord ; <keeps1> ; keep_list_opt ; crd ; eof ;
1492
	<keeps2> ;
1493
    ||
1494
	element_list_opt ; eof ;
1495
	<keeps1> ;
1496
	<keeps2> ;
1497
    ##
1498
	<syntax_error> ;
1499
} ;
1500
 
1501
 
1502
%entry% program, access, alignment, al_tag, bitfield_variety, bool,
1503
	error_code, error_code_list, error_treatment, exp, exp_list,
1504
	floating_variety, label, nat, nat_option, ntest, rounding_mode,
1505
	shape, signed_nat, string, tag, token, transfer_mode, variety ;