summaryrefslogtreecommitdiff
path: root/web/spiderweb/bug-reports
blob: 2f0537b5a6be84331a9a71eb24b9dbfd89b3dd1d (plain)
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
From chase@orc.olivetti.com Thu Apr  6 16:11:45 1989
Received: from princeton.Princeton.EDU by notecnirp.Princeton.EDU (5.51/1.81)
	id AA24139; Thu, 6 Apr 89 16:11:43 EDT
Received: from NET.BIO.NET by Princeton.EDU (5.58+++/2.6)
	id AA12881; Thu, 6 Apr 89 16:11:18 EDT
Received: from orc.olivetti.com by net.bio.net (5.59/1.15) with UUCP 
	id AA09769; Thu, 6 Apr 89 13:10:52 PDT
Received: from ozona.orc.olivetti.com by orc.olivetti.com (3.2/SMI-3.2)
	id AA14880; Thu, 6 Apr 89 12:31:15 PDT
Received: by ozona.orc.olivetti.com (3.2/SMI-3.2)
	id AA06589; Thu, 6 Apr 89 12:40:52 PDT
From: chase@orc.olivetti.com (David Chase)
Message-Id: <8904061940.AA06589@ozona.orc.olivetti.com>
To: nr@Princeton.EDU
Subject: "cputype?"
Reply-To: David Chase <chase@orc.olivetti.com>
Date: Thu, 06 Apr 89 12:40:50 -0700
Status: RO

is not a command on my Unix machine (a Sun).

David

From chase@orc.olivetti.com Thu Apr  6 16:11:56 1989
Received: from princeton.Princeton.EDU by notecnirp.Princeton.EDU (5.51/1.81)
	id AA24169; Thu, 6 Apr 89 16:11:53 EDT
Received: from NET.BIO.NET by Princeton.EDU (5.58+++/2.6)
	id AA12880; Thu, 6 Apr 89 16:11:17 EDT
Received: from orc.olivetti.com by net.bio.net (5.59/1.15) with UUCP 
	id AA09765; Thu, 6 Apr 89 13:10:50 PDT
Received: from ozona.orc.olivetti.com by orc.olivetti.com (3.2/SMI-3.2)
	id AA14856; Thu, 6 Apr 89 12:27:42 PDT
Received: by ozona.orc.olivetti.com (3.2/SMI-3.2)
	id AA06558; Thu, 6 Apr 89 12:37:19 PDT
From: chase@orc.olivetti.com (David Chase)
Message-Id: <8904061937.AA06558@ozona.orc.olivetti.com>
To: nr@Princeton.EDU
Subject: Spideryweb bug report
Reply-To: David Chase <chase@orc.olivetti.com>
Date: Thu, 06 Apr 89 12:37:15 -0700
Status: RO

An installation problem:  People who care about Trojan horses
don't put "." at the beginning of their path, so shell scripts
invoked as "make" never get executed.  Try "./make" instead.
I realize that "." at front is the Unix default, but it is an
exceptionally stupid one (put a benign Trojan horse named "ls"
in a few world-writeable directories on a time-shared Unix machine,
and see what happens).  I don't know why this isn't more widely
worried about.

David

From chase@orc.olivetti.com Thu Apr  6 16:12:03 1989
Received: from princeton.Princeton.EDU by notecnirp.Princeton.EDU (5.51/1.81)
	id AA24179; Thu, 6 Apr 89 16:12:01 EDT
Received: from NET.BIO.NET by Princeton.EDU (5.58+++/2.6)
	id AA12883; Thu, 6 Apr 89 16:11:24 EDT
Received: from orc.olivetti.com by net.bio.net (5.59/1.15) with UUCP 
	id AA09777; Thu, 6 Apr 89 13:10:58 PDT
Received: from ozona.orc.olivetti.com by orc.olivetti.com (3.2/SMI-3.2)
	id AA14962; Thu, 6 Apr 89 12:44:22 PDT
Received: by ozona.orc.olivetti.com (3.2/SMI-3.2)
	id AA06693; Thu, 6 Apr 89 12:53:57 PDT
From: chase@orc.olivetti.com (David Chase)
Message-Id: <8904061953.AA06693@ozona.orc.olivetti.com>
To: nr@Princeton.EDU
Subject: That cute trick with '#' in variable definitions
Reply-To: David Chase <chase@orc.olivetti.com>
Date: Thu, 06 Apr 89 12:53:54 -0700
Status: RO

was unknown to me.  I broke things badly "cleaning up" the
definition of the three directories.  I think you ought
to either change the formatting, or mention that there is
a reason for the '#' immediately following the definitions
(it's not like I'm a novice at this, either)

David

From chase@orc.olivetti.com Thu Apr  6 16:12:13 1989
Received: from princeton.Princeton.EDU by notecnirp.Princeton.EDU (5.51/1.81)
	id AA24188; Thu, 6 Apr 89 16:12:10 EDT
Received: from NET.BIO.NET by Princeton.EDU (5.58+++/2.6)
	id AA12886; Thu, 6 Apr 89 16:11:27 EDT
Received: from orc.olivetti.com by net.bio.net (5.59/1.15) with UUCP 
	id AA09786; Thu, 6 Apr 89 13:11:04 PDT
Received: from ozona.orc.olivetti.com by orc.olivetti.com (3.2/SMI-3.2)
	id AA15001; Thu, 6 Apr 89 13:02:35 PDT
Received: by ozona.orc.olivetti.com (3.2/SMI-3.2)
	id AA06741; Thu, 6 Apr 89 13:12:11 PDT
From: chase@orc.olivetti.com (David Chase)
Message-Id: <8904062012.AA06741@ozona.orc.olivetti.com>
To: nr@Princeton.EDU
Subject: So far, so good
Reply-To: David Chase <chase@orc.olivetti.com>
Date: Thu, 06 Apr 89 13:12:08 -0700
Status: RO

It made it past "make boot", and I'm fixing to look at
the documentation.  My intention is to see if this can
easily be made to generate Modula-3 -- if so, (I think)
I can use it to generate test input for the Modula-3
compiler.  Of course, any such test input is unlikely to
be incredibly sophisticated, since it will be machine-
generated, but it's better than none at all.

David

From nr Thu Apr  6 20:12:03 1989
Received: by notecnirp.Princeton.EDU (5.51/1.81)
	id AA05087; Thu, 6 Apr 89 20:11:36 EDT
Date: Thu, 6 Apr 89 20:11:36 EDT
From: nr (Norman Ramsey)
Message-Id: <8904070011.AA05087@notecnirp.Princeton.EDU>
To: chase@orc.olivetti.com
Subject: Re:  "cputype?"
Cc: nr
Status: RO

> Subject: "cputype?"
> is not a command on my Unix machine (a Sun).
> 
> David

I have added instructions to README and to WebMakefile that deal with
cputype.  As far as I know, it is a local idiosyncracy, and my
documentation predates it.  Thank you for calling it to my attention.

