Subversion Repositories tendra.SVN

Rev

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
	/*	Generic pl_tdf source for sys.j			*/
32
	/*							*/
33
	/* **************************************************** */
34
 
35
 
36
Tokdef ~toks_major_v = [] NAT 3;
37
Tokdef ~toks_minor_v = [] NAT 1;
38
 
39
 
40
 
41
	/* Target dependency tokens declarations */
42
 
43
Tokdec .~rep_var_width : [NAT] NAT;
44
Tokdec .~rep_atomic_width : [] NAT;
45
Tokdec .~rep_fv : [NAT] FLOATING_VARIETY;
46
Tokdec .~rep_fv_width : [NAT] NAT;
47
Tokdec .~rep_fv_radix : [NAT] NAT;
48
Tokdec .~rep_fv_mant : [NAT] NAT;
49
Tokdec .~rep_fv_min_exp : [NAT] NAT;
50
Tokdec .~rep_fv_max_exp : [NAT] NAT;
51
Tokdec .~rep_fv_epsilon : [NAT] EXP;
52
Tokdec .~rep_fv_min_val : [NAT] EXP;
53
Tokdec .~rep_fv_max_val : [NAT] EXP;
54
Tokdec .~ptr_width : [] NAT;
55
Tokdec .~best_div : [] NAT;
56
Tokdec .~little_endian : [] BOOL;
57
Tokdec .~ptr_to_ptr : [ALIGNMENT, ALIGNMENT, EXP] EXP;
58
Tokdec .~ptr_to_int : [ALIGNMENT, VARIETY, EXP] EXP;
59
Tokdec .~int_to_ptr : [VARIETY, ALIGNMENT, EXP] EXP;
60
Tokdec .~f_to_ptr : [ALIGNMENT, EXP] EXP;
61
Tokdec .~ptr_to_f : [ALIGNMENT, EXP] EXP;
62
 
63
 
64
	/* C mapping token declarations */
65
 
66
Tokdec .~char_width : [] NAT;
67
Tokdec .~short_width : [] NAT;
68
Tokdec .~int_width : [] NAT;
69
Tokdec .~long_width : [] NAT;
70
Tokdec .~longlong_width : [] NAT;
71
Tokdec .~size_t_width : [] NAT;
72
Tokdec .~fl_rep : [] NAT;
73
Tokdec .~dbl_rep : [] NAT;
74
Tokdec .~ldbl_rep : [] NAT;
75
Tokdec .~pv_align : [] ALIGNMENT;
76
Tokdec .~min_struct_rep : [] NAT;
77
Tokdec .~char_is_signed : [] BOOL;
78
Tokdec .~bitfield_is_signed : [] BOOL;
79
 
80
 
81
 
82
	/* Variety encoding constants for representing integer */
83
	/* types in conversion, promotion rules etc            */
84
 
85
Tokdef t_char = [] SIGNED_NAT		0;
86
Tokdef t_short = [] SIGNED_NAT		1;
87
Tokdef t_int = [] SIGNED_NAT		2;
88
Tokdef t_long = [] SIGNED_NAT		3;
89
 
90
Tokdef t_signed = [] SIGNED_NAT		4;
91
Tokdef t_unsigned = [] SIGNED_NAT	8;
92
Tokdef t_longlong = [] SIGNED_NAT	16;
93
 
94
Tokdef t_vmask = [] SIGNED_NAT		19;
95
Tokdef t_smask = [] SIGNED_NAT		12;
96
 
97
Tokdef t_vty = [] VARIETY	/* variety for above constants */
98
var_width(false,8);
99
 
100
	/* Constants derived from the above */
101
 
102
Tokdef t_s_char = [] SIGNED_NAT
103
computed_signed_nat (t_char(t_vty) Or t_signed(t_vty));
104
 
105
Tokdef t_u_char = [] SIGNED_NAT
106
computed_signed_nat (t_char(t_vty) Or t_unsigned(t_vty));
107
 
108
Tokdef t_s_short = [] SIGNED_NAT
109
computed_signed_nat (t_short(t_vty) Or t_signed(t_vty));
110
 
111
Tokdef t_u_short = [] SIGNED_NAT
112
computed_signed_nat (t_short(t_vty) Or t_unsigned(t_vty));
113
 
114
Tokdef t_s_int = [] SIGNED_NAT
115
computed_signed_nat (t_int(t_vty) Or t_signed(t_vty));
116
 
117
Tokdef t_u_int = [] SIGNED_NAT
118
computed_signed_nat (t_int(t_vty) Or t_unsigned(t_vty));
119
 
