22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
-
+
-
+
|
-- (base "symbol 0" "symbol 1" "symbol 2" ...) --
-- (left-padding "symbol") --
-- (image (0 "symbol 0") (2 "symbol 2") ...) --
-- (max-width "max width" ["overflow text"]) --
-- (min-width "min width") --
-- (padding "left-symbol" "right-symbol") --
-- (padding "symbol") --
-- (prefix ("prefix" 0 (10 20) ...) ("prefix" 2) ...) --
-- (prefix ("prefix" 0 (10 20) ...) (("prefix" width) 2) ...) --
-- (right-padding "symbol") --
-- (sign "plus sign" ["minus sign"]) --
-- (suffix ("suffix" 0 (10 20) ...) ("suffix" 2) ...) --
-- (suffix ("suffix" 0 (10 20) ...) (("suffix" width) 2) ...) --
-- (width "fixed width") --
-- (width "min width" "max width" ["overflow text"]) --
-- Top-level atoms are taken as the image for the next number. --
------------------------------------------------------------------------------
with Ada.Containers.Ordered_Maps;
with Ada.Streams;
|
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
+
+
+
+
+
-
+
-
+
+
|
First, Last : T;
end record
with Dynamic_Predicate => not (Interval.Last < Interval.First);
function "<" (Left, Right : Interval) return Boolean
is (Left.Last < Right.First);
-- Strict non-overlap comparison
type Displayed_Atom is record
Image : Atom_Refs.Immutable_Reference;
Width : Generic_Integers.Width;
end record;
package Atom_Maps is new Ada.Containers.Ordered_Maps
(Interval, Atom_Refs.Immutable_Reference, "<", Atom_Refs."=");
(Interval, Displayed_Atom, "<");
function Next_Index (Map : Atom_Maps.Map) return T
is (if Map.Is_Empty then T'First else Map.Last_Key.Last + 1);
-- Index of the next element to insert in sequential lists
procedure Exclude
(Map : in out Atom_Maps.Map;
Values : in Interval);
-- Remove the given interval from the map
procedure Include
(Map : in out Atom_Maps.Map;
Values : in Interval;
Image : in Atom_Refs.Immutable_Reference);
Image : in Atom_Refs.Immutable_Reference;
Width : in Generic_Integers.Width);
-- Add Image to the given interval, overwriting any existing values.
-- If Image is empty, behave like Exclude.
procedure Parse_Single_Affix
(Map : in out Atom_Maps.Map;
Expression : in out Lockable.Descriptor'Class);
-- Parse Expression as an affix atom, followed by single numbers (atoms)
|
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
|
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
|
-
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
|
procedure Remove_Prefix
(Object : in out Format;
Value : in T);
procedure Set_Prefix
(Object : in out Format;
Value : in T;
Prefix : in Atom_Refs.Immutable_Reference);
Prefix : in Atom_Refs.Immutable_Reference;
Width : in Generic_Integers.Width);
procedure Set_Prefix
(Object : in out Format;
Value : in T;
Prefix : in Atom);
procedure Set_Prefix
(Object : in out Format;
Value : in T;
Prefix : in Atom;
Width : in Generic_Integers.Width);
procedure Remove_Prefix
(Object : in out Format;
Values : in Interval);
procedure Set_Prefix
(Object : in out Format;
Values : in Interval;
Prefix : in Atom_Refs.Immutable_Reference);
Prefix : in Atom_Refs.Immutable_Reference;
Width : in Generic_Integers.Width);
procedure Set_Prefix
(Object : in out Format;
Values : in Interval;
Prefix : in Atom);
procedure Set_Prefix
(Object : in out Format;
Values : in Interval;
Prefix : in Atom;
Width : in Generic_Integers.Width);
procedure Set_Right_Padding
(Object : in out Format;
Symbol : in Atom_Refs.Immutable_Reference);
procedure Set_Right_Padding
(Object : in out Format;
Symbol : in Atom);
procedure Remove_Suffix
(Object : in out Format;
Value : in T);
procedure Set_Suffix
(Object : in out Format;
Value : in T;
Suffix : in Atom_Refs.Immutable_Reference);
Suffix : in Atom_Refs.Immutable_Reference;
Width : in Generic_Integers.Width);
procedure Set_Suffix
(Object : in out Format;
Value : in T;
Suffix : in Atom);
procedure Set_Suffix
(Object : in out Format;
Value : in T;
Suffix : in Atom;
Width : in Generic_Integers.Width);
procedure Remove_Suffix
(Object : in out Format;
Values : in Interval);
procedure Set_Suffix
(Object : in out Format;
Values : in Interval;
Suffix : in Atom_Refs.Immutable_Reference);
Suffix : in Atom_Refs.Immutable_Reference;
Width : in Generic_Integers.Width);
procedure Set_Suffix
(Object : in out Format;
Values : in Interval;
Suffix : in Atom);
procedure Set_Suffix
(Object : in out Format;
Values : in Interval;
Suffix : in Atom;
Width : in Generic_Integers.Width);
procedure Set_Symbols
(Object : in out Format;
Symbols : in Atom_Arrays.Immutable_Reference);
procedure Set_Symbols
(Object : in out Format;
Expression : in out S_Expressions.Descriptor'Class);
|