It looks like you've already figured it out, but a shell script
containing the line `echo sun3' will do fine if it is somewhere on
your search path.

> An installation problem:  People who care about Trojan horses
> don't put "." at the beginning of their path, so shell scripts
> invoked as "make" never get executed.  Try "./make" instead.

I don't see a clean way to fix this.  Are any files affected besides
WEBROOT/Makefile?  The problem is that some of the calls to $(MAKE)
are calls to shell scripts in subdirectories, while others are calls
to /bin/make in the current directory.  What have you done to improve
things?

> I realize that "." at front is the Unix default, but it is an
> exceptionally stupid one (put a benign Trojan horse named "ls"
> in a few world-writeable directories on a time-shared Unix machine,
> and see what happens).  I don't know why this isn't more widely
> worried about.

I think this isn't worried about because most people assume the world
is benign until they are bitten once or twice.  Some of my colleagues
swear by never putting . on their path at all.  Me, I haven't been
bitten yet.
> Subject: That cute trick with '#' in variable definitions
> was unknown to me.  I broke things badly "cleaning up" the
> definition of the three directories.  I think you ought
> to either change the formatting, or mention that there is
> a reason for the '#' immediately following the definitions
> (it's not like I'm a novice at this, either)

I put a comment in.  When I first prepared this for distribution, I
broke things badly by commenting those (previously uncommented) macro
definitions. 

> It made it past "make boot", and I'm fixing to look at
> the documentation.  My intention is to see if this can
> easily be made to generate Modula-3 -- if so, (I think)
> I can use it to generate test input for the Modula-3
> compiler.  Of course, any such test input is unlikely to
> be incredibly sophisticated, since it will be machine-
> generated, but it's better than none at all.

Generating Modula-3 from a Modula-3 literate program should be no
trouble at all.  One the other hand, if you want to translate
something else into Modula-3, you are probably better off using
WEB-to-C as a basis.  Let me know how it goes; I would love to have a
Modula-3 spider file to add to the distribution.

Norman


From Chris.Paris@vega.fac.cs.cmu.edu Mon Jan 23 20:52:57 1989
Received: from princeton.Princeton.EDU by notecnirp.Princeton.EDU (5.51/1.68)
	id AA03118; Mon, 23 Jan 89 20:52:56 EST
Received: from VEGA.FAC.CS.CMU.EDU by Princeton.EDU (5.58+++/1.98)
	id AA27627; Mon, 23 Jan 89 20:52:44 EST
Message-Id: <8901240152.AA27627@Princeton.EDU>
Received: from VEGA.FAC.CS.CMU.EDU by VEGA.FAC.CS.CMU.EDU; 23 Jan 89 20:51:40 EST
To: nr@Princeton.EDU
Reply-To: cap@cs.cmu.edu (Chris Paris)
Subject: webkernel
Date: Mon, 23 Jan 89 20:51:36 EST
From: Chris.Paris@VEGA.FAC.CS.CMU.EDU
Status: RO

I would be more than happy to help beta test Spider.  I think it is a
wonderful idea that seems very well implimented.  I installed the
webkernel you sent me (thanks), and it fixed most problems I was
having.  However, when ceeweave->TeX comes across something like,

	@u
	#include <stdio.h>
	#include <fcntl.h>
	#include "myinclude.h"

	main()

things happen that I wouldn't expect.  First, the filenames in angle
brackets get set in italics without the brackets.  I wouldn't expect
this because it looks like c.spider has code to recognize and put in
brackets.  "myinclude.h" is set in \tt with the quotes, which is what
I would expect.

Second, if the first line of code is a preprocessor directive, it is
indented, so that it lines up with main().  Subsequent directives are
against the left margin.

I don't want to call these bugs since I don't know if what I'm seeing
is what you intended or not.  I am testing this on a Sun 3/60 running
Mach (4.3 BSD superset), using TeX 2.9 (generated by web2c).  I can
also test on Vaxen and IBM RT's, but have not done so yet.  I'm
willing to help out with this any way I can as long as I don't get too
sidetracked from my regular work.  Thanks for your help.

/cap

From nr Tue Jan 24 12:41:32 1989
Received: by notecnirp.Princeton.EDU (5.51/1.68)
	id AA24196; Tue, 24 Jan 89 12:41:30 EST
Date: Tue, 24 Jan 89 12:41:30 EST
From: nr (Norman Ramsey)
Message-Id: <8901241741.AA24196@notecnirp.Princeton.EDU>
To: cap.cs.cmu.edu
Subject: Bugs
Cc: nr
Status: RO

> I would be more than happy to help beta test Spider.  I think it is a
> wonderful idea that seems very well implimented.  

I'm glad you think so.  I myself have some dissatisfactions with the
implementation, especially with the webkernel macros.  I hope to have
time to work them out this summer.

> I installed the
> webkernel you sent me (thanks), and it fixed most problems I was
> having.  However, when ceeweave->TeX comes across something like,
> 
> 	@u
> 	#include <stdio.h>
> 	#include <fcntl.h>
> 	#include "myinclude.h"
> 
> 	main()
> 
> things happen that I wouldn't expect.  First, the filenames in angle
> brackets get set in italics without the brackets.  I wouldn't expect
> this because it looks like c.spider has code to recognize and put in
> brackets.  "myinclude.h" is set in \tt with the quotes, which is what
> I would expect.

You found a bug in c.spider, which I have fixed.  Generally, the way
to detect such a bug is to put an @2 in a very small test program, and
then look at the resulting diagnostic output.  The numbers are numbers
of productions (from productions.list).  Anyway I changed the
following production so that it wouldn't swallow the angle brackets:: 

	preproc !(less|lesssimp|backslash|newline) --> preproc


> Second, if the first line of code is a preprocessor directive, it is
> indented, so that it lines up with main().  Subsequent directives are
> against the left margin.

A bug in Knuth's unfathomable macros.  I have hacked webkernel and
just hope I haven't broken anything else.

> I don't want to call these bugs since I don't know if what I'm seeing
> is what you intended or not.

Not.  I think my only nonstandard prettyprinting is of (old-style)
parameter declarations.

>  I am testing this on a Sun 3/60 running
> Mach (4.3 BSD superset), using TeX 2.9 (generated by web2c).  I can
> also test on Vaxen and IBM RT's, but have not done so yet.  

You will have trouble using the makefiles on other machines---I
unknowingly used some features specific to Sun make (the @#$(&% man
page didn't say `warning, not portable'), so things like `make boot'
and `make distribution' may not work right.  But `make weave' and
`make tangle' work fine on a VAX running BSD4.3.

> I'm
> willing to help out with this any way I can as long as I don't get too
> sidetracked from my regular work.  Thanks for your help.

I'm looking for a guinea pig to try to write a Spider file for ANSI C.
Be aware that C is by far the most complicated language to prettyprint
(of the ones in the distribution).

Norman

From crm@summanulla.mc.duke.edu Fri Apr  7 21:29:18 1989
Received: from princeton.Princeton.EDU by notecnirp.Princeton.EDU (5.51/1.81)
	id AA14862; Fri, 7 Apr 89 21:29:16 EDT
Received: from duke.cs.duke.edu by Princeton.EDU (5.58+++/2.6)
	id AA02957; Fri, 7 Apr 89 21:29:01 EDT
Received: from summanulla.mc.duke.edu by duke.cs.duke.edu (5.59/DUKE/08-19-88)
	id AA01720; Fri, 7 Apr 89 21:31:47 EDT
Received: by summanulla.mc.duke.edu (3.2/DUKE/3-1-88)
	id AA08029; Fri, 7 Apr 89 18:22:28 EDT
Date: Fri, 7 Apr 89 18:22:28 EDT
From: Charles R. Martin <crm@summanulla.mc.duke.edu>
Message-Id: <8904072222.AA08029@summanulla.mc.duke.edu>
To: nr@Princeton.EDU
Cc: crm@summanulla.mc.duke.edu
Subject: Spiders, eeek!
Status: RO

I got Spider over the wires a little while ago; I'm quite excited about
it, but I've had a little bit of trouble with the installation:

(1) I set up a cputype to echo sun3; when I do this, it creates a
subdirectory sun3 of master, and attempts to compile from there.
unfortunately, the objects aren't there, and so the compilation fails.

(2) compiling the Dijkstra version given a C compile error, with
duplicate labels in a case statement.

Sorry that I haven't gotten all the details of this, but its Friday
afternoon. 

The compilation record of the dijkstra version is appended below for
your convenience, if that's the word.

echo "date" `date` | cat - d.spider | awk -f /usr/nbsr/crm/Spider/master/spider.awk
Warning: numeric constants and strings are identified in this WEAVE.
Warning: TeX strings have the same category as  numeric constants in this WEAVE.
You used 3 translation keywords.
You defined 18 reserved words of 12 ilks.
You used 15 different categories in 14 productions.
The biggest production had 3 scraps on its left-hand side.
cat /usr/nbsr/crm/Spider/master/transcheck.list trans_keys.unsorted | awk -f /usr/nbsr/crm/Spider/master/transcheck.awk
awk -f /usr/nbsr/crm/Spider/master/cycle.awk < cycle.test
There can't possibly be a cycle in the graph
sort *.unsorted | awk -f /usr/nbsr/crm/Spider/master/nodups.awk
mv *web.tex /usr/nbsr/crm/lib/tex
/bin/rm -f tangle.web
ln /usr/nbsr/crm/Spider/master/tangle.web tangle.web
ceetangle -I/usr/nbsr/crm/Spider/master tangle
This is C TANGLE (generated at 6:13 PM on April 7, 1989)
*1*14*21*25*34*62*64*84*92*107*131*141
Writing the output files: (tangle.c).....500.....1000.....1500
Done.
(No errors were found.)
cc -DDEBUG -g -DSTAT -c tangle.c
"tangle.web", line 838: duplicate case in switch, 10
*** Error code 1

Stop.
*** Error code 1

From nr Sun Apr  9 22:24:29 1989
Received: by notecnirp.Princeton.EDU (5.51/1.81)
	id AA04177; Sun, 9 Apr 89 22:24:06 EDT
Date: Sun, 9 Apr 89 22:24:06 EDT
From: nr (Norman Ramsey)
Message-Id: <8904100224.AA04177@notecnirp.Princeton.EDU>
To: crm@summanulla.mc.duke.edu
Subject: Re:  Spiders, eeek!
Cc: nr
Status: RO

	From crm@summanulla.mc.duke.edu Sat Apr  8 20:31:56 1989
	Received: from princeton.Princeton.EDU by notecnirp.Princeton.EDU (5.51/1.81)
		id AA10629; Sat, 8 Apr 89 20:31:53 EDT
	Received: from duke.cs.duke.edu by Princeton.EDU (5.58+++/2.6)
		id AA28812; Sat, 8 Apr 89 20:31:39 EDT
	Received: from summanulla.mc.duke.edu by duke.cs.duke.edu (5.59/DUKE/08-19-88)
		id AA17447; Sat, 8 Apr 89 20:34:46 EDT
	Received: by summanulla.mc.duke.edu (3.2/DUKE/3-1-88)
		id AA09036; Sat, 8 Apr 89 20:31:21 EDT
	Date: Sat, 8 Apr 89 20:31:21 EDT
	From: Charles R. Martin <crm@summanulla.mc.duke.edu>
	Message-Id: <8904090031.AA09036@summanulla.mc.duke.edu>
	To: nr@Princeton.EDU
	In-Reply-To: <8904081713.AA03350@notecnirp.Princeton.EDU> "nr@Princeton.EDU"
	Subject:  Spiders, eeek!
	
	Got the patches, thanks.  They appear to be compiling fine, although
	I've uncovered another minor bug in the makefile: when you make clean,
	it mashes c/tangle.c and awk/tangle.c, which are needed for compilation.
	
	I'll look into the dijkstra thing first of next week.
	
	Thanks again!
	
That is a Feature.  If you've lost them you should be able to get them back
using `make source'.  (Once you've done a `make boot', of course.)

Norman

PS Dijkstra compiles for me now.

From crm@harahan.mc.duke.edu Mon Apr 10 10:19:15 1989
Received: from princeton.Princeton.EDU by notecnirp.Princeton.EDU (5.51/1.81)
	id AA15358; Mon, 10 Apr 89 10:19:13 EDT
Received: from duke.cs.duke.edu by Princeton.EDU (5.58+++/2.6)
	id AA10282; Mon, 10 Apr 89 10:18:38 EDT
Received: from nbsrws9.mc.duke.edu by duke.cs.duke.edu (5.59/DUKE/08-19-88)
	id AA24403; Mon, 10 Apr 89 10:21:33 EDT
Received: by harahan.mc.duke.edu (3.2/DUKE/3-1-88)
	id AA02511; Mon, 10 Apr 89 10:18:08 EDT
Date: Mon, 10 Apr 89 10:18:08 EDT
From: Charles R. Martin <crm@harahan.mc.duke.edu>
Message-Id: <8904101418.AA02511@harahan.mc.duke.edu>
To: nr@Princeton.EDU
In-Reply-To: <8904100224.AA04177@notecnirp.Princeton.EDU> "nr@Princeton.EDU"
Subject:  Spiders, eeek!
Status: RO

   Date: Sun, 9 Apr 89 22:24:06 EDT
   From: nr@Princeton.EDU (Norman Ramsey)

	   From crm@summanulla.mc.duke.edu Sat Apr  8 20:31:56 1989
	   Received: from princeton.Princeton.EDU by notecnirp.Princeton.EDU (5.51/1.81)
		   id AA10629; Sat, 8 Apr 89 20:31:53 EDT
	   Received: from duke.cs.duke.edu by Princeton.EDU (5.58+++/2.6)
		   id AA28812; Sat, 8 Apr 89 20:31:39 EDT
	   Received: from summanulla.mc.duke.edu by duke.cs.duke.edu (5.59/DUKE/08-19-88)
		   id AA17447; Sat, 8 Apr 89 20:34:46 EDT
	   Received: by summanulla.mc.duke.edu (3.2/DUKE/3-1-88)
		   id AA09036; Sat, 8 Apr 89 20:31:21 EDT
	   Date: Sat, 8 Apr 89 20:31:21 EDT
	   From: Charles R. Martin <crm@summanulla.mc.duke.edu>
	   Message-Id: <8904090031.AA09036@summanulla.mc.duke.edu>
	   To: nr@Princeton.EDU
	   In-Reply-To: <8904081713.AA03350@notecnirp.Princeton.EDU> "nr@Princeton.EDU"
	   Subject:  Spiders, eeek!

	   Got the patches, thanks.  They appear to be compiling fine, although
	   I've uncovered another minor bug in the makefile: when you make clean,
	   it mashes c/tangle.c and awk/tangle.c, which are needed for compilation.

	   I'll look into the dijkstra thing first of next week.

	   Thanks again!

   That is a Feature.  If you've lost them you should be able to get them back
   using `make source'.  (Once you've done a `make boot', of course.)

Uh, I think one of us doesn't understand.  I do make clean then make
boot, and get an error.  I have to recover c/tangle.c and awk/tangle.c
from the tar file to get it to work.

Oh, wait -- I see.  Now that I've got ceetangle, I can make source and
get tangle.c.  Okay, in that case, how about having a make veryclean
that really cleans up everything, and have make clean make a
re-'make-boot'-able  state?  It is, however, a style question rather
than a function question at that point.

   Norman

   PS Dijkstra compiles for me now.

Thanks, me too.  I haven't had a chance to look at the results, but it
does compile.  (If I could only preview dvi files through my PC at home
as I do through my 3/60 at work....)

Thanks again,

Charlie Martin (...!mcnc!duke!crm, crm@summanulla.mc.duke.edu)
NBSR/Box 3709/Duke University Medical Center/Durham, NC 27710

From chase@orc.olivetti.com Mon Apr 10 12:31:21 1989
Received: from princeton.Princeton.EDU by notecnirp.Princeton.EDU (5.51/1.81)
	id AA21577; Mon, 10 Apr 89 12:31:20 EDT
Received: from NET.BIO.NET by Princeton.EDU (5.58+++/2.6)
	id AA14387; Mon, 10 Apr 89 12:31:02 EDT
Received: from orc.olivetti.com by net.bio.net (5.61/1.15) with UUCP 
	id AA28032; Mon, 10 Apr 89 09:30:25 -0700
Received: from ozona.orc.olivetti.com by orc.olivetti.com (3.2/SMI-3.2)
	id AA02330; Mon, 10 Apr 89 09:19:46 PDT
Received: by ozona.orc.olivetti.com (3.2/SMI-3.2)
	id AA02170; Mon, 10 Apr 89 09:29:22 PDT
From: chase@orc.olivetti.com (David Chase)
Message-Id: <8904101629.AA02170@ozona.orc.olivetti.com>
To: nr@Princeton.EDU (Norman Ramsey)
Reply-To: David Chase <chase@orc.olivetti.com>
Subject: Re: "cputype?" 
In-Reply-To: Your message of Thu, 06 Apr 89 20:11:36 -0400.
             <8904070011.AA05087@notecnirp.Princeton.EDU> 
Date: Mon, 10 Apr 89 09:29:18 -0700
Status: RO


>> invoked as "make" never get executed.  Try "./make" instead.

>I don't see a clean way to fix this.  Are any files affected besides
WEBROOT/Makefile?  The problem is that some of the calls to $(MAKE)
are calls to shell scripts in subdirectories, while others are calls
to /bin/make in the current directory.  What have you done to improve
things?

It seemed to compile after I changed Makefile in the top-level
directory to say "./make", but I just now tried a "make -n clean"
and found a few missing things.  I'd suggest that in the case where
you want "make" to mean "/bin/make" that you just drop in a shell
script along the lines of

  /bin/make $*

There's a fair chance that I'll be able to translate Pascal into
Modula-3 with a little assistance.  Another worthy project would
be to get a dialect of Pascal output more acceptable to the
brain-dead Pascal compilers used on Olivetti machines.

David

From simpson%trwarcadia.UUCP@oberon.usc.edu Mon Apr 10 14:16:57 1989
Received: from princeton.Princeton.EDU by notecnirp.Princeton.EDU (5.51/1.81)
	id AA07529; Mon, 10 Apr 89 14:16:53 EDT
Received: from OBERON.USC.EDU by Princeton.EDU (5.58+++/2.6)
	id AA17855; Mon, 10 Apr 89 14:16:35 EDT
Received: by oberon.usc.edu (5.59/5.5) id AA01417; 
	Mon, 10 Apr 89 11:15:42 PST
Received: from localhost by trwarcadia.uucp (3.2/SMI-3.2)
	id AA22106; Mon, 10 Apr 89 10:55:03 PDT
Message-Id: <8904101755.AA22106@trwarcadia.uucp>
To: nr@Princeton.EDU
Subject: Figure 2 of "Building a Language-Independent WEB"
Date: Mon, 10 Apr 89 10:55:00 -0700
From: Scott Simpson <simpson%trwarcadia.UUCP@oberon.usc.edu>
Status: RO

I believe the line coming into xtangle.c from the right should be labeled
CTANGLE, not CWEAVE.
		Scott Simpson, TRW

From nr Tue Apr 11 14:13:27 1989
Received: by notecnirp.Princeton.EDU (5.51/1.81)
	id AA11976; Tue, 11 Apr 89 14:12:49 EDT
Date: Tue, 11 Apr 89 14:12:49 EDT
From: nr (Norman Ramsey)
Message-Id: <8904111812.AA11976@notecnirp.Princeton.EDU>
To: mackay@june.cs.washington.edu
Subject: Re:  spiderweb copyright (last time??)
Cc: nr
Status: RO

> One last clarification.  The question is bound to come up, especially
> from the Japanese, who are very sensitive about this.  
> 
> 1.    Is it within your intentions in copyrighting this that a firm
>    might develop proprietary software which in no way incorporates
>    any part of spiderweb, but simply uses spiderweb as a development
>    tool for internal documentation.  
> 
> 2.    What about the proprietary publication of documented source
>    which was produced with one of the language versions of spiderweb?
>    (Again with the understanding that no part of spiderweb is included
>    in that documentation.)

I personally would be happy with either of these uses of spiderweb,
but the decision is not entirely up to me.  Spiderweb was developed
partly with government contract money, and is agreed to be released
``for research purposes only'' (whatever that means).  I will have to
look into this and get back to you.

> -------------------------------------------------------------------------
> Now for some first impressions.  
> 
> You have already supplied the explanation of how to get around `cputype`
> in the new version (which I picked up yesterday).

Yes, this was a late-breaking compromise to deal with the heterogenous
processor environment here at Princeton.  I hate it, but it seems to
get the job done.
> 
> In WebMakefile, the target boot: does not move the *.o files
> to the appropriate directory, they remain in the master directory.

Someone else found that too.  I have patched the Makefile and added
some comments.  I will send you patches.  In the process, I broke the
Makefile to remove some of the sources.  I think I have fixed that
now, but for about a day a bad version was on princeton.edu
> 
> The weave output from ceetangle comes out perfectly, but the
> weave output from weave runs into problems when it includes grammar.web
> 
>        @ Here is where we define |highestposoverall| and where we
>        check the productions.
>        @d highestposoverall = 6
>        @<Test for all of the productions@>=
>        if ((1) &&
> 		       (pp+1)->cat==SP_ignore_scrap) {
> 	       /* 1: {\tt ? ignore_scrap --> #1} */
> 
> This goes fine until it hits the comment line
> 
> 	       /* 1: {\tt ? ignore_scrap --> #1} */
> but then TeX is bothered by the _ and the #.
> 
> What is needed is some sort of \ttverbatim after the {, and possibly an
> \endttverbatim before the } (I seem to remember that it can be
> difficult to get \ttverbatim to turn itself off when it drops to
> a lower level out of {} braces, but perhaps, since you are only
> dealing with one-line comments and there are no embedded newlines
> to be formatted, the difficulty can be got around.)

Actually a \ttverbatim kind of solution won't work, because
\ttverbatim needs to be able to change the catcodes, and they can't be
changed at that late date because the whole affair is an argument to
another macro, and the characeters have already been gobbled up (or
whatever the appropriate parts of TeX's anatomy that sets catcodes).
I have changed spider.web so the offending characters are escaped with
backslashes:  {\tt ? ignore\_scrap --> \#1} and so on.

> The tangle for C seems to run with very satisfactory speed.  

We have Don Knuth to thank for this.  The lexer sees the code just
once, and then converts everything to either eight or sixteen bit
tokens.  Output is very fast.

I would like to speed up WEAVE some day, by making it run from a table
(decision tree).  Doing that and abandoning the internal conversion to
ASCII would probably gain a factor of three.

> Query?  How does the Make variable $(SPIDER) with the equivalent
> any.spider get changed into the appropriate *.spider.  It works, but
> I can't figure out how it works.  Does "any" have some esoteric meaning
> to make?

This was a horrendous hack to be able to make many different WEBs
while keeping only one Makefile around.  The three magic names
$(THETANGLE), $(THEWEAVE), and $(SPIDER) are all expected to be set on
the command line.  (Perhaps I shouldn't set them at all inside
WebMakefile.)  Look at ./c/make and you'll see how it works.


I am sending you a list of bugs so far and patches for them, under
separate cover, via tarmail.

Norman

From intvax!drstrip@unmvax.cs.unm.edu Tue Apr 11 12:02:41 1989
Received: from princeton.Princeton.EDU by notecnirp.Princeton.EDU (5.51/1.81)
	id AA02118; Tue, 11 Apr 89 12:02:39 EDT
Received: from unmvax.cs.unm.edu by Princeton.EDU (5.58+++/2.6)
	id AA21790; Tue, 11 Apr 89 12:02:30 EDT
Received: from intvax.UUCP by unmvax.cs.unm.edu (5.61/3.1) with UUCP
	id <AA17499@unmvax.cs.unm.edu>; Tue, 11 Apr 89 08:57:53 -0700
From: intvax!drstrip@unmvax.cs.unm.edu
Received: by intvax.LOCAL on Tue, 11 Apr 89 09:58:18 mdt
Date: Tue, 11 Apr 89 09:58:18 mdt
Message-Id: <8904111558.AA10373@intvax.LOCAL>
To: unmvax!nr@Princeton.EDU
Subject: spider
Status: RO

I was finally able to ftp the spider files. It was just a slow connection
that was fooling me. The webkernal file appears to have an extra carriage
return right after the "?" in the comment before you define a verbatim macro.
Also, in spiderwebman (I like that, also the ref. to Stan Lee), there is an
endnewstuff missing after the section on macros. (A lot is commented out in
the section, although not the endnewstuff, which just seems to be missing.)
Thanks for the contriution. I'll let you know if I apply it.
Strip

From ramsdell@linus.MITRE.ORG Mon Jun  5 15:02:30 1989
Received: from princeton.Princeton.EDU by notecnirp.Princeton.EDU (5.51/1.81)
	id AA01963; Mon, 5 Jun 89 15:02:27 EDT
Received: from MBUNIX.MITRE.ORG by Princeton.EDU (5.58+++/2.17)
	id AA28417; Mon, 5 Jun 89 15:01:58 EDT
Posted-From: The MITRE Corp., Bedford, MA
X-Alternate-Route: user%node@mbunix.mitre.org
Return-Path: <ramsdell@linus.MITRE.ORG>
Received: from huxley.mitre.org by linus.MITRE.ORG (5.59/RCF-3S)
	id AA20583; Mon, 5 Jun 89 14:59:51 EDT
Posted-Date: Mon, 5 Jun 89 15:00:16 EDT
Received: by huxley.mitre.org (4.0/RCF-4C)
	id AA11117; Mon, 5 Jun 89 15:00:16 EDT
Date: Mon, 5 Jun 89 15:00:16 EDT
From: ramsdell@linus.MITRE.ORG
Message-Id: <8906051900.AA11117@huxley.mitre.org>
To: nr@Princeton.EDU
Subject: Spidery Scheme
Reply-To: ramsdell@MDF.mitre.org
Status: RO

I was playing with the idea of generating WEB for Scheme.  There are
many problem, especially the fact that Scheme users like a pretty
printed format that seems not generatable by WEB's algorithm.  While I
was playing, I found two bugs.

(1) In WebMakefile: the make command makes common.o and pathopen.o
even if they exist.

huxley% make
cc -DDEBUG -g -DSTAT -c /usr/src/local/tex/mitre/Spiderweb/master/common.c
mv common.o /usr/src/local/tex/mitre/Spiderweb/master/`arch`
cc -DDEBUG -g -DSTAT -c /usr/src/local/tex/mitre/Spiderweb/master/pathopen.c
mv pathopen.o /usr/src/local/tex/mitre/Spiderweb/master/`arch`
echo "date" `date` | cat - scheme.spider | awk -f /usr/src/local/tex/mitre/Spiderweb/master/spider.awk
Warning: numeric constants and strings are identified in this WEAVE.
awk: tokentest is not an array
 record number 30
*** Error code 2
make: Fatal error: Command failed for target `grammar.web'