120
Tokdef t_s_long = [] SIGNED_NAT
121
computed_signed_nat (t_long(t_vty) Or t_signed(t_vty));
122
 
123
Tokdef t_u_long = [] SIGNED_NAT
124
computed_signed_nat (t_long(t_vty) Or t_unsigned(t_vty));
125
 
126
Tokdef t_s_longlong = [] SIGNED_NAT
127
computed_signed_nat (t_longlong(t_vty) Or t_s_long(t_vty));
128
 
129
Tokdef t_u_longlong = [] SIGNED_NAT
130
computed_signed_nat (t_longlong(t_vty) Or t_u_long(t_vty));
131
 
132
 
133
 
134
 
135
	/* C integer and float varieties */
136
 
137
Tokdef ~char = [] VARIETY
138
var_width (.~char_is_signed, .~char_width);
139
 
140
Tokdef ~signed_char = [] VARIETY
141
var_width (true, .~char_width);
142
 
143
Tokdef ~unsigned_char = [] VARIETY
144
var_width (false, .~char_width);
145
 
146
Tokdef ~signed_short = [] VARIETY
147
var_width (true, .~short_width);
148
 
149
Tokdef ~unsigned_short = [] VARIETY
150
var_width (false, .~short_width);
151
 
152
Tokdef ~signed_int = [] VARIETY
153
var_width (true, .~int_width);
154
 
155
Tokdef ~unsigned_int = [] VARIETY
156
var_width (false, .~int_width);
157
 
158
Tokdef ~signed_long = [] VARIETY
159
var_width (true, .~long_width);
160
 
161
Tokdef ~unsigned_long = [] VARIETY
162
var_width (false, .~long_width);
163
 
164
Tokdef ~signed_longlong = [] VARIETY
165
var_width (true, .~longlong_width);
166
 
167
Tokdef ~unsigned_longlong = [] VARIETY
168
var_width (false, .~longlong_width);
169
 
170
Tokdef ~float = [] FLOATING_VARIETY
171
.~rep_fv [.~fl_rep];
172
 
173
Tokdef ~double = [] FLOATING_VARIETY
174
.~rep_fv [.~dbl_rep];
175
 
176
Tokdef ~long_double = [] FLOATING_VARIETY
177
.~rep_fv [.~ldbl_rep];
178
 
179
 
180
 
181
 
182
	/* max values needed to determine types of literals */
183
 
184
Tokdef max_signed_int = [] SIGNED_NAT
185
computed_signed_nat (
186
  (1(~unsigned_int) <<
187
	(snat_from_nat(false,.~int_width)(~unsigned_int) - 1(~unsigned_int)))
188
  - 1(~unsigned_int)
189
);
190
 
191
Tokdef max_unsigned_int = [] SIGNED_NAT
192
computed_signed_nat (
193
  (0(~unsigned_int) - 1(~unsigned_int))
194
);
195
 
196
Tokdef max_signed_long = [] SIGNED_NAT
197
computed_signed_nat (
198
  (1(~unsigned_long) <<
199
	(snat_from_nat(false,.~long_width)(~unsigned_long) - 1(~unsigned_long)))
200
  - 1(~unsigned_long)
201
);
202
 
203
Tokdef max_signed_longlong = [] SIGNED_NAT
204
computed_signed_nat (
205
  (1(~unsigned_longlong) <<
206
	(snat_from_nat(false,.~longlong_width)(~unsigned_long) - 1(~unsigned_long)))
207
  - 1(~unsigned_longlong)
208
);
209
 
210
 
211
 
212
 
213
	/* Shorthand tests producing EXP boolean 	*/
214
	/* for use in constant evaluation constructions */
215
 
216
Tokdef ITEST = [a:EXP, comp:NTEST, b:EXP] EXP	/* exp integer test */
217
? { ?(a comp b); 1(~unsigned_int) | 0(~unsigned_int) };
218
 
219
Tokdef OTEST = [a:EXP, comp:NTEST, b:EXP] EXP	/* exp offset test */
220
? { .?(a comp b); 1(~unsigned_int) | 0(~unsigned_int) };
221
 
222
Tokdef SNTEST = [a:SIGNED_NAT, comp:NTEST, b:SIGNED_NAT] EXP	/* s_nat test */
223
ITEST [a(~unsigned_long), comp, b(~unsigned_long)];
224
 
