File: arm_info.diff

package info (click to toggle)
ada-reference-manual 1%3A2005.2-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 8,740 kB
  • ctags: 1
  • sloc: makefile: 44
file content (2818 lines) | stat: -rw-r--r-- 101,448 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
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
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
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
#
#
# add_file "progs/arm_texinfo.adb"
#  content [7291d198ca61ecfe04d7362edb1dde8186a5f855]
# 
# add_file "progs/arm_texinfo.ads"
#  content [266d5c69e4795f81b1e609fc0ba0be883fbd96af]
# 
# patch "progs/arm_cont.adb"
#  from [6367999676bc6e64b7d6d11a401f1dac3fd1ca59]
#    to [d885d951af3ba9b6e41fd78e2001fcc74159a283]
# 
# patch "progs/arm_cont.ads"
#  from [6596716ec97c15a811b342a248759697f3092b3a]
#    to [ef3ac4e688d6574b38ea3d32b4a5d015db130f15]
# 
# patch "progs/arm_corr.adb"
#  from [8c3c083def7c6c54d5ba24fd601e369af7c715dc]
#    to [6bacc4dc096dfb9f3fa2f901f2e9d35015356083]
# 
# patch "progs/arm_db.adb"
#  from [f5f60a07051b87c049b0ecbd6462b6e9bfac38c3]
#    to [1d603365d5bb465bbb1cab92bf04dfa4fe64a7d1]
# 
# patch "progs/arm_file.adb"
#  from [c2bc065c1412b42d956a113825f463016e816550]
#    to [d2bfec6ddb79bb63fad90a1a6559681ecbd3bb96]
# 
# patch "progs/arm_form.ada"
#  from [b16d9b40ec87e171d579ffe166f2a9acfe2ade44]
#    to [c00aa04da68cb1b2c21f07bbec593cca5debec1c]
# 
# patch "progs/arm_frm.adb"
#  from [88a1527623f1c61882521ef8eebbf1f50200f291]
#    to [81a0a13966fdbca428831a7c17c7ef957cd77654]
# 
# patch "progs/arm_frm.ads"
#  from [e0e0bfa9ae14b868d1fb6af5d0cb3ca0bf4978cc]
#    to [37ae4d5c73239c0cab701e63d1f22775a11bfc44]
# 
# patch "progs/arm_html.adb"
#  from [f7485cae94631499305b48e073365eaf9a79bec1]
#    to [e2c8043f3f7cc70a7995d79701ac030ed4af6ee1]
# 
# patch "progs/arm_indx.adb"
#  from [85d524ffcd0687f48142f51f0568b4f187cde0f4]
#    to [4d4895df38d72351deed15d7549ea31d95376788]
# 
# patch "progs/arm_mast.adb"
#  from [bf1cc6c25a197650141a6c295fffe9bbb2fcccd9]
#    to [f07fb577134c87b82d27244f684fc01f34f075f3]
# 
# patch "progs/arm_rtf.adb"
#  from [dfa82e8697545d64775c89297cceeaa93d9101da]
#    to [77f0fffb0bd7a4d0b6293fad50388b82ec52827d]
# 
# patch "progs/arm_str.adb"
#  from [d12ec9e024dd28b7c7f83e8c281f6eb6ab35ba8e]
#    to [d05b795fb41d724d03e24c6adba1d4249da2bef2]
# 
# patch "progs/arm_sub.adb"
#  from [b585f4a75f9394d7cc2126667c6543165b9dbf12]
#    to [66564154cc0e70e30db4e5dbc92431ecbf341590]
# 
# patch "progs/arm_syn.adb"
#  from [b849027bd8ca131c1d0762ff315aa4f9c3709aa9]
#    to [d0031269276536bcbd8ae0b8844d12b5a881460e]
# 
# patch "progs/arm_text.adb"
#  from [0210659138fa315cfd969149fd13110072c9b906]
#    to [468b32811dce385ab7244ed4385ca746034c0e33]
# 
# patch "source_2005/AARM.MSM"
#  from [699210eae97f47f5b6e8572771f12aee8f04f075]
#    to [d6d3884441787cb4c2ecfe8855b88fe1fcffb0b0]
# 
# patch "source_2005/RM.MSM"
#  from [e854c6de287879445fa9230508b08e1059e33634]
#    to [92c2e5abae5daa80d679e9a11453d2ac0a3ba247]
# 
#   set "progs/arm_texinfo.adb"
#  attr "mtn:execute"
# value "true"
# 
#   set "progs/arm_texinfo.ads"
#  attr "mtn:execute"
# value "true"
#
============================================================
--- progs/arm_texinfo.adb	7291d198ca61ecfe04d7362edb1dde8186a5f855
+++ progs/arm_texinfo.adb	7291d198ca61ecfe04d7362edb1dde8186a5f855
@@ -0,0 +1,1992 @@
+with Ada.Exceptions;
+with Ada.Strings.Fixed;
+package body ARM_Texinfo is
+
+   --  Copyright (C) 2003, 2007, 2010 Stephen Leake.  All Rights Reserved.
+   --  E-Mail: stephen_leake@acm.org
+   --
+   --  This library is free software; you can redistribute it and/or
+   --  modify it under terms of the GNU General Public License as
+   --  published by the Free Software Foundation; either version 3, or (at
+   --  your option) any later version. This library is distributed in the
+   --  hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+   --  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+   --  PURPOSE. See the GNU General Public License for more details. You
+   --  should have received a copy of the GNU General Public License
+   --  distributed with this program; see file COPYING. If not, write to
+   --  the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+   --  MA 02111-1307, USA.
+   --
+   --  As a special exception, if other files instantiate generics from
+   --  this unit, or you link this unit with other files to produce an
+   --  executable, this  unit  does not  by itself cause  the resulting
+   --  executable to be covered by the GNU General Public License. This
+   --  exception does not however invalidate any other reasons why the
+   --  executable file  might be covered by the  GNU Public License.
+
+   use Ada.Text_IO;
+
+   Indentation : constant := 5;
+
+   --  VERSION: This is fragile; it changes with each version of the manual.
+   Index_Clause      : constant String    := "0.5";
+   Index_Clause_Name : constant String    := "Index";
+   Index_Clause_Next : constant String    := "operators";
+   Operators_Clause  : constant String    := "operators";
+   Last_Index_Clause : constant Character := 'Y';
+
+   ----------
+   --  local subprograms
+
+   procedure Check_Not_In_Paragraph (Output_Object : in Texinfo_Output_Type)
+   is begin
+      if Output_Object.In_Paragraph then
+         Ada.Exceptions.Raise_Exception
+           (ARM_Output.Not_Valid_Error'Identity,
+            "In paragraph");
+      end if;
+   end Check_Not_In_Paragraph;
+
+   procedure Check_Valid (Output_Object : in Texinfo_Output_Type)
+   is begin
+      if not Output_Object.Is_Valid then
+         Ada.Exceptions.Raise_Exception
+           (ARM_Output.Not_Valid_Error'Identity,
+            "Not valid object");
+      end if;
+   end Check_Valid;
+
+   procedure Unexpected_State (Output_Object : in Texinfo_Output_Type)
+   is begin
+      Ada.Exceptions.Raise_Exception
+        (ARM_Output.Not_Valid_Error'Identity,
+         "Unexpected state: " & State_Type'Image (Output_Object.State));
+   end Unexpected_State;
+
+   procedure Escape_Put
+     (Output_Object  : in Texinfo_Output_Type;
+      Char           : in Character;
+      Preserve_Space : in Boolean             := False)
+   is begin
+      --  Escape special chars
+      if Char = '@' then
+         Put (Output_Object.File, "@@");
+      elsif Char = '{' then
+         Put (Output_Object.File, "@{");
+      elsif Char = '}' then
+         Put (Output_Object.File, "@}");
+      elsif Char = ''' then
+         --  Avoid makeinfo converting '' into "
+         Put (Output_Object.File, "'@w{}");
+      elsif Char = '`' then
+         --  Avoid makeinfo converting `` into "
+         Put (Output_Object.File, "`@w{}");
+      elsif Char = '-' then
+         Put (Output_Object.File, "@minus{}");
+      elsif Char = ' ' and Preserve_Space then
+         --  Don't allow collapsing spaces
+         Put (Output_Object.File, "@w{ }");
+      elsif Char = '\' then
+         --  This confuses texi2dvi if not escaped.
+         Put (Output_Object.File, "@code{\}");
+      else
+         Put (Output_Object.File, Char);
+      end if;
+   end Escape_Put;
+
+   procedure Escape_Put
+     (Output_Object  : in Texinfo_Output_Type;
+      Text           : in String;
+      Preserve_Space : in Boolean             := False)
+   is begin
+      for I in Text'Range loop
+         Escape_Put (Output_Object, Text (I), Preserve_Space);
+      end loop;
+   end Escape_Put;
+
+   procedure End_Title_Page (Output_Object : in out Texinfo_Output_Type)
+   is
+      use ARM_Contents;
+
+      procedure Put_Top_Menu_Item
+        (Title         : in     Title_Type;
+         Level         : in     Level_Type;
+         Clause_Number : in     Clause_Number_Type;
+         Version       : in     ARM_Contents.Change_Version_Type;
+         Quit          :    out Boolean)
+      is
+         pragma Unreferenced (Version); --  we are only concerned with version 2
+         First_Part : String (1 .. 14); --  Get all Titles aligned.
+      begin
+         Quit := False;
+
+         case Level is
+         when Section | Normative_Annex | Informative_Annex =>
+            Ada.Strings.Fixed.Move
+              (Source =>
+                 "* " &
+                 Make_Clause_Number (Level, Clause_Number) &
+                 " ::",
+               Target => First_Part);
+
+            Put_Line (Output_Object.File, First_Part & Title);
+
+         when Unnumbered_Section | Clause | Subclause | Subsubclause =>
+            null;
+
+         end case;
+      end Put_Top_Menu_Item;
+
+      procedure Put_Top_Menu is new For_Each (Put_Top_Menu_Item);
+   begin
+
+      New_Line (Output_Object.File); --  Terminate unneeded "@center"
+
+      Put_Line (Output_Object.File, "@dircategory GNU Ada tools");
+      Put_Line (Output_Object.File, "@direntry");
+      Put_Line (Output_Object.File, "* Ada Reference Manual: (arm2005).");
+      Put_Line (Output_Object.File, "* Annotated ARM: (aarm2005).");
+      Put_Line (Output_Object.File, "@end direntry");
+
+      Put_Line (Output_Object.File, "@menu");
+      Put_Line (Output_Object.File, "* Front Matter:: Copyright, Foreword, etc."); --  Not a section in ARM sources
+      Put_Top_Menu;
+      Put_Line (Output_Object.File, "* Index ::    Index"); --  Not in ARM sources
+      Put_Line (Output_Object.File, "@end menu");
+
+      -- @node current, next, prev, up
+      Put_Line (Output_Object.File, "@node Front Matter, 0.1, Top, Top");
+      Put_Line (Output_Object.File, "@chapter Front Matter");
+   end End_Title_Page;
+
+   procedure Get_Clause_Section
+     (Clause_String  : in     String;
+      Section_Number :    out ARM_Contents.Section_Number_Type;
+      Clause_Integer :    out Natural)
+   is
+      --  This is a partial inverse of ARM_Contents.Make_Clause_Number.
+      --
+      --  Clause_String has "section.clause.subclause", possibly no subclause.
+      --
+      --  "section" can be a number, a letter "N", or "Annex N", where
+      --
+      --  'N' = Character'Val (Character'Pos('A') + (Section_Number - ANNEX_START)
+
+      Section_Dot : constant Natural := Ada.Strings.Fixed.Index (Source => Clause_String, Pattern => ".");
+
+      Clause_Dot : constant Natural := Ada.Strings.Fixed.Index
+        (Source => Clause_String (Section_Dot + 1 .. Clause_String'Last),
+         Pattern => ".");
+
+      use type ARM_Contents.Section_Number_Type;
+   begin
+      if Section_Dot = 8 then
+         --  Section is "Annex N"
+         Section_Number := ARM_Contents.ANNEX_START +
+           Character'Pos (Clause_String (Clause_String'First + 6)) - Character'Pos ('A');
+      elsif Character'Pos (Clause_String (Clause_String'First)) >= Character'Pos ('A') then
+         --  Section is letter.
+         Section_Number := ARM_Contents.ANNEX_START +
+           Character'Pos (Clause_String (Clause_String'First)) - Character'Pos ('A');
+      else
+         Section_Number := ARM_Contents.Section_Number_Type'Value
+           (Clause_String (Clause_String'First .. Section_Dot - 1));
+      end if;
+
+      if Clause_Dot = 0 then
+         Clause_Integer := Natural'Value
+           (Clause_String (Section_Dot + 1 .. Clause_String'Last));
+      else
+         Clause_Integer := Natural'Value
+           (Clause_String (Section_Dot + 1 .. Clause_Dot - 1));
+      end if;
+   end Get_Clause_Section;
+
+   procedure Add_To_Column_Item (Output_Object : in out Texinfo_Output_Type; Text : in String)
+   is begin
+      if Output_Object.Column_Text (Output_Object.Current_Column) = null or else
+        Output_Object.Column_Text (Output_Object.Current_Column).Row /= Output_Object.Current_Row
+      then
+         --  Start a new row.
+         Output_Object.Column_Text (Output_Object.Current_Column) :=
+           new Column_Text_Item_Type'
+           (Text   => (others => ' '),
+            Length => 0,
+            Row    => Output_Object.Current_Row,
+            Next   => Output_Object.Column_Text (Output_Object.Current_Column));
+      end if;
+
+      if Output_Object.Column_Text (Output_Object.Current_Column).Length + Text'Length >
+        Output_Object.Column_Text (Output_Object.Current_Column).Text'Length
+      then
+         Ada.Exceptions.Raise_Exception
+           (ARM_Output.Not_Valid_Error'Identity,
+            "Column item full, but more text: " &
+              Output_Object.Column_Text (Output_Object.Current_Column).Text
+              (1 .. Output_Object.Column_Text (Output_Object.Current_Column).Length));
+      else
+         declare
+            Current_Text : Column_Text_Item_Type renames Output_Object.Column_Text (Output_Object.Current_Column).all;
+         begin
+            Current_Text.Text (Current_Text.Length + 1 .. Current_Text.Length + Text'Length) := Text;
+
+            Current_Text.Length := Current_Text.Length + Text'Length;
+
+            if Output_Object.Column_Widths (Output_Object.Current_Column) < Current_Text.Length then
+               Output_Object.Column_Widths (Output_Object.Current_Column) := Current_Text.Length;
+            end if;
+         end;
+      end if;
+   end Add_To_Column_Item;
+
+   procedure Pad_Columns (Output_Object : in out Texinfo_Output_Type)
+   --  Ensure that all columns have the same number of (possibly
+   --  empty) rows, for table headers.
+   is
+      Item          : Column_Text_Ptr;
+      First_New_Row : Natural;
+   begin
+      for Col in 1 .. Output_Object.Column_Count loop
+         Item := Output_Object.Column_Text (Col);
+         if Item = null then
+            First_New_Row := 1;
+         else
+            First_New_Row := Item.Row + 1;
+         end if;
+
+         for I in First_New_Row .. Output_Object.Max_Row loop
+            Output_Object.Column_Text (Col) :=
+              new Column_Text_Item_Type'
+              (Text   => (others => ' '),
+               Length => 1,
+               Row    => I,
+               Next   => Output_Object.Column_Text (Col));
+         end loop;
+      end loop;
+   end Pad_Columns;
+
+   procedure Output_Column_Widths (Output_Object : in out Texinfo_Output_Type)
+   is begin
+      New_Line (Output_Object.File);
+      Put (Output_Object.File, "@multitable ");
+      for I in 1 .. Output_Object.Column_Count loop
+         Put
+           (Output_Object.File,
+            " {" &
+              String'(1 .. Output_Object.Column_Widths (I) => 'w') &
+              "}");
+      end loop;
+   end Output_Column_Widths;
+
+   procedure Output_Columns (Output_Object : in out Texinfo_Output_Type)
+   is
+      Row  : Natural         := 1;
+      Item : Column_Text_Ptr;
+      Temp : Column_Text_Ptr;
+   begin
+      Rows :
+      loop
+         New_Line (Output_Object.File);
+         Put (Output_Object.File, "@item ");
+
+         --  For all columns, output the items for this row. Note that
+         --  the last row is at the front of each column list; the
+         --  first row is at the end. We delete the rows as we output
+         --  them, so the one we want is always at the end of the
+         --  column list.
+         Columns :
+         for Col in 1 .. Output_Object.Column_Count loop
+            Item := Output_Object.Column_Text (Col);
+
+            if Item = null then
+               --  Previously finished column
+               null;
+
+            elsif Item.Next = null then
+               --  This is the last item in the column.
+               if Item.Row /= Row then
+                  --  This column is empty for this row.
+                  Item := null;
+               else
+                  --  Output Item, and mark that we're done outputing
+                  --  this column.
+                  Output_Object.Column_Text (Col) := null;
+               end if;
+            else
+               --  Find first item for this row in the column.
+               while Item.Next /= null and then Item.Next.Row /= Row loop
+                  Item := Item.Next;
+               end loop;
+
+               --  Output Item.Next, take it out of list.
+               Temp      := Item;
+               Item      := Item.Next;
+               Temp.Next := null;
+            end if;
+
+            if Item /= null then
+               --  Output the item
+               Escape_Put (Output_Object, Item.Text (1 .. Item.Length), Preserve_Space => True);
+               Free (Item);
+
+               if Col /= Output_Object.Column_Count then
+                  Put (Output_Object.File, " @tab ");
+               end if;
+
+            else
+               --  This column is empty for this row
+               if Col < Output_Object.Column_Count then
+                  Put (Output_Object.File, " @tab ");
+               end if;
+            end if;
+         end loop Columns;
+
+         if Output_Object.Column_Text = Column_Text_Ptrs_Type'(others => null) then
+            --  We've output everything.
+            exit Rows;
+         end if;
+
+         --  End the row:
+         Row := Row + 1;
+      end loop Rows;
+   end Output_Columns;
+
+   procedure Index_Menu (Output_Object : in out Texinfo_Output_Type)
+   is begin
+      Put_Line (Output_Object.File, "@menu");
+      Put_Line (Output_Object.File, "* operators::");
+      Put_Line (Output_Object.File, "* A::");
+      Put_Line (Output_Object.File, "* B::");
+      Put_Line (Output_Object.File, "* C::");
+      Put_Line (Output_Object.File, "* D::");
+      Put_Line (Output_Object.File, "* E::");
+      Put_Line (Output_Object.File, "* F::");
+      Put_Line (Output_Object.File, "* G::");
+      Put_Line (Output_Object.File, "* H::");
+      Put_Line (Output_Object.File, "* I::");
+      Put_Line (Output_Object.File, "* J::");
+      Put_Line (Output_Object.File, "* K::");
+      Put_Line (Output_Object.File, "* L::");
+      Put_Line (Output_Object.File, "* M::");
+      Put_Line (Output_Object.File, "* N::");
+      Put_Line (Output_Object.File, "* O::");
+      Put_Line (Output_Object.File, "* P::");
+      Put_Line (Output_Object.File, "* Q::");
+      Put_Line (Output_Object.File, "* R::");
+      Put_Line (Output_Object.File, "* S::");
+      Put_Line (Output_Object.File, "* T::");
+      Put_Line (Output_Object.File, "* U::");
+      Put_Line (Output_Object.File, "* V::");
+      Put_Line (Output_Object.File, "* W::");
+      Put_Line (Output_Object.File, "* X::");
+      Put_Line (Output_Object.File, "* Y::");
+      --  Put_Line (Output_Object.File, "* Z::"); --  VERSION: No entries in Z
+      Put_Line (Output_Object.File, "@end menu");
+
+      --  @node current, next, prev, up
+      Put_Line
+        (Output_Object.File,
+         "@node " & Operators_Clause &
+           ", A, " & Index_Clause_Name &
+           ", " & Index_Clause_Name);
+
+      Put_Line (Output_Object.File, "@section operators");
+   end Index_Menu;
+
+   ----------
+   --  Public subprograms. Alphabetical order
+
+   procedure AI_Reference
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      AI_Number     : in     String)
+   is begin
+      Ordinary_Text (Output_Object, AI_Number & Text);
+   end AI_Reference;
+
+   procedure Category_Header
+     (Output_Object : in out Texinfo_Output_Type;
+      Header_Text   :        String)
+   is begin
+      Check_Not_In_Paragraph (Output_Object);
+
+      --  Can't be in a multi-column setting.
+      --
+      --  Don't use @heading; that causes a weird underline in info,
+      --  that isn't centered!
+      Put_Line (Output_Object.File, "@center @emph{" & Header_Text & "}");
+      New_Line (Output_Object.File, 2);
+   end Category_Header;
+
+   procedure Clause_Header
+     (Output_Object : in out Texinfo_Output_Type;
+      Header_Text   : in     String;
+      Level         : in     ARM_Contents.Level_Type;
+      Clause_Number : in     String;
+      No_Page_Break : in     Boolean                 := False)
+   is
+      pragma Unreferenced (No_Page_Break);
+      Title : constant String := Clause_Number & " " & Header_Text;
+
+      use ARM_Contents;
+
+      Section_Number : Section_Number_Type;
+      Clause_Integer : Natural;
+
+      procedure Put_Clause_Menu_Item
+        (Item_Title         : in     Title_Type;
+         Item_Level         : in     Level_Type;
+         Item_Clause_Number : in     Clause_Number_Type;
+         Version            : in     ARM_Contents.Change_Version_Type;
+         Quit               :    out Boolean)
+      is
+         pragma Unreferenced (Version); --  only version 2
+         First_Part : String (1 .. 14); --  Get all Titles aligned.
+      begin
+         Quit := False;
+
+         case Item_Level is
+         when Section | Unnumbered_Section | Normative_Annex | Informative_Annex | Subclause | Subsubclause =>
+            --  We are doing Clause here
+            null;
+
+         when Clause  =>
+            if Item_Clause_Number.Section < Section_Number then
+               null;
+
+            elsif Item_Clause_Number.Section = Section_Number then
+               Ada.Strings.Fixed.Move
+                 (Source =>
+                    "* " &
+                    Make_Clause_Number (Item_Level, Item_Clause_Number) &
+                    " ::",
+                  Target => First_Part);
+
+               Put_Line (Output_Object.File, First_Part & Item_Title);
+            else
+               Quit := True;
+            end if;
+         end case;
+      end Put_Clause_Menu_Item;
+
+      procedure Put_Clause_Menu is new For_Each (Put_Clause_Menu_Item);
+
+      procedure Put_Subclause_Menu_Item
+        (Item_Title         : in     Title_Type;
+         Item_Level         : in     Level_Type;
+         Item_Clause_Number : in     Clause_Number_Type;
+         Version            : in     ARM_Contents.Change_Version_Type;
+         Quit               :    out Boolean)
+      is
+         pragma Unreferenced (Version); --  only version 2
+         First_Part : String (1 .. 14); --  Get all Titles aligned.
+      begin
+         Quit := False;
+
+         case Item_Level is
+            when Section | Unnumbered_Section | Normative_Annex | Informative_Annex | Clause | Subsubclause =>
+               --  We are doing Subclause here
+               null;
+
+         when Subclause  =>
+            if Item_Clause_Number.Section < Section_Number then
+               null;
+
+            elsif Item_Clause_Number.Section = Section_Number then
+               if Item_Clause_Number.Clause < Clause_Integer then
+                  null;
+
+               elsif Item_Clause_Number.Clause = Clause_Integer then
+                  Ada.Strings.Fixed.Move
+                    (Source =>
+                       "* " &
+                       Make_Clause_Number (Item_Level, Item_Clause_Number) &
+                       " ::",
+                     Target => First_Part);
+
+                  Put_Line (Output_Object.File, First_Part & Item_Title);
+               else
+                  Quit := True;
+               end if;
+            else
+               Quit := True;
+            end if;
+         end case;
+      end Put_Subclause_Menu_Item;
+
+      procedure Put_Subclause_Menu is new For_Each (Put_Subclause_Menu_Item);
+
+      function Safe_Next_Clause (Clause : in String) return String
+      is begin
+         if Clause = Index_Clause then
+            return Index_Clause_Next;
+         else
+            declare
+               Result : constant String := ARM_Contents.Next_Clause (Clause);
+            begin
+               if Result = Index_Clause then
+                  return Index_Clause_Name;
+               else
+                  return Result;
+               end if;
+            end;
+         end if;
+      exception
+      when Not_Found_Error =>
+         return "";
+      end Safe_Next_Clause;
+
+      function Safe_Previous_Clause (Clause : in String) return String
+      is begin
+         return ARM_Contents.Previous_Clause (Clause);
+      exception
+      when Not_Found_Error =>
+         return "";
+      end Safe_Previous_Clause;
+
+      function Safe_Parent_Clause (Clause : in String) return String
+      is
+         Temp : constant String := ARM_Contents.Parent_Clause (Clause_Number);
+      begin
+         if Temp'Length = 0 or Temp = "0" then
+            return "Top";
+         else
+            return Temp;
+         end if;
+      end Safe_Parent_Clause;
+
+   begin
+      Check_Not_In_Paragraph (Output_Object);
+
+      --  Handle special cases
+      if Clause_Number = "" and Header_Text = "Table of Contents" then
+         --  Actual contents output in TOC_Marker below.
+         return;
+
+      elsif Header_Text = "The Standard Libraries" then
+         --  This section has no content; don't confuse makeinfo.
+         return;
+
+      elsif Clause_Number = Index_Clause and Header_Text = Index_Clause_Name then
+
+         Put_Line
+           (Output_Object.File,
+            "@node " & Index_Clause_Name &
+              ", " & Index_Clause_Next &
+              ", " & Safe_Previous_Clause (Clause_Number) &
+              ", " & Safe_Parent_Clause (Clause_Number));
+
+         Put_Line (Output_Object.File, "@chapter Index");
+         Output_Object.State := Index_Start;
+
+         return;
+      end if;
+
+      case Level is
+      when Section | Normative_Annex | Informative_Annex =>
+         --  Menu of these done at @node Top
+         null;
+
+      when Unnumbered_Section =>
+         --  Unnumbered sections are not in ARM_Contents, but there's
+         --  currently only one of them, so they are not worth adding;
+         --  just hard-code the menu here.
+         Get_Clause_Section (Clause_Number, Section_Number, Clause_Integer);
+
+         if Section_Number = 0 and Clause_Integer = 1 then
+            Put_Line (Output_Object.File, "@menu");
+            Put_Line (Output_Object.File, "* 0.1 :: Foreword to this version of the Ada Reference Manual");
+            Put_Line (Output_Object.File, "* 0.2 :: Foreword");
+            Put_Line (Output_Object.File, "* 0.3 :: Introduction");
+            Put_Line (Output_Object.File, "* 0.99 :: International Standard");
+            Put_Line (Output_Object.File, "@end menu");
+         end if;
+
+      when Clause =>
+         --  Output menu of Clauses in this section, if we haven't already
+         Get_Clause_Section (Clause_Number, Section_Number, Clause_Integer);
+
+         if Output_Object.Menu_Section /= Section_Number then
+            Put_Line (Output_Object.File, "@menu");
+            Put_Clause_Menu;
+            Put_Line (Output_Object.File, "@end menu");
+            Output_Object.Menu_Section := Section_Number;
+            Output_Object.Menu_Clause  := 0;
+         end if;
+
+      when Subclause =>
+         --  Output menu of Subclauses in this Clause, if we haven't already
+         Get_Clause_Section (Clause_Number, Section_Number, Clause_Integer);
+
+         if Output_Object.Menu_Section = Section_Number and
+           Output_Object.Menu_Clause /= Clause_Integer
+         then
+            Put_Line (Output_Object.File, "@menu");
+            Put_Subclause_Menu;
+            Put_Line (Output_Object.File, "@end menu");
+            Output_Object.Menu_Clause := Clause_Integer;
+         end if;
+
+      when Subsubclause =>
+         Put_Line (Output_Object.File, "FIXME: Clause_Header: Subsubclause");
+      end case;
+
+      Put_Line
+        (Output_Object.File,
+         "@node " & Clause_Number &
+           ", " & Safe_Next_Clause (Clause_Number) &
+           ", " & Safe_Previous_Clause (Clause_Number) &
+           ", " & Safe_Parent_Clause (Clause_Number));
+
+      case Level is
+      when Section =>
+         Put_Line (Output_Object.File, "@chapter " & Title);
+
+      when Normative_Annex | Informative_Annex =>
+         Put_Line (Output_Object.File, "@chapter " & Title);
+
+      when Clause | Unnumbered_Section =>
+         Put_Line (Output_Object.File, "@section " & Title);
+
+      when Subclause =>
+         Put_Line (Output_Object.File, "@subsection " & Title);
+
+      when Subsubclause =>
+         Put_Line (Output_Object.File, "@subsubsection " & Title);
+
+      end case;
+
+   end Clause_Header;
+
+   procedure Clause_Reference
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      Clause_Number : in     String)
+   is begin
+      case Output_Object.State is
+      when Contents =>
+         null;
+
+      when Multi_Column | Table_Header =>
+         --  If this happens, we need to store escaped text in columns.
+         Ada.Exceptions.Raise_Exception
+           (ARM_Output.Not_Valid_Error'Identity,
+            "clause reference in multi-column");
+
+      when Normal =>
+         if Text = Clause_Number then
+            Put
+              (Output_Object.File,
+               "@ref{" &
+                 Clause_Number &
+                 "}");
+         else
+            Put
+              (Output_Object.File,
+               "@ref{" &
+                 Clause_Number &
+                 "} " &
+                 Text);
+         end if;
+
+      when Title | Index_Start | Index =>
+         Unexpected_State (Output_Object);
+
+      end case;
+   end Clause_Reference;
+
+   procedure Close (Output_Object : in out Texinfo_Output_Type)
+   is begin
+      Check_Valid (Output_Object);
+
+      Put_Line (Output_Object.File, "@bye");
+
+      Close (Output_Object.File);
+
+      Output_Object.Is_Valid := False;
+   end Close;
+
+   procedure Create
+     (Output_Object : in out Texinfo_Output_Type;
+      File_Prefix   : in     String;
+      Title         : in     String)
+   is
+      File_Name : constant String := Ada.Strings.Fixed.Trim (File_Prefix & ".texinfo", Ada.Strings.Right);
+   begin
+      if Output_Object.Is_Valid then
+         Ada.Exceptions.Raise_Exception
+           (ARM_Output.Not_Valid_Error'Identity,
+            "Already valid object");
+      end if;
+
+      Output_Object.Is_Valid := True;
+
+      Create (Output_Object.File, Out_File, File_Name);
+
+      Put_Line (Output_Object.File, "\input texinfo");
+      Put_Line (Output_Object.File, "@settitle " & Title);
+      Put_Line (Output_Object.File, "@paragraphindent none");
+      Put_Line (Output_Object.File, "@exampleindent" & Integer'Image (Indentation));
+
+      Put_Line (Output_Object.File, "@node Top");
+      Put_Line (Output_Object.File, "@top " & Title);
+
+      Output_Object.State           := ARM_Texinfo.Title;
+      Output_Object.First_Word_Last := 0;
+
+   end Create;
+
+   procedure DR_Reference
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      DR_Number     : in     String)
+   is begin
+      Ordinary_Text (Output_Object, DR_Number & Text);
+   end DR_Reference;
+
+   procedure End_Hang_Item (Output_Object : in out Texinfo_Output_Type)
+   is
+      use ARM_Output;
+   begin
+      case Output_Object.Paragraph_Format is
+      when
+        Swiss_Examples | Small_Swiss_Examples |
+        Swiss_Indented_Examples | Small_Swiss_Indented_Examples |
+        Small_Syntax_Indented |
+        Nested_X2_Bulleted | Small_Nested_X2_Bulleted |
+        Indented_Nested_Bulleted |
+        Inner_Indented | Small_Inner_Indented =>
+         Put_Line
+           (Output_Object.File,
+            "FIXME: End_Hang_Item: hanging? "& Paragraph_Type'Image (Output_Object.Paragraph_Format));
+
+      when Normal |
+        Wide |
+        Notes |
+        Notes_Header |
+        Annotations |
+        Wide_Annotations |
+        Index |
+        Syntax_Summary |
+        Examples |
+        Small_Examples |
+        Indented_Examples |
+        Small_Indented_Examples |
+        Syntax_Indented |
+        Code_Indented |
+        Small_Code_Indented |
+        Indented |
+        Small_Indented |
+        Bulleted |
+        Nested_Bulleted |
+        Small_Bulleted |
+        Small_Nested_Bulleted |
+        Indented_Bulleted |
+        Code_Indented_Bulleted |
+        Code_Indented_Nested_Bulleted |
+        Syntax_Indented_Bulleted |
+        Notes_Bulleted |
+        Notes_Nested_Bulleted =>
+
+         null;
+
+      when Hanging |
+        Small_Hanging |
+        Indented_Hanging |
+        Small_Indented_Hanging |
+        Hanging_in_Bulleted |
+        Small_Hanging_in_Bulleted =>
+
+         --  End of term in definition list; indent rest of paragraph.
+         --  But sometimes we never get an "end_hang_item" in a
+         --  hanging paragraph, so let End_Paragraph know we got one
+         --  this time.
+         Output_Object.End_Hang_Seen := True;
+
+         New_Line (Output_Object.File);
+         Put_Line (Output_Object.File, "@quotation");
+
+      when Enumerated |
+        Small_Enumerated |
+        Nested_Enumerated |
+        Small_Nested_Enumerated =>
+
+         --  Number has just been output; start text.
+         Put (Output_Object.File, "@w{  }");
+
+      end case;
+
+   end End_Hang_Item;
+
+   procedure End_Paragraph (Output_Object : in out Texinfo_Output_Type)
+   is
+      use ARM_Output;
+   begin
+      Output_Object.In_Paragraph := False;
+
+      case Output_Object.State is
+      when Contents =>
+         null;
+
+      when Multi_Column =>
+         --  Skip a row, to separate paragraphs in a column.
+         Output_Object.Current_Row := Output_Object.Current_Row + 2;
+
+      when Title =>
+         if Output_Object.Line_Empty then
+            null;
+         else
+            New_Line (Output_Object.File, 2);
+            Put (Output_Object.File, "@center ");
+            Output_Object.Line_Empty := True;
+         end if;
+
+      when Normal =>
+         case Output_Object.Paragraph_Format is
+         when
+           Swiss_Examples | Small_Swiss_Examples |
+           Swiss_Indented_Examples | Small_Swiss_Indented_Examples |
+           Small_Syntax_Indented |
+           Small_Nested_X2_Bulleted |
+           Small_Inner_Indented =>
+            Put_Line
+              (Output_Object.File, "FIXME : End_Paragraph: " & Paragraph_Type'Image (Output_Object.Paragraph_Format));
+
+         when Normal |
+           Wide |
+           Index =>
+
+            New_Line (Output_Object.File, 2);
+
+         when Notes |
+           Syntax_Summary |
+           Syntax_Indented =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end quotation");
+            New_Line (Output_Object.File);
+
+         when Annotations |
+           Wide_Annotations |
+           Code_Indented |
+           Small_Code_Indented |
+           Inner_Indented |
+           Indented |
+           Small_Indented =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end quotation");
+            Put_Line (Output_Object.File, "@end quotation");
+            New_Line (Output_Object.File);
+
+         when Examples |
+           Small_Examples =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end example");
+            New_Line (Output_Object.File);
+
+         when Indented_Examples |
+           Small_Indented_Examples =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end example");
+            Put_Line (Output_Object.File, "@end quotation");
+            New_Line (Output_Object.File);
+
+         when Notes_Header =>
+            New_Line (Output_Object.File, 2);
+
+         when Bulleted |
+           Small_Bulleted =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end itemize");
+            New_Line (Output_Object.File);
+
+         when Nested_Bulleted |
+           Small_Nested_Bulleted =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end itemize");
+            Put_Line (Output_Object.File, "@end itemize");
+            New_Line (Output_Object.File);
+
+         when Nested_X2_Bulleted =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end itemize");
+            Put_Line (Output_Object.File, "@end itemize");
+            Put_Line (Output_Object.File, "@end itemize");
+            New_Line (Output_Object.File);
+
+         when Indented_Bulleted |
+           Code_Indented_Bulleted |
+           Notes_Bulleted =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end itemize");
+            Put_Line (Output_Object.File, "@end quotation");
+            New_Line (Output_Object.File);
+
+         when Code_Indented_Nested_Bulleted |
+           Indented_Nested_Bulleted |
+           Notes_Nested_Bulleted =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end itemize");
+            Put_Line (Output_Object.File, "@end itemize");
+            Put_Line (Output_Object.File, "@end quotation");
+            New_Line (Output_Object.File);
+
+         when Syntax_Indented_Bulleted =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end itemize");
+            Put_Line (Output_Object.File, "@end quotation");
+            New_Line (Output_Object.File);
+
+         when Hanging |
+           Small_Hanging |
+           Indented_Hanging |
+           Small_Indented_Hanging |
+           Hanging_in_Bulleted |
+           Small_Hanging_in_Bulleted =>
+
+            New_Line (Output_Object.File);
+            if Output_Object.End_Hang_Seen then
+               Put_Line (Output_Object.File, "@end quotation");
+            end if;
+            New_Line (Output_Object.File);
+
+         when Enumerated |
+           Small_Enumerated |
+           Nested_Enumerated |
+           Small_Nested_Enumerated =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end itemize");
+            New_Line (Output_Object.File);
+         end case;
+
+      when Index_Start =>
+         Output_Object.State := Index;
+
+         Index_Menu (Output_Object);
+
+      when Index =>
+         --  Keep index items tightly grouped.
+         Put_Line (Output_Object.File, "@*");
+
+      when Table_Header =>
+         Unexpected_State (Output_Object);
+
+      end case;
+   end End_Paragraph;
+
+   procedure Hard_Space (Output_Object : in out Texinfo_Output_Type)
+   is begin
+      case Output_Object.State is
+      when Contents =>
+         null;
+
+      when Multi_Column | Table_Header =>
+         --  Can't do line breaks in columns
+         Add_To_Column_Item (Output_Object, " ");
+
+      when Title =>
+         if Output_Object.Line_Empty then
+            null;
+         else
+            Put (Output_Object.File, "@w{ }");
+         end if;
+
+      when Normal | Index_Start | Index =>
+         Put (Output_Object.File, "@w{ }");
+      end case;
+   end Hard_Space;
+
+   procedure Index_Line_Break
+     (Output_Object        : in out Texinfo_Output_Type;
+      Clear_Keep_with_Next : in     Boolean)
+   is
+      pragma Unreferenced (Clear_Keep_with_Next);
+   begin
+      Put_Line (Output_Object.File, "@*");
+   end Index_Line_Break;
+
+   procedure Index_Reference
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      Index_Key     : in     Natural;
+      Clause_Number : in     String)
+   is
+      pragma Unreferenced (Clause_Number);
+      --  Text is clause_number & paragraph number (optional).
+   begin
+      Put (Output_Object.File, "@ref{" & Integer'Image (Index_Key) & ", " & Text & "}");
+   end Index_Reference;
+
+   procedure Index_Target
+     (Output_Object : in out Texinfo_Output_Type;
+      Index_Key     : in     Natural)
+   is begin
+      Put (Output_Object.File, "@anchor{" & Integer'Image (Index_Key) & "}");
+   end Index_Target;
+
+   procedure Line_Break (Output_Object : in out Texinfo_Output_Type)
+   is
+      use ARM_Output;
+   begin
+      case Output_Object.State is
+      when Title =>
+         if Output_Object.Line_Empty then
+            null;
+         else
+            Put_Line (Output_Object.File, "@*");
+            Output_Object.Line_Empty := True;
+         end if;
+
+      when Contents =>
+         null;
+
+      when Multi_Column | Table_Header =>
+         Output_Object.Current_Row := Output_Object.Current_Row + 1;
+         if Output_Object.Max_Row < Output_Object.Current_Row then
+            Output_Object.Max_Row := Output_Object.Current_Row;
+         end if;
+
+      when Index_Start =>
+         --  This doesn't happen
+         Put_Line (Output_Object.File, "FIXME: Line_Break Index_Start");
+
+      when Normal | Index =>
+         case Output_Object.Paragraph_Format is
+         when
+           Swiss_Examples | Small_Swiss_Examples |
+           Swiss_Indented_Examples | Small_Swiss_Indented_Examples |
+           Small_Syntax_Indented |
+           Nested_X2_Bulleted |
+           Small_Nested_X2_Bulleted | Indented_Nested_Bulleted |
+           Inner_Indented | Small_Inner_Indented =>
+            Put_Line
+              (Output_Object.File, "FIXME: Line_Break: "& Paragraph_Type'Image (Output_Object.Paragraph_Format));
+
+         when Normal |
+           Wide |
+           Notes |
+           Notes_Header |
+           Annotations |
+           Wide_Annotations |
+           Index |
+           Syntax_Summary |
+           Syntax_Indented |
+           Code_Indented |
+           Small_Code_Indented |
+           Indented |
+           Small_Indented |
+           Bulleted |
+           Nested_Bulleted |
+           Small_Bulleted |
+           Small_Nested_Bulleted |
+           Indented_Bulleted |
+           Code_Indented_Bulleted |
+           Code_Indented_Nested_Bulleted |
+           Syntax_Indented_Bulleted |
+           Notes_Bulleted |
+           Notes_Nested_Bulleted |
+           Hanging |
+           Small_Hanging |
+           Indented_Hanging |
+           Small_Indented_Hanging |
+           Hanging_in_Bulleted |
+           Small_Hanging_in_Bulleted |
+           Enumerated |
+           Small_Enumerated |
+           Nested_Enumerated |
+           Small_Nested_Enumerated =>
+
+            Put_Line (Output_Object.File, "@*");
+
+         when Examples |
+           Small_Examples |
+           Indented_Examples |
+           Small_Indented_Examples =>
+
+            New_Line (Output_Object.File);
+
+         end case;
+
+      end case;
+   end Line_Break;
+
+   procedure Local_Link
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      Target        : in     String;
+      Clause_Number : in     String)
+   is
+      pragma Unreferenced (Target);
+      pragma Unreferenced (Clause_Number);
+   begin
+      --  These are typically references to words in the grammar
+      --  summary. Mildly useful, but the best we can do is:
+      --
+      --  "@ref{" & Target & "," & Text & "}"
+      --
+      --  makeinfo prepends 'see' and postpends '.', so it screws up
+      --  the text. For example, section 2.1 (1) ends up with "the
+      --  @ref{S0229, compilation}s." => "the see compilation: S0229."
+      --  Emacs info-mode suppresses the ': S0229', but not the 'see'
+      --  and the trailing '.'. So we just output the text.
+      Ordinary_Text (Output_Object, Text);
+   end Local_Link;
+
+   procedure Local_Link_End
+     (Output_Object : in out Texinfo_Output_Type;
+      Target        : in     String;
+      Clause_Number : in     String)
+   is begin
+      --  These work better than local links, because they are not in
+      --  the middle of plurals. First use is section 3.1 (1).
+      Put (Output_Object.File, " (@pxref{" & Target & "," & Clause_Number & "})");
+   end Local_Link_End;
+
+   procedure Local_Link_Start
+     (Output_Object : in out Texinfo_Output_Type;
+      Target        : in     String;
+      Clause_Number : in     String)
+   is
+      pragma Unreferenced (Output_Object);
+      pragma Unreferenced (Target);
+      pragma Unreferenced (Clause_Number);
+   begin
+      --  implemented in Local_Link_End
+      null;
+   end Local_Link_Start;
+
+   procedure Local_Target
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      Target        : in     String)
+   is begin
+      Put (Output_Object.File, "@anchor{" & Target & "}");
+      Ordinary_Text (Output_Object, Text);
+   end Local_Target;
+
+   procedure New_Column (Output_Object : in out Texinfo_Output_Type)
+   is begin
+      if Output_Object.Column_Count >= 4 then
+         Output_Object.Current_Column := Output_Object.Current_Column + 1;
+         Output_Object.Current_Row    := 1;
+      end if;
+   end New_Column;
+
+   procedure New_Page
+     (Output_Object : in out Texinfo_Output_Type;
+      Kind          :        ARM_Output.Page_Kind_Type := ARM_Output.Any_Page)
+   is
+      pragma Unreferenced (Kind);
+      pragma Unreferenced (Output_Object);
+   begin
+      --  No such thing in Info.
+      null;
+   end New_Page;
+
+   procedure Ordinary_Character
+     (Output_Object : in out Texinfo_Output_Type;
+      Char          : in     Character)
+   is
+      Copyright : constant String := "Copyright";
+   begin
+      case Output_Object.State is
+      when Contents =>
+         null;
+
+      when Multi_Column | Table_Header =>
+         Add_To_Column_Item (Output_Object, "" & Char);
+
+      when Title =>
+         --  Check for end of title page; indicated by line starting with "Copyright"
+         if Output_Object.Line_Empty then
+            if Output_Object.First_Word_Last > 0 then
+               if Copyright (Output_Object.First_Word_Last + 1) = Char then
+                  Output_Object.First_Word_Last := Output_Object.First_Word_Last + 1;
+                  Output_Object.First_Word (Output_Object.First_Word_Last) := Char;
+
+                  if Output_Object.First_Word_Last = Copyright'Last then
+                     End_Title_Page (Output_Object);
+                     Output_Object.State := Normal;
+                     Ordinary_Text (Output_Object, Output_Object.First_Word (1 .. Output_Object.First_Word_Last));
+                  end if;
+               else
+                  --  First word is not Copyright; output it
+                  Ordinary_Text (Output_Object, Output_Object.First_Word (1 .. Output_Object.First_Word_Last));
+                  Output_Object.Line_Empty := False;
+               end if;
+            else
+               --  No non-space seen yet
+               if Char = ' ' then
+                  null;
+               elsif Char = Copyright (1) then
+                  Output_Object.First_Word_Last := 1;
+                  Output_Object.First_Word (1)  := Char;
+               else
+                  Escape_Put (Output_Object, Char);
+                  Output_Object.Line_Empty := False;
+               end if;
+            end if;
+         else
+            --  Line already has stuff on it
+            Escape_Put (Output_Object, Char);
+         end if;
+
+      when Normal =>
+         Output_Object.Line_Empty := Char /= ' ';
+
+         Escape_Put (Output_Object, Char);
+
+      when Index_Start =>
+         Escape_Put (Output_Object, Char);
+         if Char = '&' then
+            --  give debugger a place to break
+            Put_Line ("first index entry");
+         end if;
+
+      when Index =>
+         case Char is
+         when ' ' | ',' | '[' | ']' =>
+            Put (Output_Object.File, Char);
+
+         when 'A' .. Last_Index_Clause =>
+            --  Index section heading
+
+            --  @node current, next, prev, up
+            case Char is
+            when 'A' =>
+               Put_Line
+                 (Output_Object.File,
+                  "@node " & Char &
+                    ", B, " & Operators_Clause &
+                    ", " & Index_Clause_Name);
+
+            when Last_Index_Clause =>
+               Put_Line
+                 (Output_Object.File,
+                  "@node " & Char &
+                    ", , " & Character'Pred (Char) &
+                    ", " & Index_Clause_Name);
+
+            when others =>
+               Put_Line
+                 (Output_Object.File,
+                  "@node " & Char &
+                    ", " & Character'Succ (Char) &
+                    ", " & Character'Pred (Char) &
+                    ", " & Index_Clause_Name);
+            end case;
+
+            --  Add non-break space so Emacs info will use big bold
+            --  font for single letter titles.
+            Put_Line (Output_Object.File, "@section " & Char & "@w{ }");
+
+         when others =>
+            Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Unexpected char in Index: " & Char);
+         end case;
+      end case;
+   end Ordinary_Character;
+
+   procedure Ordinary_Text
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String)
+   is begin
+      case Output_Object.State is
+      when Contents =>
+         null;
+
+      when Multi_Column | Table_Header =>
+         Add_To_Column_Item (Output_Object, Text);
+
+      when Normal | Title | Index_Start | Index =>
+         Output_Object.Line_Empty := False;
+
+         Escape_Put (Output_Object, Text);
+      end case;
+   end Ordinary_Text;
+
+   procedure Picture
+     (Output_Object : in out Texinfo_Output_Type;
+      Name          : in     String;
+      Descr         : in     String;
+      Alignment     : in     ARM_Output.Picture_Alignment;
+      Height, Width : in     Natural;
+      Border        : in     ARM_Output.Border_Kind)
+   is
+      pragma Unreferenced (Border);
+      pragma Unreferenced (Width);
+      pragma Unreferenced (Height);
+      pragma Unreferenced (Alignment);
+      pragma Unreferenced (Name);
+   begin
+      Put_Line (Output_Object.File, "FIXME: Picture: " & Descr);
+   end Picture;
+
+   procedure Revised_Clause_Header
+     (Output_Object   : in out Texinfo_Output_Type;
+      New_Header_Text : in     String;
+      Old_Header_Text : in     String;
+      Level           : in     ARM_Contents.Level_Type;
+      Clause_Number   : in     String;
+      Version         : in     ARM_Contents.Change_Version_Type;
+      No_Page_Break   : in     Boolean                          := False)
+   is
+      pragma Unreferenced (Version);
+      pragma Unreferenced (Old_Header_Text);
+   begin
+      Clause_Header (Output_Object, New_Header_Text, Level, Clause_Number, No_Page_Break);
+   end Revised_Clause_Header;
+
+   procedure Section
+     (Output_Object : in out Texinfo_Output_Type;
+      Section_Title : in     String;
+      Section_Name  : in     String)
+   is
+      pragma Unreferenced (Section_Name);
+      pragma Unreferenced (Section_Title);
+      pragma Unreferenced (Output_Object);
+   begin
+      --  This is redundant with the various Clause functions
+      null;
+   end Section;
+
+   procedure Separator_Line
+     (Output_Object : in out Texinfo_Output_Type;
+      Is_Thin       :        Boolean             := True)
+   is begin
+      --  Can't be in a multi-column setting.
+      New_Line (Output_Object.File);
+      if Is_Thin then
+         Put_Line (Output_Object.File, "----------");
+      else
+         Put_Line (Output_Object.File, "==========");
+      end if;
+   end Separator_Line;
+
+   procedure Set_Columns
+     (Output_Object     : in out Texinfo_Output_Type;
+      Number_of_Columns : in     ARM_Output.Column_Count)
+   is begin
+      Check_Valid (Output_Object);
+      Check_Not_In_Paragraph (Output_Object);
+
+      --  2 and 3 column formats are displayed without any columns.
+      --  This is mainly used for the syntax cross-reference and
+      --  index, and these definitely look better without columns.
+      --
+      --  4 or more columns are output as a table. Note that we assume
+      --  such items are formated with explicit New_Column calls, and
+      --  do not contain any nested paragraph formats.
+
+      case Output_Object.State is
+      when Normal =>
+         if Number_of_Columns >= 4 then
+            Output_Object.State          := Multi_Column;
+            Output_Object.Current_Column := 1;
+            Output_Object.Current_Row    := 1;
+            Output_Object.Column_Widths  := (others => 0);
+
+            --  Accumulate all column rows in Output_Text, then output
+            --  when done, so we can set the correct column width in
+            --  the header. Each column is a linked list of allocated
+            --  Column_Text_Item_Type.
+         else
+            null;
+         end if;
+
+      when Multi_Column =>
+         if Number_of_Columns = 1 then
+            --  Finished accumulating columns, output the columns as a table.
+            Output_Column_Widths (Output_Object);
+            Output_Columns (Output_Object);
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end multitable");
+            New_Line (Output_Object.File);
+
+            Output_Object.State := Normal;
+         else
+            Ada.Exceptions.Raise_Exception
+              (ARM_Output.Not_Valid_Error'Identity, "New multi-column section before end of old");
+         end if;
+
+      when Index_Start | Index =>
+         null;
+
+      when Table_Header | Contents | Title =>
+         Unexpected_State (Output_Object);
+      end case;
+
+      Output_Object.Column_Count := Number_of_Columns;
+   end Set_Columns;
+
+   procedure Soft_Hyphen_Break (Output_Object : in out Texinfo_Output_Type)
+   is begin
+      Put (Output_Object.File, "@-");
+   end Soft_Hyphen_Break;
+
+   procedure Soft_Line_Break (Output_Object : in out Texinfo_Output_Type)
+   is begin
+      case Output_Object.State is
+      when Contents | Title =>
+         null;
+
+      when Normal | Index_Start | Index =>
+         Put (Output_Object.File, "@-");
+
+      when Multi_Column | Table_Header =>
+         Unexpected_State (Output_Object);
+
+      end case;
+   end Soft_Line_Break;
+
+   procedure Special_Character
+     (Output_Object : in out Texinfo_Output_Type;
+      Char          : in     ARM_Output.Special_Character_Type)
+   is begin
+      --  We use Ordinary_Text, so this is output to columns when appropriate.
+      case Char is
+      when ARM_Output.EM_Dash =>
+         Ordinary_Text (Output_Object, "--");
+      when ARM_Output.EN_Dash =>
+         Ordinary_Text (Output_Object, "--");
+      when ARM_Output.GEQ =>
+         Ordinary_Text (Output_Object, ">=");
+      when ARM_Output.LEQ =>
+         Ordinary_Text (Output_Object, "<=");
+      when ARM_Output.NEQ =>
+         Ordinary_Text (Output_Object, "/=");
+      when ARM_Output.PI =>
+         Ordinary_Text (Output_Object, "PI");
+
+      when ARM_Output.Left_Ceiling =>
+         case Output_Object.State is
+         when Multi_Column | Table_Header =>
+            Ada.Exceptions.Raise_Exception
+              (ARM_Output.Not_Valid_Error'Identity,
+               "Info does not support ceiling in multi-column");
+         when Contents =>
+            null;
+
+         when Normal | Index_Start | Index =>
+            Put (Output_Object.File, "@code{ceiling(");
+
+         when Title =>
+            Unexpected_State (Output_Object);
+
+         end case;
+
+      when ARM_Output.Right_Ceiling =>
+         case Output_Object.State is
+         when Multi_Column | Table_Header =>
+            Ada.Exceptions.Raise_Exception
+              (ARM_Output.Not_Valid_Error'Identity,
+               "Info does not support ceiling in multi-column");
+         when Contents =>
+            null;
+
+         when Normal | Index_Start | Index =>
+            Put (Output_Object.File, ")}");
+
+         when Title =>
+            Unexpected_State (Output_Object);
+
+         end case;
+
+      when ARM_Output.Left_Floor =>
+         case Output_Object.State is
+         when Multi_Column | Table_Header =>
+            Ada.Exceptions.Raise_Exception
+              (ARM_Output.Not_Valid_Error'Identity,
+               "Info does not support floor in multi-column");
+         when Contents =>
+            null;
+
+         when Normal | Index_Start | Index =>
+            Put (Output_Object.File, "@code{floor(");
+
+         when Title =>
+            Unexpected_State (Output_Object);
+
+         end case;
+
+      when ARM_Output.Right_Floor =>
+         case Output_Object.State is
+         when Multi_Column | Table_Header =>
+            Ada.Exceptions.Raise_Exception
+              (ARM_Output.Not_Valid_Error'Identity,
+               "Info does not support floor in multi-column");
+         when Contents =>
+            null;
+
+         when Normal | Index_Start | Index =>
+            Put (Output_Object.File, ")}");
+
+         when Title =>
+            Unexpected_State (Output_Object);
+
+         end case;
+
+      when ARM_Output.Thin_Space =>
+         Ordinary_Text (Output_Object, " ");
+
+      when ARM_Output.Left_Quote =>
+         Ordinary_Text (Output_Object, "`");
+
+      when ARM_Output.Right_Quote =>
+         Ordinary_Text (Output_Object, "'");
+
+      when ARM_Output.Left_Double_Quote =>
+         Ordinary_Text (Output_Object, """");
+
+      when ARM_Output.Right_Double_Quote =>
+         Ordinary_Text (Output_Object, """");
+
+      when ARM_Output.Small_Dotless_I =>
+         Ordinary_Text (Output_Object, "i");
+
+      when ARM_Output.Capital_Dotted_I =>
+         Ordinary_Text (Output_Object, "I");
+      end case;
+   end Special_Character;
+
+   procedure Start_Paragraph
+     (Output_Object  : in out Texinfo_Output_Type;
+      Format         : in     ARM_Output.Paragraph_Type;
+      Number         : in     String;
+      No_Prefix      : in     Boolean                       := False;
+      Tab_Stops      : in     ARM_Output.Tab_Info           := ARM_Output.NO_TABS;
+      No_Breaks      : in     Boolean                       := False;
+      Keep_with_Next : in     Boolean                       := False;
+      Space_After    : in     ARM_Output.Space_After_Type   := ARM_Output.Normal;
+      Justification  : in     ARM_Output.Justification_Type := ARM_Output.Default)
+   is
+      pragma Unreferenced (Justification);
+      pragma Unreferenced (Space_After);
+      pragma Unreferenced (Keep_with_Next);
+      pragma Unreferenced (No_Breaks);
+      pragma Unreferenced (Tab_Stops);
+
+      use ARM_Output;
+
+   begin
+      Check_Valid (Output_Object);
+      Check_Not_In_Paragraph (Output_Object);
+
+      --  Note: makeinfo will do most of the formatting, so No_Breaks,
+      --  Keep_with_Next, Space_After, and Justification have no
+      --  effect here. In addition, info format has no support for
+      --  fonts, so the font aspects of Format is ignored as well. But
+      --  we try to respect the indentation and margin aspects.
+
+      --  TexInfo does not directly support tabs, but does use a fixed
+      --  font, so we could emulate them. But then we'd have to track
+      --  output characters; let's see if we really need it.
+
+      case Output_Object.State is
+      when Contents =>
+         null;
+
+      when Normal =>
+         if Number'Length > 0 then
+            Put_Line (Output_Object.File, Number & " @*");
+         end if;
+
+         Output_Object.In_Paragraph     := True;
+         Output_Object.Paragraph_Format := Format;
+
+         case Format is
+         when
+           Swiss_Examples | Small_Swiss_Examples |
+           Swiss_Indented_Examples | Small_Swiss_Indented_Examples |
+           Small_Syntax_Indented |
+           Small_Nested_X2_Bulleted |
+           Small_Inner_Indented =>
+            Put_Line (Output_Object.File, "FIXME: Start_Paragraph " & ARM_Output.Paragraph_Type'Image (Format));
+
+         when Normal |
+           Wide |
+           Index =>
+
+            null;
+
+         when Notes |
+           Syntax_Summary |
+           Syntax_Indented =>
+
+            Put_Line (Output_Object.File, "@quotation");
+
+         when Annotations |
+           Wide_Annotations |
+           Code_Indented |
+           Small_Code_Indented |
+           Indented |
+           Inner_Indented |
+           Small_Indented =>
+
+            Put_Line (Output_Object.File, "@quotation");
+            Put_Line (Output_Object.File, "@quotation");
+
+         when Examples |
+           Small_Examples =>
+
+            Put_Line (Output_Object.File, "@example");
+
+         when Indented_Examples |
+           Small_Indented_Examples =>
+
+            Put_Line (Output_Object.File, "@quotation");
+            Put_Line (Output_Object.File, "@example");
+
+         when Notes_Header =>
+            Put
+              (Output_Object.File,
+               "@w{" &
+                 String'(1 .. Indentation => ' ') &
+                 "}");
+
+         when Bulleted |
+           Small_Bulleted =>
+
+            Put_Line (Output_Object.File, "@itemize @bullet");
+            if not No_Prefix then
+               Put (Output_Object.File, "@item ");
+            end if;
+
+         when Nested_Bulleted |
+           Small_Nested_Bulleted =>
+
+            Put_Line (Output_Object.File, "@itemize @bullet");
+            Put_Line (Output_Object.File, "@itemize @bullet");
+            if not No_Prefix then
+               Put (Output_Object.File, "@item ");
+            end if;
+
+         when Nested_X2_Bulleted =>
+            Put_Line (Output_Object.File, "@itemize @bullet");
+            Put_Line (Output_Object.File, "@itemize @bullet");
+            Put_Line (Output_Object.File, "@itemize @bullet");
+            if not No_Prefix then
+               Put (Output_Object.File, "@item ");
+            end if;
+
+         when Indented_Bulleted |
+           Code_Indented_Bulleted |
+           Notes_Bulleted =>
+
+            Put_Line (Output_Object.File, "@quotation");
+            Put_Line (Output_Object.File, "@itemize @bullet");
+            if not No_Prefix then
+               Put (Output_Object.File, "@item ");
+            end if;
+
+         when Code_Indented_Nested_Bulleted |
+           Indented_Nested_Bulleted |
+           Notes_Nested_Bulleted =>
+
+            Put_Line (Output_Object.File, "@quotation");
+            Put_Line (Output_Object.File, "@itemize @bullet");
+            Put_Line (Output_Object.File, "@itemize @bullet");
+            if not No_Prefix then
+               Put (Output_Object.File, "@item ");
+            end if;
+
+         when Syntax_Indented_Bulleted =>
+
+            Put_Line (Output_Object.File, "@quotation");
+            Put_Line (Output_Object.File, "@itemize @bullet");
+            if not No_Prefix then
+               Put (Output_Object.File, "@item ");
+            end if;
+
+         when Hanging |
+           Small_Hanging |
+           Indented_Hanging |
+           Small_Indented_Hanging |
+           Hanging_in_Bulleted |
+           Small_Hanging_in_Bulleted =>
+
+            if No_Prefix then
+               --  Still in hanging part
+               Put_Line (Output_Object.File, "@quotation");
+               Output_Object.End_Hang_Seen := True;
+            else
+               Output_Object.End_Hang_Seen := False;
+            end if;
+
+         when Enumerated |
+           Small_Enumerated |
+           Nested_Enumerated |
+           Small_Nested_Enumerated =>
+
+            Put_Line (Output_Object.File, "@itemize @w{}");
+            Put (Output_Object.File, "@item ");
+
+         end case;
+
+      when Index_Start | Index | Title | Multi_Column | Table_Header =>
+         if Number'Length > 0 then
+            Unexpected_State (Output_Object);
+         end if;
+
+         Output_Object.In_Paragraph     := True;
+         Output_Object.Paragraph_Format := Format;
+
+      end case;
+
+   end Start_Paragraph;
+
+   procedure Start_Table
+     (Output_Object      : in out Texinfo_Output_Type;
+      Columns            : in     ARM_Output.Column_Count;
+      First_Column_Width : in     ARM_Output.Column_Count;
+      Last_Column_Width  : in     ARM_Output.Column_Count;
+      Alignment          : in     ARM_Output.Column_Text_Alignment;
+      No_Page_Break      : in     Boolean;
+      Has_Border         : in     Boolean;
+      Small_Text_Size    : in     Boolean;
+      Header_Kind        : in     ARM_Output.Header_Kind_Type)
+   is
+      pragma Unreferenced (Small_Text_Size);
+      pragma Unreferenced (Has_Border);
+      pragma Unreferenced (No_Page_Break);
+      pragma Unreferenced (Alignment);
+      pragma Unreferenced (Last_Column_Width);
+      pragma Unreferenced (First_Column_Width);
+      use ARM_Output;
+   begin
+      Output_Object.Column_Count := Columns;
+      case Header_Kind is
+      when Both_Caption_and_Header =>
+         New_Line (Output_Object.File);
+         --  Next text output will be the caption, which we don't
+         --  format in any special way (first example is F.3.2 (19)).
+         --  Then Table_Marker (End_Caption) is called, which will
+         --  start the actual table.
+
+      when Header_Only =>
+         --  Same as Table_Marker, End_Caption.
+         case Columns is
+         when 1 =>
+            Ada.Exceptions.Raise_Exception
+              (ARM_Output.Not_Valid_Error'Identity,
+               "Table with 1 column");
+
+         when 2 =>
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@table @asis");
+
+         when others =>
+            New_Line (Output_Object.File);
+            Put (Output_Object.File, "@multitable");
+            Output_Object.State          := Table_Header;
+            Output_Object.Current_Column := 1;
+            Output_Object.Current_Row    := 1;
+            Output_Object.Max_Row        := 0;
+            --  The next text output via Ordinary_Text or
+            --  Ordinary_Character is the table headers. We
+            --  capture them in Output_Object.Column_Text, and
+            --  use them to set the table column widths.
+         end case;
+
+      when No_Headers =>
+         null;
+
+      end case;
+   end Start_Table;
+
+   procedure Tab (Output_Object : in out Texinfo_Output_Type)
+   is begin
+      case Output_Object.State is
+      when Contents =>
+         null;
+
+      when Multi_Column | Table_Header =>
+         Ada.Exceptions.Raise_Exception
+           (ARM_Output.Not_Valid_Error'Identity,
+            "Tab in multi-column");
+
+      when Title =>
+         if Output_Object.Line_Empty then
+            null;
+         else
+            Put (Output_Object.File, "@w{ }");
+         end if;
+
+      when Normal | Index_Start | Index =>
+         --  Just three spaces for now, for indented trees
+         Put (Output_Object.File, "@w{   }");
+
+      end case;
+   end Tab;
+
+   procedure Table_Marker
+     (Output_Object : in out Texinfo_Output_Type;
+      Marker        : in     ARM_Output.Table_Marker_Type)
+   is begin
+      case Marker is
+      when ARM_Output.End_Caption =>
+         --  Start the actual table
+         case Output_Object.Column_Count is
+         when 1 =>
+            Ada.Exceptions.Raise_Exception
+              (ARM_Output.Not_Valid_Error'Identity,
+               "Table with 1 column");
+
+         when 2 =>
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@table @asis");
+
+         when others =>
+            New_Line (Output_Object.File);
+            Put (Output_Object.File, "@multitable");
+            Output_Object.State          := Table_Header;
+            Output_Object.Current_Column := 1;
+            Output_Object.Current_Row    := 1;
+            Output_Object.Max_Row        := 0;
+            --  The next text output via Ordinary_Text or
+            --  Ordinary_Character is the table headers. We
+            --  capture them in Output_Object.Column_Text, and
+            --  use them to set the table column widths.
+         end case;
+
+      when ARM_Output.End_Item =>
+         case Output_Object.State is
+         when Table_Header =>
+            Output_Object.Current_Column := Output_Object.Current_Column + 1;
+            Output_Object.Current_Row    := 1;
+
+         when Normal =>
+            case Output_Object.Column_Count is
+            when 2 =>
+               --  using @table
+               Put (Output_Object.File, ' ');
+
+            when others =>
+               Put (Output_Object.File, " @tab ");
+            end case;
+
+         when Multi_Column | Contents | Title | Index_Start | Index =>
+            Unexpected_State (Output_Object);
+         end case;
+
+      when ARM_Output.End_Header =>
+         case Output_Object.State is
+         when Table_Header =>
+            Output_Object.State := Normal;
+
+            for I in 1 .. Output_Object.Column_Count loop
+               Put
+                 (Output_Object.File,
+                  " {" &
+                    Output_Object.Column_Text (I).Text (1 .. Output_Object.Column_Text (I).Length) &
+                    "}");
+            end loop;
+
+            New_Line (Output_Object.File);
+
+            Put (Output_Object.File, "@item ");
+
+            Pad_Columns (Output_Object);
+            Output_Columns (Output_Object);
+            New_Line (Output_Object.File);
+            Put (Output_Object.File, "@item ");
+            Output_Object.Current_Column := 1;
+
+         when Normal =>
+            --  A two-column table; header has been output
+            null;
+
+         when Contents | Multi_Column | Title | Index_Start | Index =>
+            Unexpected_State (Output_Object);
+         end case;
+
+      when ARM_Output.End_Row | ARM_Output.End_Row_Next_Is_Last =>
+         New_Line (Output_Object.File);
+         Put (Output_Object.File, "@item ");
+         Output_Object.Current_Column := 1;
+
+      when ARM_Output.End_Table =>
+         case Output_Object.Column_Count is
+         when 2 =>
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end table");
+
+         when others =>
+            Put_Line (Output_Object.File, "@end multitable");
+
+         end case;
+
+      end case;
+   end Table_Marker;
+
+   procedure Text_Format
+     (Output_Object : in out Texinfo_Output_Type;
+      Bold          : in     Boolean;
+      Italic        : in     Boolean;
+      Font          : in     ARM_Output.Font_Family_Type;
+      Size          : in     ARM_Output.Size_Type;
+      Change        : in     ARM_Output.Change_Type;
+      Version       : in     ARM_Contents.Change_Version_Type := '0';
+      Added_Version : in     ARM_Contents.Change_Version_Type := '0';
+      Location      : in     ARM_Output.Location_Type)
+   is
+      pragma Unreferenced (Location);
+      pragma Unreferenced (Version);
+      pragma Unreferenced (Added_Version);
+      pragma Unreferenced (Change);
+      pragma Unreferenced (Size);
+      pragma Unreferenced (Font);
+      pragma Unreferenced (Italic);
+      pragma Unreferenced (Bold);
+      pragma Unreferenced (Output_Object);
+   begin
+      --  Info does not support formats; Emacs info-mode font-lock
+      --  does some, but doesn't need any help from here.
+      null;
+   end Text_Format;
+
+   procedure TOC_Marker
+     (Output_Object : in out Texinfo_Output_Type;
+      For_Start     : in     Boolean)
+   is begin
+      --  We use menus, not @contents (since makeinfo ignores
+      --  @contents in info mode). The menus (including the top menu)
+      --  are generated from data stored in ARM_Contents during the
+      --  scan pass.
+
+      if For_Start then
+         Output_Object.State := Contents;
+         --  Ignore futher output until For_Start = False.
+      else
+         Output_Object.State := Normal;
+      end if;
+   end TOC_Marker;
+
+   procedure Unicode_Character
+     (Output_Object : in out Texinfo_Output_Type;
+      Char          : in     ARM_Output.Unicode_Type)
+   is begin
+      --  Used in section 2.3 Identifiers examples, 2.5 character
+      --  literals examples, 2.6 string literals examples, 3.3.1
+      --  Object Declarations examples, 4.4 Expressions examples
+      Put_Line (Output_Object.File, "[Unicode" & ARM_Output.Unicode_Type'Image (Char) & "]");
+   end Unicode_Character;
+
+   procedure URL_Link
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      URL           : in     String)
+   is begin
+      Put (Output_Object.File, "@uref{" & URL & "," & Text & "}");
+   end URL_Link;
+
+end ARM_Texinfo;
============================================================
--- progs/arm_texinfo.ads	266d5c69e4795f81b1e609fc0ba0be883fbd96af
+++ progs/arm_texinfo.ads	266d5c69e4795f81b1e609fc0ba0be883fbd96af
@@ -0,0 +1,258 @@
+with Ada.Text_IO;
+with Ada.Unchecked_Deallocation;
+with ARM_Output;
+with ARM_Contents;
+package ARM_Texinfo is
+
+   --
+   --  Ada reference manual formatter.
+   --
+   --  This package defines the TEXINFO output object.
+   --  Output objects are responsible for implementing the details of
+   --  a particular format.
+   --
+   -- ---------------------------------------
+   --
+   --  Copyright (C) 2003, 2007 Stephen Leake.  All Rights Reserved.
+   --  E-Mail: stephen_leake@stephe-leake.org
+   --
+   --  This library is free software; you can redistribute it and/or
+   --  modify it under terms of the GNU General Public License as
+   --  published by the Free Software Foundation; either version 2, or (at
+   --  your option) any later version. This library is distributed in the
+   --  hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+   --  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+   --  PURPOSE. See the GNU General Public License for more details. You
+   --  should have received a copy of the GNU General Public License
+   --  distributed with this program; see file COPYING. If not, write to
+   --  the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+   --  MA 02111-1307, USA.
+   --
+   --  As a special exception, if other files instantiate generics from
+   --  this unit, or you link this unit with other files to produce an
+   --  executable, this  unit  does not  by itself cause  the resulting
+   --  executable to be covered by the GNU General Public License. This
+   --  exception does not however invalidate any other reasons why the
+   --  executable file  might be covered by the  GNU Public License.
+
+   type Texinfo_Output_Type is new ARM_Output.Output_Type with private;
+
+   not overriding procedure Create
+     (Output_Object : in out Texinfo_Output_Type;
+      File_Prefix   : in     String;
+      Title         : in     String);
+   --  Create an Output_Object for a document.
+
+   overriding procedure Close (Output_Object : in out Texinfo_Output_Type);
+
+   overriding procedure Section
+     (Output_Object : in out Texinfo_Output_Type;
+      Section_Title : in     String;
+      Section_Name  : in     String);
+
+   overriding procedure Set_Columns
+     (Output_Object     : in out Texinfo_Output_Type;
+      Number_of_Columns : in     ARM_Output.Column_Count);
+
+   overriding procedure Start_Paragraph
+     (Output_Object  : in out Texinfo_Output_Type;
+      Format         : in     ARM_Output.Paragraph_Type;
+      Number         : in     String;
+      No_Prefix      : in     Boolean                       := False;
+      Tab_Stops      : in     ARM_Output.Tab_Info           := ARM_Output.NO_TABS;
+      No_Breaks      : in     Boolean                       := False;
+      Keep_with_Next : in     Boolean                       := False;
+      Space_After    : in     ARM_Output.Space_After_Type   := ARM_Output.Normal;
+      Justification  : in     ARM_Output.Justification_Type := ARM_Output.Default);
+
+   overriding procedure End_Paragraph (Output_Object : in out Texinfo_Output_Type);
+
+   overriding procedure Category_Header
+     (Output_Object : in out Texinfo_Output_Type;
+      Header_Text   :        String);
+
+   overriding procedure Clause_Header
+     (Output_Object : in out Texinfo_Output_Type;
+      Header_Text   : in     String;
+      Level         : in     ARM_Contents.Level_Type;
+      Clause_Number : in     String;
+      No_Page_Break : in     Boolean                 := False);
+
+   overriding procedure Revised_Clause_Header
+     (Output_Object   : in out Texinfo_Output_Type;
+      New_Header_Text : in     String;
+      Old_Header_Text : in     String;
+      Level           : in     ARM_Contents.Level_Type;
+      Clause_Number   : in     String;
+      Version         : in     ARM_Contents.Change_Version_Type;
+      No_Page_Break   : in     Boolean                          := False);
+
+   overriding procedure TOC_Marker (Output_Object : in out Texinfo_Output_Type;
+                         For_Start : in Boolean);
+
+   overriding procedure New_Page (Output_Object : in out Texinfo_Output_Type;
+                       Kind : ARM_Output.Page_Kind_Type := ARM_Output.Any_Page);
+
+   overriding procedure New_Column (Output_Object : in out Texinfo_Output_Type);
+
+   overriding procedure Separator_Line (Output_Object : in out Texinfo_Output_Type;
+                             Is_Thin : Boolean := True);
+
+   overriding procedure Start_Table
+     (Output_Object      : in out Texinfo_Output_Type;
+      Columns            : in     ARM_Output.Column_Count;
+      First_Column_Width : in     ARM_Output.Column_Count;
+      Last_Column_Width  : in     ARM_Output.Column_Count;
+      Alignment          : in     ARM_Output.Column_Text_Alignment;
+      No_Page_Break      : in     Boolean;
+      Has_Border         : in     Boolean;
+      Small_Text_Size    : in     Boolean;
+      Header_Kind        : in     ARM_Output.Header_Kind_Type);
+
+   overriding procedure Table_Marker (Output_Object : in out Texinfo_Output_Type;
+                           Marker : in ARM_Output.Table_Marker_Type);
+
+   overriding procedure Ordinary_Text (Output_Object : in out Texinfo_Output_Type;
+                            Text : in String);
+
+   overriding procedure Ordinary_Character (Output_Object : in out Texinfo_Output_Type;
+                                 Char : in Character);
+
+   overriding procedure Hard_Space (Output_Object : in out Texinfo_Output_Type);
+
+   overriding procedure Line_Break (Output_Object : in out Texinfo_Output_Type);
+
+   overriding procedure Index_Line_Break (Output_Object : in out Texinfo_Output_Type;
+                               Clear_Keep_with_Next : in Boolean);
+
+   overriding procedure Soft_Line_Break (Output_Object : in out Texinfo_Output_Type);
+
+   overriding procedure Soft_Hyphen_Break (Output_Object : in out Texinfo_Output_Type);
+
+   overriding procedure Tab (Output_Object : in out Texinfo_Output_Type);
+
+   overriding procedure Special_Character
+     (Output_Object : in out Texinfo_Output_Type;
+      Char          : in     ARM_Output.Special_Character_Type);
+
+   overriding procedure Unicode_Character
+     (Output_Object : in out Texinfo_Output_Type;
+      Char          : in     ARM_Output.Unicode_Type);
+
+   overriding procedure End_Hang_Item (Output_Object : in out Texinfo_Output_Type);
+
+   overriding procedure Text_Format
+     (Output_Object : in out Texinfo_Output_Type;
+      Bold          : in     Boolean;
+      Italic        : in     Boolean;
+      Font          : in     ARM_Output.Font_Family_Type;
+      Size          : in     ARM_Output.Size_Type;
+      Change        : in     ARM_Output.Change_Type;
+      Version       : in     ARM_Contents.Change_Version_Type := '0';
+      Added_Version : in     ARM_Contents.Change_Version_Type := '0';
+      Location      : in     ARM_Output.Location_Type);
+
+   overriding procedure Clause_Reference (Output_Object : in out Texinfo_Output_Type;
+                               Text : in String;
+                               Clause_Number : in String);
+
+   overriding procedure Index_Target
+     (Output_Object : in out Texinfo_Output_Type;
+      Index_Key     : in     Natural);
+
+   overriding procedure Index_Reference
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      Index_Key     : in     Natural;
+      Clause_Number : in     String);
+
+   overriding procedure DR_Reference
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      DR_Number     : in     String);
+
+   overriding procedure AI_Reference
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      AI_Number     : in     String);
+
+   overriding procedure Local_Target
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      Target        : in     String);
+
+   overriding procedure Local_Link
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      Target        : in     String;
+      Clause_Number : in     String);
+
+   overriding procedure Local_Link_Start
+     (Output_Object : in out Texinfo_Output_Type;
+      Target        : in     String;
+      Clause_Number : in     String);
+
+   overriding procedure Local_Link_End
+     (Output_Object : in out Texinfo_Output_Type;
+      Target        : in     String;
+      Clause_Number : in     String);
+
+   overriding procedure URL_Link
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      URL           : in     String);
+
+   overriding procedure Picture
+     (Output_Object : in out Texinfo_Output_Type;
+      Name          : in     String;
+      Descr         : in     String;
+      Alignment     : in     ARM_Output.Picture_Alignment;
+      Height, Width : in     Natural;
+      Border        : in     ARM_Output.Border_Kind);
+
+private
+
+   subtype Column_Index_Type is Integer range 1 .. 5;
+   type Column_Text_Item_Type;
+   type Column_Text_Ptr is access Column_Text_Item_Type;
+   type Column_Text_Item_Type is record
+      Text     : String (1 .. 80);
+      Length   : Natural;
+      Row      : Natural; -- Which row in the column.
+      Next     : Column_Text_Ptr;
+   end record;
+   type Column_Text_Ptrs_Type is array (Column_Index_Type) of Column_Text_Ptr;
+   type Column_Widths_Type is array (Column_Index_Type) of Natural;
+
+   procedure Free is new Ada.Unchecked_Deallocation (Column_Text_Item_Type, Column_Text_Ptr);
+
+   type State_Type is (Title, Contents, Table_Header, Multi_Column, Normal, Index_Start, Index);
+
+   type Texinfo_Output_Type is new ARM_Output.Output_Type with record
+      File     : Ada.Text_IO.File_Type;
+      Is_Valid : Boolean := False;
+
+      State            : State_Type;
+      In_Paragraph     : Boolean := False; --  Sub-state within major states
+      Paragraph_Format : ARM_Output.Paragraph_Type;
+      End_Hang_Seen    : Boolean;
+
+      --  Detecting end of title page
+      Line_Empty      : Boolean := False; --  True if current line contains only whitespace.
+      First_Word      : String (1 .. 80);
+      First_Word_Last : Natural;
+
+      --  Building menus
+      Menu_Section : ARM_Contents.Section_Number_Type := 0;
+      Menu_Clause  : Natural := 0;
+
+      --  Table and Multi-Column format
+      Column_Count    : ARM_Output.Column_Count;
+      Current_Column  : Natural;
+      Current_Row     : Natural;
+      Column_Text     : Column_Text_Ptrs_Type := (others => null);
+      Column_Widths   : Column_Widths_Type;
+      Max_Row         : Natural;
+   end record;
+
+end ARM_Texinfo;
============================================================
--- progs/arm_cont.adb	6367999676bc6e64b7d6d11a401f1dac3fd1ca59
+++ progs/arm_cont.adb	d885d951af3ba9b6e41fd78e2001fcc74159a283
@@ -533,7 +533,34 @@ package body ARM_Contents is
 	raise Not_Found_Error;
     end Next_Clause;
 
+    function Parent_Clause (Clause : in String) return String is
+       Clause_Number : Clause_Number_Type;
+    begin
+	Make_Clause (Clause, Clause_Number);
 
+	if Clause_Number.Clause = 0 then
+	   -- Clause is a section; no parent
+	   return "";
+
+	elsif Clause_Number.Subclause = 0 then
+	   -- Clause is a clause; parent is Section or Annex
+	   if Clause_Number.Section >= ANNEX_START then
+	      return Make_Clause_Number (Normative_Annex, (Clause_Number.Section, 0, 0, 0));
+	   else
+	      return Make_Clause_Number (Section, (Clause_Number.Section, 0, 0, 0));
+	   end if;
+
+	elsif Clause_Number.Subsubclause = 0 then
+	   -- Clause is a subclause; clause is parent
+	   return Make_Clause_Number (ARM_Contents.Clause, (Clause_Number.Section, Clause_Number.Clause, 0, 0));
+
+	else
+	   -- Clause is a subsubclause; subclause is parent
+	   return Make_Clause_Number
+	     (Subclause, (Clause_Number.Section, Clause_Number.Clause, Clause_Number.Subclause, 0));
+	end if;
+    end Parent_Clause;
+
     procedure For_Each is
 	-- Call Operate for each title in the contents, in the order that
 	-- they were added to the contents. If the Quit parameter to Operate
============================================================
--- progs/arm_cont.ads	6596716ec97c15a811b342a248759697f3092b3a
+++ progs/arm_cont.ads	ef3ac4e688d6574b38ea3d32b4a5d015db130f15
@@ -62,7 +62,7 @@ package ARM_Contents is
 	-- Defines the change version. Version 0 is the original text.
 
     type Clause_Number_Type is record
-	Section : Section_Number_Type;
+	Section : Section_Number_Type := 0;
 	Clause : Natural := 0;
 	Subclause : Natural := 0;
 	Subsubclause : Natural := 0;
@@ -141,7 +141,15 @@ package ARM_Contents is
 	-- for the properly formatted clause string Clause.
 	-- Raises Not_Found_Error if not found.
 
-    function Next_Clause (Clause : in String) return String;
+   function Parent_Clause (Clause : in String) return String;
+        -- Returns the string of the parent clause (in the table of contents)
+        -- for the properly formatted clause string Clause.
+        --
+        -- Result is a null string if Clause is a top level clause;
+        -- Section, Unnumbered_Section, Normative_Annex,
+        -- Informative_Annex.
+
+   function Next_Clause (Clause : in String) return String;
 	-- Returns the string of the next clause (in the table of contents)
 	-- for the properly formatted clause string Clause.
 	-- Raises Not_Found_Error if not found.
============================================================
--- progs/arm_corr.adb	8c3c083def7c6c54d5ba24fd601e369af7c715dc
+++ progs/arm_corr.adb	6bacc4dc096dfb9f3fa2f901f2e9d35015356083
@@ -1,9 +1,6 @@
-with ARM_Output,
-     ARM_Contents,
-     Ada.Text_IO,
-     Ada.Exceptions,
-     Ada.Strings.Fixed,
-     Ada.Strings.Maps;
+with Ada.Exceptions;
+with Ada.Strings.Fixed;
+with Ada.Strings.Maps;
 package body ARM_Corr is
 
     --
@@ -120,7 +117,7 @@ package body ARM_Corr is
         end if;
         -- Create a new file for this section:
         Ada.Text_IO.Create (Output_Object.Output_File, Ada.Text_IO.Out_File,
-            ".\Output\" & Ada.Strings.Fixed.Trim (Output_Object.File_Prefix, Ada.Strings.Right) &
+            "Output/" & Ada.Strings.Fixed.Trim (Output_Object.File_Prefix, Ada.Strings.Right) &
                 "-Corr-" & Section_Name & ".TXT");
         Ada.Text_IO.New_Line (Output_Object.Output_File);
     end Section;
============================================================
--- progs/arm_db.adb	f5f60a07051b87c049b0ecbd6462b6e9bfac38c3
+++ progs/arm_db.adb	1d603365d5bb465bbb1cab92bf04dfa4fe64a7d1
@@ -1,4 +1,3 @@
-with Ada.Text_IO; -- Debug.
 with Ada.Unchecked_Deallocation,
      Ada.Strings.Fixed,
      Ada.Characters.Handling;
============================================================
--- progs/arm_file.adb	c2bc065c1412b42d956a113825f463016e816550
+++ progs/arm_file.adb	d2bfec6ddb79bb63fad90a1a6559681ecbd3bb96
@@ -1,5 +1,3 @@
-with ARM_Input,
-     Ada.Text_IO;
 package body ARM_File is
 
     --
============================================================
--- progs/arm_form.ada	b16d9b40ec87e171d579ffe166f2a9acfe2ade44
+++ progs/arm_form.ada	c00aa04da68cb1b2c21f07bbec593cca5debec1c
@@ -4,11 +4,6 @@ with ARM_Format,
      Ada.Characters.Handling,
      Ada.Command_Line;
 with ARM_Format,
-     ARM_Output,
-     ARM_Text,
-     ARM_HTML,
-     ARM_RTF,
-     ARM_Corr,
      ARM_Master,
      ARM_Contents;
 procedure ARM_Formatter is
@@ -114,7 +109,6 @@ procedure ARM_Formatter is
     Master_File : Ada.Strings.Unbounded.Unbounded_String; -- Master file for document to generate.
     Change_Kind : ARM_Format.Change_Kind; -- Changes to generate.
     Change_Version : ARM_Contents.Change_Version_Type; -- Change version.
-    Display_Index_Entries : Boolean; -- Should Index entries be displayed?
 
     procedure Get_Commands is
 	-- Process the command line for this program.
============================================================
--- progs/arm_frm.adb	88a1527623f1c61882521ef8eebbf1f50200f291
+++ progs/arm_frm.adb	81a0a13966fdbca428831a7c17c7ef957cd77654
@@ -1,15 +1,10 @@
-with ARM_Output,
-     ARM_Input,
-     ARM_File,
-     ARM_String,
-     ARM_Contents,
-     ARM_Database,
-     ARM_Syntax,
-     ARM_Index,
-     ARM_Subindex,
-     Ada.Text_IO,
-     Ada.Characters.Handling,
-     Ada.Strings.Fixed;
+with ARM_File;
+with ARM_String;
+with ARM_Syntax;
+with ARM_Index;
+with Ada.Text_IO;
+with Ada.Characters.Handling;
+with Ada.Strings.Fixed;
 package body ARM_Format is
 
     --
@@ -2920,7 +2915,7 @@ Ada.Text_IO.Put_Line ("%% No indentation
 			-- Nothing at all should be showm.
 			-- ** Warning ** If we lie here, the program will crash!
 		        Format_Object.No_Start_Paragraph := True;
-Ada.Text_IO.Put_Line("    -- No Start Paragraph (DelNoMsg)");
+--  Ada.Text_IO.Put_Line("    -- No Start Paragraph (DelNoMsg)");
 		    else
 		        ARM_Output.Start_Paragraph (Output_Object,
 					            Format => Format_Object.Format,
@@ -3245,16 +3240,16 @@ Ada.Text_IO.Put_Line("    -- No Start Pa
 		if Tabs.Stops(Tabs.Number).Stop = 0 then
 		    Tabs.Number := Tabs.Number - 1;
 		    Ada.Text_IO.Put_Line ("  ** Bad tab stop format, position" & Natural'Image(Loc) &
-			" in [" & Stops(1..Stops'Length) & "] from line " &
-		        ARM_Input.Line_String (Input_Object));
+			" in [" & Stops(Stops'First..Stops'Last) & "] from line " &
+			ARM_Input.Line_String (Input_Object));
 		    exit; -- Give up on this tabset.
 		elsif Tabs.Number < 1 and then
 			Tabs.Stops(Tabs.Number-1).Stop >=
 			Tabs.Stops(Tabs.Number).Stop then
 		    Tabs.Number := Tabs.Number - 1;
 		    Ada.Text_IO.Put_Line ("  ** Bad tab stop, less than previous, at position" & Natural'Image(Loc) &
-			" in [" & Stops(1..Stops'Length) & "] from line " &
-		        ARM_Input.Line_String (Input_Object));
+			" in [" & Stops(Stops'First..Stops'Last) & "] from line " &
+			ARM_Input.Line_String (Input_Object));
 		    exit; -- Give up on this tabset.
 		end if;
 		if Loc > Stops'Length then
@@ -3262,10 +3257,10 @@ Ada.Text_IO.Put_Line("    -- No Start Pa
 		elsif Stops(Loc) = ',' then
 		    Loc := Loc + 1;
 		    if Loc > Stops'Length then
-		        Ada.Text_IO.Put_Line ("  ** Bad tab stop set format, ends with comma in [" &
-			    Stops(1..Stops'Length) & "] from line " &
-		            ARM_Input.Line_String (Input_Object));
-		        exit; -- Give up on this tabset.
+			Ada.Text_IO.Put_Line (ASCII.HT & " ** Bad tab stop set format, ends with comma in [" &
+			    Stops(Stops'First..Stops'Last) & "] from line " &
+			    ARM_Input.Line_String (Input_Object));
+			exit; -- Give up on this tabset.
 		    end if;
 	        end if;
 		-- Skip any blanks in between.
@@ -8079,8 +8074,8 @@ Ada.Text_IO.Put_Line("    -- No Start Pa
 		    -- conditionally handle paragraph formatting (which
 		    -- otherwise would come too late).
 		    declare
-		        Which_Param : ARM_Input.Param_Num;
-		        Ch, Close_Ch : Character;
+			Which_Param : ARM_Input.Param_Num;
+			Close_Ch : Character;
 
 			NoPrefix, Noparanum, Keepnext : Boolean := False;
 			Space_After : ARM_Output.Space_After_Type := ARM_Output.Normal;
============================================================
--- progs/arm_frm.ads	e0e0bfa9ae14b868d1fb6af5d0cb3ca0bf4978cc
+++ progs/arm_frm.ads	37ae4d5c73239c0cab701e63d1f22775a11bfc44
@@ -295,8 +295,8 @@ private
         Font : ARM_Output.Font_Family_Type; -- What is the current font family?
         Size : ARM_Output.Size_Type; -- What is the current font size?
         Change : ARM_Output.Change_Type; -- What is the current kind of change?
-        Current_Change_Version : ARM_Contents.Change_Version_Type; -- What is the current version of change?
-        Current_Old_Change_Version : ARM_Contents.Change_Version_Type; -- What is the current old version of change? (Only used if Change is Both).
+	Current_Change_Version : ARM_Contents.Change_Version_Type := '0'; -- What is the current version of change?
+	Current_Old_Change_Version : ARM_Contents.Change_Version_Type := '0'; -- What is the current old version of change? (Only used if Change is Both).
         Location : ARM_Output.Location_Type; -- What is the current (vertical) location?
         Format : ARM_Output.Paragraph_Type; -- What is the current paragraph type?
         In_Paragraph : Boolean; -- Are we currently in a paragraph?
@@ -356,7 +356,7 @@ private
         Glossary_Term_Len : Natural := 0; -- processing [Chg]ToGlossary[Also] commands.
         Glossary_Change_Kind : ARM_Database.Paragraph_Change_Kind_Type;
                         -- The change kind of the ToGlossary.
-        Glossary_Version : ARM_Contents.Change_Version_Type;
+        Glossary_Version : ARM_Contents.Change_Version_Type := '0';
                         -- If the kind is not "None", this is the version
                         -- number of the changed paragraph.
         Add_to_Glossary : Boolean;
============================================================
--- progs/arm_html.adb	f7485cae94631499305b48e073365eaf9a79bec1
+++ progs/arm_html.adb	e2c8043f3f7cc70a7995d79701ac030ed4af6ee1
@@ -1,10 +1,7 @@
-with ARM_Output,
-     ARM_Contents,
-     Ada.Text_IO,
-     Ada.Exceptions,
-     Ada.Strings.Maps.Constants,
-     Ada.Strings.Fixed,
-     Ada.Unchecked_Deallocation;
+with Ada.Exceptions;
+with Ada.Strings.Maps.Constants;
+with Ada.Strings.Fixed;
+with Ada.Unchecked_Deallocation;
 package body ARM_HTML is
 
     --
@@ -1329,11 +1326,11 @@ package body ARM_HTML is
     begin
         if Output_Object.HTML_Kind > HTML_3 then
             Ada.Text_IO.Create (Output_Object.Output_File, Ada.Text_IO.Out_File,
-                ".\Output\" & File_Name & ".$$$");
+                "Output/" & File_Name & ".$$$");
 --Ada.Text_IO.Put_Line ("--Creating " & File_Name & ".html");
         else
             Ada.Text_IO.Create (Output_Object.Output_File, Ada.Text_IO.Out_File,
-                ".\Output\" & File_Name & ".html");
+                "Output/" & File_Name & ".html");
         end if;
         -- Save the current clause:
         Output_Object.Current_Clause :=
============================================================
--- progs/arm_indx.adb	85d524ffcd0687f48142f51f0568b4f187cde0f4
+++ progs/arm_indx.adb	4d4895df38d72351deed15d7549ea31d95376788
@@ -1,11 +1,10 @@
-with ARM_Output,
-     ARM_Contents,
-     Ada.Exceptions,
-     Ada.Characters.Handling,
-     Ada.Strings.Fixed,
-     Ada.Text_IO,
-     Ada.Calendar,
-     Ada.Unchecked_Deallocation;
+with ARM_Contents;
+with Ada.Exceptions;
+with Ada.Characters.Handling;
+with Ada.Strings.Fixed;
+with Ada.Text_IO;
+with Ada.Calendar;
+with Ada.Unchecked_Deallocation;
 package body ARM_Index is
 
     --
============================================================
--- progs/arm_mast.adb	bf1cc6c25a197650141a6c295fffe9bbb2fcccd9
+++ progs/arm_mast.adb	f07fb577134c87b82d27244f684fc01f34f075f3
@@ -1,17 +1,15 @@
-with Ada.Text_IO,
-     Ada.Characters.Handling,
-     Ada.Strings.Fixed,
-     Ada.Strings.Unbounded;
-with ARM_Input,
-     ARM_File,
-     ARM_Format,
-     ARM_Output,
-     ARM_Text,
-     ARM_HTML,
-     ARM_RTF,
-     ARM_Corr,
-     ARM_Master,
-     ARM_Contents;
+with Ada.Text_IO;
+with Ada.Characters.Handling;
+with Ada.Strings.Fixed;
+with Ada.Strings.Unbounded;
+with ARM_Input;
+with ARM_File;
+with ARM_Output;
+with ARM_TexInfo;
+with ARM_Text;
+with ARM_HTML;
+with ARM_RTF;
+with ARM_Corr;
 package body ARM_Master is
 
     --
@@ -297,7 +295,6 @@ package body ARM_Master is
 
 	    function Get_Single_String return String is
 		-- Returns the (single) parameter of a command.
-		Ch : Character;
 	        Item : String(1..2000);
 	        ILen : Natural := 0;
 	    begin
@@ -1284,14 +1281,16 @@ package body ARM_Master is
 		    ARM_Corr.Close (Output);
 	        end;
 	    when Info =>
-	        null; -- Future use.
-	        --declare
-	        --	Output : ARM_Info.Info_Output_Type;
-	        --begin
-		--      Create (Output, Use_Large_Files => False); -- The latter is not used.
-	        --	Generate_Sources (Output);
-	        --	ARM_Info.Close (Output);
-	        --end;
+                declare
+                    Output : ARM_TexInfo.Texinfo_Output_Type;
+                begin
+                   ARM_TexInfo.Create
+                     (Output,
+                      File_Prefix => +Output_File_Prefix,
+                      Title       => Get_Versioned_Item(Document_Title,Change_Version));
+                    Generate_Sources (Output);
+                    ARM_TexInfo.Close (Output);
+                end;
         end case;
 
     end Read_and_Process_Master_File;
============================================================
--- progs/arm_rtf.adb	dfa82e8697545d64775c89297cceeaa93d9101da
+++ progs/arm_rtf.adb	77f0fffb0bd7a4d0b6293fad50388b82ec52827d
@@ -1,12 +1,10 @@
-with ARM_Output,
-     ARM_Contents,
-     Ada.Text_IO,
-     Ada.Exceptions,
-     Ada.Streams.Stream_IO,
-     Ada.Strings.Maps,
-     Ada.Strings.Fixed,
-     Ada.Characters.Handling,
-     Ada.Calendar;
+with Ada.Calendar;
+with Ada.Characters.Handling;
+with Ada.Exceptions;
+with Ada.Streams.Stream_IO;
+with Ada.Strings.Fixed;
+with Ada.Strings.Maps;
+with Ada.Unchecked_Conversion;
 package body ARM_RTF is
 
     --
@@ -258,7 +256,8 @@ package body ARM_RTF is
 
     procedure Write_Headers (Output_Object : in out RTF_Output_Type) is
 	-- Write the page headers for this object into the current file.
-	Junk : Natural;
+       Junk : Natural;
+       pragma Unreferenced (Junk);
     begin
         -- Default header/footer:
         Ada.Text_IO.Put (Output_Object.Output_File, "{\headerl ");
@@ -2711,7 +2710,8 @@ package body ARM_RTF is
 	-- (Note: We did not use a enumeration here to insure that these
 	-- headers are spelled the same in all output versions).
 	-- Raises Not_Valid_Error if in a paragraph.
-	Count : Natural; -- Not used after being set.
+       Count : Natural; -- Not used after being set.
+       pragma Unreferenced (Count);
     begin
 	if not Output_Object.Is_Valid then
 	    Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
============================================================
--- progs/arm_str.adb	d12ec9e024dd28b7c7f83e8c281f6eb6ab35ba8e
+++ progs/arm_str.adb	d05b795fb41d724d03e24c6adba1d4249da2bef2
@@ -1,5 +1,4 @@
-with ARM_Input,
-     Ada.Text_IO;
+with Ada.Text_IO;
 package body ARM_String is
 
     --
============================================================
--- progs/arm_sub.adb	b585f4a75f9394d7cc2126667c6543165b9dbf12
+++ progs/arm_sub.adb	66564154cc0e70e30db4e5dbc92431ecbf341590
@@ -1,9 +1,7 @@
-with ARM_Output;
-with ARM_Index;
 with ARM_Contents;
 with Ada.Characters.Handling;
 with Ada.Strings.Fixed;
-with Ada.Text_IO; -- ** Temp.
+with Ada.Unchecked_Deallocation;
 package body ARM_Subindex is
 
     --
@@ -166,8 +164,6 @@ package body ARM_Subindex is
 
 	function To_Lower (A : in String) return String renames
 	    Ada.Characters.Handling.To_Lower;
-	function To_Lower (A : in Character) return Character renames
-	    Ada.Characters.Handling.To_Lower;
 
 
         function "<" (Left, Right : Item_List) return Boolean is
============================================================
--- progs/arm_syn.adb	b849027bd8ca131c1d0762ff315aa4f9c3709aa9
+++ progs/arm_syn.adb	d0031269276536bcbd8ae0b8844d12b5a881460e
@@ -102,8 +102,6 @@ package body ARM_Syntax is
     NT_Count : Natural := 0;
 
     procedure Free is new Ada.Unchecked_Deallocation (Rule_Type, Rule_Ptr);
-    procedure Free is new Ada.Unchecked_Deallocation (XRef_Type, XRef_Ptr);
-    procedure Free is new Ada.Unchecked_Deallocation (NT_Type, NT_Ptr);
     procedure Free is new Ada.Unchecked_Deallocation (String, String_Ptr);
 
     procedure Create is
============================================================
--- progs/arm_text.adb	0210659138fa315cfd969149fd13110072c9b906
+++ progs/arm_text.adb	468b32811dce385ab7244ed4385ca746034c0e33
@@ -1,8 +1,5 @@
-with ARM_Output,
-     ARM_Contents,
-     Ada.Text_IO,
-     Ada.Exceptions,
-     Ada.Strings.Fixed;
+with Ada.Exceptions;
+with Ada.Strings.Fixed;
 package body ARM_Text is
 
     --
@@ -173,7 +170,7 @@ package body ARM_Text is
         end if;
         -- Create a new file for this section:
         Ada.Text_IO.Create (Output_Object.Output_File, Ada.Text_IO.Out_File,
-            ".\Output\" & Ada.Strings.Fixed.Trim (Output_Object.File_Prefix, Ada.Strings.Right) &
+            "Output/" & Ada.Strings.Fixed.Trim (Output_Object.File_Prefix, Ada.Strings.Right) &
                 "-" & Section_Name & ".TXT");
         Ada.Text_IO.New_Line (Output_Object.Output_File);
     end Section;
============================================================
# source_2005/AARM.MSM is binary
============================================================
# source_2005/RM.MSM is binary