(2) Spider.awk fails as input to GNU's version of make:

huxley% echo "date" `date` | cat - scheme.spider | gawk -f /usr/src/local/tex/mitre/Spiderweb/master/spider.awk
gawk:  syntax error near line 1221:
temp=sprintf"strncmp("%s",loc-1,%d)==0=0",$2,length($2)


                                           ^ parse error

The problem is gawk's sprintf expects a parenthesized argument list.
Using gawk is prefered because the error messages are better an Sun
awk does not always run spider.awk correctly.  The input file 

scheme.spider:
-------------
## A very broken attempt at scheme.

language Scheme extension scm

module definition exp use exp
# use as stmt is unavoidable since tangle introduces line breaks

comment begin <";"> end newline

line begin <";"-space-"line"> end <"">

default translation <*> mathness no

# identifiers are wrong -- no hope here.
token identifier category exp mathness yes
token number category exp mathness yes
token newline category newline translation <> mathness no
token pseudo_semi category semi mathness maybe translation <"\\relax">

semi <force> --> exp

token ( category open
token ) category close
#token . category binop translation <".\\,"-opt-3>

open exp --> call
call exp --> call
call close --> exp

#newline --> ignore_scrap

? ignore_scrap --> #1

-------------------

gives this output: (all is okay using gawk)