225
Tokdef SNLLTEST = [a:SIGNED_NAT, comp:NTEST, b:SIGNED_NAT] EXP	/* s_nat test */
226
ITEST [a(~unsigned_longlong), comp, b(~unsigned_longlong)];
227
 
228
Tokdef NATTEST = [a:NAT, comp:NTEST, b:NAT] EXP		/* nat test */
229
SNTEST [snat_from_nat(false,a), comp, snat_from_nat(false,b)];
230
 
231
Tokdef TV_SNTEST = [a:SIGNED_NAT, comp:NTEST, b:SIGNED_NAT] EXP	/* s_nat test */
232
ITEST [a(t_vty), comp, b(t_vty)];
233
 
234
Tokdef BOOLTEST = [b:BOOL] EXP
235
ITEST [snat_from_nat(b,1)(~signed_int), <, 0(~signed_int)];
236
 
237
 
238
 
239
 
240
Tokdef ~div = [arg1:EXP, arg2:EXP] EXP
241
div0 (impossible, wrap, arg1, arg2);
242
 
243
Tokdef ~rem = [arg1:EXP, arg2:EXP] EXP
244
rem0 (impossible, wrap, arg1, arg2);
245
 
246
Tokdef ~assign = [ptr:EXP, val:EXP, sh:SHAPE] EXP
247
Let desttag = ptr {
248
  desttag = val ;
249
  *(sh) desttag
250
};
251
 
252
Tokdef ~assign_vol = [ptr:EXP, val:EXP, sh:SHAPE] EXP
253
Let assigned_val = val {
254
  assign_with_mode (volatile, ptr, assigned_val) ;
255
  assigned_val
256
};
257
 
258
Tokdef ~ptr_add = [ptr:EXP, n:EXP, sh:SHAPE] EXP
259
( ptr *+. ( Sizeof(sh) .* n ) );
260
 
261
Tokdef ~ptr_sub = [ptr:EXP, n:EXP, sh:SHAPE] EXP
262
( ptr *+. offset_negate(( Sizeof(sh) .* n )) );
263
 
264
Tokdef ~sizeof = [sh:SHAPE] EXP
265
offset_div (
266
  var_width (false, .~size_t_width),
267
  Sizeof (sh),
268
  Sizeof (integer(~unsigned_char))
269
);
270
 
271
Tokdef ~comp_off = [sz:EXP] EXP
272
offset_pad (
273
  alignment (integer (var_width (false, .~min_struct_rep))),
274
  offset_pad (alignment(compound(sz)), sz)
275
);
276
 
277
 
278
 
279
 
280
Tokdef ~convert = [which_v:SIGNED_NAT] VARIETY
281
VARIETY ? ( TV_SNTEST [which_v, ==, t_char],
282
  ~char,
283
  VARIETY ? ( TV_SNTEST [which_v, ==, t_s_char],
284
    ~signed_char,
285
    VARIETY ? ( TV_SNTEST [which_v, ==, t_u_char],
286
      ~unsigned_char,
287
      VARIETY ? ( TV_SNTEST [which_v, ==, t_s_short],
288
        ~signed_short,
289
        VARIETY ? ( TV_SNTEST [which_v, ==, t_u_short],
290
          ~unsigned_short,
291
          VARIETY ? ( TV_SNTEST [which_v, ==, t_s_int],
292
            ~signed_int,
293
            VARIETY ? ( TV_SNTEST [which_v, ==, t_u_int],
294
              ~unsigned_int,
295
              VARIETY ? ( TV_SNTEST [which_v, ==, t_s_long],
296
                ~signed_long,
297
                VARIETY ? ( TV_SNTEST [which_v, ==, t_u_long],
298
                  ~unsigned_long,
299
                  VARIETY ? ( TV_SNTEST [which_v, ==, t_s_longlong],
300
                    ~signed_longlong,
301
                    ~unsigned_longlong
302
                  )
303
                )
304
              )
305
            )
306
          )
307
        )
308
      )
309
    )
310
  )
311
);
312
 
