File: fweb.texi

package info (click to toggle)
fweb 1.62-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 4,504 kB
  • ctags: 5,148
  • sloc: ansic: 40,448; makefile: 388; sh: 170
file content (12264 lines) | stat: -rw-r--r-- 419,141 bytes parent folder | download | duplicates (7)
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
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
\input texinfo   @c -*-texinfo-*-
@def@ifhtml{@doignore{ifhtml}}
@setfilename fweb.info
@settitle FWEB

@macro Fprog{name}
@sc{\name\}
@end macro

@macro FWEB
@Fprog{Fweb}
@end macro

@macro FWEAVE
@Fprog{Fweave}
@end macro

@macro FTANGLE
@Fprog{Ftangle}
@end macro

@macro ASP
@iftex
@tex`\hbox{\tt@@\char`\ }'@end tex
@end iftex
@ifinfo
@w{@samp{@@ }}@c
@end ifinfo
@end macro

@macro PI
@tex
$\pi$
@end tex
@ifinfo
@var{pi}@c
@end ifinfo
@end macro

@macro EQUIV
@tex
$\equiv$
@end tex
@ifinfo
==@c
@end ifinfo
@end macro


@
@ifinfo
     This file documents FWEB...
     
        Copyright 1993--1998 John A. Krommes
     
     Permission is granted to make and distribute verbatim
     copies of this manual provided the copyright notice and
     this permission notice are preserved on all copies.
     
@c     @ignore
     Permission is granted to process this file through TeX
     and print the results, provided the printed document
     carries a copying permission notice identical to this
     one except for the removal of this paragraph (this
     paragraph not being relevant to the printed manual).
     
@c     @end ignore
     Permission is granted to copy and distribute modified
     versions of this manual under the conditions for
     verbatim copying, provided also that the section
     entitled ``Copying'' is included exactly as in the original, and provided
     that the entire resulting derived work is distributed
     under the terms of a permission notice identical to this
     one.
     
     Permission is granted to copy and distribute
     translations of this manual into another language,
     under the above conditions for modified versions,
     except that this permission notice may be stated in a
     translation approved by the author.
@end ifinfo

@titlepage
@title FWEB
@subtitle A WEB system of structured documentation 
@subtitle for multiple languages
@author By John A. Krommes
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1993--1998 John A. Krommes

     Permission is granted to make and distribute verbatim
     copies of this manual provided the copyright notice and
     this permission notice are preserved on all copies.
     
     Permission is granted to copy and distribute modified
     versions of this manual under the conditions for
     verbatim copying, provided also that the section
     entitled ``Copying'' is included exactly as in the original, and provided
     that the entire resulting derived work is distributed
     under the terms of a permission notice identical to this
     one.
     
     Permission is granted to copy and distribute
     translations of this manual into another language,
     under the above conditions for modified versions,
     except that this permission notice may be stated in a
     translation approved by the author.
@end titlepage


@node Top,Copying,(dir),(dir)

@ifhtml
NOTE: Because of last-minute translation problems with texi2html
operating on the macro-expanded version of fweb.texi, user-defined macro
expansion has temporarily been turned off in this html version.
Multitable is also giving trouble, as is @samp in section names.  These
are probably problems with texi2html; sorry for the inconvenience.
@end ifhtml

@unnumbered @FWEB{}

This Texinfo documentation describes @FWEB{} Version 1.61.


@quotation

@itemize @bullet
@item
To learn about new features of this version, see @ref{V1.61}.  

@item
For a quick introduction to, and review of the structure of an @FWEB{}
source file, see @ref{Structure}. 

@item
If you used to receive e-mail information about @FWEB{} but don't any
longer, it's probably because you need to update your e-mail address in
the @code{fweb-users} mailing list.  Subscription instructions can be
found in @ref{Support}.

@item
Bug reports and suggestions are much appreciated, but are no longer
acknowledged individually.  See @ref{Support}.

@item
The next major release, @FWEB{} Version 2.00, is planned for
no earlier than January 1, 2000.

@end itemize
@end quotation

@ifinfo
If you're perusing this documentation for the first time, try first
reading the discussion at just the top-level nodes in order to get a
general sense of what's here.  Lower-level nodes have many details, but
most of them are unnecessary for the casual user.

One can obtained a TeX'd copy of the present documention by saying
@samp{texi2dvi fweb.texi}, assuming that the relevant @code{texinfo}
macros have been installed on one's system. (@file{texinfo.tex} and the
script @code{texi2dvi} are included in the standard GNU distributions.)
@end ifinfo

This documentation is now accessible on the World-Wide Web from

@quotation
@url{http://w3.pppl.gov/~krommes/fweb_toc.html}.
@end quotation

Other sources of information about @FWEB{} are the archival files of
the @code{fweb-users} and @code{fweb-installers} mailing lists.  To
learn how to obtain those, see @ref{Support}.

If you are learning @FWEB{} for the first time, you will probably find
that this (unfinished) manual is not sufficiently pedagogical.  For
background, please refer to Knuth's book cited in @ref{Intro}.  You
should also browse through @ref{Concepts}, in particular
@ref{Structure}.

@ifinfo
   The first part of this master menu lists the major nodes in this Info
document.  The rest of the menu lists all of the lower-level nodes in
the document.
@end ifinfo

@menu
* Copying::             Your rights; NO WARRANTY.
* Intro::               An introduction to @FWEB{}.
* Concepts::            General concepts of WEB programming.
* Files::               Files used by @FWEB{}.
* Starting::            Command-line syntax and options
* @@ commands: AT commands.  @FWEB{} commands.
* Comments::            Commenting styles.
* Languages::           Languages.
* Macros::              Macro definitions and preprocessing.
* Ratfor::              RATional FORtran.
* Documentation::       Features and hints about working with @FWEAVE{}.
* Index::               The index produced by @FWEB{}.
* Customization::       Customizing @FWEB{}, learning about parameters, etc.
* Hints::               Various usage tips, etc.
* New features::        New features/changes in the current version.
* Support::             Help, bug reports, etc.
* Installing::          Installing @FWEB{}.
* Concept index::       Significant concepts.
* Option and command index::  Command-line options, @@ commands, etc.
* Parameter index::     Style-file parameters.

 --- The Detailed Node Listing ---

INTRODUCTION to @FWEB{}

* History::             History of literate programming.
* Features::            Special features of @FWEB{}.

WEB CONCEPTS

* Processors::          @FTANGLE{} and @FWEAVE{}.
* Phases::              Phases of operation of the @FWEB{} processors.
* Structure::           The structure of a web.
* Modules::             Use of named and unnamed modules.

FILES

* Input files::         Input files.
* Output files::        Output files.
* Change files::        Change files.

Input files

* Completion::          Automatic file-name completion.

RUNNING @FWEB{}

* Syntax::      Command-line syntax.
* Options::     Command-line options.

Command-line options

* Negating options:: How to invert the meaning of an option.
* -1::          Brief debugging mode.
* -2::          Verbose debugging mode.
* -@@: -AT.      Display information about control codes.
* -A: -A_.      Turn on ASCII translations.
* -B: -B_.      Turn off audible beeps.
* -b::          Number blocks.
* -C: -C_.      Set the color mode.
* -c::          Set global language to C.
* -c++: -cpp.   Set global language to C++.
* -D: -D_.      Display information about @FWEB{}'s reserved words.
* -d::          Convert unnumbered `do...enddo's to Fortran--77.
* -E: -E_.      Change the delimiter of a file-name extension.
* -e::          Turn on automatic file-name completion.
* -F: -F_.	Compare output files with old versions.
* -f::          Turn off module references for identifiers.
* -H: -H_.      Scan #include files to format typedef and/or class commands.
* -h::          Where to get help.
* -I: -I_.      Append a directory to search list for include files.
* -i::          Don't print contents of @@I include files.
* -i!::         Don't even read @@I include files.
* -j::          Inhibit multiple includes of the same file.
* -k::          Don't recognize lower-case forms of Fortran I/O keywords.
* -L: -L_.      Select global language.
* -l::          Echo the input line.
* -M: -M_.      Set output message level.
* -m::          Define an @FWEB{} macro.
* -m4::         Understand the m4 built-in commands.
* -m;::         Append pseudo-semicolons to @FWEB{} macro definitions.
* -n::          Set global language to Fortran--77.
* -n9::         Set global language to Fortran--90.
* -n@@;: -nAT;. For Fortran, supply pseudo-semicolons automatically (default).
* -n;::         For Fortran, supply actual semicolons automatically.
* -ncolon::     In Fortran, place statement labels on separate lines.
* -nb::         In Fortran, number the ifs and dos.
* -nC::         In Fortran, ignore single-line comments ('C', 'c', or '*').
* -np::         Print semicolons in woven Fortran output.
* -n\::         In Fortran--90, free-form syntax continued with '\\'.
* -n&::         In Fortran--90, free-form syntax continued with '&'.
* -n/::         In Fortran, recognize '//' as the start of a short comment.
* -n!::         In Fortran, make '!' denote the start of a short comment.
* -n)::         In Fortran, reverse array indices.
* -o::          Turn off @FWEAVE{}'s mechanisms for overloading operators.
* -q::          Don't translate Ratfor.
* -P: -P_.      Select TeX processor.
* -p::          Set style parameter.
* -r::          Set the global language to Ratfor--77.
* -r9::         Set the global language to Ratfor--90.
* -rb::         In Ratfor, number the ifs and dos.
* -rg::         Set |goto| parameters.
* -rk::         Suppress comments about Ratfor statement translation.
* -rK: -rK_.    Write out comments about Ratfor statement translation.
* -r@@;: -rAT;. Turn on Ratfor's auto-semi mode, using pseudo-semicolons.
* -r;::         Turn on Ratfor's auto-semi mode, using actual semicolons.
* -r/::         In Ratfor, recognize '//' as the start of a short comment.
* -r!::         In Ratfor, make '!' denote the start of a short comment.
* -r)::         In Ratfor, reverse array indices.
* -s::          Print statistics about memory usage.
* -T: -T_.      Flag-setting commands for @FTANGLE{}.
* -t::          Truncate identifiers.
* -U: -U_.      Convert reserved output tokens to lower case.
* -u::          Undefined a predefined or command-line macro.
* -V: -V_.      Print version number.
* -v::          Make all comments verbatim.
* -W: -W_.      Flag-setting commands for @FWEAVE{}.
* -w::          Change name of @FWEB{}'s macro package.
* -X: -X_.      Print selected cross-reference information.
* -x::          Reduce or eliminate cross-reference information.
* -y::          Allocate dynamic memory.
* -Z: -Z_.      Display default values of style-file parameters.
* -z::          Change name of style file.
* -.::          Don't recognize dot constants.
* -\::          Explicitly escape continued strings.
* -(: -lp.      Continue parenthesized strings with backslashes.
* -colon::      Set starting automatic statement number
* ->::          Redirect tangled output.
* -=::          Redirect tangled output.
* -#::          Don't print comments about line numbers and module names
                in tangled output.
* -+: -plus.    Don't interpret compound assignment operators.
* -/::          Recognize '//' as the start of a short comment.
* -!::          Make '!' denoted the start of a short comment.

* Info options:: Information options.

@samp{-T}:  Flag-setting options for @FTANGLE{}

* -TD::         Permit processing of deferred macro definitions.
* -Tb::         Permit built-functions such as @code{$IF} to be redefined.
* -Tm::         Permib user-defined macros to be redefined.
* -Tv::         Don't print header info at top of output. 
* -T%::         Don't retain trailing comments.
* -T#::         Don't insert @samp{#line} command after @samp{@@%}.        

@samp{-W}:  Flag-setting options for @FWEAVE{}

* -W@@: -WAT.            Set module warning flag.
* -W1::                 Completely cross-reference single-character identifiers.
* -W[::                 Turn on processing of bracketed array indices.
* -WH: -WH_.            Send extra arguments to the C preprocessor.

Commands that inhibit printing:

* -Wd: -Wnoprint.       Don't print @@d or @@D in woven output.
* -Wf: -Wnoprint.       Don't print @@f.
* -WF: -Wnoprint.       Don't print @@F.
* -Wl: -Wnoprint.       Don't print @@l.
* -Wm: -Wnoprint.       Don't print @@m or @@M.
* -Wv: -Wnoprint.       Don't print @@v.
* -Ww: -Wnoprint.       Don't print @@w or @@W.

@FWEB{} COMMANDS

* @@0: AT0.     Turn off debugging.
* @@1: AT1.     Display irreducible scraps.
* @@2: AT2.     Display detailed scrap reductions.

Literal control characters:
* @@@@: ATAT.     Insert an '@@'.
* @@|: AT|.      Vertical bar/optional line break.

Beginning of section:
* @@ : ATspace.  Begin minor section.
* @@*: AT*.      Begin major section.

Beginning of code part:
* @@<: AT<.      Begin module name.
* @@>: AT>.      End module name.
* @@A: ATA_.     Begin code part.
* @@a: ATa.      Begin code part and mark next identifier.

Control codes b--z:
* @@B: ATB_.      Insert left brace; suppress default insertion of breakpoint command.
* @@b: ATb.      Insert breakpoint command.
* @@c: ATc.      Set language to C.
* @@c++: ATcpp.  Set language to C++.
* @@D: ATD_.     Define outer macro.
* @@d: ATd.      Define outer macro and mark it.
* @@E: ATE_.     Treat next identifier as ordinary expression.
* @@e: ATe.      Invisible expression.
* @@f: ATf.      Format identifier or module name.
* @@I: ATI_.     Include a WEB file, but don't print it.
* @@i: ATi.      Include a WEB file.
* @@K: ATK_.     Expand global RCS-like keyword.
* @@k: ATk.      Expand local RCS-like keyword.
* @@L: ATL_.     Set language.
* @@l: ATl.      Specify limbo text.
* @@M: ATM_.     Define an @FWEB{} macro.
* @@m: ATm.      Define a @FWEB{} macro and mark it.
* @@N: ATN_.     Turn on language-independent mode.
* @@n: ATn.      Set language to Fortran--77.
* @@n9:ATn9.     Set language to Fortran--90.
* @@O: ATO_.     Open new output file (global scope).
* @@o: ATo.      Open new output file (local scope).
* @@q: ATq.      Turn off or on module and line information locally.
* @@R: ATR_.     Treat next identifier as integer-like reserved word.
* @@r: ATr.      Set language to Ratfor--77.
* @@r9: ATr9.    Set language to Ratfor--90.
* @@u: ATu.      Undefine an outer macro.
* @@v: ATv.      Overload an operator.
* @@W: ATW_.     Overload an identifier.
* @@x: ATx.      Terminate ignorable material.
* @@y: ATy.	 End first part of change.
* @@z: ATz.      Begin ignorable material.

Conversion to ASCII:
* @@': ATquote.     Convert single character to ASCII.
* @@": ATdquote.         Convert string to ASCII.

Forward referencing:
* @@[: AT[.         Mark next identifier as defined in this section.

Comments:
* @@/*: AT/*.        Begin a long verbatim comment.
* @@//: AT//.        Begin a short verbatim comment.
* @@%: AT%.          Ignore everything to next newline.
* @@?: AT?.          Begin a compiler directive.
* @@(: ATlp.         Begin a meta-comment.
* @@): AT).          End a meta-comment.

Special brace:
* @@@{: ATlb.       Insert left brace; suppress newlines in pretty-printing.

Index entries:
* @@_: AT_.         Force an index entry to be underlined (marked as defined).
* @@-: AT-.         Delete index entry for following identifier.
* @@+: ATplus.      Force index entry for following identifier.
* @@^: AT^.         Make index entry in Roman type.
* @@.: ATdot.       Make index entry in typewriter type.
* @@9: AT9.         Make index entry in format controlled by `\9'.

Control text:
* @@t: ATt.         Put control text into TeX \hbox.
* @@=: AT=.         Pass control text verbatim to the output.

Spacing:
* @@comma: ATcomma. Insert a thin space.
* @@/: AT/.         Insert a line break, preserving indentation.
* @@\: ATbs.         Insert a line break and backspace.
* @@|: AT|_.        Insert optional line break in an expression.
* @@#: AT#.         Force line break with blank line.
* @@~: AT~.         Cancel a line break (tie adjacent lines together).
* @@&: AT&.         Join left and right items.

Pseudo (invisible) operators:
* @@e: ATe.         Invisible expression.
* @@;: AT;.         Invisible semicolon.
* @@colon: ATcolon.     Invisible colon.

Miscellaneous:
* @@!: AT!.         Inhibit expansion for next macro.

COMMENTING STYLES

* Invisible comments::          Skipping input material.
* Visible comments::            Comments in code mode.
* Temporary comments::          Temporarily commenting out code.

MACROS and PREPROCESSING

* Outer macros::        Macros copied to beginning of output file (@@d).
* FWEB macros::         Macros and built-in functions expanded by @FWEB{} (@@m).
* Macros and formatting:: How to format macros for pretty-printing.
* Preprocessing::       @FWEB{}'s preprocessing language (@@#if, etc.)

@FWEB{} macros

* Macro features::      Various points about @FWEB{} macros.
* Tokens::              Special tokens used in @FWEB{} macros.
* Built-in functions::  Macro-like functions built into @FWEB{}.
* Debugging with macros:: Debugging glitches, and their solutions.

Various features of @FWEB{} macros

* Variable arguments::  @FWEB{} macros with variable arguments.
* Recursion::           @FWEB{} macros may be recursive (proceed at your own risk).
* Macro protection::    Protecting @FWEB{} macros against redefinition.


Built-in functions

* Strings and quotes::  Quoted and non-quoted strings.
* Protection::          By default, built-in functions may not be redefined.

INDIVIDUAL BUILT-IN FUNCTIONS

* $A::                  Convert to ASCII.
* $ABS::                Absolute value.
* $ASSERT::             Assert a condition.
* $AUTHOR::             RCS global keyword; see $KEYWORD.
* $COMMENT::            Generate a comment.
* $DATE::               Today's date.
* $DATE_TIME::          RCS global keyword; see $KEYWORD.
* $DAY::                Today.
* $DECR::               Decrement a macro.
* $DEFINE::             Define a (deferred) macro.
* $DO::                 Macro @b{DO} loop.
* $DUMPDEF::            Dump macro definitions to the terminal.
* $E::                  Base of the natural logarithms:  2.71828...
* $ERROR::              Send error message to output.
* $EVAL::               Evaluate an expression.
* $EXP::                Exponential function.
* $GETENV::             Get value of environment variable.
* $HEADER::             RCS global keyword; see $KEYWORD.
* $HOME::               The user's home directory.
* $ID::                 RCS global keyword; see $KEYWORD.
* $IF::                 Two-way conditional:  ``If expression is true''
* $IFCASE::             n-way conditional.
* $IFDEF::              Two-way conditional:  ``If macro is defined''
* $IFNDEF::             Two-way conditional:  ``If macro is not defined''
* $IFELSE::             Two-way conditional:  ``If macro1 equals macro2''
* $INCR::               Increment a macro.
* $INPUT_LINE::         Line number that begins current section.
* $KEYWORD::            Extract text of global RCS-like keyword.
* $L::                  Change string to lower case.
* $L_KEYWORD::          Extract text of local RCS-like keyword.
* $LANGUAGE::           Identifier for current language.
* $LANGUAGE_NUM::       Number of current language.
* $LEN::                Length of string.
* $LOCKER::             RCS global keyword; see $KEYWORD.
* $LOG::                Natural logarithm.
* $LOG10::              Logarithm to the base 10.
* $M::                  Define a (deferred) macro.
* $MAX::                Maximum of one or more elements.
* $MIN::                Minimum of one or more elements.
* $MODULE_NAME::        Name of present @code{web} module.
* $MODULES::            Total number of independent modules.
* $NAME::               RCS global keyword; see $KEYWORD.
* $OUTPUT_LINE::        Current line number of tangled output.
* $P::                  The C preprocessor symbol @code{#} (an unquoted string).
* $PI::                 3.14159...
* $POW::                Raise to a power.
* $PP::                 The C preprocessor symbol @code{#} (a character).
* $RCSFILE::            RCS global keyword; see $KEYWORD.
* $REVISION::           RCS global keyword; see $KEYWORD.
* $ROUTINE::            Current Ratfor program, function, or subroutine.
* $SECTION_NUM::        Number of current section.
* $SECTIONS::           Maximum number of sections.
* $SOURCE::             RCS global keyword; see $KEYWORD.
* $SQRT::               Square root.
* $STATE::              RCS global keyword; see $KEYWORD.
* $STRING::             Expand argument, then stringize.
* $STUB::               
* $TIME::               The local time.
* $TRANSLIT::           Transliterate a string.
* $U::                  Change string to upper case.
* $UNDEF::              Undefine an @FWEB{} macro.
* $UNQUOTE::            Remove quotes from string (leaving an unquoted string).
* $UNSTRING::           Remove quotes and string delimiters from string.
* $VERBATIM::           (Obsolete.)
* $VERSION::            @FWEB{} version number.

LANGUAGES

* Setting the language::             Setting the language.

Special hints and considerations for each language.
* C::                   C
* C++: Cpp.             C++.
* Fortran::             Fortran--77 and Fortran--90.
* Ratfor: Ratfor_.      RATional FORtran.
* TeX::                 @TeX{}.
* Verbatim::            Literal mode.

@sc{Ratfor}

* Syntax: RSyntax.      Ratfor syntax.
* Commands::            Ratfor commands.
* Caveats::             Nuances about @FWEB{} Ratfor.

DOCUMENTATION

* Typesetting::         Woven output; TeX vs. LaTeX, etc.
* Pretty-printing::     Turning ugly input into beautiful output.

Typesetting

* Output::	Structure of the TeX output from @FWEAVE{}.
* fwebmac.sty:: The macro package used with @FWEAVE{}.
* LaTeX::	Specifics of the LaTeX support.

The macro package @file{fwebmac.sty}

* User macros:: Macros defined for user convenience.
* Fonts::       Useful font commands.

La@TeX{} support

* Document class::	LaTeX's document class, options, etc.
* REVTeX::              The REV@TeX{} scientific macro package.
* Packages::            Special FWEB-related La@TeX{}2e packages.
* Sections::	        Section numbering, spacing, etc.
* Index:LIndex.         Technical details about multi-columns and the Index.
* Table of Contents::   The Table of Contents.
* Customizing LaTeX::   Conditional flags, etc.
* Inserting woven code:: How to insert @FWEAVE{}'s output into a La@TeX{} document.

La@TeX{} packages related to @FWEB{}

* fwebinsert:Inserting woven code. Enable insertion of woven code into a La@TeX{} document.
* fwebnum:Numbering.              Number each section in ascending order.
* idxmerge:Merging indexes.       Merge several stand-alone indexes.

Customizing La@TeX{}'s output

* Page references::     Indexing by page numbers.
* Headers::             The content of page headers.
* Numbering::           Various section numbering schemes.

Pretty-printing

* Alternatives::        Alternatives for various input tokens.
* Pseudo-operators::    Invisible parts of speech.
* Overloading::         Changing the appearance of various quantities.

@FWEB{}'s INDEX.

* Internal index::      The self-contained index produced by @FWEB{}.
* Using makeindex::     Writing index data for use by @code{makeindex}.
* Merging indexes::     Using the @code{idxmerge} utility to merge indexes.

CUSTOMIZATION

* Environment variables::       Environment or logical variables.
* Initialization::              Initialization file.
* Memory allocation::           Dynamic memory allocation.
* Style::                       Style file.

Memory allocation

* -yb::         Maximum bytes for identifiers, index entries, and module names.
* -ybs::        Size of the change buffer.
* -ycb::        Size of line buffer for C output.
* -ycf::        A Ratfor buffer.
* -ycg::        Another Ratfor buffer.
* -yd::         Increment for expanding the dots table.
* -ydt::        Maximum number of deferred macro tokens.
* -ydx::        Maximum number of deferred macro texts.
* -yid::        Maximum depth of file inclusion.
* -yif::        Maximum number of unique include-file names.
* -ykt::        Stack size for @FTANGLE{}.
* -ykw::        Stack size for @FWEAVE{}.
* -yll::        Line length for @FWEAVE{}'s output.
* -yln::        Maximum length of module names or strings.
* -ylb::        Maximum number of nested loops in Ratfor.
* -ylx::        Maximum length of expressions that can be expanded with
                        the post-increment operators of Fortran or Ratfor.
* -ym::         Maximum number of sections.
* -yma::        Maximum number of arguments to @FWEB{} macros.
* -ymb::        Size of the buffer for expanding @FWEB{} macros.
* -yn::         Maximum number of identifiers and module names.
* -ynf::        Maximum number of open output files.
* -yop::        Maximum number of entries in the table for operator
                        overloading. 
* -yr::         Maximum number of cross-references.
* -ys::         Maximum number of scraps.
* -ysb::        Size of style-file input-line buffer.
* -ytt::        Maximum number of tokens that @FTANGLE{} can process.
* -ytw::        Maximum number of tokens in the current section being
                        processed by @FWEAVE{}.
* -yx::         Maximum number of texts.
* -yxb::        Size of line buffer for @TeX{} output.

The Style file

* Index params::                Customizing the Index.
* Module params::               Customizing the list of sections.         
* Contents params::             Customizing the Table of Contents.
* Subscript params::            Customizing subscripting for cross-references.
* Fwebmac params::              Customizing behavior of @FWEB{}'s macros.
* Completion params::           Automatic selection of file extensions, etc.
* Control-code mappings::       Remapping @FWEB{}'s control codes (danger)!
* Color::                       @FWEB{}'s color output.
* Miscellaneous params::        Other customizations.

Customizing @FWEAVE{}'s index

* delim_0: S_delim.             Insert after identifier in index entry.
* delim_n: S_delim.             Insert between section numbers in index entry.

* encap.infix: S_encap.         Start the section number.
* encap.prefix: S_encap.        @TeX{} macro to begin a section number.
* encap.suffix: S_encap.        Ends the section number.

* group_skip::

* index.collate: S_index.       Collating sequence for the Index.
* index.postamble: S_index.     @TeX{} material to end the Index.
* index.preamble: S_index.      @TeX{} material to begin the Index.
* index.tex: S_index.           Name of file holding the Index.

* item_0::                      @TeX{} command to begin an index entry.

* language.prefix: S_language.  Begin a language entry in the Index.
* language.suffix: S_language.  End a language entry in the Index.

* lethead.prefix: S_lethead.    Begin a letter group.
* lethead.suffix: S_lethead.    End a letter group.
* lethead.flag: S_lethead.      Control beginning of letter group.

* name: S_index.                Name of index.

* underline.prefix: S_underline. Begin an underlined index entry.
* underline.suffix: S_underline. End an underlined index entry.

Customizing the module list

* modules.info: S_modules.
* modules.postamble: S_modules. @TeX{} commands to end module list.
* modules.preamble: S_modules.  @TeX{} commands to begin module list.
* modules.tex: S_modules.       Name of file containing list of modules.

Customizing the Table of Contents

* contents.postamble: S_contents. @TeX{} commands to end Table of Contents.
* contents.preamble: S_contents.  @TeX{} commands to begin Table of Contents.
* contents.tex: S_contents.       Name of contents file.

Customizing cross-reference subscripts

* mark_defined.generic_name: S_mark_defined.
* mark_defined.fcn_name: S_mark_defined.
* mark_defined.WEB_macro: S_mark_defined.
* mark_defined.outer_macro: S_mark_defined.
* mark_defined.exp_type: S_mark_defined.
* mark_defined.typedef_name: S_mark_defined.

Customizing the behavior of @file{fwebmac.sty} macros

* doc.preamble: S_LaTeX.        Preamble for entire document.
* doc.postamble: S_LaTeX.       Postamble for entire document.

* format_IDENTIFIER: S_format.  Macro name for typesetting upper-case identifiers.
* format.reserved: S_format.    Macro for reserved words.
* format.short_identifier: S_format. Macro for single-character identifiers.
* format_OUTER_MACRO: S_format. Macro for upper-case @samp{@@d} identifiers.
* format.outer_macro: S_format. Macro for lower-case @samp{@@d} identifiers.
* format_WEB_MACRO: S_format.   Macro for upper-case @samp{@@m} identifiers.
* format.WEB_macro: S_format.   Macro for lower-case @samp{@@m} identifiers.
* format.intrinsic: S_format.   Macro for intrinsic library functions.
* format_KEYWORD: S_format.     Macro for upper-case keywords.
* format.keyword: S_format.     Macro for lower-case keywords.
* format.typewriter: S_format.  Macro for strings.
* format.wildcard: S_format.    Macro for user-defined index entries.

* indent.TeX: S_indent.         Paragraph indentation for @TeX{} part.
* indent.code: S_indent.        Paragraph indentation for code part.

* LaTeX.class: S_LaTeX.         Specify the document class.
* LaTeX.class.options: S_LaTeX. Specify options for document class.
* LaTeX.package: S_LaTeX.         Specify user package(s)
* LATeX.package.options: S_LaTeX. Specify options for user package(s).

Miscellaneous style-file parameters

* ASCII_fcn::                   Routine for converting strings to ASCII.
* cchar::                       Continuation character for Fortran.
* cdir_start::                  @samp{@?} translates to this.
* line_char::                   Comment char. for @FTANGLE{}'s @code{line} cmds.
* line_length: S_line_length.

* paren.len: -n).               Length of one parenthesized index for @samp{-n)}.
* paren.levels: -n).            Number of nested parentheses for @samp{-n)}.
* paren.num: -n).               Number of permitted indices for @samp{-n)}.

* meta.top: S_meta_t.           Material to precede tangled meta-comment. 
* meta.prefix: S_meta_t.        Begins each line of meta-comment.
* meta.bottom: S_meta_t.        Material that follows the meta-comment.

* meta.top.hdr: S_meta_t.       Like meta.top, but for info at start of file.
* meta.prefix.hdr: S_meta_t.    As above.
* meta.bottom.hdr: S_meta_t.    As above.

* outer.def: S_outer.           @FTANGLE{} converts @samp{@@d} to this.
* outer.undef: S_outer.         @FTANGLE{} converts @samp{@@u} to this.

* protect::                     Protection character to end a continued line.
* suffix::                      Suffixes for output files.

For @FWEAVE{}:

* macros::                      Default name of the macro package to be
                                        read in by @FWEAVE{}. 
* limbo.begin: S_limbo.         Default material to begin the limbo section.
* limbo.end: S_limbo.           Default material to end the limbo section.

* meta.code.begin: S_meta_w.
* meta.code.end: S_meta_w.

* meta.TeX.begin: S_meta_w.     @TeX{} material to begin @FWEAVE{}'s 
                                                output of a meta-comment.
* meta.TeX.end: S_meta_w.       As above, but end the meta-comment.

* preamble.named: S_preamble.   @TeX{} material to begin named section.
* preamble.unnamed: S_preamble. @TeX{} material to begin unnamed section. 

For both processors:

* dot_constant.begin: S_dot_constant.   Beginning character for dot constant.
* dot_constant.end: S_dot_constant.     Ending character for dot constant.

* null_file::                   Name of the null file.

Automatic file name completion

* Ext.web: S_Ext.        Extensions for the web file.
* Ext.ch: S_Ext.     Extensions for the change file.
* Ext.hweb: S_Ext.       Extensions for include files.
* Ext.hch: S_Ext.    Extensions for change files associated with
                                include files. 

USAGE TIPS and SUGGESTIONS

* Converting::          Converting an existing code to @FWEB{}.
* Tips::                Usage tips and suggestions.
* Science::             Useful features for scientific programming.

NEW FEATURES

* V1.61::
* V1.53::
* V1.52::
* V1.50::
* V1.40::
@end menu

@node Copying, Intro, Top, Top
@comment  node-name,  next,  previous,  up

@unnumbered @FWEB{} Copying Permissions

@FWEB{} is ``free.''  This means that everyone is free to use them and free to
redistribute them on a free basis.  @FWEB{} operates under the terms
of the GNU General Public License; see, for example, 
@ref{Distrib, , Distribution, emacs, The GNU Emacs Manual}.

Although it is hoped that @FWEB{} will be useful, 
there is @emph{ABSOLUTELY NO WARRANTY}.  

@node Intro, Concepts, Copying, Top
@comment  node-name,  next,  previous,  up

@chapter INTRODUCTION to @FWEB{}

@cindex Literate programming
@FWEB{} is a system for @dfn{literate programming}.  It enables one to
maintain both documentation and source code in a single place (the
@code{web} file), and to explain the code in terms of a @dfn{web} of
very small fragments.  Because @FWEB{} is intimately integrated with
@TeX{}, one gains many advantages such as book-quality typesetting and
extensive cross-referencing facilities.  A simple example program is
described in @ref{Structure}.


@FWEB{} was originally intended for scientific programming (the 'F'
stands for @sc{Fortran}), and is in wide use in that arena; however, it
has much broader applicability.  It is an extension of Knuth's WEB
system that handles the specific languages C, C++, Fortran (both F77 and
F90), @sc{Ratfor}, and (in a limited fashion) @TeX{} itself.  It also
attempts to implement a WYSIWYG language-independent mode as well as a
(closely-related but not identical) verbatim `language'.  @emph{The
language-independent features are highly experimental} and are not
recommended. 

The origins and philosophy of literate programming are described in the
very enjoyable book by D. E. Knuth, @cite{Literate Programming} (Center for
the Study of Language and Information, Leland Stanford Junior
University, 1992).

Knuth's original WEB 
@pindex WEB
was written in Pascal, and it formatted Pascal code.
Silvio Levy introduced @sc{Cweb}, 
@pindex CWEB
a WEB system written in C for C.  @FWEB{} 
@pindex FWEB
is a
(by now, substantial) modification of version 0.5 of @sc{Cweb} that was
graciously supplied by Levy.  It also borrows various ideas from the
works of Ramsey and Briggs on language-independent webs.

The original WEB's worked with Plain @TeX{}.  More recently, many users
have turned to Lamport's La@TeX{} because of its ease of use and
higher-level features.  Excellent and extensive development of La@TeX{} has been
accomplished, as described by Goossens, Mittelbach, and Samarin, @cite{The
La@TeX{} Companion} (Addison--Wesley, Reading, MA, 1994). 
The present version of @FWEB{} is intended to be used with
La@TeX{} (La@TeX{}2e, in particular); Plain @TeX{} is no longer supported.

@menu
* History::             History of literate programming.
* Features::            Special features of @FWEB{}.
@end menu

@node History, Features, Intro, Intro
@comment  node-name,  next,  previous,  up

@section History of WEB and literate programming
(To be completed; see Knuth's book, cited in @ref{Intro}.)

@node Features, , History, Intro
@comment  node-name,  next,  previous,  up

@section Features of @FWEB{}

@FWEB{} is distinguished from its relatives in several respects:

@quotation
@itemize @bullet
@item
@FWEB{} introduces the concept of a @emph{current language}
(@pxref{Languages}), so more than one compiler language can be processed
in a single @FWEB{} run.  For example, mixtures of C++ and
@sc{Fortran} are common in modern scientific programming.

@item
@FWEB{} understands the syntaxes of several of the more important
compiler languages: C, C++, @sc{Fortran} (both F77 and F90),
@sc{Ratfor}, and @TeX{}.  For other languages, @FWEB{} can work in a
language-independent mode that essentially weaves and tangles the source
code verbatim, but still provides the user with the powerful @sc{web}
features related to @sc{TeX} documentation, module names, macro
processing, etc.

@item
@FWEB{} contains a built-in @sc{Ratfor} (@sc{RATional} @sc{FORtran})
translator.  @xref{Ratfor}.

@item
@FWEB{} has a built-in C-like @emph{macro preprocessor}.  This is
especially useful for @sc{Fortran} and @sc{Ratfor}, which have no predefined
preprocessor.  However, certain extensions such as variable numbers of arguments
make the @FWEB{} preprocessor sometimes useful even for C and C++.
@xref{Macros} and @ref{Preprocessing}.

@item
Many aspects of @FWEB{}'s behavior, default strings, etc. can be
customized by means of setting parameters in a @code{makeindex}-like
@emph{style file} (by default, @file{fweb.sty}).  @xref{Style}.

@end itemize
@end quotation

@node Concepts, Files, Intro, Top
@comment  node-name,  next,  previous,  up

@chapter WEB CONCEPTS

The principle concepts of @sc{WEB} programming are laid out in Knuth's book,
the reference to which was given in @ref{Intro}.  @FWEB{} follows most
conventions introduced by @sc{web} and @sc{Cweb}, except that the names
of some commands have been changed for consistency, symmetry, and/or
clarity.

@menu
* Processors::          @FTANGLE{} and @FWEAVE{}.
* Phases::              Phases of operation of the @FWEB{} processors.
* Structure::           The structure of a web.
* Modules::             Use of named and unnamed modules.
@end menu

@node Processors, Phases, Concepts, Concepts
@comment  node-name,  next,  previous,  up

@section The @FWEB{} processors:  @FWEAVE{} and @FTANGLE{}

@cindex Processors, @FWEB{}
Following Knuth's original design, @FWEB{} consists of two processors,
@FTANGLE{} and @FWEAVE{}.  Both operate on a single source file, say
@file{test.web}.  @FTANGLE{} produces compilable code, say @file{test.c},
whereas @FWEAVE{} produces a @TeX{} file, @file{test.tex}, that can
(in principle) be processed with either @TeX{} or La@TeX{}.  (If a file
@file{test.tex} already exists, @FWEAVE{} will ask for confirmation
before overwriting it if it does not think that the file was created by
a previous run of @FWEAVE{}.)

The output file produced by @FTANGLE{} is not intended for human eyes
(or for editors!); it is for compiling only.  All changes to the code
should be made to the @code{web} file, since changes made directly to
the output file would be overwritten the next time the @code{web} source
is tangled.  In an attempt to discourage messing with @FTANGLE{}'s
output file, all unnecessary spaces are deliberately removed.

@cindex Makefiles, using
A common way of integrating @FWEB{} into ones program development is to
do all compilations through a @code{make} file, into which one puts an
extra dependency line that explains how to produce the compilable output
file from the @code{web} source.  For example,

@example
test.c: test.web
        ftangle test

test.o: test.c
        gcc -c test test.c
@end example
@noindent
With this approach, one is not so tempted to edit @file{test.c}.

@FWEB{} development is now based on La@TeX{}; Plain @TeX{} is no longer
supported.  For detailed descriptions of the La@TeX{} support, see @ref{LaTeX}.


@node Structure, Modules, Phases, Concepts
@comment  node-name,  next,  previous,  up

@section The structure of a web

@cindex Web, structure
An @FWEB{} source file is structured into @dfn{sections}, which
correspond to logical subunits of the code (either a function or a
fragment of a function).
@cindex Sections
Each section consists of three @dfn{parts}, each of which is optional:
@cindex Parts
@cindex Part, @TeX{}
@cindex Part, definition
@cindex Part, code
the

@quotation
@enumerate
@item
@TeX{} part;

@item
definition part; and

@item
code part.
@end enumerate
@end quotation
@noindent
When @FTANGLE{} outputs code, it can combine
the code parts of (possibly noncontiguous) sections into
larger units called @dfn{modules}, as explained in @ref{Modules}.

With the aid of sections, one's possibly huge and logically complex code
can be broken down into bite-sized pieces, each one easily
comprehensible.  Since sections may correspond to only a small part of a
function or subroutine, 1000-line main programs (they still exist!)
should become a thing of the past.

Since sections can be combined into modules, there is no
need for sections that must be physically contiguous in the output file
to be contiguous in the source file.  This allows for great flexibility
in structuring the documentation of the code.

@subsubsection A simple example

@cindex Example, of @FWEB{} file
A simple example of an @FWEB{} source file consisting of three sections is as
follows:

@example
@group
@@n/ % Set FWEB language to Fortran, and recognize short // comments.

\Title@{example.web@} % \Title is an FWEB TeX macro.
\author@{J. A. Krommes@} % \author is a LaTeX macro.

@@* INTRODUCTION. 
This code is intended to illustrate the use of the |write| statement.
It also provides a simple example of the \FWEB\ macro preprocessor.

@@m A_CONSTANT 1.2345 // \FWEB\ preprocessor macro definition.

@@a
        program main
        call compute
        end

@@ The computational routine is pretty boring.
@@a
        subroutine compute
        write(*,*) 'Macro value = ', A_CONSTANT
        end

@@* \INDEX.
@end group
@end example

Commands to @FWEB{} are begun by the @samp{@@} symbol (@pxref{AT
commands}).  In this example, the first command, @samp{@@n}, sets the
global language to @sc{Fortran}-77.  One should always begin one's code
with a language-setting command.  

In this example, the language command is invoked with an optional
argument @samp{/}.  That is necessary in @sc{Fortran} in order to tell
@FWEB{} to use the short (single-line) comment form beginning with
@samp{//}, which otherwise conflicts with the concatenation operator.  
@xref{-n/}. 

For more information about languages, see @ref{Languages}.  For a fuller
discussion of optional arguments, see @ref{Setting the language}.

@findex @@*
@cindex Sections, named
@cindex Sections, unnamed
The @samp{@@*} command begins a @dfn{major} or @dfn{named section}
(corresponding to La@TeX{}'s @code{\section} command); this command is
followed by the section name, terminated by a period.  (The period is
essential; if it is omitted, weird errors may result.)  Major sections
are entered in an automatically generated Table of Contents.  They are
also printed at the top of each output page.  If the full section name
is too long to so print, one can shorten it with an optional argument,
as in

@example
@@* [INTRO]INTRODUCTION.
@end example

The command @samp{@@*@i{n}} (not illustrated in the above example)
begins a major (sub)section of level @i{n}, where @samp{@@*0} is
equivalent to the simple @samp{@@*}, @samp{@@*1} indicates a subsection,
and @samp{@@*2} indicates a subsubsection.  The highest
permissible major level is 2 (a subsubsection).  Such subsections are
also entered in the Table of Contents.  For more information, see
@ref{Sections}.

@findex \INDEX
@cindex Index
As the example demonstrates, the name of the very last section, which
should be starred, should be @samp{\INDEX}.  Note the backslash;
@samp{\INDEX} is a @TeX{} macro.  This command tells @FWEAVE{} to
write out the index in a special two-column format.  By default,
@samp{\INDEX} expands to @samp{INDEX}, but this name can be overridden
by the style-file parameter @samp{index.name} (@pxref{S_index}).  For
more discussion of @FWEB{}'s indexing facilities, see @ref{Index}.

Minor (@dfn{unnamed}) sections are begun by @ASP{} (``at-space'');
these have no associated names and are not entered into the Table of
Contents.  A newline counts as a space.

@subsubsection The @TeX{} part

@cindex Commentary, optional
@cindex Part, @TeX{}
All sections begin with (optional) @TeX{} commentary.  That can just be
straight text; to input that, no knowledge of @TeX{} is required.  It
can also include mathematical exposition or any of the other advanced
features offered by @TeX{}.

Whenever @FWEB{} is in @TeX{} mode, one can temporarily shift into @dfn{code mode}
@cindex Code mode
@cindex Vertical bars
@cindex Code, typesetting
by enclosing the
code within vertical bars.  That code is typeset just like code in the
code part (see below), except that newlines are replaced by spaces.
Thus, one can say things like

@example
Consider the C code fragment `|@@c for(i=0; i<10; i++)@{@}|', which ...
@end example
@noindent
(If the global language were C instead of @sc{Fortran}, the @samp{@@c} inside
the vertical bars would not be necessary.)
The ability to switch back and forth between text mode and code mode at
will allows for a very convenient and flexible style of exposition. 

@subsubsection The definition part

@cindex Part, definition
The @TeX{} part is followed by an
optional @dfn{definition part}.  The beginning of the definition part is
signaled by the appearance of any one of the commands @samp{@@d}, @samp{@@f},
@samp{@@m}, @samp{@@v}, or @samp{@@W} (explained later).
In the previous example, the first section has a
definition part consisting of one @FWEB{} macro definition (@samp{@@m}); the
second section has no definition part.  For more information, see @ref{Macros}.

(Failure to appreciate how easy it is to shift from part to part can get
one into trouble.  For example, don't write documentation such as
@samp{Consider the @@m command}, because the @samp{@@m} will inadvertently
terminate the documentation part and begin the definition part.  What
one needs to do here is to use the literal @samp{@@}, as in
@samp{@@@@m}.)
@cindex @@, literal

@subsubsection The code part

@cindex Part, code
An unnamed @dfn{code part} is begun by @samp{@@a}.  A named code part is begun
by the appearance of a module name, such as @samp{@@<Global
variables@@>}, followed by an equals sign; see @ref{Modules}.  Within
the code part, one can place any sequence of code or code fragments
(they need not be complete subroutines) that are valid for the current
language.  (Setting the language is described in @ref{Languages}.)  The
code part is terminated by the next appearance of @samp{@@*} or @ASP{}
(which signal the beginning of a new section), or by the end of file.

@subsubsection The limbo section

@cindex Section, limbo
@cindex Limbo section
The portion of the source file before the first section (i.e., before
the first @samp{@@*} or @ASP{}) is called @dfn{in limbo} or
@dfn{the limbo section}.  
@cindex Limbo section
The only @samp{@@} commands that are allowed in limbo (in addition to
@samp{@@@@}, which stands for the character @samp{@@} and is allowed
anywhere) are the language-changing commands, and one of those, such as
@samp{@@c}, should appear.  Other text in limbo is ignored by @FTANGLE{}
and is copied by @FWEAVE{} to the @code{tex} output file.  Thus, one can make or
issue @TeX{} macro definitions in limbo that override the defaults in
@FWEB{}'s macro package @file{fwebmac.sty}.  In the above example, see
the @code{\Title} command.  This is defined in @file{fwebmac.sty}, and
basically issues La@TeX{}'s @code{\title} command.

(Another way of getting @TeX{} text into the limbo section is by means of
the @samp{@@l} command; see @ref{ATl}.)

La@TeX{} users may need to know that @TeX{} commands in limbo are
executed @emph{after} the @samp{\begin@{document@}} command (which is
issued automatically in @file{fwebmac.sty}).  For more information, see
@ref{LaTeX}.

@node Modules, , Structure, Concepts
@comment  node-name,  next,  previous,  up

@section Modules

@cindex Modules
The code parts of (possibly noncontiguous) sections can be combined into
@dfn{modules}.   For @FWEAVE{}, this is a @emph{logical} combination, for
purposes of cross-referencing different pieces of the code.  But for
@FTANGLE{}, the combination is physical; @FTANGLE{}'s output proceeds module
by module.

Modules can be @dfn{named} or @dfn{unnamed}. There is exactly one
unnamed module. The fundamental operation of @FTANGLE{} is that

@quotation
@emph{@FTANGLE{} outputs the unnamed module}.
@end quotation
@noindent
That output goes to a compilable file with an extension appropriate to
the current language.

The contents of a module, either unnamed or named, consists of a mixture
of code and comments.  @FTANGLE{} ignores the comments; @FWEAVE{}
treats them as @TeX{} text.  Within any @TeX{} text, including comments,
constructions delimited by @samp{|...|} signify a temporary shift into
code mode.  (In the present design, one cannot enclose a comment within
the vertical bars.)

@subsection The unnamed module

The unnamed code module 
@cindex Unnamed module
@cindex Module, unnamed
is introduced by the command @samp{@@a}.  Subsequent
uses of @samp{@@a} accrete code to the unnamed module.
To repeat, the fundamental operation of @FTANGLE{} is that

@quotation
@emph{@FTANGLE{} outputs the unnamed module}.
@end quotation

@noindent
Thus, there must be at least one @samp{@@a} in the source file or
@FTANGLE{} will output nothing.

(Why is the command called @samp{@@a}?  Historically, it was the first
letter of the alphabet, as befits its prominent status.  However, one
can also think of it as ``accrete.'')

@subsection Named modules

@cindex Named module
@cindex Module, named
Named modules represent logically-connected fragments of code.

A module name is specified by the construction

@example
@@< @i{Arbitrary @TeX{} text} @@>
@end example

@noindent
Leading and trailing white space around the name text is ignored.  The
name text can include the @samp{|...|} construction, which tells
@FWEAVE{} to typeset a code fragment.  Thus, module names can be
highly explicit---for example,

@example
@@< Check that |x >= 0.0|; |abort| if not @@>
@end example

To define a named module, replace the @samp{@@a} that begins the unnamed code
part of a section by @samp{@@< @i{module name} @@>=}.  If one uses this
construction with the same name in a later section, the effect is to
@emph{accrete} to the contents of the module.  Thus, a named module
might ultimately consist of the code from sections 2, 5, and 9, for
example.

To use a named module, simply use the name anywhere in a code part;
@FTANGLE{} will insert the contents of the module at the point where the
name is used.  For example,

@example
@@c
@@ Here's how to use a named module.
@@a
for(i=1; i<n; i++)
        @@< Inner loop @@>@@;

@@ Here's how to define a named module.  Definitions may occur after use.
@@< Inner...@@>=
@{
a[i] = i;
@}
@end example

@noindent
There are several details to notice about the above example.  First,
@FWEAVE{} considers module names to be simple expressions (such as the
single identifier @var{x}).  In C, expressions are made into complete
statements (as is required in the body of a @b{for} statement) by
appending a semicolon.  In this case, a @emph{pseudo-semicolon}
@samp{@@;} is appropriate; for more discussion of that,
see @ref{AT;}.  

Second, after a name has appeared once in full, it may be
abbreviated by a unique prefix followed by three periods, as demonstrated in
the above example.  By convention, a complete module name cannot be a
subset of another.  For example, @samp{@@<Test@@>} and @samp{@@<Test of
graphics@@>} will elicit an error message.

Commonly, the first unnamed section in the code indicates its modular
structure.  For example, a C code might begin with

@example
@@c
@@* DEMO.
@@a
@@<Include files@@>@@;
@@<Typedefs@@>@@;
@@<Function prototypes@@>@@;
@@<Global variables@@>@@;
@end example

@noindent
Subsequently one can accrete to the above named sections, as often as
desired and in any order.  This way, definitions of global variables can
be introduced anywhere in the @code{web} source file as logical and pedagogical
exposition dictates, but will 
be guaranteed to appear at the top of the code.  Function prototypes
could be handled this way as well; alternatively, they could all be
collected into one section, perhaps at the end of the source file.  (The
above organization still guarantees that they will appear at the
beginning of the output.)  Functions could be introduced one at a time
in subsequent unnamed sections.

Very rarely, one might try the following construction:

@example
@@
@@a
@@< @i{Left side} @@> = @@< @i{Right side} @@>@@;
@end example
@noindent
Here the intent is to construct an assignment statement.  However, this
will be flagged as an error because @FWEB{} thinks one is trying to
define the named module @samp{@@<@i{Left side}@@>}, which one shouldn't be
doing while in code mode.  To make it work, just put the invisible
expression @samp{@@e} (@pxref{ATe}) before the equals sign.

@node Phases, Structure, Processors, Concepts
@comment  node-name,  next,  previous,  up

@section Phases of processing

The @FWEB{} processors perform their work in several distinct phases.
(The following is somewhat technical.  Scan it, then use it for
reference later if necessary.)

@subsection The phases of @FTANGLE{}

@cindex Phases, of @FTANGLE{}
@FTANGLE{} has two phases.  In phase 1, the source file is read; in phase
2, compilable code is written out in the order specified by the web.

More specifically, phase 1

@quotation
@itemize @bullet
@item
discards @TeX{} documentation;

@item
tokenizes the source;

@item
expands @FWEB{} preprocessor commands such as @samp{@@#if}
(@pxref{Preprocessing}); 

@item
expands @samp{@@'...'} (@pxref{ATquote}), @samp{@@"..."} (@pxref{ATdquote}),
and the binary notation @samp{0b...} (@pxref{C}) [in @sc{Fortran}, also
the octal notation @samp{0...} and the hexadecimal notation @samp{0x...}]; 

@item
stores code text in appropriate modules;

@item
memorizes macro definitions (@samp{@@d} and @samp{@@m})
(@pxref{ATd} and @ref{ATm}).  
@end itemize
@end quotation

Phase 2

@quotation
@itemize @bullet
@item
outputs outer macro definitions (@samp{@@d});

@item
outputs the unnamed module (@samp{@@a});

@item
expands @FWEB{} macros (@samp{@@m});

@item
expands built-in macros such as @samp{$IF} or @samp{$PI}
(@pxref{Built-in functions}); 

@item
translates @sc{Ratfor} statements (@pxref{Ratfor}).
@end itemize
@end quotation

@subsection The phases of @FWEAVE{}

@cindex Phases, of @FWEAVE{}
@FWEAVE{} has three phases.  In phase 1, the source file is read and
cross-reference information is collected.  In phase 2, the source file
is read again, then pretty-printed with some cross-reference
information.  (For discussion of pretty-printing, see
@ref{Pretty-printing}.)  In phase 3, an automatically-generated Index,
List of Modules, and Table of Contents are written.

More specifically, phase 1

@quotation
@itemize @bullet
@item
tokenizes and stores identifiers and module names;

@item
collects cross-reference information (including, in C and C++, the
scanning of @samp{#include} files for @samp{typedef} and/or @samp{class}
declarations (@pxref{-H_}); 

@item
stores limbo text definitions made with @samp{@@l} (@pxref{ATl});

@item
collects information about overloaded operators (@samp{@@v}) and
identifiers (@samp{@@W}).  @xref{ATv} and @ref{ATW_}.
@end itemize
@end quotation

Phase 2

@quotation
@itemize @bullet
@item
outputs limbo text;

@item
outputs special @TeX{} macros for overloaded operators;

@item
copies @TeX{} material directly to output;

@item
treats material between vertical bars (@samp{|...|}) as code to be
typeset;

@item
tokenizes and stores contents of each code section;

@item
analyzes code syntax and converts it to appropriate @TeX{} macros.
@end itemize
@end quotation

Phase 3 writes out cross-reference information.  (To eliminate some of
that, see @ref{-x}.)  Specifically, it

@quotation
@itemize @bullet
@item
writes out the Index (@file{INDEX.tex} by default, but see @ref{Output
files} and @ref{Index params});

@item
writes out a list of named modules (@file{MODULES.tex} by default, but
see @ref{Output files} and @ref{Module params});

@item
writes out macros to generate the Table of Contents.  (Table of Contents
information is actually processed by La@TeX{}, not @FWEAVE{}.  The
information is written to the @file{aux} file.)
@end itemize

@end quotation


@node Files, Starting, Concepts, Top
@comment  node-name,  next,  previous,  up

@chapter FILES

@cindex Files
@FWEB{} works with a variety of files.  File names have the form
@samp{[path]/root[.ext]}, where the brackets denote optional.  Here the slash
is called the @dfn{prefix end character}.  Since this character differs
for various 
operating systems, it can be changed by system installers in @file{custom.h}
(@pxref{Customization}). 
The character that initiates the file-name extension (normally a period)
can be changed with the @samp{-E} command-line option (@pxref{-E_}).


@menu
* Input files::         Input files.
* Output files::        Output files.
* Change files::        Change files.
@end menu

@node Input files,Output files,Files,Files
@comment  node-name,  next,  previous,  up

@section Input files

@cindex Files, input
@FWEB{} reads files with a variety of default extensions.

@quotation

@file{.fweb} --- Initialization file (optional; for setting up default options
used for all runs).  This file is always in the user's home directory.
@xref{Initialization}.
@findex .fweb

@file{fweb.sty} --- Style file (optional; for customizing the behavior
of a particular @code{web} file or group of files).  @xref{Style}.  This
file is always in 
the directory of the @code{web} file that is being tangled unless that
is changed by environment variable @code{FWEB_STYLE_DIR}.  The basic
name can be changed by the @samp{-z} option (@pxref{-z}).
@findex fweb.sty
A sample @file{fweb.sty} file is provided with the @FWEB{} distribution.

@file{@i{name}.web} --- Source file.

@file{@i{name}.ch} --- Change file (optional; for making incremental changes
to a @code{web} source file).  @xref{Change files}.

@file{@i{name}.hweb} --- Code included into web file with @samp{@@i}
(@pxref{ATi}). 
Include files are searched for in the path set by the environment
variable @code{FWEB_INCLUDES} and/or the @samp{-I} option (@pxref{-I_}).
If that path is empty, then the current directory is searched.

@file{@i{name}.hch} --- Optional change file for include file.
@end quotation

@menu 
* Completion::          Automatic file-name completion.
@end menu

@node Completion,,Input files,Input files
@comment  node-name,  next,  previous,  up

@subsection Automatic file-name completion

@cindex File-name completion
@cindex Completion, automatic file-name
Automatic completion of input file names is turned on by the @samp{-e}
command-line option (@pxref{-e}). When this option is in effect, input
file names that 
include no period (have no extension) are completed automatically
according to the contents of the following style-file entries:

@quotation
@multitable { for include file} {Style-file entry} {Default}
@item
@r{Type of file} @tab    @r{Style-file entry} @tab      @r{Default}
@item
@r{WEB file} @tab           @code{ext.web} @tab         @code{web}
@item
@r{Change file} @tab       @code{ext.ch} @tab          @code{ch}
@item
@r{Include file}  @tab     @code{ext.hweb} @tab        @code{hweb}
@item
@r{Change file for include file} @tab @code{ext.hch} @tab         @code{hch}
@end multitable
@end quotation
@noindent 
More than one extension may be specified, as a space-delimited
list---e.g., @samp{ext.web = "web wb"}; the first one that matches is used.  

@node Output files,Change files,Input files,Files
@comment  node-name,  next,  previous,  up

@section Output files

@cindex Files, output
@FWEAVE{} writes a variety of output files.

@quotation
@file{@i{name}.tex} --- Woven output to be processed with La@TeX{}.

@file{CONTENTS.tex} --- Temporary file that accumulates
Table-of-Contents information.  (For La@TeX{}, the @file{aux} file is
used instead.)
@findex CONTENTS.tex

@file{INDEX.tex} --- Temporary file that stores indexing information.
@findex INDEX.tex

@file{MODULES.tex} --- Temporary files that stores module list.
@findex MODULES.tex
@end quotation

@noindent
@cindex Output files, changing names of
The names of the three temporary files can be changed with style-file
parameters (@pxref{Style}).  Commonly, one may put into the style file
@file{fweb.sty} commands such as

@example
index.tex "#.ndx"
modules.tex "#.mds"
contents.tex "#.cts"
@end example

@noindent
The @samp{#} is replaced by the root name of the @code{web} file.

@FTANGLE{} writes files of the form

@quotation
@file{@i{name}.@i{ext}} --- Compilable output file.
@end quotation
@noindent
The extensions for the compilable output file(s) have certain defaults,
but can be changed by style-file parameters according to the following
table:

@quotation
@multitable {Fortran-77} {style-file entry} {unix default} {non-unix default}
@item
@r{Language} @tab @r{Style-file entry} @tab @r{@sc{unix} default} @tab @r{non-@sc{unix} default}
@item
 C           @tab @code{suffix.C}    @tab @code{c} @tab    @code{c}
@item
 C++         @tab @code{suffix.Cpp}  @tab @code{C} @tab    @code{C}
@item
 Fortran--77 @tab @code{suffix.N}    @tab @code{f} @tab    @code{for}
@item
 Fortran--90 @tab @code{suffix.N90}  @tab @code{f90} @tab  @code{for90}
@item
 Ratfor--77  @tab @code{suffix.R}    @tab @code{r}  @tab    @code{rat}
@item
 Ratfor--90  @tab @code{suffix.R90}  @tab @code{r90} @tab @code{rat90}
@item
 TeX         @tab @code{suffix.X}    @tab @code{sty} @tab   @code{sty}
@item
 VERBATIM    @tab @code{suffix.V}    @tab @code{mk} @tab   @code{mk}
@end multitable
@end quotation
@noindent
For example, to change the default extension for a C++ file from
@samp{C} to @samp{c++}, put into @file{fweb.sty} the line

@example
suffix.C = "c++"
@end example
  
@node Change files,,Output files,Files
@comment  node-name,  next,  previous,  up

@section Change files

@cindex Files, change
The primary input to the @FWEB{} processors is the @file{test.web}
source file. However, a @dfn{change file} @file{test.ch} can also be
specified.  A change file consists of instances of the following
structure:

@example
@@x
(One or more lines of text, EXACTLY as in the web file.  Copy these
lines with an editor; don't type them from scratch.)
@@y
(Replacement text.)
@@z
@end example

@noindent
The change-file mechanism allows one to insert local changes or test new
code without physically modifying the original web file.

To specify a change file, use its name as the second file name on the
command line.  The extension @samp{.ch} is assumed by default.  For
example,

@example
ftangle test test
@end example

@noindent
processes @file{test.web} with the change file @file{test.ch}.

@findex @@[
@findex @@]
In addition to @samp{@@x}, @samp{@@y}, and @samp{@@z}, the only
@samp{@@} commands allowed in a change file are language-changing
commands such as @samp{@@c} and the special commands @samp{@@[} and
@samp{@@]}.  The command @samp{@@[} is used for column-oriented
languages such as @sc{Fortran}--77 and means @dfn{switch into code
mode}.  Similarly, @samp{@@]} means @dfn{switch out of code mode}.

All @samp{@@} commands in a change file must begin in column 1.  Lines
not beginning with @samp{@@} are ignored, so may be used as comments.
Comments may also be included on the @samp{@@x}, @samp{@@y}, and/or
@samp{@@z} lines.

@node Starting, AT commands, Files, Top
@comment  node-name,  next,  previous,  up

@chapter RUNNING @FWEB{}

@FWEB{} has a @sc{unix}-style command-line syntax.  There are many
command-line options, but few or none of these are necessary for
standard appplications.  Proceed in blissful ignorance until you need to
do something tricky, then scan the list of options to see if they can
help.

Commonly-used command-line options can be placed into the initialization
file @file{.fweb} (@pxref{Options}) that resides in one's home directory.

A @dfn{style file} (patterned after the utility @code{makeindex};
@pxref{Style}) can be associated with each manuscript or collection of
related manuscripts in order to customize their appearance.  This file
is read @emph{after} the command-line options are processed, except that
the @samp{-p} option gets special treatment; see @ref{-p}.

@menu
* Syntax::      Command-line syntax.
* Options::     Command-line options.
@end menu

@node Syntax, Options, Starting, Starting
@comment  node-name,  next,  previous,  up

@section Command-line syntax

The command-line syntax is
@cindex Syntax, command-line

@example
@{ftangle | fweave@} [-option...] webfile[.web] [changefile[.ch]] 
@end example
@noindent
A file name is anything that doesn't begin with a @samp{-}, except that
a lone hyphen stands for the special file name
@file{stdin}, which means `read from the standard input.'  (This should
not be used except for very special effects.) 
@findex -

Command-line options begin with a @samp{-}.  File names and options can
be intermixed, or the 
options may appear after the file names.  The first file name
encountered is the web source file; the second, if it exists, is
the change file (@pxref{Change files}).  [When no change file is
specified, @FWEB{} attempts 
to read from the null file (@file{/dev/null} on @sc{unix} systems).  This
name should be specified when @FWEB{} is installed
(@pxref{Customization}), or can be set in the style file @file{fweb.sty}.
@xref{null_file}.] 

The web file is shown as required since one is normally processing a
source.  However, some of the information options (@pxref{Info options})
will work without specifying any file name.  For example, one can obtain a
list of all of the style-file parameters and their default values by saying
@w{@samp{ftangle -Z}}.

@node Options, , Syntax, Starting
@comment  node-name,  next,  previous,  up

@section Command-line options

Command-line options may be put, one per line, into the initialization file
@file{.fweb} (which is always in the user's home directory).
In that file, options beginning with a hyphen are processed @emph{before}
the command-line options (so command-line options can override the
defaults).  To force an option to be processed @emph{after} the 
command-line options, preface it with an ampersand
rather than a hyphen; this is rarely necessary.

To make sense of the plethora of options, it helps to know that options
beginning with @samp{n} are related to @sc{Fortran}; those beginning
with @samp{r} are related to @sc{Ratfor}.  Some flags that can be set
separately for those two languages also have a global option that sets the
flags for both languages simultaneously; cf. @samp{-n/}, @samp{-r/}, and
@samp{-/}.

Some options take arguments.  For example, an @FWEB{} macro can be
defined from the command line by saying something like @samp{-mIBMPC=1}.
Unlike many @sc{unix} utilities, @emph{no spaces are allowed between any
option and its argument.}  For example, if one says @samp{-m IBMPC},
@FWEB{} will think that @file{IBMPC} is a file name.

@menu
* Negating options:: How to invert the meaning of an option.
* -1::          Brief debugging mode.
* -2::          Verbose debugging mode.
* -@@: -AT.      Display information about control codes.
* -A: -A_.      Turn on ASCII translations.
* -B: -B_.      Turn off audible beeps.
* -b::          Number blocks.
* -C: -C_.      Set the color mode.
* -c::          Set global language to C.
* -c++: -cpp.   Set global language to C++.
* -D: -D_.      Display information about @FWEB{}'s reserved words.
* -d::          Convert unnumbered `do...enddo's to Fortran--77.
* -E: -E_.      Change the delimiter of a file-name extension.
* -e::          Turn on automatic file-name completion.
* -F: -F_.	Compare output files with old versions.
* -f::          Turn off module references for identifiers.
* -H: -H_.      Scan #include files to format typedef and/or class commands.
* -h::          Where to get help.
* -I: -I_.      Append a directory to search list for include files.
* -i::          Don't print contents of @@I include files.
* -i!::         Don't even read @@I include files.
* -j::          Inhibit multiple includes of the same file.
* -k::          Don't recognize lower-case forms of Fortran I/O keywords.
* -L: -L_.      Select global language.
* -l::          Echo the input line.
* -M: -M_.      Set output message level.
* -m::          Define an @FWEB{} macro.
* -m4::         Understand the m4 built-in commands.
* -m;::         Append pseudo-semicolons to @FWEB{} macro definitions.
* -n::          Set global language to Fortran--77.
* -n9::         Set global language to Fortran--90.
* -n@@;: -nAT;. For Fortran, supply pseudo-semicolons automatically (default).
* -n;::         For Fortran, supply actual semicolons automatically.
* -ncolon::     In Fortran, place statement labels on separate lines.
* -nb::         In Fortran, number the ifs and dos.
* -nC::         In Fortran, ignore single-line comments ('C', 'c', or '*').
* -np::         Print semicolons in woven Fortran output.
* -n\::         In Fortran--90, free-form syntax continued with '\\'.
* -n&::         In Fortran--90, free-form syntax continued with '&'.
* -n/::         In Fortran, recognize '//' as the start of a short comment.
* -n!::         In Fortran, make '!' denote the start of a short comment.
* -n)::         In Fortran, reverse array indices.
* -o::          Turn off @FWEAVE{}'s mechanisms for overloading operators.
* -q::          Don't translate Ratfor.
* -P: -P_.      Select TeX processor.
* -p::          Set style parameter.
* -r::          Set the global language to Ratfor--77.
* -r9::         Set the global language to Ratfor--90.
* -rb::         In Ratfor, number the ifs and dos.
* -rg::         Set |goto| parameters.
* -rk::         Suppress comments about Ratfor statement translation.
* -rK: -rK_.    Write out comments about Ratfor statement translation.
* -r@@;: -rAT;. Turn on Ratfor's auto-semi mode, using pseudo-semicolons.
* -r;::         Turn on Ratfor's auto-semi mode, using actual semicolons.
* -r/::         In Ratfor, recognize '//' as the start of a short comment.
* -r!::         In Ratfor, make '!' denote the start of a short comment.
* -r)::         In Ratfor, reverse array indices.
* -s::          Print statistics about memory usage.
* -T: -T_.      Flag-setting commands for @FTANGLE{}.
* -t::          Truncate identifiers.
* -U: -U_.      Convert reserved output tokens to lower case.
* -u::          Undefined a predefined or command-line macro.
* -V: -V_.      Print version number.
* -v::          Make all comments verbatim.
* -W: -W_.      Flag-setting commands for @FWEAVE{}.
* -w::          Change name of @FWEB{}'s macro package.
* -X: -X_.      Print selected cross-reference information.
* -x::          Reduce or eliminate cross-reference information.
* -y::          Allocate dynamic memory.
* -Z: -Z_.      Display default values of style-file parameters.
* -z::          Change name of style file.
* -.::          Don't recognize dot constants.
* -\::          Explicitly escape continued strings.
* -(: -lp.      Continue parenthesized strings with backslashes.
* -colon::      Set starting automatic statement number
* ->::          Redirect tangled output.
* -=::          Redirect tangled output.
* -#::          Don't print comments about line numbers and module names
                in tangled output.
* -+: -plus.    Don't interpret compound assignment operators.
* -/::          Recognize '//' as the start of a short comment.
* -!::          Make '!' denoted the start of a short comment.

* Info options:: Information options.
@end menu

@node Negating options,-1,Options,Options
@comment  node-name,  next,  previous,  up

@subsection Negating options

@cindex Options, negating
To negate a command-line option, use an extra hyphen.  For example,
@samp{--v} means `Don't make all comments verbatim.'  This kind of
construction isn't used very often, but it is useful if an option such
as @samp{-v} is turned on in the @file{.fweb} initialization file and
one wishes to turn it off for just one run.

@node -1,-2,Negating options,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-1}:  Turn on brief debugging mode (@FWEAVE{})

@findex -1
@cindex Debugging
This option tells @FWEAVE{} to display irreducible scrap sequences.
@cindex Scrap, irreducible

A @dfn{scrap} is a part of speech.  The expression @samp{x + y} consists of
three scraps: @samp{x} (an expression), @samp{+} (a binary operator),
and @samp{y} (an expression).  @FWEAVE{} contains @dfn{production rules}
such as ``replace the combination @samp{expr binop expr} with
@samp{expr}.''  If all goes well, the result of @FWEAVE{}'s reduction
process is ultimately just one scrap, such as @samp{function}.  If
@FWEAVE{} is left with more than one scrap at the end of a section,
this is called an @dfn{irreducible scrap sequence}; @samp{-1} displays
them.

Irreducible scrap sequences can arise either because the programmer made
a mistake or because @FWEAVE{} has not been taught the proper grammar.

@cindex Output, changing appearance of
While @FWEAVE{} is reducing the scraps, it appends @TeX{} macros that
ultimately produce the pretty-printed output.  Frequently people ask how
to change the appearance of that output.  Fundamentally, this is not
possible at present; the grammar rules and the associated @TeX{} are
hard-coded.  A completely general, user-customizable scheme is very
complex and daunting; it has not been attempted.

This brief debugging mode can be turned on more locally by means of the
@samp{@@1} command.  @xref{AT1}.

@node -2,-AT,-1,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-2}:  Turn on verbose debugging mode (@FWEAVE{})

@findex -2
@cindex Debugging
This option tells @FWEAVE{} to display detailed reductions of the
scraps as it does the pretty-printing.  (For a discussion of scraps, see
@ref{-1}.)  Sometimes @FWEAVE{} fails spectacularly at
pretty-printing a section, either because of a syntax error on the
part of the user or because of a bug in @FWEAVE{}'s logic.  This
option helps one (usually the system developer!) to figure out why.

This feature can be turned on more locally by means of the @samp{@@2}
command.  @xref{AT2}.

@node -AT, -A_, -2, Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-@@}:  Display the control-code mappings

@findex -@@
@cindex Options, information
This option supplies information about the @samp{@@} control codes
(@pxref{AT commands}).  It shows the associated style-file parameters
that can be used to remap the codes (but @emph{don't do that!}), and it
displays the precedence.  (Some codes such as @samp{@@@@} may be used
anywhere; others such as @samp{@@*} begin 
a new section or part of section.  Codes that begin the definition part
are labelled by @samp{[D]}; codes that begin the code part are labelled
by @samp{[C]}; codes that begin a new section are labelled by
@samp{[S]}.)

The option produces two columns of output: the first is sorted
numerically, the second alphabetically.  The notation @samp{USED_BY_OTHER}
means that this command is ignored by whatever processor (@FTANGLE{}
or @FWEAVE{}) is currently being run, but may be used by the other
processor.  (For technical reasons, a very few commands such as
@samp{@@i} do not show up in this output at present.)

If one says just @samp{-@@}, information about all control codes is
produced.  Selected control codes may be queried by listing them after
the @samp{-@@}.  For example, to learn about the commands @samp{@@~} and
@samp{@@a}, say @samp{-@@~a}.  Remember to quote certain characters on
@sc{unix} systems---e.g., @samp{-@@'*?'}.  If a command is used by
neither processor, its description will be replaced by a question mark.

@node -A_,-B_,-AT,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-A}:  Turn on ASCII translations

@findex -A
This option is used primarily for debugging.  @FWEB{} works
internally with the ASCII character set.  If @FWEB{} is run on a
non-ASCII machine (notably IBM mainframes), translations to and from the
internal ASCII are done automatically; on an ASCII machine, these
translations are unnecessary and are not performed unless the @samp{-A}
option is used.

@node -B_, -b, -A_, Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-B}:  Turn off audible beeps

@findex -B
@cindex Marriage
@FWEB{} sometimes beeps the terminal when it encounters certain errors.  The
@samp{-B} option turns off the beeps, replacing them by a printed
exclamation point.

(This option is sometimes called the ``marriage-saver,'' after the
situation that prompted a user's request for this feature.)

@node -b,-C_,-B_,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-b}:  Number blocks (@FWEAVE{})

@findex -b
@cindex Numbering blocks
@cindex Blocks, numbering
Number @b{do} and @b{if} blocks in woven @sc{Fortran} and @sc{Ratfor} output.
This feature is particularly useful in @sc{Fortran}-77 to help correlate
the beginnings and ends of long blocks (but note that appropriate use of
literate programming techniques can keep all of one's blocks short!).
Output something like the following is produced, where the comments are
inserted automatically by the @samp{-b} option:

@example
do i=1,10 // Block 1
 do j=1,10 // Block 2
  if(i==j) then // Block 3
        call sub1(i)
  else // Block 3
        call sub2(i,j)
  endif // Block 3
 end do // Block 2
end do // Block 1
@end example
@noindent

The precise form of the block comment that is emitted can be changed by
redefining the macro @code{\Wblock} in @file{fwebmac.sty}.
@findex \Wblock

@node -C_, -c, -b, Options
@comment  node-name,  next,  previous,  up

@findex -C
@subsection @samp{-C}:  Set the color mode

@cindex Color, setting
The option @samp{-C@var{n}} sets the color mode to @var{n}, where the
color modes are, briefly, 

@quotation
@table @kbd
@item 0
No color
@item 1
ANSI color
@item 2
Bilevel
@item 3
Trilevel
@item 4
User-defined
@end table
@end quotation
@noindent
These modes, and color output in general, are described more thoroughly
in @ref{Color}. 

For obscure technical reasons, this command is processed differently
than all other command-line options.  In the present incomplete
implementation, @emph{the color mode must be set on the command line},
not in @file{.fweb}!  To work around this annoyance, @sc{unix} users
could alias commands such as @w{@samp{ftangle -C1}}.

@node -c, -cpp, -C_, Options
@comment  node-name,  next,  previous,  up

@findex -c
@subsection @samp{-c}:  Set global language to C

@cindex Language, setting
Usually the global language (@ref{Languages}) is set to C by means of
the command @samp{@@c} in limbo, rather than using @samp{-c} on the
command line.  However, one may need to use the command-line option
@samp{-c} if a subsequent command-line option is language-dependent.
See, for example, the discussion of the option @samp{-D} in @ref{-D_}.

@node -cpp, -D_, -c, Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-c++}:  Set global language to C++

@findex -c++
For more information, see the discussion of @samp{-c} in @ref{-c}.

@node -D_, -d, -cpp, Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-D}:  Display reserved words

@findex -D
@cindex Options, information
@cindex Reserved words
@cindex Words, reserved
@cindex Intrinsic functions
@cindex Functions, intrinsic
@cindex Keywords, I/O
@cindex I/O keywords
This information option displays the list of reserved words for the
language currently in force.  (For the purposes of this option,
`reserved words' include ``true'' reserved words such as @samp{int};
they also include the names of intrinsic functions such as @samp{sin}
and, for @sc{Fortran} and @sc{Ratfor}, I/O keywords such as
@samp{IOSTAT}.)  Thus, to see the reserved words for @sc{Ratfor}--90,
say

@example
ftangle -Lr9 -D
@end example

@noindent
(For this option one must set the language on the command line, because
the @samp{-D} option is processed before the limbo section of the web file is
read.)

If one says @samp{-Dabc}, one will get just the reserved words that begin with
"abc".

If one says @samp{-D*}, one will get all reserved words for all languages.

The @samp{-D} may be followed by a list of one or more optional letters
enclosed in square brackets.  (For @sc{unix} systems, don't forget to
quote the brackets, as they mean something special to the shell.)  The
letters represent which kind of reserved word to display; they may be
@samp{i} (`intrinsic'), @samp{k} (`keyword'), or @samp{r} (`reserved').
Thus, to see a list of the @sc{Fortran} keywords, say @samp{-D[k]}.  To
see a list of the intrinsic functions for C++ that begin with @samp{s},
say @samp{-Lc++ -D[i]s}.

@node -d,-E_,-D_,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-d}:  Convert do...enddo

@findex -d
@emph{(This option is obsolete.)}

@node -E_,-e,-d,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-E}:  Change the delimiter of a file-name extension

@findex -E
The standard delimiter for file-name extensions is a period, as in
@file{test.web}.  To change this character to a comma, for example, say
@samp{-E,}.  This feature is required by at least one perverse system.

@node -e,-F_,-E_,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-e}:  Turn on automatic file-name completion

@findex -e
When the @samp{-e} option is in effect, @FWEB{} attempts to be helpful in
figuring out what file name one intends.  For any input file name that
has no extension (no embedded period), @FWEB{} completes the name by adding
the extension contained in the style-file parameter listed in the
following table:

@example
        @r{Type of file}      @r{Style-file entry}        @r{Default}
        WEB file            @code{ext.web}        @code{web}
        Change file         @code{ext.ch}         @code{ch}
        Include file        @code{ext.hweb}       @code{hweb}
        Change file
         for include file   @code{ext.hch}        @code{hch}
@end example

@noindent
More than one extension may be specified, as a space-delimited
list---e.g., @samp{ext.web = "web wb"}; the first one that matches is used.  

@node -F_,-f,-e,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-F}:  Compare output files with old versions (@FTANGLE{})

@findex -F
When the @samp{-F} option is in effect, @FTANGLE{} writes its output
to a temporary file (or files) instead of to its ultimate
destination such as @file{test.c} and/or @file{test.f}.  After all
output is written, the temporary files are compared with the old version
of the files, if they exist.  If the files are identical, the
appropriate temporary file is deleted; otherwise, the temporary file is
renamed, effectively overwriting the old version.  This feature avoids
updating the time stamp on the file unnecessarily, so a @code{make} file won't
recompile the output unless it really has to.

Note that with this option in effect, if one uses the @sc{unix} utility
@code{touch} to force processing of a group of files, but the @code{web}
sources are never changed, the @code{make} file will continue to tangle
the sources no matter how many times it is run, since @FTANGLE{} will
never update the time stamp on the files.  This is harmless, but
annoying.  To get things back in sync, do a run without the @samp{-F}.

The location of the temporary file as well as details of the renaming
procedure are determined by the automatic configuration script
@code{./configure} during 
installation of the processors.  The script first looks for
the (non-ANSI) function @code{tempnam}.  
@findex tempnam
If it finds it, it uses it to place
the temporary file in the directory that @FWEB{} would normally use for
output in the absence of the @samp{-F} option.  (That is usually the current
directory.)  If @code{tempnam} is not available, the ANSI routine
@code{tmpnam} is used.
@findex tmpnam
That places the temporary file in a directory
determined by the system.  

To implement the renaming, the @code{rename} function is used.  That may fail
if @code{tmpnam} placed the temporary file on a different device.  If so, an
attempt is made to force the rename by using the @code{system} routine to
issue a @code{mv} command.  Terminal output indicates the progress of the
renaming.  An asterisk following an output file name indicates that
@code{rename} did not succeed, but the @code{mv} command did.

Some of the above-mentioned file names and system commands are
system-dependent; see @ref{Customization}.

@node -f,-H_,-F_,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-f}:  Turn off module references for identifiers (@FWEAVE{})

@findex -f
In an attempt to be helpful, @FWEAVE{} appends subscripts to many
identifiers indicating in which section they are first defined
(@pxref{Subscript params}).  Sometimes these result in output that is
too cluttered and confusing.  The @samp{-f} option turns off the
subscripting operations.

@node -H_,-h,-f,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-H}:  Scan C/C++ include files (@FWEAVE{})

@findex -H
@findex -Hx
@findex -HX
@findex -Hr
@cindex Include files, scanning
For C or C++, the @samp{-H} option tells @FWEAVE{} to do a phase-1 scan
of @code{#include} files for @samp{typedef} and/or @samp{class}
declarations.  This removes the necessity of including many redundant
@samp{@@f} format statements (@pxref{ATf}), which would otherwise be
necessary in order that the code be pretty-printed correctly.  For
example, if one uses the @samp{-H} option with the code

@example
@@c++
@@
#include <Complex.h>
Complex z;
@end example
@noindent
the identifier @b{Complex} will be properly formatted as a reserved
word (in boldface), as though one had said @samp{@@f Complex int}.

In addition to the basic @samp{-H}, there are several more detailed
options:

@quotation
@table @code
@item -Hx     
Make index entries only for double-quoted include files.
@item -HX
Make index entries for all include files.
@item -Hr
Retain temporary files generated by the preprocessor.
@end table
@end quotation

By default, index entries are not made for variables that are read
during such scans.  If one says @samp{-Hx}, index entries will be made
only for include files whose names are enclosed in double quotes rather
than angle brackets, such as @samp{#include "myheader.h"}
(usually these are defined by the user and reside in the local
directory).  If one says @samp{-HX}, index entries will be made for all
include files.  This can generate many entries, since system header
files may be complicated and may include other files as well.

This command is implemented as follows.  When @FWEAVE{} reads an
@code{#include} statement, it issues a @code{system} command to run the
C preprocessor on the included file.  Output from the preprocessor is
written to a temporary file, which @FWEAVE{} scans.

By default, the C preprocessor will look in certain default paths for
the included files.  To add to those defaults, use one or more @samp{-I}
options @emph{after} the @samp{-H}.  These colon-delimited lists are
concatenated to the contents of the environment variable
@code{FWEB_HDR_INCLUDES}, if that is defined.  The entire list is then
passed as multiple @samp{-I} options to the preprocessor.

This command, new with version 1.53, is @emph{highly experimental} and
incomplete.  The installation script attempts to determine what command
to use to run the preprocessor, but that is not guaranteed to work in
general.  @samp{-H} has been tested only with @code{gcc}.

To send arguments to the C preprocessor, see @ref{-WH_}.

The @samp{-H} mechanism uses temporary files to do its work.  By
default, those are deleted after use.  However, for debugging purposes,
one can force those to be retained by saying @samp{-Hr}.  That option
also has the side effect of displaying the actual command line that was
sent to the preprocessor.

@node -h,-I_,-H_,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-h}:  Get help

@findex -h
If just @samp{-h} is typed, a message is printed saying where further
help is available.  It refers one to the various information options
(@pxref{Info options}) and the on-line documentation
(@pxref{Support}).  If the stand-alone @code{info} program (the GNU
hypertext browser) is installed, one can enter
@samp{info FWEB} at this time by typing @samp{?} or a space-separated
list of @FWEB{} menu items such as @samp{Macros FWEB built-in $PI}.
In fact, since @samp{$PI} appears in the detailed node listing, one can
simply type @samp{$PI}.  More generally, one can type anything that
@code{info} accepts on its command line (the option @samp{-f FWEB} is
implicit). 

One can bypass the printed message and directly enter @code{info} by
specifying the @code{info} arguments as arguments to @samp{-h}.  For
example, on a @sc{unix} system, one could type @samp{-h'\$PI'}.  Here
the dollar sign must be escaped because it has special significance to
the shell, and the quotes are necessary in order to preserve that escape
character as the argument is supplied to @code{info}.  To get to the
top-level @FWEB{} info directory, type 
@samp{-h.} or @samp{-h'?'}.

@node -I_,-i,-h,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-I}:  Append to search list for include files

@findex -I
@cindex Include files, finding
The fundamental search list for @dfn{include files} (read in via @samp{@@i} or
@samp{@@I}) is defined by the environment variable @code{FWEB_INCLUDES},
which is a colon-delimited list such as

@example
setenv FWEB_INCLUDES .:/usr/fweb:/other/stuff
@end example

@noindent
The @samp{-I} option appends to this list.  

For information about include files, see @ref{ATi}.

@node -i,-i!,-I_,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-i}:  Don't print @samp{@@I} include files (@FWEAVE{})

@findex -i
@findex -ix
@cindex Include files, skipping
@cindex Include files, indexing
If a web file is included via @samp{@@I} (@pxref{ATI_}),
for example

@example
@@I formats.hweb
@end example

@noindent
then the @samp{-i} option means to read and process the web file, but don't
print its contents.  This option is often used for large files of macro
definitions, formats, or @b{typedef} statements that must be included at the
beginning of even very short web files; it clutters things up to print
such header files all of the time.  (C and C++ programmers will find that the
@samp{-H} option substantially reduces the need to include such header
files; see @ref{-H_}.)

Note that files included via @samp{@@i} (lower case) do not respond to
@samp{-i} or @samp{-i!}. 

By default, identifiers that are referenced in non-printed include files
are not cross-referenced or indexed in any way.  To force them to be
cross-referenced, say @samp{-ix} instead of @samp{-i}.  In the present
implementation, the cross-reference information for such non-printed
files is presented in the form
@samp{#@i{n}}, where @i{n} is the integer section number.  (The La@TeX{}
section label is undefined for sections in non-printed files.)

The option @samp{-i!} means skip the include files completely.  This is
usually not very useful.

@node -i!,-j,-i,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-i!}:  Don't read @samp{@@I} include files

If a web file is included via @samp{@@I}, for example

@example
@@I formats.hweb
@end example

@noindent
then the @samp{-i!} option means to ignore such files completely.  This option
is seldom useful; the @samp{-i} option (@pxref{-i}) is more often used.

@node -j,-k,-i!,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-j}:  Inhibit multiple includes

@findex -j
@cindex Include files, inhibiting
File inclusion via @FWEB{}'s @samp{@@i} command suffers from a design
deficiency:  they cannot be inhibited by means of @FWEB{}'s
preprocessor commands.  (The reason is that @samp{@@i} is processed very
early in the input stage, before tokenization.  This design decision was
inherited from @sc{Cweb}, and is very difficult to change.)  A
particularly annoying situation arises when the same file is included
multiple times; various array space may be eaten up unnecessarily.  The
@samp{-j} option inhibits such multiple includes.

@node -k,-L_,-j,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-k}:  Don't recognize lower-case forms of keywords

@findex -k
By definition, in @sc{Fortran} and @sc{Ratfor}, a keyword is one of the
parameters such as @code{IOSTAT} used in the parameter list of an I/O
statement.  For example,

@example
open(21, FILE=file_name, STATUS='old', IOSTAT=io_flag)
@end example
@noindent
Such keywords are typeset in @code{typewriter type} to better highlight them.
In @sc{Fortran}, these keywords are case-insensitive.  However,
note that certain of the lower-case forms---in particular, @samp{end},
@samp{read}, and @samp{write}---have other special meanings, and one can
in principle use any of these keywords as ordinary variables in other parts of
the code; however, @FWEB{} identifiers can have just one meaning
throughout the code.  By default, the lower-case forms are also
recognized as keywords (except for the three special identifiers just 
mentioned), so one shouldn't use those as regular variables.  To cause
only the upper-case forms to be recognized, use the @samp{-k} option.

@node -L_,-l,-k,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-L}:  Select global language

@findex -L
To select a global language from the command line, say @samp{-L@i{l}},
where @i{l} is one of @code{@r{@{}c,c++,n,n9,r,r9,v,x@r{@}}}.  @xref{Languages}.

Usually, the global language is set via an @samp{@@} command in limbo,
not on the command line.  However, one may need to use a command-line
option such as @samp{-L_} if a subsequent command-line option is
language-dependent.  See, for example, the discussion of the option
@samp{-D} in @ref{-D_}.

@node -l,-M_,-L_,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-l}:  Echo input line

@findex -l
The option @samp{-l@i{[mmm[:nnn]]}} echoes the input lines constructed
by the input 
driver between lines @i{mmm} and @i{nnn}.  Missing @i{nnn} means echo to
the end of file.  Missing @i{mmm} means echo from the beginning.

This option is useful as a debugging tool (usually by the system
developer).  It is often used to verify that the input driver is
inserting semicolons correctly.  For @sc{Fortran}--77, it is also useful to
verify that comments are being processed correctly.

@node -M_, -m, -l, Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-M}:  Set output message level

@cindex Message level
@cindex Level, message
@findex -M
By default, @FWEB{} is relatively verbose; as it proceeds, it prints
messages about what files it is reading and writing, numbers of the
starred sections, line numbers, etc.  However, different levels of
verbosity can be set by the command @samp{-M@i{level}}, where the level
may be 0 (least verbose) through 4 (most verbose; the default), as
described in the following table:

@quotation

@table @kbd
@item 0
Like level 1, but the start-up banner is not printed.  If @FWEB{} runs
to completion with no errors, nothing at all will be printed.

@item 1
Print only error messages.

@item 2
Print error and warning messages.

@item 3
Print errors, warnings, and short information messages (excluding
starred section numbers and line numbers).

@item 4
Print everything.

@end table
@end quotation

The start-up banner, which includes the version number, is printed for
all message levels except 0.  For level 0, one can use the @samp{-V}
option to request the start-up banner. @xref{-V_}.

This option is very recent, and may not be fully debugged for obscure
combinations of command-line options.  Please report any annoyances.

Another way of discriminating message types is via color output.
@xref{Color}. 

@node -m,-m4,-M_,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-m}:  Define @FWEB{} macro (@FTANGLE{})

@findex -m
The command-line construction

@example
-mA(x)=x
@end example
@noindent
defines the @FWEB{} macro @code{A} as though the definition

@example
@@m A(x) x
@end example

@noindent
had appeared in the first definition part of the web file.

One can also say @samp{-m'A(x) x'}, where the quotes are removed by the
shell.  That is, an @samp{=} appearing @emph{immediately} after the
macro name (or argument list, if there is one) plays the role of the
space in the conventional definition.  Thus, carefully distinguish the forms

@example
-m'A(x)=x'   // @r{A(x) expands to @samp{x}}
-m'A(x) =x'  // @r{A(x) expands to @samp{=x}}
-m'A(x)==x'  // @r{Precisely equivalent to the previous example.}
@end example

The equals sign is permitted only with command-line macro definitions,
not with @samp{@@m} commands (@pxref{ATm}) in the definition parts of
the web file. 

@node -m4,-m;,-m,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-m4}:  Understand @code{m4} built-in commands

@findex -m4
@cindex Preprocessor, m4
This tells @FWEAVE{} to properly format the reserved words of the @code{m4}
preprocessor.  The use of that preprocessor is @emph{not recommended} in
conjunction with @FWEB{}; use @FWEB{}'s built-in C-like preprocessor
instead. 

@node -m;,-n,-m4,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-m;}:  Append pseudo-semicolons

@findex -m;
When @samp{-m;} is in effect, the construction @samp{@@;} is appended
automatically to all @FWEB{} macro definitions.

@emph{This option is not recommended.}  Please insert the @samp{@@;} by
hand when necessary, as in

@example
@@m SET(x,y) x=1; y=2@@;
@@m TEST(x) if(x) y; else z@@;
@end example

@node -n,-n9,-m;,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-n}:  Set global language to @sc{Fortran}--77

@findex -n
This is @FWEB{}'s default, so it generally does not need to be used
explicitly.  (See also the discussion of @ref{-L_}.)  However, variants
of this option, as described below, may be useful. 

See also @ref{Languages} and @ref{Fortran}.

@node -n9,-nAT;,-n,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-n9}:  Set global language to @sc{Fortran}--90

@findex -n9
@xref{Languages} and @ref{Fortran}; see also the discussion of @samp{-L}
in @ref{-L_}.

@node -nAT;, -n;, -n9, Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-n@@;}:  Supply automatic pseudo-semicolons [@sc{Fortran}]

@findex -n@@;
@cindex Pseudo-semicolons, automatic
@cindex Automatic pseudo-semicolons
(Don't forget that a semicolon has special meaning to @sc{unix} shells,
so you'll probably have to quote this command:  @samp{-n'@@;'}.)

This is the default mode of operation for free-form @sc{Fortran}-90; the
input driver automatically appends a pseudo-semicolon (invisible) to
each logical line of source code.  Since it is the default, one doesn't
have to use it unless one wishes to negate it (@pxref{Negating
options}).  In that case, it is best to place the @samp{--n@@;} command
in the source file, as @samp{@@n9[--n@@;]}.  If one places it on the
command line, be sure to set the language first: @code{-n9 --n@@;}.

For free-format @sc{Fortran}-90, when @samp{-n@@;} is in effect (the
default), @samp{-np} is also turned on.  @xref{-np}.

For further discussion, see the companion command @ref{-n;}.

@node -n;,-ncolon,-nAT;,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-n;}:  Supply automatic semicolons [@sc{Fortran}]

@findex -n;
@cindex Semicolons, automatic
@cindex Automatic semicolons
(Don't forget that a semicolon has special meaning to @sc{unix} shells,
so you'll probably have to quote this command:  @samp{-n';'}.)

This command functions the same as @samp{-n@@;} (@pxref{-nAT;}, except
that actual 
(visible) semicolons rather than pseudo-semicolons are appended.  This
is the default mode of operation for @sc{Fortran}-77 (and for that
language, it cannot be turned off by negation).

The distinction between @samp{-n@@;} and @samp{-n;} has to do with what
is visible on output.  In @sc{Fortran}-77, semicolons are not printed by
default since that seemed to annoy many users.  However, that causes
trouble with @sc{Fortran}-90 code containing multiple statements per
line, as in

@example
a = b; c = d
@end example
@noindent
If @samp{-np} is not used, then the semicolon in the above
example is not printed, hindering legibility.  Thus, the default mode of
operation for free-format @sc{Fortran}-90 is @samp{-n@@;} and
@samp{-np}.  This turns the above example into @samp{a = b; c = d@@;}
and displays it correctly.

When @samp{-n;} is used, semicolons will not be printed by default.
To force them to be printed, use the @samp{-np} option (@pxref{-np}).  

Do not insert semicolons by hand in @sc{Fortran}-77; they are always
inserted automatically.  If you have terminated @sc{Fortran}-90
statements by hand, turn off auto-semis by @samp{-n;} (and use
@samp{-np} at your discretion).

The following table summarizes the defaults for auto-semi insertion and
semicolon printing in @sc{Fortran}, both fixed and free formats (`N/A'
means `not applicable'):

@quotation
@multitable {F90}{Fixed}{ `-nA; -np' }

@item @tab Fixed @tab Free
@item F77 @tab @samp{-n;} @tab N/A
@item F90 @tab @samp{-n;} @tab @samp{-n@@; -np}

@end multitable
@end quotation


@node -ncolon,-nb,-n;,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-n:}:  Put statement label on separate line [@sc{Fortran}]

@findex -n:
By default, in @sc{Fortran} statement labels are placed on the same
line, and backspaced from, the command that is being labeled, as in

@example
EXIT: continue
@end example
@noindent
This can look ugly if the label is very long.  The command @samp{-n:}
places the label on a separate line, as is done automatically for
@sc{Ratfor}---e.g.,

@example
EXIT:
  continue
@end example

If neither of these options appeals to you, you could try redefining the
macro @code{\Wlbl}, found with some discussion in @file{fwebmac.web}.
That macro is emitted only when @samp{-n:} is @emph{not} used.
@findex \Wlbl

@node -nb,-nC,-ncolon,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-nb}:  Number @b{if}s and @b{do}s [@sc{Fortran}] (@FWEAVE{})

@findex -nb
@cindex Numbering blocks
@cindex Blocks, numbering
In the woven output, extra comments are added to help one correlate the
block structure of the code.  For more discussion, see @ref{-b}.

@node -nC, -np, -nb, Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-nC}:  Ignore single-line comments [@sc{Fortran}]

@findex -nC
@cindex Comments, ignore single-line Fortran
Ignore, at the input-driver stage, comment lines beginning with
@samp{C}, @samp{c}, or @samp{*}.

Interpretation:  In the usual mode of operation, the @sc{Fortran}-77 input
driver makes a heroic attempt to mix the original single-line column-1
commenting style with the @FWEB{} style (@samp{/*...*/} and
@samp{//}).  It converts single-line comments to the @samp{/*...*/}
style and passes them along to the innards of the processors.  

Problems sometimes arise when converting an existing @sc{Fortran} code
to @FWEB{}.  Such codes may have very large blocks of code or
documentation commented out with a @samp{C} in column 1.  Special @TeX{}
characters in those comments can cause problems for @FWEAVE{};
sometimes @FTANGLE{} gets confused as well.  The @samp{-nC} option
short-circuits these problems by simply throwing all such lines away at
the input driver stage.

This option is not a recommended long-term solution.  Instead, consider
the following:

@quotation
@itemize @bullet

@item
In @FWEB{}, blocks of code should be commented out with the
preprocessor commands @code{@@#if 0...@@#endif}; see @ref{Temporary
comments}.

@item
Textual comments for documentation should be converted to the standard
@FWEB{} commenting style.

@item
If one has a block of code prefaced by an extremely long comment,
replace that by a named module and put the comment into the @TeX{} part
of that section.

@end itemize
@end quotation

@node -np,-n\,-nC,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-np}:  Print semicolons [@sc{Fortran}] (@FWEAVE{})

@findex -np
@cindex Semicolons, printing
Although the @sc{Fortran} input driver automatically terminates logical
lines with semicolons (@sc{Fortran}-77; see @ref{-n;}) or pseudo-semicolons
(@sc{Fortran}-90; see @ref{-nAT;}) so that the innards of @FWEAVE{}
can process them correctly, the semicolons are not printed by default.
To make actual semicolons be printed, use the @samp{-np} option.

@samp{-np} is turned on automatically  for free-format @sc{Fortran}-90 when
@samp{-n@@;} is in effect (the default).  For more discussion, see
@ref{-n;}. 

@node -n\,-n&,-np,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-n\}:  Free-form syntax continued by backslash

@findex -n\
@cindex Syntax, free-form
In @sc{Fortran}--90, this turns on free-form syntax and sets the continuation
character to be the backslash (as it would be in C).  For example,

@example
-n9[-n\]
@@
@@a
program main
x = \
 y
end
@end example
@noindent
In the tangled output the backslash is converted into @sc{Fortran}-90's
standard continuation character, the ampersand.

See also @ref{-n&}.

@node -n&,-n/,-n\,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-n&}:  Free-form syntax continued by ampersand

@findex -n&
@cindex Syntax, free-form
In @sc{Fortran}--90, this turns on free-form syntax and sets the continuation
character to be the ampersand.  For example,

@example
-n9[-n&]
@@
@@a
program main
x = &
 y
end
@end example

For @sc{Fortran}-90, free-form syntax continued by the ampersand is
@FWEB{}'s default, so one probably will not need to use @samp{-n&}
explicitly.  

See also @ref{-n\}.

@node -n/,-n!,-n&,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-n/}:  Recognize short comments [@sc{Fortran}]

@findex -n/
The standard @FWEB{} notation for a short comment (one terminated by
the next newline) is @samp{// ...}.  However, in @sc{Fortran} the
@samp{//} denotes concatenation by default.  To make it denote a short
comment, use the @samp{-n/} option.  One can do this in the @file{.fweb}
file (@pxref{Customization}) or with the language-setting command in
limbo, as in @samp{@@n/}.

@noindent
In @FWEB{}, one may always use @samp{\/} for concatenation, so there's
no penalty for using @samp{-n/}.
@cindex Concatenation
@findex \/

@node -n!,-n),-n/,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-n!}:  Make @samp{!} denote short comment [@sc{Fortran}]

@findex -n!
@cindex Comments, @sc{Fortran}
In @sc{Fortran}-90, @samp{!} starts a short comment.  However,
by default @FWEB{} usurps @samp{!} for the logical not, as in
@samp{if(x != y)}.  To force it to recognize @samp{!} as a comment, use
@samp{-n!}.  However, the recommended style is to use @FWEB{}'s
standard convention that @samp{//} denotes the start of a short
comment (@pxref{-n/}).  See also @ref{-!} and @ref{-r!}.

In @sc{Fortran}-77, to include the exclamation point inside a string,
escape it with a backslash, as in

@example
        s = "A \! inside a string"
@end example
@noindent
This possibly annoying restriction arises because the unduly complicated
@sc{Fortran} input driver does some preprocessing of the @sc{Fortran}
source before it feeds it to the cores of the processors.

@node -n), -o, -n!, Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-n)}:  Reverse array indices [@sc{Fortran}] (@FTANGLE{})

@findex -n)
This @emph{somewhat experimental} flag permits @sc{Fortran} programmers to
use C-style array indices. 
Conversions such as the following are made (during the output phase of
@FTANGLE{}): 

@example
a(k)(i) @r{=>} a(i,k)
a(k)(i,j) @r{=>} a(i,j,k)
a(k)(j)(i) @r{=>} a(i,j,k)
@end example
@noindent
[No spaces may intervene between @samp{)} and @samp{(}; effectively,
@samp{)(} is treated as one token for the purposes of @samp{-n)}.]
This feature permits convenient definitions of macros that deal with
multi-dimensional vectors.

Unfortunately, @FTANGLE{} doesn't fully understand the syntax of the
source code---and never will, unless it is fully integrated with a
compiler.  It will therefore be confused by situations like the
following @sc{Fortran} example:

@example
dimension x(0:4)(1:2) // @r{OK}
character*90 ch(4) // @r{OK}
write(6,*) ((x(i)(j),i=1,2), j=3,4) // @r{Will reverse incorrectly.}
c = ch(4)(3:4) // @r{Shouldn't reverse, but will.}
@end example
@noindent
One solution, due to Charles Karney, is to insert a space to prevent
@samp{)(} from being recognized as a single token.  However,
since ordinary white space is eaten on input, one must resort to
something like the following (@samp{$UNQUOTE} is a built-in @FWEB{}
function; @pxref{$UNQUOTE}):

@example
@@m SP $UNQUOTE(' ')
@@a
dimension x(0:4)(1:2)
character*90 ch(4)
write(6,*) SP ((x(i)(j),i=1,2), j=3,4)
c = ch(4)SP(3:4)
@end example

This option is controlled by the three style-file parameters
@samp{paren.len}, @samp{paren.num}, and @samp{paren.nest}.  (@xref{Style}.)
@samp{paren.len} is the default number of bytes to be allocated for each
index; if an index is longer than this number, the current length is
increased by this number and storage is automatically reallocated.
@samp{paren.num} is the maximum number of allowed indices; for example,
when processing @samp{a(i)(j)(k)}, @samp{paren.num} is 3.
@samp{paren.nest} is the maximum parenthesis nesting level.  In the
example @samp{x(a(i)(j)(k))}, @samp{paren.nest} is 2.  If either of the
last two parameters is exceeded, a message will be issued asking you to
increase the appropriate value.

@node -o,-q,-n),Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-o}:  Don't overload operators

@findex -o
@cindex Operators, overloading
This option inhibits the operator-overloading feature invoked by the
command @samp{@@v} (@pxref{Overloading}).

@node -q,-P_,-o,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-q}:  Don't translate @sc{Ratfor}

@findex -o
@emph{(This option is obsolete.)}

@node -P_,-p,-q,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-P}:  Select @TeX{} processor

@findex -P
@cindex Processor, @TeX{}
@cindex Processor, La@TeX{}
Say @samp{-PT} or @samp{-PL} to inform @FWEAVE{} that its output will
be processed by @TeX{} or La@TeX{}, respectively.  Beginning with
Version 1.50, the default processor is LaTeX (@samp{-PL}).  If you
always use @TeX{}, it's easiest to put @samp{-PT} into the @file{.fweb}
initialization file.  

@emph{Please note that @samp{-PT} is no longer supported;  @FWEB{}
development is now based exclusively on La@TeX{}.}

@node -p,-r,-P_,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-p}:  Buffer up a style-file entry

@findex -p
This option specifies a style-file entry (@pxref{Style}).  Its argument
is exactly the same as a line that one may put into the local @FWEB{}
style file.  Thus, if in @file{fweb.sty} one would say
@samp{entry="value"}, the form of the @samp{-p} option would be
@samp{-pentry='"value"'}.  (The single quotes are required on a
@sc{unix} system because the double quotes have special significance to
the shell.)

This option can be used either in the @file{.fweb} initialization file
(@pxref{Initialization}), to record style-file entries that are common
to all runs, or on the command line, to override a local style-file
entry for a single run.  This behavior is a consequence of the following
order of processing style parameters:

@quotation
@enumerate
@item
@samp{-p} options in @file{.fweb};

@item
entries in the local style file @file{fweb.sty};

@item
@samp{-p} options on the command line.

@end enumerate
@end quotation

@node -r,-r9,-p,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-r}:  Set global language to @sc{Ratfor}--77

@xref{Languages} and @ref{Ratfor}.  See also @ref{-L_}.
@findex -r

@node -r9,-rg,-r,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-r9}:  Set global language to @sc{Ratfor}--90

@xref{Languages} and @ref{Ratfor}.  See also @ref{-L_}.
@findex -r9

@node -rg,-rk,-r9,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-rg}:  Set @b{goto} parameters

@findex -rg
This obscure option is used for configuring @sc{Ratfor} (and really
should be a style-file parameter).  (Discussion not finished.)

@node -rk,-rK_,-rg,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-rk}: Suppress comments about @sc{Ratfor} translation (@FTANGLE{})

@findex -rk
By default, the @sc{Ratfor} translator writes comments about what command it
is translating.  The @samp{-rk} option suppresses those comments.  Arguments
to this option allows one to suppress comments about only particular
commands, according to the following list:

@example
b @r{---} break
c @r{---} case
t @r{---} default
d @r{---} do
f @r{---} for
i @r{---} if
n @r{---} next
p @r{---} repeat, until
r @r{---} return
s @r{---} switch
h @r{---} where
w @r{---} while
@end example

@noindent
For example, one can say @samp{-rkrb} to suppress comments about the
@b{return} and @b{break} statements.

@node -rK_,-rAT;,-rk,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-rK}:   Write comments about @sc{Ratfor} translation (@FTANGLE{})

@findex -rK
This is the negative of @samp{-rk} (@pxref{-rk}); it forces comments
about particular @sc{Ratfor} commands. 

@node -rAT;, -r;, -rK_, Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-r@@;}:  Turn on auto-semi mode using pseudo-semis [@sc{Ratfor}]

@findex -r@@;
Please don't use this option (it may not work).  Insert semicolons by
hand in your @sc{Ratfor} code, just as one does in C.

@node -r;, -rb, -rAT;, Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-r;}:  Turn on auto-semi mode using actual semis [@sc{Ratfor}]

@findex -r;
Please don't use this option (it may not work).  Insert semicolons by
hand in your @sc{Ratfor} code, just as one does in C.

@node -rb,-r/,-r;,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-rb}:  Number @b{if}s and @b{do}s [@sc{Ratfor}]

@findex -rb
@cindex Numbering blocks
@cindex Blocks, numbering
In the woven output, extra comments are added to help one correlate the
block structure of the code.  For more discussion, see @ref{-b}.

@node -r/,-r!,-rb,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-r/}:  Recognize short comments [@sc{Ratfor}]

@findex -r/
The standard @FWEB{} notation for a short comment is @samp{// ...}.
However, in @sc{Ratfor} the @samp{//} denotes concatenation by default.
To make it denote a short comment, use the @samp{-r/} option.  For
concatenation, use @samp{\/}.

For an example, see @ref{-n/}.

@node -r!,-r),-r/,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-r!}:  Make @samp{!} denote short comment [@sc{Ratfor}]

@findex -r!
See the corresponding discussion of @samp{-!} in @ref{-!} and @ref{-n!}.

In @sc{Fortran}-77, to include the exclamation point inside a string,
escape it with a backslash, as in

@example
        s = "A \! inside a string"
@end example

@node -r), -s, -r!, Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-r)}:  Reverse array indices [@sc{Ratfor}] (@FTANGLE{})

@findex -r)
See the corresponding discussion of @samp{-n)} in @ref{-n)}.

@node -s, -T_, -r), Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-s}:  Print statistics

@findex -s
@findex -sm
@cindex Statistics, printing
@samp{-s} prints statistics about memory usage at the end of the run.  

@samp{-sm} prints statistics about memory usage at the end of the run, just
as does @samp{-s}; it also prints information about dynamic memory
allocations as they occur.  @samp{-sm@i{nnn}} displays allocations of nnn bytes
or more; if @i{nnn} is missing, 10000 is assumed.

@node -T_, -t, -s, Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-T}:  Flag-setting options for @FTANGLE{}

This is a family of options that set miscellaneous flags appropriate
only for @FTANGLE{}. 

@menu
* -TD::         Permit processing of deferred macro definitions.
* -Tb::         Permit built-functions such as @code{$IF} to be redefined.
* -Tm::         Permib user-defined macros to be redefined.
* -Tv::         Don't print header info at top of output. 
* -T%::         Don't retain trailing comments.
* -T#::         Don't insert @samp{#line} command after @samp{@@%}.        
@end menu

@node -TD, -Tb, -T_, -T_
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-TD}:  Permit processing of deferred macro definitions

@findex -TD
@cindex Macros, deferred
@dfn{Deferred macro definitions} are @samp{@@m} (or, equivalently,
@samp{@@#define}) commands that appear in the code part rather than
the usual definition part.  These definitions are evaluated during the
output (phase 2), and can cause confusion when used with the
preprocessor commands, which are evaluated during the input (phase 1).
Because of this confusion, deferred macro definitions are prohibited by
default.  To permit them, use the @samp{-TD} option (then be prepared
to make some obscure programming errors).

@node -Tb, -Tm, -TD, -T_
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-Tb}:  Permit built-functions to be redefined

@findex -Tb
@cindex built-in functions, redefining

By default, built-in functions such as @code{$IF} (@pxref{Built-in functions})
may not be redefined by an @code{@@m} command.  To allow this extremely
dangerous operation, use the @samp{-Tb} option.

@node -Tm, -Tv, -Tb, -T_
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-Tm}:  Permit user macros to be redefined

@findex -Tm
@cindex macros, redefining

By default, user macros may not be redefined by an @code{@@m} command.
To permit this, use the @samp{-Tm} option.  Note that many functions
described under @ref{Built-in functions}, such as @code{$PI}, are in fact
implemented as macros.

@node -Tv, -T%, -Tm, -T_
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-Tv}: Don't print header info

@findex -Tv
@cindex Header comments, printing
By default, @FTANGLE{} attempts to be helpful and writes some
information about the command line, input and change files, etc.@ at the
beginning of the output file.  This information can be deleted by means
of the @samp{-Tv} flag.  [This is done automatically when the @samp{-F}
flag (@pxref{-F_}) is in effect, since the header information includes a
time stamp that would defeat a successful file comparison.]

@node -T%, -T#, -Tv, -T_
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-T%}:  Don't retain trailing comments (@TeX{})

@findex -T%
@cindex Comments, @TeX{}
Unless the @samp{-v} option is used, comments are generally deleted by
@FTANGLE{} as it writes the output file.  However, in the @TeX{}
language such deletions can change the behavior of the output (by
introducing extra spaces).  Therefore, @TeX{} comments that do not
begin a line are always retained unless the @samp{-T%} option is used.
This option has no effect for languages other than @TeX{}.

@node -T#, , -T%, -T_
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-T#}:  Don't insert @samp{#line} command after @samp{@@%}

@findex -T#
If the @samp{@@%} command (@pxref{AT%}) is used to comment out a line,
it eats the trailing newline.  An undesirable consequence of this is
that, if nothing is done, the subsequent line numbering will be
misunderstood by a debugger, at least until @FWEB{} inserts a
@samp{#line} command for some reason.  To prevent this, @FWEB{}
inserts by default an implicit @samp{@@#line} command
(@pxref{Preprocessing}) after each @samp{@@%} that begins a line.  To
prevent this from happening (possibly because the feature doesn't work
correctly, in which case you should report it; @pxref{Support}), use the
@samp{-T#} option. 

@node -t, -U_, -T_, Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-t}:  Truncate identifiers

@findex -t
@cindex Identifiers, truncating
The truncation option enables one to use a wider character set for
identifiers than the language compiler will accept.  The standard
example is vanilla-flavored @sc{Fortran}-77, which doesn't allow the underscore.
If one says @samp{`-tn6@{_@}}', underscores will be removed from all
identifiers, then the result will be truncated to length 6.  If the
truncation procedure results in non-unique identifiers, these are
listed.

@node -U_, -u, -t, Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-U}:  Convert reserved output tokens to lower case (@FTANGLE{})

@findex -U
@cindex Tokens, upper-case
Particularly during @sc{Ratfor} expansion, certain tokens such as
@samp{DO} are output by @FTANGLE{} in upper case.  The @samp{-U}
option forces such tokens to be produced in lower case.

@node -u,-V_,-U_,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-u}:  Undefine @FWEB{} macro (@FTANGLE{})

@findex -u
@samp{-uA} undefines the @FWEB{} macro @samp{A} previously defined on the
command line (or in @file{.fweb}) via @samp{-m}.  

@emph{CAUTION}:  This option can also undefine built-in
functions such as @code{$IF}.  Don't do that, since built-ins can use other
built-ins behind the scenes; undefining one can cause very strange behavior.

@node -V_, -v, -u, Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-V}:  Print @FWEB{} version number

@cindex Version number
@findex -V
This flag requests the startup banner, which includes the @FWEB{}
version number, to be printed.  This is usually done anyway, so it
is only relevant when the message level is 0 (@pxref{-M_}).  

@node -v,-W_,-V_,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-v}:  Make all comments verbatim (@FTANGLE{})

@findex -v
@cindex Comments, verbatim
By default, comments are not passed to the tangled output.  With @samp{-v},
all comments are included verbatim in the tangled output.  Since there's
generally no harm in this, one might want to put this option into
@file{.fweb} (@pxref{Initialization}).

@node -W_,-w,-v,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-W}:  Flag-setting options for @FWEAVE{}

@findex -W
This is a family of options that set miscellaneous flags appropriate
only for @FWEAVE{}. 
Options such as @samp{-W[} and @samp{-Wf} can be combined as @samp{-W[f}.

@menu
* -W@@: -WAT.            Set module warning flag.
* -W1::                 Completely cross-reference single-character identifiers.
* -W[::                 Turn on processing of bracketed array indices.
* -WH: -WH_.            Send extra arguments to the C preprocessor.

Commands that inhibit printing:

* -Wd: -Wnoprint.       Don't print @@d or @@D in woven output.
* -Wf: -Wnoprint.       Don't print @@f.
* -WF: -Wnoprint.       Don't print @@F.
* -Wl: -Wnoprint.       Don't print @@l.
* -Wm: -Wnoprint.       Don't print @@m or @@M.
* -Wv: -Wnoprint.       Don't print @@v.
* -Ww: -Wnoprint.       Don't print @@w or @@W.
@end menu

@node -WAT, -W1, -W_, -W_
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-W@@}:  Set module warning flag.

@findex -W@@
@cindex Modules, warning level for
@cindex Warning level for modules

@FWEAVE{} can check module names for the possible anomalous conditions of
``never used'' or ``multiple uses.''  These correspond to a module
warning level, as in the following numbered list:

@enumerate
@item
Never used.

@item
Multiple uses.

@end enumerate
@noindent
The module warning flag is the bitwise OR of the desired warning
levels; warning messages are printed only when the relevant bits are
turned on.  By default, it is 1, so only messages about never-used
modules are printed.  The @samp{-W@@@i{flag}} overrides the default.
For example, to get messages only about multiple uses, say @samp{-W@@2};
to get no messages, say @samp{-W@@0}.  One can put such an option into the
@file{.fweb} initialization file (@pxref{Initialization}).

@FWEAVE{} will always complain about module names that are never defined.


@node -W1, -W[, -WAT, -W_
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-W1}:  Cross-reference single-character identifiers

@findex -W1
@cindex Identifiers, single-character
By default, @FWEB{} does not index uses of single-character
identifiers (following Knuth's original design).  (It does index their
definitions.)  To get complete cross-reference information for
single-character identifiers, use the @samp{-W1} option.

@node -W[, -WH_, -W1, -W_
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-W[}:  Process bracketed array indices

@findex -W[
@cindex Brackets, active
This @emph{experimental} option makes square brackets behave like
parentheses in the context of array indices.  

In @sc{Fortran}, @FTANGLE{} will just replace the brackets by parentheses.
In C, the brackets will be left alone.

@findex \WARRAY
@FWEAVE{}, however, will typeset the indices according
to the @file{fwebmac.sty} macro @samp{\WARRAY}.  This macro takes one
argument, which is just the array index or indices.  (In C, indexing
like @samp{a[i][j][k]} generates the argument @samp{i,j,k}.)  By
default, @samp{\WARRAY} just surrounds its argument with brackets.
However, the user may change its definition to get special effects such
as superscripted or subscripted indices.  A simple example macro
@samp{\WSUB} is provided in @file{fwebmac.sty}; one can say
@samp{\let\WARRAY\WSUB} in the limbo section to have bracketed indices
print as subscripts.

This feature may not work when the contents of the brackets
are too complicated (so that @FWEAVE{} tries to typeset them by going
in and out of math mode).

For more information, experts can see @file{fwebmac.web}, command @code{\WXA}.
@findex \WXA

@node -WH_, -Wnoprint, -W[, -W_
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-WH}:  Send additional arguments to the C preprocessor

@findex -WH
@cindex Preprocessor, sending additional arguments to
When the @samp{-H} option (@pxref{-H_}) is used, the C preprocessor is
invoked to scan include header files for @b{typedef}'s and @b{class}
declarations.  That is called with a standard set of options.
(Presently, @code{gcc} is actually called to invoke the preprocessor; it
is sent the options @samp{-E}, @samp{-P}, and @samp{-I}.)  Occasionally
it may be necessary to send additional options.  Those can be specified
as the (string) argument to @samp{-WH}.  Thus, to define two macros to the
preprocessor, one could say either of

@example
-WH-Dtest1=1 -WH-Dtest2=2
-WH"-Dtest1=1 -Dtest2=2"
@end example
@noindent
The first form shows that @samp{-WH} accretes to earlier uses.  The
second form shows how to handle embedded blanks (in a @sc{unix} shell).
Then, if one were programming in C, use of @samp{-H} would issue the
system command 

@example
gcc -E -P -Dtest1=1 -Dtest2=2
@end example


@node -Wnoprint, , -WH_, -W_
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-WdfFlmvw}:  Don't print various things in woven output

@findex -W
The printing of selected definition-part commands can be suppressed as
follows:

@example
-Wd @r{--- outer definitions (@samp{@@d} or @samp{@@D})}
-Wf @r{--- format statements (@samp{@@f})}
-WF @r{--- format statements (@samp{@@F})}
-Wl @r{--- limbo text definitions (@samp{@@l})}
-Wm @r{--- FWEB macro definitions (@samp{@@m} or @samp{@@M})}
-Wv @r{--- operator overloads (@samp{@@v})}
-Ww @r{--- identifier overloads (@samp{@@w} or @samp{@@W})}
@end example

@noindent
When these options used, associated cross-referencing is suppressed
as well.
@cindex Cross-references, suppressing

@node -w,-x,-W_,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-w}:  Change name of macro package (@FWEAVE{})

@findex -w
The option @samp{-w} means ``Don't print @samp{\input fwebmac.sty} as
the first line of the @file{.tex} output file.''  The option
@samp{-w@i{fname}} means ``Print @samp{\input fname} as the first line.''
For example, when working with REV@TeX{} (@pxref{REVTeX}), one needs to
say @samp{-wrwebmac.sty}.

This option can be used for special effects when one is trying to obtain
behavior different from that defined by @FWEB{}'s macro package
@file{fwebmac.sty} (@pxref{fwebmac.sty}).  However, try to not do that.
Please submit requests for such behavior modifications to the developer;
see @ref{Support}.

@node -x,-X_,-w,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-x}:  Eliminate or reduce cross-reference information (@FWEAVE{}). 

@findex -x
@cindex Cross-references, eliminating
Cross-reference information (for @FWEAVE{}) includes the Table of Contents
('c'), the Index ('i'), and the Module List ('m').  The option @samp{-x}
eliminates all of that information.  The option @samp{-x@i{letters}}
eliminates the piece of information corresponding to each letter in the
list.  For example, @samp{-xim} eliminates the Index and the Module List.

Another possibility is to say @samp{-xu}, which prevents
cross-references from unnamed sections (begun with @samp{@@a} or
@samp{@@A}) from appearing in the Index.

@node -X_,-y,-x,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-X}:  Print selected cross-reference information (@FWEAVE{})

@findex -X
When used with any of the arguments @samp{cim}, this option is the
opposite of @samp{-x}.  @xref{-x}. 

The option @samp{-XI} tells @FWEAVE{} to write its index
cross-references to a file formatted for input by the @code{makeindex}
utility.  This feature facilitates creation of a master index that spans
several individual @code{web} files.  For more discussion, see
@ref{Using makeindex}.

The construction @samp{-XI} stands alone; one may not mix the @samp{I}
with the list @samp{cim}.  Also, this option is overridden by
@samp{-xi}, which suppresses output of all index information.

@node -y,-Z_,-X_,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-y}:  Allocate dynamic memory

@findex -y
@cindex Memory allocation
@cindex Allocation, memory
This option changes the default size for a dynamically allocated memory
buffer.  The buffers are indicated by a one- or two-character
abbreviation such as @samp{op}.  For example, the option @samp{-yop200}
allocates 200 units for the @samp{op} buffer.

To query the default allocations, just say @samp{-y}.

When @FWEB{} runs out of space, it usually (but not always) issues a
message telling one which @samp{-y} command to use in order to increase
the allocations.  (Someday it will reallocate automatically.)  One may
wish to add some such options to the @file{.fweb} file.

For a more detailed discussion of memory allocation and a menu of the
various dynamic arrays, see @ref{Memory allocation}.

@node -Z_,-z,-y,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-Z}:  Display default style-file parameters

@findex -Z
@cindex Options, information
The information option @samp{-Zabc} prints to the screen the default
contents of the style-file parameters beginning with @samp{abc}.  Just
@samp{-Z} prints everything.

After printing the defaults, the @samp{-p} options (@pxref{-p}) and the
style file @file{fweb.sty} are processed.  If that processing has
overridden any of the defaults, the parameters are printed again, 
preceded by an asterisk.

To see only the parameters that have been modified from the defaults,
say @samp{--Z}.

The @samp{-Z} option behaves slightly differently for color escape
sequences than for other parameters; see @ref{Color}.


@node -z,-.,-Z_,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-z}:  Change name of style file

@findex -z
@cindex Style file, changing name of
The command @samp{-znew.sty} changes the default style-file name
@file{fweb.sty} to @file{new.sty}.  The command @samp{-z} (with no
argument) means ``Don't read any style file.'' 

Normally the style file is read from the same directory in which the
@code{web} source file resides (or from the path defined by the
environment variable @code{FWEB_STYLE_DIR}).  To force @code{fweb.sty}
to be read from the current directory, say @samp{-z.}.

@node -.,-\,-z,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-.}:  Don't recognize dot constants

@findex -.
@cindex Dot constants, recognizing
If this command is used, the processors will not understand that
constructions such as @samp{.LT.} are operators in @sc{Fortran} or
@sc{Ratfor}.  This command is useful if one is trying to modernize the
source code to use @FWEB{} conventions such as @samp{<} instead of
@samp{.LT.}.

@node -\,-lp,-.,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-\}:  Explicitly escape continued strings

@findex -\
@cindex Strings, long
@cindex Strings, continuing
In @FWEB{}, long strings are continued with the backslash.  Normally,
the continuation of the string must start in the first column of the
next line; otherwise, spurious blanks will be introduced.  However, when
the @samp{-\} option is in effect, @FWEB{} expects that the
continuation will also begin with the backslash, and it will ignore
leading white space and the backslash.  (This feature was inspired by
@sc{Fortran}-90.)  Thus, in the example

@example
"This is \
      \continued";
@end example
@noindent
the effective string is @code{"This is continued"} when @samp{-\} is in
effect.

Note that this option affects all strings in the source file; one cannot
mix and match.

@node -lp,-colon,-\,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-(}:  Continue parenthesized strings with backslashes

@findex -(
@cindex Strings, parenthesized
This option is like @samp{-\} (@pxref{-\}), but it refers to certain
strings that are not normally quoted, such as the arguments of
@samp{ifelse} commands in @code{m4}.

@node -colon,->,-lp,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-:}:  Set starting automatic statement number

@findex -:
@cindex Statement numbers, automatic
This option is useful for @sc{Fortran} and @sc{Ratfor}.  Symbolic
statement labels that are defined with the @samp{#:0} macro command
(@ref{Tokens}; @ref{Fortran}), as in @samp{@@m EXIT #:0}, are incremented
starting with the default of 90000.  To change this to, e.g., 789, say
@samp{-:789}.

@node ->,-=,-colon,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{->}:  Redirect output (@FTANGLE{})

@findex ->
@cindex Ouput, redirecting
This changes the name of @FTANGLE{}'s output file.  If no name is
given, output is redirected to the terminal.

This command has no effect for @FWEAVE{}.  

Although the appearance of this command is highly intuitive, it may be
hard to type quickly.  An equivalent command is @samp{-=} (@pxref{-=}).

@node -=,-#,->,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-=}:  Redirect output (@FTANGLE{})

@findex -=
@cindex Ouput, redirecting
Equivalent to @samp{->} (@pxref{->}), and faster to type on many keyboards.

@node -#,-plus,-=,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-#}:  Turn off comments about line and section numbers (@FTANGLE{}) 

@findex -#
By default, tangled output includes comments about the line and section
numbers corresponding to the current piece of code.  To eliminate this
clutter, say @samp{-#}.  (But note that the line-number information is very
useful for debugging in C and C++, as it enables the debugger to display
the source line in the web file.)

In some cases, bugs in tangled output, particularly from @sc{Fortran}, can be
eliminated by using @samp{-#}.  (But please report the bug anyway;
@ref{Support}.) 

In some cases, it is useful to turn off the line- and section-number
information locally.  This can be done with the @samp{@@q} command.
@xref{ATq}.

@node -plus,-/,-#,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-+}:  Don't interpret compound assignment operators

@findex -+
@cindex Assignment operators, compound
Both @sc{Ratfor} and @sc{Fortran} attempt to translate the commands
@samp{++}, @samp{--}, @samp{+=}, @samp{-=}, @samp{*=}, and @samp{/=}
into code that behaves as their C/C++ counterparts.  To turn this feature off,
use @samp{-+}.  

@cindex Not equal
Notice that in @sc{Fortran}-90 @samp{/=} is a token for ``not equal,''
so if you want to use that you must turn off the compound assignment
operators with use @samp{-+}.  However, a better solution is to leave
them turned on and use @FWEB{}'s standard @samp{!=} token for ``not equal.''

See also @ref{-ylx}.

@node -/,-!,-plus,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-/}:  Recognize short comments (@sc{Fortran} & @sc{Ratfor})

@findex -/

@cindex Comments, short
If this command is not used with the @sc{Fortran}-like languages, the
@samp{//} construction will be interpreted 
as concatenation rather than as the beginning of a short comment.

Concatenation can be signified with @FWEB{}'s token@samp{\/}, so no
penalty is incurred for using @samp{-/}.

One way of invoking this option is with the global language command,
such as @samp{@@n/}.  Another is to put the command into the
initialization file @file{.fweb}.

See also @ref{-n/} and @ref{-r/}.

@node -!,Info options,-/,Options
@comment  node-name,  next,  previous,  up

@subsection @samp{-!}:  Make @samp{!} denote short comment (@sc{Fortran} & @sc{Ratfor})

@findex -!
@cindex Comments, short
This option is not recommended; use @FWEB{}'s standard @samp{//} to
begin short comments.

To include the exclamation point inside a string, escape it with a
backslash, as in

@example
        s = "A \! inside a string"
@end example

@node Info options,,-!,Options
@comment  node-name,  next,  previous,  up

@subsection Information options

@cindex Options, information
@cindex Information options
Several of the command-line options can be used to elicit information
about the initial state of @FWEB{}.

@quotation
@samp{-@@} displays information about the control codes. @xref{-AT}.

@samp{-D} displays information about reserved words.  @xref{-D_}.

@samp{-y} displays default dynamic memory allocations.  @xref{-y}.

@samp{-Z} displays default values of style-file parameters.  @xref{-Z_}.
@end quotation
@noindent
The @samp{-h} option reminds one about these information options; it
also provides convenient access to the GNU @code{info} browser.
@xref{-h}.

@node AT commands,Comments,Starting,Top
@comment  node-name,  next,  previous,  up

@chapter @FWEB{} COMMANDS

All @FWEB{} commands begin with the character @samp{@@}.  It is recommended
that these begin in column 1 if possible.  This is required in some
cases [e.g., the @samp{@@x}, @samp{@@y}, and @samp{@@z} in change files
(@pxref{Change files}), or column-oriented @sc{Fortran}-77 processing].

Some of these control codes may be used anywhere; others begin a new
part of the current section.  (For a discussion of sections and parts,
see @ref{Structure}.)  For a quick summary of the control-code mappings
and to see which codes begin new parts, say @samp{ftangle -@@}.
@xref{-AT}.

@menu
Debugging commands:
* @@0: AT0.     Turn off debugging.
* @@1: AT1.     Display irreducible scraps.
* @@2: AT2.     Display detailed scrap reductions.

Literal control characters:
* @@@@: ATAT.     Insert an '@@'.
* @@|: AT|.      Vertical bar/optional line break.

Beginning of section:
* @@ : ATspace.  Begin minor section.
* @@*: AT*.      Begin major section.

Beginning of code part:
* @@<: AT<.      Begin module name.
* @@>: AT>.      End module name.
* @@A: ATA_.     Begin code part.
* @@a: ATa.      Begin code part and mark next identifier.

Control codes b--z:
* @@B: ATB_.      Insert left brace; suppress default insertion of breakpoint command.
* @@b: ATb.      Insert breakpoint command.
* @@c: ATc.      Set language to C.
* @@c++: ATcpp.  Set language to C++.
* @@D: ATD_.     Define outer macro.
* @@d: ATd.      Define outer macro and mark it.
* @@E: ATE_.     Treat next identifier as ordinary expression.
* @@e: ATe.      Invisible expression.
* @@f: ATf.      Format identifier or module name.
* @@I: ATI_.     Include a WEB file, but don't print it.
* @@i: ATi.      Include a WEB file.
* @@K: ATK_.     Expand global RCS-like keyword.
* @@k: ATk.      Expand local RCS-like keyword.
* @@L: ATL_.     Set language.
* @@l: ATl.      Specify limbo text.
* @@M: ATM_.     Define an @FWEB{} macro.
* @@m: ATm.      Define a @FWEB{} macro and mark it.
* @@N: ATN_.     Turn on language-independent mode.
* @@n: ATn.      Set language to Fortran--77.
* @@n9:ATn9.     Set language to Fortran--90.
* @@O: ATO_.     Open new output file (global scope).
* @@o: ATo.      Open new output file (local scope).
* @@q: ATq.      Turn off or on module and line information locally.
* @@R: ATR_.     Treat next identifier as integer-like reserved word.
* @@r: ATr.      Set language to Ratfor--77.
* @@r9: ATr9.    Set language to Ratfor--90.
* @@u: ATu.      Undefine an outer macro.
* @@v: ATv.      Overload an operator.
* @@W: ATW_.     Overload an identifier.
* @@x: ATx.      Terminate ignorable material.
* @@y: ATy.	 End first part of change.
* @@z: ATz.      Begin ignorable material.

Conversion to ASCII:
* @@': ATquote.     Convert single character to ASCII.
* @@": ATdquote.         Convert string to ASCII.

Forward referencing:
* @@[: AT[.         Mark next identifier as defined in this section.

Comments:
* @@/*: AT/*.        Begin a long verbatim comment.
* @@//: AT//.        Begin a short verbatim comment.
* @@%: AT%.          Ignore everything to next newline.
* @@?: AT?.          Begin a compiler directive.
* @@(: ATlp.         Begin a meta-comment.
* @@): AT).          End a meta-comment.

Special brace:
* @@@{: ATlb.       Insert left brace; suppress newlines in pretty-printing.

Index entries:
* @@_: AT_.         Force an index entry to be underlined (marked as defined).
* @@-: AT-.         Delete index entry for following identifier.
* @@+: ATplus.      Force index entry for following identifier.
* @@^: AT^.         Make index entry in Roman type.
* @@.: ATdot.       Make index entry in typewriter type.
* @@9: AT9.         Make index entry in format controlled by `\9'.

Control text:
* @@t: ATt.         Put control text into TeX \hbox.
* @@=: AT=.         Pass control text verbatim to the output.

Spacing:
* @@comma: ATcomma. Insert a thin space.
* @@/: AT/.         Insert a line break, preserving indentation.
* @@\: ATbs.         Insert a line break and backspace.
* @@|: AT|_.        Insert optional line break in an expression.
* @@#: AT#.         Force line break with blank line.
* @@~: AT~.         Cancel a line break (tie adjacent lines together).
* @@&: AT&.         Join left and right items.

Pseudo (invisible) operators:
* @@e: ATe.         Invisible expression.
* @@;: AT;.         Invisible semicolon.
* @@colon: ATcolon.     Invisible colon.

Miscellaneous:
* @@!: AT!.         Inhibit expansion for next macro.
@end menu

@node AT0, AT1, AT commands, AT commands
@comment  node-name,  next,  previous,  up

@section Debugging commands

Several commands provide localized versions of the @samp{-1} and
@samp{-2} options related to debugging of pretty-printing.

@subsection @samp{@@0}:  Turn off debugging

@findex @@0
@cindex Debugging
This cancels the effect of a previous @samp{@@1} or @samp{@@2}
(see @ref{AT1} and @ref{AT2}).  The @samp{@@0} command should appear in a
different section from the @samp{@@1} or @samp{@@2} commands.

@node AT1, AT2, AT0, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@1}:  Display irreducible scraps

@findex @@1
@cindex Debugging
This is a local version of the command-line option @samp{-1}
(@pxref{-1}); refer to that discussion for more information. 

@node AT2, ATAT, AT1, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@2}:  Display detailed reductions of the scraps

@findex @@2
@cindex Debugging
This is a local version of the command-line option @samp{-2}
(@pxref{-2}); refer to that discussion for more information. 

@node ATAT, AT|, AT2, AT commands
@comment  node-name,  next,  previous,  up

@section Literal control characters

Several commands insert specific characters.

@subsection @samp{@@@@}:  The character @samp{@@}

@findex @@@@
@samp{@@@@} inserts the single character @samp{@@}.

Don't forget to double the @samp{@@} even inside strings.  For example,
the @FWEB{} source line

@example
puts("'@@@@' is represented by `@@@@@@@@'");
@end example

@noindent
will be tangled to

@example
puts("'@@' is represented by `@@@@'");
@end example

@node AT|,ATspace,ATAT,AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@|}:  Literal vertical bar, or optional line break

@findex @@|
@cindex Bar, vertical
@cindex Vertical bar
In the @TeX{} (documentation) part of a section, @samp{@@|} inserts a
vertical bar.  This is useful inside La@TeX{} verbatim environments.  (A
simple bar would signal a shift into code mode, which is probably not
what one wants.)  For an example, see @ref{AT|_}.

@cindex Line break, optional
In a code part, @samp{@@|} inserts an optional line break in an
expression---e.g., 

@example
@samp{f(a,b,@@|c+d,...)}.
@end example
@noindent
This helps @TeX{} to break the line at an appropriate place.  If the
line does not need to be broken, the command does nothing.  [Compare
@samp{@@|} with @samp{@@\} (@pxref{ATbs}) and @samp{@@/} (@pxref{AT/}),
which always break the line.]

@node ATspace, AT*, AT|, AT commands
@comment  node-name,  next,  previous,  up

@section Beginning of section

Sections are begun by either @samp{@@*} or @ASP{}.

@subsection @samp{@@ }:  Begin minor section

@findex @@ 
@cindex Section, beginning minor
@ASP{}@ begins a new minor (unstarred or unnamed) section that is not entered
into the Table of Contents.  For example,

@example
@@ This is an example of a minor (unnamed) section.  (No entry is made
in the Table of Contents.)

@@a
main()
@{@}
@end example

@node AT*, AT<, ATspace, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@*}, @samp{@@*@i{n}}:  Begin major section

@findex @@*
@cindex Section, beginning major
@cindex Major section, beginning
@cindex Table of contents, entries for
@samp{@@*} begins a new major (starred) section (of level 0).  The
command must be followed by the name of the section (entry in the Table
of Contents), followed by a period.  (If a period appears in the name
itself, it must be protected by braces.)

@cindex Major section, optional argument for
@cindex Section names, long
@cindex Section names, short
The section name is also used as a running head on the output pages.  To
deal with the possibility that the full name may be too long, the
section name may be preceded by an optional argument enclosed in
brackets.  If it is present, the optional argument is used as the
running head.  (If a period appears as part of the optional argument, it
must be protected by braces.)

@cindex Subsection, beginning major
@cindex Major subsection
If @samp{@@*} is followed by a digit @i{n}, it begins a new major
(sub)section of level @i{n}.  This is also entered into the Table of Contents.
Thus, the complete syntax to begin a major section is

@example
@@*@i{n} [Short name]Full name.
@end example

For example,

@example
@@* MAIN PROGRAM.  This begins a major section (of level 0).

@@a
main()
@{@}

@@*1 [Input routines\dots]A very long section name that essentially
means ``input routines.''  Now follow some subroutines. 

@@a
get_input()
@{@}
@end example

For La@TeX{}, the highest permissible major level is 2 (a subsubsection).

Section names can contain reasonably arbitrary @TeX{} text, including
font-changing commands and other macros.  However, it is necessary to
understand that @emph{fragile} commands (in the sense of La@TeX{}) may
not work because the section name is used in various contexts (e.g., as
a page header).   If a macro in a section name doesn't work properly,
try preceding it with @samp{\protect}.

@FWEAVE{} converts @samp{@@*} commands to section numbers.  For a
discussion of section numbering, see @ref{Numbering}.

@node AT<, AT>, AT*, AT commands
@comment  node-name,  next,  previous,  up

@section Beginning of code part

The code part is begun by the appearance of either @samp{@@a} or
@samp{@@< @i{Module name} @@>=}.

@subsection @samp{@@<}:  Begin module name

@findex @@<
@cindex Module name, beginning
@samp{@@<} begins a module name, which has the form
@samp{@@< @i{@TeX{} text} @@>}.  (Module names inside @FWEB{} macro definitions
begin with @samp{@@#}, not @samp{@@<}.)

@node AT>, ATA_, AT<, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@>}:  End module name

@findex @@>
@cindex Module name, ending
@samp{@@>} ends a module name, of the form @samp{@@< @i{@TeX{} text} @@>}.

Technically, @samp{@@>} is not a command; rather, it is a delimiter
that terminates @samp{@@<}.  An unmatched @samp{@@>} is simply ignored
(after a warning message is issued).

@node ATA_, ATa, AT>, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@A}:  Begin code part of unnamed section

@findex @@A
@cindex Code part, beginning unnamed
@samp{@@A} begins the code part of an unnamed section.  For example,

@example
@@ In an unnamed section, the code part begins with @samp{@@a} or @samp{@@A}.
@@A
main()
@{@}
@end example

For more discussion of the distinction between @samp{@@A} and
@samp{@@a}, see @ref{ATa}.

@node ATa, ATB_, ATA_, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@a}:  Begin code part of unnamed section, and mark

@findex @@a
@cindex Code part, beginning unnamed
@samp{@@a} begins the code part of an unnamed section (just as does
@samp{@@A}), and in addition marks the next unreserved identifier it
finds as defined in this section.  Precisely,

@example
@samp{@@a} == @samp{@@A@@[}
@end example

Originally, @FWEB{} did not contain the @samp{@@A} command, so when
the functionality of automatically marking the next unreserved
identifier (@pxref{AT[}) was added, it was natural to add it to @samp{@@a}.  A
reasonable style of coding is to always use @samp{@@a} if you don't know
any better; if you sometime run into trouble, you can then change
selected @samp{@@a}s to @samp{@@A}s.  For example, it is appropriate to
use @samp{@@a} if one codes one function per section.  E.g.,

@example
@@c
@@ 
@@a
int
subrtn()
@{@}
@end example
@noindent
Here the @samp{@@a} marks @samp{subrtn} as defined in this section; if
that identifier is used elsewhere, it will be subscripted with the
section number.  (To turn this feature off, use @samp{-f}; see @ref{-f}.)
However, if a section contains an arbitrary code fragment, the code part should
probably begin with @samp{@@A}.  E.g.,

@example
@@c
@@
@@A
x = y;
@end example
@noindent
If one had used @samp{@@a} here, the @code{x} would have been marked as
defined here, which is not what one wants.  


@node ATB_, ATb, ATa, AT commands
@comment  node-name,  next,  previous,  up

@section Control codes b--z

@subsection @samp{@@B}:  Suppress insertion of breakpoint command

@findex @@B
@cindex Breakpoints, suppressing
@cindex Left brace, inserting
This is for detailed debugging of @FWEB{} codes.  It inserts a left
brace and suppresses the insertion of a breakpoint command.  See the
discussion of @samp{@@b} in @ref{ATb}.

@node ATb, ATc, ATB_, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@b}:  Insert a breakpoint command

@findex @@b
@cindex Breakpoints, inserting
(Discussion to be finished.  Useful only for very intimate debugging of
@FWEB{} codes.  In these days of safe sex, such intimacy may not be
desirable.)

See also @ref{ATB_}.

@node ATc, ATcpp, ATb, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@c}:  Set language to C

@findex @@c
The command @samp{@@c} is a shorthand for @samp{@@Lc}.  For a discussion
of language commands in limbo, see @ref{ATL_}.

@xref{Languages} and @ref{C}.

@node ATcpp, ATD_, ATc, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@c++}:  Set language to C++

@findex @@c++
The command @samp{@@c++} is a shorthand for @samp{@@Lc++}.  For a discussion
of language commands in limbo, see @ref{ATL_}.

@xref{Languages} and @ref{Cpp}.

@node ATD_, ATd, ATcpp, AT commands
@comment  node-name,  next,  previous,  up

@findex @@D
@cindex Outer macro, defining
@subsection @samp{@@D}:  Define outer macro

@emph{This command begins the definition part.}

@samp{@@D} defines an outer macro.  For more discussion, see @ref{Outer macros}.
For example, in C

@example
@@D A 1
@end example
@noindent
will be tangled to the beginning of the output file as @samp{#define A 1}.

@node ATd, ATE_, ATD_, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@d}:  Define outer macro, and mark

@findex @@d
@emph{This command begins the definition part.}

@samp{@@d} defines an outer macro (just as @samp{@@D} does), and also marks the
next identifier as defined in the present section.  It is equivalent to 

@quotation
@samp{@@d} == @samp{@@D@@[}
@end quotation

@noindent
(@pxref{AT[}).

The distinction between @samp{@@d} and @samp{@@D} is analagous to the
distinction between @samp{@@a} and @samp{@@A}.  @xref{ATa}.

@node ATE_, ATf, ATd, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@E}:  Treat next identifier as ordinary expression (@FWEAVE{})

@findex @@E
For formatting purposes, treat the next identifier as an ordinary
expression.

This command is useful in pretty-printing certain kinds of macro
constructions.  Further discussion is given in @ref{Macros and
formatting}.  

@node ATf, ATi, ATE_, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@f}:  Format identifier or module name

@findex @@f
@cindex Identifier, formatting
@emph{This command begins the definition part.}

The construction

@example
@@f identifier old_identifier
@end example

@noindent
makes @FWEAVE{} treat @i{identifier} like @i{old_identifier}.  For example,

@example
@@f mytype int
@end example

@noindent
says to treat the variable @code{mytype} just as @code{int} is treated
(e.g., as a reserved word in C or C++).

Traditionally, C programmers needed to use this command to format
identifiers that were defined in @code{#include} files.  This annoying
redundancy has now been eliminated by means of the @samp{-H} command,
which tells @FWEAVE{} to scan @code{#include} files automatically.
@xref{-H_}. 

The @i{old_identifier} may be one of the following special names, which
insert extra spaces according to the positions of the underscores and
behave as the part of speech indicated by the base names:

@example
$_BINOP_
$_COMMA_
$_EXPR
$_EXPR_
$EXPR_
$UNOP_
@end example
@noindent
These are useful for dealing with certain macro constructions.  For
example,

@example
@@f PLUS $_BINOP_
@@m PLUS +
@@m ADD(x, y) ((x) PLUS (y))
@end example
@noindent
Without the format command, the @samp{ADD} macro will pretty-print
without spaces before and after the @samp{PLUS}.  

When the current language is @TeX{}, the format command can be used to
change a category code according to the format

@example
@@f `TeXchar new_cat_code
@end example

@noindent
Difficulties may ensue if one try to change the category code of
@samp{@@} in this way; a fully operational @sc{web} for @TeX{} is quite
difficult and has been neither accomplished nor attempted.

@node ATi, ATI_, ATf, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@i}:  Include file (unconditional)

@findex @@i
@cindex File, including web
If one says

@example
@@i test.hweb
@end example

@noindent
the file @file{test.hweb} is inserted at the present point of the web file.  By
default, the current directory is searched.  Files can be included from
other directories by means of the @code{FWEB_INCLUDES} environment variable
and/or the @samp{-I} command-line option.  
See @ref{Environment variables} and @ref{-I_}.

In principle, the included file may contain any fragment of source text.
However, it is best to make it a complete section (begun by @samp{@@*}
or @ASP{}) if at all possible.

Unfortunately, the @samp{@@i} command cannot be commented out or
conditionally included by use of an @FWEB{} preprocessor command.
That is because @samp{@@i} is processed very early in the parsing
process.  (Consider:  @samp{@@i} could include @TeX{} text, but the
preprocessor is only active in the definition and code parts.)

Include commands may be nested to a depth set by the option
@samp{-yid}.  @xref{-yid}.

@cindex Include file, printing name of
@findex \WIF
@cindex Include file, formatting name of
@findex \WIFfmt
In the woven output, if a section comes from an include file, the name
of the include file is printed in square brackets as the first text of
the @TeX{} part.  To inhibit printing of that name, say

@example
\def\WIF#1@{@}
@end example
@noindent
in the limbo section.  To change the way that name is formatted,
redefine the macro @samp{\WIFfmt}, whose single argument is the name of
the include file.  (It is not called when there is no current include
file.)  The default definition is 

@example
\def\WIFfmt#1@{[@{\tt#1@}]@}
@end example


@node ATI_, ATK_, ATi, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@I}:  Include file (conditional)

@findex @@I
@cindex File, including web
This command behaves like @samp{@@i} if the command-line option
@samp{-i} is not used.  If it is used, then the contents of the included
file is not printed in the woven output.  
@xref{-i} and @ref{-i!}.

@node ATK_, ATk, ATI_, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@K}:  Extract global RCS-like keyword

The construction @samp{@@K @i{Keyword} @@>} accesses the value of a global
RCS-like keyword.  (For more discussion of such keywords, see @ref{ATz}.)
The command is treated differently by @FTANGLE{} and @FWEAVE{}
depending on its location in the source file.

@FWEAVE{} will expand the construction
in the limbo section and @TeX{} parts only.  The value is not surrounded
by quotes.  For 
example,

@example
@@z
$Id:  test $
@@x

@@c

\def\ID@{Id = \.@{"@@K Id @@>"@}@}

@@ \ID.  This is a @@K Id @@>.
@end example
@noindent
will expand into

@example
@@c

@@ \ID.  This is a test.
@end example
@noindent
and when La@TeX{} is run the macro @code{\ID} will expand to @samp{Id =
\.@{"Test"@}}.  The quotes are not necessary in the macro definition;
they are included only to emphasize that in this (limbo) context the
@samp{@@K} construction can effectively be put inside a string.  This is
possible because the routine that copies the limbo section simply copies
characters; it does not tokenize anything.

@FWEAVE{} does not expand @samp{@@K} constructions in the definition
or code parts; it merely gives them a symbolic representation.

@FTANGLE{}, on the other hand, expands @samp{@@K} constructions in the
definition or code parts (during input).  The values are surrounded by
quotes.  (As usual, @FTANGLE{} ignores material in the limbo section
and @TeX{} parts.)

For @FTANGLE{}, the built-in function @samp{$KEYWORD}
(@pxref{$KEYWORD}) behaves essentially as does @samp{@@K}, except that
it is expanded during output, not input.  @FWEAVE{} does not expand
@samp{$KEYWORD}.

The command @samp{@@k} behaves as does @samp{@@K} except that it
accesses local keywords, not global ones.  @xref{ATk}.

@node ATk, ATL_, ATK_, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@k}:  Access local RCS-like keyword

The construction @samp{@@k keyword} behaves as @samp{@@K} does
(@pxref{ATK_}), except it accesses local keywords (defined at the top of
include files).

@node ATL_, ATl, ATk, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@L}:  Set language

@findex @@L
@cindex Language, setting
@samp{@@Ll} sets the language to @i{l}, where @i{l} is one of
@samp{@{c,c++,n,n9,r,r9,v,x@}}. 
@xref{Languages}.

There are shorthand forms of this command for some languages; see
@samp{@@c} (@ref{ATc}), @samp{@@c++} (@ref{ATcpp}), @samp{@@n}
(@ref{ATn}), @samp{@@n9} (@ref{ATn9}), @samp{@@r} (@ref{ATr}), and
@samp{@@r9} (@ref{ATr9}).

Generally, the global language should be set in the limbo section by
means of @samp{@@L}, @samp{@@c}, etc.@  rather on the command line by
options such as @samp{-L} or @samp{-c}.

@node ATl, ATM_, ATL_, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@l}:  Specify limbo text

@findex @@l
@emph{This command begins the definition part.}

Limbo text is material that @FWEAVE{} should output before
the start of the first section.  
@cindex Limbo text
For example,

@example
@@l "\\def\\A@{abc@}"
@end example
@noindent
Note that @samp{\\} stands for a backslash.  In general, characters must be
escaped just as in C [so that one can include things like @samp{\n}
(newline) in the definitions].

Limbo text may also be typed directly into the limbo section; in that
case, no escapes are necessary since one is typing ordinary @TeX{} text.
Sometimes, however, the @samp{@@l} command is useful for pedagogical
purposes, as the limbo material can then be defined at the point where
the logical discussion is made.

@node ATM_, ATm, ATl, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@M}:  Define @FWEB{} macro

@findex @@M
@emph{This command begins the definition part.}

For a detailed discussion of @FWEB{} macros, see @ref{Macros}.

@node ATm, ATN_, ATM_, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@m}:  Define @FWEB{} macro, and mark

@findex @@m
@emph{This command begins the definition part.}

@samp{@@m} defines an @FWEB{} macro, and also marks the next identifier
as defined here.  It is equivalent to

@quotation
@samp{@@m} == @samp{@@M@@[}
@end quotation
@noindent
(@pxref{AT[}).

For a detailed discussion of @FWEB{} macros, see @ref{Macros}.

The distinction between @samp{@@m} and @samp{@@M} is analagous to the
distinction between @samp{@@a} and @samp{@@A}.  @xref{ATa}.

@node ATN_, ATn, ATm, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@N}:  Turn on N mode

@findex @@N
@emph{This command must appear before the code part.}  Generally, this
means immediately before @samp{@@a}.  @emph{Do not use this command in
limbo; use @samp{@@Lv} instead.}

The N mode invokes language-independent behavior within the scope of
a particular language.  The scoping rules are the same as for language
changes; i.e., using @samp{@@N} within a given section produces
language-independent behavior for that section and for any modules first
referenced in that section.  

Fundamentally, @dfn{language-independent} behavior essentially means a literal
transcription of the input to the output.  For example, it inhibits
blank compression by @FTANGLE{} and tells @FWEAVE{} to turn off
``pretty-printing'' (instead, the output is printed in typewriter type
within a @samp{\begin@{verbatim@}...\end@{verbatim@}} environment).

There are some subtleties with this mode (not to mention the likelihood
of bugs):

@enumerate
@item
@FWEB{} macros and built-in
functions will normally be expanded even in the N mode.  To inhibit
expansion of a particular identifier, place @samp{@@!} before the
identifier.  For example, 

@example
@@
@@m A 1
@@N
@@a
@@!A = A;
@end example

@noindent
expands to @samp{A = 1}.  

@item
Blank lines are significant.  The N mode is ended by the appearance of
the @samp{@@*} or @ASP{} denoting the start of the next section.  If
that were preceded by one or more blank lines, those would show up in
both the tangled and woven output.  They might or might not be
significant in the tangled output, but they almost certainly will look
ugly in the woven output.  To avoid this, use the command @samp{@@%%},
which deletes the remainder of the current line and all immediately
following empty lines.  For example,

@example
@@
@@N
@@a
x;@@%%



@@ Next section.
@end example

@item
If the N mode is invoked from a compiler-like language such as @sc{Fortran},
cross-referencing of variables is done as usual.  However, if the
language is @sc{verbatim} (which turns on the N mode automatically), no
cross-referencing is done.  (Identifiers are still recognized according
to @FWEB{}'s rules.  Those rules as currently implemented may be
essentially meaningless for some languages; in the future, provision may
be made for generalizing these rules by the user.)  To force an
identifier to be placed into the Index, precede it by @samp{@@+}.

@item
A  module name must be within the scope of an @samp{@@N} the first time
the name is seen, if it is ever to be within such scope.  Thus, the
following does not work properly:

@example
@@ Consider the module @@<Test@@>.  (Not yet within scope of \.@{@@N@}.)
@@N
@@a
x;
@@<Test@@>@@;
y;
@end example
@noindent
What happens is that the N mode is not restored after the code-part use
of @samp{@@<Test@@>}.  This is a bug.  There are very tricky design
issues to be dealt with here.

@end enumerate

@node ATn, ATn9, ATN_, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@n}:  Set language to @sc{Fortran}--77

@findex @@n
@sc{Fortran}-77 is @FWEB{}'s default language, so this command is usually not
strictly necessary.  However, it is good practice to include it, so a
user looking at the @code{web} file can tell immediately what language
it is supposed to process.

For more discussion of languages, see @ref{ATL_} and @ref{Languages}.

@node ATn9, ATO_, ATn, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@n9}:  Set language to @sc{Fortran}--90

@findex @@n9
For more discussion of languages, see @ref{ATL_} and @ref{Languages}.

For hints about @FWEB{} programming in @sc{Fortran}, see @ref{Fortran}.

@node ATO_, ATo, ATn9, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@O}:  Open output file (global scope)

@findex @@O
@cindex File, opening output
A statement of the form

@example
@@O @i{new_output_file_name}
@end example

@noindent
changes the name of @FTANGLE{}'s output file.  This change remains
in effect for the duration of the file, or until another @samp{@@O} is
encountered.  (If that occurs, the previously open file is closed.)

This command is expanded during output, so it must appear in the code part. 

For an example of using the @samp{@@O} command to produce both C header
files (@samp{.h}) and source files (@samp{.c}), see the discussion in
@ref{Outer macros}. 

To change the name of the output file locally (for just the present
section), see @ref{ATo}. 

@node ATo, ATq, ATO_, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@o}:  Open output file (local scope)

@findex @@o
@cindex File, opening output
This behaves like @samp{@@O}, except that the new file name is in effect only
for the current section.  A subsequent @samp{@@o} issued in a different
section but for the same file name accretes material to the file.  

An annoying problem arises in C programming when @samp{@@o}s are used to create
multiple source files that are subsequently compiled under the control
of a @code{Makefile}.  Remember that by default line-number information
is written into the C files.  This means that a change in the @code{web}
file code for one source file can affect all of the others, because the
line numbering in the @code{web} file changes.  Therefore, a trivial change to
the code for just one source file can cause all of the others to be
recompiled.

As long as one desires debugging information relative to the original
@code{web} file, there is really no solution to this problem; one needs
the proper line information in each file in order to work with the
debugger, so if line numbers change the sources must be recompiled.  One
can, of course, turn off the line numbering with the command-line option
@samp{-#} (@pxref{-#}), but then debugger statements will refer to the
tangled C code, which is undesirable.  A better partial solution is to
use @samp{@@q} (@pxref{ATq}) to turn off the line numbering for output
code that is currently stable.  In the following example, the code for
each file is put into a module, then the modules are output in the
unnamed section; it is assumed that the programmer is currently
making changes to the code for @file{file2.c}:

@example
@@
@@a
@@q0
@@o file1.c
        @@<File 1@@>@@;
@@q1
@@o file2.c
        @@<File 2@@>@@;
@@q0
@@o file3.c
        @@<File 3@@>@@;
@end example

For very large projects, another solution is to maintain multiple
@code{web} source files.  To avoid losing the substantial benefits of
the automatic index, refer to the discussion in @ref{Merging indexes} to
learn how to create a master index that contains information about
several @code{web} files. 


@node ATq, ATR_, ATo, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@q}:  Turn off module and line info locally

@findex @@q
@cindex Line numbering, turning off
The command-line option @samp{-#} (@pxref{-#}) turns off comments about
module and line numbers globally, for the entire code.  However, in some
cases one wants to turn that off in just a small block of code.  One
important example arises in @sc{Fortran}.  Consider

@example
@@
@@a
      x = @@<Some action@@>

@@
@@<Some action@@>=
y + z
@end example
@noindent
This example will tangle to something like

@example
      x = 
C* 1: *
*line 20 "test.web"
      y + z
C* :1 *
*line 5 "test.web"
@end example
@noindent
Unfortunately, the information comments have created invalid code that
will not compile.  

The @samp{@@q} command solves this problem by turning off or on the
information comments locally.  @samp{@@q0} turns them off; @samp{@@q1}
turns them on.  Thus, if one rewrites the above example as

@example
@@
@@a
@@q0
      x = @@<Some action@@>
@@q1
@end example
@noindent
it will tangle to

@example
      x = y + z
@end example
@noindent
as one desires.

For another use of the @samp{@@q} command, see @ref{ATo}.

@node ATR_, ATr, ATq, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@R}:  Treat next identifier as integer-like reserved
word (@FWEAVE{})

@findex @@R
For formatting purposes, treat the next identifier as an integer-like
reserved word.

This command is useful in pretty-printing certain kinds of macro
constructions.  Further discussion is given in @ref{Macros and
formatting}.  

@node ATr, ATr9, ATR_, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@r}:  Set language to @sc{Ratfor}--77

@findex @@r
@xref{ATL_} and @ref{Languages}.

@node ATr9, ATu, ATr, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@r9}:  Set language to @sc{Ratfor}--90

@findex @@r9
@xref{ATL_} and @ref{Languages}.

@node ATu, ATv, ATr9, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@u}:  Undefine outer macro

@findex @@u
@cindex Outer macros, undefining
@emph{This command begins the definition part.}

@samp{@@u} is the inverse of @samp{@@d}.  For example, in C the command
@samp{@@u A} tangles to @samp{#undef A}. 

@node ATv, ATW_, ATu, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@v}:  Overload operator

@findex @@v
@cindex Operators, overloading
@emph{This command begins the definition part.}

@samp{@@v} is used to change the woven appearance of an operator.  If
one defines a new operator, for example by a statement such as

@example
interface operator(.BETA.)
@end example
@noindent
in @sc{Fortran}-90, one should also use an @samp{@@v} in the definition
part---for example,

@example
@@v .BETA. "\\beta" +
@end example
@noindent
For a detailed discussion of overloading (the output appearance of)
operators, see @ref{Overloading}. 

@node ATW_, ATx, ATv, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@W}:  Overload identifier

@findex @@W
@cindex Identifiers, overloading
@emph{This command begins the definition part.}

For a detailed discussion of overloading (the output appearance of)
identifiers, see @ref{Overloading}. 

@node ATx, ATy, ATW_, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@x}:  Terminate ignorable material, or begin material to be changed

@findex @@x
In a change file, this command begins material to be changes; see
@ref{Change files}.  

In @code{web} source files, this command has a different use;
see the discussion of the @samp{@@z} command (@pxref{ATz}).

@node ATy, ATz, ATx, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@y}:  Begin change material

@findex @@y
The @samp{@@y} command is permitted only in change files.  @xref{Change
files}.

@node ATz, ATquote, ATy, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@z}:  Begin ignorable material, or terminate change

@findex @@z
@FWEB{} files may begin with the construction

@example
@@z
.
.
@@x
@end example

@noindent
where the @samp{@@z} occupies the very first two characters of the file, and
where the @samp{@@z} and @samp{@@x} must begin in column 1.
Material between the @samp{@@z} and @samp{@@x} is @dfn{pure commentary} and is
ignored by both processors, with one exception.

@findex @@K
@findex @@k
@findex $KEYWORD
@findex $L_KEYWORD
@cindex RCS-like keyword
@cindex Keyword, RCS-like
The exception is that an RCS-like line (RCS stands for
``revision-control system'') with syntax

@example
$Keyword: Text of Keyword $
@end example
@noindent
(at least one blank after the colon, and at least one before the last
dollar sign; @sc{unix} users, see @samp{man ident}) is parsed, and the
text of the @code{Keyword} is made 
available to the control codes @samp{@@K} (@pxref{ATK_}) and @samp{@@k}
(@pxref{ATk}) as well as to @FTANGLE{}'s built-in function @code{$KEYWORD}
(@pxref{$KEYWORD}.

A distinction is made between keywords that are found in the ignorable
commentary at the beginning of the master web file, which are called
@dfn{global keywords}, and ones that are found at the beginning of files
included via @samp{@@i}, which are called @dfn{local keywords}.

The commands that access RCS-like keywords function as follows:

@quotation
@itemize @bullet
@item
@samp{$KEYWORD(Keyword)} accesses a global keyword.  It is a built-in
function that is 
expanded by @FTANGLE{} (during output) into the quoted character
string @code{"Text of Keyword"}.

@item
@samp{@@K} and @samp{@@k} are expanded during input.  @samp{@@K}
accesses a global keyword, whereas @samp{@@k} accesses a local keyword.  

@item
In the limbo section or a @TeX{} part, @FWEAVE{} will expand @samp{@@K
Keyword @@>} into @code{Text of Keyword} (without the surrounding
quotes), and similarly for @samp{@@k}.  (The intention is that the
expanded text can be used as bodies of @TeX{} macros.)
@FWEAVE{} will also print the
values of global keywords at the end of its output, whether or not they
are referenced by @samp{@@K}.

@item
Elsewhere @FWEAVE{} will just print the keyword name itself,
surrounded by double angle brackets.  If the keyword was local
(@samp{@@k}), the brackets will carry the subscript 0.

@item
@FTANGLE{} treats the global command @samp{@@K Keyword @@>}
essentially like it does @samp{$Keyword}, except that the construction
is expanded on input rather than output.

@item
@FTANGLE{} expands the command @samp{@@k keyword @@>} on input,
generating a quoted string containing the value of the local keyword.

@end itemize
@end quotation

The command @samp{@@z} is also used in change files to end a change.
@xref{Change files}.

@node ATquote, ATdquote, ATz, AT commands
@comment  node-name,  next,  previous,  up

@section Conversion to ASCII

@cindex ASCII, converting to
Several commands are useful for generating machine-independent code.
For example, @FWEB{} works internally with the ASCII character set, so
uses these commands heavily to convert from the possibly non-ASCII
native character set of the machine on which @FWEB{} is running.

@subsection @samp{@@'}:  Convert character to ASCII

@findex @@'
The construction @samp{@@'c'} converts @samp{c} to its ASCII value.  In
C and C++, it is converted to octal; for example, @samp{@@'A'} is output
as @samp{0101}. In @sc{Fortran} and @sc{Ratfor}, it is converted to decimal; the
previous example would be output as @samp{65}.

If the native character set of one's machine is ASCII, the conversion
will not be done unless the @samp{-A} command-line option is used.
@xref{-A_}. 

@node ATdquote, AT[, ATquote, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@"}:  Convert string to ASCII

@findex @@"
The construction @samp{@@"abc"} converts the enclosed string to its ASCII
representation.  For example, in C and C++
@samp{@@"abc"} will be output as @samp{"\141\142\143"}.  

@findex ASCIIstr
In @sc{Fortran} and @sc{Ratfor}, no such simple mechanism exists in the
language, so a function call is issued.  For example, the previous
example would be output as @samp{ASCIIstr('abc')}.  The user is
responsible for defining the function @samp{ASCIIstr}.  The name of this
function can be changed by the style-file entry @samp{ASCII_fcn}.
@xref{ASCII_fcn}.

If the native character set of one's machine is ASCII, the conversion
will not be done unless the @samp{-A} command-line option is used.
@xref{-A_}. 

@node AT[, AT/*, ATdquote, AT commands
@comment  node-name,  next,  previous,  up

@section Forward referencing

@cindex References, forward

@subsection @samp{@@[}:  Mark as defined

@findex @@[
This command marks the next (non-reserved) identifier that appears after
the @samp{@@[} as being defined in the current section.  It is usually
issued automatically; for example, @samp{@@a} is equivalent to
@samp{@@A@@[}, @samp{@@d} is equivalent to @samp{@@D@@[}, and @samp{@@m}
is equivalent to @samp{@@M@@[}.

If the appropriate style-file parameter @code{mark_defined.???} is 1,
this command causes any appearance of the identifier to be subscripted
with a section number.  For more information, see @ref{Subscript params}.

The utility of this command can be seen from the characteristic
construction

@example
@@ This is section 5.
@@a @@% Issues an implicit @@[, which marks |test| as defined in section 5.
        subroutine test
        ...
        end

@@ This is section 6.
@@a
        program main
        call test // This will print as $|test|_5$.
        end
@end example

The @samp{@@[} command should be distinguished from @samp{@@_}
(@pxref{AT_}).  The  
latter causes the index entry for the identifier to be underlined; the
former possibly causes the identifier to be subscripted by a section
number.  One may wish to turn off the subscripts because they become too
cluttered; however, the underlined index entries remain useful and
unobtrusive. 

@node AT/*, AT//, AT[, AT commands
@comment  node-name,  next,  previous,  up

@section Comments

@FWEB{} supports a variety of commenting styles borrowed from C, C++,
and @TeX{}.  For more discussion, see @ref{Comments}.

@cindex Comments

@subsection @samp{@@/*}:  Begin long verbatim comment

@findex @@/*
The following comment is copied to the tangled output.  (By default,
comments are not copied.)  If you desire all comments to be so copied,
use @samp{-v}.  @xref{-v}.

@node AT//, AT%, AT/*, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@//}:  Begin short verbatim comment

@findex @@//
See the discussion of @samp{@@/*} in @ref{AT//}.

@node AT%, AT?, AT//, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@%}:  Ignorable comment

@findex @@%
@findex @@%%
@cindex Comments, ignorable
If any line in a web source code contains the command @samp{@@%}, all
remaining material on that line (to and including the newline character)
is ignored by the input driver and never processed at all.

A stronger form of this command is @samp{@@%%}.  This deletes the
current line as well any empty lines that immediately follow.  This command
is particularly useful when the N mode is in effect.  @xref{ATN_}.

Line-numbering problems can arise when these commands are used.  For a
discussion, see @ref{-T#}.

@node AT?, ATlp, AT%, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@?}:  Begin compiler directive

@findex @@?
@cindex Compiler directives
The remainder of the line is processed as a compiler directive.  Optional
material may be inserted automatically at the beginning of the tangled
output line by means of the style-file option @code{cdir_start}.
@xref{Miscellaneous params}.

@node ATlp, AT), AT?, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@(}:  Begin meta-comment

@findex @@(
Material between @samp{@@(} and @samp{@@)} is treated in the N mode.
For example,

@example
@@(
Comment 1
Comment 2
@@)
@end example

Style-file parameters allow optional material to be insert at the
beginning and end of the meta-comment, and at the beginning of each line
of output.  For more information, see the style-file parameters
beginning with @samp{meta} (@pxref{Miscellaneous params}).

@node AT), ATlb, ATlp, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@)}:  End meta-comment

@findex @@)
See the discussion of @samp{@@(}, @ref{ATlp}.

@node ATlb, AT_, AT), AT commands
@comment  node-name,  next,  previous,  up

@section Special left brace

The command @samp{@@@{} is useful in C/C++ programming to beautify some
of the pretty-printing.  It translates into a left brace, but also
suppresses the automatic insertion of newlines into the subsequent
function body or block.  This is desirable for very short functions, such
as simple constructors in C++.  For example,

@example
class C
@{
private:
        int i;

public:
        C(int i0) @@@{i = i0;@}
@}   
@end example
@noindent
Here the function will be typeset as

@example
C(int i0)
  @{ i = i0; @}
@end example
@noindent
rather than the default

@example
C(int i0)
  @{
  i = i0;
  @}
@end example

@node AT_, AT-, ATlb, AT commands
@comment  node-name,  next,  previous,  up

@section Index entries

@cindex Indexing commands
Although most information for the Index is gathered automatically, in
some situations it must be done by hand.

@subsection @samp{@@_}:  Force index entry to be underlined

@findex @@_
@cindex Index entries, underlining
This command applies to the next identifier that appears after the
@samp{@@_}.  The index entry for that identifier will be underlined.
(By convention, this means `defined' or `declared'.)

This command is usually issued automatically.  For example, the index
entries for the variables @samp{i} and @samp{j} in the C statement
@samp{int i, j;} will be underlined, since @FWEAVE{} understands
enough of the syntax to know that variables are being defined.  Macro
definitions (begun by 
@samp{@@D} or @samp{@@M}) will also be underlined automatically.

@node AT-, ATplus, AT_, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@-}:  Delete index entry

@findex @@-
@cindex Index entries, deleting
This command applies to the next identifier that appears after the
@samp{@@-}; it prevents an index entry associated with that identifier
from being made.  This might be useful when the N mode is in effect.

@node ATplus, AT^, AT-, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@+}:  Force index entry

@findex @@+
@cindex Index entries, forcing
This command applies to the next identifier that appears after the
@samp{@@+}; it forces an index entry for that identifier. It is
particularly useful when the language is @sc{verbatim}, since
cross-referencing is turned off in that case.

@node AT^, ATdot, ATplus, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@^}:  Make index entry (Roman type)

@findex @@^
@cindex Index entries, Roman type
To insert one's own index entry in Roman type, say  @samp{@@^@i{My entry}@@>}.

@node ATdot, AT9, AT^, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@.}:  Make index entry (typewriter type)

@findex @@.
@cindex Index entries, typewriter type
To insert one's own index entry in typewriter type, say  @samp{@@.@i{My
entry}@@>}. 

@node AT9, ATt, ATdot, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@9}:  Make index entry (user-defined format)

@findex @@9
@cindex Index entries, user format
The construction @samp{@@9@i{Text}@@>} is used to create an index entry in a
format defined by the user.  It is associated with the macro @code{\9}, which
will be called during @TeX{}'s processing of the Index as
@code{\9@{@i{Text}@}}.  The user must define @code{\9} according to the format

@example
\def\9#1@{...@}
@end example
@noindent
where argument @samp{#1} is the text between @samp{@@9} and @samp{@@>}.
For example, to print that text in a sans serif font, say

@example
\def\9#1@{@{\sf #1@}@}
@end example
@noindent
(Note the extra level of braces to prevent the font command from propagating.)

@node ATt, AT=, AT9, AT commands
@comment  node-name,  next,  previous,  up

@section Control text

@cindex Control text
@cindex Text, control
@dfn{Control text} is material terminated by @samp{@@>}; it must be all
on one line and must not contain any @samp{@@}s.

@subsection @samp{@@t}:  Put control text into a @TeX{} \hbox (@FWEAVE{})

@findex @@t
When @FWEAVE{} sees the command @samp{@@t@i{control text}@@>}, it packages
the control text into an @code{\hbox} and ships it to the output.  This
command is ignored by @FTANGLE{}.

@node AT=, ATcomma, ATt, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@=}:  Pass control text verbatim to the output

@findex @@=
For @FTANGLE{}, the command @samp{@@=@i{control text}@@>} sends the control
text to the output exactly as input.  @FWEAVE{} highlights the control
text by drawing a box around it.

@node ATcomma, AT/, AT=, AT commands
@comment  node-name,  next,  previous,  up

@section Spacing

@cindex Spacing commands

The spacing commands are used to refine @FWEAVE{}'s pretty-printed
output.  Generally it's not necessary to bother with these until one is
putting the final touches on a code.  

@subsection @samp{@@,}:  Insert a thin space

@findex @@,
@cindex Spacing, thin space
Extra spacings are sometimes necessary when working with unusual macro
constructions.  @samp{@@,} inserts a thin space, analogous to @TeX{}'s
@code{\,}.  

An example where explicit spacing would be necessary is as follows:

@example
@@c
@@
@@m OP +
@@m A(x,y) x @@, OP @@, y

@@a
z = A(a, b);
@end example

@noindent
Without the @samp{@@,}'s, the body of the @code{A} macro will weave as
the unappealing @samp{xOPy}.  This occurs because although @code{OP} is
defined to be a binary operator, @FWEAVE{} thinks of it as just a mere
expression, and one of its fundamental production rules is to
concatenate expressions with no intervening expressions.

This demonstrates that situations arise in which one needs to override
@FWEAVE{}'s default processing.  But for the above example, there is
actually a better solution.  Instead of using the @samp{@@,}'s, include
the format command @samp{@@f OP $_BINOP_}.  @xref{ATf}.

@node AT/, ATbs, ATcomma, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@/}:  Force a line break, preserving indentation.

@findex @@/
@cindex Line break, forcing
This command is used to override @FWEAVE{}'s natural inclinations.
For example, if one wants each piece of a declaration to appear on a
separate line, one can say

@example
int@@/
  i,@@/
  j,@@/
  k;
@end example

This command preserves the natural indentation that would have happened
if @FWEAVE{} or La@TeX{} had broken a long line spontaneously.  Thus, the
declared variables are indented in the above example.  To remove that
indent, use @samp{@@\} instead.  @xref{ATbs}.

Try to use the line-break commands sparingly---i.e., let @FWEAVE{} do
the work. 
Often, if lines run together in an unexpected or unreadable way,
it's because @FWEAVE{} wasn't able to parse the relevant block of
code, perhaps because it didn't understand that some variable in an
include file has a special meaning.  In such cases, trying to fix things
with @samp{@@/} is the wrong solution.  Either use @samp{@@f}
(@pxref{ATf}) or @samp{-H} (@pxref{-H_}).

Distinguish the @samp{@@/} command from @samp{@@|} (@pxref{AT|}), which
inserts an optional breakpoint into an expression.

@node ATbs, AT|_, AT/, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@\}:  Force a line break, then indent

@findex @@\
@cindex Line break, forcing with indent
The @samp{@@\} command behaves like @samp{@@/} (@pxref{AT/}), except
that it backspaces one notch after the line break.  This usually has the
effect of undoing the natural indentation that would have been inserted
had a long line been spontaneously broken.  One common case where the
@samp{@@\} command might be used would be to put the return type of a C
function on a separate line:

@example
int @@\
main()
@{@}
@end example

It would be nice to have @FWEAVE{} do that automatically.
Unfortunately, the syntax of a function isn't recognized until the
opening braces are sensed; by that time, the declaration part of the
statement has already been processed.  This is one example of the fact
that the @FWEB{} processors are much less intelligent and sophisticated
than language compilers.  A clever (and simple) idea for getting around
this kind of problem is lacking at this point.

@node AT|_, AT#, ATbs, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@|}:  Literal vertical bar, or optional line break

@findex @@|
@cindex Bar, vertical
@cindex Vertical bar
In the @TeX{} (documentation) part of a section, @samp{@@|} inserts a
vertical bar.  Here's a La@TeX{} example:

@example
\begin@{verbatim@}
  The constructions @@|x@@| and |x| are very different.
\end@{verbatim@}
@end example

@noindent
You might wish to try this out to see what @FWEAVE{} produces.

@cindex Line break, optional
In a code part, @samp{@@|} inserts an optional line break in an expression.

@node AT#, AT~, AT|_, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@#}:  Blank line

@findex @@#
@samp{@@#} forces a line break with some extra vertical white space.
However, note
that @emph{blank lines in the source are significant}, so this command should
seldom if ever be necessary.

if @samp{@@#} is immediately followed by a letter (e.g., @samp{@@#if}),
it is assumed that a preprocessor command is beginning.  @xref{Preprocessing}.


@node AT~, AT&, AT#, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@~}:  Cancel line break

@findex @@~
@cindex Line break, canceling
@samp{@@~} is analogous to @TeX{}'s @samp{~} (tie); it prevents a line
break, which @FWEAVE{} usually inserts after each complete statement
it recognizes.  For example,

@example
printf("Working..."); @@~ fflush(stdout);
x = y; @@~ break;
@end example

@node AT&, ATe, AT~, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@&}:  Join items

@findex @@&
@cindex Joining items
@cindex Items, joining
During @FWEAVE{}'s output, @samp{@@&} joins the items to either side
with no spaces or line breaks inbetween.  

This command must be distinguished from the preprocessor construction
@code{##} (paste tokens together).  In a macro definition, @samp{a##bc}
creates the single identifier @samp{abc}.  If one said @samp{a@@&bc},
two identifiers would be output with no spaces separating them.  In
simple cases, the results may look identical, but consider how things
would differ if @code{abc} were itself an @FWEB{} macro that should
itself be expanded.

@node ATe, AT;, AT&, AT commands
@comment  node-name,  next,  previous,  up

@section Pseudo (invisible) operators

@cindex Pseudo-operators
@cindex Operators, pseudo-
Pseudo- or invisible operators are ignored by @FTANGLE{} and not
printed by @FWEAVE{}; however, they retain grammatical significance
that helps out @FWEAVE{} in its attempts to understand the syntax.

@subsection @samp{@@e}:  Pseudo-expression

@cindex Pseudo-expression
@cindex Expression, pseudo
@findex @@e
@samp{@@e} is an invisible expression (`pseudo-expression')
(@pxref{Pseudo-operators}).  It is 
sometimes useful in situations where @FWEAVE{}'s pretty-printing has
broken down because it didn't properly understand the language syntax.
If, for example, @FWEAVE{} failed to properly parse the C statement

@example
p = (int (*))q;
@end example

@noindent
one might get things to work properly by saying

@example
p = (int (*@@e))q;
@end example

In this particular case, one is patching up a deficiency (all right, a
bug) in @FWEAVE{}'s ``production rules.''  (This particular bug may no
longer exist.) However, there are other situations in which the use of
@samp{@@e} might be necessary.  Consider, for example, the C macro
definition

@example
#define A(x) = x
@end example
@noindent
Here the replacement text of the macro is @samp{= x}, which by itself is
not a valid construction in C.  When the @samp{-1} or @samp{-2} options
are used, @FWEAVE{} will report an ``irreducible
scrap sequence'' in this situation (although it may typeset it correctly
anyway).  To eliminate the warning message, say instead

@example
#define A(x) @@e = x
@end example
@noindent
Now the fragment @samp{@@e = x} is interpreted as a valid expression.

@node AT;, ATcolon, ATe, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@;}:  Pseudo-semicolon

@cindex Pseudo-semicolon
@cindex Semicolon, pseudo
@findex @@;
@samp{@@;} is an invisible semicolon.  These are often used in C
programming to terminate a module name that expands to a compound
statement.  Carefully compare the uses of @samp{@@;} and @samp{;} in the
following example:

@example
@@c
@@a
if(flag)
        @@<Compound statement@@>@@;
else
        @@<Simple statement@@>;

@@ This compound statement ends with a brace, but is used as an
expression above.
@@<Com...@@>=

@{
x;
y;
@}

@@ This fragment does not end with a semicolon, so one must be 
supplied above.

@@<Sim...@@>=
z
@end example

Here is a case for which the pseudo-semicolon is not necessary.  Consider

@example
@@c
@@ The code fragment |x = y| ...
@end example
@noindent
If the @samp{-1} is turned on, one might think that @FWEAVE{} would
report an ``irreducible scrap sequence'' because @samp{x = y} is an
expression but not a complete statement.  (Turning on @samp{-2}
demonstrates this.)  However, it is not necessary to say @samp{|x = y@@;|} 
because the warning message is not issued if the parsing reduces to just
one unresolved scrap.  

On the other hand, @samp{|goto done|} does not reduce to just one
unresolved scrap, so say @samp{|goto done@@;|} in cases such as this.
@xref{Pseudo-operators}.

In some situations, pseudo-semicolons are inserted automatically.  An
important case is free-format @sc{Fortran}-90.  There the language
syntax says that newlines terminate statements (except when there's a
trailing ampersand).  However, newlines are thrown away before tokenized
text is seen by @FWEAVE{}'s parser (and in any event would just be
interpreted as white space).  Therefore, by default newlines that
terminate statements are replaced by pseudo-semicolons, so the parsing
proceeds correctly.

In the @sc{Fortran}-90 case, one could also insert pseudo-semicolons or
actual semicolons by hand, and some users prefer that.  The
possibilities are controlled by the options @samp{-n@@;} (@pxref{-nAT;})
and @samp{-n;} (@pxref{-n;}).
@findex -n@@;
@findex -n;
@cindex Pseudo-semicolons, automatic
@cindex Automatic pseudo-semicolons

@node ATcolon, AT!, AT;, AT commands
@comment  node-name,  next,  previous,  up

@subsection @samp{@@:}:  Pseudo-colon

@cindex Pseudo-colon
@cindex Colon, pseudo
@findex @@:
@samp{@@:} is an invisible colon (@pxref{Pseudo-operators}).
It can be helpful in formatting certain C constructions correctly.  For
example, if one has a named module defined as

@example
@@<Cases@@>=
case 1:
case 2:
case 3@@: @@;
@end example

@noindent
then one can use it as a case construction followed by the usual colon,
as in

@example
switch(c)
        @{
   @@<Cases@@>: 
        stuff;
        break;
        @}
@end example

@node AT!, , ATcolon, AT commands
@comment  node-name,  next,  previous,  up

@section Miscellaneous commands

@subsection @samp{@@!}:  Inhibit macro expansion

@findex @@!
@cindex Macros, inhibiting expansion of
@FWEB{} macros and built-in functions are always expanded by default.
This may not be desirable, particularly in the N mode.  To inhibit
expansion of an individual identifier, preface it by @samp{@@!}.

@node Comments,Languages,AT commands,Top


@comment  node-name,  next,  previous,  up

@chapter COMMENTING STYLES

@FWEB{} allows a variety of commenting styles. The visible comments are in
the font @code{\cmntfont}, which defaults to @code{\mainfont}, a
ten-point Roman font.
@cindex Commenting styles
@cindex Comments

@menu
* Invisible comments::          Skipping input material.
* Visible comments::            Comments in code mode.
* Temporary comments::          Temporarily commenting out code.
@end menu

@node Invisible comments,Visible comments,Comments,Comments
@comment  node-name,  next,  previous,  up

@section Invisible comments

@cindex Comments, invisible
@table @code
@item @@z...@@x 
If a source or include file begins with @samp{@@z} (in the very first
two characters of the file), then all material is skipped until and
including a line beginning in column 1 with @samp{@@x} [except that
lines of the form @w{@samp{$Keyword: text of keyword $}} are processed; see
@ref{$KEYWORD}, @ref{ATK_} (source files), or @ref{ATk} (include
files)].

@item @@%
All material until and including the next newline is completely ignored.

@item @@%%
As @samp{@@%}, but also skip blank lines that immediately follow the current line.
@end table

For example,

@example
@@z
Author:  J. A. Krommes
@@x
@@c @@% This sets the global language to C.
@@* EXAMPLE.
@end example

@node Visible comments, Temporary comments, Invisible comments, Comments
@comment  node-name,  next,  previous,  up

@section Visible comments

@cindex Comments, visible

@samp{/* ... */} is a long comment (it may extend over several lines).

@samp{// ...} is a short comment (terminated by the next newline).

@samp{@@(...@@)} is a meta-comment.  Meta-comments are a localized form
of the N mode (@pxref{Languages}).  Tangled meta-comments are begun by
the contents of the style-file entry @samp{meta.top} and terminated by
@samp{meta.bottom}.  Each line of the meta-comment is begun by
@samp{meta.prefix}.  Woven meta-comments are begun by
@samp{meta_code.begin} and ended by @samp{meta_code.end}.
@xref{Miscellaneous params}.

@example
@@n
@@a
        program main
/* Get input. */
        call get_input // Read the parameter file.
/* Process information.  Comments like this
   can be split over several lines. */
@@(
Meta-comments provide a poor-person's alignment feature
 i --- counter
 x --- data value
@@)
        i = 1
        x = 2.0
        call exec(i,x)
        end
@end example

@emph{The use of meta-comments is not recommended;} they are only
marginally supported.  Use ordinary long comments
instead.  Inside of them, use the various powerful features of @TeX{} or
La@TeX{} (such as @code{\halign} or
@code{\begin@{verbatim@}} @code{...} @code{\end@{verbatim@}}) to format
your comment appropriately.

@node Temporary comments, , Visible comments, Comments
@comment  node-name,  next,  previous,  up

@section Temporary comments

@cindex Comments, temporary
@cindex Code, temporarily commenting out

During development, one frequently desires to temporarily comment out a
section of code.  C programmers sometimes try to do this by enclosing the 
code in @code{/*...*/}, but this is @emph{not} good
style for several reasons.  First, it is impossible if the code itself
includes comments, since comments do not nest in C.  Second, @FWEAVE{}
will treat the commented code as @TeX{} rather than C code and will (at best)
format it very poorly.  In fact, La@TeX{} will frequently complain,
because the commented code might contain characters such as underscores
that @TeX{} expects to be in math mode.  (Those are dealt with
automatically when @FWEAVE{} is in code mode.)  The trivial example 
@w{@samp{/* a_b; */}} is sufficient to illustrate this point.

The proper way of commenting out sections of code is to use preprocessor
constructions: @code{#if 0...#endif} in C, or more generally @code{@@#if
0...@@#endif} (usable in all languages).  (The @FWEB{} preprocessor is
described in @ref{Preprocessing}.)  With this method, there is no
trouble with nested comments, and @FWEAVE{} will continue to format
the code as code, so the documentation will make sense.

For @sc{Fortran} programmers converting an existing code to @FWEB{},
the @samp{-nC} option (@pxref{-nC}) may be helpful.

@node Macros,Ratfor,Languages,Top
@comment  node-name,  next,  previous,  up

@chapter MACROS and PREPROCESSING

@FWEB{} offers a built-in preprocessor facility, especially useful for
@sc{Fortran} programmers.  It is closely patterned after the C/C++
preprocessor, but with some extensions such as variable numbers of
arguments.  In addition, there are some built-in functions that provide
functionality that cannot be emulated by user-defined macros.

When working with a language such as C that has its own preprocessor,
the question arises when to use that and when to use @FWEB{}'s
facilities.  The answer generally comes with experience.  Remember that
@FWEB{}'s macros have been expanded by the time the tangled output
file is produced, whereas language-specific preprocessor commands are
just passed through to that file.  

If you're a @sc{Fortran} programmer, @emph{strongly} consider the use of
@FWEB{}'s macro facilities; they will simplify your present and future
life by creating more legible codes and reducing programming errors by
eliminating redundant pieces of code.  C/C++ programmers may also
appreciate the preprocessor extensions.

In addition to conventional macro processing, @FWEB{} also offers the
convenience of certain built-in functions that behave in many ways like
macros.  As a trivial example, the value of @PI{} is available through
the built-in function @samp{$PI}. Built-in functions are described in
@ref{Built-in functions}.  They can be useful to programmers in all languages.

@FWEB{} recognizes two kinds of macros:  @dfn{outer macros}, and @dfn{WEB
macros} (@dfn{inner macros}).  Control codes associated with either of
these kinds normally begin the definition part.  However, @FWEB{}
macros are sometimes allowed in the code part as well; see @ref{FWEB macros}.

Macros are expanded by @FTANGLE{} only; @FWEAVE{} merely prints
them as they occur in the source file.

@cindex Macros

@menu
* Outer macros::        Macros copied to beginning of output file (@@d).
* FWEB macros::         Macros and built-in functions expanded by @FWEB{} (@@m).
* Macros and formatting:: How to format macros for pretty-printing.
* Preprocessing::       @FWEB{}'s preprocessing language (@@#if, etc.)
@end menu

@node Outer macros,FWEB macros,Macros,Macros
@comment  node-name,  next,  previous,  up

@section Outer macros

@cindex Macros, outer
Outer macros provide a shorthand way of invoking macro definitions in
the source language; they are not expanded by @FWEB{}.  Outer macros are
defined by @samp{@@d} (@pxref{ATd}) or @samp{@@D}
(@pxref{ATD_}).  They may be placed in any definition part.  @FTANGLE{}
collects them during phase 1; during phase 2, they are simply copied in
order of their appearance to the beginning of the output file.  This is
most useful for C or C++ codes; it's a quick way of typing
@samp{#define} when the positioning of the @samp{#define} is
unimportant.

As an example,

@example
@@c
@@
@@d YES 1
@@d NO 0
@@a
main()
@{@}

@@
@@d BUF_LEN 100
@@a
...
@end example

The keyword into which the @samp{@@d} is translated is
language-dependent; it is controlled by the style-file parameter
@samp{outer_def}. @xref{Miscellaneous params}.

Outer macros can be undefined by @samp{@@u}.  The translation is
controlled by the style-file parameter @samp{outer_undef}.
@xref{Miscellaneous params}.

The default behavior, in which the outer macro definitions are just
copied to the top of the output file, is fine for simple applications.
However, often C programmers prefer to maintain their macro definitions
in a header file such as @file{test.h}.  One way of accomplishing this is to
redirect @FTANGLE{}'s output from the command line, as in
@samp{ftangle test -=test.h}, then use an @samp{@@O} command immediately
after the first @samp{@@a} in the @code{web} file to open up
@file{test.c}.  A more complicated variant of this allows additional
information to be placed into the header file, as in the following example:

@example
@@c
@@* INTRO.
We assume command-line redirection into \.@{test.h@} (`\.@{-=test.h@}').

@@d A 1 // This will go into \.@{test.h@}.

@@a
@@<Header material@@>@@; // Also goes into \.@{test.h@}.
@@O test.c // Remaining unnamed sections go into \.@{test.c@}.

@@ Header material may be defined as needed throughout the code, but
with this design it will all go into \.@{test.h@}.

@@<Header material@@>=

@@<Includes@@>@@;
@@<Typedefs@@>@@;
@@<Global variables@@>@@;

@end example

@node FWEB macros,Macros and formatting,Outer macros,Macros
@comment  node-name,  next,  previous,  up

@section @FWEB{} macros

@cindex Macros, @FWEB{}
@FWEB{} macros (sometimes called @dfn{inner macros}) are defined by
@samp{@@m} (@pxref{ATm}) or @samp{@@M} 
(@pxref{ATM_}).  These should normally be placed in the definition
part, as in 

@example
@@n
@@ Documentation...

@@m CUBE(x) (x)**3

@@a
        z3 = CUBE(x) + CUBE(y)
@end example
@noindent
(the appearance of an @samp{@@m} in the documentation part begins the
definition part).  They are collected during
@FTANGLE{}'s phase 1 and effectively placed at the top of the unnamed
section, so they are all known during the output in phase 2.

In unusual situations when macros are being conditionally defined and/or
undefined, the order of processing a macro definition becomes
significant.  If the command-line option @samp{-TD} is used, then
@FWEB{} macros may be used in the code part as well; they are then
called @dfn{deferred macros}.  These definitions will be processed during
phase 2 in the order that the code sections are processed, which may not
be the same as the physical order in the source file.  

@emph{The use of deferred macros is highly discouraged}, for the
following reason.  @FWEB{} macros are often used in conjunction with
the @FWEB{} preprocessor commands.  @emph{Preprocessor commands are
always processed during phase 1}, so they do not interact properly with
deferred macros.  It is for this reason that deferred macros are
normally prohibited from appearing in the code part.

@menu
* Macro features::      Various points about @FWEB{} macros.
* Tokens::              Special tokens used in @FWEB{} macros.
* Built-in functions::  Macro-like functions built into @FWEB{}.
* Debugging with macros:: Debugging glitches, and their solutions.
@end menu

@node Macro features, Tokens, FWEB macros, FWEB macros
@comment  node-name,  next,  previous,  up

@subsection Various features of @FWEB{} macros

@quotation
@itemize @bullet
@item 
Fundamentally, @FWEB{} macros follow the syntax for ANSI C.  There are
also a few extensions, notably the possibility of variable (optional) arguments
(@pxref{Variable arguments}) and some additional preprocessing tokens
(@pxref{Tokens}). 

@item
Adjacent strings in macro text are automatically concatenated.
@end itemize
@end quotation

@menu

EXTENSIONS of ANSI-C MACRO SYNTAX

* Variable arguments::  @FWEB{} macros with variable arguments.
* Recursion::           @FWEB{} macros may be recursive (proceed at your own risk).
* Macro protection::    Protecting @FWEB{} macros against redefinition.

@end menu

@node Variable arguments, Recursion, Macro features, Macro features
@comment  node-name,  next,  previous,  up

@subsubsection @FWEB{} macros with variable arguments

@cindex Macros, with variable arguments
@cindex Variable arguments
An important extension to the ANSI-C syntax is to allow macros with
variable (optional) arguments. @FWEB{} macros with a variable number of arguments
are indicated by an ellipsis, as in

@example
@@m VAR(x,y,z,...) text
@end example
@noindent
The tokens @samp{#0} (number of variable arguments), @samp{#@i{n}}
(value of the @i{n}th optional argument), and @samp{#.} (comma-delimited list of
the optional arguments) are useful in this context.

@node Recursion, Macro protection, Variable arguments, Macro features
@comment  node-name,  next,  previous,  up

@subsubsection Recursion

@cindex Recursion
ANSI C does not permit recursive macros (for good reason).  Thus, in the
example

@example
@@m recurse recurse
@end example
@noindent
the identifier @code{recurse} simply expands as `@code{recurse}', not as
an infinite loop.  However, in @FWEB{} recursion may be useful in
conjunction with some of the built-in functions 
(@pxref{Built-in functions}).  To permit a macro to be recursive, say @samp{@@m*}.  

@emph{No formal support is provided for recursive macros!}  If they
don't work, or suddenly stop working in a new release, @emph{you're on
your own}! 

@node Macro protection, , Recursion, Macro features
@comment  node-name,  next,  previous,  up

@subsubsection Protecting macros against redefinition

@cindex Macros, redefinition of
Normally an @FWEB{} macro can be redefined at will.  The example

@example
@@m PI 3.14159
@@m PI (-3)
@end example
@noindent
is permissible, but probably not a good idea.  If you want to ensure
that a crucial macro definition is never redefined inadvertently, say
@samp{@@m!}, as in

@example
@@m! PI 3.14159
@end example
@noindent
That is called @dfn{protecting} the macro.

@FWEB{}'s built-in functions and macros (beginning with @samp{$}) are
protected by default; see 
@ref{Protection}.  To override that protection, use the command-line
options @samp{-Tb} (@ref{-Tb}; for built-in functions) or @samp{-Tm}
(@ref{-Tm}; for macros).  


@node Tokens, Built-in functions, Macro features, FWEB macros
@comment  node-name,  next,  previous,  up

@subsection Special tokens

@cindex Macros, special tokens for
The following special tokens may be used in the text of @FWEB{} macro
definitions:

@subsubsection ANSI C-compatible tokens

@example 
 ##          @r{--- Paste tokens on either side to form a new identifier.}
 #@i{parameter}  @r{--- Convert parameter to string (without expansion).}
@end example

For example,

@example
@@m FORTRAN(type, name) type _##name()
@@m TRACE(where) puts("At " #where)
@@a
FORTRAN(int, fcalc); // @r{Expands to @samp{int _fcalc();}}
TRACE(predictor); // @r{Expands to @samp{puts("At " "predictor");}}
@end example

@subsubsection Extensions to ANSI C macro syntax

The most frequently used extensions are the following ones associated
with variable arguments: @samp{#0}, @samp{#@i{n}}, and @samp{#.}.
@sc{Fortran}-77 users should also employ @samp{#:0} to allow symbolic
rather than numeric statement labels.  Try not to use the other
extensions; they are experimental, complicated, and unlikely to work in
all situations. 

In the following list, the forms @samp{#@{n@}} and @samp{#[n]} may not
work correctly in complicated situations.  This is a design deficiency
that may be corrected someday.

@quotation
@table @code
@item #*@i{param} 
 Like @samp{#@i{parameter}}, but pass a quoted string through unchanged.
@item #!@i{param}
 Don't expand argument.
@item #'@i{param}
 Convert parameter to a single-quoted string (no expansion).
@item #"@i{param}
 Convert parameter to a double-quoted string (no expansion).
@item #0         
 Number of variable arguments.
@item #@i{n}     
 n-th variable argument, counting from 1.
@item #@{0@}     
 Like @samp{#0}, but the argument may be a macro expression known at run time.
@item #@{@i{n}@}       
 Like @samp{#@i{n}}, but the argument may be a macro expression.
@item #[0]       
 The total number of arguments (fixed + variable).  (The
 argument inside the brackets may be a macro expression.)
@item #[@i{n}]       
 The @i{n}th argument (including the fixed ones), counting
 from 1.  (The argument inside the brackets may be a macro expressions.
@item #.         
 Comma-separated list of all variable arguments.
@item #:0        
 Unique statement number (expanded in phase 1).
@item #:@i{nnn}      
 Unique statement number for each invocation of this macro (expanded in phase 2).
@item #<         
 Begin a module name.
@item #,         
 Internal comma; doesn't delimit macro argument.
@end table
@end quotation

A few examples of the more important of these tokens are as follows:

@example
@@c
@@m FPRINTF(fmt,...) fprintf(fp,fmt,#.) 
        // Use the whole list of variable args.
@@m B(...) printf("There were %i arguments\n", #0) 
        // Use the number of var args.

@@n
@@
@@m DONE #:0 // Symbolic statement label in @sc{Fortran}.
@@a
        goto DONE
        ...
DONE:
        call endup
@end example

@node Built-in functions, Debugging with macros, Tokens, FWEB macros
@comment  node-name,  next,  previous,  up

@subsection Built-in functions

@cindex Functions, built-in
Built-in functions behave in most ways like macros.  In some cases
they actually are macros, but other times they implement functions that a
user could not define.  They all begin with a dollar sign and are in
upper case.

In using these built-ins, confusion may arise regarding the order of
expansion of various arguments.  When they are implemented as macros,
they are subject to the same ANSI-C preprocessor rules as other
@FWEB{} macros, which is that all arguments are fully expanded before
generating the replacement text of the macro.  When they are directly
implemented as a primitive function, however, that rule may not apply.
For example, @code{$IF} expands only its first argument during its first
pass of processing; depending on the results of that expansion, it then
expands @emph{either} its second or third argument, but not both.

The built-in function @code{$DUMPDEF} can be used to understand and
debug the action of the built-in functions.  @xref{$DUMPDEF}.

In the original @FWEB{} design, built-in functions began with an
underscore.  This usage conflicts with the conventions for reserved
words in ANSI C, and has been eliminated.  @emph{All @FWEB{} built-ins
now begin with a dollar sign.}

@emph{No user-defined macro should begin with a dollar sign!}  It might
interfere with the functioning of some internal built-in function.

@menu

GENERAL INFORMATION ABOUT BUILT-IN FUNCTION DESIGN

* Strings and quotes::  Quoted and non-quoted strings.
* Protection::          By default, built-in functions may not be redefined.

INDIVIDUAL BUILT-IN FUNCTIONS

* $A::                  Convert to ASCII.
* $ABS::                Absolute value.
* $ASSERT::             Assert a condition.
* $AUTHOR::             RCS global keyword; see $KEYWORD.
* $COMMENT::            Generate a comment.
* $DATE::               Today's date.
* $DATE_TIME::          RCS global keyword; see $KEYWORD.
* $DAY::                Today.
* $DECR::               Decrement a macro.
* $DEFINE::             Define a (deferred) macro.
* $DO::                 Macro @b{DO} loop.
* $DUMPDEF::            Dump macro definitions to the terminal.
* $E::                  Base of the natural logarithms:  2.71828...
* $ERROR::              Send error message to output.
* $EVAL::               Evaluate an expression.
* $EXP::                Exponential function.
* $GETENV::             Get value of environment variable.
* $HEADER::             RCS global keyword; see $KEYWORD.
* $HOME::               The user's home directory.
* $ID::                 RCS global keyword; see $KEYWORD.
* $IF::                 Two-way conditional:  ``If expression is true''
* $IFCASE::             n-way conditional.
* $IFDEF::              Two-way conditional:  ``If macro is defined''
* $IFNDEF::             Two-way conditional:  ``If macro is not defined''
* $IFELSE::             Two-way conditional:  ``If macro1 equals macro2''
* $INCR::               Increment a macro.
* $INPUT_LINE::         Line number that begins current section.
* $KEYWORD::            Extract text of global RCS-like keyword.
* $L::                  Change string to lower case.
* $L_KEYWORD::          Extract text of local RCS-like keyword.
* $LANGUAGE::           Identifier for current language.
* $LANGUAGE_NUM::       Number of current language.
* $LEN::                Length of string.
* $LOCKER::             RCS global keyword; see $KEYWORD.
* $LOG::                Natural logarithm.
* $LOG10::              Logarithm to the base 10.
* $M::                  Define a (deferred) macro.
* $MAX::                Maximum of one or more elements.
* $MIN::                Minimum of one or more elements.
* $MODULE_NAME::        Name of present @code{web} module.
* $MODULES::            Total number of independent modules.
* $NAME::               RCS global keyword; see $KEYWORD.
* $OUTPUT_LINE::        Current line number of tangled output.
* $P::                  The C preprocessor symbol @code{#} (an unquoted string).
* $PI::                 3.14159...
* $POW::                Raise to a power.
* $PP::                 The C preprocessor symbol @code{#} (a character).
* $RCSFILE::            RCS global keyword; see $KEYWORD.
* $REVISION::           RCS global keyword; see $KEYWORD.
* $ROUTINE::            Current Ratfor program, function, or subroutine.
* $SECTION_NUM::        Number of current section.
* $SECTIONS::           Maximum number of sections.
* $SOURCE::             RCS global keyword; see $KEYWORD.
* $SQRT::               Square root.
* $STATE::              RCS global keyword; see $KEYWORD.
* $STRING::             Expand argument, then stringize.
* $STUB::               
* $TIME::               The local time.
* $TRANSLIT::           Transliterate a string.
* $U::                  Change string to upper case.
* $UNDEF::              Undefine an @FWEB{} macro.
* $UNQUOTE::            Remove quotes from string (leaving an unquoted string).
* $UNSTRING::           Remove quotes and string delimiters from string.
* $VERBATIM::           (Obsolete.)
* $VERSION::            @FWEB{} version number.
@end menu

@node Strings and quotes, Protection, Built-in functions, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection Strings and quotes

@cindex String, definition of
@cindex String, quoted
@cindex String, unquoted

Several of the built-in functions expect or return a string argument.
Examples include @code{$STRING} (@pxref{$STRING}), @code{$UNQUOTE}
(@pxref{$UNQUOTE}), and @code{$UNSTRING} (@pxref{$UNSTRING}). 
In understanding the operation of those functions, it is important to
understand just what a string means in the @FWEB{} context.  As usual,
it is a vector of characters.  However, @emph{those need not be
delimited by quotes}, although they may be.  Internally, a string is
represented by the construction @i{sqc...cqs}, where @i{s} is a special
string delimiter never seen by the user, @i{q} is an optional quote
character (either single or double quote depending on the language), and
@i{c} is an ordinary character.  Whether or not the quotes are present,
the string delimiters inhibit macro expansion.

The difference between @code{$UNQUOTE} and @code{$UNSTRING} can now be
stated as follows.  Given a quoted string such as @code{"abc"} (in C),

@itemize @bullet
@item
@samp{$UNQUOTE} removes the quote characters @i{q}, leaving @i{sabcs} (still a
string).

@item
@samp{$UNSTRING} removes both the quote characters @i{q} and the string
delimiters @i{s}, leaving @i{abc} (a collection of three characters).  This
collection is @emph{not} tokenized; it does @emph{not} represent the
single identifier name @code{abc} (and therefore is not very useful).
@code{$UNSTRING} is primarily used internally.  

@end itemize

The built-ins @code{$P} (@pxref{$P}) and @code{$PP} (@pxref{$PP}), which
both generate the preprocessor character @samp{#}, provide a good
illustration of the differences between @code{$UNQUOTE} and
@code{$UNSTRING}.  Consider @sc{Fortran} as an example.  Essentially,
@code{$P} is defined as @samp{$UNQUOTE('#')}, which is internally
@i{s@t{#}s}.  When this single-character string is sent to the output, it is
treated like any other expression and therefore would appear in column 7
or greater even if the construction appeared at the very beginning of
the line.  On the other hand, @code{$PP} is (essentially) defined as
@samp{$UNSTRING('#')}, which is internally the single character @t{#}.
Because this character is not a string, the @sc{Fortran} output driver
treats it as a special control character, defined in this case to force
the character into the first column.

@node Protection, $A, Strings and quotes, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection Redefining built-in functions

By default, built-in functions are @dfn{protected}---that is, they may not be
redefined by an @code{@@m} command.  (To do so cavalierly invites many
kinds of weird disasters.)  If it is absolutely necessary to redefine a
built-in function, use the command-line option @samp{-Tb} (@pxref{-Tb}).

Many of @FWEB{}'s ``built-in functions'' are in fact ordinary macros
that are implemented in terms of lower-level built-ins.  An example is
@code{$POW} (@pxref{$POW}), which is constructed from the built-in
function @code{$EVAL} (@pxref{$EVAL}).  By default, such macros are also
protected against redefinition; to override, use the option @samp{-Tm}
(@pxref{-Tm}).  

@node $A, $ABS, Protection, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$A}:  Convert to ASCII

@findex $A
@cindex ASCII, converting to
@samp{$A(@i{string})} is the built-in equivalent of @samp{@@'...'} or
@samp{@@"..."}.  (See @ref{ATquote} and @ref{ATdquote}.)
Note the extra parentheses required by the built-in.

@code{$A} first expands its argument, in case it is a macro defined as a
string.

@node $ABS,$ASSERT,$A,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$ABS}:  Absolute value

@findex $ABS
@cindex Absolute value
@cindex Macros, absolute value of
@samp{$ABS(@i{expression})} returns the absolute value of the macro
expression.  It is a macro implemented in terms of @code{$IF} and @code{$EVAL}.

@node $ASSERT,$AUTHOR,$ABS,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$ASSERT}:  Assert a condition

@findex $ASSERT
@cindex Asserting a condition
@cindex Condition, asserting
@samp{$ASSERT(@i{expression})} evaluates the macro expression.  If the
expression is false, an error message is printed and the run aborts.  

This built-in is useful for ensuring that @FWEB{} macros required by
the code are properly initialized.  Because it is expanded during the
output phase, it must appear in the @emph{code 
part} (not in the definition part).

@node $AUTHOR, $COMMENT, $ASSERT, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$AUTHOR}:  Value of RCS global keyword @code{Author}
@findex $AUTHOR
@cindex Author

Equivalent to @samp{$KEYWORD(Author)}.  @xref{$KEYWORD}.

@node $COMMENT,$DATE,$AUTHOR,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$COMMENT}:  Generate a comment

@findex $COMMENT
@cindex Comments, generating
@samp{$COMMENT}(@i{string}) generates a comment in the output file.  

This function is sometimes useful in conjunction with the processing of
@FWEB{} macros, since ordinary comments are removed when macros are
processed.  For example, if one says

@example
@@c
@@
@@m M "abc" $COMMENT("Test")
@@a
m = M
@end example
@noindent
the tangled output will be @samp{m= "abc"/* Test */}

@node $DATE,$DATE_TIME,$COMMENT,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$DATE}:  Today's date

@findex $DATE
@cindex Date, generating the
@samp{$DATE} generates a string consisting of the date in the form
@code{"August 16, 2001"}.  It is implemented as a macro that calls other
macros and primitive functions.

@node $DATE_TIME, $DAY, $DATE, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$DATE_TIME}:  Value of RCS global keyword @code{Date}

@findex $DATE_TIME
@cindex Date
@cindex Time
Equivalent to @samp{$KEYWORD(Date)}.  @xref{$KEYWORD}.

@node $DAY,$DECR,$DATE_TIME,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$DAY}:  The day

@findex $DAY
@cindex Day, generating the
@samp{$DAY} generates a string consisting of the day of the week, such
as @code{"Monday"}.  It is implemented as a macro that calls other
macros and primitive functions.

@node $DECR,$DEFINE,$DAY,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$DECR}:  Decrement a macro

@findex $DECR
@cindex Macros, decrementing
@samp{$DECR(@var{N})} redefines the numeric macro @var{N} to be one less
than its previous value.  (If @var{N} does not simplify to a number, an
error results.)  In other words, in the language of C the effect is to
say @samp{@i{N}--}.

The two-argument form @samp{$DECR(@var{N,m})} executes the equivalent of
@samp{@i{N} -= @i{m}}.

@node $DEFINE,$DO,$DECR,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$DEFINE}:  Deferred macro definition

@findex $DEFINE
@cindex Macros, defining
@samp{$DEFINE} behaves like the @FWEB{} macro command @code{@@m}, but
it is intended to appear in the @emph{code} part, not the definition part (so
it is processed during @emph{output}, not input).  Thus, the code fragment

@example
a = A;
$DEFINE(A 1)@@%
a = A;
@end example
@noindent
tangles to

@example
a= A;
a= 1;
@end example
@noindent
(Notice how the @samp{@@%} command was used to kill an unwanted newline,
analogous to the @samp{dnl} macro in @code{m4}.)

In the above example, one could also say @samp{$DEFINE(A=1)}.
To define a macro with arguments, say something like
@samp{$DEFINE(A(x)x*x)}.  Do @emph{not} say @samp{$DEFINE(A(x)=x*x)}, as
in this case the equals sign will be included in the macro expansion.
One must use the equals sign as a means of preventing parentheses from
being interpreted as an argument in examples like

@example
$DEFINE(A=(x))
@end example
@noindent
This expands to @samp{(x)}.

A completely equivalent shorthand notation for @code{$DEFINE} is
@code{$M}.

@node $DO,$DUMPDEF,$DEFINE,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$DO}:  Macro do loop

@findex $DO
@cindex Macros, repetitively defining
@samp{$DO(@i{macro,imin,imax[,di]})@{...@}} repetitively defines
@i{macro} as would the @sc{Fortran} statement @samp{do macro =
imin,imax,di}.  For example,

@example
$DO(I,0,2)
  @{
  a[I] = I;
  @}
@end example

@noindent
generates the three statements

@example
  a[0] = 0;
  a[1] = 1;
  a[2] = 2;
@end example

In general, the macro name used as loop counter should @emph{not} be
explicitly defined as a macro prior to the @code{$DO}.  If it is not, it
will remain undefined after the end of the iteration.

Instead of the delimiting braces, parentheses may be used.  These may be
useful to help @FWEAVE{} format certain constructions correctly.

Nested delimiters are handled correctly.  The delimiters are required
even if only a single statement is to expanded.

@findex $UNROLL
@code{$DO} is implemented in terms of a command @code{$UNROLL}.
However, if one says something like @samp{$DUMPDEF($UNROLL(0,5,1))},
@FWEB{} will respond that @code{$UNROLL} is not an @FWEB{} macro.
Rather, @code{$UNROLL} is processed like expandable commands in
@sc{Ratfor} such as @code{while}.  This implies that it cannot be
redefined as ordinary macros or built-in functions can be.

@node $DUMPDEF,$E,$DO,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$DUMPDEF}:  Dump macro definitions to the terminal

@findex $DUMPDEF
@cindex Debugging macros
@cindex Macros, debugging
In the call @samp{$DUMPDEF(@i{m1, m2, ...})}, @i{m1}, @i{m2}, and so on
are macro calls (with arguments if appropriate).  Two lines of output
are generated for each argument.  Line 1 is the macro definition; line 2
is its expansion using the provided arguments.

One can use this built-in to debug one's own macros, or to find out the
secrets of @FWEB{}'s built-ins.  As an example, if one says

@example
$DUMPDEF($EVAL(2^^4))@@%
@end example
@noindent
it responds with the two lines

@example
$EVAL($0) = $$EVAL($0)
$EVAL(2**4) = 16
@end example
@noindent
(The @code{$@i{n}} notation indicates the @i{n}-th argument of the macro.)
If one replaces @code{$EVAL} with @code{$$EVAL} in the above
@code{$DUMPDEF}, it will respond

@example
$$EVAL($0) = <built-in>
$$EVAL(2**4) = 16
@end example
@noindent

The purpose of code such as @samp{$EVAL($0) = $$EVAL($0)} is to ensure
that the argument of @code{$EVAL} is expanded if it contains macros; the
primitive function @code{$$EVAL} does not do that expansion
automatically.

Names indicated as @samp{<built-in>} by @code{$DUMPDEF} may be redefined
as ordinary macros, but this is in general a @emph{very bad idea}; other
parts of @FWEB{} may mysteriously stop working.

@node $E, $ERROR, $DUMPDEF, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$E}: Base of the natural logarithms

@findex $E
@cindex Logarithms, natural
The expression @samp{$E} returns @var{e}, the base of the natural
logarithms, to the default machine precision. 
The expression @samp{$E(@i{iprec})} returns @var{e} to the decimal precision
@var{iprec} (which must be less than 50).

@node $ERROR, $EVAL, $E, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$ERROR}:  Send error message to output

@findex $ERROR
@cindex Error messages, printing
@samp{$ERROR(@i{string})} prints an error message in @FWEB{}'s
standard form.

@node $EVAL, $EXP, $ERROR, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$EVAL}:  Evaluate a macro expression

@findex $EVAL
@cindex Expressions, evaluating
@cindex Macros, evaluating
@samp{$EVAL(@i{expression})} uses @FWEB{}'s macro-expression evaluator
(@pxref{Preprocessing}) to reduce the macro expression to its simplest
form.  An attempt to perform arithmetic on combinations of non-macro
identifiers and numbers generates a warning message.

@node $EXP, $GETENV, $EVAL, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$EXP}:  Exponential function

@findex $EXP
@cindex Exponentiation
@samp{$EXP(@i{x})} returns 
@tex
$e^x$.
@end tex
@ifinfo
@var{e} to the power @var{x}.
@end ifinfo

@node $GETENV, $HEADER, $EXP, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$GETENV}:  Get value of environment variable

@findex $GETENV
@cindex Environment, obtaining the
@cindex Environment variables
@samp{$GETENV(@var{name})} returns a string consisting of the current
value of the environment variable @var{name}.  (Under VMS, logical names
behave like environment variables.)

The argument to @code{$GETENV} need not be a string (double-quoted), but
it may be if necessary to avoid the expansion of a macro.

@node $HEADER, $HOME, $GETENV, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$HEADER}:  Value of RCS global keyword @code{Header}

@findex $HEADER
@cindex Header

Equivalent to @samp{$KEYWORD(Header)}.  @xref{$KEYWORD}.

@node $HOME,$ID,$HEADER,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$HOME}:  The user's home directory

@findex $HOME
@samp{$HOME} is a convenience macro equivalent to @samp{$GETENV(HOME)}.

@node $ID, $IF, $HOME, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$ID}:  Value of RCS global keyword @code{Id}

@findex $ID
@cindex Identification
Equivalent to @samp{$KEYWORD(Id)}.  @xref{$KEYWORD}.

@node $IF,$IFCASE,$ID,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$IF}:  Two-way conditional

@findex $IF
@cindex Conditional, two-way
@code{$IF} is a primitive function (not a macro) that is the code-part
version of @samp{@@#if}. 
The syntax is 

@example
$IF(@i{expr}, @i{action-if-true}, @i{action-if-false})
@end example
@noindent
The @i{expr} is an @FWEB{} macro expression that must reduce to 0
(false) or 1 (true).  First that argument is expanded.  If it is true,
@i{action-if-true} is expanded; otherwise @i{action-if-false} is expanded.

There may be peculiarities with this and the other built-in @code{$IF}
function having to do with the order of expansion when the actions
contain macros whose arguments themselves are macros.  Therefore, do not
use them unless absolutely necessary.

@emph{Do not redefine} @code{$IF} or any other built-in conditionals, as they
are used internally to @FWEB{}.

@node $IFCASE,$IFDEF,$IF,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$IFCASE}:  n-way conditional

@findex $IFCASE
@cindex Conditional, n-way
This primitive built-in behaves like @TeX{}'s @samp{\ifcase} command.
The syntax is 

@example
$IFCASE(@i{expr}, @i{case-0}, @i{case-1}, ...,@i{case-n-1}, @i{default})
@end example
@noindent
If @i{expr} reduces to an integer between 0 and @emph{n-1},
inclusively, the appropriate case is selected; otherwise, the default
case is selected.

As examples,

@example
$IFCASE(2, zero, one, two, default) @r{=>} `two'
$IFCASE(2, zero, one, three) @r{=>} `three'
$IFCASE(2, zero, one) @r{=>} `one'
@end example

@node $IFDEF,$IFNDEF,$IFCASE,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$IFDEF}:  Two-way conditional

@findex $IFDEF
@cindex Conditional, two-way
This built-in primitive is the code-part version of @samp{@@#ifdef}.
The syntax is 

@example
$IFDEF(@var{macro}, @i{action-if-defined},@i{action-if-not-defined})
@end example

@node $IFNDEF,$IFELSE,$IFDEF,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$IFNDEF}:  Two-way conditional

@findex $IFNDEF
@cindex Conditional, two-way
This built-in primitive is the code-part version of @samp{@@#ifndef}.
The syntax is @samp{$IFNDEF(@var{macro}, @i{action-if-not-defined},
@i{action-if-defined})}. 

@node $IFELSE,$INCR,$IFNDEF,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$IFELSE}:  Two-way conditional

@findex $IFELSE
@cindex Conditional, two-way
The syntax of this built-in primitive is @samp{$IFELSE(@i{expr1},
@i{expr2}, @i{action-if-equal}, @i{action-if-not-equal})}.  The
expansions of @i{expr1} and @i{expr2} are compared on a byte-by-byte
basis.  If they are equal, the first action is taken, otherwise the
second action is taken.

For example,

@example
$M(S="abc")@@%
$IFELSE("abc", S, yes, no)
@end example
@noindent
evaluates to @samp{yes}.

@node $INCR,$INPUT_LINE,$IFELSE,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$INCR}:  Increment a macro

@findex $INCR
@cindex Macros, incrementing
@samp{$INCR(@var{N})} redefines the numeric macro @var{N} to be one greater
than its previous value.  (If @var{N} does not simplify to a number, an
error results.)  In other words, in the language of C the effect is to
say @samp{@var{N}++}.

The two-argument form @samp{$INCR(@var{N,m})} executes the equivalent of
@samp{@var{N} += @var{m}}.

@node $INPUT_LINE,$KEYWORD,$INCR,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$INPUT_LINE}:  Line number that begins current section

@findex $INPUT_LINE
@cindex Input line, number of
@samp{$INPUT_LINE} is the number of the line in the @code{web} source file
that @emph{begins the current section} (not the source line in which the
@code{$INPUT_LINE} command appears).  Compare @code{$OUTPUT_LINE},
@ref{$OUTPUT_LINE}. 

@node $KEYWORD, $L, $INPUT_LINE, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$KEYWORD}:  Value of global RCS-like keyword

@findex $KEYWORD
@cindex Keyword, RCS
@cindex RCS-like keyword
@samp{$KEYWORD} provides a built-in function alternative to the use of
@samp{@@K} in a code part.  (@pxref{ATK_}).  

@samp{$KEYWORD(@i{Keyword})} extracts (as a character string) the text of an
RCS-like keyword defined in the ignorable commentary between @samp{@@z}
and @samp{@@x} at the beginning of the web source file (@pxref{ATz}).
(@dfn{RCS} stands for ``revision-control system.'')  The general syntax
is (@sc{unix} users, see @samp{man ident})

@example
$@i{Keyword}: @r{text of keyword} $
@end example
@noindent
For example,

@example
@@z
$Author: krommes $
@@x

@@c
@@
@@a
char author[] = $KEYWORD(Author);
@end example
@noindent
This tangles to

@example
char author[] = "krommes";
@end example

In this example, @samp{$Author} is one of the standard RCS keywords.
However, any keyword that fits the syntax
@samp{$@i{keyword}: @i{contents} $} can be accessed by @samp{$KEYWORD}.
(At least one blank is necessary before and after @i{contents}.)
The argument of @samp{$KEYWORD} need not be quoted, but it may be.  In
either event, the output is a quoted string.

Keywords extracted from ignorable commentary at the beginning of a web
file are called @dfn{global} and are known throughout the code.
Distinguish these from @dfn{local} keywords extracted from ignorable
commentary at the beginning of an include (@samp{@@i}) file.  Such
keywords are known only during the time that file is being read and are
accessible via @samp{@@k} (@pxref{ATk}).

For convenience, built-ins are defined for some standard RCS global keywords.
These are

@example
$AUTHOR    @r{=>} $KEYWORD(Author)
$DATE_TIME @r{=>} $KEYWORD(Date)
$HEADER    @r{=>} $KEYWORD(Header)
$ID        @r{=>} $KEYWORD(Id)
$LOCKER    @r{=>} $KEYWORD(Locker)
$NAME      @r{=>} $KEYWORD(Name)
$RCSFILE   @r{=>} $KEYWORD(RCSfile)
$REVISION  @r{=>} $KEYWORD(Revision)
$SOURCE    @r{=>} $KEYWORD(Source)
$STATE     @r{=>} $KEYWORD(State)
@end example
@noindent
There are no such abbreviations for local keywords, because such
abbreviations would be expanded during output whereas it is necessary to
recognize and expand the local keywords during input.  Presumably such local
keywords will be used rarely, if at all.

@node $L,$L_KEYWORD,$KEYWORD,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$L}:  Change to lower case

@findex $L
@cindex Lower case
@cindex Case, changing
@samp{$L(@var{string})} changes @var{string} to lower case.  The argument is
first expanded in case it is a macro.

@node $L_KEYWORD, $LANGUAGE, $L, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$L_KEYWORD}:  Value of local RCS-like keyword

@findex $L_KEYWORD
@cindex Keyword, RCS
@cindex RCS-like keyword
For most purposes, @samp{$L_KEYWORD} behaves as @samp{@@k}
(@pxref{ATk}).  It is still under development and should not be used yet.

@samp{$L_KEYWORD("@i{Keyword}")} extracts (as a character string) the text of
an RCS-like keyword defined in the ignorable commentary between
@samp{@@z} and @samp{@@x} at the beginning of a file included via
@samp{@@i}.  @samp{$L_KEYWORD("@i{local keyword}")} is expanded during
input, and the results are known only during the time the include file
is being read.  

Note that the argument of @samp{$L_KEYWORD} must be a quoted string.
For more discussion of the distinction between local and global
keywords, please see @ref{ATz} and @ref{$KEYWORD}. 

It is expected that local keywords will rarely be used, as 
fundamental revision-control information should presumably be extracted
from the top of the master web file.  

@node $LANGUAGE,$LANGUAGE_NUM,$L_KEYWORD,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$LANGUAGE}:  Identifier for current language

@findex $LANGUAGE
@cindex Language, determining the
This expands to an identifier that denotes the current language, as
follows:

@quotation
@multitable {..VERBATIM..} {LANGUAGE}
@item Language      @tab  @code{$LANGUAGE}
@item  C            @tab @code{$C}
@item  C++          @tab @code{$CPP}
@item  Fortran      @tab @code{$N}
@item  Fortran-90   @tab @code{$N90}
@item  Ratfor       @tab @code{$R}
@item  Ratfor-90    @tab @code{$R90}
@item  TeX          @tab @code{$X}
@item VERBATIM     @tab @code{$V}
@end multitable
@end quotation

@noindent
Note that this outputs identifiers, not @FWEB{} macros.  They are intended
to be used in @code{$IF} or @code{$IFELSE} statements such as

@example
$IF($LANGUAGE==$C, @i{C-text}, @i{other-text})
@end example

For multiway switches, the @code{$LANGUAGE_NUM} built-in is more useful;
see @ref{$LANGUAGE_NUM}. 

@node $LANGUAGE_NUM,$LEN,$LANGUAGE,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$LANGUAGE_NUM}:  Number of current language

@findex $LANGUAGE_NUM
@cindex Language number
@cindex Language, determining
@samp{$LANGUAGE_NUM} expands to an integer that uniquely defines the
current language, as follows:

@quotation
@multitable {..VERBATIM..} {LANGUAGE_NUM}
@item Language @tab  @code{$LANGUAGE_NUM}
@item  C          @tab   @code{0}
@item  C++        @tab   @code{1}
@item  Fortran    @tab   @code{2}
@item  Fortran-90 @tab   @code{3}
@item  Ratfor     @tab   @code{4}
@item  Ratfor-90  @tab   @code{5}
@item  TeX        @tab   @code{6}
@item VERBATIM    @tab   @code{7}
@end multitable
@end quotation
 
@noindent
This built-in is useful in conjunction with an @code{$IFCASE}
construction; see @ref{$IFCASE}.

@node $LEN, $LOCKER, $LANGUAGE_NUM, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$LEN}:  Length of string

@findex $LEN
@cindex String length
@cindex Length of string
@samp{$LEN(@var{string})} returns the length of @var{string} in bytes.  If
@var{string} is not surrounded by quotes, it is interpreted as if it were
quoted (so it is not expanded if it is a macro).  Thus, in the example

@example
@@m SS string
$LEN(SS)
@end example

@noindent
the value returned is 2, not 5.

To expand the argument before taking the length, one can say something
like

@example
@@m $XLEN(s) $LEN(s)
@end example

@node $LOCKER, $LOG, $LEN, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$LOCKER}:  Value of RCS global keyword @code{Locker}

@findex $LOCKER
@cindex Lock
Equivalent to @samp{$KEYWORD(Locker)}.  @xref{$KEYWORD}.

@node $LOG, $LOG10, $LOCKER, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$LOG}:  Natural logarithm

@findex $LOG
@cindex Logarithms, natural
@samp{$LOG(@i{x})} returns 
@tex
$\ln x$.
@end tex
@ifinfo
the natural logarithm of @i{x}.
@end ifinfo

@node $LOG10, $M, $LOG, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$LOG10}:  Logarithm to the base 10

@findex $LOG10
@cindex Logarithms, base 10
@samp{$LOG10(@i{x})} returns
@tex
$\log_{10}x$.
@end tex
@ifinfo
the logarithm to the base 10 of @i{x}.
@end ifinfo

@node $M, $MAX, $LOG10, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$M}:  Define a deferred macro

@findex $M
@cindex Macros, defining
@code{$M} is equivalent to @code{$DEFINE}.  @xref{$DEFINE}.

@node $MAX,$MIN,$M,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$MAX}:  Maximum of a list

@findex $MAX
@cindex Maximum
@samp{$MAX(@i{x1},@i{x2},...)} returns the maximum of the list of arguments.
(There must be at least one argument.)

@node $MIN,$MODULE_NAME,$MAX,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$MIN}:  Minimum

@findex $MIN
@cindex Mininum
@samp{$MIN(@i{x1},@i{x2},...)} returns the minimum of the list of arguments.
(There must be at least one argument.)

@node $MODULE_NAME,$MODULES,$MIN,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$MODULE_NAME}:  Name of present @code{web} module

@findex $MODULE_NAME
@cindex Module, name of
@samp{$MODULE_NAME} returns the name of the present @code{web} module.  If the
present module is unnamed, it returns the string @code{"unnamed"}.

@node $MODULES,$NAME,$MODULE_NAME,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$MODULES}:  Total number of independent modules

@findex $MODULES
@cindex Modules, number of
@samp{$MODULES} gives the total number of independent modules---that is,
the number of independent module names, plus 1 for the unnamed module.

@node $NAME, $OUTPUT_LINE, $MODULES, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$NAME}:  Value of RCS global keyword @code{Name}

@findex $NAME
Equivalent to @samp{$KEYWORD(Name)}.  @xref{$KEYWORD}.

@node $OUTPUT_LINE,$P,$NAME,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$OUTPUT_LINE}:  Current line number of tangled output

@findex $OUTPUT_LINE
@cindex Output line
@cindex Line number
This returns the current line number of the tangled output.  Contrast
this with @code{$INPUT_LINE}, @ref{$INPUT_LINE}.

@node $P,$PI,$OUTPUT_LINE,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$P}:  The C preprocessor symbol

@findex $P
@cindex Sharp sign
@cindex Pound sign
@cindex Preprocessor symbol
@code{$P} is (essentially) a synonym for @samp{$UNQUOTE("#")}
(@pxref{$UNQUOTE}).  It is useful for constructing @FWEB{} macro
definitions that expand to C preprocessor statements.  For example,

@example
@@m CHECK(flag)
        $P if(flag)
                special code;
        $P endif
@end example

Another version of the preprocessor symbol is @code{$PP} (@pxref{$PP}).
For most purposes, @code{$P} and @code{$PP} will behave in exactly the
same way.  The difference between them is that @code{$P} is treated as a
string (without surrounding quotes), whereas @code{$PP} is treated as a
character.  The character nature of @code{$PP} is used by @sc{Fortran}
to reset the column number to 1, so C-like preprocessor commands appear
there rather than in column 7.
        
For further discussion of strings and the differences between @code{$P}
and @code{$PP}, see @ref{Strings and quotes}.

@node $PI, $POW, $P, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$PI}: Pi

@findex $PI
@cindex Pi
The expression @samp{$PI} returns 
@PI{} to the default machine
precision.  The expression @samp{$PI(@i{iprec})} returns 
@ifinfo
@var{pi}
@end ifinfo
@tex
$\pi$
@end tex
to the decimal precision @var{iprec} (which must be less than 50).

@node $POW, $PP, $PI, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$POW}:  Exponentiation

@findex $POW
@cindex Exponentiation
@samp{$POW(@i{x,y})} generates 
@tex
$x^y$.
@end tex
@ifinfo
@i{x} raised to the power @i{y}.
@end ifinfo
(It is a macro defined in terms of @code{$EVAL} (@pxref{$EVAL}) and the
exponentiation operator.) 

@node $PP, $RCSFILE, $POW, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$PP}:  The C preprocessor symbol

@findex $PP
@cindex Sharp sign
@cindex Pound sign
@cindex Preprocessor symbol
@code{$PP} is shorthand for @samp{$UNSTRING($P)} (@pxref{$P}), or
(essentially) a synonym for @samp{$UNSTRING("#")} (@pxref{$UNSTRING}).
It is useful, particularly in @sc{Fortran}, for constructing @FWEB{}
macro definitions that expand to C preprocessor statements.  For an
example, see @ref{$P}.  For a detailed discussion of the difference
between @samp{$P} and @samp{$PP}, see @ref{Strings and quotes}.

@node $RCSFILE, $REVISION, $PP, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$RCSFILE}:  Value of RCS global keyword @code{$RCSfile}

@findex $RCSfile
@cindex RCS file
@cindex File, RCS
Equivalent to @samp{$KEYWORD(RCSfile)}.  @xref{$KEYWORD}.

@node $REVISION, $ROUTINE, $RCSFILE, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$REVISION}:  Value of RCS global keyword @code{Revision}

@findex $REVISION
@cindex Revision
Equivalent to @samp{$KEYWORD(Revision)}.  @xref{$KEYWORD}.

@node $ROUTINE,$SECTION_NUM,$REVISION,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$ROUTINE}:  Current function (@sc{Ratfor} only)

@findex $ROUTINE
@cindex Program unit
When @sc{Ratfor} is the current language, @code{$ROUTINE} expands to a
string built of the name of the current program, function, or
subroutine.  This function is not useful for other languages, for which
it expands to the null string.

@node $SECTION_NUM,$SECTIONS,$ROUTINE,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$SECTION_NUM}:  Number of current @FWEB{} section

@findex $SECTION_NUM
@cindex Section number, current
@samp{$SECTION_NUM} returns an integer greater than 0 that is the
integer number of the current @code{web} section.  (This is not the
La@TeX{} section number such as 3.4.)

@node $SECTIONS,$SOURCE,$SECTION_NUM,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$SECTIONS}:  Maximum section number

@findex $SECTIONS
@cindex Section number, maximum
@samp{$SECTIONS} is the maximum section number as understood by
@FWEAVE{}.

@node $SOURCE, $SQRT, $SECTIONS, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$SOURCE}:  Value of RCS global keyword @code{Source}

@findex $SOURCE
Equivalent to @samp{$KEYWORD(Source)}.  @xref{$KEYWORD}.

@node $SQRT, $STATE, $SOURCE, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$SQRT}:  Square root

@findex $SQRT
@cindex Square root
@cindex Root, square
@samp{$SQRT(@i{x})} returns
@tex
$\sqrt{x}$.
@end tex
@ifinfo
the square root of @i{x}.
@end ifinfo
It is a convenience macro defined in terms of @code{$POW}.  @xref{$POW}.

@node $STATE, $STRING, $SQRT, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$STATE}:  Value of RCS global keyword @code{State}

@findex $STATE
@cindex State
Equivalent to @samp{$KEYWORD(State)}.  @xref{$KEYWORD}.

@node $STRING, $STUB,$STATE, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$STRING}:  Expand, then stringize

@findex $STRING
@cindex String, quoting a
@samp{$STRING(@i{s})} expands its argument if it is a macro, then makes
the expansion into a quoted string.  If the argument is already a quoted
string, it is returned unchanged.

@node $STUB,$TIME,$STRING,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$STUB}:  Trap for missing module

@findex $STUB
@cindex Modules, missing
When a missing module is detected, @FTANGLE{} inserts the command
@samp{$STUB(@i{module_name})} into the output code.  The built-in
@code{$STUB} expands to a function call appropriate to the current
language.  For example, in C it expands to @samp{missing_mod}, in
@sc{Fortran} it expands to @samp{call nomod}.

@node $TIME,$TRANSLIT,$STUB,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$TIME}:  The time

@findex $TIME
@cindex Time
@samp{$TIME} returns a string consisting of the local time in the form
@code{"19:59"}.

@node $TRANSLIT,$U,$TIME,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$TRANSLIT}:  Transliteration

@findex $TRANSLIT
@cindex Transliteration
The macro @samp{$TRANSLIT(@var{s}, @var{from}, @var{to})} interprets each of
its arguments 
as strings (without expanding anything). Then @var{s} is modified by
replacing any of the characters found in @var{from} by the
corresponding characters in @var{to}. If @var{to} is shorter than
@var{from}, then the excess characters in @var{from} are deleted from
@var{s}. As a limiting case, if @var{to} is empty, then all the
characters in @var{from} are deleted from @var{s}. For example,
@samp{$TRANSLIT(s, aeiou, 12345)} replaces the vowels in @var{s} by the
corresponding digits, and @samp{$TRANSLIT(s, aeiou, )} deletes all the
vowels.  The backslash may be used to escape a character, as in ANSI C.
For example, @samp{$TRANSLIT("a\\"\\\\d", "d\\\\a\\"", "D,A'")}
translates into @samp{A',D}.  Here one had to explicitly enclose strings
involving @samp{\\"} in double quotes in order to avoid a complaint
about an unterminated string.


@node $U,$UNDEF,$TRANSLIT,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$U}:  Change to upper case

@findex $U
@cindex Case, changing
@cindex Upper case
@samp{$U(@i{string})} changes @i{string} to upper case.

@node $UNDEF,$UNQUOTE,$U,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$UNDEF}:  Undefine a macro

@findex $UNDEF
@cindex Macros, undefining
@samp{$UNDEF(@i{macro})} undefines an @FWEB{} macro.

@node $UNQUOTE,$UNSTRING,$UNDEF,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$UNQUOTE}:  Remove quotes from string

@findex $UNQUOTE
@cindex Strings, unquoting
@samp{$UNQUOTE(@var{string})} returns @var{string} without its surrounding
quotes.  (However, the resulting construction is still treated as a
string; no macro expansion is done.)

For a more detailed discussion and a comparison with @code{$UNSTRING}
(@pxref{$UNSTRING}), see @ref{Strings and quotes}.

@node $UNSTRING, $VERBATIM, $UNQUOTE, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$UNSTRING}:  Convert string into characters

@findex $UNSTRING
@samp{$UNSTRING(@var{string})} removes quotes from the string, if they are
present, and treats the result as a collection of characters.  No
tokenization is done, so macro expansion does not operate on those
characters.

For a more detailed discussion and a comparison with @code{$UNQUOTE}
(@pxref{$UNQUOTE}), see @ref{Strings and quotes}.

@node $VERBATIM, $VERSION, $UNSTRING, Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$VERBATIM}:  (Obsolete)

@findex $VERBATIM
This was an old name for @code{$UNQUOTE} (@pxref{$UNQUOTE}).  Please
remove all references to this macro from existing codes.

@node $VERSION,,$VERBATIM,Built-in functions
@comment  node-name,  next,  previous,  up

@subsubsection @code{$VERSION}:  Present @FWEB{} version number

@findex $VERSION
@cindex Version, of FWEB
@samp{$VERSION} returns a string built out of the @FWEB{} version
number, such as @code{"1.61"}.

@node Debugging with macros, , Built-in functions, FWEB macros
@comment  node-name,  next,  previous,  up

@subsection Debugging with macros

@cindex Macros, debugging with
@findex #line

If an @FWEB{} macro expands to more than one output line, debugging
can be a bit confusing if the debugger (e.g., @code{gdb}) displays lines
in the @code{web} source file instead of the output file (as it normally
does for C and C++).  While single-stepping through the code, the
debugger will incorrectly step the screen display for each output line
even if the macro call occupies just one line in the source file.  To
localize the debugger's confusion, insert a @samp{@@#line} command after
the macro call.  For example,

@example
@@c
@@ Example of a macro that expands to several output lines.
@@m UPDATE(i, delta_i)
     i += delta_i;
     store(i)@@;
@@a
main()
@{
UPDATE(j, 5);
@@#line
// More code.  The debugger will be in sync from here on.
@}
@end example    

An alternative for highly confusing situations is to use the @samp{-#}
option (@pxref{-#}).

Another potentially confusing situation occurs when @samp{@@%} is used
to comment out a line.  @FWEB{} deals with the line-number problem
that arises here automatically; see @ref{-T#}.

@node Macros and formatting, Preprocessing, FWEB macros, Macros
@comment  node-name,  next,  previous,  up

@cindex Macros, formatting
@FWEAVE{} makes a valiant attempt to pretty-print
(@pxref{Pretty-printing}) the definitions of 
both outer macros and @FWEB{} macros in a reasonable way. However, this
can be a formidable task, because macro syntax can be essentially
arbitrary.  Consider, for example, the following definition:

@example
@@c
@@d GET(type) type get_##type()
@@a
GET(int)@{@}@@; // @r{Expands into @samp{int get_int()@{@}}.}
@end example
@noindent
The problem is that the identifier @samp{type} is used in two different
ways:  as the type of a reserved word (the second @samp{type}), and as
an ordinary expression (the third @samp{type}).  The first @samp{type} has both
meanings simultaneously.  Unfortunately, within any particular language
@FWEAVE{} associates one unique type or @dfn{ilk} with each identifier.

One solution to this problem is to use the @samp{@@R} command
(@pxref{ATR_}), which changes the ilk of the very next identifier to
integer-like.  Thus,

@example
@@d GET(type) @@R type get_##type()@@;
@end example
@noindent
will format correctly.  An alternative solution uses the related command
@samp{@@E}, which 
changes the ilk of the very next identifier to an ordinary expression.
Thus,

@example
@@f type int
@@d GET(type) type get_##@@Etype()@@;
@end example

Other types of troublesome situations involve spaces.  When @FWEB{}
understands the syntax, it inserts spaces automatically to make the
output pleasing.  Consider, however, the (somewhat contrived) example

@example
@@c
@@d A(x, y) x y
@@d B s1;
@@d C s2;
@@a
A(B, C)@@;
@end example
@noindent
Here @FWEAVE{} will consider @samp{x} and @samp{y} to be ordinary
identifiers (simple expressions), and will abut them with no intervening
spaces, which is confusing to read.  The solution is to insert a space
manually with @samp{@@,}:

@example
@@d A(x, y) x @@, y
@end example
@noindent
(Whether one should write macros like this at all is a separate issue.)
For a related example, see the discussion of @ref{ATcomma}.

@node Preprocessing,,Macros and formatting,Macros
@comment  node-name,  next,  previous,  up

@section Preprocessing

@cindex Macros, preprocessing
@cindex Preprocessing
Generally, the @FWEB{} preprocessor commands follow a syntax identical
to their C/C++ counterparts.  The one exception is the @samp{@@#line}
command.  Whereas the C command takes a line number and file name as
arguments, the @FWEB{} command takes no arguments; its expansion
automatically inserts the current line number and file name.  This
command should be necessary only in rare circumstances.  One of those
involves situations in which an @FWEB{} macro expands to more than one
output line; see @ref{Debugging with macros}.

The @FWEB{} preprocessor commands may appear in either the definition or the
code parts.  But @emph{BEWARE:  No matter where they appear, they are expanded
during INPUT, not output.}  (This is probably a design flaw.)  For more
discussion, see @ref{FWEB macros}.

@findex @@#line
@findex @@#define
@findex @@#undef
@findex @@#ifdef
@findex @@#ifndef
@findex @@#if
@findex @@#elif
@findex @@#endif

The syntax of each command is as follows:

@quotation
@table @code
@item @@#line
  --- Insert a @code{#line} command.

@item @@#define @var{identifier}
 --- Define an FWEB macro; equivalent to @samp{@@m}.
@item @@#undef @var{identifier}
  --- Undefine an FWEB macro.

@item @@#ifdef @var{identifier}
 --- Is FWEB macro defined?  Equivalent to @w{@samp{@@#if defined identifier}}.
@item @@#ifndef @var{identifier}
 --- Is FWEB macro not defined?  Equivalent to @w{@samp{@@#if !defined identifier}}.

@item @@#if @i{expression}
@item @@#elif @i{expression}
@item @@#else
@item @@#endif
@end table
@end quotation

In the @samp{@@#if} statement, the @i{expression} may contain @FWEB{}
macros, but must ultimately evaluate to a number.  If that number is
zero, the expression is false; otherwise, it is true.

@cindex Expression evaluation
The @i{expression} following constructions such as @samp{@@#if} is
evaluated by a built-in expression evaluator that can also be used for
other purposes, such as in macro expansion.  Its behavior is again
motivated by expression 
evaluation in ANSI C; it is not quite as general, but should be more than
adequate.  (One design flaw that will be fixed someday is that the order
of expression evaluation is not necessarily left-to-right, as it is in C.)
It supports both integer and floating-point arithmetic (with type
promotion from integer to floating-point if necessary), and the ANSI
@code{defined} operator. Operators with the highest precedence 
(see table below) are evaluated first; as usual, parentheses override the
natural order of evaluation. The unary operator @code{defined}
has the highest
precedence; all the other unary operators have the next highest (and equal)
precedence; then come the binary operators. When the operator exists in C,
the action taken by @FWEB{} is precisely that that the C compiler would take.
Arithmetic is done in either @b{long} or @b{double} variables, as
implemented by the C compiler that compiled @FTANGLE{}.  (This was the
easy choice, not necessarily the most desirable one.)

The operators, listed from  highest precedence  to lowest, are as
follows
@ifinfo
(printed documentation only):
@end ifinfo

@page

@tex
\gdef\expr{{\it expr}}
\gdef\.#1{{\tt #1}}
\chardef\TL=`\~% Tilde in a string: '\.\~'.
\gdef\^{\ifmmode\raise0.45ex\hbox{$\,\scriptstyle\mathchar"25E\,$}%
	\else\char`^ \fi}% 
\global\let\amp\&
$$\def\<{{\rm ,$\,$}}
\def\mod{\Mathop{mod}}
\vtop{\halign{\tt\quad#\quad\hfil&\ ---\
\vtop{\hsize=0.75\hsize\noindent\hang \strut#\strut}\hfil\cr
\noalign{\medskip\leftline{@b{Unary operators}:}\smallskip}
defined&@code{defined} is a unary operator that acts on identifier tokens. 
@samp{defined id} or equivalently @samp{defined(id)} evaluates to~1 (true) if
the identifier is defined as an @sc{Fweb} macro; 
to~0 (false) otherwise.  The construction @samp{@@\#if defined A} works the
same way as @w{@samp{@@\#ifdef A}}, but one can use @samp{defined} in
expressions, as in 
$$
\hbox{@code{@@\#if defined(A) || defined(B)}}.
$$ 
(The parentheses around the macro names are optional.)
With the advent of @samp{defined}, the
@sc{Fweb} preprocessor statements @samp{@@\#ifdef} and @samp{@@\#ifndef}
become redundant, but are often useful shorthands.\cr
-&Unary minus.\cr
!&Logical \hbox{\.{NOT}}. \.{!\expr} evaluates to~0 if \.{\expr}
is nonzero, and evaluates to~1 if \.{\expr} is~0.\cr
\TL&One's complement of an integer. For example, $\.{\TL0} =
-1$.\cr 
\noalign{\medskip\leftline{@b{Binary operators}:}\smallskip}
\^\^&Exponentiation (all languages). $2\hbox{\.{\^\^}}3 = 8$.\cr
\^\<**&Exponentiation (@sc{Fortran} or @sc{Ratfor}).\cr
*\</\<\%&Multiplication, division, and modulus: 
`\.{$a$ \% $b$}' means `$a \hbox{ mod } b$'; for example, \.{5 \% 3 = 2}. \cr
+\<-&The usual plus and minus.\cr
<<&`\.{$a$ << $b$}' means shift integer~$a$ left $b$~bits. $1 \ll
3 = 8$.\cr
>>&As above, but right-shift. $7 \gg 2 = 1$.\cr
<\<<=\<>\<>=&Evaluates to~1 if the inequality holds, to~0 otherwise.
E.g., `\.{(2.0 < 3.0)}' evaluates to~1.\cr
==\<!=&`\.{$a$==$b$}' (`\.{$a$!=$b$'}) evaluates to~1 (0) if $a$
equals~$b$; evaluates to~0 (1) otherwise.\cr 
\amp&Bitwise \hbox{\.{AND}}. The truth table is \.{0b1100 \amp{
}0b1010 = 0b1000}.\cr 
\^&Bitwise \.{EXCLUSIVE OR} (C). (For @sc{Fortran}, use `\.{.xor.}'.)
The truth 
table is {\.{0b1100}~\.{.xor.}~\.{0b1010 = 0b0110}}.\cr
|&Bitwise~\hbox{\.{OR}}. The truth table is \.{0b1100 | 0b1010 =
0b1110}.\cr 
\amp\amp&Logical~\hbox{\.{AND}}.\ `\.{$a$ \amp\amp{ }$b$}'
evaluates to~1 if both~$a$ and~$b$ are true (nonzero).\cr 
||& Logical~\.{OR}. `\.{$a$ || $b$}' evaluates to~1 if either~$a$ or~$b$
are true.\cr 
  }}$$
Note in particular the use of the single caret, which is
language-dependent:  it is an 
exponentiation operator for @sc{Fortran} (just as in @TeX{}), but is the
exclusive-or operator for~C. Also, note that the bitwise operators
should almost never be used. For 
logic, almost always one will be using @samp{==}, @samp{!=}, @samp{\&\&},
and @samp{||}. 
@end tex

@node Languages,Macros,Comments,Top
@comment  node-name,  next,  previous,  up

@chapter LANGUAGES

@cindex Languages
@cindex Language, global
@FWEB{} has the ability to work with more than one source language
during a single run.  The language in effect at the beginning of the
first section defines the @emph{global language}.  Further language
changes within a section have scope local to that section.

Usually, `language' means a compiler language like @sc{Fortran} or C.
These languages will be ``pretty-printed'' by @FWEAVE{}.
Pretty-printing can be inhibited by turning on the N mode (globally,
with the command-line option @samp{-N}; locally, with @samp{@@N}) or by
selecting the @sc{verbatim} `language'; in both of these cases, the input
text is echoed literally to the output of both @FTANGLE{} and
@FWEAVE{}.

`Language' is a stronger concept than `mode'.  For example, when a
language is selected, the extension of the tangled output file is
changed appropriately---for example, if @file{test.web} contains C code
(that is, contains the command @samp{@@c}), @file{test.web} tangles into
@file{test.c} (compressing blanks and otherwise (deliberately) making
the tangled output relatively unreadable) and @FWEAVE{} pretty-prints
using the C syntax.  Turning on the N mode does not affect the language;
@FTANGLE{} copies the source code literally into @file{test.c} (no
blank compression or other modifications), and @FWEAVE{} typesets the
source code within a verbatim environment (no pretty-printing).  When
the @sc{verbatim} language is selected, the N mode is turned on
automatically, but @FTANGLE{} writes its output to a file with a
special default extension that can be customized in the style file.
@xref{Miscellaneous params}.

@menu
* Setting the language::             Setting the language.

Special hints and considerations for each language.
* C::                   C
* C++: Cpp.             C++.
* Fortran::             Fortran--77 and Fortran--90.
* Ratfor: Ratfor_.      RATional FORtran.
* TeX::                 @TeX{}.
* Verbatim::            Literal mode.
@end menu

@node Setting the language, C, Languages, Languages
@comment  node-name,  next,  previous,  up

@section Setting the language

@cindex Language, setting
The most general form of a language command is

@quotation
@@@i{[}L@i{]ltext}[@i{options}]
@end quotation

@noindent
where @i{l} is a language symbol, @i{text} is converted into the
option @samp{-@i{l}text}, and @i{options} have the same syntax as on the
command line.  

The language symbols must be in lower case; they are

@quotation
@multitable{..VERBATIM..}{cpp}
@item C          @tab  @code{c}
@item C++        @tab  @code{c++}
@item Fortran-77 @tab  @code{n}
@item Fortran-90 @tab  @code{n9}
@item Ratfor-77  @tab  @code{r}
@item Ratfor-90  @tab  @code{r9}
@item TeX        @tab  @code{x}
@item VERBATIM   @tab  @code{v}
@end multitable
@end quotation

An example of a command with the optional @i{text} field is @samp{@@n/}.
By definition, this is equivalent to @samp{@@n[-n/]}.  Thus, it both sets
the language and invokes a command-line option.

As another example, @samp{@@n9} really means @samp{@@n[-n9]}.  Thus the
language is first set to @sc{Fortran}, then reset to @sc{Fortran}-90.
One doesn't need to worry about this detail.

@example
@@n9[-n&]
@end example

@noindent
means set the language to @sc{Fortran}--90 and use free-form syntax with the
ampersand as the continuation character.  (This construction is now
@FWEB{}'s default.)

The brackets may contain more than one space-delimited option.

A language command should appear somewhere in limbo, before the start of
the first section.  The language in effect at the beginning of the first
section defines the global language.  For historical reasons, the
default language is @sc{Fortran}-77, but @emph{do not rely on this;
always include a language command}.

Language commands may be used within sections, but the new language
remains in force only for that section.  The language of a named module
is inherited from the language in effect at the time the name is first
used.  Thus, in the following example, the global language is
@sc{Fortran}--77, but an arbitrary number of C functions can be placed into a
C-language module with just one @samp{@@c} language-changing command.

@example
@@n
@@ 
@@a
        program main
        end

@@c
@@<C@@>@@;

@@ 
@@<C@@>=
int fcn()
@{@}
@end example

@noindent
@FTANGLE{} will write two output files for this example---e.g.,
@file{test.f} and @file{test.c}.  Particularly note that one did not
need an @samp{@@c} command in the last section because the language was
C when @samp{@@<C@@>} was first encountered.

@section Special hints and considerations for each language

One important thing to keep in mind is that in @FWEB{} an identifier
may have, for each language, precisely one meaning throughout the
document.  This restriction is not necessarily in accord with the
syntaxes of the various source languages.  See, for example, the
discussions in @ref{Cpp} and @ref{Fortran}. 

@node C, Cpp, Setting the language, Languages
@comment  node-name,  next,  previous,  up

@subsection Special considerations for C

@cindex C hints
@cindex Hints, C

@itemize @bullet

@item
@cindex Binary notation
@cindex Notation, binary
@FTANGLE{} treats the construction @samp{0b...} as a binary notation
that it expands to an unsigned decimal number.  Thus, @samp{0b101}
expands to 5 and @samp{0b1111111111111111} expands to 65535.  

@item
@FWEAVE{} processes @b{typedef} statements during phase one, so they will
format properly even if they are used in a documentation part before
they are defined in a code part.

@item
The @samp{-H} option helps one to deal with identifiers defined in
header files.  @xref{-H_}.

@item
@cindex Tags, enum
@cindex Tags, structure
Note that in C structure and enum tags do not define a new type, so the
tag name does not get highlighted in boldface, underlined in the index,
etc.  (That is, if one says @samp{struct S @{...@};}, one can't say
@samp{S s;}, one must say @samp{struct S s;}.)  This is a good reason
for using C++, where such tags do define a new type.

@end itemize

(To be completed.)

@node Cpp,Fortran,C,Languages
@comment  node-name,  next,  previous,  up

@subsection Special considerations for C++

@cindex C++ hints
@cindex Hints, C++
@itemize @bullet

@item
All of the items in the previous section (@pxref{C}) still apply.

@item
The @samp{@@@{} command is very useful for beautifying very short
definitions of member functions such as constructors.  @xref{ATlb}

@item
Essentially, @FWEAVE{} has only one name space, global to the entire
code; those names do not obey any concept of scope.  In various
situations in C and C++, however, multiple namespaces are used, or the
interpretation of a name changes according to its scope.  Thus, the
design of @FWEAVE{} imposes a few restrictions on one's programming
style.  (Remember, @FWEAVE{} doesn't know nearly as much as a language
compiler.)

One example in C++ has to do with formal types in templates.  Consider
the following example:

@example
template <class Type>
class A
@{
private:
        Type *p;
@}
@end example
@noindent
In order that the class definition be typeset correctly, @samp{Type}
must be understood to be a reserved word like @b{int}, and that is
correctly figured out by the first @b{class} command.  However,
according to C++, the scope of @samp{Type} is local to the class
definition; unfortunately, @FWEAVE{} does not respect that locality and will
always treat @samp{Type} as an @b{int} from the point of the
@samp{class Type} construction to the end of the source code.  Thus, one
should use such dummy variables as @samp{Type} only as formal template
parameters, never as ordinary variables.

@end itemize

@node Fortran,Ratfor_,Cpp,Languages
@comment  node-name,  next,  previous,  up

@subsection Special considerations for @sc{Fortran}

@cindex Hints, @sc{Fortran}
@cindex @sc{Fortran} hints

@subsubsection Items for both @sc{Fortran}-77 and @sc{Fortran}-90

@itemize @bullet

@item
@cindex Binary notation
@cindex Notation, binary
@cindex Octal notation
@cindex Notation, octal
@cindex Hexadecimal notation
@cindex Notation, hexadecimal
@FTANGLE{} will translate into unsigned decimal numbers the binary
notation @samp{0b...}, the octal notation @samp{0...}, and the
hexadecimal notation @samp{0x...}.  Thus, @samp{0b101} expands to 5,
@samp{0101} expands to 65, and @samp{0x101} expands to 257.

@item
Don't use the column 1 @samp{C} commenting convention.  Use @samp{/*
... */} or @samp{// ...}.  

@item
For compiler directives, use @samp{@@?} (@pxref{AT?}), not a @samp{C} in
column 1.

@item
If you are going to use the recommended @samp{// ...} convention for
short comments, you must say @samp{@@n/} (@pxref{-n/}) or
@samp{@@n9[-n/]} as your language command.  Otherwise, \FWEB\ will treat
the @samp{//} as \@sc{Fortran's} standard token for concatenation.  (You
may always use @samp{\/} for concatenation.)

@item
@cindex Code, temporarily commenting out
If you want to completely comment out a whole block of code,
use the preprocessor construction @samp{@@#if 0...@@#endif}
(@pxref{Preprocessing}).  Don't put a comment character at the beginning
of each line; that prevents @FWEAVE{} from formatting the code
sensibly and can be annoying to undo.  With the preprocessor form, one
can also implement conditional comments by using @FWEB{} preprocessor
macros:  e.g., @samp{@@#if(DEBUG)...@@#endif}.

Pre-@FWEB{} codes may have such blocks commented out with a @samp{C}
in column 1.  Those should be converted to the preprocessor
construction.  However, if you're in a real hurry, temporarily use the
@samp{-nC} option (@pxref{-nC}) to kill those lines very early in the
processing, before they can give you all kinds of trouble.

@item
@cindex Comments, short
An unfortunate byproduct of using @samp{//} for short comments is that,
in general, format constructions like @code{format(//)} won't work.  (It
will work if one uses @samp{-nC}; see @ref{-nC}.)  Alternatively, one
can say @code{format(/ /)}.

@item
Consecutive lines commented out with a @samp{C}, @samp{c}, @samp{*}, or
@samp{!} in column 1 are converted into a single comment before
processing by @FWEB{}.  Large blocks of such lines (common in
pre-@FWEB{} code) may overflow @FWEB{}'s tables.  To avoid that,
insert blank lines between some of the comments.  Better, however, is to
move most such blocks out of the code part to the @TeX{} part of the
section.  It's most readable to have only a few very short comments
interspersed in the code.

To help with conversion of existing codes, the command-line option
@samp{-nC} can be used to completely ignore comment lines.

@item
@samp{@@} commands should, by and large, start in column 1.  That's not
necessary for short module names that fit on one line.  However, a long
module name that must be broken across lines must begin in column 1, as
in

@example
@@n
@@
@@a
@@<This is a module name
broken across lines@@>@@;
@end example
@noindent
Failure to do this results in a spurious semicolon being inserted in the
middle of the name.  This happens because the @sc{Fortran}-77 input driver
does various low-level manipulations of the source before it presents it
to the innards of @FWEB{}; it's not tokenizing the source at that time
and doesn't understand all of the @FWEB{} syntax such as module names.

@item
Define symbolic statement labels with @samp{#:0}
(@pxref{Tokens}).  Such names should be followed by a colon.  Thus,

@example
@@n
@@
@@m EXIT #:0
@@m ABORT #:0
@@a
.
.
ABORT: continue
.
.
EXIT: continue
.
.
@end example

@item
By default, statement labels are @code{\llap}'d from the body of the
statement.  With this convention, long labels can extend too far into
the left margin.  Instead, try the command-line option @samp{-n:}
(@pxref{-ncolon}), which puts them on a separate line.  Alternatively, one
can redefine the macro @code{\Wlbl}, found with some discussion in
@file{fwebmac.sty}.
@findex \Wlbl

@item
@cindex Keywords, I/O
@findex -k
As a suggestion, use upper case for I/O keywords such as @code{IOSTAT}.
However, by default the lower-case forms are also recognized.  To permit
only upper case, use @samp{-k} (@pxref{-k}).  Note that although there
is a command @samp{-nk}, it is unfortunately not related to @samp{-k}.

@item
@cindex Exponentiation
One may use @samp{^} as an alternative for the exponentiation operator
@samp{**}. 

@item
@findex -+
@cindex Assignment operators, compound
@FWEB{} attempts to be helpful and tries to expand the operators
@samp{++}, @samp{--}, @samp{+=}, @samp{-=}, @samp{*=}, and @samp{/=}
in a way compatible with the usage in C and C++.  For example, it
expands @w{@samp{x += y}} into @w{@samp{x = x + (y)}}.  This feature can be a
great time-saver and also makes the code substantially more legible; it
is strongly recommended.  To turn off this feature, use the option
@samp{-+}.  @xref{-plus}. 

@cindex Not equal
Notice that in @sc{Fortran}-90 @samp{/=} is a token for ``not equal,''
so if you want to use that you must use the @samp{-+} option.  However,
a better solution is to use @samp{!=}, @FWEB{}'s preferred operator
for ``not equal.'' 

@item
@cindex .true.
@cindex .false.
By default, the operators @code{.true.} and @code{.false.} will weave as
caligraphic T and F.  That appearance be changed by redefining the macros
@code{\WTRUE} and @code{\WFALSE} in @file{fwebmac.sty} or in the limbo
section of your source file.

@item
@findex -#
If @FTANGLE{} messes up and outputs incorrect @sc{Fortran} code, try
tangling with the command-line option @samp{-#} (@pxref{-#}) (and then
report the problem.)

@end itemize

@subsubsection Items specific to @sc{Fortran}-77 and fixed-form @sc{Fortran-90}

@itemize @bullet

@item
@cindex Semicolons, automatic
@cindex Automatic semicolons
By default, when processing the code part the
@sc{Fortran} driver inserts semicolons automatically at the end of each
logical statement.  Thus, the core of @FWEB{} is presented with a
uniform syntax.  However, when one escapes into code mode by using
vertical bars, those semicolons aren't inserted, so something that
appears a first glance to be complete statement may not be formatted as
one might expect.  Thus, the construction @samp{|5: continue|} doesn't
format quite properly (the colon disappears); this problem is solved by
putting a semicolon after the @samp{continue}.  Also, if one is talking
about multiple statements (for example, with a shift into code mode
during @TeX{} documentation), there's no choice but to insert the
semicolon between statements.  For example, @w{@samp{|a = b; c = d;|}}.

@end itemize

@subsubsection Items specific to @sc{Fortran}-90

@itemize @bullet

@item
@cindex Syntax, free-form
If @sc{Fortran}-90 is selected (@pxref{-n9}), the default is
@emph{free-form} syntax (lines are continued by a trailing ampersand).
However, automatic line breaking is done in a way compatible with
fixed-form syntax as well.

@item
@findex -n!
With free-form syntax, comment lines in the tangled output file begin
with @samp{!}.  But such lines are not recognized on input unless
@samp{-n!} is used.  @xref{-n!}.

@item
@cindex Pseudo-semicolons, automatic
@cindex Automatic pseudo-semicolons
Beginning with Version 1.61, by default (pseudo-)semicolons are automatically
inserted in free-form \Fortran-90 code, as one would expect.  For more
discussion, see @ref{-nAT;} and @ref{-n;}.

@end itemize

(To be completed.)

@node Ratfor_,TeX,Fortran,Languages
@comment  node-name,  next,  previous,  up

@subsection Special considerations for @sc{Ratfor}

For some warnings about @sc{Ratfor}, see @ref{Caveats}.

@node TeX, Verbatim, Ratfor_, Languages
@comment  node-name,  next,  previous,  up

@subsection Special considerations for TeX

@cindex Hints, @TeX{}
@cindex @TeX{} hints
@samp{@@Lx} is supported only to the extent that @code{fwebmac.sty} can
be generated correctly from @code{fwebmac.web}.  You are welcome to
experiment, but you may encounter difficulties (which you should report;
@pxref{Support}).

(To be completed.)

@node Verbatim, , TeX, Languages
@comment  node-name,  next,  previous,  up

@subsection Special considerations for the @sc{verbatim} language

Unfortunately, the @sc{VERBATIM} language is not fully debugged.
Therefore, it is not recommended for general use.
(To be completed.)

@node Ratfor,Documentation,Macros,Top
@comment  node-name,  next,  previous,  up

@chapter @sc{Ratfor}

@cindex @sc{Ratfor}
@cindex @sc{Fortran}, Rational
@cindex Rational @sc{Fortran}
``@sc{Ratfor}'' stands for ``@sc{RATional} @sc{FORtran}.''  It endows
@sc{Fortran} with a 
C-like syntax.  Certain loop and other constructions (such as
@samp{switch} or @samp{i++}) that are not allowed in @sc{Fortran} are allowed
in @sc{Ratfor}; @FWEB{} translates those into proper @sc{Fortran}.

Although @sc{Ratfor} is a definite improvement over @sc{Fortran}, it certainly
does not have the power of C (e.g., elegant pointer notation) or C++
(e.g., classes).  Many advantages accrue by taking the time to learn C.
@sc{Ratfor} offers a gentle transition.  (It is not supported very
actively any more.)

@menu
* Syntax: RSyntax.      Ratfor syntax.
* Commands::            Ratfor commands.
* Caveats::             Nuances about @FWEB{} Ratfor.
@end menu

@node RSyntax, Commands, Ratfor, Ratfor
@comment  node-name,  next,  previous,  up

@section @sc{Ratfor} syntax

A sample @sc{Ratfor} program is

@example
@@r
@@
@@a
program main
@{
integer k;
real fcn, x;

for(k=0; k<10; k++)
        @{
        x = fcn(k);

        if(x < 0.0)
                @{
                x = 0.0;
                break;
                @}
        @}
@}
@end example
@noindent
The concluding brace of a function is translated into an @b{END}
statement.  Note the use of semicolons to terminate statements, braces
to delimit compound statements, @samp{<} instead of @samp{.LT.}, the
C-like @b{for} construction, and the @samp{k++} expression. 

Constructions like @samp{k++} or @samp{k -= l + 1} must be used with
great care.  They translate to statements involving @samp{=} signs, so they
can be used only where simple statements are allowed, not essentially
anywhere as in C (for example, they cannot be used as function
arguments).

@node Commands,Caveats,RSyntax,Ratfor
@comment  node-name,  next,  previous,  up

@section @sc{Ratfor} commands

@subsection @sc{Ratfor}--77 commands

@cindex @sc{Ratfor} commands
@example 
 break; // @r{Used with @code{case} or to break out of loops, as in C.}
 case i: // @r{Used with @code{switch}.}
 default: // @r{Used with @code{case}, as in C.}
 do ...; @{...@} // @r{Note the semicolon (unnecessary if followed by a compound stmt).}
 else @{...@} // @r{Used after @code{if} as in C.}
 for(a;b;c) @{...@} // @r{As in C.}
 if(condition) @{...@}
 next; // @r{Equivalent to C's |continue| statement; go to bottom of loop.}
 repeat @{...@} until(condition); // @r{Equivalent to C's @code{do @{...@} while();}}
 return expression; // @r{As in C.}
 switch(expression) @{...@} // @r{As in C.}
 while(condition) @{...@} // @r{Like C's @code{while}.}
@end example

@subsection Additional @sc{Ratfor}--90 commands

@example
 contains:
 interface name @{...@}
 interface operator(op) @{...@}
 interface assignment(assgnmnt) @{...@}
 module name @{...@}
 private:
 sequence:
 type name @{...@}
 where(expression) @{...@}
@end example

@node Caveats,,Commands,Ratfor
@comment  node-name,  next,  previous,  up

@section Caveats about @sc{Ratfor}

@cindex @sc{Ratfor}, caveats about
The version of @sc{Ratfor} built into @FWEB{} differs slightly from its @sc{unix}
counterpart:  

@quotation
@enumerate
@item 
Numeric statement labels must be followed by a colon; they should
be first on their line.  (Use symbolic statement labels instead; see the
discussion of @samp{#:0} in @ref{Tokens}.)

@item
The quoting convention for characters and strings follows that
of C:  Single-quote single characters, double-quote strings.

@item
In a @b{switch}, cases fall through to the next case unless
terminated by @b{break} (just as in C).

@item
The @b{do} statement must be terminated by a semicolon if
followed by a simple statement.  (It's unnecessary if followed by a left
brace that begins a compound statement.)

@item
Use @t{&&} and @t{||} for the logical AND and OR.

@item
Do not use an @b{end} statement at the very end of a @sc{Ratfor} program
unit; it is added automatically by @FWEB{} when the closing brace is sensed.
@end enumerate
@end quotation


@node Documentation,Index,Ratfor,Top
@comment  node-name,  next,  previous,  up

@chapter DOCUMENTATION

@cindex Formatting
@cindex Documentation format
@FWEB{} uses La@TeX{} to produce its documentation.  Plain @TeX{}
is no longer supported.

It is not necessary to be very familiar with La@TeX{} in order to use
@FWEB{} effectively.  @FWEB{} does complicated things behind
the scenes, relieving the programmer of many burdens.  If you don't need
complicated mathematics, one needs to know virtually no La@TeX{} at all
in order to document a section of code.  And if you do need to typeset
math, consider that La@TeX{} makes this daunting task about as simple as
one could hope.

If you're an @FWEB{} beginner, don't bother diving into the details of
this section until you really need to.

@menu
* Typesetting::         Woven output; TeX vs. LaTeX, etc.
* Pretty-printing::     Turning ugly input into beautiful output.
@end menu

@node Typesetting, Pretty-printing, Documentation, Documentation
@comment  node-name,  next,  previous,  up

@section Typesetting

@cindex Typesetting
@FWEB{}'s ``new look'' (beginning with version 1.40) is designed
to work only with La@TeX{}.  The new look is more
book-like, following ideas from Briggs' @code{nuweb}.  By default, it
uses default La@TeX{} section numbers such as 1.5.32; however, sections
may be numbered with consecutive integers by specifying the La@TeX{}2e package
@code{fwebnum}; see @ref{Numbering}.

@menu
* Output::	Structure of the TeX output from @FWEAVE{}.
* fwebmac.sty:: The macro package used with @FWEAVE{}.
* LaTeX::	Specifics of the LaTeX support.
@end menu

@node Output,  fwebmac.sty, Typesetting,  Typesetting
@comment  node-name,  next,  previous,  up

@subsection @FWEAVE{}'s OUTPUT

When one says @samp{fweave test}, the file @file{test.tex} is created.
Some @TeX{} commands contained in this file are created automatically;
others are copied from the web source file.  They are organized into several
sequential groups, as follows.

@quotation
@enumerate
@item 
@code{\input} command to read in @FWEAVE{}'s macro package.

@findex fwebmac.sty
By default, the initial input command is @samp{\input fwebmac.sty}
(@pxref{fwebmac.sty}).  The name of the macro package can be changed
with 
the @samp{-w} command-line option, but that is dangerous and useful only for
very special effects.  @xref{-w}.

@item 
@code{\Wbegin} command.

The @code{\Wbegin} macro sets up certain defaults (which can be overridden in
the limbo section).  In La@TeX{}, it also issues the
@samp{\documentclass@{article@}} and @samp{\begin@{document@}} commands.

@item 
Limbo text from the style-file parameter @code{limbo.begin}.  @xref{S_limbo}.

@item
Limbo text from @samp{@@l} commands. @xref{ATl}.

@item 
User's limbo section.

@item
Limbo text from the style-file parameter @code{limbo.end}.
@xref{S_limbo}.

@item 
@TeX{} commands for individual WEB sections.

@item 
@code{\input} command to read in the index data file.

@item 
@code{\input} command to read in the module-list data file.

@item 
@code{\Winfo} command (summarizes some status information).

@item 
@code{\Wcon} command (generates the Table of Contents, and ends the run).
@end enumerate
@end quotation



@node fwebmac.sty, LaTeX, Output, Typesetting
@comment  node-name,  next,  previous,  up

@subsection The macro package @file{fwebmac.sty}

@findex fwebmac.sty
@FWEAVE{} works in conjunction with the macro package
@file{fwebmac.sty}, which is always read into the @file{.tex} file by
default.  This file is (overly) complicated, so one should not mess with
it unless in dire emergency.  Most of its commands are intended for
behind-the-scenes  processing.  However, some features may be of general
interest; these are described in the items below.

For the most part, macros used internally by @file{fwebmac.sty} begin
with an uppercase @samp{W}.  If you are worried about macro conflicts, a
complete list of the macros appearing in @file{fwebmac.sty} can be found
in the Index produced by weaving @file{fwebmac.web}.

@menu
* User macros:: Macros defined for user convenience.
* Fonts::       Useful font commands.
@end menu

@node User macros, Fonts, fwebmac.sty, fwebmac.sty
@comment  node-name,  next,  previous,  up

@subsubsection User macros

For the user's convenience, @file{fwebmac.sty} defines a variety of
macros such as @samp{\FWEB}, @samp{\Fortran}, etc.  Refer to
@file{fwebmac.web} for a complete list.

@FWEAVE{} usurps various common single-character macros such as @samp{\.} for
its own purposes.  So the user can still access their original
definitions, those are @samp{\let} equal to alternative commands 
such as @samp{\period}.  For example, commands such as the following are
executed in @code{fwebmac.sty}: 

@example
\let\amp\&
\let\at\@@@@
\let\bslash\\
\let\caret\^
\let\dollar\$
\let\dstar\*
\let\equals\=
\let\leftbrace\@{
\let\period\.
\let\rightbrace\@}
\let\vertbar|
\let\PM\#
\let\PC\%
@end example
@noindent
(Some of the more inscrutable synonyms are for historical reasons.)

For the most up-to-date and detailed information, refer to @file{fwebmac.web}. 

@node Fonts, , User macros, fwebmac.sty
@comment  node-name,  next,  previous,  up

@subsubsection Fonts

@cindex Fonts
Several fonts have been declared.
Those include

@quotation
@itemize @bullet
@item
@samp{\titlefont} (large sans serif),

@item
@samp{\ttitlefont} (large typewriter), 

@item
@samp{\SC} (small caps),

@item
@samp{\Csc} (Caps/small caps), and

@item
@samp{\tentex} (@TeX{}'s extended character set). 

@end itemize
@end quotation

@noindent
For illustrations and further details, see @file{fwebmac.web}.

To typeset a string of characters in typewriter type, one may use the
@samp{\.} macro.  (More precisely, the name of this macro is the value
of the style-file parameter @code{format.typewriter}.  For more
information, see @ref{S_format}.)
When using this, one must escape the special
characters @samp{ \#%$^_@{@}~&}, as in @samp{\.@{\\alpha@}}.  (@FWEAVE{}
does that escaping automatically when typesetting strings in code mode.)
You may wish to surround @samp{\.@{...@}} with an @samp{\hbox}; that is
not done by default because @FWEAVE{} uses special trickery to break
long strings in code mode automatically, and that breaking would be
inhibited by an @samp{\hbox}.

@node LaTeX, , fwebmac.sty, Typesetting
@comment  node-name,  next,  previous,  up

@subsection La@TeX{} support

@cindex La@TeX{}
@cindex La@TeX{}2e
Original La@TeX{} support (through version 1.30) was substantially
incomplete in that La@TeX{}'s @code{\output} routine was usurped by the
relatively simple one used for @FWEB{}'s @TeX{} support.  However,
beginning with version 1.40, full La@TeX{} support is provided (and
Plain @TeX{} is @emph{not} supported); version 1.50 supports La@TeX{}2e.
La@TeX{}'s @code{\output} routine is used, as are its sectioning
commands (with minor changes), Table-of-Contents facilities, etc.

The following discussion is based on La@TeX{}2e.  If La@TeX{}2e is not
installed, @FWEAVE{} recognizes that fact and issues the
@samp{\documentstyle} command instead of @samp{\documentclass}.
@findex \documentstyle

Users are strongly encouraged to upgrade to La@TeX{}2e.  A useful book
that describes the present state of La@TeX{} is Goossens, Mittelbach,
and Samarin, @cite{The La@TeX{} Companion} (Addison--Wesley, Reading, MA,
1994).

@menu
* Document class::	LaTeX's document class, options, etc.
* REVTeX::              The REV@TeX{} scientific macro package.
* Packages::            Special FWEB-related La@TeX{}2e packages.
* Sections::	        Section numbering, spacing, etc.
* Index:LIndex.         Technical details about multi-columns and the Index.
* Table of Contents::   The Table of Contents.
* Customizing LaTeX::   Conditional flags, etc.
* Inserting woven code:: How to insert @FWEAVE{}'s output into a La@TeX{} document.
@end menu

@node Document class, REVTeX,  LaTeX, LaTeX
@comment  node-name,  next,  previous,  up

@subsubsection La@TeX{}'s document class

@findex \documentclass
An @FWEB{}/La@TeX{} document is set up with the @samp{\Wbegin}
command, issued automatically by @FWEAVE{}.  See the summary at the
end of this section for the essence of what the @samp{\Wbegin} command
accomplishes.  

@FWEAVE{} uses @code{\documentclass@{article@}} by default.  In
principle, the document class can be changed by the @FWEB{} style-file
option @samp{LaTeX.class}; see @ref{Fwebmac params}.  However,
@emph{@FWEAVE{} has not been tested with most other document classes}.
It will probably not work with most document classes that redefine the
sectioning commands from those of @code{\documentclass@{article@}}.
However, it @emph{may} work with the @code{revtex} scientific macro
package.  @xref{REVTeX}.

To incorporate class options---i.e., to obtain the effect of
@samp{\documentclass[myoptions]@{article@}}---use the style-file parameter
@code{LaTeX.class.options}, as in
@cindex Class options
@cindex Options, class

@example
LaTeX.class.options "myoptions"
@end example
@noindent
To get two-sided printing, for example, one would say
@cindex Printing, two-sided

@example
LaTeX.class.options "twoside"
@end example

@findex \usepackage
@cindex User packages
@cindex Packages, user
To specify user packages---i.e., to obtain the effect of
@samp{\usepackage[pkgoptions]@{pkgname@}}---use the style-file parameters
@code{LaTeX.package} and @code{LaTeX.package.options}, as in

@example
LaTeX.package "pkgname"
LaTeX.package.options "pkgoptions"
@end example
@noindent
For example, to indent the first line of every section and to permit the
use of the @code{multicol} package (the latter is a useful way of
substantially cutting down on white space), say

@example
LaTeX.package "indentfirst,multicol"
@end example

Note that specifying @code{LaTeX.package} and
@code{LaTeX.package.options} results in the execution (by the
@code{\Wbegin} macro) of precisely @emph{one} line of the form

@example
\usepackage[myoptions]@{mypackages@}
@end example
@noindent
Sometimes one instead needs to have multiple @code{\usepackage} lines,
such as

@example
\usepackage[option1]@{package1@}
\usepackage[option2]@{package2@}
@end example
@noindent
To get this effect, one can put these commands explicitly into the
style-file parameter @code{doc.preamble} (see discussion two paragraphs
below), as in 

@example
doc.preamble = "\\usepackage[option1]@{package1@}\
                \\usepackage[option2]@{package2@}"
@end example

@TeX{} commands in the user's limbo section of the @code{web} source
file will be processed @emph{after} the @code{\begin@{document@}}
command.  Limbo commands from the style file can be inserted before
and/or after those in the limbo section with the aid of the style-file
parameters @samp{limbo.begin} and @samp{limbo.end}; see @ref{S_limbo}.

If there is a compelling reason to insert one's own La@TeX{}
commands between the @samp{\usepackage} and @samp{\begin@{document@}}
commands, one may use the style-file parameter @samp{doc.preamble},
whose value is a string consisting of La@TeX{} commands (empty by
default).  Those commands are processed immediately before
@samp{\begin@{document@}}.  One use of @samp{doc.preamble} is to inhibit
@FWEB{}'s tendency to keep a section together on one page.  To make it
break more readily in the middle of sections (particularly useful for
multicolumn output), say

@example
doc.preamble "\\secpenalty=0"
@end example

In summary, the beginning of the file output by @FWEAVE{} looks like
the following, where @samp{<parameter>} means the contents of the
style-file string called @samp{parameter}:

@example
\input fwebmac.sty
\Wbegin@{many obscure arguments@}
<limbo.begin>
Optional TeX commands copied from user's limbo section
<limbo.end>
@end example

@noindent
@findex \Wbegin
The @samp{\Wbegin} command essentially does the following:

@example
\documentclass[<LaTeX.class.options>]@{<LaTeX.class>@}
\usepackage[<LaTeX.package.options>]@{<LaTeX.package>@}
<doc.preamble>
\begin@{document@}
@end example
@noindent
For precise information about how @samp{\Wbegin} works, see
@code{fwebmac.web}.  If you feel that macro absolutely needs to be
changed, please inform the developer (@pxref{Support}).

@node REVTeX, Packages, Document class, LaTeX
@comment  node-name,  next,  previous,  up

@subsubsection Using REV@TeX{}

REV@TeX{} is the standard macro package used for formatting scientific
papers submitted to the American Physical Society, the American
Institute of Physics, and some European journals.  It modifies the
sectioning commands of @code{\documentclass@{article@}} and provides
various other useful macros.

Unfortunately, as of August, 1998, REV@TeX{} is not fully compatible
with La@TeX{}2e; it must be invoked with
@code{\documentstyle@{revtex@}}, not @code{\documentclass}.  This is
annoying, because @FWEB{}'s macros in @file{fwebmac.sty} default to
@code{\documentclass} if they recognize that La@TeX{}2e is loaded.

To use REV@TeX{}, uncomment the line in @file{fwebmac.sty} that says
@code{\useREVTeXtrue}.  (One cannot say @samp{\useREVTeXtrue} in the
limbo section of one's @code{web} source, because the document class has
already been selected by that time.)  You may wish to rename the
resulting file, say to @file{rwebmac.sty}, so it can be loaded in place
of the standard @file{fwebmac.sty}.  To do that, one would use the
command-line option @samp{-wrwebmac.sty} (see @ref{-w}).

Saying @code{\useREVTeXtrue} selects @code{\documentstyle} rather than
@code{\documentclass}.  To implement a standard command such as
@code{\documentstyle[aps,my_macros]@{revtex@}}, use the style-file
(@file{fweb.sty}) parameters @code{LaTeX.style} and
@code{LaTeX.options}, as in

@example
LaTeX.style "revtex"
LaTeX.options "aps,my_macros"
@end example
@noindent
Here @file{my_macros.sty} would be a user's macro package loaded in
addition to those of REV@TeX{} and @FWEB{}.

REV@TeX{} support is extremely recent.  There may be glitches; please
report those.  In a pinch, if La@TeX{} stops while processing a
REV@TeX{} file produced by @FWEAVE{}, try typing `s' (scroll mode) to
force it to continue; you might get usable output.

@node Packages, Sections, REVTeX, LaTeX
@comment  node-name,  next,  previous,  up

@subsubsection La@TeX{} packages related to @FWEB{}

The following packages are supplied with the @FWEB{} distribution and
can be used to achieve special effects.  Packages are invoked by giving
their names as arguments to the @code{LaTeX.package} command; see
@ref{S_LaTeX}.

@iftex
@itemize @bullet
@item
@code{fwebinsert} --- Enables insertion of woven code into a La@TeX{}
document.  
@xref{Inserting woven code}.

@item
@code{fwebnum} --- Number each section in ascending integer order.
@xref{Numbering}.

@item
@code{idxmerge} --- Merge several stand-alone indexes.  @xref{Merging indexes}.

@end itemize
@end iftex

@menu
* fwebinsert:Inserting woven code. Enable insertion of woven code into a La@TeX{} document.
* fwebnum:Numbering.              Number each section in ascending order.
* idxmerge:Merging indexes.       Merge several stand-alone indexes.
@end menu

@node Sections,  LIndex, Packages,  LaTeX
@comment  node-name,  next,  previous,  up

@subsubsection Sections in La@TeX{}

@cindex La@TeX{} section
@findex \section
@findex \subsection
@findex \subsubsection
@FWEB{}'s sectioning commands @samp{@@*} and @samp{@@*@i{n}}
are converted into 
La@TeX{}'s section commands such as @code{\section} (@i{n}=0),
@code{\subsection} (@i{n}=1), and 
@code{\subsubsection} (@i{n}=2).  During La@TeX{}'s processing of the
@code{.tex} file, it 
keeps track of the maximum depth achieved by @samp{@@*@i{n}}.  This number is
written as the last item in the @file{aux} file.  During the next
La@TeX{} run, 
that number is used to map the untitled @ASP{} commands to the next most
insignificant sectioning command.  That level of sectioning command is
slightly redefined from La@TeX{}'s default, so don't try to redefine it.

The previous scheme means that it may be necessary to run La@TeX{} as
many as three times in order to resolve all sectioning and
cross-reference information correctly.  You should be warned in such
cases.  If not, you will recognize difficulties by noting that the Table
of Contents or section numbering is incomplete.

The @file{aux} file is also used by both processors to generate
appropriate error messages that refer to the La@TeX{} section number
instead of the internal one.

A discussion of alternative section-numbering schemes is given in
@ref{Numbering}. 

@node LIndex, Table of Contents, Sections, LaTeX
@comment  node-name,  next,  previous,  up

@subsubsection La@TeX{}'s index.

@cindex Index
@findex \INDEX
@findex \beforeindex
@findex \startindex
@findex \Wfin
The Index should be the last section of the code, and should be begun by the command @samp{@@* \INDEX.}.  For more
information, see @ref{S_index}.

The challenge of typesetting the Index is to get it into two-column mode
in the best possible way.  In the original Plain-@TeX{} @FWEB{},
special code was provided for this.  With La@TeX{}, however, one wants
to use standard features.

@cindex @code{multicol}, using
@cindex Package, @code{multicol}
@findex multicol.sty
@findex \twocolumn
The best solution is to use the user package @code{multicol}.  If that
is loaded by means of the style-file statement @samp{LaTeX.package
"multicol"}, then any text typed by the user following the @samp{@@*
\INDEX.} command will 
be typeset in single-column mode, after which two-column mode is
entered.  If it is not loaded, a @samp{\twocolumn} command is issued
@emph{before} the index section is begun (in order to get the Index
started on a new page).  

More precisely, what happens is the following.  When the @samp{@@*
\INDEX.} command is recognized, essentially the following operations are
performed, where the results are bracketed in the form @samp{[multicol :
nomulticol]}:  

@example
\beforeindex [\newpage : \twocolumn]
[print INDEX section heading]
\startindex  [\begin@{multicols@}@{2@} : \medskip]
\Wfin        [\end@{multicols@} : \relax]
@end example
@noindent
(Use of the asymmetrical name @samp{\Wfin} is for historical reasons.)

@cindex Columns, multiple
The positioning of @samp{\beforeindex} suggests a way of printing the
entire document in two-column mode.  If one enters multi-column mode in
the limbo section, then @samp{\beforeindex} can be used to terminate it.
It is best to do this at the @emph{end} of the limbo section; otherwise
user macro definitions in the limbo section must be made @code{\global} in order
that they remain defined in the Index.  The relevant commands can be
placed in the style file:

@example
LaTeX.package "multicol"

doc.preamble "\\secpenalty=0"

limbo.end "\\def\\beforeindex@{\\end@{multicols@}\\newpage@}\n\
\\begin@{multicols@}@{2@}\n\
\\raggedcolumns"
@end example
@noindent
Just to repeat, use only the first command to get just the Index printed
in two-column format; use the second and third ones to make the entire
document two-column.

@node Table of Contents, Customizing LaTeX, LIndex, LaTeX
@comment  node-name,  next,  previous,  up

@subsubsection La@TeX{}'s Table of Contents

@cindex Contents, table of
@cindex Table of Contents
@findex \FWEBtoc
La@TeX{} uses the @file{aux} file to accumulate the information for the
Table of Contents.

When La@TeX{} is used, the Table of Contents appears at the front of the
document by default (beginning with version 1.61).  This is accomplished
by setting the default value of the style-file parameter
@code{limbo.end} to @code{"\\FWEBtoc"}, where @code{\FWEBtoc} is defined
in @file{fwebmac.sty}.  If you initialize @code{limbo.end} yourself in
@file{fweb.sty}, you should include @code{"\\FWEBtoc"} at the end of
that initialization if you want the Table of Contents to appear in the
beginning.  Otherwise, it will appear at the end.

In essence, the Table of Contents is produced by the La@TeX{} commands

@example
\pagenumbering@{roman@}
\maketitle
\topofcontents
\tableofcontents
\botofcontents
\newpage
@end example

@noindent
@findex \topofcontents
@findex \botofcontents
@findex \maketitle
@findex \Title
@findex \title
By default, the @FWEB{} hooks @code{\topofcontents} and
@code{\botofcontents} are empty, 
but they may be used in special circumstances to override the usual
behavior.  One can set the parameters for @code{\maketitle} in the limbo
section in the usual La@TeX{} way, except that it is better to use
@FWEB{}'s @code{\Title} macro instead of @code{\title}:

@example
\Title@{MYCODE.WEB@}
\author@{My name@}
\date@{January 1, 2001@}
@end example

By default, the argument of the @code{\Title} macro is printed both on
the title page and as a running headline in the document.  The default
font for the title is @code{\ttitlefont}; that for the running headline
is @code{\large\tt}.  However, @code{\Title} has one optional argument
that allows one to override the running headline, perhaps by specifying
a shorter form.  Say

@example
\Title[@i{Short title}]@{@i{Long title}@}
@end example
@noindent
to make the running headline be @samp{\large\tt @i{Short title}} and the
title-page title be @samp{\ttitlefont @i{Long title}}.  

The \@FWEB{} @code{\Title} macro calls La@TeX{}'s @code{\title} macro
with the long title as its argument.
By default, @FWEAVE{} uses (in the @samp{\Wbegin} macro)

@example
\title@{@}%
\author@{@}%
\date@{\today\\[3pt]\Time@}%
@end example

@findex \numberline
Section numbers in the Table of Contents are produced by the La@TeX{}
macro @code{\numberline}.  La@TeX{}'s default definition is inadequate
when section numbers are very large; they extend to the right and can
overwrite the section name.  The macro is redefined more appropriately
when the package @code{fwebnum} (@pxref{Numbering}) is used.

@node Customizing LaTeX, Inserting woven code,  Table of Contents, LaTeX
@comment  node-name,  next,  previous,  up

@subsubsection Customizing La@TeX{}'s output

Several (@TeX{}) flags are provided to change the appearance of the final
La@TeX{} document.  (This appearance is a bit experimental, and it is
fair to say that not everything may be fully debugged; please report
problems.)  These are (@samp{...} means either @samp{true} or @samp{false})

@quotation
@itemize @bullet
@item 
@findex \pagerefs
@code{\pagerefs...} (index references by pages or section numbers);

@item 
@findex \numberTeX
@code{\numberTeX...} (number the beginning of unnamed TeX parts);

@item 
@findex \numberdefs
@code{\numberdefs...} (number the beginning of the definition part);

@item 
@findex \numbercode
@code{\numbercode...} (number the beginning of the code part).
@end itemize
@end quotation

@noindent
The defaults for these flags are

@example
\pagerefsfalse
\numberTeXfalse
\numberdefstrue
\numbercodetrue
@end example

@noindent
If desired, one may override these in the limbo section.
(They are defined using Plain @TeX{}'s @samp{\newif} rather than the
equivalent La@TeX{} command because they may also be used when La@TeX{}
is not present.)

@code{\numberTeX} is on the verge of obsolescence.  Try to not use it;
never use it in conjunction with the package @code{fwebnum}.
@xref{Numbering}

@menu
* Page references::     Indexing by page numbers.
* Headers::             The content of page headers.
* Numbering::           Various section numbering schemes.
@end menu

@node Page references, Headers, Customizing LaTeX, Customizing LaTeX
@comment  node-name,  next,  previous,  up

@subsection Page references

@findex \pagerefs
@cindex Page numbers
@cindex Sections, numbering
When one says @samp{\pagerefstrue} (La@TeX{} only), index references are
made by page numbers rather than module numbers or La@TeX{} section
numbers.  If there is more than one section per page, they are
identified by @samp{a}, @samp{b}, @samp{c}, etc., such as @samp{section
17b}.  (Presently, this will not work correctly when @code{multicol} is
used for the body of the document.)

The information necessary to process page references in this way is
written into the @file{aux} file.  As is usual with La@TeX{}, several runs
may be required for the references to be fully consistent with the
source file.

@node Headers, Numbering, Page references, Customizing LaTeX

@subsection Page headers

@cindex Headers
@cindex Page headers
The very top (header) line on each page of @FWEAVE{}'s output contains
several pieces of information:

@itemize @bullet

@item
the current section name or document title;

@item
the page number; 

@item
the range of La@TeX{} section numbers on the
page (these are preceded by the 
@ifinfo
@samp{\S}
@end ifinfo
@tex
\S\
@end tex
symbol); and

@item
the range of integer section numbers as understood internally by
@FWEAVE{} (those are in square brackets and preceded by the @samp{#} sign).

@end itemize

@node Numbering, , Headers, Customizing LaTeX
@comment  node-name,  next,  previous,  up

@subsection Section numbering schemes

@cindex Sections, numbering
@cindex Package, @code{fwebnum}
@findex fwebnum.sty
The @FWEB{} commands @samp{@@*} and @ASP{} are translated by
complicated magic into La@TeX{} commands such as @code{\section},
@code{\subsection}, etc.  By default, use of
@code{\documentclass@{article@}} then produces Dewey-decimal section
numbers such as 2.13.4 (subsubsection 4 of subsection 13 of section 2).
When the section tree is very deep, these numbers can look somewhat obtrusive.

An alternative scheme (that of the original @sc{web}) is to merely
number each section in ascending integer order, beginning with 1.  This
can be done by specifying the package @code{fwebnum}, as in

@example
LaTeX.package = "fwebnum"
@end example
@noindent
This package is supplied with the @FWEB{} distribution; it is still
somewhat experimental.

By default, @code{fwebnum} numbers all sections, including unnamed
ones.  To prohibit numbering of unnamed sections, use the package option
@code{dontnumberunnamed}, as in

@example
LaTeX.package.options = "dontnumberunnamed"
@end example
@noindent
This option will eventually make @code{\numberTeX} obsolete; do not use
@code{\numberTeX} in conjunction with @code{fwebnum}.

@node Inserting woven code, , Customizing LaTeX, Packages
@comment  node-name,  next,  previous,  up

@subsubsection Package @code{fwebinsert}:  Inserting @FWEAVE{}'s output into a La@TeX{} document

@cindex FWEB output, inserting into LaTeX document
@findex fwebinsert.sty
Beginning with version 1.61, it is (barely) possible to insert the
@TeX{} output woven by @FWEAVE{} into a La@TeX{} document.  For
example, a code listing could be an appendix to a dissertation, or a
handbook on numerical methods could insert fragments of code formatted
by @FWEAVE{}.

Suppose one has the file @file{test.web} and used @FWEAVE{} to create
@file{test.tex}.  Unfortunately, it does @emph{not} work to simply
@code{\input test.tex} into a La@TeX{} document, because by
default @file{test.tex} operates in a ``stand-alone'' mode and tries to
issue a @code{\begin@{document@}} command.

Instead, one must use the package @code{fwebinsert} and the special
input command @code{\FWEBinput}, as in the following example.  There are
two important steps.

@quotation
@enumerate
@item
Use @FWEAVE{} to create @file{test.tex}.
[You may wish to use the @samp{-x} flag
(@pxref{-x}) to prevent some of the lists at the end, such as the index
or module list, from being printed.]

@item 
Now @samp{latex test} until all of the section numbering is up-to-date.
(This step is necessary because information in the @file{aux} file is
used in processing the section headings.)
@end enumerate
@end quotation
@noindent
Now @file{test.tex} is ready to be inserted in a code like the
following:

@example
\documentclass@{article@}
\usepackage@{fwebinsert@}

\begin@{document@}

\section@{Body@}

The body of the document.

\appendix

\FWEBinput@{test@}

\end@{document@}
@end example

Note that the @samp{@@*} commands in @file{test.web} are converted into
La@TeX{} sectioning commands such as @code{\section}.  The above example
works correctly because the first @samp{@@*} in @file{test.web} is
equivalent to a @code{\section} (level 0) command, which should indeed
immediately follow an @code{\appendix} command.  Suppose, however, that
you wanted to input @file{test.web} as part of the body of the above
example, and wanted the @samp{@@*}s to be treated as subsections (level
1) rather than sections.  To tell @code{fwebinsert} what level number to
assign to the @samp{@@*}s, provide that number as an optional argument
to @code{\FWEBinput}, as in the following example:

@example
\documentclass@{article@}
\usepackage@{fwebinsert@}

\begin@{document@}

\section@{Body@}

The body of the document.

\FWEBinput[1]@{test@}

\end@{document@}
@end example
@noindent
Alternatively, say @code{\FWEBlevel@{1@}} before the @code{\FWEBinput}.
(The optional argument construction merely calls @code{\FWEBlevel}.)

Here are some caveats about @code{fwebinsert}:

@itemize @bullet

@item
Implementing this package was tricky.  It may work in simple
circumstances, but it is not fully debugged.

@item
The @code{\FWEBinput} command surrounds the included @TeX{} code with
@code{\begingroup}...@code{\endgroup}, in an attempt to prevent various
macro conflicts.  As it stands, the command @code{\fwebinput} is
@code{\let} equal to @code{\FWEBinput}.  If necessary, one could redefine
@code{\fwebinput} to not include the enclosing
@code{\begingroup}...@code{\endgroup}.  

@item
For anything except level-0 inclusions, one should have just one
@code{\FWEBinput} command following each sectioning command.  (This is a
bug.)

@item
@findex fwebnum.sty
One is supposed to be able to use the package @code{fwebnum}
(@pxref{Numbering}) in 
conjunction with @code{fwebinsert}.  One can apply that to either the
included file (via a @code{LaTeX.package} entry in @file{fweb.sty}), the
including file (via a @code{\usepackage} command), or both.  Try out
these various combinations to see what emerges.

@end itemize

@node Pretty-printing, , Typesetting, Documentation
@comment  node-name,  next,  previous,  up

@section Pretty-printing

@cindex Pretty-printing
@dfn{Pretty-printing} refers to @FWEAVE{}'s attempt to typeset and
highlight the code in a readable way.  This is usually done
automatically for all of the compiler-like languages such as C.
However, it can be inhibited by turning on the N mode with
@samp{@@N} or by using the @sc{verbatim} language (selected with @samp{@@Lv}).

Pretty-printing is one of those topics that can arouse strong passions:
your idea of what's esthetic may not be mine.  Unfortunately,
@FWEB{}'s formatting rules are mostly hard-coded, so if, for example,
you don't like 
the way braces are arranged in typeset C code, you're mostly stuck.
Most directly, this possibly undesirable choice comes from design
decisions made by previous authors.  It also makes @FWEAVE{} very
fast, and enables certain complicated tricks that seem difficult or
impossible to accomplish with a completely customizable approach.  The
latter seems quite formidable, and has not been attempted---a good
thesis project for the 21st century.

@menu
* Alternatives::        Alternatives for various input tokens.
* Pseudo-operators::    Invisible parts of speech.
* Overloading::         Changing the appearance of various quantities.
@end menu

@node Pseudo-operators, Overloading, Alternatives, Pretty-printing
@comment  node-name,  next,  previous,  up

@subsection Pseudo-operators

@cindex Pseudo-operators
Pseudo-operators behave like a particular part of speech for the
purposes of @FWEAVE{}'s formatting, but are invisible on output; they
are ignored by @FTANGLE{}.  The pseudo-operators are

@example
@@e @r{--- pseudo-expression.  @xref{ATe}.}
@@; @r{--- pseudo-semicolon.  @xref{AT;}.}
@@: @r{--- pseudo-colon.  @xref{ATcolon}.}
@end example

@node Alternatives,  Pseudo-operators, Pretty-printing, Pretty-printing
@comment  node-name,  next,  previous,  up

@subsection Alternatives for various input tokens

@FWEAVE{} translates various input constructions into allegedly more
readable symbols---for example, in @sc{Fortran} it translates
@samp{.LT.} into @samp{<}.  
@ifinfo
The printed documentation contains a table of what one can type on
input, and what @FWEAVE{} will output.
@end ifinfo

@tex
Here is a table of
what one can type on input, and what @sc{Fweave} will typeset. The first entry
is standard @sc{Fortran}; the parenthesized material is an allowable input
alternative. (In most cases,
the pretty input alternatives follow C's~convention.)
$$
\def\i(#1,#2){{\tt #1} \def\temp{#2}\ifx\temp\empty\else({\tt #2})\fi}
\def\htop#1{\vtop{\halign{##\hfil&$\to \hbox{##}$\hfil\cr#1}}}
\let\WL\le
\let\WS\equiv
\let\WI\neq
\let\WG\ge
\let\WW\land
\let\WV\lor
\def\EQV{\mathrel{?{=}}}
\def\NEQV{\not\equiv}
\let\WR\lnot
\let\SlSl\parallel
\chardef\BS=`\\
\htop{
\i(.lt.,<) & $<$\cr
\i(.le.,<=) & $\WL$\cr
\i(.eq.,==) & $\WS$\cr
\i(.ne.,!=,<>) & $\WI$\cr
\i(.gt.,>) & $>$\cr
\i(.ge.,>=) & $\WG$\cr
\i(.and.,\amp\amp) & $\WW$\cr}
\qquad\qquad
\htop{
\i(.or.,||) & $\WV$\cr
\i(.neqv.,) & $\NEQV$\cr
\i(.xor.,) & $\NEQV$\cr
\i(.eqv.,) & $\EQV$\cr
\i(.not.,!) & $\WR$\cr
\noalign{\smallskip}
\i(**,\^) & {\tt (a+b)\^(c+d)} $\to (a+b)^{c+d}$\cr
\i(//,\BS/) & $\SlSl$\cr
}$$
These same conventions are allowed in @sc{Ratfor} mode.  Note that in @sc{Fortran}
and @sc{Ratfor} @samp{//} is interpreted  by default as the concatenation
symbol, not the start of a short comment. 
To override that default, use one of the command-line options @samp{-n/},
@samp{-r/}, or @samp{-/}, 
or use a language-changing command of the form @samp{@@n/}.
@end tex


@node Overloading, , Pseudo-operators, Pretty-printing
@comment  node-name,  next,  previous,  up

@subsection Overloading operators and identifiers

@cindex Overloading
For special effects in the woven output, there are commands to help
one change the appearance of operators and identifiers.

@subsubsection Overloading operators

@cindex Overloading operators
@cindex Operators, overloading
A feature common to both C++ and @sc{Fortran}--90 is @dfn{operator overloading},
the ability to extend or redefine the definition of an operator such as
@samp{.FALSE.}
or @samp{=}.  @sc{Fortran--90} even allows one to define new @dfn{dot
operators}---for example, one might define the operator @samp{.IN.} to test
for inclusion in a set.  In a nontrivial extension of the original design,
@FWEAVE{} allows one to define how overloaded
operators should appear on output.
@tex
\def\&#1{{\bf #1}}%
\gdef\.#1{{\tt #1}}%
\def\\#1{\leavevmode\hbox{\it#1\/\kern.05em}}%
For example, in the opinion of the author it is much more readable
to read `$\&{if}\.(x \in \\{set}\.)$' than `\&{if}\.(x\ \.{.IN.}\
\\{set}\.).'
@end tex
Indeed, this feature can be used even when the compiler language itself
does not permit overloading in order to customize the appearance of the
woven output.

The @samp{@@v} control code is used to change the appearance of an operator.
The format is

@example
@@v new_operator_symbol_or_name "TeX material" old_operator
@end example

@noindent 
This means ``Display the new operator according to the @i{@TeX{}
material}, but treat it like the old operator---e.g., unary or binary---for
formatting purposes.  The 
quoted @TeX{} material is treated just like a C string, so if
one wants to include a backslash one must escape it with another backslash.
For example, one can make an equals sign display on output as
a large left arrow by saying

@example
@@v = "\\Leftarrow" =
@end example

@noindent
Two @sc{Fortran} examples are

@example
@@v .FALSE. "\\.@{.FALSE.@}" .FALSE.
@@v .IN. "\\in" +
@end example

This feature can go a long way toward enhancing readability of the woven
output, particularly when operators are actually being overloaded.  It can
also lead to arbitrarily bizarre output that no-one else will understand.
As usual, restraint is advised.

@subsubsection Overloading identifiers

@cindex Overloading identifiers
@cindex Identifiers, overloading
Although operator overloading is quite useful, it does not allow one to
change the appearance of identifiers.  In its most general form, such a
facility becomes quite complicated; one must endow @FWEAVE{} with a
macro-processing facility analogous to that of @FTANGLE{}.  This has
not been 
done yet (maybe it will be someday).  In the meantime, one has the
command @samp{@@W},
which provides a restricted form of such a facility.  @emph{This
command is experimental, and not firmly established.  Changes in usage
and/or syntax may be made in future versions.}

The most general form of the @samp{@@W} command is

@example
@@W identifier "replacement text"
@end example

@noindent 
This means:  Replace any references to @i{identifier} in the
woven output with the @i{replacement text}.  

A more restrictive form is

@example
@@W identifier \newmacro
@end example

@noindent 
which replaces references to @i{identifier} with a call to
@code{\newmacro}.  (Note that there are no quotes in this form.)

The shortest form is

@example
@@W identifier .
@end example

@noindent 
which replaces references to @i{identifier} with a call to
@code{\identifier}.  For example, the identifier @i{x} normally appears in
woven output as @samp{\.@{\Wshort\@{x\@}@}}.  If one says

@example
@@W x .
@end example

@noindent 
one will instead get the macro reference @samp{\x}, which could
be defined to give a variety of special effects.  (However, one may need
some rather intimate understanding of @FWEAVE{}'s output in order to
ensure that things always work correctly.)

One of the important uses of this facility is to expedite special
formatting of array references.  This subject is discussed separately below
in the section on ``Special array formatting'' (sorry, that isn't here
yet), where an example is given.


@node Index, Customization, Documentation, Top
@comment  node-name,  next,  previous,  up

@chapter @FWEB{}'s INDEX.

@FWEB{} has several powerful indexing facilities:

@quotation
@enumerate
@item
It sorts and writes its own self-contained (@dfn{internal}) index, including
cross-references to all the variables as well as items inserted by the
user.

@item
It can write its cross-reference information to a file formatted for use
by the @code{makeindex} utility.  This feature facilitates creation of a
master index that contains information about several @code{web} files.

@end enumerate
@end quotation

@menu
* Internal index::      The self-contained index produced by @FWEB{}.
* Using makeindex::     Writing index data for use by @code{makeindex}.
* Merging indexes::     Using the @code{idxmerge} utility to merge indexes.
@end menu

@node Internal index, Using makeindex, Index, Index
@comment  node-name,  next,  previous,  up

@section @FWEB{}'s self-generated index

One of the most useful features of
@FWEB{} is that it automatically generates an Index of all variable
usage.   One 
can also insert one's own index 
entries by using the commands

@itemize @bullet

@item
@samp{@@^} (entry in Roman type; see
@ref{AT^}),

@item
@samp{@@.} (entry in typewriter type; see @ref{ATdot}), and

@item
@samp{@@9} (user-defined format; see @ref{AT9}).


@end itemize

(More discussion to be completed.)

@node Using makeindex, Merging indexes, Internal index, Index
@comment  node-name,  next,  previous,  up

@section Creating a stand-alone index with @code{makeindex}

@cindex Index, stand-alone
@cindex Makeindex, using
In addition to the internal index described in the previous section
(@pxref{Internal index}), @FWEAVE{} can write the index data to a file
formatted for later, stand-alone processing by the @code{makeindex}
utility.  (Several such indexes can be merged together; see @ref{Merging
indexes}.)  The procedure is simple, although the following discussion goes
into some rather arcane details.

@subsection Creating a stand-alone index:  Summary

As a quick reference for those who have already read the details in the
next subsection, the procedure to print a stand-alone index with
@code{makeindex} is as follows.  First, create, if necessary, a file
@file{index.tex} that @code{\input}s @file{index.ind}.  (A skeleton
is illustrated in the next subsection.)  Then:

@example
fweave -XI test.web @r{% Creates test.idx and test.sty.}
makeindex -s test.sty -o index.ind test.idx @r{% Creates index.ind.}
latex index
@end example
@noindent
If you're not happy with the @code{\pg} macro supplied in
@file{fwebmac.sty}, define it yourself in @file{index.tex}.  

In this procedure, note the use of the @samp{-XI} option and the use of
a different root name (@file{index} here) for the output file.

@subsection Creating a stand-alone index:  Details

@findex -XI
To create an index file in a form suitable for later stand-alone
processing by @code{makeindex}, use the @samp{-XI} option to
@FWEAVE{}.  If the @code{web} file is @file{test.web}, the default
name of the @code{makeindex} output file is @file{test.idx}.  (This name
can be overridden by the style-file parameter @code{makeindex.out}.)  Run
@code{makeindex} on @file{test.idx} to create the La@TeX{} file
@file{index.ind} (see following discussion for details).  A stand-alone
index can then be produced by saying @samp{latex index}, where a skeleton
version of @file{index.tex} would be

@example
% index.tex --- skeleton for printing a stand-alone index.
\documentclass@{article@}
\usepackage@{fwebmac@}

\begin@{document@}

\input@{\jobname.ind@}

\end@{document@}
@end example
@noindent
(In practice, a more involved procedure will probably be followed; see below.)

@cindex Style file, for makeindex
Usually @code{makeindex} works in conjunction with a style file.  [In
fact, the syntax of @FWEB{}'s style file (@pxref{Style}) was motivated
by that of @code{makeindex}.]  When the @samp{-XI} option (@pxref{-X_}) is used,
@FWEAVE{} will @emph{create} an appropriate style file for
@code{makeindex}.  (The default name of @file{test.sty} can be overridden
by the style-file parameter @code{makeindex.sty}.)  To run
@code{makeindex} on the index data for @file{test.web} and create the
output file @file{index.ind}, one would thus say

@example
makeindex -s test.sty -o index.ind test[.idx]
@end example
@noindent
It's important to use the @samp{-o} option with a name different than
the original file name, because it simplifies the construction of the
skeleton file @file{index.tex} that prints the stand-alone index.

@FWEAVE{} writes @file{test.sty} because the contents of that file may
depend on parameter settings in @FWEB{}'s style file @file{fweb.sty}.
@FWEB{}'s style vocabulary includes all parameters understood by
@code{makeindex}.  If a @code{makeindex} parameter is called
@samp{param}, one references it in @file{fweb.sty} by
@samp{makeindex.param}.  Thus, to change the @samp{headings_flag} of
@code{makeindex}, one would put into @file{fweb.sty} a line like
@samp{makeindex.headings_flag = 1}.  To see a list of all
@code{makeindex}-related parameters, say @samp{fweave -Zmakeindex}
(@pxref{-Z_}).  Remember, @emph{do all @code{makeindex} customizations
in @file{fweb.sty}; the actual style file @file{test.sty} that will be
read by @code{makeindex} is written automatically by @FWEAVE{}.}

The @file{.idx} file will contain a list of entries that begin with
@samp{\indexentry} (more precisely, the value of the parameter
@samp{makeindex.keyword}).  The general form is 

@example
\indexentry@{sort key:identifier expression|macro@}@{page number@}
@end example
@noindent
Typical entries are

@example
\indexentry@{istream:"\>@{istream@}|pg@{@}@{@}@}@{1@}
\indexentry@{main:"\>@{main@}|pg@{@}\underline@}@{1@}
\indexentry@{pow:"\@@@{pow@}|pg@{@}@{@}@}@{2@}
\indexentry@{z:"\"|z|pg@{@}\underline@}@{2@}
@end example
@noindent
Here the colon is the value of @samp{makeindex.actual}; it separates the
sort key (before the colon) from the actual expression to be printed.
The macros such as @samp{\>} typeset the identifiers in the appropriate
way, depending on their use in the code.  Note that the backslashes are
quoted with the value of @samp{makeindex.quote}, which is by default the
double quote.

Although one might guess that the typesetting macros such as @samp{\>}
would be defined in @file{fwebmac.sty}, that is not true.  Rather, for
various technical reasons they
are equated to macros in @file{fwebmac.sty} as one of the operations of
the @samp{\Wbegin} macro that is executed at the beginning of every
@code{tex} file output by @FWEAVE{}.  For example, @samp{\Wbegin} does
the equivalent of @samp{\let\>\Wid}.  Unfortunately, without further
action that equating would be forgotten by a La@TeX{} run made on the
output @file{index.ind} of @code{makeindex}.  For that reason, @FWEAVE{}
appends the appropriate @samp{\Wequate} macro to the end of
@samp{makeindex.preamble}.  This is one specific instance that
necessitates that @FWEAVE{} write the @code{makeindex} style file.

Each of the @samp{\indexentry}s contains the encapsulation character
@samp{|} (the value of @samp{makeindex.encap}).  By the conventions of
@code{makeindex}, everything between the encapsulation character and the
closing right brace defines a macro expression that acts on the page
number.  E.g., the general form above generates the command
@samp{\macro@{@i{page number}@}}.  The specific macro construction
output by @FWEAVE{} is

@example
\pg@{@}@{@i{possible action macro}@}@{@i{page number}@}
@end example
@noindent
Here the name @samp{pg} is the value of @samp{makeindex.page}.  The
@dfn{action macro} is something like @samp{\underline}, which would be
used by @FWEAVE{} to underline the page number to indicate where a
variable is defined.  A default definition of @samp{\pg} is given is
@file{fwebmac.sty}.  It is a three-argument macro,
@samp{\def\pg#1#2#3@{...@}}, where the arguments are as follows:
@findex \pg

@example
#1 @r{--- Integer file identification number}
#2 @r{--- Action macro.}
#3 @r{--- Page number.}
@end example
@noindent
The definition should contain the construction @samp{#2@{#3@}}---i.e.,
the page number must be the argument of the action macro.  The first
argument is left empty in the @file{.idx} file written by @FWEAVE{}.
This can be filled in later by the utility @code{idxmerge}
(@pxref{Merging indexes}) that merges the indices
from several @code{web} files.  For example, in a master index one might
ultimately print page numbers like @samp{II.5}, where @samp{II} refers to
a file such as @file{test2.web}.  To aid this merging process, the root
name of the @code{web} file is written as a comment at the top of the
@file{.idx} file output by @FWEAVE{}.

@node Merging indexes, , Using makeindex, Index
@comment  node-name,  next,  previous,  up

@section Using the @code{idxmerge} utility to merge indexes

@cindex Indexes, merging
@findex idxmerge.sty
In a large project, one may maintain and work with several @FWEB{}
files.  It may be useful to produce a global index that spans all of
those files.  To this end, the utility @code{idxmerge} and associated
La@TeX{} package @code{idxmerge} are supplied with
the @FWEB{} distribution.  

@subsection Using @code{idxmerge}:  Summary

As quick reference for those who have already plowed through the
following details, here is a summary of the procedure.  To print a
stand-alone index by merging the indexes from several @code{web}
sources, do the following.  First, create, if necessary, a file
@file{index.tex} that @code{\input}s @file{index.ind}.  Then:

@example
fweave -XI test1.web
fweave -XI test2.web
fweave -XI test3.web

idxmerge -oindex test1.idx test2.idx test3.idx 
        % Creates index.ind and index-names.tex.
makeindex -s test1.sty index
latex index
@end example

Note the use of the @samp{-XI} option.  For further background, see the
previous section, @ref{Using makeindex}.

@subsection Using @code{idxmerge}:  Details

Suppose one has three files, @file{test1.web}, @file{test2.web}, and
@file{test3.web}.  To use @code{idxmerge}, weave each of the files
separately, using the @samp{-XI} option to create @file{test*.idx} and
@file{test*.sty}.  Then say

@example
idxmerge -oindex test1.idx test2.idx test3.idx
@end example
@noindent
This creates two output files:  @file{index.idx}, and
@file{index-names.tex}.  @code{idxmerge} first sorts the list of file
names.  It then writes one entry into @file{index-names.tex} for each
file, of the form

@example
\idxname@{@var{n}@}@{file_name@var{n}@}
@end example
@noindent
This file can be @code{\input} by the @code{\topofindex} command (for an
example, see the La@TeX{}2e package @code{idxmerge}) (supplied with
the @FWEB{} distribution) and used to create a list of the merged files.
@findex \topofindex
@findex \idxname

Then it merges the @code{\indexentry} commands from each of the input
files into @file{index.idx}, filling in the integer file identifier @var{n}
(the position of the file in the sorted list) into the first argument of
the @code{\pg} macro.  One can now say

@example
makeindex -s test1.sty index
@end example
@noindent
This creates @file{index.ind}, which can be processed by, for example,
a simple modification of the simple La@TeX{} template given above in
@ref{Using makeindex}.  The only difference is that the package
@code{idxmerge} was used; in that file, the macros @code{\topofindex}
and @code{\idxname} are appropriately defined to print out a numbered
list of the merged files to cross-reference into the numerical file- and
page-number entries in the body of the index.  Here is an example
(provided in the @FWEB{} distribution):

@example
% index.tex --- skeleton for printing a stand-alone index.
\documentclass@{article@}
\usepackage@{fwebmac,idxmerge@}

\begin@{document@}

\input@{\jobname.ind@}

\end@{document@}
@end example
@noindent

@node Customization, Hints, Index, Top
@comment  node-name,  next,  previous,  up

@chapter CUSTOMIZATION

@cindex Customization
@cindex Customizing @FWEB{}
@cindex @FWEB{}, customizing
The default behavior of @FWEB{} can be changed in a variety of ways.  

@quotation
@enumerate
@item 
@sc{unix} environment variables (logical variables in VMS) affect path or
file names. 

@item 
An initialization file resides in the home directory.

@item 
A style file resides in the current directory.
@end enumerate
@end quotation

The initialization file (usually called @file{.fweb}) is intended to contain
command-line options (one per line) that are to be used in every run.
@xref{Initialization}. 

The style file (called @file{fweb.sty} by default; see @ref{-z}) is
intended to provide more local customization, perhaps 
differing for each source file and group of source files.  The style
file does not contain command-line 
options; rather, it contains parameter settings that override
@FWEB{}'s defaults.  The @samp{-p} option (@pxref{-p})
may be used to specify a style-file entry in @file{.fweb} (i.e., a
global value for all source files) or on the
command line (i.e., a value used for a single run).

The order of processing is:

@quotation
@enumerate
@item 
Evaluate environment variables.  @xref{Environment variables}.

@item 
Read @file{.fweb} and remember its contents; sort those into three
groups:  options beginning with @samp{-}, beginning with @samp{&}, and
beginning with a letter (file names) .  @xref{Initialization}.

@item 
Process @file{.fweb} options beginning with @samp{-} (or @samp{+}, for
backward compatibility), except for @samp{-p}.

@item 
Read and process command-line options, except for @samp{-p}.  @xref{Options}.

@item 
Process remaining @file{.fweb} options (either file names, or options
beginning with @samp{&}).

@item 
Process any @samp{-p} options from @file{.fweb}.  @xref{-p}.

@item 
Process the style file.  @xref{Style}.

@item
Process any @samp{-p} options from the command line.

@end enumerate
@end quotation

Unfortunately, because not all options are processed immediately when
they are read, errors may not show up when one expects.  For example,
nothing is actually processed while @file{.fweb} is being read; its
contents are just being stored.  It
could therefore happen that a syntax error in entering a @samp{-p}
option in @file{.fweb} may not be reported until after the style file
has been read, possibly confusing the user as to the source of the
error.

@menu
* Environment variables::       Environment or logical variables.
* Initialization::              Initialization file.
* Memory allocation::           Dynamic memory allocation.
* Style::                       Style file.
@end menu

@node Environment variables,Initialization,Customization,Customization
@comment  node-name,  next,  previous,  up

@section Environment variables

@cindex Environment variables
@cindex Variables, environment

@code{FWEB_HDR_INCLUDES} --- Colon-delimited list of directories for the
C preprocessor (in the form of @code{gcc}) to
search for @samp{#include} header files.  This is used in conjunction
with the @samp{-H} option; see @ref{-H_}.  (One can append to this list
by means of the @samp{-I} option, provided that option comes
@emph{after} the @samp{-H}; see @ref{-I_}.)
@findex FWEB_HDR_INCLUDES

@code{FWEB_INCLUDES} --- Colon-delimited list of directories to search for
@samp{@@i} include files.  (One can append to this list by means of the
@samp{-I} option, provided that option comes @emph{before} any use of
@samp{-H}; see @ref{-I_}.)  
@findex FWEB_INCLUDES

@code{FWEB_INI} --- Name of the initialization file. If not defined, either
@file{.fweb} or @file{fweb.ini} is chosen, depending on the machine.  The
initialization file always resides in @code{$HOME}.
@findex FWEB_INI


@code{FWEB_STYLE_DIR} --- Directory in which the style file resides.  If not
defined, the current directory is used.
@findex FWEB_STYLE_DIR

@node Initialization,Memory allocation,Environment variables,Customization
@comment  node-name,  next,  previous,  up

@section Initialization

Although some aspects of @FWEB{}'s behavior are hard-coded, many can
be changed and/or initialized by the user.

@subsection The initialization file

@cindex Initialization file
@cindex File, initialization
@cindex @FWEB{}, initializing
@findex .fweb
On startup, @FWEB{} attempts to read an initialization file.  This always
resides in the user's home directory.  It is usually called @file{.fweb}
(@file{fweb.ini} on personal computers).  The default file name can be
overridden by the environment variable @code{FWEB_INI}.

One may put into @file{.fweb} any option that might be used as a
command-line option.  (Presently, there must be just one entry per
line.)  If the option begins with a @samp{-} (or a @samp{+} for backward
compatibility), it is processed @emph{before} the actual command-line
options; if it begins with @samp{&} or is a file name, it is processed
after.  Generally, @file{.fweb} options should begin with @samp{-} so
that one may override them from the command line.  The @samp{%} sign
begins a comment terminated by the end-of-line.
  
@node Memory allocation,Style,Initialization,Customization
@comment  node-name,  next,  previous,  up

@subsection Memory allocation

@cindex Memory allocation
@cindex Allocation, memory
The command-line option @samp{-y} (@pxref{-y}) is used to change the
default allocation for a dynamic array.  The arrays have a one- or
two-character abbreviation denoted by @i{aa}.  Some error messages will
use this abbreviation when suggesting that one increase a default
allocation.  To query the present allocations of variable @i{aa}, just say
@samp{-y@i{aa}}.  To query everything, say @samp{-y}.

This whole scheme is somewhat annoying.  In most cases, dynamic arrays
should be reallocated automatically.  That can be done without too much
difficulty, but I was reluctant to try it for Version 1.61 in fear of
breaking something.  Please wait for the year 2000.

If one uses @samp{-y} to examine the maximum permitted values of these
parameters, one will note the magic number 10239 appearing
occasionally.  This number is a bit less than 64K/5; it is a signature
of an inherently 32-bit design that goes back to Knuth.  Unfortunately,
this number can't be increased without some radical redesign.  Wait for
the year 2100.

@menu
* -yb::         Maximum bytes for identifiers, index entries, and module names.
* -ybs::        Size of the change buffer.
* -ycb::        Size of line buffer for C output.
* -ycf::        A Ratfor buffer.
* -ycg::        Another Ratfor buffer.
* -yd::         Increment for expanding the dots table.
* -ydt::        Maximum number of deferred macro tokens.
* -ydx::        Maximum number of deferred macro texts.
* -yid::        Maximum depth of file inclusion.
* -yif::        Maximum number of unique include-file names.
* -ykt::        Stack size for @FTANGLE{}.
* -ykw::        Stack size for @FWEAVE{}.
* -yll::        Line length for @FWEAVE{}'s output.
* -yln::        Maximum length of module names or strings.
* -ylb::        Maximum number of nested loops in Ratfor.
* -ylx::        Maximum length of expressions that can be expanded with
                        the post-increment operators of Fortran or Ratfor.
* -ym::         Maximum number of sections.
* -yma::        Maximum number of arguments to @FWEB{} macros.
* -ymb::        Size of the buffer for expanding @FWEB{} macros.
* -yn::         Maximum number of identifiers and module names.
* -ynf::        Maximum number of open output files.
* -yop::        Maximum number of entries in the table for operator
                        overloading. 
* -yr::         Maximum number of cross-references.
* -ys::         Maximum number of scraps.
* -ysb::        Size of style-file input-line buffer.
* -ytt::        Maximum number of tokens that @FTANGLE{} can process.
* -ytw::        Maximum number of tokens in the current section being
                        processed by @FWEAVE{}.
* -yx::         Maximum number of texts.
* -yxb::        Size of line buffer for @TeX{} output.
@end menu

@node -yb, -ybs, Memory allocation, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-yb}:  Maximum bytes for identifiers, index entries, and module names

@findex -yb

Unique identifiers, index entries, and module names are stored
contiguously in a large memory area, the size of which is controlled by
@samp{-yb}.  The default may need to be increased for very large source
files, or decreased to squeeze things into a personal computer.  See
also @ref{-yn}.

@node -ybs, -ycb, -yb, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-ybs}:  Size of the change buffer, in bytes

@findex -ybs

Information from change files is read into the change buffer, whose size
is controlled by @samp{-ybs}.  It should not be necessary to change this
unless an error message specifically tells one to do so.

@node -ycb, -ycf, -ybs, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-ycb}:  Size of line buffer for C output, in bytes

@findex -ycb

@FTANGLE{} outputs lines of a fixed maximum length.  It attempts to
split them in a reasonable way, dependent on the language.  When it
absolutely can't figure out how to split the line, it will issue a
warning message and split it anyway.  The @samp{-ycb} option controls
the maximum output line length for C and C++.  

The analogous command @samp{-yxb} controls the output line length for
@TeX{} and the verbatim mode.  @xref{-yxb}.

@node -ycf, -ycg, -ycb, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-ycf}:  Size of a Ratfor buffer, in bytes

@findex -ycf

The sizes of buffers used by @sc{Ratfor} for constructing messages about
the commands it is expanding are controlled by @samp{-ycf} and @samp{-ycg}.

@node -ycg, -yd, -ycf, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-ycg}:  Size of another Ratfor buffer, in bytes

@findex -ycg

The sizes of buffers used by @sc{Ratfor} for constructing messages about
the commands it is expanding are controlled by @samp{-ycf} and @samp{-ycg}.

@node -yd, -ydt, -ycg, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-yd}:  Increment for expanding the dots table

@findex -yd

The ``dots'' table is used for @sc{Fortran} to hold information relating
to ``dot'' operators such as @samp{.NE.}.  In @sc{Fortran--90},
additional such operators can be added by the program, so the table can
grow dynamically.  The @samp{-yd} option controls how many additional
entries are made available each time the table size needs to be
reallocated.

@node -ydt, -ydx, -yd, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-ydt}:  Maximum number of deferred macro tokens

@findex -ydt

Deferred @FWEB{} macros are ones defined in the code part rather in
the definition part.  (Their use is normally prohibited; see @ref{-TD}.)
@samp{-ydt} controls how many bytes are set aside for the storage of
these replacement text of those macros.  See also @ref{-ydx}.

@node -ydx, -yid, -ydt, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-ydx}:  Maximum number of deferred macro texts

@findex -ydx

@samp{-ydx} controls how many deferred macros are permitted.  See also
@ref{-ydt}. 

@node -yid, -yif, -ydx, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-yid}:  Maximum depth of file inclusion

@findex -yid

Files included by @samp{@@i} can themselves contain @samp{@@i} commands,
to a nesting level controlled by @samp{-yid}.

@node -yif, -ykt, -yid, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-yif}:  Maximum number of unique include-file names

@findex -yif

The number of unique file names appearing in @samp{@@i} commands is
controlled by @samp{-yif}.

@node -ykt, -ykw, -yif, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-ykt}:  Stack size for @FTANGLE{}

@findex -ykt

@FTANGLE{} uses a stack to deal with the web of module names---i.e., a
named section can refer to another module name.  The size of this stack
is controlled by @samp{-ykt}.

@node -ykw, -yll, -ykt, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-ykw}:  Stack size for @FWEAVE{}

@findex -ykw

@FWEAVE{}'s stack handles the possibilities that code mode can be
embedded in a module name, or vice versa.  The maximum nesting level for
such mode changes is controlled by @samp{-ykw}.

@node -yll, -yln, -ykw, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-yll}:  Line length for @FWEAVE{}'s output, in bytes

@findex -yll

@samp{-yll} controls the length of each line in the @code{.tex} file
output by @FWEAVE{}.

@node -yln, -ylb, -yll, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-yln}:  Maximum length of module names or strings, in bytes

@findex -yln

When each module name or string is parsed, it is stored temporarily in a
buffer whose length is controlled by @samp{-yln}.

@node -ylb, -ylx, -yln, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-ylb}:  Maximum number of nested loops in @sc{Ratfor}

@findex -ylb

In @sc{Ratfor}, various loops such as @samp{while} are translated into
their @sc{Fortran} equivalents.  @samp{-ylb} controls the maximum
nesting level of such expandable constructions.

@node -ylx, -ym, -ylb, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-ylx}:  Maximum length of expressions that can be expanded with the post-increment operators of @sc{Fortran} or @sc{Ratfor}

@findex -ylx

@sc{Fortran} and @sc{Ratfor} can expand expressions such as @samp{x(i) +=
dx} into their @sc{Fortran} counterparts such as @samp{x(i) = x(i) + dx}.  
It does so in a very straightforward way, by copying the expression to
the left of the equals sign.  @samp{-ylx} controls the maximum size of
that expression.

@node -ym, -yma, -ylx, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-ym}:  Maximum number of sections

@findex -ym

@samp{-ym} limits the maximum number of sections, both named and
unnamed.  (Each unnamed section is counted separately.)  The absolute
maximum number of sections is 10239, probably one of the most stringent
restrictions in @FWEB{}'s design.  (This number is a bit less than 1/5
of 64K.)

@node -yma, -ymb, -ym, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-yma}:  Maximum number of arguments to @FWEB{} macros

@findex -yma

The maximum number of arguments to @FWEB{} macros (defined by
@samp{@@m}) is limited by @samp{-yma}.

@node -ymb, -yn, -yma, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-ymb}:  Size of the buffer for expanding @FWEB{} macros

@findex -ymb

The expansion of each @FWEB{} macro is done in a buffer whose size is
controlled by @samp{-ymb}.  (In some situations, particularly in
@sc{Ratfor}, more than one such buffer can be open at once.)

@node -yn, -ynf, -ymb, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-yn}:  Maximum number of identifiers and module names

@findex -yn

A structure is associated with each unique identifier and module name.
The maximum number of such structures is controlled by @samp{-yn}.  See
also @ref{-yb}.

@node -ynf, -yop, -yn, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-ynf}:  Maximum number of open output files

@findex -ynf

In addition to @FTANGLE{}'s usual output file---e.g.,
@code{test.c}---additional files may be opened by means of the
@samp{@@O} (@pxref{ATO_}) or @samp{@@o} (@pxref{ATo}) commands.
Depending on the situation, some of these files may remain open
simultaneously.  The maximum number of such files is controlled by @samp{-ynf}.

@node -yop, -yr, -ynf, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-yop}:  Maximum number of entries in the table for operator overloading. 

@findex -yop

In @FWEAVE{}, the appearance of an operator can be changed
(@dfn{overloaded}) by means of the @samp{@@v} command (@pxref{ATv}).  Each
such operator is entered into a table, the maximum size of which is
controlled by @samp{-yop}.  

@node -yr, -ys, -yop, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-yr}:  Maximum number of cross-references

@findex -yr

The Index cross-reference information (in which sections each identifier
is used or defined) is maintained in a large array of structures, one
structure for each cross-reference.  The maximum number of
cross-references is controlled by @samp{-yr}.

@node -ys, -ysb, -yr, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-ys}:  Maximum number of scraps

@findex -ys

The maximum number of scraps is controlled by @samp{-ys}.  For a
discussion of scraps, see @ref{-1}.

@node -ysb, -ytt, -ys, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-ysb}:  Size of style-file input-line buffer

@findex -ysb

The maximum length of each input line of the style file (@code{fweb.sty}
by default) is controlled by @samp{-ysb}.

@node -ytt, -ytw, -ysb, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-ytt}:  Maximum number of tokens that @FTANGLE{} can process

@findex -ytt

A @dfn{token} is an identifier, numerical constant, operator, etc.
@FTANGLE{} must read in and store all tokens in the entire source
file, because they can be output in a different order than they are
input.  The maximum number of tokens is controlled by @samp{-ytt}.

@node -ytw, -yx, -ytt, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-ytw}:  Maximum tokens in the current section being processed by @FWEAVE{}.

@findex -ytw

Unlike @FTANGLE{}, @FWEAVE{} need only read in one section at a
time.  The maximum number of tokens in any section is controlled by
@samp{-ytw}.

@node -yx, -yxb, -ytw, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-yx}:  Maximum number of texts

@findex -yx

For @FTANGLE{}, a @dfn{text} is either the replacement text of a macro, or
the contents of a named section.  The maximum number of such texts is
controlled by @samp{-yx}.

For @FWEAVE{}, a @dfn{text} is a phrase that arises from combining primitive
scraps during the translation stage of phase 2.  

For both processors, the absolute maximum number of texts is 10239.

@node -yxb, , -yx, Memory allocation
@comment  node-name,  next,  previous,  up

@subsubsection @samp{-yxb}:  Size of line buffer for @TeX{} and verbatim output

@findex -yxb

This option is like @samp{-ycb} (@pxref{-ycb}), but controls the size of
the output line for the @TeX{} (@samp{@@Lx}) and verbatim (@samp{@@Lv})
languages. 

@node Style,,Memory allocation,Customization
@comment  node-name,  next,  previous,  up

@section The Style file

@cindex Style file
@cindex File, style
@findex fweb.sty
A @dfn{style file} (default name @file{fweb.sty}) may reside in the
user's current directory (or the directory specified by the environment
variable @code{FWEB_STYLE_DIR}).  The default name can be changed by the
command-line option @samp{-z} (@pxref{-z}).

The style file is processed after all command-line options have been
processed, except that the command-line option @samp{-p} (@pxref{-p})
gets special treatment.  Note that that option buffers up style-file
entries (i.e., one may use more than one @samp{-p} option).  @samp{-p}
options placed in @file{.fweb} are treated as residing in a temporary
file that is read just @emph{before} the local style file; thus, those behave
as `global' style-file entries that will be overridden by a matching
entry in the local style file.  @samp{-p} options on the command line
will be processed @emph{after} the local style file, thus override
corresponding options in either @file{.fweb} or the local style file.
 
To summarize the previous discussion, the local style file is intended
to contain settings that are common to a particular source file.
Settings common to all source files can be put into @file{.fweb} by
means of the @samp{-p} option.  To override a setting for a single run,
use a @samp{-p} option on the command line.

Style-file entries have the form

@example
        @var{keyword} @i{[}=@i{]} @var{value}
@end example
@noindent
The equals sign is always optional.  The @samp{value} is usually a
double-quoted string, but may sometimes be an integer or a single-quoted
character.  For example,

@example
        LaTeX.class.options = "twoside"
        LaTeX.package "indentfirst,multicol"
        mark_defined.fcn_name 0
        line_char.N 'C'
        color.error = "red"
        Color.red = "\e[01;31m"
@end example
@noindent
The syntax is completely free-form.  Periods within keywords are
precisely equivalent to underscores, but are useful heuristically for
associating a structure-like hierarchy to some of the commands.
Non-printable characters in strings can be specified as octal constants
(e.g., @samp{\033}), hexadecimal constants (e.g., @samp{\x1B}), or one
of the ANSI escape sequences @samp{\a}, @samp{\b}, @samp{\f}, @samp{\n},
@samp{\r}, @samp{\t}, and @samp{\v}.  The non-ANSI escape sequence
@samp{\e} (escape) is also supported; that is particularly useful for
color processing (@pxref{Color}).

Various of the style-file parameters take a language subscript.  Those
are 

@quotation
@table @code
@item C
C
@item Cpp
C++
@item N
@sc{Fortran}-77
@item N90
@sc{Fortran}-90
@item R
@sc{RatFor}-77
@item R90
@sc{RatFor}-90
@item V
Verbatim
@item X
@TeX{}

@end table
@end quotation
@noindent
Thus, @code{line_char.N} is the comment character for @FTANGLE{}'s
@code{line} commands (@pxref{line_char}), for @sc{Fortran}-77 code.

Unfortunately, the descriptions of the parameters aren't all completed
yet.  To query the default values, say @samp{ftangle -Z} (see @ref{-Z_}).

@menu
* Index params::                Customizing the Index.
* Module params::               Customizing the list of sections.         
* Contents params::             Customizing the Table of Contents.
* Subscript params::            Customizing subscripting for cross-references.
* Fwebmac params::              Customizing behavior of @FWEB{}'s macros.
* Completion params::           Automatic selection of file extensions, etc.
* Control-code mappings::       Remapping @FWEB{}'s control codes (danger)!
* Color::                       @FWEB{}'s color output.
* Miscellaneous params::        Other customizations.
@end menu

@node Index params,Module params,Style,Style
@comment  node-name,  next,  previous,  up

@subsection  Customizing @FWEAVE{}'s index

In the following, @samp{???} denotes the name of various subparameters.

@menu
* delim_0: S_delim.             Insert after identifier in index entry.
* delim_n: S_delim.             Insert between section numbers in index entry.

* encap.infix: S_encap.         Start the section number.
* encap.prefix: S_encap.        @TeX{} macro to begin a section number.
* encap.suffix: S_encap.        Ends the section number.

* group_skip::

* index.collate: S_index.       Collating sequence for the Index.
* index.postamble: S_index.     @TeX{} material to end the Index.
* index.preamble: S_index.      @TeX{} material to begin the Index.
* index.tex: S_index.           Name of file holding the Index.

* item_0::                      @TeX{} command to begin an index entry.

* language.prefix: S_language.  Begin a language entry in the Index.
* language.suffix: S_language.  End a language entry in the Index.

* lethead.prefix: S_lethead.    Begin a letter group.
* lethead.suffix: S_lethead.    End a letter group.
* lethead.flag: S_lethead.      Control beginning of letter group.

* name: S_index.                Name of index.

* underline.prefix: S_underline. Begin an underlined index entry.
* underline.suffix: S_underline. End an underlined index entry.
@end menu

@node S_index, S_delim, Index params, Index params
@comment  node-name,  next,  previous,  up

@subsubsection @code{index.@i{???}}

@findex \INDEX
@cindex Index, name of
@vindex index.name
@code{index.name} is the name of the index section.  This string is used
in @code{\Wbegin} to initialize the @TeX{} macro @code{\INDEX}.  The
index section is recognized by matching, for a starred section, the
actual section name against the contents of @code{\INDEX}.  When they
match, a new page and two-column mode are begun.  These rules imply that
the last section of one's source file can be titled @samp{\INDEX}, as in

@example
@@* \INDEX.
@end example

@vindex index.tex
@code{index.tex} is the name of the file into which the Index is
written.  The character @samp{#} is translated into the root name of the web
file, as for example @samp{#.ndx}.

@vindex index.preamble
@code{index.preamble} are @TeX{} commands that begin the Index.

@vindex index.postamble
@code{index.postamble} are @TeX{} commands that end the Index.

@vindex index.collate
@code{index.collate} specifies the collating sequence for the Index.

@node S_delim, S_encap, S_index, Index params
@comment  node-name,  next,  previous,  up

@subsubsection @code{delim_@i{?}}

@vindex delim_0
@code{delim_0} is the string to insert after the identifier in an index
entry.

@vindex delim_n
@code{delim_n} is the string to insert between two section numbers in an
index entry.

@node S_encap, group_skip, S_delim, Index params
@comment  node-name,  next,  previous,  up

@node group_skip, item_0, S_encap, Index params
@comment  node-name,  next,  previous,  up

@subsubsection @code{group_skip}

@vindex group_skip
@code{group_skip} is a string of @TeX{} commands to insert between
letter groups.

@node item_0, S_language, group_skip, Index params
@comment  node-name,  next,  previous,  up

@subsubsection @code{item_0}

@vindex item_0
@code{item_0} is the @TeX{} command to begin an index entry.

@node S_language, S_lethead, item_0, Index params
@comment  node-name,  next,  previous,  up

@subsubsection @code{language.@i{???}}

@vindex language.prefix
@vindex language.suffix
@code{language.prefix} begins a language entry.; @code{language.suffix}
ends one.

@node S_lethead, S_underline, S_language, Index params
@comment  node-name,  next,  previous,  up

@subsubsection @code{lethead.@i{???}}

@vindex lethead.prefix
@vindex lethead.suffix
@vindex lethead.flag
@code{lethead.prefix} begins a letter group; @code{lethead.suffix} ends
one.  The flag @code{lethead.flag} controls the format of the letter
group: if it is zero, nothing is inserted; if it is positive, an
upper-case letter is inserted; if it is negative, a lower-case letter is
inserted.


@node S_underline, , S_lethead, Index params
@comment  node-name,  next,  previous,  up

@subsubsection @code{underline.@i{???}}

@vindex underline.prefix
@code{underline.prefix} is the @TeX{} command to begin an underlined
index entry.

@vindex underline.suffix
@code{underline.suffix} is the @TeX{} command to end an underlined index
entry.


@node Module params,Contents params,Index params,Style
@comment  node-name,  next,  previous,  up

@subsection Customizing the module list

@menu
* modules.info: S_modules.
* modules.postamble: S_modules. @TeX{} commands to end module list.
* modules.preamble: S_modules.  @TeX{} commands to begin module list.
* modules.tex: S_modules.       Name of file containing list of modules.
@end menu

@node S_modules, , Module params, Module params
@comment  node-name,  next,  previous,  up

@vindex modules.tex
@code{modules.tex} is the name of the file into which the module names
are written.

@vindex modules.preamble
@code{modules.preamble} is a string of @TeX{} commands to begin the list
of modules.

@vindex modules.postamble
@code{modules.postamble} is a string of @TeX{} commands to end the list
of modules.

@vindex modules.info
@code{modules.info} is the name of the @TeX{} macro that formats the
command line and related information.

@node Contents params,Subscript params,Module params,Style
@comment  node-name,  next,  previous,  up

@subsection Customizing the Table of Contents

@menu
* contents.postamble: S_contents. @TeX{} commands to end Table of Contents.
* contents.preamble: S_contents.  @TeX{} commands to begin Table of Contents.
* contents.tex: S_contents.       Name of contents file.
@end menu

@node S_contents, , Contents params, Contents params
@comment  node-name,  next,  previous,  up

@vindex contents.tex
@code{contents.tex} is the name of the file into which the Table of
Contents is written.

@vindex contents.preamble
@code{contents.preamble} is the @TeX{} string that begins printing the
Table of Contents.

@vindex contents.postamble
@code{contents.postamble} is the @TeX{} string that ends the Table of
Contents.

@node Subscript params,Fwebmac params,Contents params,Style
@comment  node-name,  next,  previous,  up

@subsection Customizing cross-reference subscripts

@cindex Bullet
@cindex Subscript, bullet
When @FWEAVE{} pretty-prints code, it can attach cross-reference
subscripts to various kinds of identifiers such as function or macro
names.  [A bullet
@tex
($\bullet$)
@end tex
for a subscript indicates that the name was defined in the
current section.]
The actual marking of the cross reference is done by
the command @samp{@@[} (@pxref{AT[}).  This is usually done
implicitly; for example, the commands @samp{@@a}, @samp{@@d}, and
@samp{@@m} issue an implicit @samp{@@[}.  (See the discussion of
@samp{@@a} in @ref{ATa}.)  In C, various declarations of
variables also result in such an implicit mark.

Various nuances in the type (possibly underlined) used for the
subscript give a hint about what kind of identifier @FWEAVE{} thinks
it's working with.  For more information about the typesetting
conventions, see the definition of the 
primitive macro @samp{\W@@IN} in @file{fwebmac.web}.]
@cindex Bullet subscript
The following flags select which identifiers are so subscripted.

To see the default values of these parameters, say @samp{ftangle
-Zmark_defined}.  To turn off the subscripting operations completely, use the
@samp{-f} option (@pxref{-f}).

@menu
* mark_defined.generic_name: S_mark_defined.
* mark_defined.fcn_name: S_mark_defined.
* mark_defined.WEB_macro: S_mark_defined.
* mark_defined.outer_macro: S_mark_defined.
* mark_defined.exp_type: S_mark_defined.
* mark_defined.typedef_name: S_mark_defined.
@end menu

@node S_mark_defined, , Subscript params, Subscript params
@comment  node-name,  next,  previous,  up

@vindex mark_defined.typedef_name
@vindex mark_defined.exp_type
@vindex mark_defined.outer_macro
@vindex mark_defined.WEB_macro
@vindex mark_defined.fcn_name
@vindex mark_defined.generic_name
(Discussion to be completed.)

@node Fwebmac params,Completion params,Subscript params,Style
@comment  node-name,  next,  previous,  up

@subsection Customizing the behavior of @file{fwebmac.sty} macros

@findex fwebmac.web
To some extent, the behavior of @FWEB{}'s macro package
@file{fwebmac.sty} can be changed by means of the following parameters.
(Please try not to actually edit @file{fwebmac.sty} itself; it is
produced automatically from @file{fwebmac.web}.  And please don't edit
that file either!)

@menu
* doc.preamble: S_LaTeX.        Preamble for entire document.
* doc.postamble: S_LaTeX.       Postamble for entire document.

* format_IDENTIFIER: S_format.  Macro name for typesetting upper-case identifiers.
* format.reserved: S_format.    Macro for reserved words.
* format.short_identifier: S_format. Macro for single-character identifiers.
* format_OUTER_MACRO: S_format. Macro for upper-case @samp{@@d} identifiers.
* format.outer_macro: S_format. Macro for lower-case @samp{@@d} identifiers.
* format_WEB_MACRO: S_format.   Macro for upper-case @samp{@@m} identifiers.
* format.WEB_macro: S_format.   Macro for lower-case @samp{@@m} identifiers.
* format.intrinsic: S_format.   Macro for intrinsic library functions.
* format_KEYWORD: S_format.     Macro for upper-case keywords.
* format.keyword: S_format.     Macro for lower-case keywords.
* format.typewriter: S_format.  Macro for strings.
* format.wildcard: S_format.    Macro for user-defined index entries.

* indent.TeX: S_indent.         Paragraph indentation for @TeX{} part.
* indent.code: S_indent.        Paragraph indentation for code part.

* LaTeX.class: S_LaTeX.         Specify the document class.
* LaTeX.class.options: S_LaTeX. Specify options for document class.
* LaTeX.package: S_LaTeX.         Specify user package(s)
* LATeX.package.options: S_LaTeX. Specify options for user package(s).
@end menu

@node  S_format, S_indent, Fwebmac params, Fwebmac params
@comment  node-name,  next,  previous,  up

@subsubsection @code{format.@i{???}}

The @code{format} parameters are strings that specify the macro to be
used to pretty-print various kinds of identifiers.  These macro names
are usually written automatically by @FWEAVE{}, but they may also be
used directly by the user in the @TeX{} documentation.  One can see
their default values by typing @samp{ftangle -Zformat.}.  For example,
the default value for @code{format.typewriter} is @code{"\\."}.

The macro names defined by the @code{format} fields are @emph{not}
defined in @file{fwebmac.sty}.  They are @emph{dummy names}, and can be
changed to any other name not already in use without affecting the
operation of @FWEB{}.  This ability is necessary because other
packages might usurp macros like @code{\.} for their own purposes.

Thus, @FWEAVE{} normally writes out the macro @code{\.} to typeset a
string.  Suppose, however, that some user package uses @code{\.} for
something else.  (One might realize this when @sc{LaTeX} crashes
when it encounteres a @code{\.} that was written automatically by
@FWEAVE{}.)  To fix this problem, put into @file{fweb.sty} the lines

@example
format_KEYWORD = "\\WTT"
format_keyword = "\\WTT"
format_typewriter = "\\WTT"
@end example
@noindent
Here @code{\WTT} can be any name not already in use; @emph{you need not (and
should not)} give a definition for @code{\WTT}.

Macros like @code{\.} or @code{\WTT} are given their values during the
execution of the @code{\Wbegin} macro that begins the output from
@FWEAVE{}.  The style-file values are written as arguments to that
macro, and essentially a command like @code{\let\.\Wtypewriter} is
executed, where the internal macro @code{\Wtypewriter} is defined in
@file{fwebmac.sty}.  If you want to change the way @FWEB{} typesets a
particular kind of identifier, you must redefine the @emph{internal}
macro name, not the one used in the @code{format} parameters.

Here are the internal macros used by @file{fwebmac.sty} to typeset the
various kinds of identifiers.  The associated style-file parameters are
shown in parentheses.  

@vindex format.id
@vindex format.ID
@vindex format.short_id
@vindex format.outer_macro
@vindex format.WEB_macro
@vindex format.reserved
@vindex format.RESERVED
@vindex format.intrinsic
@vindex format.keyword
@vindex format.KEYWORD
@vindex format.typewriter

@quotation
@ftable @code

@item \Wid 
ordinary identifiers (@code{format.id})

@item \WID 
completely upper-case ordinary identifiers (@code{format.ID})

@item \Wshort 
single-character ordinary identifiers (@code{format.short_id})

@item \WidD 
outer macros (@code{format.outer_macro})

@item \WIDD 
completely upper-case outer macros (@code{format.outer_macro})

@item \WidM 
FWEB macros (@code{format.WEB_macro})

@item \WIDM 
completely upper-case FWEB macros (@code{format.WEB_macro})

@item \Wreserved 
reserved words (@code{format.reserved})

@item \WRESERVED 
completely upper-case reserved words (@code{format.RESERVED})

@item \Wintrinsic 
library/intrinsic function names (@code{format.intrinsic})

@item \Wkeyword 
certain Fortran keywords (@code{format.keyword})

@item \WKEYWORD 
completely upper-case keywords (@code{format.KEYWORD})

@item \Wtypewriter 
character strings (@code{format.typewriter})

@end ftable
@end quotation


@node S_indent, S_LaTeX, S_format, Fwebmac params
@comment  node-name,  next,  previous,  up

@subsubsection @code{indent.@i{???}}

@vindex indent.TeX
@code{indent.TeX} specifies paragraph indentation for the @TeX{} part.

@vindex indent.code
@code{indent.code} specifies similar indentation for the code part.

@node S_LaTeX, , S_indent, Fwebmac params
@comment  node-name,  next,  previous,  up

@subsubsection @code{LaTeX.@i{???}}

@vindex LaTeX.class
For La@TeX{}2e, the default document class can be overridden by
@code{LaTeX.class}.  The default class is @code{article}, and @FWEB{}
has not been tested with other document classes, except minimally with
@code{revtex} (@pxref{REVTeX}).

@vindex LaTeX.class.options
Options to the document class can be specified by
@code{LaTeX.class.options}.

User packages can be given by @code{LaTeX.package}.

@vindex LaTeX.package
@vindex LaTeX.package.options
Options to user packages can be specified by
@code{LaTeX.package.options}.  There may be just one
@code{LaTeX.package} command and just one @code{LaTeX.package.options}
command.  If it is necessary to issue multiple such commands, then put
them into @code{doc.preamble}.  See the discussion in @ref{Document
class}. 

@vindex LaTeX.style
@vindex LaTeX.options
When running under La@TeX{} prior to La@TeX{}2e (or with REVTeX; see
@ref{REVTeX}), the document is 
(effectively) begun by the command
@code{\documentstyle[options]@{style@}}.  The options field can be
specified by @code{LaTeX.options}; the style field by
@code{LaTeX.style}.


@node Control-code mappings, Color, Completion params, Style
@comment  node-name,  next,  previous,  up

@subsection Remapping control codes

Control-code remappings are sophisticated and unwise.  They are mostly
intended for the developer, so are not explained here.

@node Color, Miscellaneous params, Control-code mappings, Style
@comment  node-name,  next,  previous,  up

@subsection Color output

@cindex Color
In the design of @FWEB{}, provision has been made for writing various
messages to the terminal in color---e.g., serious error messages might
appear in red.  This feature was motivated by the color @code{ls} of Linux.
It is installed automatically if the @code{termcap} library is present.

@cindex Message types
@cindex Color, and message types
Messages output from @FWEB{} are ranked according to an internal message-type
table; each type can be associated with a color that can be changed
in the style file.  Presently, the message types (hopefully
self-explanatory) are
@cindex Message types
@vindex color.ordinary
@vindex color.program_name
@vindex color.mod_name
@vindex color.info
@vindex color.warning
@vindex color.error
@vindex color.fatal
@vindex color.mod_num
@vindex color.line_num
@vindex color.in_file
@vindex color.include_file
@vindex color.out_file
@vindex color.timing

@quotation
@example
ordinary
program_name
mod_name
info
warning
error
fatal
mod_num
line_num
in_file
include_file
out_file
timing
@end example
@end quotation

@noindent
The associated style-file parameters are the above names prefaced by
@samp{color.}---e.g., @code{color.warning}.  Each of those has a default
value, such as @code{color.error = "red"}.  Those defaults can be
displayed by saying @samp{ftangle -Zcolor}.

What the color actually means in practice depends on the @dfn{color
mode}, set by the @samp{-C} option (@pxref{-C_}).  That selects one of
several primitive palettes, as follows:
@findex -C

@quotation
@table @kbd
@item 0
@strong{No color}; ordinary black-and-white output.  This is the default (and the
mode used when the @code{termcap} library is not present).

@item 1
@cindex Color, ANSI
@cindex Color mode, ANSI
@strong{ANSI color}.  With a color terminal that supports ANSI color escape
sequences, one has available the following colors:  @code{"black"},
@code{"red"}, @code{"green"}, @code{"yellow"}, @code{"blue"},
@code{"magenta"}, @code{"cyan"}, @code{"white"}, and @code{"default"}.
These are displayed with bold attribute (that is, bright, not dim).
@samp{"default"} stands for the usual black on white background, or vice
versa.

@item 2
@cindex Color mode, bilevel
@strong{Bilevel}.  This is for terminals that don't support true color,
but do support a double-bright mode and reverse video.  Colors are
mapped onto various combinations of those two display attributes,
according to an internally defined scheme.  For example, @code{"red"} is
mapped onto the pair of escape sequences @samp{md}, @samp{mr}
(double-bright mode in reverse video).

@item 3
@cindex Color mode, trilevel
@strong{Trilevel}.  As above, but adds underlining capability.

@item 4
@cindex Color mode, user-defined
@strong{User-defined colors}.  This implements a minimal set of defaults.  It is
intended that the user add definitions in the style file to override
those defaults. 

@end table
@end quotation

@findex termcap
@cindex Escape sequences, ANSI
@vindex Color.black
@vindex Color.red
@vindex Color.green
@vindex Color.yellow
@vindex Color.blue
@vindex Color.magenta
@vindex Color.cyan
@vindex Color.white
@vindex Color.default

The mechanism is intended to work with systems that support the
@code{termcap} library.  The terminal is controlled by writing
appropriate escape sequences to it.  The style-file parameters that
store the escape sequences are the color name preceded by @samp{Color.}
(note the upper case @samp{C})---e.g., @samp{Color.red}.  For cases like
reverse video (standard termcap abbreviation @samp{mr}), the escape
sequences are determined by querying the termcap database (usually
@file{/etc/termcap}) through the @code{termcap} library functions.  For
ANSI color (color mode = 1), ANSI escape sequences are hard-coded into
@FWEB{}.  One can see the escape sequences @FWEB{} assigns to colors by
saying @samp{ftangle -ZColor}.

For any non-zero color mode, one can override @FWEB{}'s default choices
for color mappings and escape sequences by redefining one or more of the
@code{Color} parameters in the style file.  The escape sequences can
either be specified in raw form---e.g., for color mode = 1, a
default is @code{Color.red = "\e[01;31m"}---or in the form of a sequence
of two-character abbreviations that are defined in the termcap
documentation---e.g., for modes 2 and 3, the default is @code{Color.red
= "mdmr"}.  (When one displays that with the @samp{-Z} option, @FWEB{}
will display the actual escape sequences that it determines from the termcap
database, not the abbreviations.  For both input and output, note that
one may use the non-ANSI escape sequence @samp{\e} to represent the
escape character @samp{\033}.)

When one says @samp{-ZColor}, for color modes 1--3 all of the
parameters are listed as modified, even if the user redefines none.
That occurs because the defaults are overwritten internally when the
color mode is set.

@findex termcap0
@FWEB{}'s configuration script attempts to determine whether the termcap
library is present; if not, they link in dummy termcap routines
(@file{termcap0.web}).  To override this behavior, change the
appropriate lines in @file{defaults.mk}, produced by the command
@code{./configure}. 

Color message output is not fully debugged (it's a frill, after all), so
some messages that should reasonably be colored may not be so in the
present release.  

@node Miscellaneous params,,Color,Style

@comment  node-name,  next,  previous,  up

@subsection Miscellaneous style-file parameters

There are a variety of miscellaneous parameters.

@menu
For @FTANGLE{}:

* ASCII_fcn::                   Routine for converting strings to ASCII.
* cchar::                       Continuation character for Fortran.
* cdir_start::                  @samp{@?} translates to this.
* line_char::                   Comment char. for @FTANGLE{}'s @code{line} cmds.
* line_length: S_line_length.

* paren.len: -n).               Length of one parenthesized index for @samp{-n)}.
* paren.levels: -n).            Number of nested parentheses for @samp{-n)}.
* paren.num: -n).               Number of permitted indices for @samp{-n)}.

* meta.top: S_meta_t.           Material to precede tangled meta-comment. 
* meta.prefix: S_meta_t.        Begins each line of meta-comment.
* meta.bottom: S_meta_t.        Material that follows the meta-comment.

* meta.top.hdr: S_meta_t.       Like meta.top, but for info at start of file.
* meta.prefix.hdr: S_meta_t.    As above.
* meta.bottom.hdr: S_meta_t.    As above.

* outer.def: S_outer.           @FTANGLE{} converts @samp{@@d} to this.
* outer.undef: S_outer.         @FTANGLE{} converts @samp{@@u} to this.

* protect::                     Protection character to end a continued line.
* suffix::                      Suffixes for output files.

For @FWEAVE{}:

* macros::                      Default name of the macro package to be
                                        read in by @FWEAVE{}. 
* limbo.begin: S_limbo.         Default material to begin the limbo section.
* limbo.end: S_limbo.           Default material to end the limbo section.

* meta.code.begin: S_meta_w.
* meta.code.end: S_meta_w.

* meta.TeX.begin: S_meta_w.     @TeX{} material to begin @FWEAVE{}'s 
                                                output of a meta-comment.
* meta.TeX.end: S_meta_w.       As above, but end the meta-comment.

* preamble.named: S_preamble.   @TeX{} material to begin named section.
* preamble.unnamed: S_preamble. @TeX{} material to begin unnamed section. 

For both processors:

* dot_constant.begin: S_dot_constant.   Beginning character for dot constant.
* dot_constant.end: S_dot_constant.     Ending character for dot constant.

* null_file::                   Name of the null file.
@end menu

@node ASCII_fcn, cchar, Miscellaneous params, Miscellaneous params
@comment  node-name,  next,  previous,  up

@subsubsection @code{ASCII_Fcn}

@vindex ASCII_Fcn
@xref{ATdquote}.

@node cchar, cdir_start, ASCII_fcn, Miscellaneous params
@comment  node-name,  next,  previous,  up

@subsubsection @code{cchar}

@vindex cchar
Continuation character for @sc{Fortran} code output.

@node cdir_start, line_char, cchar, Miscellaneous params
@comment  node-name,  next,  previous,  up

@subsubsection @code{cdir_start}

@vindex cdir_start
This parameter has the form @code{cdir_start.@i{l}}, where @i{l} is one of
@samp{C}, @samp{Cpp}, @samp{N}, @samp{N90}, @samp{R}, @samp{R90},
@samp{X}, or @samp{V}.  The contents of this parameter is written
immediately after the @samp{@@?} that begins a compiler directive.

@node line_char, S_line_length, cdir_start, Miscellaneous params
@comment  node-name,  next,  previous,  up

@subsubsection @code{line_char.@i{l}} (@FTANGLE{})

@vindex line_char
By default, @FTANGLE{} outputs comments indicating line numbers in the
@code{web} file from which the tangled output comes.  (This information
can be used by debuggers, especially those for C and C++, to correlate
error messages to the @code{web} source.)  The @code{line_char}
parameter sets the comment character that begins the line comment.

@node S_line_length, S_meta_t, line_char, Miscellaneous params
@comment  node-name,  next,  previous,  up

@subsubsection @code{line_length.@i{l}} (@FTANGLE{})

@vindex line_length
This parameter is used by the @sc{Fortran}-like languages to control the
length of the output line in the @file{.f} file produced by
@FTANGLE{}.  For @sc{Fortran}-77, its default value is the venerable
72.  For @sc{Fortran}-90, its default is 73.  Using that value makes it
possible to generate code that is compatible with both fixed- and
free-form format (by continuing lines with an trailing ampersand in
column 73 and another ampersand in column 6 of the next line).

@node S_meta_t, S_outer, S_line_length, Miscellaneous params
@comment  node-name,  next,  previous,  up

@subsubsection @code{meta.@i{???.?}}, @code{meta.@i{???}.hdr.@i{?}} (@FTANGLE{})

These parameters customize the treatment of meta-comments.
Fundamentally, meta-comments consist of material enclosed by
@samp{@@(...@@)}.  The header information usually written at the top of
the file output by @FTANGLE{} (@pxref{-Tv}) is also treated as a
meta-comment.  For that header material, a separate set of parameters is
provided, such as @code{meta.top.hdr}.

@vindex meta.top
@vindex meta.top.hdr
@code{meta.top.@var{l}} specifies text that precedes material enclosed by
@samp{@@(...@@)}.  Here @var{l} is one of the standard language subscripts
(@pxref{Style}) such as @code{N90}.

@vindex meta.prefix
@vindex meta.prefix.hdr
@code{meta.prefix.@var{l}} begins each line of the meta-comment.

@vindex meta.bottom
@vindex meta.bottom.hdr
@code{meta.bottom.@var{l}} specifies text that follows the meta-comment.

@node S_outer, protect, S_meta_t, Miscellaneous params
@comment  node-name,  next,  previous,  up

@subsubsection @code{outer.@i{???}}

@vindex outer.def
@vindex outer.under
@FTANGLE{} converts @samp{@@d} (@pxref{ATd}) to @code{outer.def}, and
@samp{@@u} (@pxref{ATu}) to @code{outer.undef}.

@node protect, suffix, S_outer, Miscellaneous params
@comment  node-name,  next,  previous,  up

@subsubsection @code{protect.?}

@vindex protect
The strings @code{protect.@var{l}} specify the protection character(s) to end
a continued line.

@node suffix, macros, protect, Miscellaneous params
@comment  node-name,  next,  previous,  up

@subsubsection @code{suffix.?}

@vindex suffix
The extension for the files output by @FTANGLE{} is specified by
@code{suffix.@var{l}}.


@node macros, S_limbo, suffix, Miscellaneous params
@comment  node-name,  next,  previous,  up

@subsubsection @code{macros}

@vindex macros
The default name of the macro package to be read in.  [This is usually
@file{fwebmac.sty} (@pxref{fwebmac.sty}), but can be overridden by the
command-line option @samp{-w}; see @ref{-w}.]

@node S_limbo, S_meta_w, macros, Miscellaneous params
@comment  node-name,  next,  previous,  up

@subsubsection @code{limbo.begin}, @code{limbo.end}

@vindex limbo.begin
@samp{limbo.begin} is @TeX{} material to be printed at the beginning of
the limbo section, just before the text from @samp{@@l} commands.  @xref{ATl}.
(This command was previous called just @samp{limbo}, and that still
works.)

@vindex limbo.end
Similarly, @samp{limbo.end} is printed at the end of the limbo section.

Thus, the beginning of the file output by @FWEAVE{} looks like this:

@example
\input fwebmac.sty

\Wbegin@{...@} 
   [contains \documentclass, \usepackage, <doc.preamble>, \begin@{document@}]

<limbo.begin>
[contents of any @@l commands]
[user's TeX commands from the limbo section]
<limbo.end>
@end example

The @samp{limbo.end} command is useful for printing the entire document
in two-column format.  For more discussion, see @ref{LIndex}.

@node S_meta_w, S_preamble, S_limbo, Miscellaneous params
@comment  node-name,  next,  previous,  up

@subsubsection @code{meta.@i{???}} (@FWEAVE{})

@vindex meta
(To be finished.)

@node S_preamble, S_dot_constant, S_meta_w, Miscellaneous params
@comment  node-name,  next,  previous,  up

@subsubsection @code{preamble.@i{???}}

@vindex preamble.named
@vindex preamble.unnamed
Additional @TeX{} material can be inserted at the beginning of a named
section with @code{preamble.named} and at the beginning of an unnamed
one with @code{preamble.unnamed}.

@node S_dot_constant, null_file, S_preamble, Miscellaneous params
@comment  node-name,  next,  previous,  up

@subsubsection @code{dot_constant.@i{???.?}}

@vindex dot_constant.begin
@vindex dot_constant.end
In @sc{Fortran}, `dot' constants such as @code{.LT.} are begun and ended by
periods.  In special circumstances, the beginning and ending characters
may be modified by @code{dot_constant.begin.@var{l}} and
@code{dot_constant.end.@var{l}}.

@node null_file, , S_dot_constant, Miscellaneous params
@comment  node-name,  next,  previous,  up

@subsubsection @code{null_file}

@vindex null_file
The name of the null file or device.  For more discussion, see
@ref{Change files}. 

@node Completion params,Control-code mappings,Fwebmac params,Style
@comment  node-name,  next,  previous,  up

@subsection  Automatic file name completion

@menu
* Ext.web: S_Ext.        Extensions for the web file.
* Ext.ch: S_Ext.     Extensions for the change file.
* Ext.hweb: S_Ext.       Extensions for include files.
* Ext.hch: S_Ext.    Extensions for change files associated with
                                include files. 
@end menu

@node S_Ext, , Completion params, Completion params
@comment  node-name,  next,  previous,  up

@vindex ext.web
@vindex ext.ch
@vindex ext.hweb
@vindex ext.hch

For more information, see @ref{-e}.

@node Hints, New features, Customization, Top
@comment  node-name,  next,  previous,  up

@chapter USAGE TIPS and SUGGESTIONS

In this section are collected various tips and suggestions to help one make
full use of @FWEB{}.  Additional hints broken down by each supported
source language can be found in @ref{Languages}.

@menu
* Converting::          Converting an existing code to @FWEB{}.
* Tips::                Usage tips and suggestions.
* Science::             Useful features for scientific programming.
@end menu

@node Converting, Tips, Hints, Hints
@comment  node-name,  next,  previous,  up

@section Converting an existing code to @FWEB{}

@cindex Converting an existing code to @FWEB{}
@cindex Code, converting to @FWEB{}
To convert an existing code to @FWEB{}, one should do the
following. (The following simple procedure assumes that one puts all the
subroutines into the unnamed module. However, other more elaborate schemes
are possible.)

@enumerate

@item
Place invisible commentary
about the author, version, etc. at the beginning of the source file by
bracketing it with @samp{@@z...@@x}.  The @samp{@@z} must be the first two
characters of the file.

@item
Next, set the language by including a command such as @samp{@@n} or
@samp{@@c++}. 

@item
Place an @samp{@@a} command (switch into unnamed code) before each
program unit (e.g., main @b{program}, @b{subroutine}, or @b{function}).

@item
Before each @samp{@@a}, place an @samp{@@*} or @ASP{} command,
followed by @TeX{} documentation about that particular section of code.

@item
If you have program units longer than about twelve lines, either
make them function calls, if you can afford the overhead and can impart
sufficient information via the function name, or break them up into shorter
fragments by using named modules. Insert the command @samp{@@<Name of
module@@>} in place of the fragment you're replacing, then put that
fragment somewhere else, prefaced by 
@ASP{} and @samp{@@<Name of module@@>=}.

@item
Make sure your comments are valid @TeX{}. (One can't have things
like raw underscores or dollar signs in comments, since those cause @TeX{}
to take special actions.)

@item
Beautify and clarify your documentation by using code mode
(enclosing stuff between vertical bars) liberally within your @TeX{}. 

@item
After you've seen the woven output, you may need to go back and 
format a few identifiers or section names so that @FWEAVE{} understands them
properly, or you may need to insert some pseudo-semicolons (@samp{@@;}),
pseudo-expressions (@samp{@@e}), or pseudo-colons (@samp{@@:})
(@pxref{Pseudo-operators}). 
 
@item
Consider using @FWEB{}'s built-in macro preprocessor (@pxref{Macros})
to make your code more readable---for example, replace raw numerical
constants by symbolic names. 

@item
Scientific programmers may benefit from built-in macro-like functions
like @code{$PI}; see @ref{Built-in functions}.

@item
If you are a @sc{Fortran} user,  for ultimate readability
consider converting to @sc{Ratfor}. The initial annoyance is getting rid of
column-6 continuations. With the aid of a good editor, this can be done
simply. For example, in @code{emacs} one can replace the regular expression
[carriage return, five spaces, something not equal to space, tab, or 0]
with [backslash, carriage return, six spaces]:

@example
M-x replace-regexp RET
C-q C-j \.@{\ \ \ \ \ @}[\^\.\ tab 0]RET
\\\\ C-q C-j \.@{\ \ \ \ \ \ @}RET
@end example

@noindent 
Get rid of the keywords such as @b{then} or @b{end if} in favor
of braces. Change singly-quoted character strings to doubly-quoted
ones.  The @samp{-nC} option (@pxref{-nC}) may be helpful.

@end enumerate

@node Tips, Science, Converting, Hints
@comment  node-name,  next,  previous,  up

@cindex Suggestions
@cindex Programming tips

@section Programming tips and other suggestions

@enumerate

@item
Learn how to use the GNU @code{info} browser to access the on-line
documentation.

@item
Read the list of new features and changes for the last several
releases.  @xref{New features}.

@item
Periodically check @code{ftp.pppl.gov:/pub/fweb/READ_ME} for bug
reports and other news.  Make bug reports!  @xref{Support}.

@item
If you have a color terminal, try the option @samp{-C1} (@pxref{-C_},
@pxref{Color}). 

@item
Any option in @file{.fweb} that is intended to be processed @emph{after}
the command-line options should begin with @samp{&} rather than
@samp{-}.  (This is rarely necessary.)
@xref{Initialization}

@item
Put standard command-line options into @file{.fweb}.  Also put there
standard style parameters---e.g.,

@example
-pindex.tex "#.ndx"
-pmodules.tex "#.mds"
-pcontents.tex "#.cts"
@end example

@item
Learn how to use the style file. @xref{Style}.

@item
Use the info options @samp{-@@}, @samp{-D}, @samp{-y}, and @samp{-Z}
to find out about various internal @FWEB{} tables (control codes,
reserved words, memory allocations, and style-file parameters).
@xref{Info options}.

@item
Begin all @FWEB{} sources with invisible commentary 
bracketed by @samp{@@z...@@x}.
@xref{ATz}.

@item
Always include an explicit language-setting command in the limbo
section.  Under normal circumstances, do not set the language from the
command line.
@xref{Languages}.

@item
Keep sections quite short.
Knuth suggests a dozen lines.  That's
quite hard to achieve sometimes, but almost never should a section be more
than a page long.  If a block of code is longer than that, split it up
using named modules.

@item
It's easy to define macros from the command line to expedite
conditional preprocessing. 
@xref{-m}.

@item
Use the preprocessor construction @samp{@@#if 0...@@#endif} to
comment out unwanted code.
@xref{Preprocessing}.

@item
For logical operations with the preprocessor, use @samp{||}, not @samp{|}. 

@item
It's conventional to identify the ends of long preprocessor
constructions as follows:

@example
@@#if A
.
.
@@#endif // |A|
@end example

@item
To debug an errant @FWEB{} macro, use the built-in function
@samp{$DUMPDEF}. 
@xref{$DUMPDEF}.

@item
Use @samp{@@?} for compiler directives.  @xref{AT?}.
Use the style-file parameters @samp{cdir_start} to specify 
information that will be written out at the beginning of the line.
@xref{cdir_start}. 

@item
Stick to the standard @FWEB{} commenting style @samp{/*...*/} or
@samp{//...}.  Don't use alternatives such as @sc{Fortran}'s column 1
convention; these may not work or may not be supported someday.
@xref{Comments}.

@item
The meta-comment feature @samp{@@(...@@)} provides a poor-person's
alignment feature.  But it doesn't work very well, and it's not in the
spirit of @TeX{}; learn to use @samp{\halign} or the La@TeX{} alternatives.

@item
In @sc{Fortran}, use @samp{#:0} to declare readable alphabetic statement
labels.  See @ref{Tokens} and @ref{-colon}.

@item
When mixing languages, define the language of a module at the highest
possible level---e.g., in the unamed module, not after @samp{@@<...@@>=}.

@item
Use La@TeX{}.  Plain @TeX{} is no longer supported.   Upgrade to
La@TeX{}2e.  @xref{LaTeX}.

@item
If you are reading this documentation from printed pages, make sure it's
also installed as an Info package on your system so it can be read
interactively with @code{emacs}.  You can also read it through a
World-Wide Web browser such as Netscape.  For the address, see
@ref{Support}. 

@end enumerate


@node Science, , Tips, Hints
@comment  node-name,  next,  previous,  up

@cindex Scientific programming

@section Features for scientific programming

@FWEB{} contains a few features particularly intended for scientific
programming.

@enumerate
@item
Several built-in functions generate numerical constants.  See @samp{$PI}
(@ref{$PI}) and @samp{$E} (@ref{$E}).

@item
Several built-in functions perform mathematical manipulations.  See
@samp{$EXP} (@ref{$EXP}), @samp{$POW} (@ref{$POW}), @samp{$SQRT}
(@ref{$SQRT}), @samp{$LOG} (@ref{$LOG}), @samp{$LOG10} (@ref{$LOG10}), 
@samp{$MAX} (@ref{$MAX}), and @samp{$MIN} (@ref{$MIN}).

@item
The do-loop macro @samp{$DO} may be useful.  @xref{$DO}.

@item
C-style array indices can be used by means of the @samp{-n)} option.
@xref{-n)}. 

@item
An active bracket feature helps improve the appearance of
woven code that uses subscripts and/or superscripts heavily.  @xref{-W[}.

@end enumerate

@node New features, Support, Hints, Top
@comment  node-name,  next,  previous,  up

@chapter NEW FEATURES

@cindex Features, new

This info documentation is now accessible on the World-Wide Web; see
@ref{Support}. 

Some things that have been added or changed in recent releases are
described in the following.

@menu
* V1.61::
* V1.53::
* V1.52::
* V1.50::
* V1.40::
@end menu

@node V1.61, V1.53, New features, New features
@comment  node-name,  next,  previous,  up

@section Version 1.61

@subsection Updates to documentation (v1.61)

@quotation
@enumerate

@item
@FWEB{} supports color modes in which messages to the terminal can
appear in colors chosen by the user; see @ref{Color}.  The color mode is
set by the new command-line option @samp{-C} (@pxref{-C_}).  

@item
A previously undocumented feature is that for the C-like and
Fortran-like languages, @FTANGLE{} expands the binary notation
@samp{0b...} to an unsigned decimal number. @xref{Phases}.

@end enumerate
@end quotation

@subsection Redefined commands (v1.61)

@cindex Commands, redefined
@cindex Redefined commands, version 1.61

A few obscure commands have been slightly redefined.  Sorry about that,
but it makes for more symmetry and ease of recall, and/or solves some
technical problems.

@quotation
@enumerate

@item
Although it was never documented, previous versions permitted either
lower or upper case for the @samp{@@} commands that set the
language---e.g., both @samp{@@c} and @samp{@@C} worked.  Now only the
lower-case forms work.  (The upper-case forms may have other meanings.)

@item
The style-file parameter @samp{Ext_delimiter} now begins with an
upper-case @samp{E}; formerly it was lower-case.

@item
The behavior of the optional argument of the @code{\Title} macro has
been slightly redefined.  The new, more symmetrical form is

@example
\Title[Short title]@{Long title@}
@end example
@noindent
where @code{Long title} is printed on the title page and @code{Short
title} is used for the running header within the document.  @xref{Table
of Contents}.

@item
The line-break commands @samp{@@/} and @samp{@@\} (formerly identical)
now behave slightly differently.  @samp{@@/} breaks the line just as it
would if the line had been too long and been spontaneously broken.
@xref{AT/}.  @samp{@@\} backspaces one unit of indentation after
breaking the line.  @xref{ATbs}.  Usually, one should use @samp{@@/}
(sorry; I was previously recommending @samp{@@\}.  For an example in
which it is natural to use @samp{@@\}, see @ref{ATbs}.

@item
The names of some of the code-typesetting macros in @code{fwebmac.sty}
have been changed to conform to the convention that they should all
start with @samp{W}.  This change will be invisible to you unless you
happen to have user macros of your own that start that way or (perish
the thought) you have redefined low-level and obscure code in
@file{fwebmac.sty}. 

@end enumerate
@end quotation

@subsection New features (v1.61)

@cindex Features, version 1.61
This release adds some features for managing large projects, including
(i) the @code{idxmerge} utility that merges indexes produced by several
@FWEB{} files, (ii) a mechanism for accessing RCS-like information in
the ignorable commentary at the beginning of the file, and (iii) the
ability to include @FWEAVE{}-formatted code into a standard La@TeX{}
document.  It also fixes a variety of miscellaneous bugs.

@quotation
@enumerate

@item
A stand-alone index file suitable for processing by @code{makeindex} can
be produced by the @samp{-XI} option.  @xref{Using makeindex}.

@item
Stand-alone indexes produced by @samp{-XI} can be merged with the
@code{idxmerge} utility.  @xref{Merging indexes}.

@item
@FWEAVE{}-formatted code can be included in a standard La@TeX{}2e
document by means of the @code{fwebinsert} package.  
@xref{Inserting woven code}. 

@item
Revision-control-system (RCS) information that appears in the ignorable
commentary between the optional @samp{@@z} and @samp{@@x} that begin an
@FWEB{} file (@pxref{ATz}) is accessible in the body of the file
through the built-in function @code{$KEYWORD} (@pxref{$KEYWORD}) and the
new commands @samp{@@K} (@pxref{ATK_}) and @samp{@@k} (@pxref{ATk}).
These features can access RCS-like keywords that are not known to RCS
itself, as long as they fit the proper syntax (@pxref{ATz}).

@item
The @samp{-h} option now permits easy access to the GNU @code{info} browser if
it is installed.  @xref{-h}.

@item
Underscored versions of built-in functions have been removed!!!  E.g.,
use @code{$IF}, not @code{_IF}.  This change was warned about in the
last release.

@item
Single-character identifiers can now be completely cross-referenced via
the @samp{-W1} option.  @xref{-W1}.

@item
Some module warning messages can be eliminated with the @samp{-W@@}
option.  @xref{-WAT}.

@item
The @samp{@@q} command (still experimental) has been added to locally
turn on or off the the line and module comments in the tangled output.
@xref{ATq}. 

@item
The level of verbosity of @FWEB{}'s informational messages can be
controlled with the @samp{-M} option. @xref{-M_}.

@item
C/C++ programmers may find the command @samp{@@@{} useful.  @xref{ATlb}.

@item
The @samp{-nC} option has been added for @sc{Fortran} users; it kills
commented lines at a very early stage in the processing.  This can be
useful when converting existing codes to @FWEB{}.
@xref{-nC}

@item
@sc{Fortran}-90 (@pxref{-n9}) now defaults to free-form syntax.

@item
As of the non-beta Version 1.61, free-form @sc{Fortran}-90 now inserts
semicolons automatically in the code part.  Thus, textbook
@sc{Fortran}-90 examples will weave correctly without the annoyance of
explicitly terminating each statement with a semicolon.  (If you prefer
to put in the semicolons explicitly, use @samp{--n;} to turn off the
auto-insertion.) @xref{-n;}

@item
The default meaning of the @samp{-k} option was changed; now both lower-
and upper-case forms of @sc{Fortran} I/O keywords are recognized.
@xref{-k}. 

@item
Various changes were made to internal code in @file{fwebmac.sty}.  This
should not affect anyone @emph{unless} you have redefined @code{fwebmac}
macros.  If so, you'll have to compare your versions with the present
ones.  For example, colons as argument delimiters in @code{\def}s have
been removed.

@item
It is now (barely) possible to use @code{\documentstyle@{revtex@}}
instead of the default @code{\documentclass@{article@}}.  @xref{REVTeX}.

@end enumerate
@end quotation

@subsection Significant bugs (v1.61)

@cindex Bugs, version 1.61
@quotation
@enumerate
@item
Perhaps the most significant bug is that some high-order (>= 128)
characters in strings may not typeset or be processed correctly.  This
may be an issue for some users of foreign-language packages.  The
difficulty arises from a design decision made by a previous author.
This has at least partly been fixed, but I eschewed a substantial
overhaul for fear of breaking other things.

@end enumerate
@end quotation

@node V1.53, V1.52, V1.61, New features
@comment  node-name,  next,  previous,  up

@section Version 1.53

@cindex Features, version 1.53
This release fixes a relatively small number of obscure bugs in
@code{fweb-1.52-beta}.  A few minor enhancements were also made.  They include

@quotation
@enumerate

@item
Sections can be numbered by consecutive integers rather than LaTeX's
default Dewey-decimal form by saying

@example
LaTeX.package = "fwebnum"
@end example
@noindent
@xref{Sections}.

@item
The @samp{-H} option (experimental and incomplete) was added.
For C and C++, this option tells @FWEAVE{} to scan @code{#include}
files for @samp{typedef} and/or @samp{class} definitions.  @xref{-H_}.

@item
The @samp{-k} option was added.  This tells @sc{Fortran} and @sc{Ratfor}
to understand the lower-case forms of I/O keywords such as
@samp{iostat} (with the exception of @samp{read}, @samp{write}, and
@samp{end}).  @xref{-k}. 

@item
The @samp{-n:} option was added.  This tells @sc{Fortran} to place
statement labels on a separate line, which is useful when the labels are
relatively long.  (By default, @sc{Fortran} labels are placed on the
same line as the thing they are labeling, which looks good for short
labels.)  @xref{-ncolon}

@item
The preprocessor command @samp{@@#line} was added.  For C code, this
adds an explicit @samp{#line} command to the tangled output file.  This
helps to keep the line numbers between debugger and source file in sync
when an @FWEB{} preprocessor statement expands to several lines.
@xref{Debugging with macros}.

An implicit @samp{@@#line} command is added after each @samp{@@%}
(@pxref{AT%}) that begins a line (this keeps line numbering correct).
To override this, use the option @samp{-T#}.  @xref{-T#}.

@item 
@samp{-p} (style-file) options (@pxref{-p}) on the command line are now
processed @emph{after} the local style file.  @xref{Style}.

@item
The functionality of the @samp{-D} command was enhanced to include
optional arguments that limit the information that will be listed.  @xref{-D_}.

@end enumerate
@end quotation

@node V1.52, V1.50, V1.53, New features
@comment  node-name,  next,  previous,  up

@section Version 1.52

@cindex Features, version 1.52
This release was issued only as a beta version.  It consists mostly of
bug fixes.  However, there are a few other interesting points.

@quotation
@enumerate
@item
@code{fwebmac.sty} was enhanced to warn the user to run La@TeX{} again
when the section numbering hasn't yet been brought up to date.  I'm not
sure I've covered all the bases, but before it didn't complain at all.

@item
C++ classes are now formatted (identified as reserved words) on the first
pass, so forward references such as

@example
@@ The class |C|...
@@a
class C
  @{@}
@end example
@noindent
will now work.  Note that @b{typedef} has done this for a while, although
there are still a few glitches.

@item
For two years, the documentation has described two control codes as
follows:

@example
@@~ --- inhibit line break.
@@+ --- force an index entry.
@end example
@noindent
Apparently the code had these definitions inverted; it has now been brought
up to date with the documentation.  Fortunately these commands are
evidently not heavily used, since no one complained.

@item
@code{fwebmac.sty} was further reworked to interact properly with the
user package @code{multicol}.  If in @code{fweb.sty} one says
@samp{LaTeX.package "multicol"}, then the two-column index is done with
@code{multicol}; this gives various improvements over the
@code{\twocolumn} format that was used previously.  Furthermore, it's
possible to use @samp{multicol} to do one's entire document in
two-column format.  This turned out to be relatively simple, but one
needs to get the commands in the proper order.  See @ref{LIndex} for more
details.  Two-column format substantially cuts down the white space; I
saved about 50% on a 200-page code.

  One known glitch with @FWEB{}/@code{multicol} is that if one selects
page-number cross-references instead of La@TeX{} section numbers, page
references such as 98c don't get the 'c' correct.  This is presumably not a big
deal.  At this point, assume that the use of @code{multicol} is highly
experimental. 

@item
Further bugs in the C and C++ production rules were fixed.

@end enumerate
@end quotation

@node V1.50, V1.40, V1.52, New features
@comment  node-name,  next,  previous,  up

@section Version 1.50

@cindex Features, version 1.50
@quotation
@enumerate
@item
The syntax for entries in the initialization file @file{.fweb}
(@pxref{Initialization}) has been
modified (in a way that is as backward-compatible as possible).
Previously, @samp{+} meant process the option before the command-line
options, @samp{-} meant process it after.  This convention was somewhat
hard to remember, given the statement that any command-line option could
be put into @file{.fweb}; furthermore, just about everything in
@file{.fweb} should, in fact, be processed before the command-line
options.  So now both @samp{+} and @samp{-} mean the same thing, namely
process before (and the @samp{+} notation should fade away as time goes
on).  If you explicitly want something to be processed after 
all command-line options for some tricky reason, begin it with @samp{&}.
I.e., scan your @samp{.fweb} file for any line beginning with @samp{-}
and replace that with @samp{&}.

@item
The La@TeX{} processor (@samp{-PL}) is now the default.

@item
The experimental @file{fwebmacL.sty} macro package supplied with version
1.40 has been substantially reworked and is now the default
@file{fwebmac.sty}.  Remove any reference to @file{fwebmacL.sty} from
your @file{.fweb} file.

@item
Support for La@TeX{}2e is now provided.  @xref{LaTeX}.

@item
The style-file parameter @code{index.name} was added.  This is the
section name to be given to the Index (@pxref{Index}), which should be
the last major (starred) section.  It becomes the contents of the macro
@code{\INDEX}.  Therefore, one can end one's source file by saying

@example
@@* \INDEX.
@end example

@item
The @samp{$IF...} class of built-in functions was reworked.  They should
now be more robust, recursive, and intuitive.  Simple uses of these
functions should work as before.  However, complicated uses that
depended on tricky things about the order of expansion of arguments may
require revision.  Carefully compare the descriptions of these functions
in the documentation (e.g., see @ref{$IF}) with your usage of them in
any pre-existing code.

In some cases, if a previous constructions using @code{$IF} no longer works, it
might work if you say

@example
@@m $IF(a,b,c) $$IF(a,b,c)
@end example
@noindent
and then use @code{$$IF} in your code.  (This forces an extra level of macro
expansion.)  The same remark goes for @code{$DEFINE}.

The old forms @samp{_IF} etc. no longer work; convert to @samp{$IF}.

@item
The option @samp{-j} was added.  This inhibits multiple inclusions via
@samp{@@i} of the same include file.
@xref{-j}.

@item
One now has the ability to change the comment character that begins
@FTANGLE{}'s @samp{line} command.  In the style file, say, e.g.,

@example
line_char.N '#'
@end example

@noindent
to change the default @samp{*line} output by @FTANGLE{} in @sc{Fortran}
mode to @samp{#line}.  This could be useful if one runs the C
preprocessor on the tangled @sc{Fortran} output.

@item
@FWEAVE{}'s processing of @b{typedef} statements in C and C++ was
improved. 

@item
@FWEB{} should now be able to process C++ templates and exception handling,
at least in simple situations.  The typesetting of C++ references (e.g.,
@samp{int&}) was also improved.  Please report any difficulties.

@item
There were various miscellaneous obscure bug fixes.

@end enumerate
@end quotation

@node V1.40, , V1.50, New features
@comment  node-name,  next,  previous,  up@section Version 1.40

@section Version 1.40

@cindex Features, version 1.40
@quotation
@enumerate
@item
@emph{The meaning of @samp{@@+} has changed.}  (SORRY!)  Formerly, this
inhibited a line break; that function is now performed by @samp{@@~}.
The new meaning of @samp{@@+} is to force an index entry (the opposite
of @samp{@@-}, which inhibits an index entry).

If you have large codes using the old @samp{@@+} that you do not wish to
convert, you can recover the old mappings by placing the following
commands into @file{fweb.sty}:  

@example
yes_index = "~"
no_line_break = "+"
@end example

@noindent
However, please try to make the
conversion; the new codes are intended to be more symmetrical and easier
to remember.  

@item
@emph{Built-in functions now begin with @samp{$}, not @samp{_}.}  The
underscore prefix was a bad design decision; it introduces conflicts
with ANSI C in certain circumstances.  To ease conversion, the old forms
are still understood.  Thus, one can use @samp{$EVAL} and @samp{_EVAL}
interchangably.  However, @emph{do not use} the underscore forms; they
will be deleted in future releases.

@item
@emph{Full La@TeX{} support.}  @FWEB{} no longer usurps La@TeX{}'s
@code{\output} routine, and La@TeX{}'s sectioning commands,
Table-of-Contents commands, etc. are used.  The appearance of the woven
output is changed to be more book-like.  (This is an experiment.)

@item 
@emph{Verbatim language.}  @samp{@@Lv} selects a language-independent format.
@xref{Verbatim}

@item
@emph{Language-independent mode.}  The N mode inhibits pretty-printing,
blank compression, etc.; source code is essentially copied literally
from input to output.  This mode is turned on automatically by the
@sc{verbatim} language, but it can also be used with the other languages.  It
is turned on by the command-line option @samp{-N} or the local command
@samp{@@N}. @xref{ATN_}.

@item
@emph{Writing of temporary files.}  When the @samp{-F} command-line option is
in effect, tangled output is written to temporary files instead of the
final target files, and the temporary files are compared to the last
version of the target files on disk.  If there is no change, the target
files are not updated.  This avoid unnecessary recompilation if only the
documentation, not the code, was changed.  @xref{-F_}.

@item
@emph{Converting output tokens to lower case.}  @xref{-U_}.

@item
@emph{The built-in functions @samp{$E} and @samp{$PI}.}  @xref{$E},
@ref{$PI}.

@item
@emph{The built-in functions @samp{$EXP}, @samp{$LOG}, and
@samp{$LOG10}.}  @xref{$EXP}, @ref{$LOG}, and @ref{$LOG10}.

@item
@emph{@samp{$MAX} and @samp{$MIN} generalized to take arbitrary list of
arguments.}  @xref{$MAX}, @ref{$MIN}.

@item
@emph{The marriage-saver option}.  In response to a serious user
request, see @ref{-B_}.

@end enumerate
@end quotation

@node Support, Installing, New features, Top
@comment  node-name,  next,  previous,  up

@chapter SUPPORT

@cindex Support
@cindex Bugs
@FWEB{} is supported by John Krommes, @email{krommes@@princeton.edu}.
This project is a definitively @emph{spare-time activity}!!!  Bug
reports submitted with very short test files will be verified, although
not necessarily in real time.  For very simple fixes, a change file may
be provided.  Generally, however, bugs are not fixed until the next
release.  Releases occur intermittently, depending on my many other
professional obligations.

Suggestions are very welcome.  Many of @FWEB{}'s current features were
incorporated in response to users' requests.  However, the queue for
future improvements is long; nothing may happen immediately.  The next
major release of @FWEB{}, Version 2.00, is planned for approximately the
year 2000.  (You may be relieved to know that, to the best of my
knowledge, @FWEB{} does not suffer from the Y2K bug.)

This info documentation is now accessible on the World-Wide Web from

@quotation
@url{http://w3.pppl.gov/~krommes/fweb_toc.html}.
@end quotation

You can subscribe to one or both of two @FWEB{} mailing lists,
@code{fweb-users} and @code{fweb-installers}.  To subscribe, send e-mail
to @email{majordomo@@pppl.gov}.  In the @emph{body} of the message, say, e.g.,

@quotation
@code{subscribe fweb-users}
@end quotation
@noindent
You will receive introductory information describing how these lists are
intended to be used.  To unsubscribe at any time, substitute
@code{unsubscribe} for @code{subscribe} in the above instructions.

Archive files containing the messages sent to the @FWEB{} mailing
lists are kept in

@quotation
@code{ftp.pppl.gov:/pub/fweb/archive/fweb-@{users,installers@}.archive}.
@end quotation
@noindent
In addition to anonymous @code{ftp}, these files may be obtained by
sending a message to @code{majordomo@@pppl.gov} of the form 

@quotation
@code{get fweb-users fweb-users.archive}.
@end quotation

@node Installing, Concept index, Support, Top
@comment  node-name,  next,  previous,  up

@appendix  Installing @FWEB{}

Here is the bare-bones installation procedure for @sc{unix} users:

@cindex Installing @FWEB
@enumerate
@item 
Download the @code{zgip}-compressed @code{tar} file from
@code{ftp.pppl.gov:/pub/fweb}. 
The name of the file contains the version number---e.g.,
@file{fweb-1.61.tar.gz}. 

@example
ftp ftp.pppl.gov
bin
get fweb-1.61.tar.gz
quit
@end example

@item
Uncompress and unpack the tar file:

@example
gunzip fweb-1.61.tar.gz
tar -xf fweb-1.61.tar
@end example
@noindent
If the GNU @code{tar} is installed, these two steps can be combined into

@example
gtar -xzf fweb-1.61.tar.gz
@end example

Unpacking creates the directory @file{fweb-1.61}, with at least the two
subdirectories @file{Web} and @file{Manual}.

@item
Change to the new @file{Web} subdirectory and run the configuration script.

@example
cd fweb-1.61/Web
./configure
@end example

@file{./configure} is an @code{sh} script.  It attempts to figure out
various local system features automatically, then generates the three
files @file{defaults.mk}, @file{config.h}, and @file{custom.h}; those
are used in the @code{make}.  For further information about the
operation of @file{./configure}, see @file{fweb-1.61/READ_ME.FWEB}.

@item
Make and install the release:

@example
make @i{[}CFLAGS='@i{special compiler flags}'@i{]}
make install
@end example

If @code{gcc} is available, it will be used in the @code{make}; in that
case, the default @code{CFLAGS} should be sufficient.  If another
compiler is used, ensure that it is run in ANSI-compatible mode, not the
old-style Kernighan and Ritchie.

@FWEB{} compiles on my system without any warnings with 
@w{@samp{gcc -ansi -pedantic}}.  Please report any compiler warnings
from an allegedly ANSI-C environment. 

@end enumerate

@node Concept index, Option and command index, Installing, Top
@comment  node-name,  next,  previous,  up

@unnumbered Concept index

@printindex cp

@node Option and command index, Parameter index, Concept index, Top

@unnumbered Option and command index

@printindex fn

@node Parameter index, , Option and command index, Top
@comment  node-name,  next,  previous,  up

@unnumbered Parameter index

@printindex vr

@shortcontents
@contents

@bye