huxley% echo "date" `date` | cat - scheme.spider | awk -f /usr/src/local/tex/mitre/Spiderweb/master/spider.awk
Warning: numeric constants and strings are identified in this WEAVE.
awk: tokentest is not an array
 record number 27

---------------------

Thank you for making your software available.  I like Levy's CWEB and
am looking forward to using your version of CWEB.
John



From kademan@stat.wisc.edu Thu Jun  8 15:30:58 1989
Received: from princeton.Princeton.EDU by notecnirp.Princeton.EDU (5.51/1.81)
	id AA12073; Thu, 8 Jun 89 15:30:56 EDT
Received: from bayes.stat.wisc.edu by Princeton.EDU (5.58+++/2.17)
	id AA00826; Thu, 8 Jun 89 15:30:47 EDT
Date: Thu, 8 Jun 89 14:28:47 CDT
From: kademan@stat.wisc.edu (Ed Kademan)
Message-Id: <8906081928.AA16941@bayes.stat.wisc.edu>
Received: by bayes.stat.wisc.edu; Thu, 8 Jun 89 14:28:47 CDT
To: nr@Princeton.EDU
Subject: spiderweb bug report
Status: RO

In case you haven't heard of this one yet, two of the line directives in
the file WEBROOT/master/common.c did not have any space between the number
and the file name string.  GNU C would not compile it as a result.  The
lines were numbers 168 and 170 I believe:
----------------------------------------------------------------------
#line 187"/u/nr/src/web/master/pathopen.web"

#line 188"/u/nr/src/web/master/pathopen.web"
----------------------------------------------------------------------
===> Bundled 11 Apr 89; all bugs into patches/003

From nr Sat Jun 17 11:02:26 1989
Received: by notecnirp.Princeton.EDU (5.51/1.81)
	id AA00234; Sat, 17 Jun 89 11:02:25 EDT
Date: Sat, 17 Jun 89 11:02:25 EDT
From: nr (Norman Ramsey)
Message-Id: <8906171502.AA00234@notecnirp.Princeton.EDU>
To: ramsdell@linus.MITRE.ORG
Subject: Re:  Spidery Scheme
Cc: nr
Status: RO

> From ramsdell@linus.MITRE.ORG Mon Jun  5 15:02:30 1989
> I was playing with the idea of generating WEB for Scheme.  There are
> many problem, especially the fact that Scheme users like a pretty
> printed format that seems not generatable by WEB's algorithm.  

What is the difficulty?  Are there some lexical elements that WEB
can't recognize, or does one need semantic information to prettyprint
Scheme?  I have only a nodding acquaintance with Lisp and know even
less about Scheme, but I shouldn't have expected too much difficulty.