313
Tokdef OLDarith_type = [arg1:SIGNED_NAT, arg2:SIGNED_NAT] SIGNED_NAT
314
SIGNED_NAT ? ( TV_SNTEST [arg1, ==, t_u_long],
315
  t_u_long,
316
  SIGNED_NAT ? ( TV_SNTEST [arg2, ==, t_u_long],
317
    t_u_long,
318
    SIGNED_NAT ? ( TV_SNTEST [arg1, ==, t_s_long],
319
      SIGNED_NAT ? ( NATTEST [.~long_width, >, .~int_width],
320
        t_s_long,
321
        SIGNED_NAT ? ( TV_SNTEST [arg2, ==, t_u_int],
322
          t_u_long,
323
          t_s_long
324
        )
325
      ),
326
      SIGNED_NAT ? ( TV_SNTEST [arg2, ==, t_s_long],
327
        SIGNED_NAT ? ( NATTEST [.~long_width, >, .~int_width],
328
          t_s_long,
329
          SIGNED_NAT ? ( TV_SNTEST [arg1, ==, t_u_int],
330
            t_u_long,
331
            t_s_long
332
          )
333
        ),
334
        SIGNED_NAT ? ( TV_SNTEST [arg1, ==, t_u_int],
335
          t_u_int,
336
          SIGNED_NAT ? ( TV_SNTEST [arg2, ==, t_u_int],
337
            t_u_int,
338
            t_s_int
339
          )
340
        )
341
      )
342
    )
343
  )
344
);
345
 
346
Tokdef ~arith_type = [arg1:SIGNED_NAT, arg2:SIGNED_NAT] SIGNED_NAT
347
SIGNED_NAT ? ( TV_SNTEST [arg1, ==, t_u_longlong],
348
  t_u_longlong,
349
  SIGNED_NAT ? ( TV_SNTEST [arg2, ==, t_u_longlong],
350
    t_u_longlong,
351
    SIGNED_NAT ? ( TV_SNTEST [arg1, ==, t_s_longlong],
352
      SIGNED_NAT ? ( NATTEST [.~longlong_width, >, .~long_width],
353
        t_s_longlong,
354
        SIGNED_NAT ? ( TV_SNTEST [arg2, ==, t_u_long],
355
          t_u_longlong,
356
          SIGNED_NAT ? ( NATTEST [.~longlong_width, >, .~int_width],
357
            t_s_longlong,
358
            SIGNED_NAT ? ( TV_SNTEST [arg2, ==, t_u_int],
359
              t_u_longlong,
360
              t_s_longlong
361
            )
362
          )
363
        )
364
      ),
365
      SIGNED_NAT ? ( TV_SNTEST [arg2, ==, t_s_longlong],
366
        SIGNED_NAT ? ( NATTEST [.~longlong_width, >, .~long_width],
367
          t_s_longlong,
368
          SIGNED_NAT ? ( TV_SNTEST [arg1, ==, t_u_long],
369
            t_u_longlong,
370
            SIGNED_NAT ? ( NATTEST [.~longlong_width, >, .~int_width],
371
              t_s_longlong,
372
              SIGNED_NAT ? ( TV_SNTEST [arg2, ==, t_u_int],
373
                t_u_longlong,
374
                t_s_longlong
375
              )
376
            )
377
          )
378
        ),
379
        OLDarith_type [arg1, arg2]
380
      )
381
    )
382
  )
383
);
384
 
385
 
386
Tokdef ~int_promot = [] SIGNED_NAT
387
SIGNED_NAT ? ( NATTEST [.~int_width, >, .~short_width],
388
  t_s_int,
389
  t_u_int
390
);
391
 
392
 
393
Tokdef ~promote = [arg:SIGNED_NAT] SIGNED_NAT
394
computed_signed_nat(
395
  EXP ? ( TV_SNTEST [arg, ==, t_u_short],
396
    ~int_promot(t_vty),
397
    ? { ?( (arg(t_vty) And t_vmask(t_vty)) < t_int(t_vty));
398
        t_s_int(t_vty)
399
      | arg(t_vty)
400
    }
401
  )
402
);
403
 
404
 
405
Tokdef ~sign_promote = [arg:SIGNED_NAT] SIGNED_NAT
406
computed_signed_nat(
407
  ? { ?( (arg(t_vty) And t_vmask(t_vty)) < t_int(t_vty));
408
      ? { ?( (arg(t_vty) And t_smask(t_vty)) == t_unsigned(t_vty));
409
          t_u_int(t_vty)
410
        | t_s_int(t_vty)
411
      }
412
    | arg(t_vty)
413
  }
414
);
415
 
416
 
417
Tokdef ~lit_int = [arg:SIGNED_NAT] SIGNED_NAT
418
SIGNED_NAT ? ( SNTEST [arg, <=, max_signed_int],
419
  t_s_int,
420
  SIGNED_NAT ? ( SNTEST [arg, <=, max_signed_long],
421
    t_s_long,
422
    t_u_long
423
  )
424
);
425
 
426
 
427
Tokdef ~lit_hex = [arg:SIGNED_NAT] SIGNED_NAT
428
SIGNED_NAT ? ( SNTEST [arg, <=, max_signed_int],
429
  t_s_int,
430
  SIGNED_NAT ? ( SNTEST [arg, <=, max_unsigned_int],
431
    t_u_int,
432
    SIGNED_NAT ? ( SNTEST [arg, <=, max_signed_long],
433
      t_s_long,
434
      t_u_long
435
    )
436
  )
437
);
438
 
439
 
440
Tokdef ~lit_unsigned = [arg:SIGNED_NAT] SIGNED_NAT
441
SIGNED_NAT ? ( SNTEST [arg, <=, max_unsigned_int],
442
  t_u_int,
443
  t_u_long
444
);
445
 
446
 
447
Tokdef ~lit_long = [arg:SIGNED_NAT] SIGNED_NAT
448
SIGNED_NAT ? ( SNTEST [arg, <=, max_signed_long],
449
  t_s_long,
450
  t_u_long
451
);
452
 
453
 
454
Tokdef ~lit_ulong = [arg:SIGNED_NAT] SIGNED_NAT
455
t_u_long;
456
 
457
 
458
Tokdef ~lit_longlong = [arg:SIGNED_NAT] SIGNED_NAT
459
SIGNED_NAT ? ( SNLLTEST [arg, <=, max_signed_longlong],
460
  t_s_longlong,
461
  t_u_longlong
462
);
463
 
464
 
465
Tokdef ~lit_ulonglong = [arg:SIGNED_NAT] SIGNED_NAT
466
t_u_longlong;
467
 
468
 
469
 
470
Tokdef ~char_lit = [chars:EXP, length:SIGNED_NAT, v:VARIETY] EXP
471
EXP ? ( SNTEST [length, ==, 1],
472
  Var char_val = chars {
473
    [ v ] * (integer(~char)) char_val
474
  },
475
  #"Too many characters in char literal"
476
);
477
 
478
 
479
Tokdef ~wchar_lit = [chars:EXP, length:SIGNED_NAT, v:VARIETY] EXP
480
~char_lit [ chars, length, v ];
481
 
482
 
483
Tokdef ~string_lit = [string:EXP, length:SIGNED_NAT, v:VARIETY] EXP
484
(string);
485
 
486
 
487
Tokdef ~checked_plus = [arg1:EXP, arg2:EXP] EXP
488
EXP ? ( ITEST [arg1, >, (max_signed_int(~unsigned_long) - arg2)],
489
  #"Constant out of range for its type",
490
  arg1 + arg2
491
);
492
 
493
 
494
 
495
 
496
	/* pointer conversions, simple for byte-addressed architectures */
497
 
498
Tokdef ~ptr_void = [] SHAPE
499
pointer (.~pv_align);
500
 
501
 
502
Tokdef ~pun = [from_sh:SHAPE, to_sh:SHAPE, val:EXP] EXP
503
component (
504
  to_sh,
505
  Cons [ shape_offset(from_sh) .max. shape_offset(to_sh) ] (
506
    offset_zero(alignment(from_sh)) : val
507
  ),
508
  offset_zero(alignment(to_sh))
509
);
510
 
511
 
512
Tokdef ~ptr_to_ptr = [from_al:ALIGNMENT, to_al:ALIGNMENT, ptr:EXP] EXP
513
~pun [ pointer(from_al), pointer(to_al), ptr ];
514
 
515
 
516
Tokdef ~to_ptr_void = [al:ALIGNMENT, ptr:EXP] EXP
517
~ptr_to_ptr [ al, .~pv_align, ptr ];
518
 
519
 
520
Tokdef ~from_ptr_void = [al:ALIGNMENT, ptr:EXP] EXP
521
~ptr_to_ptr [ .~pv_align, al, ptr ];
522
 
523
 
524
Tokdef ~i_to_p = [v:VARIETY, al:ALIGNMENT, val:EXP] EXP
525
~pun [
526
  integer (var_width (true, .~ptr_width)),
527
  pointer (al),
528
  [var_width (true, .~ptr_width)] val
529
];
530
 
531
 
532
Tokdef ~p_to_i = [al:ALIGNMENT, v:VARIETY, val:EXP] EXP
533
([v] ~pun [
534
  pointer (al),
535
  integer (var_width (true,.~ptr_width)),
536
  val
537
]);
538
 
539
 
540
Tokdef ~null_pv = [] EXP
541
make_null_ptr(.~pv_align);
542
 
543
 