> While I
> was playing, I found two bugs.
> 
> (1) In WebMakefile: the make command makes common.o and pathopen.o
> even if they exist.
> 
> huxley% make
> cc -DDEBUG -g -DSTAT -c /usr/src/local/tex/mitre/Spiderweb/master/common.c
> mv common.o /usr/src/local/tex/mitre/Spiderweb/master/`arch`
> cc -DDEBUG -g -DSTAT -c /usr/src/local/tex/mitre/Spiderweb/master/pathopen.c
> mv pathopen.o /usr/src/local/tex/mitre/Spiderweb/master/`arch`
> echo "date" `date` | cat - scheme.spider | awk -f /usr/src/local/tex/mitre/Spiderweb/master/spider.awk
> Warning: numeric constants and strings are identified in this WEAVE.
> awk: tokentest is not an array
>  record number 30
> *** Error code 2
> make: Fatal error: Command failed for target `grammar.web'


The problem is in your use of `arch` and exposes a flaw in make.  Make
is looking for a file common.o in a directory `arch` and not finding
it, so it makes the target.  You can cure the problem by replacing
`arch` with $(ARCH) in the Makefile and using ARCH=`arch` in the make
script that calls /bin/make.  I don't know of anything better.


> (2) Spider.awk fails as input to GNU's version of make:
> 
> huxley% echo "date" `date` | cat - scheme.spider | gawk -f /usr/src/local/tex/mitre/Spiderweb/master/spider.awk
> gawk:  syntax error near line 1221:
> temp=sprintf"strncmp("%s",loc-1,%d)==0=0",$2,length($2)
> 
> 
>                                            ^ parse error
> 
> The problem is gawk's sprintf expects a parenthesized argument list.
> Using gawk is prefered because the error messages are better an Sun
> awk does not always run spider.awk correctly.  

I am reluctant to move to gawk because in the past I have found it
buggy and unstable.  BSD awk is buggy but at least is stable.
Spider.awk contains a number of workarounds.  I will look into the
tokentest problem.

> Thank you for making your software available.  I like Levy's CWEB and
> am looking forward to using your version of CWEB.
> John

I'm glad to hear it.  Sorry I took so long getting back to you; I've
been out of town and things piled up while I was away.

Norman

From nr Sat Jun 17 11:08:01 1989
Received: by notecnirp.Princeton.EDU (5.51/1.81)
	id AA00397; Sat, 17 Jun 89 11:07:51 EDT
Date: Sat, 17 Jun 89 11:07:51 EDT
From: nr (Norman Ramsey)
Message-Id: <8906171507.AA00397@notecnirp.Princeton.EDU>
To: kademan@stat.wisc.edu
Subject: Re:  spiderweb bug report
Cc: nr
Status: RO

I haven't heard of this one yet; thanks for the report.  The problem is that
TANGLE tries to be clever about removing ``unnecessary'' spaces from its input.
The lines you found were from a .h file that was @included.  Since I'm spending
my time writing new literate programming tools, I'm not going to attempt to fix
it.  You can work around it by running the code through a sed script:
	/^#line/s/"/ "/

Good luck.

Norman
	From kademan@stat.wisc.edu Thu Jun  8 15:30:58 1989
	Received: from princeton.Princeton.EDU by notecnirp.Princeton.EDU (5.51/1.81)
		id AA12073; Thu, 8 Jun 89 15:30:56 EDT
	Received: from bayes.stat.wisc.edu by Princeton.EDU (5.58+++/2.17)
		id AA00826; Thu, 8 Jun 89 15:30:47 EDT
	Date: Thu, 8 Jun 89 14:28:47 CDT
	From: kademan@stat.wisc.edu (Ed Kademan)
	Message-Id: <8906081928.AA16941@bayes.stat.wisc.edu>
	Received: by bayes.stat.wisc.edu; Thu, 8 Jun 89 14:28:47 CDT
	To: nr@Princeton.EDU
	Subject: spiderweb bug report
	Status: RO
	
	In case you haven't heard of this one yet, two of the line directives in
	the file WEBROOT/master/common.c did not have any space between the number
	and the file name string.  GNU C would not compile it as a result.  The
	lines were numbers 168 and 170 I believe:
	----------------------------------------------------------------------
	#line 187"/u/nr/src/web/master/pathopen.web"
	
	#line 188"/u/nr/src/web/master/pathopen.web"
	----------------------------------------------------------------------
	===> Bundled 11 Apr 89; all bugs into patches/003
	

From kademan@stat.wisc.edu Mon Jun 26 07:17:06 1989
Received: from princeton.Princeton.EDU by notecnirp.Princeton.EDU (5.51/1.81)
	id AA14563; Mon, 26 Jun 89 07:17:05 EDT
Received: from bayes.stat.wisc.edu by Princeton.EDU (5.58+++/2.17)
	id AA27774; Mon, 26 Jun 89 07:16:24 EDT
Date: Mon, 26 Jun 89 06:14:15 CDT
From: kademan@stat.wisc.edu (Ed Kademan)
Message-Id: <8906261114.AA02589@bayes.stat.wisc.edu>
Received: by bayes.stat.wisc.edu; Mon, 26 Jun 89 06:14:15 CDT
To: nr@Princeton.EDU
Subject: spider bug report
Status: RO

===> Bundled 11 Apr 89; all bugs into patches/003

The webkernel.tex file has an \eject command on line 221 right after the
code that sets up an empty page for the first use of the output routine.
As a result the first "page" gets output before the regular macros get a
chance to set mark, and the section number in the first header is null.
Simply deleting that \eject command fixes the problem (and doesn't
introduce any new ones as far as I can tell.)

I've been having a good time playing with this spider system, and have
created a web for C++ by tweaking your c.spider file.

From matsl@inmic.se Tue May 23 11:11:17 1989
Received: from princeton.Princeton.EDU by notecnirp.Princeton.EDU (5.51/1.81)
	id AA14352; Tue, 23 May 89 11:11:15 EDT
Received: from [192.36.125.2] by Princeton.EDU (5.58+++/2.13)
	id AA28056; Tue, 23 May 89 11:11:01 EDT
Received: from inmic.se by sunic.sunet.se (5.61+IDA/KTH/LTH/1.53)
	id AAsunic04212; Tue, 23 May 89 17:11:18 +0200
Received: from haf2.inmic.se (ha2) by nmpcad.inmic.se (dec-1.2/3.0)
	id AA14700; Tue, 23 May 89 17:08:19 -0200
Received: by haf2.inmic.se (hp-13.1/3.0)
	id AA16364; Tue, 23 May 89 17:10:39 met
Date: Tue, 23 May 89 17:10:39 met
From: Mats Lidell  <matsl@inmic.se>
Message-Id: <8905231510.AA16364@haf2.inmic.se>
To: nr@Princeton.EDU
In-Reply-To: Norman Ramsey's message of Mon, 22 May 89 11:18:05 EDT <8905221518.AA03626@notecnirp.Princeton.EDU>
Subject:  Spiderweb
Status: RO

Dear Norman,

Thanks for your quick and helpful answer. It made me try it once again.

> I have only two guesses:
> 	-- you are somehow combining Spider with Silvio Levy's CWEB in a way
> 		that doesn't work
> 	-- you've got a buggy C compiler

Quite right. I was combining Spider with Silvio Levy's CWEB. See note
below.

> Please let me know more if you can, or at least tell me how big your
> tangle.c is, so I can tell if it makes sense.

This time I tried to follow the instructions real hard and it worked!
But I had some small problems.

When doing 'make boot' the link of ceetangle and ceeweave tries to get
the common object files from the cputype directory but they are not
there. They are compiled in the master directory! I just removed the
use of the cputype-directory and then it worked!

I also managed to destroy the tangle.c file in the master directory
when I typed 'make -p'. Well I shouldn't have done it but away it
went. Then I realised that this was what happened the last time I
tried to make spiderweb and that time I copied ctangle.c from CWEB
just to try it. Stupid me! This time I went back to my copy of the
distribution and got the real ctangle.c! The previous time I didn't
realised that it ever was in the master directory. I though it simply
was missing.

The programs are using the 'index' function that's not available on
SYSV. (I'm running HP-UX.) This should be substituted with 'strchr'
since I think that this is now normally available on both SYSV and BSD
systems. (I haven't checked that though! Maybe a macro is safer.) I
found no other system problem.

A small error when trying to print out the weave. I haven't tried to
find out why it fails. See output below.

	ceeweave -I../master weave.web
	This is C WEAVE (generated at 11:03 AM on May 23, 1989)
	*1*14*28
	! Illegal use of @ in comment. (l. 363)
	/* identifier =200 or octal @'
	                              310 */ *35*52*65*75*81*84*114*138*150*151*168*188*211*235
	Writing the output file...*1*14*28
	! Illegal use of @ in comment. (l. 363)
	/* identifier =200 or octal @'
	                              310 */ *35*52*65*75*81*84*114*138*150*151*168*188*211*235
	Writing the index...Done.
	Memory usage statistics: 722 of 3999 names, 2988 of 19999 cross-references,
		 9695 of 89999 bytes;
	Parsing required 822 of 1000(950) scraps, 1736 of 2000(1950) texts,
		 3749 of 20000(19950) tokens, 258 of 399 levels;

	Sorting required 47 levels

	(Pardon me, but I think I spotted something wrong.)


I can't find any collection of the improvements and/or differences you
have added to your weave and tangle nor can I find any users manual in
the same way as for CWEB. Well I will start looking through the
program documentation but if you have anything better I would
appreciate that.

Many thanks.

Yours matsl
---
Mats Lidell
 Swedish Institute of Microelectronics,  VHDL CAD Tools,
 PO Box 1084, S-164 21 KISTA, SWEDEN
 Tel: +46 8 752 11 42    Ttx: 128 75 INMIC S   Fax: +46 8 750 80 56
Internet: matsl@inmic.se or {uunet,unido,mcvax,ukc,munnari}sunic!inmic.se!matsl

From campbell@vx2.GBA.NYU.EDU Sat Jul  1 18:34:13 1989
Received: from princeton.Princeton.EDU by notecnirp.Princeton.EDU (5.51/1.82)
	id AA13480; Sat, 1 Jul 89 18:34:12 EDT
Received: from VX2.GBA.NYU.EDU by Princeton.EDU (5.58+++/2.19)
	id AA22478; Sat, 1 Jul 89 18:34:04 EDT
Received: by vx2.GBA.NYU.EDU (5.61/1.34)
	id AA25315; Sat, 1 Jul 89 17:35:25 -0500
Date: Sat, 1 Jul 89 17:35:25 -0500
From: campbell@vx2.GBA.NYU.EDU (bruce dietrich-campbell)
Message-Id: <8907012235.AA25315@vx2.GBA.NYU.EDU>
To: nr@Princeton.EDU
Subject: spider installation on 3b1
Status: RO

Hi,

I've just installed spider on my ATT 3b1 (aka UnixPC). Thought you
might be interested in a few minor changes I had to make.

	1. In common.c I added the definition

		#define index strchr

	since the routine is named differently on SysV machines.
	I probably should have added a -DUSG compilation flag, but
	since this was the only dependency ...

	2. In spider.awk, three sprintf lines were missing the
	surrounding parentheses:

1221c1221
< temp=sprintf"strncmp(\"%s\",loc-1,%d)==0",$2,length($2)
---
> temp=sprintf("strncmp(\"%s\",loc-1,%d)==0",$2,length($2))
1231c1231
< temp=sprintf"'%s'",$2
---
> temp=sprintf("'%s'",$2)
3040c3040
< temp=sprintf"(pp+%d)->cat",$i-1
---
> temp=sprintf("(pp+%d)->cat",$i-1)

	This was confusing, since BSD4.3 awk doesn't mind.

	3. My awk then wouldn't digest c.spider or awk.spider,
	complaining of an

		awk : unexpected break, continue or next at record ###

	where ### was one more than the number of lines in c.spider
	or awk.spider.  Rather than fight it, I installed gawk2.10
	and everything went fine. (Note that gawk also burps on
	the missing parentheses mentioned in 2 above.)


The last line of BUGS is:

===> Bundled 11 Apr 89; all bugs into patches/003

Cheers!

.............................................................................
Bruce Dietrich-Campbell  ARPA:   campbell@vx2.gba.nyu.edu
                         USENET: ...!{uunet,rocky,harvard}!cmcl2!vx2!campbell

From purtill@math.mit.edu Thu Jul 20 18:19:07 1989
Received: from princeton.Princeton.EDU by notecnirp.Princeton.EDU (5.51/1.83)
	id AA19356; Thu, 20 Jul 89 18:19:05 EDT
Received: from BOURBAKI.MIT.EDU by Princeton.EDU (5.58+++/2.20)
	id AA27225; Thu, 20 Jul 89 18:18:47 EDT
Received: from jacobi.mit.edu by math.mit.edu; Thu, 20 Jul 89 18:18:32 EDT
Received: by jacobi.mit.edu; Thu, 20 Jul 89 18:18:23 EDT
Date: Thu, 20 Jul 89 18:18:23 EDT
From: purtill@math.mit.edu
Message-Id: <8907202218.AA05761@jacobi.mit.edu>
To: nr@Princeton.EDU (Norman Ramsey)
Subject: spider bug(?)
Status: R


If foo.web is:
----------
@* Oink.

@<Oink |#include|s@>=
#include <oink.h>
----------

Then foo.tex (produced by ceeweave) is:
----------
\input cweb.tex

\N1.  Oink.

\Y\P\4\X1:Oink s\X${}\S{}$\par
\fi


\inx
\:\\{include}, 1.
\:\\{oink}, 1.
\fin
\:\X1:Oink s\X
\con
----------

Notice that the module name which should be "<Oink #includes>"
cleverly formated ends up being just "<Oink s>".  (Also, I'm no longer
using gawk!)

^.-.^ Mark Purtill		purtill@math.mit.edu  (617)623-6238 - H
((")) Dept. of Math, MIT 2-229, Cambridge, MA  02139  (617)253-1589 - O




From nr Thu Jul 20 18:43:45 1989
Received: by notecnirp.Princeton.EDU (5.51/1.83)
	id AA19658; Thu, 20 Jul 89 18:43:44 EDT
Date: Thu, 20 Jul 89 18:43:44 EDT
From: nr (Norman Ramsey)
Message-Id: <8907202243.AA19658@notecnirp.Princeton.EDU>
To: purtill@math.mit.edu
Subject: Re:  spider bug(?)
Cc: nr
Status: R

This is a bug.  A production is matching a token that isn't
there, and for some reason this is making WEAVE drop all its
text.  I haven't found a quick workaround; you'll have to put
something else in that title (it needs a newline to terminate 
the #include, and it can never get one within @<...@>).

I'll let you know when I get the bug fixed.

Norman

From alexande@cs.unc.edu Fri Jan 19 17:52:39 1990
Received: by cs.Princeton.EDU (5.57/1.98)
	id AA05330; Fri, 19 Jan 90 17:52:38 EST
Received: from Princeton.EDU by notecnirp.Princeton.EDU (5.51/1.98)
	id AA08642; Fri, 19 Jan 90 17:52:10 EST
Received: from mcnc.mcnc.org by Princeton.EDU (5.58+++/2.29/mailrelay)
	id AA17810; Fri, 19 Jan 90 17:45:02 EST
Received: from mercury.cs.unc.edu by mcnc.mcnc.org (5.59/MCNC/5-16-88)
	id AA21523; Fri, 19 Jan 90 17:43:28 EST
Received: from dopey.cs.unc.edu by mercury.cs.unc.edu (5.59/UNC/6-17-88)
	id AA11354; Fri, 19 Jan 90 17:42:24 EST
Received: by dopey.cs.unc.edu (5.59/UNC/06-13-88)
	id AA00405; Fri, 19 Jan 90 17:41:01 EST
Date: Fri, 19 Jan 90 17:41:01 EST
From: Geoffrey D. Alexander <alexande@cs.unc.edu>
Message-Id: <9001192241.AA00405@dopey.cs.unc.edu>
To: nr@Princeton.EDU
Subject: Problem installing spidery WEB
Cc: alexande@cs.unc.edu
Status: RO

Norman,

I have run into a problem installing Spidery WEB.  The problem occur when I
try to run make boot from WEBROOT.  Here is the output produced:

===============================================================================
cd c; make  boot; cd ..
cd ../master; rm -f *.o; for i in /unc/alexande/spiderweb/master/common.c /unc/alexande/spiderweb/master/pathopen.c; do \
	cc -DDEBUG -g -DSTAT -c $i; \
	mv *.o /unc/alexande/spiderweb/master/sparc_sunos ; \
done; cd ../c
cc -DDEBUG -g -DSTAT -c tangle.c; \
cc -DDEBUG -g -DSTAT -o /unc/alexande/bin/sparc_sunos/ceetangle /unc/alexande/spiderweb/master/sparc_sunos/common.o /unc/alexande/spiderweb/master/sparc_sunos/pathopen.o tangle.o
ld: /unc/alexande/spiderweb/master/sparc_sunos/common.o: Not a directory
*** Error code 4
make: Fatal error: Command failed for target `boot'
Current working directory /tmp_mnt/auto/phi/phi2/unc/alexande/spiderweb/c
*** Error code 1
make: Fatal error: Command failed for target `boot'
===============================================================================

The problem is that there is no directory WEBROOT/master/sparc_sunos where
sparc_sunos is the value returned by cputype.  I see that Spidery WEB is
distributed with null directories WEBROOT/master/sun3 and WEBROOT/master/vax.
Instead of "precreating" these null directories, why not dynamically create
them?  Note that there wasn't anything in WEBROOT/README or
EBROOT/master/WebMake which indicated that cputype has to return either sun3
or vax (or that a null directory has to be created).

The last line of WEBROOT/BUGS is

===============================================================================
===> Bundled 29 Nov 89; all bugs into patches/008
===============================================================================

If you have any questions, please let me know.

Thanks,
Geoff

From nr Mon Apr 16 10:57:52 1990
Received: by cs.Princeton.EDU (5.57/1.100)
	id AA08937; Mon, 16 Apr 90 10:57:34 EDT
Date: Mon, 16 Apr 90 10:57:34 EDT
From: Norman Ramsey <nr>
Message-Id: <9004161457.AA08937@cs.Princeton.EDU>
To: alexande@cs.unc.edu
Subject: Re:  Problem installing spidery WEB
Cc: nr
Status: R

> 
> Norman,
> 
> I havd the following problems installing Spidery WEB:
> 
> *  I was unable to make web in the larch subdirectory.
> Error: "comment begin" must have a restricted translation
> Error: "line begin" must have a restricted translation

Fixed.  You need <"%"> not % and <"%line"> not %line

> * I had two problems making web in the penelope subdirectory although I did
>   get a tangle and weave wiich run.  Why did I get a Fatal error from make
>   (I believe it comes from /bin/make -f SpiderMakefile $*)?  

Beats me.


> Why is there
>   potential cycle error?

Cleverness about newlines in annotations.  Context eliminates the
possibility of a cycle---check the productions.list file if you're not
clear about that.

> I recently started using Spidery WEB.  I have encountered a few minor problems.
> The first problem is that I would like to use C code in a module name.  This
> is illustrated by the following short example.
> 
> ===============================================================================
> @*= Starred module with |C_code|.

This is broken just like anything else that changes catcodes in
arguments.  It's a TeX problem that nobody knows how to fix.

> As a temporary soultion for using C code in module names, I tried using \it.
> This illustrated by
> 
> ===============================================================================
> @*= Starred module with {\it C\_code}.
> 
> @*= Index.
> ===============================================================================
> 
> This didn't work.  When I ran TeX, I got
> ......
> A solution which worked for me was to move \write\cont{\string... after
> \openout\cont=\contentsfile.  This is similar to the code in CWEB's
> cwebmac.tex.  Is this a good fix?

Looks good to me.

> This problem has to do with C preprocessor commands and the index.  Consider
> the following short example.
> 
> Ceeweave and TeX both run fine.  However, the index contains entries for ifdef,
> include, and endif (in italics and without the #).  I don't think preprocessor
> commands should be in the index (in any form).  What do you think?  How do I
> fix this?
>
> This problem invloves #include and the index.  Consider the following short
> example.
> 
> Both ceeweave and TeX run fine.  However the index contains entries for test
> and it.  It should contain instead an entry for test.it (or no entry).  What
> do you think?  How do I fix this?

You're not going to be able to do anything about this without
fundamentally changing Weave's idea of what an identifier is.  
If you want you could make the preprocessor directives reserved words,
suppressing their appearance in the index, but that will have
unpleasant repercussions, I'm sure.  If you really want to fix this
you'll have to do some hacking.

> This problem has to do with spacing in ANSI C function parameter
> specifications.  Consider the following short example.

Nobody has written a Spider description for ANSI C that I am aware of.
If you care to write one I'll be happy to put it in the distribution.

> This problem has to do with the running head.  Consider the following short
> example.
> 
> ===============================================================================
> @*= Test of starred modules -- chapter.
> 
> @*2 Test of starred modules -- subsection.
> 
> @*4 Test of starred modules -- subsubsection.
> 
> @*=Index.
> ===============================================================================
> 
> Both ceeweave and TeX run fine.  However, the running head on page 1 has module
> number 1 and the title for module 3.  I believe that they should be consistent.

Fidget with \firstmark, \topmark, and all of their friends in
webkernel.tex.  Let me know when you have something you're happy with.

> Actually, I would like to have only starred modules which cause page ejects be
> reflected in the running head.  What do you think?  How do I fix this?

Not a bad idea.  Get hacking.

> This is not really a problem as much as a design question.  I feel that @f
> should not result in any text in the TeX output (either in the module in
> which it occurs or in the index).  @f is a directive to ceeweave; it does not
> contribute to understanding the C program.  For example, if I use Xlib, I need
> to @f a number (20+) of indetifiers which are "typed" in the Xlib header files.
> I feel that having the @f's appear in a module (and in the index) simply
> detracts from the program.  What do you think?  How might I "fix" @f?

I think that if you're going to lie to your reader by using @f, your
reader should at least have a chance to catch you in the act.  From
this you may infer that I never use @f.


Norman

From ndn@seg.npl.co.uk Thu Mar 29 04:58:29 1990
Received: by cs.Princeton.EDU (5.57/1.98)
	id AA02242; Thu, 29 Mar 90 04:58:28 EST
Received: from mcsun.eu.net by Princeton.EDU (5.58+++/2.32/mailrelay)
	id AA14282; Thu, 29 Mar 90 04:56:23 EST
Received: by mcsun.EU.net via EUnet; Thu, 29 Mar 90 11:57:25 +0200 (MET)
Received: from psg.npl.co.uk by kestrel.Ukc.AC.UK   with UUCP  id aa29895;
          29 Mar 90 10:32 BST
Received: from guava.seg.npl.co.uk by snow.psg.npl.co.uk; Thu, 29 Mar 90 09:29:47 BST
From: Nick North <ndn@seg.npl.co.uk>
Date: Thu, 29 Mar 90 09:32:36 BST
Message-Id: <10449.9003290832@guava.seg.npl.co.uk>
To: nr@Princeton.EDU
Subject: Spiderweb bug
Status: RO

We are using the adaweave generated by Spiderweb and have run into
problems with the ** operator: the ada.spider supplied generates a
weave which turns
  i := 3 ** Integer(p);
into
  $\|i\mathbin{:=}\O{3}C\\{Integer}\ (\|p); \32$
So the ** has disappeared.
The following patch solves the problem (I don't know if it is the best
solution though):

*** ada.spider.old	Wed Mar 28 11:46:50 1990
--- ada.spider	Wed Mar 28 10:04:03 1990
***************
*** 46,52 ****
  
  token => category arrow translation <"\\AR">
  token .. category binop translation <"\\.{..}">
! token ** category binop 
  token := category binop translation <"\\mathbin{:=}">
  token /= translation <"\\I"> category binop 
  token >= translation <"\\G"> category binop 
--- 46,52 ----
  
  token => category arrow translation <"\\AR">
  token .. category binop translation <"\\.{..}">
! token ** category binop translation <"\\mathbin{**}">
  token := category binop translation <"\\mathbin{:=}">
  token /= translation <"\\I"> category binop 
  token >= translation <"\\G"> category binop 

We are running the version of Spiderweb whose BUGS file ends with:
===> Bundled 11 Apr 89; all bugs into patches/003

Nick North
National Physical Laboratory, UK

From alexande@cs.unc.edu Tue Apr 24 11:26:22 1990
Received: by cs.Princeton.EDU (5.57/1.101)
	id AA29083; Tue, 24 Apr 90 11:26:18 EDT
Received: from bashful.cs.unc.edu by mcnc.mcnc.org (5.59/MCNC/5-16-88)
	id AA18202; Tue, 24 Apr 90 11:25:14 EDT
Received: from fillmore.cs.unc.edu by bashful.cs.unc.edu (5.61/UNC_02-28-90)
	id AA21656; Tue, 24 Apr 90 11:24:49 -0400
Received: by fillmore.cs.unc.edu (5.61/UNC_02-28-90)
	id AA10498; Tue, 24 Apr 90 11:24:40 -0400
Date: Tue, 24 Apr 90 11:24:40 -0400
From: Geoffrey D. Alexander <alexande@cs.unc.edu>
Message-Id: <9004241524.AA10498@fillmore.cs.unc.edu>
To: nr@cs
Subject: 3 more SpiderWEB problems
Cc: alexande@cs.unc.edu
Status: RO

I have run into three more Spidery WEB problems:

8.  Page number may be off by one in table of contents.  Illustrated by the
    following example.  Not that module 2 starts on page 2 -- table of contents
    entry for module 2 gives page 1.

===============================================================================
@*= A Page Number Test.

Include a large amount of vertical space.
\vskip 6in

@*2 A level 2 module.

Include a large amount of vertical space.
\vskip 6in

@*= Index.
===============================================================================

9.  Enums not formatted correctly by ceeweave.  Illustrated by the following
    example.  I think enums should be formatted similar to structures.  Also,
    left arrows are not appropriate; I think a colon might be better.  Finally,
    enumerated values (false and true) should be underscored in index.

===============================================================================
@*= Test of enum.

@c
enum {
  false=0,
  true=1
} boolean;

@*= Index.
===============================================================================

10. Typedefs not formated correctly by ceeweave.  Illustrated by the following
    example.  The new types (boolean, lstring_head, lstring, and string) should
    be formatted as types (ie. in bold).  I tried using @f to redefine them.
    See second example.  This caused there to be no line break between typedefs
    and a small white space between the new type and ;.

===============================================================================
@*= Test of typedef.

@c
typedef enum {
  @!false=0,
  @!true=1
} boolean;
typedef struct {
  int buf_len;
  int cur_len;
} lstring_head;
typedef lstring_head *lstring;
typedef char *string;

@*= Index.
===============================================================================

===============================================================================
@*= Test of typedef.

@f boolean char
@f lstring_head char
@f lstring char
@f string char

@c
typedef enum {
  @!false=0,
  @!true=1
} boolean;
typedef struct {
  int buf_len;
  int cur_len;
} lstring_head;
typedef lstring_head *lstring;
typedef char *string;

@*= Index.
===============================================================================

The last line of the BUGS file is

  ==> Bundled 29 Nov 89; all bugs into patches/008

I think that problem 8 requires a change to webkernel.tex and that problems 9
and 10 reguire changes to the C definition source.  I plan to look at problem
8 later this week.  I'll take a look at problems 9 and 10 when I get around to
creating a Spidery WEB for ANSI C.

If you have any suggestions or fixes, please let me know.

Thanks,
Geoff Alexander

From nr Tue Apr 24 17:05:07 1990
Received: by cs.Princeton.EDU (5.57/1.101)
	id AA08862; Tue, 24 Apr 90 17:04:56 EDT
Date: Tue, 24 Apr 90 17:04:56 EDT
From: Norman Ramsey <nr>
Message-Id: <9004242104.AA08862@cs.Princeton.EDU>
To: alexande@cs.unc.edu
Subject: Re:  3 more SpiderWEB problems
Cc: nr
Status: R

> 
> I have run into three more Spidery WEB problems:
> 
> 8.  Page number may be off by one in table of contents.

This is a problem with the underlying TeX macros (marks, and so on).
I'll be delighted if you can find a fix.

> 9.  Enums not formatted correctly by ceeweave.

enums are not K&R (old-style C).  An ANSI C spider definition is badly
needed, but I don't have funding to produce one.

> 10. Typedefs not formated correctly by ceeweave.  

Only if you believe ``correctly'' == ``what Silvio does.''
The problem is that the logical structure of typedefs follows the
structure of the C program, whereas the formatting is done on the
structure of the WEB source.  There are nasty problems of scoping, and
even doing a botched job requires a two-pass algorithm.

> I tried using @f to redefine them.
>     See second example.  This caused there to be no line break between typedefs
>     and a small white space between the new type and ;.
> 
> ===============================================================================
> @*= Test of typedef.
> 
> @f boolean char
> @f lstring_head char
> @f lstring char
> @f string char

This should be fixable by fiddling the c.spider definition; let me
know how you make out.

> I'll take a look at problems 9 and 10 when I get around to
> creating a Spidery WEB for ANSI C.

Sorry to be so unhelpful, but I have been putting my time into new,
better-designed tools, instead of continually patching web.

Norman

From alexande@cs.unc.edu Tue Apr 24 21:51:59 1990
Received: by cs.Princeton.EDU (5.57/1.101)
	id AA11728; Tue, 24 Apr 90 21:51:55 EDT
Received: from bashful.cs.unc.edu by mcnc.mcnc.org (5.59/MCNC/5-16-88)
	id AA00785; Tue, 24 Apr 90 21:50:54 EDT
Received: from fillmore.cs.unc.edu by bashful.cs.unc.edu (5.61/UNC_02-28-90)
	id AA23752; Tue, 24 Apr 90 21:50:29 -0400
Received: by fillmore.cs.unc.edu (5.61/UNC_02-28-90)
	id AA01306; Tue, 24 Apr 90 21:50:20 -0400
Date: Tue, 24 Apr 90 21:50:20 -0400
From: Geoffrey D. Alexander <alexande@cs.unc.edu>
Message-Id: <9004250150.AA01306@fillmore.cs.unc.edu>
To: nr@cs
Subject: Some Spidery WEB fixes
Cc: alexande@cs.unc.edu
Status: R

Norman,

I have fixed some of the Spidery WEB problem is snet you.  First, a fix for the
"code in a module name" problem (this also allows italic text in a module
name).  This fix involves two changes to webkernel.tex:

Initialize \DC:
===== old =====================================================================
\def\CD{\relax\ifmmode\let\DC\egroup\hbox\bgroup\else\let\DC\relax\fi}
===== new =====================================================================
\def\CD{\relax\ifmmode\let\DC\egroup\hbox\bgroup\else\let\DC\relax\fi}
\let\DC\relax
===============================================================================

Move the he code that writes "\catcode`@=11" to the toc file:
===== old =====================================================================
\newwrite\cont
\output{\setbox0=\page % the first page is garbage
  \openout\cont=\contentsfile
  \global\output{\normaloutput\page\lheader\rheader\lfooter\rfooter}}