544
Tokdef ~pv_test = [ptr:EXP, escape:LABEL, comparison:NTEST] EXP
545
*?(ptr comparison ~null_pv | escape);
546
 
547
 
548
Tokdef ~cpp.pv_compare = [ptr1:EXP, ptr2:EXP, escape:LABEL, comparison:NTEST] EXP
549
*?(ptr1 comparison ptr2 | escape);
550
 
551
 
552
Tokdef ~pad = [off:EXP, sh1:SHAPE, sh2:SHAPE] EXP
553
EXP ? ( OTEST [offset_pad(alignment(sh1), (off .+. shape_offset(sh2))),
554
               >,
555
	       offset_pad(alignment(sh1), off)],
556
  offset_pad(alignment(sh1), off),
557
  offset_pad(alignment(sh2), off)
558
);
559
 
560
 
561
Tokdef ~i_to_pv = [v:VARIETY, val:EXP] EXP
562
~i_to_p [ v, .~pv_align, val ];
563
 
564
 
565
Tokdef ~pv_to_i = [v:VARIETY, val:EXP] EXP
566
~p_to_i [ .~pv_align, v, val ];
567
 
568
 
569
Tokdef ~f_to_pv = [fn:EXP] EXP
570
.~f_to_ptr [ .~pv_align, fn ];
571
 
572
 
573
Tokdef ~pv_to_f = [ptr:EXP] EXP
574
.~ptr_to_f [ .~pv_align, ptr ];
575
 
576
 
577
Tokdef ~debug_exp = [diagi:NAT, body:EXP] EXP
578
(body);
579
 
580
Tokdef ~debug_scope = [starti:NAT, endi:NAT, body:EXP] EXP
581
(body);
582
 
583
Tokdef ~fn_scope = [body:EXP, starti:NAT, endi:NAT] EXP
584
(body);
585
 
586
 
587
Tokdef ~little_endian = [] EXP
588
EXP ? ( BOOLTEST [.~little_endian],
589
  1(~signed_int),
590
  0(~signed_int)
591
);
592
 
593
 
594
Tokdef ~cpp.empty.offset = [] EXP
595
~comp_off [
596
  offset_add (
597
    offset_zero(alignment(integer(~char))),
598
    shape_offset(integer(~char)))
599
];
600
 
601
Tokdef ~cpp.empty.shape = [] SHAPE
602
compound(~cpp.empty.offset);
603
 
604
Tokdef ~cpp.empty.align = [] ALIGNMENT
605
alignment(floating(~long_double));
606
 
607
Tokdef ~cpp.bitf_sign = [which_v: SIGNED_NAT] BOOL
608
BOOL ? ( BOOLTEST [.~bitfield_is_signed],
609
  BOOL ? ( which_v(t_vty) And t_unsigned(t_vty),
610
    false,
611
    true
612
  ),
613
  false
614
);
615
 
616
Tokdef ~cpp.ptr_rep = [] SIGNED_NAT
617
SIGNED_NAT ? ( NATTEST [.~ptr_width, ==, .~int_width],
618
  t_s_int,
619
  t_s_long
620
);
621
 
622
 
623
 
624
Keep (
625
~toks_major_v, ~toks_minor_v,
626
~div, ~rem, ~ptr_add, ~ptr_sub, ~char, ~unsigned_char, ~signed_char,
627
~unsigned_short, ~signed_short, ~unsigned_int, ~signed_int,
628
~unsigned_long, ~signed_long, ~unsigned_longlong, ~signed_longlong,
629
~float, ~double, ~long_double,
630
~ptr_void, ~assign, ~assign_vol, ~convert, ~arith_type, ~int_promot,
631
~debug_exp, ~debug_scope, ~fn_scope, ~promote, ~sign_promote,
632
~lit_int, ~lit_hex, ~lit_unsigned, ~lit_long, ~lit_ulong, ~lit_longlong,
633
~lit_ulonglong, ~char_lit, ~wchar_lit,
634
~string_lit, ~checked_plus, ~to_ptr_void, ~from_ptr_void, ~ptr_to_ptr,
635
~sizeof, ~i_to_p, ~p_to_i, ~null_pv, ~pv_test, ~cpp.pv_compare, ~pad,
636
~i_to_pv, ~pv_to_i, ~f_to_pv, ~pv_to_f, ~comp_off, ~little_endian,
637
~cpp.empty.offset, ~cpp.empty.shape, ~cpp.empty.align,
638
~cpp.bitf_sign, ~cpp.ptr_rep
639
)