\setpage
\vbox to \vsize{} % the first \topmark won't be null
% Delete as per bug report from kademan@stat.wisc.edu
% Causes headings on first page to be missing
% \eject
\write\cont{\string\catcode`\string\@=11}% a hack to make contents
					 % take stuff in \.{---}
===== new =====================================================================
\newwrite\cont
\output{\setbox0=\page % the first page is garbage
  \openout\cont=\contentsfile
  \write\cont{\string\catcode`\string\@=11} 	% a hack to make contents
						% take stuff in \.{---}
  \global\output{\normaloutput\page\lheader\rheader\lfooter\rfooter}}
\setpage
\vbox to \vsize{} % the first \topmark won't be null
% Delete as per bug report from kademan@stat.wisc.edu
% Causes headings on first page to be missing
% \eject
===============================================================================

Next, a fix for the "module name in running head" problem.  This fix makes the
module name in the running head change only a "page eject" module is
encountered.  This fix involves a a single change.  

Move the code that sets \rhead from \N to the \headcheck.
=== old \N ====================================================================
\outer\def\N#1.#2.{\MN#1.\headcheck#2\headcheck
  \edef\rhead{\uppercase{\ignorespaces\themodtitle}} % define running headline
  \message{*\modno} % progress report
  \edef\next{\write\cont{\thetocskip
	\Z{\theopen\relax
		\themodtitle}{\modno}{\the\pageno}}}\next % to contents file
  \ifon\startsection{\bf\ignorespaces\themodtitle.\quad}\ignorespaces}
=== new \N (includes third fix) ===============================================
\outer\def\N#1.#2.{\MN#1.\headcheck#2\headcheck
  \message{*\modno} % progress report
  \edef\next{\write\cont{\thetocskip\Z{\theopen\relax
	\themodtitle}{\modno}{\noexpand\the\pageno}}}\next % to contents file
  \ifon\startsection{\bf\ignorespaces\themodtitle.\quad}\ignorespaces}
===============================================================================

=== old \headcheck ============================================================
\def\headcheck#1#2\headcheck{%
	\makethechar{#1}%
	\def\theskipper{\vfil\penalty-100\vfilneg\vskip12ptminus3pt}%
				% skip before new module
	\def\theopen{}% opening skip in toc entry
	\def\thetocskip{}% vertical skip before toc entry
	\def\themodtitle{{#2}}
	\ifnextchar={%
		\def\theskipper{\vfil\eject}%
		\canceltrue
		\def\theopen{\bf}%
		\def\thetocskip{\vskip3ptplus1in\penalty-100
			\vskip0ptplus-1in}%
	}{\ifnextchar1{%
		\cancelfalse
		\def\theskipper{\vfil\eject}%
		\def\theopen{\hskip2em}%
	}{\ifnextchar2{%
		\cancelfalse
		\def\theopen{\hskip2em}%
	}{\ifnextchar3{%
		\cancelfalse
		\def\theskipper{\vfil\eject}%
		\def\theopen{\hskip4em}%
	}{\ifnextchar4{%
		\cancelfalse
		\def\theopen{\hskip4em}%
	}{% else 
		\ifcancel\else
			\def\theskipper{\vfil\eject}%
		\fi
		\cancelfalse
		\def\themodtitle{#1{#2}}%
	}}}}}%
	\theskipper
}
=== new \headcheck ============================================================
\def\headcheck#1#2\headcheck{%
	\makethechar{#1}%
	\def\theskipper{\vfil\penalty-100\vfilneg\vskip12ptminus3pt}%
				% skip before new module
	\def\theopen{}% opening skip in toc entry
	\def\thetocskip{}% vertical skip before toc entry
	\def\themodtitle{{#2}}
	\ifnextchar={%
      		\def\theskipper{\vfil\eject%
				\edef\rhead{\uppercase{\ignorespaces%
					\themodtitle}}}%
		\canceltrue
		\def\theopen{\bf}%
		\def\thetocskip{\vskip3ptplus1in\penalty-100
			\vskip0ptplus-1in}%
	}{\ifnextchar1{%
		\cancelfalse
      		\def\theskipper{\vfil\eject%
				\edef\rhead{\uppercase{\ignorespaces%
					\themodtitle}}}%
		\def\theopen{\hskip2em}%
	}{\ifnextchar2{%
		\cancelfalse
		\def\theopen{\hskip2em}%
	}{\ifnextchar3{%
		\cancelfalse
      		\def\theskipper{\vfil\eject%
				\edef\rhead{\uppercase{\ignorespaces%
					\themodtitle}}}%
		\def\theopen{\hskip4em}%
	}{\ifnextchar4{%
		\cancelfalse
		\def\theopen{\hskip4em}%
	}{% else 
		\ifcancel\else
	      		\def\theskipper{\vfil\eject%
					\edef\rhead{\uppercase{\ignorespaces%
						\themodtitle}}}%
		\fi
		\cancelfalse
		\def\themodtitle{#1{#2}}%
	}}}}}%
	\theskipper
}
===============================================================================

Last, a fix for the "table of contents page number off by one" problem.  This
invloves a single change to webkernel.tex:

Add \noexpand before \the\pageno in \N.
=== old \N ====================================================================
\outer\def\N#1.#2.{\MN#1.\headcheck#2\headcheck
  \edef\rhead{\uppercase{\ignorespaces\themodtitle}} % define running headline
  \message{*\modno} % progress report
  \edef\next{\write\cont{\thetocskip
	\Z{\theopen\relax
		\themodtitle}{\modno}{\the\pageno}}}\next % to contents file
  \ifon\startsection{\bf\ignorespaces\themodtitle.\quad}\ignorespaces}
=== new \N (includes second fix) ==============================================
\outer\def\N#1.#2.{\MN#1.\headcheck#2\headcheck
  \message{*\modno} % progress report
  \edef\next{\write\cont{\thetocskip\Z{\theopen\relax
	\themodtitle}{\modno}{\noexpand\the\pageno}}}\next % to contents file
  \ifon\startsection{\bf\ignorespaces\themodtitle.\quad}\ignorespaces}
===============================================================================

Note that there are two distinct changes to \N (one for the second fix and one
for the third fix).  Feel free to make the changes to the distributed
webkernel.tex.  If you have any questions or you have problems with any of the
fixes, please let me know.

Geoff Alexander

From alexande@cs.unc.edu Tue Apr 24 21:51:59 1990
Received: by cs.Princeton.EDU (5.57/1.101)
	id AA11728; Tue, 24 Apr 90 21:51:55 EDT
Received: from bashful.cs.unc.edu by mcnc.mcnc.org (5.59/MCNC/5-16-88)
	id AA00785; Tue, 24 Apr 90 21:50:54 EDT
Received: from fillmore.cs.unc.edu by bashful.cs.unc.edu (5.61/UNC_02-28-90)
	id AA23752; Tue, 24 Apr 90 21:50:29 -0400
Received: by fillmore.cs.unc.edu (5.61/UNC_02-28-90)
	id AA01306; Tue, 24 Apr 90 21:50:20 -0400
Date: Tue, 24 Apr 90 21:50:20 -0400
From: Geoffrey D. Alexander <alexande@cs.unc.edu>
Message-Id: <9004250150.AA01306@fillmore.cs.unc.edu>
To: nr@cs
Subject: Some Spidery WEB fixes
Cc: alexande@cs.unc.edu
Status: RO

Norman,

I have fixed some of the Spidery WEB problem is snet you.  First, a fix for the
"code in a module name" problem (this also allows italic text in a module
name).  This fix involves two changes to webkernel.tex:

Initialize \DC:
===== old =====================================================================
\def\CD{\relax\ifmmode\let\DC\egroup\hbox\bgroup\else\let\DC\relax\fi}
===== new =====================================================================
\def\CD{\relax\ifmmode\let\DC\egroup\hbox\bgroup\else\let\DC\relax\fi}
\let\DC\relax
===============================================================================

Move the he code that writes "\catcode`@=11" to the toc file:
===== old =====================================================================
\newwrite\cont
\output{\setbox0=\page % the first page is garbage
  \openout\cont=\contentsfile
  \global\output{\normaloutput\page\lheader\rheader\lfooter\rfooter}}
\setpage
\vbox to \vsize{} % the first \topmark won't be null
% Delete as per bug report from kademan@stat.wisc.edu
% Causes headings on first page to be missing
% \eject
\write\cont{\string\catcode`\string\@=11}% a hack to make contents
					 % take stuff in \.{---}
===== new =====================================================================
\newwrite\cont
\output{\setbox0=\page % the first page is garbage
  \openout\cont=\contentsfile
  \write\cont{\string\catcode`\string\@=11} 	% a hack to make contents
						% take stuff in \.{---}
  \global\output{\normaloutput\page\lheader\rheader\lfooter\rfooter}}
\setpage
\vbox to \vsize{} % the first \topmark won't be null
% Delete as per bug report from kademan@stat.wisc.edu
% Causes headings on first page to be missing
% \eject
===============================================================================

Next, a fix for the "module name in running head" problem.  This fix makes the
module name in the running head change only a "page eject" module is
encountered.  This fix involves a a single change.  

Move the code that sets \rhead from \N to the \headcheck.
=== old \N ====================================================================
\outer\def\N#1.#2.{\MN#1.\headcheck#2\headcheck
  \edef\rhead{\uppercase{\ignorespaces\themodtitle}} % define running headline
  \message{*\modno} % progress report
  \edef\next{\write\cont{\thetocskip
	\Z{\theopen\relax
		\themodtitle}{\modno}{\the\pageno}}}\next % to contents file
  \ifon\startsection{\bf\ignorespaces\themodtitle.\quad}\ignorespaces}
=== new \N (includes third fix) ===============================================
\outer\def\N#1.#2.{\MN#1.\headcheck#2\headcheck
  \message{*\modno} % progress report
  \edef\next{\write\cont{\thetocskip\Z{\theopen\relax
	\themodtitle}{\modno}{\noexpand\the\pageno}}}\next % to contents file
  \ifon\startsection{\bf\ignorespaces\themodtitle.\quad}\ignorespaces}
===============================================================================

=== old \headcheck ============================================================
\def\headcheck#1#2\headcheck{%
	\makethechar{#1}%
	\def\theskipper{\vfil\penalty-100\vfilneg\vskip12ptminus3pt}%
				% skip before new module
	\def\theopen{}% opening skip in toc entry
	\def\thetocskip{}% vertical skip before toc entry
	\def\themodtitle{{#2}}
	\ifnextchar={%
		\def\theskipper{\vfil\eject}%
		\canceltrue
		\def\theopen{\bf}%
		\def\thetocskip{\vskip3ptplus1in\penalty-100
			\vskip0ptplus-1in}%
	}{\ifnextchar1{%
		\cancelfalse
		\def\theskipper{\vfil\eject}%
		\def\theopen{\hskip2em}%
	}{\ifnextchar2{%
		\cancelfalse
		\def\theopen{\hskip2em}%
	}{\ifnextchar3{%
		\cancelfalse
		\def\theskipper{\vfil\eject}%
		\def\theopen{\hskip4em}%
	}{\ifnextchar4{%
		\cancelfalse
		\def\theopen{\hskip4em}%
	}{% else 
		\ifcancel\else
			\def\theskipper{\vfil\eject}%
		\fi
		\cancelfalse
		\def\themodtitle{#1{#2}}%
	}}}}}%
	\theskipper
}
=== new \headcheck ============================================================
\def\headcheck#1#2\headcheck{%
	\makethechar{#1}%
	\def\theskipper{\vfil\penalty-100\vfilneg\vskip12ptminus3pt}%
				% skip before new module
	\def\theopen{}% opening skip in toc entry
	\def\thetocskip{}% vertical skip before toc entry
	\def\themodtitle{{#2}}
	\ifnextchar={%
      		\def\theskipper{\vfil\eject%
				\edef\rhead{\uppercase{\ignorespaces%
					\themodtitle}}}%
		\canceltrue
		\def\theopen{\bf}%
		\def\thetocskip{\vskip3ptplus1in\penalty-100
			\vskip0ptplus-1in}%
	}{\ifnextchar1{%
		\cancelfalse
      		\def\theskipper{\vfil\eject%
				\edef\rhead{\uppercase{\ignorespaces%
					\themodtitle}}}%
		\def\theopen{\hskip2em}%
	}{\ifnextchar2{%
		\cancelfalse
		\def\theopen{\hskip2em}%
	}{\ifnextchar3{%
		\cancelfalse
      		\def\theskipper{\vfil\eject%
				\edef\rhead{\uppercase{\ignorespaces%
					\themodtitle}}}%
		\def\theopen{\hskip4em}%
	}{\ifnextchar4{%
		\cancelfalse
		\def\theopen{\hskip4em}%
	}{% else 
		\ifcancel\else
	      		\def\theskipper{\vfil\eject%
					\edef\rhead{\uppercase{\ignorespaces%
						\themodtitle}}}%
		\fi
		\cancelfalse
		\def\themodtitle{#1{#2}}%
	}}}}}%
	\theskipper
}
===============================================================================

Last, a fix for the "table of contents page number off by one" problem.  This
invloves a single change to webkernel.tex:

Add \noexpand before \the\pageno in \N.
=== old \N ====================================================================
\outer\def\N#1.#2.{\MN#1.\headcheck#2\headcheck
  \edef\rhead{\uppercase{\ignorespaces\themodtitle}} % define running headline
  \message{*\modno} % progress report
  \edef\next{\write\cont{\thetocskip
	\Z{\theopen\relax
		\themodtitle}{\modno}{\the\pageno}}}\next % to contents file
  \ifon\startsection{\bf\ignorespaces\themodtitle.\quad}\ignorespaces}
=== new \N (includes second fix) ==============================================
\outer\def\N#1.#2.{\MN#1.\headcheck#2\headcheck
  \message{*\modno} % progress report
  \edef\next{\write\cont{\thetocskip\Z{\theopen\relax
	\themodtitle}{\modno}{\noexpand\the\pageno}}}\next % to contents file
  \ifon\startsection{\bf\ignorespaces\themodtitle.\quad}\ignorespaces}
===============================================================================

Note that there are two distinct changes to \N (one for the second fix and one
for the third fix).  Feel free to make the changes to the distributed
webkernel.tex.  If you have any questions or you have problems with any of the
fixes, please let me know.

Geoff Alexander