fw_src/ 755 0 0 0 6717573523 5307 5fw_src/0veracty.vsf 644 0 0 55056 6717573362 7620 +--------------------------------------------------------------------------+ |V E R A C I T Y S N A P S H O T | | V E R A C I T Y S N A P S H O T | | V E R A C I T Y S N A P S H O T | | V E R A C I T Y S N A P S H O T | | V E R A C I T Y S N A P S H O T | | V E R A C I T Y S N A P S H O T | | V E R A C I T Y S N A P S H O T | | V E R A C I T Y S N A P S H O T | | V E R A C I T Y S N A P S H O T | | V E R A C I T Y S N A P S H O T | | V E R A C I T Y S N A P S H O T | | V E R A C I T Y S N A P S H O T | +--------------------------------------------------------------------------+ | | | This snapshot file was generated by the VERACITY data integrity tool | | and contains information about a directory tree, such as the structure | | of the tree and the checksums of its files. To use Veracity to check a | | directory tree against this snapshot file, give the command: | | | | veracity check | | | | For more information on Veracity, including The Veracity Snapshot | | Standard, which defines the format of this file, see www.veracity.com. | | | | Veracity is a product of Rocksoft: | | | | Company : Rocksoft Pty Ltd | | Phone : +61 8 8232-6262 | | Fax : +61 8 8232-6264 | | Email : rocksoft@rocksoft.com | | WWW : http://www.rocksoft.com/ | | WWW : http://www.veracity.com/ | | Postal : PO Box 3066, Rundle Mall SA 5000, Australia. | | ACN : 008-280-153 (Australian Company Number). | | Date : This information is current as at January 1999. | | VERACITY and ROCKSOFT are trademarks of Rocksoft Pty Ltd. | | | | Note: Veracity ignores any text before the opening marker and after the | | closing marker of the snapshot file. This means that you can delete this | | header and add any text of your own. Similarly, electronic mail messages | | containing snapshots can be used directly without having to delete | | extraneous text first. | | | +--------------------------------------------------------------------------+ ?+S=====(SNAPSHOT1.0)===== ( (Content=DirectoryTree) (Version=3.0) (Grade=Standard) (Writer=Veracity/V2.0/Macintosh) (Salt='zSuampoFpz6Jf3LfZVlxAAA) (StartDateTime=16-May-1999^16:48.31^+0930) ) ( (ClipList='-'-'-'-'-'LBeginClipListV1'R'-'-'-'-'-'+"#*"^-*->^+create^+delet e'+"#*"^-f->^+T.md5^+no_text_warnings'+"/&0veracty.v%f~"^-f->^-all'+"/&vera city_v*"^^^-f->^-all'+'-'-'-'-'-'LEndClipList'R'-'-'-'-'-'+ ) ) ((T=D)(N=Root)(L)) ((C.md5='zIQh4inDnaLI/ZUtqkcUSLg)) ?+0=====()===== ((Cycle=0)(Num=11)) ((C.md5='zYm5/BdW+fp0gQ7tNQOcC/g)) ((T=D)(N=admin)(L)) ((T=D)(N=answers)(L)) ((T=D)(N=results)(L)) ((T=D)(N=scripts)(L)) ((T=D)(N=source)(L)) ((T=D)(N=tests)(L)) ((T=F)(N=0veracty.v0f)) ((T=F)(N=0veracty.vcf)) ((T=F)(N=0veracty.vrf)) ((T=F)(N=0veracty.vsf)) ((T=F)(N=Veracity_v2.0)) ()((C.md5='zaozWsskVutna/8pAofYhHQ)) ?+1=====(admin)===== ((Cycle=0)(Num=3)) ((C.md5='zfclmm7KomEovPKBp7JHoYA)) ((T=F)(N=0build.txt) (T.md5='zGmk8V115zXaT5WgXF0JrZw)) ((T=F)(N=0readme.txt) (T.md5='zVjtg+q5mJey+Aed4nwb6Ow)) ((T=F)(N=gnu2.txt) (T.md5='z4Zw+coZX2sG16Py/zv42lg)) ()((C.md5='z4UsdkjB8UKiN30hIffrCRQ)) ()((C.md5='zSwdO3LmNPuJk01zcnnv3zg)) ?-1-----(admin)----- ?+1=====(answers)===== ((Cycle=0)(Num=146)) ((C.md5='zJTFaqoJAg5YJOZnALN5zMA)) ((T=F)(N=an01.lis) (T.md5='z+bbMeVRr59qOiT8JQvv3LQ)) ((T=F)(N=an02.lis) (T.md5='zoUcnZx41cGRW1Y28OIQczg)) ((T=F)(N=an03.lis) (T.md5='zJCx1DBAxR+Po9dU8QwpghA)) ((T=F)(N=an04.lis) (T.md5='zWW0zGPjSimJeBgNouosADQ)) ((T=F)(N=an05.lis) (T.md5='z20woBShLcKRg7joYJbNVNA)) ((T=F)(N=ex01.lis) (T.md5='zTdok4zY95FNctZPy7X3jyw)) ((T=F)(N=ex01.out) (T.md5='zGCvXOGISPasSs5n3PWVYcw)) ((T=F)(N=ex02.lis) (T.md5='zHXodfLkFYpsq5hDn7YRQYA)) ((T=F)(N=ex02.out) (T.md5='zGCvXOGISPasSs5n3PWVYcw)) ((T=F)(N=ex03.lis) (T.md5='zLv2inPOdnix5yF6eqiDTWA)) ((T=F)(N=ex04.lis) (T.md5='zkh3tLeyhmRnxe4CtTnztSg)) ((T=F)(N=ex04.out) (T.md5='zFiS9neBpOM/r9EnxNDTT0w)) ((T=F)(N=ex05.lis) (T.md5='zE8zALg9ILxnUilb85gKPHA)) ((T=F)(N=ex05.out) (T.md5='z9/xchctXlH8lxgd8uUxZ4w)) ((T=F)(N=ex06.lis) (T.md5='zoCwJq6dDTehEm6ZMmC2UPw)) ((T=F)(N=ex06.out) (T.md5='zfRZkhxHtAAVpclJlhaLzMw)) ((T=F)(N=ex07.lis) (T.md5='zk8UJCRZExtgPKsbNQp0pxw)) ((T=F)(N=ex07.out) (T.md5='zbldctSTpUjbMX6N6i6qLkA)) ((T=F)(N=ex08.lis) (T.md5='zOoy+qUfIi/IS4YXaNUwDkw)) ((T=F)(N=ex08.out) (T.md5='zQ4yFDGcyCMQIkwilIQdXGw)) ((T=F)(N=ex09.lis) (T.md5='zsw3yXU5muh6aTH6JnnlXcw)) ((T=F)(N=ex09.out) (T.md5='zEVDdSpPt/f86/XSgqzagKg)) ((T=F)(N=ex10.lis) (T.md5='zs+i+xRM4mOSJlOZJAdOYKQ)) ((T=F)(N=ex10.out) (T.md5='zi9e6Gy3T87SnNb5jJq2LYQ)) ((T=F)(N=ex11.htm) (T.md5='zVm0x52QpBoXN/cO7tilBRw)) ((T=F)(N=ex11.lis) (T.md5='zO6VP3cI3ArNG4Bq3gnAa2Q)) ((T=F)(N=ex11.tex) (T.md5='zcfhlWY5gxtcw5oWk1+R4Ig)) ((T=F)(N=ex12.htm) (T.md5='zuKHOTM6cRW/alvlMVe8VkQ)) ((T=F)(N=ex12.lis) (T.md5='zO6VP3cI3ArNG4Bq3gnAa2Q)) ((T=F)(N=ex12.tex) (T.md5='zmTaRHEuLQJ6SONVb78zYRA)) ((T=F)(N=ex13.htm) (T.md5='z27LyeTKYco3fhAzmY6VyeQ)) ((T=F)(N=ex13.lis) (T.md5='zO6VP3cI3ArNG4Bq3gnAa2Q)) ((T=F)(N=ex13.tex) (T.md5='zDfuYuoc5eM08l9Q57InuqQ)) ((T=F)(N=ex14.htm) (T.md5='zRpXlCMsGHQsZztcYevWMrg)) ((T=F)(N=ex14.lis) (T.md5='zO6VP3cI3ArNG4Bq3gnAa2Q)) ((T=F)(N=ex14.tex) (T.md5='zLtUhU4ts2lwouZgGGHo7Mg)) ((T=F)(N=ex15.htm) (T.md5='zDIwitxQEVChlT860Nt5Yag)) ((T=F)(N=ex15.lis) (T.md5='zO6VP3cI3ArNG4Bq3gnAa2Q)) ((T=F)(N=ex15.tex) (T.md5='zLw+n4ppY/gY35L8Hy24Sjg)) ((T=F)(N=ex16.lis) (T.md5='zoXuNoYP/ne7kIFbaj5DVJg)) ((T=F)(N=ex16.out) (T.md5='ziPuGHY4/bv5LyWNEkBoVCA)) ((T=F)(N=ex16.tex) (T.md5='zFigbpM+PN/pEKlWHIbJKiA)) ((T=F)(N=generate.lis) (T.md5='zrHOHWAHikBMfcwQws5+gSQ)) ((T=F)(N=hi01.lis) (T.md5='zxess8CYZnrh0XM7EJA9NPw)) ((T=F)(N=hi01.out) (T.md5='zHWSHCyRcAd5y6xSH7VrT1g)) ((T=F)(N=hi02.lis) (T.md5='zrNfdjGKc1gVWYwSfajcZSg)) ((T=F)(N=hi02.out) (T.md5='znbjkH4pwgXxNh+nUsp1XZw)) ((T=F)(N=hi03.lis) (T.md5='ziagI9R8dvnX9Y96f5N0fvg)) ((T=F)(N=hi03.out) (T.md5='z1B6u5BxFND2nS0+x+uKY2g)) ((T=F)(N=hi04.lis) (T.md5='zbBhHEQpJtwb0KJzbCXSm2Q)) ((T=F)(N=hi04.out) (T.md5='zwgw9wYbbx8UAvouvQBIvpA)) ((T=F)(N=hi05.lis) (T.md5='zs7bO78lKNjq7XF41MXc/wA)) ((T=F)(N=hi05.out) (T.md5='zuFaS1y3riV9N27tjFr1+5w)) ((T=F)(N=hi06.lis) (T.md5='zK+Yu/bIvVvdBXtcmOZuaaw)) ((T=F)(N=hi06a.out) (T.md5='zQYDRAFWS3e7ozHbUmNJkHQ)) ((T=F)(N=hi06b.out) (T.md5='z7bfLIcB2TLV+f/fYqUVohw)) ((T=F)(N=hi07.lis) (T.md5='zQuXXlmR5emqwvbYxjtGYFw)) ((T=F)(N=hi07a.out) (T.md5='zmVLSfYm4FVGUFKNur9Y8Pw)) ((T=F)(N=hi07b.out) (T.md5='z4ReUXP2YYHQOz1Vk/tj8ZA)) ((T=F)(N=hi08.lis) (T.md5='zX7PY+skPrSQN7kdFSWmWJA)) ((T=F)(N=hi08.out) (T.md5='zQBugoF+3/3zrXlS9PEfqYw)) ((T=F)(N=hi09.lis) (T.md5='zj0gK4Fig5AvYO3RZHR2TSw)) ((T=F)(N=hi09.out) (T.md5='zxyU8sm79sTSlraUcLCba3A)) ((T=F)(N=hi10.lis) (T.md5='znf+S27R/t8MTNd5eHklp9Q)) ((T=F)(N=hi10.out) (T.md5='zSWPHa0JVUP6U5HSGCbu73w)) ((T=F)(N=pr01.lis) (T.md5='z4MxIL0q1k8eLWVJx3i7ITQ)) ((T=F)(N=pr02.lis) (T.md5='zLLTMsdQkGPhm6y3UdLFzyQ)) ((T=F)(N=pr03.lis) (T.md5='zJC8qSZXMahpXZQccFaSEig)) ((T=F)(N=pr04.lis) (T.md5='zCIo8hcm6ho2dYhI0E+j5PA)) ((T=F)(N=pr05.lis) (T.md5='z1nK5Nbaj5mjmIP++ZUbZ7A)) ((T=F)(N=pr06.lis) (T.md5='zWQUxaZu7IQ2iuuOTfOCgRQ)) ((T=F)(N=pr07.lis) (T.md5='zZkldFW3zILeIfPf71+2Scw)) ((T=F)(N=pr08.lis) (T.md5='zx9YnOfpgczYAysv2JmEVFA)) ((T=F)(N=pr09.lis) (T.md5='zhS2841c9QlWhvvfUDl38HA)) ((T=F)(N=pr10.lis) (T.md5='zyot3DwZ3f1zEYD7pdRfipw)) ((T=F)(N=pr11.lis) (T.md5='zA+NpWW/uhqEYv2SMt34x1g)) ((T=F)(N=sc01.lis) (T.md5='zxrEF26wEbSGTWU3oYMorOg)) ((T=F)(N=sc02.lis) (T.md5='zZts1uDbFWmH5uRp1qmwBvQ)) ((T=F)(N=sc03.lis) (T.md5='zaAPcrrE2AcVSIkD5+er0iA)) ((T=F)(N=sc04.lis) (T.md5='zWOknwEALcFNaPLrGkkYu0Q)) ((T=F)(N=sc05.lis) (T.md5='zDLPigMIESCtA96+Fny+oZQ)) ((T=F)(N=sc06.lis) (T.md5='zhT9BcSv9c77SmcAr7f8thw)) ((T=F)(N=sc07.lis) (T.md5='zqHh7P+fvvL1JYG2IHXB8+Q)) ((T=F)(N=sc08.lis) (T.md5='zsyM/scuodNCEOpIBScY0+w)) ((T=F)(N=sc09.lis) (T.md5='zyBh8xosJXypx7VIiQJqvRg)) ((T=F)(N=sc10.lis) (T.md5='zvdhjnMc9dzFqpfmAem2esg)) ((T=F)(N=sc11.lis) (T.md5='z5XYmmS5ZB+++WrJ3s05SCg)) ((T=F)(N=sc12.lis) (T.md5='zWWBsapBMXTPVTFYTUPhMxg)) ((T=F)(N=sc13.lis) (T.md5='zfw8xPkYBDJSuY2Uwishbig)) ((T=F)(N=sc14.lis) (T.md5='zwyqz5fUggl2DYNcX7p6J5A)) ((T=F)(N=sc15.lis) (T.md5='zv+CbkwuD+t2vF0LwN08+4Q)) ((T=F)(N=sc16.lis) (T.md5='zgQXxn2lee+KksKho0NBKsg)) ((T=F)(N=sc17.lis) (T.md5='zfN4BLwKmbkpAUVvVe8gtDA)) ((T=F)(N=sc18.lis) (T.md5='zo6fpvZ2OQDAsMkO9ZBdzRQ)) ((T=F)(N=sc19.lis) (T.md5='zSQgo2b1/6svkahapYGP21A)) ((T=F)(N=sc20.lis) (T.md5='zjdrSRtLE9RzOE+yL8Pw00g)) ((T=F)(N=sc21.lis) (T.md5='zAxns4XMD/wIPZNY2wgItWA)) ((T=F)(N=sc22.lis) (T.md5='z/pSCEMyyxf6Hv/eHyIMy6w)) ((T=F)(N=sc23.lis) (T.md5='z/7fjpyaM3QikiaIfNCD3Vw)) ((T=F)(N=sc24.lis) (T.md5='zYu9o0T2QbnPat69b3BAunA)) ((T=F)(N=sc25.lis) (T.md5='zXUtuXUrd8W7hs6teOL1Upw)) ((T=F)(N=sc26.lis) (T.md5='zblIXxDqIhXq/dGU5PX44Lg)) ((T=F)(N=sc27.lis) (T.md5='zIRNnUEVQuMvC/fMmTqo7Og)) ((T=F)(N=sc28.lis) (T.md5='zEhEWxNLNJcauhPZtnTKCvw)) ((T=F)(N=sc29.lis) (T.md5='zBRforEo+SFyKuZHzTZ2zsg)) ((T=F)(N=tg01.lis) (T.md5='zJF069BMxZYWG6qRkC5R+bQ)) ((T=F)(N=tg01.out) (T.md5='zOwuqK0lAJC3dg2hMF0RWlw)) ((T=F)(N=tg02.lis) (T.md5='zN9T2z2GwDwLvkTnk/exXEg)) ((T=F)(N=tg02.out) (T.md5='zKthbtR2GTdVC2pLoVkGURw)) ((T=F)(N=tg03.lis) (T.md5='zpFqTzhQBN0E0ZUDBVVrv7A)) ((T=F)(N=tg03.out) (T.md5='zr+V23wXevUo4CiNJexBvVQ)) ((T=F)(N=tg04.lis) (T.md5='z4utqNuHk8fo1FIrvqh3MqA)) ((T=F)(N=tg04.out) (T.md5='zP2OC+amPSwaoPhKQG8TDpw)) ((T=F)(N=tg05.lis) (T.md5='zDIcNg2zqMRWLbCkes+3N9g)) ((T=F)(N=tg05.out) (T.md5='zcHoUy4MbmVOfhRnO/KhKkA)) ((T=F)(N=tg06.lis) (T.md5='zW+ce9hrHV4G+n1iF1v50dA)) ((T=F)(N=tg06.out) (T.md5='z1BSlvE9zxdRkkwceTt0roA)) ((T=F)(N=tg07.lis) (T.md5='z1MUdtbNNL/Z5Q1qd1yG41g)) ((T=F)(N=tg07.out) (T.md5='zw8n5n4bpslqwIAkH8p00fA)) ((T=F)(N=tg08.lis) (T.md5='zef1sAHQZdKMb2L+tMYqXTA)) ((T=F)(N=tg08.out) (T.md5='zIrMGMQm5NCVu6qJMc4xyOg)) ((T=F)(N=tg09.lis) (T.md5='zfvyxExqUxCtNCFma5B5KbQ)) ((T=F)(N=tg09.out) (T.md5='zAtFuRHDqSzHlm+M87eGa2g)) ((T=F)(N=tg10.lis) (T.md5='zCYpgbyqcxiAbJVAMqc8N3g)) ((T=F)(N=tg10.out) (T.md5='zsQ4PsKY9zOcVOUkhZfwBFw)) ((T=F)(N=wv01.htm) (T.md5='zcxxgalpRB6qfmO7OWGSPDg)) ((T=F)(N=wv01.lis) (T.md5='zO6VP3cI3ArNG4Bq3gnAa2Q)) ((T=F)(N=wv01.tex) (T.md5='zIBT0NjHoJtYJhlHsnz+dyA)) ((T=F)(N=wv02.htm) (T.md5='z6er/qEnjIOZkCMoY+Tks5A)) ((T=F)(N=wv02.lis) (T.md5='zO6VP3cI3ArNG4Bq3gnAa2Q)) ((T=F)(N=wv02.tex) (T.md5='zPSN7/w1/g+Cu7PVrwnqLng)) ((T=F)(N=wv03.htm) (T.md5='zuG+DFFdYMtYz90QiQ4DyJg)) ((T=F)(N=wv03.lis) (T.md5='zO6VP3cI3ArNG4Bq3gnAa2Q)) ((T=F)(N=wv03.tex) (T.md5='zir7fq2z4zB6pc9WtxNzKnQ)) ((T=F)(N=wv04.htm) (T.md5='zIfwt0EVPcvHx3k85Jr8wbA)) ((T=F)(N=wv04.lis) (T.md5='zO6VP3cI3ArNG4Bq3gnAa2Q)) ((T=F)(N=wv04.tex) (T.md5='zdqpchvitjN76xHaAU34aUw)) ((T=F)(N=wv05.htm) (T.md5='zy/5dcPVe7ZSap6FYtD0oxw)) ((T=F)(N=wv05.lis) (T.md5='zO6VP3cI3ArNG4Bq3gnAa2Q)) ((T=F)(N=wv05.tex) (T.md5='zQBpSwi3p7CgNYRT8LunAGg)) ((T=F)(N=wv06.htm) (T.md5='zrsJ0506kZXQqocLNTfSc3A)) ((T=F)(N=wv06.lis) (T.md5='zrsJ0506kZXQqocLNTfSc3A)) ((T=F)(N=wv06.tex) (T.md5='z5sp/1GBcUKN+KSC/4Wj+ag)) ((T=F)(N=wv07.htm) (T.md5='zGEaXG/QT521zh4k/XVVXQg)) ((T=F)(N=wv07.lis) (T.md5='zO6VP3cI3ArNG4Bq3gnAa2Q)) ((T=F)(N=wv07.tex) (T.md5='z2SsrJlwfNH25AC5d9j77Zg)) ()((C.md5='z3s6GVBEZ2HJshyePW8tcyA)) ()((C.md5='zDxQ0zn4JDPAZMlatokkqzw)) ?-1-----(answers)----- ?+1=====(results)===== ((Cycle=0)(Num=0)) ((C.md5='zfiOKSeNWqbAFB/x7xj68fA)) ()((C.md5='zAGHgN2QdJgiK3qW9IAZM+w)) ()((C.md5='zXWz6+MfDYxffvaBEYQMLdQ)) ?-1-----(results)----- ?+1=====(scripts)===== ((Cycle=0)(Num=9)) ((C.md5='z5j1IeQOnPN04wFoHTNUmcw)) ((T=F)(N=master.fws) (T.md5='zU5xS5HDipRpQBZbIjzGSKw)) ((T=F)(N=test_gen.fws) (T.md5='zO0ZrgKNx8tnZlSpo5mO8eA)) ((T=F)(N=test_l.fws) (T.md5='zRpOlmsAbUIgYn+LUcqhTcw)) ((T=F)(N=test_ld.fws) (T.md5='zKhIPaTbj/xbkwRUjQohrVA)) ((T=F)(N=test_lo.fws) (T.md5='zadluNVxn7lTYMFRY0gqNdw)) ((T=F)(N=test_lo2.fws) (T.md5='zswVhPaBkt1QXg27aqWLCNQ)) ((T=F)(N=test_lot.fws) (T.md5='z4t2vq/8IBZLPeolSZ+MBfw)) ((T=F)(N=test_lt.fws) (T.md5='z5eOGp30rrDGUr9DthUyiYA)) ((T=F)(N=test_lt2.fws) (T.md5='zUIeUWdjHXw2TD3m+hQwq5w)) ()((C.md5='zM87n9TH3KefKgsP9P77XuQ)) ()((C.md5='z4njfiumtpCWOU8QD1H+CWw)) ?-1-----(scripts)----- ?+1=====(source)===== ((Cycle=0)(Num=55)) ((C.md5='zArTt2/g8ahB6eh0P8xaa+A)) ((T=F)(N=analyse.c) (T.md5='znvBr5DfaVgiZhXlSqME4qw)) ((T=F)(N=analyse.h) (T.md5='zVvlKw7ev2kg/aSgNvd3A+A)) ((T=F)(N=as.c) (T.md5='zbowepBQsPW+L04BFMG4H6w)) ((T=F)(N=as.h) (T.md5='zeDZ2JhCcf/s5mZyhSEbcRg)) ((T=F)(N=clock.c) (T.md5='zEA2WvNKpfszMT6Qxe+E6pQ)) ((T=F)(N=clock.h) (T.md5='zpYyY594oTk103IUCteukDw)) ((T=F)(N=command.c) (T.md5='zYXZWcTzKNBMiGFV2dMT8DA)) ((T=F)(N=command.h) (T.md5='zhLC5KDBdYxgGHfG7ABPgEQ)) ((T=F)(N=data.c) (T.md5='z3+JA41VViYlYK0Vs2+U16g)) ((T=F)(N=data.h) (T.md5='zxMPM+W78VDSu/0Rdr52weg)) ((T=F)(N=dump.c) (T.md5='zF4k2//CwnSHcoJ+Q4D5z9A)) ((T=F)(N=dump.h) (T.md5='zZtnVW+yoHt3+ohDL5kpC6g)) ((T=F)(N=environ.h) (T.md5='zBXbO7RuSWFvs6G6gSRpomA)) ((T=F)(N=help.c) (T.md5='zC/f4DTNW6LMvSwRf6sZTzQ)) ((T=F)(N=help.h) (T.md5='zjXcn90gP0hdM1fJzs7SqGg)) ((T=F)(N=help_gnu.c) (T.md5='zOMmFUe8obFb9Y22iNVzaIA)) ((T=F)(N=help_gnu.ctx) (T.md5='z3LPiqG8v67csaNt4B2tt5Q)) ((T=F)(N=help_gnu.h) (T.md5='ziE1t6Ea+qhtLf8uM2EKF3g)) ((T=F)(N=help_gnu.txt) (T.md5='z4Zw+coZX2sG16Py/zv42lg)) ((T=F)(N=list.c) (T.md5='z2+VVg/SQFa3vFBsc5Xt8BA)) ((T=F)(N=list.h) (T.md5='zFnqNCHMx86XwNUb0fDTJiQ)) ((T=F)(N=lister.c) (T.md5='zhTEzi1a0gpfbdWgB73ChjQ)) ((T=F)(N=lister.h) (T.md5='zYdMoPl8bTaZHFKZgb8dN9g)) ((T=F)(N=machin.c) (T.md5='zMnt++OBbAH17v5Gw34BUdA)) ((T=F)(N=machin.h) (T.md5='zMLmqvwVQrs0tSZO5cT/BEg)) ((T=F)(N=main.c) (T.md5='zrSrXhzp/qGIwJ/IpTZCB2Q)) ((T=F)(N=mapper.c) (T.md5='zVHrHhds5M6z/8ZKavs9LVg)) ((T=F)(N=mapper.h) (T.md5='zZmmG5K8V2r+qgOGoWKkY6Q)) ((T=F)(N=memory.c) (T.md5='z6BmAttxbm3Fyvxyfvlo86g)) ((T=F)(N=memory.h) (T.md5='zjDg+k43faHr67NGuAjrKqw)) ((T=F)(N=misc.c) (T.md5='zQ4QxH7dDp97vT/3QYNPa/A)) ((T=F)(N=misc.h) (T.md5='zeDr0lqdkTtkSwXNadIs58Q)) ((T=F)(N=option.c) (T.md5='zQs3VL2cXvghmbz8KmDLjBQ)) ((T=F)(N=option.h) (T.md5='zNHa+k/NhzvQAlg5epbUISw)) ((T=F)(N=parser.c) (T.md5='zUGAhLIdP2iuZWzqdll6rVg)) ((T=F)(N=parser.h) (T.md5='z8v8Jvh3NwjFrFVQiLoSHnQ)) ((T=F)(N=scanner.c) (T.md5='zFazhWOGJcHm5PjJvVb7Hfg)) ((T=F)(N=scanner.h) (T.md5='zcO18rt9UGgChuk9qX4xjlA)) ((T=F)(N=section.c) (T.md5='zBbGMVMhtBeVTy5DbSx1D4Q)) ((T=F)(N=section.h) (T.md5='zytDUIvcwDvYvVfAjs1PfRw)) ((T=F)(N=style.h) (T.md5='znZjMqCxMc/h2rzTG5JJitg)) ((T=F)(N=table.c) (T.md5='zlJGAXbB+iXYr4ObclGswtg)) ((T=F)(N=table.h) (T.md5='z68OfTfDrEEZBUD3HZ6qR1Q)) ((T=F)(N=tangle.c) (T.md5='zuRcvj6c5wuZIjeITxfLlQw)) ((T=F)(N=tangle.h) (T.md5='zzPIvNBR7ZQqrqQlqSm8yqg)) ((T=F)(N=texhead.c) (T.md5='zOXrvs60nZrpPC9SaFNvfCg)) ((T=F)(N=texhead.ctx) (T.md5='zipb3tUcZak2TJk0cAs1Z8Q)) ((T=F)(N=texhead.h) (T.md5='zLGfYR9Dqza3XFMZLqdDyVw)) ((T=F)(N=texhead.tex) (T.md5='zl1vZorIwoqEJ+RFMkOREhg)) ((T=F)(N=weaveh.c) (T.md5='zyOZ0Bn+dQsd43M8mFE+TpA)) ((T=F)(N=weaveh.h) (T.md5='z1XtOigATVwvx9hwP7BHmbw)) ((T=F)(N=weavet.c) (T.md5='zVqLsB3n35gnlb3SHI6dy3w)) ((T=F)(N=weavet.h) (T.md5='z8FGc8o6WyFZt5OCyJ5O8wQ)) ((T=F)(N=writfile.c) (T.md5='z5+0XAtMKVisjrhKVF6YD/Q)) ((T=F)(N=writfile.h) (T.md5='ztow2K7EeS7TiSk5q9C5ZVA)) ()((C.md5='zC4GEFI3+8jLdfIRugDvyug)) ()((C.md5='z2otgf4VyMl/SWiii6XKuxQ)) ?-1-----(source)----- ?+1=====(tests)===== ((Cycle=0)(Num=99)) ((C.md5='z8p5Pr9VzYQvZgGZf8taafw)) ((T=F)(N=an01.fw) (T.md5='zJTngwtV6RZ2U14w31yOnMQ)) ((T=F)(N=an02.fw) (T.md5='zMotKrDXLhuMYjwx2uWyuMw)) ((T=F)(N=an03.fw) (T.md5='z6po6ahPiYJCNCbLCx81Xhw)) ((T=F)(N=an04.fw) (T.md5='zDr+LAlU0ge8PLSKSBMDuPA)) ((T=F)(N=an05.fw) (T.md5='z/FAhp1gKgUuqRK6RgjlDNw)) ((T=F)(N=ex01.fw) (T.md5='zpJ/nhYhioDiLWM2G1l/06Q)) ((T=F)(N=ex02.fw) (T.md5='zl4H6XoXceiOyAbXgC4f88A)) ((T=F)(N=ex03.fw) (T.md5='zyIP19DoE3gHSIYYutHU5zQ)) ((T=F)(N=ex04.fw) (T.md5='zVfX65GBpYrGKbsPaq5LRhQ)) ((T=F)(N=ex05.fw) (T.md5='zHZIzYxP7yjL4ZCCbXDLMrw)) ((T=F)(N=ex06.fw) (T.md5='zFjoB8e9IM9tzQ7QnLGbZ7Q)) ((T=F)(N=ex07.fw) (T.md5='zEu/SA/kxJ6SIMVUbkLYosw)) ((T=F)(N=ex08.fw) (T.md5='zRpTpGO5gJ1V4Q4S3c/LMww)) ((T=F)(N=ex09.fw) (T.md5='zdSl+pNv/PW7MGcaNZcBgXw)) ((T=F)(N=ex09a.fwi) (T.md5='zXrnIvAldvWTWbjfefbx31A)) ((T=F)(N=ex10.fw) (T.md5='zxJY0ZUiT3vO7aloMnfnrwA)) ((T=F)(N=ex10a.fwi) (T.md5='zUALvEa1eWtQ2lG3dK3XhhA)) ((T=F)(N=ex11.fw) (T.md5='zT1TQyEmfrcXrBgzQHwdjtw)) ((T=F)(N=ex12.fw) (T.md5='zjfN5HzAypWWdAQHr1Zae9g)) ((T=F)(N=ex13.fw) (T.md5='zEJvx3K0CkVluMUwACTh4Tw)) ((T=F)(N=ex14.fw) (T.md5='zzh5uHGe4DEYwqq5zeMUQcQ)) ((T=F)(N=ex15.fw) (T.md5='zqMwnmDjOfu5JoU46s2bFEA)) ((T=F)(N=ex16.fw) (T.md5='z/pINDorHZ080iY4XzqzWWg)) ((T=F)(N=generate.fw) (T.md5='zdd9I1GE/khxFe2Ytq4boJg)) ((T=F)(N=hi01.fw) (T.md5='zRc8V1UiXB/4TJJoJtk+YDg)) ((T=F)(N=hi02.fw) (T.md5='zazWCG76R71RrLqXcdZfiAw)) ((T=F)(N=hi03.fw) (T.md5='zO0tLlzDzMo6MgOEuANQ+CA)) ((T=F)(N=hi04.fw) (T.md5='zhe1NURQbmplLBu6Ue9McXg)) ((T=F)(N=hi05.fw) (T.md5='zi0nJUU+4oAFaCM5RVy4Fmw)) ((T=F)(N=hi06.fw) (T.md5='z3goLLDDK0VNCN2dU7IqkAw)) ((T=F)(N=hi07.fw) (T.md5='z6Kzbp3whvSxycBe4WCngnA)) ((T=F)(N=hi08.fw) (T.md5='zhyvfp+ls4rkYUIqQ2tzwog)) ((T=F)(N=hi09.fw) (T.md5='zq1d8ZxKInmUliZWckXB7Fw)) ((T=F)(N=hi10.fw) (T.md5='zltor/9YGmDNTP5gG8ljmFw)) ((T=F)(N=pr01.fw) (T.md5='zyq137A5tw7ZQw1v74Jxlvg)) ((T=F)(N=pr02.fw) (T.md5='zdgh387PCiTx/eo5e8JK7zQ)) ((T=F)(N=pr03.fw) (T.md5='z0Vwqq3fHJx7dAJtqGQePEg)) ((T=F)(N=pr04.fw) (T.md5='z0Xcrpm4Wa2YXBhuo8xQxoQ)) ((T=F)(N=pr05.fw) (T.md5='zju1ouBrGR8gahjG6h5pc4Q)) ((T=F)(N=pr06.fw) (T.md5='zkVZOjVw4fbVMXxCYQ94a5w)) ((T=F)(N=pr07.fw) (T.md5='zkMKcFDBDow0xlCPAsnRd1g)) ((T=F)(N=pr08.fw) (T.md5='zNOuUgU5Ty/9t0X3XpRoVBQ)) ((T=F)(N=pr09.fw) (T.md5='zLrqc5fGnyiPEqJ2Iind9JQ)) ((T=F)(N=pr10.fw) (T.md5='zr5VPfGDMy4wGSZyVNWpANA)) ((T=F)(N=pr11.fw) (T.md5='zntbxUmgr+tmwKnkSNr0axg)) ((T=F)(N=sc01_note.fw) (T.md5='zG/ICCW/gLsecb1jpkRpyxg)) ((T=F)(N=sc02.fw) (T.md5='z1B2M2Y8AsgTpgAmY7PhCfg)) ((T=F)(N=sc03.fw) (T.md5='zu+6Cx9e6d/X+LtaOGJmPKQ)) ((T=F)(N=sc04.fw) (T.md5='zzAOWbrbWE8+zEdda+y69lA)) ((T=F)(N=sc05.fw) (T.md5='z6eQoD5Wh5zxtjbnMPfi17w)) ((T=F)(N=sc06.fw) (T.md5='zX30yuOsdjLRTq25JcEQxiQ)) ((T=F)(N=sc07.fw) (T.md5='zC95VVKmSvWHsH3NFHN2jlA)) ((T=F)(N=sc08.fw) (T.md5='zk/CxF239KFOh59/xuWB+aw)) ((T=F)(N=sc09.fw) (T.md5='z460yT2Hicloz+LrTHVLl/A)) ((T=F)(N=sc10.fw) (T.md5='znUXZgRBdSKodIvEYZ+Babw)) ((T=F)(N=sc11.fw) (T.md5='z4ZYUXR1FLL6l+oJy0zCZDQ)) ((T=F)(N=sc12.fw) (T.md5='zhy9tN0UTfxzmKN87GVMQZQ)) ((T=F)(N=sc13.fw) (T.md5='zo8mZKM+r8U4bAuiVYvTjzw)) ((T=F)(N=sc13a.fwi) (T.md5='z1B2M2Y8AsgTpgAmY7PhCfg)) ((T=F)(N=sc13b.fwi) (T.md5='zu+6Cx9e6d/X+LtaOGJmPKQ)) ((T=F)(N=sc13c.fwi) (T.md5='zzAOWbrbWE8+zEdda+y69lA)) ((T=F)(N=sc13d.fwi) (T.md5='zyLhc2ralGLYJk7DEHLOy4w)) ((T=F)(N=sc13e.fwi) (T.md5='zPvossUneq/UyThwdC6nSjQ)) ((T=F)(N=sc13f.fwi) (T.md5='zrfsdo8Gv5UHb2jZvdM25Fg)) ((T=F)(N=sc14.fw) (T.md5='zCAfNrgczWrq0xPPSPJEDuA)) ((T=F)(N=sc15.fw) (T.md5='zwg6c97sc5sdrBr0E/vP50g)) ((T=F)(N=sc15a.fwi) (T.md5='z4DO/fYqEIgOQtc7QkI2mvA)) ((T=F)(N=sc16.fw) (T.md5='zMcXbcvr9FMMnwBaw5FK8TQ)) ((T=F)(N=sc17.fw) (T.md5='zLZnl/XeI7ut/sOYiXhvleQ)) ((T=F)(N=sc18.fw) (T.md5='zRUU3Ld46O3X9OJlsb207Ag)) ((T=F)(N=sc19.fw) (T.md5='zlS6Dz/u77fb7uGhlRbGyjQ)) ((T=F)(N=sc20.fw) (T.md5='zDVbVmd3SMXHl6Ll5U5YbLA)) ((T=F)(N=sc21.fw) (T.md5='zuvBGLSAdCrB78T1Pzn1PVQ)) ((T=F)(N=sc22.fw) (T.md5='zF9LazLswR8CfBhEoEw7hGw)) ((T=F)(N=sc23.fw) (T.md5='zIthpyGwUBuhiKqC+n4PkKw)) ((T=F)(N=sc24.fw) (T.md5='zFfGRbnEQW1N/O0qhG29I2A)) ((T=F)(N=sc25.fw) (T.md5='z1zOht41Bvc7rBA4ZD6K6gA)) ((T=F)(N=sc26.fw) (T.md5='zyiNtXHA32Xa6dygX04a3QA)) ((T=F)(N=sc27.fw) (T.md5='zq45Sq/quls3qaanzVtnhsg)) ((T=F)(N=sc28.fw) (T.md5='zjwOR5g8pdOqXpng1w24zwg)) ((T=F)(N=sc29.fw) (T.md5='zIvSbp871w9IX5xkMeBteiA)) ((T=F)(N=tg01.fw) (T.md5='zh6R5gbQn+n44lKRfVCXFXQ)) ((T=F)(N=tg02.fw) (T.md5='zVlWpQ6qDEOSvlSBWPOe6Bg)) ((T=F)(N=tg03.fw) (T.md5='z9xIH1iSkRpSELRnV4ebjxw)) ((T=F)(N=tg04.fw) (T.md5='zJPDSd3IKXsFuru7tUspSdQ)) ((T=F)(N=tg05.fw) (T.md5='zYsHWH5G/ApS0tt75Ldl3Pw)) ((T=F)(N=tg06.fw) (T.md5='zueOmxlEquP5jPIPvYnvflw)) ((T=F)(N=tg07.fw) (T.md5='zyFES09ak2LClNb/ARNVthg)) ((T=F)(N=tg08.fw) (T.md5='zZA7PzO88VArzqUprKPtS+A)) ((T=F)(N=tg08a.fwi) (T.md5='zeMHb5JyI50kr7I6mDTmmtg)) ((T=F)(N=tg09.fw) (T.md5='zorvNU+pq/hneAmKl9lQRCg)) ((T=F)(N=tg10.fw) (T.md5='zI0sioaNneQAbKodjX/roUA)) ((T=F)(N=wv01.fw) (T.md5='zMexTyFaAULQyHBepgeVLAg)) ((T=F)(N=wv02.fw) (T.md5='ztPK6JyUAGi+UDDAo6mdt8A)) ((T=F)(N=wv03.fw) (T.md5='zRIYjao/3pRIHANQiAc/gIg)) ((T=F)(N=wv04.fw) (T.md5='zm9O5PW1lh5VD3ZJr9VWCWA)) ((T=F)(N=wv05.fw) (T.md5='zZ3koctx4A8sn4mQZzkTxJg)) ((T=F)(N=wv06.fw) (T.md5='zkQru7uNd4Ty8g+7ceZeNxg)) ((T=F)(N=wv07.fw) (T.md5='zhgF1Blw6GqgriqgVOTrogw)) ()((C.md5='zMb20t13BAY8pj0okS7Fyyg)) ()((C.md5='zS9JUllzWBIcLEsAagB0PzA)) ?-1-----(tests)----- ()((C.md5='zI3YxaB0ZFgEpSIudYyAqEA)) ?-0-----()----- ( (Content=DirectoryTree) (Version=3.0) (Grade=Standard) (Writer=Veracity/V2.0/Macintosh) (Salt='zSuampoFpz6Jf3LfZVlxAAA) (StartDateTime=16-May-1999^16:48.31^+0930) (FinishDateTime=16-May-1999^16:48.50^+0930) ) ( (ClipList='-'-'-'-'-'LBeginClipListV1'R'-'-'-'-'-'+"#*"^-*->^+create^+delet e'+"#*"^-f->^+T.md5^+no_text_warnings'+"/&0veracty.v%f~"^-f->^-all'+"/&vera city_v*"^^^-f->^-all'+'-'-'-'-'-'LEndClipList'R'-'-'-'-'-'+ ) ) ((T=D)(N=Root)(L)) ((C.md5='zQN/VwPAHJPd1omqTxlM+KA)) ?-S-----(SNAPSHOT)----- tokkqzw)) ?-1-----(answers)----- ?+1=====(results)===== ((Cycle=0)(Num=0)) ((C.md5='zfiOKSeNWqbAFB/x7xj68fA)) ()((C.md5='zAGHgN2QdJgiK3qW9IAZM+w)) ()((C.md5='zXWz6+MfDYxffvaBEYQMLdQ)) ?-1-----(results)----- ?+1=====(scripts)===== ((Cycle=0)(Num=9)) ((C.md5='z5j1IeQOnPN04wFoHTNUmcw)) ((T=F)(N=master.fws) (T.md5='zU5xS5HDipRpQBZbIjzGSKw)) ((T=F)(N=test_gen.fws) (T.md5='zO0ZrgKNx8tnZlSpo5mO8eA)) ((T=F)(N=test_l.fws) (T.md5='zRpOlmsAbUIgYn+LUcqhTcw)) ((Tfw_src/admin/ 755 0 0 0 6717571120 6366 5fw_src/admin/0build.txt 644 0 0 700 6717571272 10273 ================================================================================ HOW TO BUILD FUNNELWEB ====================== For information on building FunnelWeb, see the FunnelWeb Developer Manual at: http://www.ross.net/funnelweb/developer/ The manual can also be obtained from the FunnelWeb FTP archive at: ftp://ftp.ross.net/clients/ross/funnelweb/ ================================================================================ (T.md5='ziE1t6Ea+qhtLf8uM2EKF3g)) ((T=F)(N=help_gnu.txt) (T.mdfw_src/admin/0readme.txt 644 0 0 57276 6716652066 10515 ================================================================================ FUNNELWEB V3.2 ============== Date : 13 May 1999. Author : Ross N. Williams (ross@ross.net). WWW : http://www.ross.net/funnelweb/ FTP : ftp://ftp.ross.net/clients/ross/funnelweb/ Copyright : Copyright (c) Ross N. Williams 1992. All rights reserved. What Is FunnelWeb? ------------------ FunnelWeb is a powerful literate-programming macro preprocessor that enables you to weave programs and documentation together. FunnelWeb is a production-quality tool that was specifically engineered for practical everyday use: * Can be used with any programming language. * Runs on most platforms. * Free of charge; entirely non-commercial. * Source available under a GNU licence. * Reference, tutorial, and developer manuals. * Mature and essentially bug-free (released 1992). * Simple; specifically designed to minimize errors. * High speed; doesn't stretch the development cycle. * Generates documentation in HTML and TeX forms. * FunnelWeb user community mailing list. FunnelWeb is also a powerful general purpose text file preparation tool that has found many applications outside the area of literate programming. In particular, FunnelWeb is an excellent tool for the preparation of web sites. For more information visit: http://www.ross.net/funnelweb/ http://www.ross.net/funnelweb/tutorial/ http://www.ross.net/funnelweb/reference/ http://www.ross.net/funnelweb/developer/ Copyright And Licensing ----------------------- Copyright (c) Ross N. Williams 1992. All rights reserved. FunnelWeb is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). FunnelWeb is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. A copy of Version 2 of the GNU General Public License should appear at the end of this readme document. If it does not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA The source code for FunnelWeb is available somewhere within: ftp://ftp.ross.net/clients/ross/funnelweb/ Obtaining FunnelWeb ------------------- The FunnelWeb web is at: http://www.ross.net/funnelweb/ This web contains instructions on how to obtain and install FunnelWeb. If you do not have web access, take a look in the following FTP archive: ftp://ftp.ross.net/clients/ross/funnelweb/ There may be one or more subdirectories named by FunnelWeb version number. Choose the highest version number and look there for the FunnelWeb distribution files. IMPORTANT: The "Win32" version of FunnelWeb is for both "Windows 95" and "Windows NT". Unpacking FunnelWeb ------------------ FunnelWeb is shipped as a single archive file. Here are examples of how to unpack FunnelWeb on various kinds of platforms. The V characters stand for the FunnelWeb version number. Win32 : Use WinZip's GUI to "Extract" the FunnelWeb directory. MS-DOS : pkunzip -d funwvVVV.zip MacOS : Drop funnelweb_vVVV_mac.hqx onto Stuffit Expander. Unix : tar -xf funnelweb_vVVV_solaris.tar OpenVMS : unzip funnelweb_vVVV_vmsvax.zip If all goes well, a small directory tree called "funnelweb" will be created. The directory tree should look something like this: funnelweb - The FunnelWeb directory. 0readme.txt - This document. funnelweb.exe - The FunnelWeb executable. Here's where to find the unpacking utilities. If you can't access these servers, try doing an Archie search for files of similar names to find copies on other servers. They're everywhere. Win32 : http://www.winzip.com/ MS-DOS : ftp://cs.nyu.edu/pub/local/porter/pkunzip.exe MacOS : ftp://ftp.amug.org//pub/info-mac/cmp/stuffit-expander*.hqx OpenVMS : ftp://ftp.wku.edu/vms/unzip.exe (and unzip.alpha_exe). Unix : The tar command is part of Unix. Install The FunnelWeb Executable -------------------------------- Move the FunnelWeb executable to a permanent place on your disk. You can place the FunnelWeb directory anywhere you like. Here are some suggested places: Win32 : C:\FW\ MS-DOS : C:\FW\ MacOS : HardDisk:FunnelWeb:FunnelWeb OpenVMS : SYS$SYSDEVICE:[FUNNELWEB]FUNNELWEB.EXE;1 Unix : /usr/local/bin/fw Make The Executable Available ----------------------------- Make the FunnelWeb executable available for execution in your shell (as the command "fw") by either defining a symbol for it or placing the executable in the "path". Here are some examples of how to do this: Win32 : PATH=%PATH%;C:\FW MS-DOS : PATH=%PATH%;C:\FW MacOS : No action required. OpenVMS : fw == "$sys$sysdevice:[funnelweb]FUNNELWEB.EXE" Unix : alias fw /usr/local/bin/fw or Unix : set path=($path /usr/local/bin) Put the definition in an appropriate login script (e.g. AUTOEXEC.BAT, .login, LOGIN.COM) so that the fw command will be available next time you log in. Set Protections --------------- Under some operating systems, you should set appropriate protections on the executable file so that it can be executed. You should also protect the other files too. Here are some examples: Win32 : Set appropriate protections. Win95 : No action required. MS-DOS : No action required . MacOS : No action required (unless installing on a server). Unix : chmod go=rx /usr/local/bin/fw OpenVMS : set prot=(s:rwed,o:rwed,g:e,w:e) funnelweb.exe More Information ---------------- More information on FunnelWeb can be found at: http://www.ross.net/funnelweb/ http://www.ross.net/funnelweb/tutorial/ http://www.ross.net/funnelweb/reference/ http://www.ross.net/funnelweb/developer/ The next step is to visit the FunnelWeb Tutorial in the tutorial web. ================================================================================ GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ================================================================================ to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of thefw_src/admin/gnu2.txt 644 0 0 43071 5211006126 10012 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ftware interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an execufw_src/answers/ 755 0 0 0 6717354164 6767 5fw_src/answers/an01.lis 644 0 0 507 6717353731 10220 FUNNELWEB LISTING FILE ====================== E: No macros defined. E: No output files specified. Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- There were 2 Errors. you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accefw_src/answers/an02.lis 644 0 0 457 6717353732 10226 FUNNELWEB LISTING FILE ====================== E: No output files specified. Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- There was 1 Error. tent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you fw_src/answers/an03.lis 644 0 0 7210 6717353732 10241 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- 1 1| AN03: Test semantics checking of macros. 2 2| 3 3| First define some macros to call. 4 4| @$@@Z@M@{@} 5 5| @$@@(@1@)@Z@M@{@} 6 6| @$@@(@2@)@Z@M@{@} 7 7| 8 8| 1. Test call to undefined macro. 9 9| @$@@Z==@{@@} Error|...................^Call to undefined macro. 10 10| 11 11| 2. Test calls with wrong number of parameters. 12 12| @$@@Z==@{ 13 13| @ 14 14| @@(@) Error|.^Call has 1 parameter, but the macro |.^definition at line 4 specifies 0 parameters. |.^Note: If your call looks like this: @@(@) then you |.^should be aware that FunnelWeb treats this as a call with |.^a single parameter consisting of the empty string. This |.^is a consequence of parameter delimiters @"@" being optional. 15 15| @@(@,@) Error|.^Call has 2 parameters, but the macro |.^definition at line 4 specifies 0 parameters. 16 16| @ Error|.^Call has 0 parameters, but the macro |.^definition at line 5 specifies 1 parameter. 17 17| @@(@) 18 18| @@(Walrus@,@) Error|.^Call has 2 parameters, but the macro |.^definition at line 5 specifies 1 parameter. 19 19| @@(Sloth@) Error|.^Call has 1 parameter, but the macro |.^definition at line 6 specifies 2 parameters. 20 20| @} 21 21| 22 22| 3. Test call to file macro. 23 23| @O@@{@} |.^This file macro is called one or more times. |.^Each call has been flagged with an error message. 24 24| @$@@Z@{@@} Error|.................^Calls to file macros are not allowed. |.................^Reason: It should be possible to comment out a |.................^file macro without a big fuss. Calling a file macro |.................^just tangles it up in the macro structure, |.................^making it more difficult to comment out later. 25 25| 26 26| 4. Test macro never used and has Z. 27 27| @$@@Z@{@} 28 28| 29 29| 5. Test macro often used and has M. 30 30| @$@@M@{@} 31 31| @$@@Z@{@@@} 32 32| 33 33| 6. Test macro never used and no Z 34 34| @$@@{@} Error|.^This macro is never used (and has no @Z). 35 35| 36 36| 7. Test multiply used and no M. 37 37| @$@@{@} Error|.^This macro is used more than once (and has no @M). 38 38| @$@@Z@{@@@} 39 39| 40 40| 8. Test directly recursive macro. 41 41| @$@@{@@} Error|.^This macro has an infinite expansion. 42 42| 43 43| 9. Test indirectly recursive macro. 44 44| @$@@M@{@@} Error|.^This macro has an infinite expansion. 45 45| @$@@{@@} Error|.^This macro has an infinite expansion. 46 46| 47 47| 10. Test callers of recursive macros. 48 48| @$@@Z@{@@} Error|.^This macro has an infinite expansion. | ------------+------------------------------------------------------------------- There were 13 Errors. Y OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can fw_src/answers/an04.lis 644 0 0 2024 6717353733 10241 FUNNELWEB LISTING FILE ====================== E: No output files specified. Global Local| Input File ------------+------------------------------------------------------------------- 1 1| AN04: Test document list checks. 2 2| 3 3| 1. Test for sections with no names. 4 4| 5 5| @A@ 6 6| @$@@Z@{@} 7 7| 8 8| @A@ 9 9| 10 10| @A 11 11| @$@@Z@{@} 12 12| 13 13| @A This section has no name and no macro to inherit one from. Error|.^This section has no name. |.^You can give it one explicitly (As in @A@) or implicitly by |.^defining a macro (whose name will be inherited) within the section. 14 14| | ------------+------------------------------------------------------------------- There were 2 Errors. onditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; afw_src/answers/an05.lis 644 0 0 1542 6717353734 10247 FUNNELWEB LISTING FILE ====================== E: No output files specified. Global Local| Input File ------------+------------------------------------------------------------------- 1 1| AN05: Test analysis of library macros. 2 2| 3 3| 1. Ensure that zero call detection works on library macros. 4 4| 5 5| @$@@L@{@} Error|.^This macro is never used (and has no @Z). 6 6| 7 7| 2. Ensure that multiple call detection works on library macros. 8 8| 9 9| @$@@L@{@} Error|.^This macro is used more than once (and has no @M). 10 10| @$@@Z@{@@@} 11 11| 12 12| End of tests. | ------------+------------------------------------------------------------------- There were 3 Errors. fw_src/answers/ex01.lis 644 0 0 464 6717353766 10250 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed ex01.out. SUCCESS: No diagnostics. ere were 2 Errors. you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accefw_src/answers/ex01.out 644 0 0 14 6717353766 10237 Hello World STING FILE ====================== E: No output files specified. Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- There was 1 Error. tent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you fw_src/answers/ex02.lis 644 0 0 464 6717353767 10252 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed ex02.out. SUCCESS: No diagnostics. 5 5| @$@@(@1@)@Z@M@{@} 6 6| @$@@(@2@)@Z@M@{@} 7 7| 8 8| 1. Test call to undefined macro. 9 9| @$@@Z==@{@@} Error|...........fw_src/answers/ex02.out 644 0 0 14 6717353767 10241 Hello World |.^is a consequence of parameter delimiters @"@" being optional. 15 15| @@(@,@) Error|.^Call has 2 parameters, but the macro |.^definition at line 4 specifies 0 parameters. 16 16| @ Error|.^Call has 0 parameters, but the macro |.^definition at line 5 specifies 1 parameter. 17 17| @@(@) 18 18| @@(Walrus@,@) Error|.^Call has 2 parameters, but the macro |.^definition at line 5 spefw_src/answers/ex03.lis 644 0 0 2754 6717353770 10271 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- 1 1| EX03: An example containing errors to do with the number of times 2 2| that macros are called. 3 3| 4 4| @O@==@{@- 5 5| @ 6 6| @ 7 7| @
8 8| @} 9 9| 10 10| @$@
==@{@- 11 11| main() 12 12| { 13 13| doit(); 14 14| } 15 15| @} 16 16| 17 17| @$@==@{@- Error|.^This macro is never used (and has no @Z). 18 18| void doit() 19 19| { 20 20| int i; 21 21| for (i=0;i<10;i++) 22 22| { 23 23| @ 24 24| @ 25 25| } 26 26| }@} 27 27| 28 28| @$@==@{@- Error|.^This macro is used more than once (and has no @M). 29 29| printf("Hello World!"); 30 30| printf("\n");@} 31 31| 32 32| @$@==@{scanf@} Error|.^This macro is never used (and has no @Z). 33 33| 34 34| @$@==@{@- Error|.^This macro is used more than once (and has no @M). 35 35| #include 36 36| #include @} | ------------+------------------------------------------------------------------- There were 4 Errors. an infinite expansifw_src/answers/ex04.lis 644 0 0 464 6717353771 10247 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed ex04.out. SUCCESS: No diagnostics. fw_src/answers/ex04.out 644 0 0 316 6717353771 10263 #include #include void doit() { int i; for (i=0;i<10;i++) { printf("Hello World!"); printf("\n"); printf("Hello World!"); printf("\n"); } } main() { doit(); } has no name. |.^You can give it one explicitly (As in @A@) or implicitly by |.^defining a macro (whose name will be inherited) within the section. 14 14| | ------------+------------------------------------------------------------------- Tfw_src/answers/ex05.lis 644 0 0 464 6717353772 10251 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed ex05.out. SUCCESS: No diagnostics. fw_src/answers/ex05.out 644 0 0 1146 6717353772 10307 program adt(input,output); type buffer_type = record length : integer; buf : array[1..100] of char; end; type complex_type = record r,i : real; end; bigbuf : buffer_type; procedure buf_init (var b : buffer_type ) {Body of buf_init} procedure buf_add (var b : buffer_type; ch : char) {Body of buf_add} procedure buf_get (var b : buffer_type; var ch : char) {Body of buf_get} procedure cm_set (var c: complex_type; a,b: real) {Body of cm_set} procedure cm_add (a,b: complex_type; var c: complex_type) {Body of cm_add} {Other procedures and functions} begin startproc; end. 644 0 0 464 6717353766 10250 fw_src/answers/ex06.lis 644 0 0 464 6717353773 10253 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed ex06.out. SUCCESS: No diagnostics. fw_src/answers/ex06.out 644 0 0 1171 6717353773 10307 program adt(input,output); type buffer_type = record length : integer; buf : array[1..100] of char; end; type complex_type = record r,i : real; end; bigbuf : buffer_type; procedure buf_init(var b : buffer_type) {Body of buf_init} procedure buf_add(var b : buffer_type; ch : char) {Body of buf_add} procedure buf_get(var b : buffer_type; var ch : char) {Body of buf_get} procedure cm_set(var c: complex_type; a,b : real) {Body of cm_set} procedure cm_add(a,b : complex_type; var c: complex_type) {Body of cm_add} {Other procedures and functions} begin startproc; end. -------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed ex02.out. SUCCESS: No diagnostics. 5 5| @$@@(@1@)@Z@M@{@} 6 6| @$@@(@2@)@Z@M@{@} 7 7| 8 8| 1. Test call to undefined macro. 9 9| @$@@Z==@{@@} Error|...........fw_src/answers/ex07.lis 644 0 0 464 6717353774 10255 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed ex07.out. SUCCESS: No diagnostics. |.^definition at line 5 specifies 1 parameter. 17 17| @@(@) 18 18| @@(Walrus@,@) Error|.^Call has 2 parameters, but the macro |.^definition at line 5 spefw_src/answers/ex07.out 644 0 0 240 6717353774 10265 x=1; while (x<=10) { printf("X=%u\n",x); } x:=1; while (x<=10) { printf("X=%u\n",x); } x=1; while (x<=10) { printf("X=%u\n",x); } 1| EX03: An example containing errors to do with the number of times 2 2| that macros are called. 3 3| 4 4| @O@==@{@- 5 5| @ 6 6| @ 7 7| @
8 8| @} 9 9| 10 10| @$@
==@{@- 11 11| mainfw_src/answers/ex08.lis 644 0 0 464 6717353775 10257 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed ex08.out. SUCCESS: No diagnostics. nclude 36 36| #include @} | ------------+------------------------------------------------------------------- There were 4 Errors. an infinite expansifw_src/answers/ex08.out 644 0 0 6051 6717353775 10315 The Twelve Bugs of Christmas ---------------------------- For the first bug of Christmas, my manager said to me See if they can do it again. For the second bug of Christmas, my manager said to me Ask them how they did it and See if they can do it again. For the third bug of Christmas, my manager said to me Try to reproduce it Ask them how they did it and See if they can do it again. For the fourth bug of Christmas, my manager said to me Run with the debugger Try to reproduce it Ask them how they did it and See if they can do it again. For the fifth bug of Christmas, my manager said to me Ask for a dump Run with the debugger Try to reproduce it Ask them how they did it and See if they can do it again. For the sixth bug of Christmas, my manager said to me Reinstall the software Ask for a dump Run with the debugger Try to reproduce it Ask them how they did it and See if they can do it again. For the seventh bug of Christmas, my manager said to me Say they need an upgrade Reinstall the software Ask for a dump Run with the debugger Try to reproduce it Ask them how they did it and See if they can do it again. For the eighth bug of Christmas, my manager said to me Find a way around it Say they need an upgrade Reinstall the software Ask for a dump Run with the debugger Try to reproduce it Ask them how they did it and See if they can do it again. For the ninth bug of Christmas, my manager said to me Blame it on the hardware Find a way around it Say they need an upgrade Reinstall the software Ask for a dump Run with the debugger Try to reproduce it Ask them how they did it and See if they can do it again. For the tenth bug of Christmas, my manager said to me Change the documentation Blame it on the hardware Find a way around it Say they need an upgrade Reinstall the software Ask for a dump Run with the debugger Try to reproduce it Ask them how they did it and See if they can do it again. For the eleventh bug of Christmas, my manager said to me Say it's not supported Change the documentation Blame it on the hardware Find a way around it Say they need an upgrade Reinstall the software Ask for a dump Run with the debugger Try to reproduce it Ask them how they did it and See if they can do it again. For the twelfth bug of Christmas, my manager said to me Tell them it's a feature Say it's not supported Change the documentation Blame it on the hardware Find a way around it Say they need an upgrade Reinstall the software Ask for a dump Run with the debugger Try to reproduce it Ask them how they did it and See if they can do it again. This song appeared in the internet newsgroup rec.humor.funny on 24-Dec-1991. It was contributed by Pat Scannell (scannell@darkstar.ma30.bull.com). pe = record length : integer; buf : array[1..100] of char; end; type complex_type = record r,i : real; end; bigbuf : buffer_type; procedure buf_init (var b : buffer_type ) {Body of buf_init} procedure buf_add (var b : buffer_type; ch : char) {Body of buf_add} procedure buf_get (var b : buffer_type; var ch : char) {Body of buf_get} procedure cm_set (var c: complex_type; a,b: real) {Body of cm_set} procedure cm_add (a,b: complefw_src/answers/ex09.lis 644 0 0 464 6717353776 10261 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed ex09.out. SUCCESS: No diagnostics. fw_src/answers/ex09.out 644 0 0 312 6717353776 10271 I like to go shooting, it's a whole lot of fun, 'Cos I shoot with a camera instead of a gun. The animals flock to be petted and fed, Cos they know my camera isn't loaded with lead. - RNW, 04-Jan-1991. fw_src/answers/ex10.lis 644 0 0 464 6717353777 10252 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed ex10.out. SUCCESS: No diagnostics. 5 5| @$@@(@1@)@Z@M@{@} 6 6| @$@@(@2@)@Z@M@{@} 7 7| 8 8| 1. Test call to undefined macro. 9 9| @$@@Z==@{@@} Error|...........fw_src/answers/ex10.out 644 0 0 46 6717353777 10246 This is the text of the sloth macro. ======= Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed ex07.out. SUCCESS: No diagnostics. |.^definition at line 5 specifies 1 parameter. 17 17| @@(@) 18 18| @@(Walrus@,@) Error|.^Call has 2 parameters, but the macro |.^definition at line 5 spefw_src/answers/ex11.htm 644 0 0 6543 6717354000 10254 Package ex11

EX11: This example shows how FunnelWeb typesets macros, typesetter commands and free text.

You are reading some free text before the macro. Free text can consist of any text (not containing the FunnelWeb special character) including typesetter commands such as $, %, #, and \TeX{} which will be typeset to appear exactly as they do in the input file! Look out! Here comes a macro!

1. File: ex11.out={This text is part of
a macro definition.
}
This macro is attached to an output file.

This is free text following the macro. This sentence contains two inline typesetter directives. Now here is a non-inline typesetting directive.


This sentence will appear on the next page.


End Of File

Reinstall the software Ask for a dump Run with the debugger Try to reproduce it Ask them how they did it and See if they can dofw_src/answers/ex11.lis 644 0 0 532 6717354000 10223 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Weave: Completed <>. Weave: Completed <>. SUCCESS: No diagnostics. de Reinstall the software Ask for a dump Run with the debugger Try to reproduce it Ask them how they did it and See if they can do it agfw_src/answers/ex11.tex 644 0 0 36723 6717354000 10307 %******************************************************************************* %* START OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* %* * %* This TeX file was automatically generated by the FunnelWeb preprocessor. * %* You can typeset this file to produce printed documentation by running it * %* through the TeX typesetter using a command such as: * %* tex thisfilename * %* The resultant file thisfilename.dvi can be printed using a command such as: * %* lpr -Plaser -d thisfilename.dvi * %* * %* FunnelWeb is a preprocessor that allows programmers to weave programs and * %* their documentation together in a single document. The FunnelWeb program * %* analyses such documents producing both program files and typeset * %* documentation such as this TeX file. * %* FunnelWeb was created by Ross N. Williams. * %* * %* For more information on FunnelWeb see http://www.ross.net/funnelweb/ * %* * %******************************************************************************* %===================== Start of FunnelWeb TeX Definitions ====================== % Version % ------- % This is FunnelWeb TeX Macro Library Version 1.0. % Copyright % --------- % This set of FunnelWeb TeX definitions was written by Ross Williams and was % originally Copyright (C) 1992 Ross N. Williams. However, I, Ross Williams, % hereby forego any claim to Copyright in this set of FunnelWeb TeX definitions % and hereby authorize that the set of TeX definitions pass into the public % domain. -- Ross N. Williams, 3:41pm 07-May-1992, Adelaide, Australia. % Modification % ------------ % Please record all modifications to these TeX definitions here. Unless % otherwise specified, all modified definitions fall in the public domain too. % % Programmers: % RNW Ross N. Williams ross@ross.net % % Changes: % 07-May-1992 RNW Prepared this work for public domain release. % 10-May-1999 RNW Added \fwlib macro. % General Comments % ---------------- % This set of TeX definitions exists for two reasons: % % 1. To shorten and neaten the FunnelWeb TeX output. % 2. To allow users to fiddle with the output format in their input files % (by inserting redefining "\def"s) without having to resort to % modifying the FunnelWeb code. % % The user is warned that these definitions may be changed from time to time % (but probably not much). The user should not be too sneaky. In particular, % users wishing to redefine some of these macros should do so in an explicitly % defined section at the top of their input file. This will mean that in the % event of problems, that section can simply be deleted or commented out to % allow the document to at least be typeset in the default format. Users should % limit themselves to redefining these macros in such a section and should % refrain from using the macros throughout their documents. % Environment Parameters % ---------------------- % \tolerance tells TeX how tolerant it should be about making bad line and % page breaks. Here we set it to it's maximum, as % 1) Computer programs are likely to cause lots of bad breaks. % 2) In most cases the user would probably rather get the TeX file through % TeX without any errors than fiddle with spacings for perfection. \tolerance=10000 % I don't like indentation as it makes the page look more busy. Instead, % paragraphs are separated by a little space (see next). \parindent=0pt % In many cases, users will produce documents with long runs of paragraphs. % In order to space out these paragraphs, it is convenient to maintain a % prevailing non-zero \parskip (end-of-paragaph skip). The only trouble is % that the skip becomes a problem in macro definitions which require no skip % and so we have to turn the skip on and off. The following two macros % simplify this process. \def\fwparskipon{\parskip=\medskipamount} \def\fwparskipoff{\parskip=0pt} \fwparskipon % Setting raggedbottom allows TeX to leave a bit of space at the bottom of the % page in order to better vertically align the rest of the page (e.g. skips % won't stretch as much). It also means that headings are less likely to be % isolated at the bottom of the page without any following text. \raggedbottom % Fonts % ----- % Most of the typeset output is set in 10pt roman and 10pt tt font. % The major extra font needs spring from titles and headings. % For portability's sake we use only the following fonts: % cmr10 % cmbx10 % cmtt10 % and some enlargements of them. These fonts are all "standard" fonts % in Plain TeX. See The TeXbook p.350. \font\fwfontnote=cmr7 \font\fwfontnorm=cmr10 \font\fwfontnorma=cmr10 scaled \magstep1 \font\fwfontnormb=cmr10 scaled \magstep2 \font\fwfontbold=cmbx10 \font\fwfontbolda=cmbx10 scaled \magstep1 \font\fwfontboldb=cmbx10 scaled \magstep2 \font\fwfontboldc=cmbx10 scaled \magstep3 \font\fwfontboldd=cmbx10 scaled \magstep4 % Macros for Stylistic Details % ---------------------------- % This section contains all the fiddly little macros for setting the details % of each macro definition. % Macro definitions are sandwiched by calls to these macros which can be used % to sort out the spacing before and after the macro definition. \def\fwbeginmacro{\fwparskipoff\bigskip} \def\fwendmacro{\fwparskipon\par} % These macros deal with the macro name and definition line. \def\fwmacroname#1#2{{\sl #1\/}$\lbrack$#2$\rbrack$} \def\fwfilename#1#2{{\bf #1}$\lbrack$#2$\rbrack$} \def\fwzero#1{{\bf Z}} \def\fwmany#1{{\bf M}} \def\fwlib#1{{\bf L}} \def\fwequals{ $\equiv$} \def\fwplusequals{ $+\equiv$} % Now for the actual body of the definition. It looks nice to have the tt % code indented a little. Again, we use macros instead of writing direct TeX, % so as to allow the user to fiddle this stuff to taste without having to % modify the FunnelWeb C code. \def\fwodef{\parindent=15pt\vskip0pt$\lbrace$\parindent=20pt} \def\fwcdef{$\rbrace$\vskip0pt\parindent=0pt} \def\fwoquote{`} \def\fwcquote{'} \def\fwoparen{$($} \def\fwcomma{$,$} \def\fwcparen{$)$} \def\fwparam#1{$\diamond #1$} \def\fwparams#1{$(\diamond #1)$} % These macros deal with the notes that are appended at the end of each % macro definition. Note that even though \fwisafile,\fwusedin, and \fwseealso % have the same definition, they are given different names so as to allow the % user to redefine these macros to typeset each kind of information differently % if desired. \def\fwbeginmacronotes{\begingroup\baselineskip=9pt\smallskip} \def\fwnote#1{{\fwfontnote #1}\par} \def\fwisafile#1{\fwnote{#1}} \def\fwusedin#1{\fwnote{#1}} \def\fwseealso#1{\fwnote{#1}} \def\fwendmacronotes{\endgroup} % Macros to Typeset Program Code Verbatim % --------------------------------------- % This is by far the hairiest and most difficult part of the typesetting task % because we have to turn off most of TeX's natural instincts in order to % typeset the program text exactly as it appears in the input file. % Two macros are defined to pull this off: \fwbtx and \fwverbatimgobble. % Their code was inspired by the following sections of "The TeXbook": % Appendix D: Dirty Tricks, 3.Verbatim listing, p.380-382. % Appendix E: Example Formats, p.421. % The \fwbtx[ (for "FunnelWeb Begin TeXt") macro does most of the hard work. % The liberal use of "%" is because I don't understand TeX well enough to % understand when an end of line will cause trouble, and I am playing it safe. % Before defining the main \fwbtx macro, we have to stash away some definitions % in the hidden part of TeX's environment. Let's hope that these "hidden" % definitions don't affect anything except what is desired to be affected. % The tt font in which we wish to set the text has two Latin lurking ligatures! % These are ?` and !`. To disable them, we define the left quote when ACTIVE % to be defined in such a way as to prevent ligatures. The main TeX text will % normally not be exposed to this definition because normally the leftquote % character is not active. The \fwbtx macro temporarily makes the left quote % character active thus activating the deactivation of left quote ligatures. % See The TeXbook p.381. {\catcode`\`=\active \gdef`{\relax\lq}} % TeX is fairly carefree about spaces and so we have to make it more serious. % To do so we pull the same trick as above, setting up a definition for active % space, but only making space active during the span of the verbatim text. % In Plain TeX the active space is defined to be simply a space, but here we % define it to be a control space. This ensures that the space cannot % be gobbled up by one of TeX's mysterious mechanisms when activated. % See The TeXbook, p.381 and p.352. {\obeyspaces\global\let =\ } % Here is the main \fwbtx verbatim text macro. % Note: The order in which all these pieces of business have to be done is % still a partial mystery to me. Don't fiddle with this stuff unless you % think you know what you are doing. \def\fwbtx[{% % % The funnies involved in getting verbatim output are safely housed inside % this \begingroup, and the \endgroup in \fwverbatimgobble. Groups are used % instead of curly braces because we have to be able to signal the end of % this macro with a curly brace. \begingroup% % % \pars at the end of empty lines in the verbatim text won't come out normally % because TeX is in vertical mode and they get gobbled up. To prevent this, % we force \par to exit vertical mode first. See The TeXbook p.381. \def\par{\leavevmode\endgraf}% % % Activate the leftquote character so as to avoid ligatures (see above). \catcode`\`=\active% % % The \obeylines macro simply defines end of line (^M) to be \par. This ensures % that TeX will treat each verbatim line as a new paragraph. \obeylines% % % To get verbatim output, we have to desex all the special characters. This % is explained in detail in The TeXbook p.380. \def\do##1{\catcode`##1=12 }\dospecials% % % Activate the space character so as to make TeX treat blanks seriously. % This activation invokes an eralier definition (see above). \obeyspaces % % Interparagraph skips do not help the cause. % Note: We have to preserve the indentation though, as the code is actually % indented in the final output. See \fwodef in an earlier section. \parskip=0pt% % % We typeset the verbatim text in tt font (courier on the Macintosh) for a % number of reasons: % - tt font has the same horizontal spacing for each character. % - tt font covers the ASCII character set. % - tt font doesn't have many surprises (e.g. ligatures). % - tt font looks much what you might see on a computer terminal screen. \tt% % % Having set up an environment for verbatim, we are ready to use it. % By invoking \fwverbatimgobble, this \fwbtx macro gobbles up text verbatim (as % part of the parameter of \fwverbatimgobble) until it sees the termination % string "]fwetx=" (the "=" was thrown in to add obscurity as this sequence % must never occur in the verbatim text). \fwverbatimgobble} % The \fwverbatimgobble macro exists to allow \fwbtx to bracket verbatim text. \def\fwverbatimgobble#1]fwetx={#1\endgroup} % Table of Contents % ----------------- % The five levels of table of contents that FunnelWeb supports are identified % by the five letters [A..E]. These are used throughout the following macros. % The following macros are utilities to the TOC macros to follow. \def\fwrule{\medskip\hrule\medskip} \def\fwqh{\hskip1.5em\relax} \def\fwbeforesec{\penalty-200\bigskip\medskip\par} % The following macros are used to typeset the table of contents. \def\fwtocstart#1{\fwrule\leftline{\fwfontbolda Table of Contents}\fwrule} \def\fwtoca#1#2{\leftline{{\bf #1 #2}}} \def\fwtocb#1#2{\leftline{\fwqh #1 #2}} \def\fwtocc#1#2{\leftline{\fwqh\fwqh #1 #2}} \def\fwtocd#1#2{\leftline{\fwqh\fwqh\fwqh #1 #2}} \def\fwtoce#1#2{\leftline{\fwqh\fwqh\fwqh\fwqh #1 #2}} \def\fwtocfinish#1{\fwrule} % The following "library" macros define five different strengths of headings % which can be used later in the section macros. \def\fwliba#1#2{\vfill\eject{\fwfontboldc #1 #2}\penalty200\smallskip} \def\fwlibb#1#2{\fwbeforesec{\fwfontboldb #1 #2}\penalty200\smallskip} \def\fwlibc#1#2{\fwbeforesec{\fwfontnormb #1 #2}\penalty200\smallskip} \def\fwlibd#1#2{\fwbeforesec{\bf #1 #2}\penalty200} \def\fwlibe#1#2{\fwbeforesec{\bf #1 #2}} % Here are the macros that actually typeset the section headings throughout % the document. The fwlib system has been employed so as to easily allow the % user to redefine the strengths of headings to taste. For example, the % user could insert in the input document a similar set of definitions to these % but with the b..e headings set to \fwlibc. This would tone down the output. \def\fwseca#1#2{\fwliba{#1}{#2}} \def\fwsecb#1#2{\fwlibb{#1}{#2}} \def\fwsecc#1#2{\fwlibc{#1}{#2}} \def\fwsecd#1#2{\fwlibd{#1}{#2}} \def\fwsece#1#2{\fwlibe{#1}{#2}} % Support for Explicit Typesetting % -------------------------------- % FunnelWeb supports pragmas and other constructs that allow % typesetter-independent typesetting commands to be given. The % following macros support these features. % The in-text literal @{sloth@} and emphasise @[walrus@] features. \def\fwlit#1{{\tt #1}} \def\fwemp#1{{\it #1}} % The "@p new_page" pragma. \def\fwnewpage{\vfill\eject} % The "@p vskip Nmm" pragma. \def\fwvskip#1{\null\vskip #1mm} % The "@p title " pragma. \def\fwfontnormal#1{{\fwfontnorm {#1}}} \def\fwfonttitle#1{{\fwfontboldd {#1}}} \def\fwfontsmalltitle#1{{\fwfontboldb {#1}}} \def\fwleftline#1{\leftline{#1}} \def\fwcenterline#1{\centerline{#1}} \def\fwrightline#1{\rightline{#1}} % Support for Old FunnelWeb % ------------------------- % The following macros were used extensively in the first version of % FunnelWeb and are retained so that these older input files will still % typeset cleanly. \def\p#1{{\tt #1}} % P for Program text. \def\flagpage#1#2{ \null \vfill \centerline{\fwfontboldd #1} \vskip 1cm \centerline{\fwfontboldd #2} \vfill \null \vfill } %====================== End of FunnelWeb TeX Definitions ======================= EX11: This example shows how FunnelWeb typesets macros, typesetter commands and free text. You are reading some free text before the macro. Free text can consist of any text (not containing the FunnelWeb special character) including typesetter commands such as \$, \%, \#, and $\backslash$TeX$\{$$\}$ which will be typeset to appear exactly as they do in the input file! Look out! Here comes a macro! \fwbeginmacro \fwfilename{ex11.out}{1}\fwequals \fwodef \fwbtx[This text is part of a macro definition. ]fwetx=% \fwcdef \fwbeginmacronotes \fwisafile{This macro is attached to an output file.} \fwendmacronotes \fwendmacro This is free text following the macro. This sentence contains two \fwlit{inline} typesetter \fwemp{directives}. Now here is a non-inline typesetting directive. \fwnewpage This sentence will appear on the next page. \bye %******************************************************************************* %* END OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* ction contains all the fiddly little macros ffw_src/answers/ex12.htm 644 0 0 7163 6717354002 10256 Package ex12

EX12: This example gives some simple headings and demonstrates heading name inheritance.

1. File: ex12.out={dummy text }
This macro is attached to an output file.


1. Feed the Penguins and Save the World


1.1. Feed the Penguins


1.1.1. Feed the little penguins


1.1.2. Feed the big penguins


1.2. Save the World


1.2.1. Save Europe


1.2.2. Save Africa


1.2.3. Save the rest of the world

This heading hasn't been given an explicit name, but will inherit the name \p{Save the rest of the world} from the macro definition below.

2. Save the rest of the world[Z]={... }
This macro is NEVER invoked.


End Of File

t the end of empty lines in the verbatim text won't come out normally % because TeX is in vertical mode and they get gobbled up. To prevent this, % we force \par to exit vertical mode first. See The TeXbook p.381. \def\par{\leavevmode\endgraf}% % % Activate the leftquote character so as to avoid ligatures (see above). \catcode`\`=\active% % % The \obeylines macro simply defines end of line (^M)fw_src/answers/ex12.lis 644 0 0 532 6717354002 10226 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Weave: Completed <>. Weave: Completed <>. SUCCESS: No diagnostics. many surprises (e.g. ligatures). % - tt font looks much what you might see on a computer terminal screen. \tt% % % Having set up an environment for verbatim, we arfw_src/answers/ex12.tex 644 0 0 37047 6717354002 10312 %******************************************************************************* %* START OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* %* * %* This TeX file was automatically generated by the FunnelWeb preprocessor. * %* You can typeset this file to produce printed documentation by running it * %* through the TeX typesetter using a command such as: * %* tex thisfilename * %* The resultant file thisfilename.dvi can be printed using a command such as: * %* lpr -Plaser -d thisfilename.dvi * %* * %* FunnelWeb is a preprocessor that allows programmers to weave programs and * %* their documentation together in a single document. The FunnelWeb program * %* analyses such documents producing both program files and typeset * %* documentation such as this TeX file. * %* FunnelWeb was created by Ross N. Williams. * %* * %* For more information on FunnelWeb see http://www.ross.net/funnelweb/ * %* * %******************************************************************************* %===================== Start of FunnelWeb TeX Definitions ====================== % Version % ------- % This is FunnelWeb TeX Macro Library Version 1.0. % Copyright % --------- % This set of FunnelWeb TeX definitions was written by Ross Williams and was % originally Copyright (C) 1992 Ross N. Williams. However, I, Ross Williams, % hereby forego any claim to Copyright in this set of FunnelWeb TeX definitions % and hereby authorize that the set of TeX definitions pass into the public % domain. -- Ross N. Williams, 3:41pm 07-May-1992, Adelaide, Australia. % Modification % ------------ % Please record all modifications to these TeX definitions here. Unless % otherwise specified, all modified definitions fall in the public domain too. % % Programmers: % RNW Ross N. Williams ross@ross.net % % Changes: % 07-May-1992 RNW Prepared this work for public domain release. % 10-May-1999 RNW Added \fwlib macro. % General Comments % ---------------- % This set of TeX definitions exists for two reasons: % % 1. To shorten and neaten the FunnelWeb TeX output. % 2. To allow users to fiddle with the output format in their input files % (by inserting redefining "\def"s) without having to resort to % modifying the FunnelWeb code. % % The user is warned that these definitions may be changed from time to time % (but probably not much). The user should not be too sneaky. In particular, % users wishing to redefine some of these macros should do so in an explicitly % defined section at the top of their input file. This will mean that in the % event of problems, that section can simply be deleted or commented out to % allow the document to at least be typeset in the default format. Users should % limit themselves to redefining these macros in such a section and should % refrain from using the macros throughout their documents. % Environment Parameters % ---------------------- % \tolerance tells TeX how tolerant it should be about making bad line and % page breaks. Here we set it to it's maximum, as % 1) Computer programs are likely to cause lots of bad breaks. % 2) In most cases the user would probably rather get the TeX file through % TeX without any errors than fiddle with spacings for perfection. \tolerance=10000 % I don't like indentation as it makes the page look more busy. Instead, % paragraphs are separated by a little space (see next). \parindent=0pt % In many cases, users will produce documents with long runs of paragraphs. % In order to space out these paragraphs, it is convenient to maintain a % prevailing non-zero \parskip (end-of-paragaph skip). The only trouble is % that the skip becomes a problem in macro definitions which require no skip % and so we have to turn the skip on and off. The following two macros % simplify this process. \def\fwparskipon{\parskip=\medskipamount} \def\fwparskipoff{\parskip=0pt} \fwparskipon % Setting raggedbottom allows TeX to leave a bit of space at the bottom of the % page in order to better vertically align the rest of the page (e.g. skips % won't stretch as much). It also means that headings are less likely to be % isolated at the bottom of the page without any following text. \raggedbottom % Fonts % ----- % Most of the typeset output is set in 10pt roman and 10pt tt font. % The major extra font needs spring from titles and headings. % For portability's sake we use only the following fonts: % cmr10 % cmbx10 % cmtt10 % and some enlargements of them. These fonts are all "standard" fonts % in Plain TeX. See The TeXbook p.350. \font\fwfontnote=cmr7 \font\fwfontnorm=cmr10 \font\fwfontnorma=cmr10 scaled \magstep1 \font\fwfontnormb=cmr10 scaled \magstep2 \font\fwfontbold=cmbx10 \font\fwfontbolda=cmbx10 scaled \magstep1 \font\fwfontboldb=cmbx10 scaled \magstep2 \font\fwfontboldc=cmbx10 scaled \magstep3 \font\fwfontboldd=cmbx10 scaled \magstep4 % Macros for Stylistic Details % ---------------------------- % This section contains all the fiddly little macros for setting the details % of each macro definition. % Macro definitions are sandwiched by calls to these macros which can be used % to sort out the spacing before and after the macro definition. \def\fwbeginmacro{\fwparskipoff\bigskip} \def\fwendmacro{\fwparskipon\par} % These macros deal with the macro name and definition line. \def\fwmacroname#1#2{{\sl #1\/}$\lbrack$#2$\rbrack$} \def\fwfilename#1#2{{\bf #1}$\lbrack$#2$\rbrack$} \def\fwzero#1{{\bf Z}} \def\fwmany#1{{\bf M}} \def\fwlib#1{{\bf L}} \def\fwequals{ $\equiv$} \def\fwplusequals{ $+\equiv$} % Now for the actual body of the definition. It looks nice to have the tt % code indented a little. Again, we use macros instead of writing direct TeX, % so as to allow the user to fiddle this stuff to taste without having to % modify the FunnelWeb C code. \def\fwodef{\parindent=15pt\vskip0pt$\lbrace$\parindent=20pt} \def\fwcdef{$\rbrace$\vskip0pt\parindent=0pt} \def\fwoquote{`} \def\fwcquote{'} \def\fwoparen{$($} \def\fwcomma{$,$} \def\fwcparen{$)$} \def\fwparam#1{$\diamond #1$} \def\fwparams#1{$(\diamond #1)$} % These macros deal with the notes that are appended at the end of each % macro definition. Note that even though \fwisafile,\fwusedin, and \fwseealso % have the same definition, they are given different names so as to allow the % user to redefine these macros to typeset each kind of information differently % if desired. \def\fwbeginmacronotes{\begingroup\baselineskip=9pt\smallskip} \def\fwnote#1{{\fwfontnote #1}\par} \def\fwisafile#1{\fwnote{#1}} \def\fwusedin#1{\fwnote{#1}} \def\fwseealso#1{\fwnote{#1}} \def\fwendmacronotes{\endgroup} % Macros to Typeset Program Code Verbatim % --------------------------------------- % This is by far the hairiest and most difficult part of the typesetting task % because we have to turn off most of TeX's natural instincts in order to % typeset the program text exactly as it appears in the input file. % Two macros are defined to pull this off: \fwbtx and \fwverbatimgobble. % Their code was inspired by the following sections of "The TeXbook": % Appendix D: Dirty Tricks, 3.Verbatim listing, p.380-382. % Appendix E: Example Formats, p.421. % The \fwbtx[ (for "FunnelWeb Begin TeXt") macro does most of the hard work. % The liberal use of "%" is because I don't understand TeX well enough to % understand when an end of line will cause trouble, and I am playing it safe. % Before defining the main \fwbtx macro, we have to stash away some definitions % in the hidden part of TeX's environment. Let's hope that these "hidden" % definitions don't affect anything except what is desired to be affected. % The tt font in which we wish to set the text has two Latin lurking ligatures! % These are ?` and !`. To disable them, we define the left quote when ACTIVE % to be defined in such a way as to prevent ligatures. The main TeX text will % normally not be exposed to this definition because normally the leftquote % character is not active. The \fwbtx macro temporarily makes the left quote % character active thus activating the deactivation of left quote ligatures. % See The TeXbook p.381. {\catcode`\`=\active \gdef`{\relax\lq}} % TeX is fairly carefree about spaces and so we have to make it more serious. % To do so we pull the same trick as above, setting up a definition for active % space, but only making space active during the span of the verbatim text. % In Plain TeX the active space is defined to be simply a space, but here we % define it to be a control space. This ensures that the space cannot % be gobbled up by one of TeX's mysterious mechanisms when activated. % See The TeXbook, p.381 and p.352. {\obeyspaces\global\let =\ } % Here is the main \fwbtx verbatim text macro. % Note: The order in which all these pieces of business have to be done is % still a partial mystery to me. Don't fiddle with this stuff unless you % think you know what you are doing. \def\fwbtx[{% % % The funnies involved in getting verbatim output are safely housed inside % this \begingroup, and the \endgroup in \fwverbatimgobble. Groups are used % instead of curly braces because we have to be able to signal the end of % this macro with a curly brace. \begingroup% % % \pars at the end of empty lines in the verbatim text won't come out normally % because TeX is in vertical mode and they get gobbled up. To prevent this, % we force \par to exit vertical mode first. See The TeXbook p.381. \def\par{\leavevmode\endgraf}% % % Activate the leftquote character so as to avoid ligatures (see above). \catcode`\`=\active% % % The \obeylines macro simply defines end of line (^M) to be \par. This ensures % that TeX will treat each verbatim line as a new paragraph. \obeylines% % % To get verbatim output, we have to desex all the special characters. This % is explained in detail in The TeXbook p.380. \def\do##1{\catcode`##1=12 }\dospecials% % % Activate the space character so as to make TeX treat blanks seriously. % This activation invokes an eralier definition (see above). \obeyspaces % % Interparagraph skips do not help the cause. % Note: We have to preserve the indentation though, as the code is actually % indented in the final output. See \fwodef in an earlier section. \parskip=0pt% % % We typeset the verbatim text in tt font (courier on the Macintosh) for a % number of reasons: % - tt font has the same horizontal spacing for each character. % - tt font covers the ASCII character set. % - tt font doesn't have many surprises (e.g. ligatures). % - tt font looks much what you might see on a computer terminal screen. \tt% % % Having set up an environment for verbatim, we are ready to use it. % By invoking \fwverbatimgobble, this \fwbtx macro gobbles up text verbatim (as % part of the parameter of \fwverbatimgobble) until it sees the termination % string "]fwetx=" (the "=" was thrown in to add obscurity as this sequence % must never occur in the verbatim text). \fwverbatimgobble} % The \fwverbatimgobble macro exists to allow \fwbtx to bracket verbatim text. \def\fwverbatimgobble#1]fwetx={#1\endgroup} % Table of Contents % ----------------- % The five levels of table of contents that FunnelWeb supports are identified % by the five letters [A..E]. These are used throughout the following macros. % The following macros are utilities to the TOC macros to follow. \def\fwrule{\medskip\hrule\medskip} \def\fwqh{\hskip1.5em\relax} \def\fwbeforesec{\penalty-200\bigskip\medskip\par} % The following macros are used to typeset the table of contents. \def\fwtocstart#1{\fwrule\leftline{\fwfontbolda Table of Contents}\fwrule} \def\fwtoca#1#2{\leftline{{\bf #1 #2}}} \def\fwtocb#1#2{\leftline{\fwqh #1 #2}} \def\fwtocc#1#2{\leftline{\fwqh\fwqh #1 #2}} \def\fwtocd#1#2{\leftline{\fwqh\fwqh\fwqh #1 #2}} \def\fwtoce#1#2{\leftline{\fwqh\fwqh\fwqh\fwqh #1 #2}} \def\fwtocfinish#1{\fwrule} % The following "library" macros define five different strengths of headings % which can be used later in the section macros. \def\fwliba#1#2{\vfill\eject{\fwfontboldc #1 #2}\penalty200\smallskip} \def\fwlibb#1#2{\fwbeforesec{\fwfontboldb #1 #2}\penalty200\smallskip} \def\fwlibc#1#2{\fwbeforesec{\fwfontnormb #1 #2}\penalty200\smallskip} \def\fwlibd#1#2{\fwbeforesec{\bf #1 #2}\penalty200} \def\fwlibe#1#2{\fwbeforesec{\bf #1 #2}} % Here are the macros that actually typeset the section headings throughout % the document. The fwlib system has been employed so as to easily allow the % user to redefine the strengths of headings to taste. For example, the % user could insert in the input document a similar set of definitions to these % but with the b..e headings set to \fwlibc. This would tone down the output. \def\fwseca#1#2{\fwliba{#1}{#2}} \def\fwsecb#1#2{\fwlibb{#1}{#2}} \def\fwsecc#1#2{\fwlibc{#1}{#2}} \def\fwsecd#1#2{\fwlibd{#1}{#2}} \def\fwsece#1#2{\fwlibe{#1}{#2}} % Support for Explicit Typesetting % -------------------------------- % FunnelWeb supports pragmas and other constructs that allow % typesetter-independent typesetting commands to be given. The % following macros support these features. % The in-text literal @{sloth@} and emphasise @[walrus@] features. \def\fwlit#1{{\tt #1}} \def\fwemp#1{{\it #1}} % The "@p new_page" pragma. \def\fwnewpage{\vfill\eject} % The "@p vskip Nmm" pragma. \def\fwvskip#1{\null\vskip #1mm} % The "@p title " pragma. \def\fwfontnormal#1{{\fwfontnorm {#1}}} \def\fwfonttitle#1{{\fwfontboldd {#1}}} \def\fwfontsmalltitle#1{{\fwfontboldb {#1}}} \def\fwleftline#1{\leftline{#1}} \def\fwcenterline#1{\centerline{#1}} \def\fwrightline#1{\rightline{#1}} % Support for Old FunnelWeb % ------------------------- % The following macros were used extensively in the first version of % FunnelWeb and are retained so that these older input files will still % typeset cleanly. \def\p#1{{\tt #1}} % P for Program text. \def\flagpage#1#2{ \null \vfill \centerline{\fwfontboldd #1} \vskip 1cm \centerline{\fwfontboldd #2} \vfill \null \vfill } %====================== End of FunnelWeb TeX Definitions ======================= EX12: This example gives some simple headings and demonstrates heading name inheritance. \fwbeginmacro \fwfilename{ex12.out}{1}\fwequals \fwodef \fwbtx[dummy text]fwetx=% \fwcdef \fwbeginmacronotes \fwisafile{This macro is attached to an output file.} \fwendmacronotes \fwendmacro \fwseca{1}{Feed the Penguins and Save the World} \fwsecb{1.1}{Feed the Penguins} \fwsecc{1.1.1}{Feed the little penguins} \fwsecc{1.1.2}{Feed the big penguins} \fwsecb{1.2}{Save the World} \fwsecc{1.2.1}{Save Europe} \fwsecc{1.2.2}{Save Africa} \fwsecc{1.2.3}{Save the rest of the world} This heading hasn't been given an explicit name, but will inherit the name $\backslash$p$\{$Save the rest of the world$\}$ from the macro definition below. \fwbeginmacro \fwmacroname{Save the rest of the world}{2}\fwzero{}\fwequals \fwodef \fwbtx[...]fwetx=% \fwcdef \fwbeginmacronotes \fwusedin{This macro is NEVER invoked.} \fwendmacronotes \fwendmacro \bye %******************************************************************************* %* END OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* definition. % Macro definitions are sandwiched by calls to these macros which can be used % to sort out the spacing before and after the macro definition. \def\fwbeginmacro{\fwparskipoff\bigskip} \def\fwendmacro{\fwparskipon\par} % These macros deal with the macro name and definition line. \def\fwmacroname#1#2{{\sl #1\/}$\lbrack$#2$\rbrack$} \def\fwfilename#1#2{{\bf #1}$\lbrack$#2$\rbrack$} \def\fwzero#1{{\bf Z}} \def\fwmany#1{{\bf M}} \def\fwlib#1{{\bf L}} \def\fweqfw_src/answers/ex13.htm 644 0 0 17050 6717354005 10276 Package ex13

EX13: This example is used to generate typeset documentation which is discussed in the tutorial in the FunnelWeb user's manual.


1. Table of Contents

1. Table of Contents
2. Macros for Moral Support
3. An Extremely Imperative Stack Abstraction
     3.1. Define the Stack
     3.2. Push the Stack
     3.3. Pop the Stack
     3.4. Rough the Stack Up a Bit


2. Macros for Moral Support

The following macro contain comments that provide moral support in the output code.

1. Programmer's Cheer[M]={
-- Shift to the left!
-- Shift to the right!
-- Pop up, push down!
-- Byte! Byte! Byte!
-- (From "The New Hacker's Dictionary").
}
This macro is invoked in definitions 6 and 8.

The next macro is similar but is distributed throughout the program.

2. Hacker's Cheer+={
-- Pointer to the left
}
This macro is defined in definitions 2, 3, 5, 7 and 9.
This macro is invoked in definition 10.


3. An Extremely Imperative Stack Abstraction


3.1. Define the Stack

3. Hacker's Cheer+={-- Pointer to the right
}
This macro is defined in definitions 2, 3, 5, 7 and 9.
This macro is invoked in definition 10.

4. Stack Type[Z]={type stack = record ... end; }
This macro is NEVER invoked.


3.2. Push the Stack

5. Hacker's Cheer+={-- Hack that code
}
This macro is defined in definitions 2, 3, 5, 7 and 9.
This macro is invoked in definition 10.

6. Push Procedure[Z]={procedure push(var b:stack; v:value);  Programmer's Cheer {...} }
This macro is NEVER invoked.


3.3. Pop the Stack

7. Hacker's Cheer+={-- Tight! Tight! Tight!
}
This macro is defined in definitions 2, 3, 5, 7 and 9.
This macro is invoked in definition 10.

8. Pop Procedure[Z]={procedure pop(var b:stack);  Programmer's Cheer {...} }
This macro is NEVER invoked.


3.4. Rough the Stack Up a Bit

9. Hacker's Cheer+={-- (RNW, 04-Jan-1991).
}
This macro is defined in definitions 2, 3, 5, 7 and 9.
This macro is invoked in definition 10.

10. Rough Procedure[Z]={procedure rough(var b:stack);  Hacker's Cheer {...} }
This macro is NEVER invoked.

11. File: dummy.txt={dummy
}
This macro is attached to an output file.


End Of File

are retained so that these older input files will still % typeset cleanly. \def\p#1{{\tt #1}} % P for Program text. \def\flagpage#1#2{ \null \vfill \centerline{\fwfontboldd #1} \vskip 1cm \centerline{\fwfontboldd #2} \vfill \null \vfill } %====================== End of FunnelWeb TeX Definitions ======================= EX12: This example gives some simple headings and demonstrates heading name inheritance. \fwbeginmacro \fwfilename{ex12fw_src/answers/ex13.lis 644 0 0 532 6717354004 10231 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Weave: Completed <>. Weave: Completed <>. SUCCESS: No diagnostics. ***************************************** %* END OF AUTOMATICALLY GENERATED TEX FILE * %******************************************fw_src/answers/ex13.tex 644 0 0 44521 6717354005 10311 %******************************************************************************* %* START OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* %* * %* This TeX file was automatically generated by the FunnelWeb preprocessor. * %* You can typeset this file to produce printed documentation by running it * %* through the TeX typesetter using a command such as: * %* tex thisfilename * %* The resultant file thisfilename.dvi can be printed using a command such as: * %* lpr -Plaser -d thisfilename.dvi * %* * %* FunnelWeb is a preprocessor that allows programmers to weave programs and * %* their documentation together in a single document. The FunnelWeb program * %* analyses such documents producing both program files and typeset * %* documentation such as this TeX file. * %* FunnelWeb was created by Ross N. Williams. * %* * %* For more information on FunnelWeb see http://www.ross.net/funnelweb/ * %* * %******************************************************************************* %===================== Start of FunnelWeb TeX Definitions ====================== % Version % ------- % This is FunnelWeb TeX Macro Library Version 1.0. % Copyright % --------- % This set of FunnelWeb TeX definitions was written by Ross Williams and was % originally Copyright (C) 1992 Ross N. Williams. However, I, Ross Williams, % hereby forego any claim to Copyright in this set of FunnelWeb TeX definitions % and hereby authorize that the set of TeX definitions pass into the public % domain. -- Ross N. Williams, 3:41pm 07-May-1992, Adelaide, Australia. % Modification % ------------ % Please record all modifications to these TeX definitions here. Unless % otherwise specified, all modified definitions fall in the public domain too. % % Programmers: % RNW Ross N. Williams ross@ross.net % % Changes: % 07-May-1992 RNW Prepared this work for public domain release. % 10-May-1999 RNW Added \fwlib macro. % General Comments % ---------------- % This set of TeX definitions exists for two reasons: % % 1. To shorten and neaten the FunnelWeb TeX output. % 2. To allow users to fiddle with the output format in their input files % (by inserting redefining "\def"s) without having to resort to % modifying the FunnelWeb code. % % The user is warned that these definitions may be changed from time to time % (but probably not much). The user should not be too sneaky. In particular, % users wishing to redefine some of these macros should do so in an explicitly % defined section at the top of their input file. This will mean that in the % event of problems, that section can simply be deleted or commented out to % allow the document to at least be typeset in the default format. Users should % limit themselves to redefining these macros in such a section and should % refrain from using the macros throughout their documents. % Environment Parameters % ---------------------- % \tolerance tells TeX how tolerant it should be about making bad line and % page breaks. Here we set it to it's maximum, as % 1) Computer programs are likely to cause lots of bad breaks. % 2) In most cases the user would probably rather get the TeX file through % TeX without any errors than fiddle with spacings for perfection. \tolerance=10000 % I don't like indentation as it makes the page look more busy. Instead, % paragraphs are separated by a little space (see next). \parindent=0pt % In many cases, users will produce documents with long runs of paragraphs. % In order to space out these paragraphs, it is convenient to maintain a % prevailing non-zero \parskip (end-of-paragaph skip). The only trouble is % that the skip becomes a problem in macro definitions which require no skip % and so we have to turn the skip on and off. The following two macros % simplify this process. \def\fwparskipon{\parskip=\medskipamount} \def\fwparskipoff{\parskip=0pt} \fwparskipon % Setting raggedbottom allows TeX to leave a bit of space at the bottom of the % page in order to better vertically align the rest of the page (e.g. skips % won't stretch as much). It also means that headings are less likely to be % isolated at the bottom of the page without any following text. \raggedbottom % Fonts % ----- % Most of the typeset output is set in 10pt roman and 10pt tt font. % The major extra font needs spring from titles and headings. % For portability's sake we use only the following fonts: % cmr10 % cmbx10 % cmtt10 % and some enlargements of them. These fonts are all "standard" fonts % in Plain TeX. See The TeXbook p.350. \font\fwfontnote=cmr7 \font\fwfontnorm=cmr10 \font\fwfontnorma=cmr10 scaled \magstep1 \font\fwfontnormb=cmr10 scaled \magstep2 \font\fwfontbold=cmbx10 \font\fwfontbolda=cmbx10 scaled \magstep1 \font\fwfontboldb=cmbx10 scaled \magstep2 \font\fwfontboldc=cmbx10 scaled \magstep3 \font\fwfontboldd=cmbx10 scaled \magstep4 % Macros for Stylistic Details % ---------------------------- % This section contains all the fiddly little macros for setting the details % of each macro definition. % Macro definitions are sandwiched by calls to these macros which can be used % to sort out the spacing before and after the macro definition. \def\fwbeginmacro{\fwparskipoff\bigskip} \def\fwendmacro{\fwparskipon\par} % These macros deal with the macro name and definition line. \def\fwmacroname#1#2{{\sl #1\/}$\lbrack$#2$\rbrack$} \def\fwfilename#1#2{{\bf #1}$\lbrack$#2$\rbrack$} \def\fwzero#1{{\bf Z}} \def\fwmany#1{{\bf M}} \def\fwlib#1{{\bf L}} \def\fwequals{ $\equiv$} \def\fwplusequals{ $+\equiv$} % Now for the actual body of the definition. It looks nice to have the tt % code indented a little. Again, we use macros instead of writing direct TeX, % so as to allow the user to fiddle this stuff to taste without having to % modify the FunnelWeb C code. \def\fwodef{\parindent=15pt\vskip0pt$\lbrace$\parindent=20pt} \def\fwcdef{$\rbrace$\vskip0pt\parindent=0pt} \def\fwoquote{`} \def\fwcquote{'} \def\fwoparen{$($} \def\fwcomma{$,$} \def\fwcparen{$)$} \def\fwparam#1{$\diamond #1$} \def\fwparams#1{$(\diamond #1)$} % These macros deal with the notes that are appended at the end of each % macro definition. Note that even though \fwisafile,\fwusedin, and \fwseealso % have the same definition, they are given different names so as to allow the % user to redefine these macros to typeset each kind of information differently % if desired. \def\fwbeginmacronotes{\begingroup\baselineskip=9pt\smallskip} \def\fwnote#1{{\fwfontnote #1}\par} \def\fwisafile#1{\fwnote{#1}} \def\fwusedin#1{\fwnote{#1}} \def\fwseealso#1{\fwnote{#1}} \def\fwendmacronotes{\endgroup} % Macros to Typeset Program Code Verbatim % --------------------------------------- % This is by far the hairiest and most difficult part of the typesetting task % because we have to turn off most of TeX's natural instincts in order to % typeset the program text exactly as it appears in the input file. % Two macros are defined to pull this off: \fwbtx and \fwverbatimgobble. % Their code was inspired by the following sections of "The TeXbook": % Appendix D: Dirty Tricks, 3.Verbatim listing, p.380-382. % Appendix E: Example Formats, p.421. % The \fwbtx[ (for "FunnelWeb Begin TeXt") macro does most of the hard work. % The liberal use of "%" is because I don't understand TeX well enough to % understand when an end of line will cause trouble, and I am playing it safe. % Before defining the main \fwbtx macro, we have to stash away some definitions % in the hidden part of TeX's environment. Let's hope that these "hidden" % definitions don't affect anything except what is desired to be affected. % The tt font in which we wish to set the text has two Latin lurking ligatures! % These are ?` and !`. To disable them, we define the left quote when ACTIVE % to be defined in such a way as to prevent ligatures. The main TeX text will % normally not be exposed to this definition because normally the leftquote % character is not active. The \fwbtx macro temporarily makes the left quote % character active thus activating the deactivation of left quote ligatures. % See The TeXbook p.381. {\catcode`\`=\active \gdef`{\relax\lq}} % TeX is fairly carefree about spaces and so we have to make it more serious. % To do so we pull the same trick as above, setting up a definition for active % space, but only making space active during the span of the verbatim text. % In Plain TeX the active space is defined to be simply a space, but here we % define it to be a control space. This ensures that the space cannot % be gobbled up by one of TeX's mysterious mechanisms when activated. % See The TeXbook, p.381 and p.352. {\obeyspaces\global\let =\ } % Here is the main \fwbtx verbatim text macro. % Note: The order in which all these pieces of business have to be done is % still a partial mystery to me. Don't fiddle with this stuff unless you % think you know what you are doing. \def\fwbtx[{% % % The funnies involved in getting verbatim output are safely housed inside % this \begingroup, and the \endgroup in \fwverbatimgobble. Groups are used % instead of curly braces because we have to be able to signal the end of % this macro with a curly brace. \begingroup% % % \pars at the end of empty lines in the verbatim text won't come out normally % because TeX is in vertical mode and they get gobbled up. To prevent this, % we force \par to exit vertical mode first. See The TeXbook p.381. \def\par{\leavevmode\endgraf}% % % Activate the leftquote character so as to avoid ligatures (see above). \catcode`\`=\active% % % The \obeylines macro simply defines end of line (^M) to be \par. This ensures % that TeX will treat each verbatim line as a new paragraph. \obeylines% % % To get verbatim output, we have to desex all the special characters. This % is explained in detail in The TeXbook p.380. \def\do##1{\catcode`##1=12 }\dospecials% % % Activate the space character so as to make TeX treat blanks seriously. % This activation invokes an eralier definition (see above). \obeyspaces % % Interparagraph skips do not help the cause. % Note: We have to preserve the indentation though, as the code is actually % indented in the final output. See \fwodef in an earlier section. \parskip=0pt% % % We typeset the verbatim text in tt font (courier on the Macintosh) for a % number of reasons: % - tt font has the same horizontal spacing for each character. % - tt font covers the ASCII character set. % - tt font doesn't have many surprises (e.g. ligatures). % - tt font looks much what you might see on a computer terminal screen. \tt% % % Having set up an environment for verbatim, we are ready to use it. % By invoking \fwverbatimgobble, this \fwbtx macro gobbles up text verbatim (as % part of the parameter of \fwverbatimgobble) until it sees the termination % string "]fwetx=" (the "=" was thrown in to add obscurity as this sequence % must never occur in the verbatim text). \fwverbatimgobble} % The \fwverbatimgobble macro exists to allow \fwbtx to bracket verbatim text. \def\fwverbatimgobble#1]fwetx={#1\endgroup} % Table of Contents % ----------------- % The five levels of table of contents that FunnelWeb supports are identified % by the five letters [A..E]. These are used throughout the following macros. % The following macros are utilities to the TOC macros to follow. \def\fwrule{\medskip\hrule\medskip} \def\fwqh{\hskip1.5em\relax} \def\fwbeforesec{\penalty-200\bigskip\medskip\par} % The following macros are used to typeset the table of contents. \def\fwtocstart#1{\fwrule\leftline{\fwfontbolda Table of Contents}\fwrule} \def\fwtoca#1#2{\leftline{{\bf #1 #2}}} \def\fwtocb#1#2{\leftline{\fwqh #1 #2}} \def\fwtocc#1#2{\leftline{\fwqh\fwqh #1 #2}} \def\fwtocd#1#2{\leftline{\fwqh\fwqh\fwqh #1 #2}} \def\fwtoce#1#2{\leftline{\fwqh\fwqh\fwqh\fwqh #1 #2}} \def\fwtocfinish#1{\fwrule} % The following "library" macros define five different strengths of headings % which can be used later in the section macros. \def\fwliba#1#2{\vfill\eject{\fwfontboldc #1 #2}\penalty200\smallskip} \def\fwlibb#1#2{\fwbeforesec{\fwfontboldb #1 #2}\penalty200\smallskip} \def\fwlibc#1#2{\fwbeforesec{\fwfontnormb #1 #2}\penalty200\smallskip} \def\fwlibd#1#2{\fwbeforesec{\bf #1 #2}\penalty200} \def\fwlibe#1#2{\fwbeforesec{\bf #1 #2}} % Here are the macros that actually typeset the section headings throughout % the document. The fwlib system has been employed so as to easily allow the % user to redefine the strengths of headings to taste. For example, the % user could insert in the input document a similar set of definitions to these % but with the b..e headings set to \fwlibc. This would tone down the output. \def\fwseca#1#2{\fwliba{#1}{#2}} \def\fwsecb#1#2{\fwlibb{#1}{#2}} \def\fwsecc#1#2{\fwlibc{#1}{#2}} \def\fwsecd#1#2{\fwlibd{#1}{#2}} \def\fwsece#1#2{\fwlibe{#1}{#2}} % Support for Explicit Typesetting % -------------------------------- % FunnelWeb supports pragmas and other constructs that allow % typesetter-independent typesetting commands to be given. The % following macros support these features. % The in-text literal @{sloth@} and emphasise @[walrus@] features. \def\fwlit#1{{\tt #1}} \def\fwemp#1{{\it #1}} % The "@p new_page" pragma. \def\fwnewpage{\vfill\eject} % The "@p vskip Nmm" pragma. \def\fwvskip#1{\null\vskip #1mm} % The "@p title " pragma. \def\fwfontnormal#1{{\fwfontnorm {#1}}} \def\fwfonttitle#1{{\fwfontboldd {#1}}} \def\fwfontsmalltitle#1{{\fwfontboldb {#1}}} \def\fwleftline#1{\leftline{#1}} \def\fwcenterline#1{\centerline{#1}} \def\fwrightline#1{\rightline{#1}} % Support for Old FunnelWeb % ------------------------- % The following macros were used extensively in the first version of % FunnelWeb and are retained so that these older input files will still % typeset cleanly. \def\p#1{{\tt #1}} % P for Program text. \def\flagpage#1#2{ \null \vfill \centerline{\fwfontboldd #1} \vskip 1cm \centerline{\fwfontboldd #2} \vfill \null \vfill } %====================== End of FunnelWeb TeX Definitions ======================= EX13: This example is used to generate typeset documentation which is discussed in the tutorial in the FunnelWeb user's manual. \fwseca{1}{Table of Contents} \fwtocstart{} \fwtoca{1}{Table of Contents} \fwtoca{2}{Macros for Moral Support} \fwtoca{3}{An Extremely Imperative Stack Abstraction} \fwtocb{3.1}{Define the Stack} \fwtocb{3.2}{Push the Stack} \fwtocb{3.3}{Pop the Stack} \fwtocb{3.4}{Rough the Stack Up a Bit} \fwtocfinish{} \fwseca{2}{Macros for Moral Support} The following macro contain comments that provide moral support in the output code. \fwbeginmacro \fwmacroname{Programmer's Cheer}{1}\fwmany{}\fwequals \fwodef \fwbtx[ -- Shift to the left! -- Shift to the right! -- Pop up, push down! -- Byte! Byte! Byte! -- (From "The New Hacker's Dictionary"). ]fwetx=% \fwcdef \fwbeginmacronotes \fwusedin{This macro is invoked in definitions 6 and 8.} \fwendmacronotes \fwendmacro The next macro is similar but is distributed throughout the program. \fwbeginmacro \fwmacroname{Hacker's Cheer}{2}\fwplusequals \fwodef \fwbtx[ -- Pointer to the left ]fwetx=% \fwcdef \fwbeginmacronotes \fwseealso{This macro is defined in definitions 2, 3, 5, 7 and 9.} \fwusedin{This macro is invoked in definition 10.} \fwendmacronotes \fwendmacro \fwseca{3}{An Extremely Imperative Stack Abstraction} \fwsecb{3.1}{Define the Stack} \fwbeginmacro \fwmacroname{Hacker's Cheer}{3}\fwplusequals \fwodef \fwbtx[-- Pointer to the right ]fwetx=% \fwcdef \fwbeginmacronotes \fwseealso{This macro is defined in definitions 2, 3, 5, 7 and 9.} \fwusedin{This macro is invoked in definition 10.} \fwendmacronotes \fwendmacro \fwbeginmacro \fwmacroname{Stack Type}{4}\fwzero{}\fwequals \fwodef \fwbtx[type stack = record ... end;]fwetx=% \fwcdef \fwbeginmacronotes \fwusedin{This macro is NEVER invoked.} \fwendmacronotes \fwendmacro \fwsecb{3.2}{Push the Stack} \fwbeginmacro \fwmacroname{Hacker's Cheer}{5}\fwplusequals \fwodef \fwbtx[-- Hack that code ]fwetx=% \fwcdef \fwbeginmacronotes \fwseealso{This macro is defined in definitions 2, 3, 5, 7 and 9.} \fwusedin{This macro is invoked in definition 10.} \fwendmacronotes \fwendmacro \fwbeginmacro \fwmacroname{Push Procedure}{6}\fwzero{}\fwequals \fwodef \fwbtx[procedure push(var b:stack; v:value); ]fwetx=% \fwmacroname{Programmer's Cheer}{1}\fwbtx[ {...}]fwetx=% \fwcdef \fwbeginmacronotes \fwusedin{This macro is NEVER invoked.} \fwendmacronotes \fwendmacro \fwsecb{3.3}{Pop the Stack} \fwbeginmacro \fwmacroname{Hacker's Cheer}{7}\fwplusequals \fwodef \fwbtx[-- Tight! Tight! Tight! ]fwetx=% \fwcdef \fwbeginmacronotes \fwseealso{This macro is defined in definitions 2, 3, 5, 7 and 9.} \fwusedin{This macro is invoked in definition 10.} \fwendmacronotes \fwendmacro \fwbeginmacro \fwmacroname{Pop Procedure}{8}\fwzero{}\fwequals \fwodef \fwbtx[procedure pop(var b:stack); ]fwetx=% \fwmacroname{Programmer's Cheer}{1}\fwbtx[ {...}]fwetx=% \fwcdef \fwbeginmacronotes \fwusedin{This macro is NEVER invoked.} \fwendmacronotes \fwendmacro \fwsecb{3.4}{Rough the Stack Up a Bit} \fwbeginmacro \fwmacroname{Hacker's Cheer}{9}\fwplusequals \fwodef \fwbtx[-- (RNW, 04-Jan-1991). ]fwetx=% \fwcdef \fwbeginmacronotes \fwseealso{This macro is defined in definitions 2, 3, 5, 7 and 9.} \fwusedin{This macro is invoked in definition 10.} \fwendmacronotes \fwendmacro \fwbeginmacro \fwmacroname{Rough Procedure}{10}\fwzero{}\fwequals \fwodef \fwbtx[procedure rough(var b:stack); ]fwetx=% \fwmacroname{Hacker's Cheer}{2}\fwbtx[ {...}]fwetx=% \fwcdef \fwbeginmacronotes \fwusedin{This macro is NEVER invoked.} \fwendmacronotes \fwendmacro \fwbeginmacro \fwfilename{dummy.txt}{11}\fwequals \fwodef \fwbtx[dummy ]fwetx=% \fwcdef \fwbeginmacronotes \fwisafile{This macro is attached to an output file.} \fwendmacronotes \fwendmacro \bye %******************************************************************************* %* END OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* this definition because normally the leftquote % character is not active. The \fwbtx macro temporarily makes the left quote % character active thus activating the deactivatiofw_src/answers/ex14.htm 644 0 0 5473 6717354007 10267 Package ex14

EX14: This example demonstrates the literal and emphasis typesetting constructs.

The following procedure put_sloth writes the sloth variable to the output file. Note: The output file must be opened for writing at this point or the program will crash!

1. File: ex14.out={dummy
}
This macro is attached to an output file.


End Of File

lowing macros are used to typeset the table of contents. \def\fwtocstart#1{\fwrule\leftline{\fwfontbolda Table of Contents}\fwrule} \def\fwtoca#1#2{\leftline{{\bf #1 #2}}} \def\fwtocb#1#2{\leftlinefw_src/answers/ex14.lis 644 0 0 532 6717354006 10234 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Weave: Completed <>. Weave: Completed <>. SUCCESS: No diagnostics. xample, the % user could insert in the input document a similar set of definitions to these % but with the b..e headings set to \fwlibc. This would tone down the outpfw_src/answers/ex14.tex 644 0 0 36121 6717354006 10310 %******************************************************************************* %* START OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* %* * %* This TeX file was automatically generated by the FunnelWeb preprocessor. * %* You can typeset this file to produce printed documentation by running it * %* through the TeX typesetter using a command such as: * %* tex thisfilename * %* The resultant file thisfilename.dvi can be printed using a command such as: * %* lpr -Plaser -d thisfilename.dvi * %* * %* FunnelWeb is a preprocessor that allows programmers to weave programs and * %* their documentation together in a single document. The FunnelWeb program * %* analyses such documents producing both program files and typeset * %* documentation such as this TeX file. * %* FunnelWeb was created by Ross N. Williams. * %* * %* For more information on FunnelWeb see http://www.ross.net/funnelweb/ * %* * %******************************************************************************* %===================== Start of FunnelWeb TeX Definitions ====================== % Version % ------- % This is FunnelWeb TeX Macro Library Version 1.0. % Copyright % --------- % This set of FunnelWeb TeX definitions was written by Ross Williams and was % originally Copyright (C) 1992 Ross N. Williams. However, I, Ross Williams, % hereby forego any claim to Copyright in this set of FunnelWeb TeX definitions % and hereby authorize that the set of TeX definitions pass into the public % domain. -- Ross N. Williams, 3:41pm 07-May-1992, Adelaide, Australia. % Modification % ------------ % Please record all modifications to these TeX definitions here. Unless % otherwise specified, all modified definitions fall in the public domain too. % % Programmers: % RNW Ross N. Williams ross@ross.net % % Changes: % 07-May-1992 RNW Prepared this work for public domain release. % 10-May-1999 RNW Added \fwlib macro. % General Comments % ---------------- % This set of TeX definitions exists for two reasons: % % 1. To shorten and neaten the FunnelWeb TeX output. % 2. To allow users to fiddle with the output format in their input files % (by inserting redefining "\def"s) without having to resort to % modifying the FunnelWeb code. % % The user is warned that these definitions may be changed from time to time % (but probably not much). The user should not be too sneaky. In particular, % users wishing to redefine some of these macros should do so in an explicitly % defined section at the top of their input file. This will mean that in the % event of problems, that section can simply be deleted or commented out to % allow the document to at least be typeset in the default format. Users should % limit themselves to redefining these macros in such a section and should % refrain from using the macros throughout their documents. % Environment Parameters % ---------------------- % \tolerance tells TeX how tolerant it should be about making bad line and % page breaks. Here we set it to it's maximum, as % 1) Computer programs are likely to cause lots of bad breaks. % 2) In most cases the user would probably rather get the TeX file through % TeX without any errors than fiddle with spacings for perfection. \tolerance=10000 % I don't like indentation as it makes the page look more busy. Instead, % paragraphs are separated by a little space (see next). \parindent=0pt % In many cases, users will produce documents with long runs of paragraphs. % In order to space out these paragraphs, it is convenient to maintain a % prevailing non-zero \parskip (end-of-paragaph skip). The only trouble is % that the skip becomes a problem in macro definitions which require no skip % and so we have to turn the skip on and off. The following two macros % simplify this process. \def\fwparskipon{\parskip=\medskipamount} \def\fwparskipoff{\parskip=0pt} \fwparskipon % Setting raggedbottom allows TeX to leave a bit of space at the bottom of the % page in order to better vertically align the rest of the page (e.g. skips % won't stretch as much). It also means that headings are less likely to be % isolated at the bottom of the page without any following text. \raggedbottom % Fonts % ----- % Most of the typeset output is set in 10pt roman and 10pt tt font. % The major extra font needs spring from titles and headings. % For portability's sake we use only the following fonts: % cmr10 % cmbx10 % cmtt10 % and some enlargements of them. These fonts are all "standard" fonts % in Plain TeX. See The TeXbook p.350. \font\fwfontnote=cmr7 \font\fwfontnorm=cmr10 \font\fwfontnorma=cmr10 scaled \magstep1 \font\fwfontnormb=cmr10 scaled \magstep2 \font\fwfontbold=cmbx10 \font\fwfontbolda=cmbx10 scaled \magstep1 \font\fwfontboldb=cmbx10 scaled \magstep2 \font\fwfontboldc=cmbx10 scaled \magstep3 \font\fwfontboldd=cmbx10 scaled \magstep4 % Macros for Stylistic Details % ---------------------------- % This section contains all the fiddly little macros for setting the details % of each macro definition. % Macro definitions are sandwiched by calls to these macros which can be used % to sort out the spacing before and after the macro definition. \def\fwbeginmacro{\fwparskipoff\bigskip} \def\fwendmacro{\fwparskipon\par} % These macros deal with the macro name and definition line. \def\fwmacroname#1#2{{\sl #1\/}$\lbrack$#2$\rbrack$} \def\fwfilename#1#2{{\bf #1}$\lbrack$#2$\rbrack$} \def\fwzero#1{{\bf Z}} \def\fwmany#1{{\bf M}} \def\fwlib#1{{\bf L}} \def\fwequals{ $\equiv$} \def\fwplusequals{ $+\equiv$} % Now for the actual body of the definition. It looks nice to have the tt % code indented a little. Again, we use macros instead of writing direct TeX, % so as to allow the user to fiddle this stuff to taste without having to % modify the FunnelWeb C code. \def\fwodef{\parindent=15pt\vskip0pt$\lbrace$\parindent=20pt} \def\fwcdef{$\rbrace$\vskip0pt\parindent=0pt} \def\fwoquote{`} \def\fwcquote{'} \def\fwoparen{$($} \def\fwcomma{$,$} \def\fwcparen{$)$} \def\fwparam#1{$\diamond #1$} \def\fwparams#1{$(\diamond #1)$} % These macros deal with the notes that are appended at the end of each % macro definition. Note that even though \fwisafile,\fwusedin, and \fwseealso % have the same definition, they are given different names so as to allow the % user to redefine these macros to typeset each kind of information differently % if desired. \def\fwbeginmacronotes{\begingroup\baselineskip=9pt\smallskip} \def\fwnote#1{{\fwfontnote #1}\par} \def\fwisafile#1{\fwnote{#1}} \def\fwusedin#1{\fwnote{#1}} \def\fwseealso#1{\fwnote{#1}} \def\fwendmacronotes{\endgroup} % Macros to Typeset Program Code Verbatim % --------------------------------------- % This is by far the hairiest and most difficult part of the typesetting task % because we have to turn off most of TeX's natural instincts in order to % typeset the program text exactly as it appears in the input file. % Two macros are defined to pull this off: \fwbtx and \fwverbatimgobble. % Their code was inspired by the following sections of "The TeXbook": % Appendix D: Dirty Tricks, 3.Verbatim listing, p.380-382. % Appendix E: Example Formats, p.421. % The \fwbtx[ (for "FunnelWeb Begin TeXt") macro does most of the hard work. % The liberal use of "%" is because I don't understand TeX well enough to % understand when an end of line will cause trouble, and I am playing it safe. % Before defining the main \fwbtx macro, we have to stash away some definitions % in the hidden part of TeX's environment. Let's hope that these "hidden" % definitions don't affect anything except what is desired to be affected. % The tt font in which we wish to set the text has two Latin lurking ligatures! % These are ?` and !`. To disable them, we define the left quote when ACTIVE % to be defined in such a way as to prevent ligatures. The main TeX text will % normally not be exposed to this definition because normally the leftquote % character is not active. The \fwbtx macro temporarily makes the left quote % character active thus activating the deactivation of left quote ligatures. % See The TeXbook p.381. {\catcode`\`=\active \gdef`{\relax\lq}} % TeX is fairly carefree about spaces and so we have to make it more serious. % To do so we pull the same trick as above, setting up a definition for active % space, but only making space active during the span of the verbatim text. % In Plain TeX the active space is defined to be simply a space, but here we % define it to be a control space. This ensures that the space cannot % be gobbled up by one of TeX's mysterious mechanisms when activated. % See The TeXbook, p.381 and p.352. {\obeyspaces\global\let =\ } % Here is the main \fwbtx verbatim text macro. % Note: The order in which all these pieces of business have to be done is % still a partial mystery to me. Don't fiddle with this stuff unless you % think you know what you are doing. \def\fwbtx[{% % % The funnies involved in getting verbatim output are safely housed inside % this \begingroup, and the \endgroup in \fwverbatimgobble. Groups are used % instead of curly braces because we have to be able to signal the end of % this macro with a curly brace. \begingroup% % % \pars at the end of empty lines in the verbatim text won't come out normally % because TeX is in vertical mode and they get gobbled up. To prevent this, % we force \par to exit vertical mode first. See The TeXbook p.381. \def\par{\leavevmode\endgraf}% % % Activate the leftquote character so as to avoid ligatures (see above). \catcode`\`=\active% % % The \obeylines macro simply defines end of line (^M) to be \par. This ensures % that TeX will treat each verbatim line as a new paragraph. \obeylines% % % To get verbatim output, we have to desex all the special characters. This % is explained in detail in The TeXbook p.380. \def\do##1{\catcode`##1=12 }\dospecials% % % Activate the space character so as to make TeX treat blanks seriously. % This activation invokes an eralier definition (see above). \obeyspaces % % Interparagraph skips do not help the cause. % Note: We have to preserve the indentation though, as the code is actually % indented in the final output. See \fwodef in an earlier section. \parskip=0pt% % % We typeset the verbatim text in tt font (courier on the Macintosh) for a % number of reasons: % - tt font has the same horizontal spacing for each character. % - tt font covers the ASCII character set. % - tt font doesn't have many surprises (e.g. ligatures). % - tt font looks much what you might see on a computer terminal screen. \tt% % % Having set up an environment for verbatim, we are ready to use it. % By invoking \fwverbatimgobble, this \fwbtx macro gobbles up text verbatim (as % part of the parameter of \fwverbatimgobble) until it sees the termination % string "]fwetx=" (the "=" was thrown in to add obscurity as this sequence % must never occur in the verbatim text). \fwverbatimgobble} % The \fwverbatimgobble macro exists to allow \fwbtx to bracket verbatim text. \def\fwverbatimgobble#1]fwetx={#1\endgroup} % Table of Contents % ----------------- % The five levels of table of contents that FunnelWeb supports are identified % by the five letters [A..E]. These are used throughout the following macros. % The following macros are utilities to the TOC macros to follow. \def\fwrule{\medskip\hrule\medskip} \def\fwqh{\hskip1.5em\relax} \def\fwbeforesec{\penalty-200\bigskip\medskip\par} % The following macros are used to typeset the table of contents. \def\fwtocstart#1{\fwrule\leftline{\fwfontbolda Table of Contents}\fwrule} \def\fwtoca#1#2{\leftline{{\bf #1 #2}}} \def\fwtocb#1#2{\leftline{\fwqh #1 #2}} \def\fwtocc#1#2{\leftline{\fwqh\fwqh #1 #2}} \def\fwtocd#1#2{\leftline{\fwqh\fwqh\fwqh #1 #2}} \def\fwtoce#1#2{\leftline{\fwqh\fwqh\fwqh\fwqh #1 #2}} \def\fwtocfinish#1{\fwrule} % The following "library" macros define five different strengths of headings % which can be used later in the section macros. \def\fwliba#1#2{\vfill\eject{\fwfontboldc #1 #2}\penalty200\smallskip} \def\fwlibb#1#2{\fwbeforesec{\fwfontboldb #1 #2}\penalty200\smallskip} \def\fwlibc#1#2{\fwbeforesec{\fwfontnormb #1 #2}\penalty200\smallskip} \def\fwlibd#1#2{\fwbeforesec{\bf #1 #2}\penalty200} \def\fwlibe#1#2{\fwbeforesec{\bf #1 #2}} % Here are the macros that actually typeset the section headings throughout % the document. The fwlib system has been employed so as to easily allow the % user to redefine the strengths of headings to taste. For example, the % user could insert in the input document a similar set of definitions to these % but with the b..e headings set to \fwlibc. This would tone down the output. \def\fwseca#1#2{\fwliba{#1}{#2}} \def\fwsecb#1#2{\fwlibb{#1}{#2}} \def\fwsecc#1#2{\fwlibc{#1}{#2}} \def\fwsecd#1#2{\fwlibd{#1}{#2}} \def\fwsece#1#2{\fwlibe{#1}{#2}} % Support for Explicit Typesetting % -------------------------------- % FunnelWeb supports pragmas and other constructs that allow % typesetter-independent typesetting commands to be given. The % following macros support these features. % The in-text literal @{sloth@} and emphasise @[walrus@] features. \def\fwlit#1{{\tt #1}} \def\fwemp#1{{\it #1}} % The "@p new_page" pragma. \def\fwnewpage{\vfill\eject} % The "@p vskip Nmm" pragma. \def\fwvskip#1{\null\vskip #1mm} % The "@p title " pragma. \def\fwfontnormal#1{{\fwfontnorm {#1}}} \def\fwfonttitle#1{{\fwfontboldd {#1}}} \def\fwfontsmalltitle#1{{\fwfontboldb {#1}}} \def\fwleftline#1{\leftline{#1}} \def\fwcenterline#1{\centerline{#1}} \def\fwrightline#1{\rightline{#1}} % Support for Old FunnelWeb % ------------------------- % The following macros were used extensively in the first version of % FunnelWeb and are retained so that these older input files will still % typeset cleanly. \def\p#1{{\tt #1}} % P for Program text. \def\flagpage#1#2{ \null \vfill \centerline{\fwfontboldd #1} \vskip 1cm \centerline{\fwfontboldd #2} \vfill \null \vfill } %====================== End of FunnelWeb TeX Definitions ======================= EX14: This example demonstrates the literal and emphasis typesetting constructs. The following procedure \fwlit{put\_sloth} writes the \fwlit{sloth} variable to the output file. Note: \fwemp{The output file must be opened for writing at this point or the program will crash!} \fwbeginmacro \fwfilename{ex14.out}{1}\fwequals \fwodef \fwbtx[dummy ]fwetx=% \fwcdef \fwbeginmacronotes \fwisafile{This macro is attached to an output file.} \fwendmacronotes \fwendmacro \bye %******************************************************************************* %* END OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* fontnote=cmr7 \font\fwfontnorm=cmr10 \font\fwfontnorma=cmr10 scaled \magstep1 \font\fwfontnormb=cmr10 scaled \magstep2 \font\fwfontbold=cmbx10 \font\fwfontbolda=cmbx10 scaled \magstep1 \font\fwfontboldb=cmbx10 scaled \magstep2 \font\fwfontboldc=cmbx10 scaled \magstep3 \font\fwfontboldd=cmbx10 scaled \magstep4 % Macros for Stylistic Details % ---------------------------- % This section contains all the fiddly little macros ffw_src/answers/ex15.htm 644 0 0 7415 6717354010 10260 Package ex15

EX15: This example demonstrates some of FunnelWeb's generic typesetting constructs.





Hairy Wombat

Simulation


A Program in Six Parts

Simulating the Life of Some Hairy Wombats



By Zqitzypbuswapzra Ypongtatoslrtzz


1. Section One
2. Section Two



1. Section One


2. Section Two

1. File: ex15.out={Dummy
}
This macro is attached to an output file.


End Of File

ce \par to exit vertical mode first. See The TeXbook p.381. \def\par{\leavevmode\endgraf}% % % Activate the leftquote character so as to avoid ligatures (see above). \catcode`\`=\active% % % The \obeylines macro simply defines end of line (^M)fw_src/answers/ex15.lis 644 0 0 532 6717354010 10230 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Weave: Completed <>. Weave: Completed <>. SUCCESS: No diagnostics. many surprises (e.g. ligatures). % - tt font looks much what you might see on a computer terminal screen. \tt% % % Having set up an environment for verbatim, we arfw_src/answers/ex15.tex 644 0 0 36557 6717354010 10321 %******************************************************************************* %* START OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* %* * %* This TeX file was automatically generated by the FunnelWeb preprocessor. * %* You can typeset this file to produce printed documentation by running it * %* through the TeX typesetter using a command such as: * %* tex thisfilename * %* The resultant file thisfilename.dvi can be printed using a command such as: * %* lpr -Plaser -d thisfilename.dvi * %* * %* FunnelWeb is a preprocessor that allows programmers to weave programs and * %* their documentation together in a single document. The FunnelWeb program * %* analyses such documents producing both program files and typeset * %* documentation such as this TeX file. * %* FunnelWeb was created by Ross N. Williams. * %* * %* For more information on FunnelWeb see http://www.ross.net/funnelweb/ * %* * %******************************************************************************* %===================== Start of FunnelWeb TeX Definitions ====================== % Version % ------- % This is FunnelWeb TeX Macro Library Version 1.0. % Copyright % --------- % This set of FunnelWeb TeX definitions was written by Ross Williams and was % originally Copyright (C) 1992 Ross N. Williams. However, I, Ross Williams, % hereby forego any claim to Copyright in this set of FunnelWeb TeX definitions % and hereby authorize that the set of TeX definitions pass into the public % domain. -- Ross N. Williams, 3:41pm 07-May-1992, Adelaide, Australia. % Modification % ------------ % Please record all modifications to these TeX definitions here. Unless % otherwise specified, all modified definitions fall in the public domain too. % % Programmers: % RNW Ross N. Williams ross@ross.net % % Changes: % 07-May-1992 RNW Prepared this work for public domain release. % 10-May-1999 RNW Added \fwlib macro. % General Comments % ---------------- % This set of TeX definitions exists for two reasons: % % 1. To shorten and neaten the FunnelWeb TeX output. % 2. To allow users to fiddle with the output format in their input files % (by inserting redefining "\def"s) without having to resort to % modifying the FunnelWeb code. % % The user is warned that these definitions may be changed from time to time % (but probably not much). The user should not be too sneaky. In particular, % users wishing to redefine some of these macros should do so in an explicitly % defined section at the top of their input file. This will mean that in the % event of problems, that section can simply be deleted or commented out to % allow the document to at least be typeset in the default format. Users should % limit themselves to redefining these macros in such a section and should % refrain from using the macros throughout their documents. % Environment Parameters % ---------------------- % \tolerance tells TeX how tolerant it should be about making bad line and % page breaks. Here we set it to it's maximum, as % 1) Computer programs are likely to cause lots of bad breaks. % 2) In most cases the user would probably rather get the TeX file through % TeX without any errors than fiddle with spacings for perfection. \tolerance=10000 % I don't like indentation as it makes the page look more busy. Instead, % paragraphs are separated by a little space (see next). \parindent=0pt % In many cases, users will produce documents with long runs of paragraphs. % In order to space out these paragraphs, it is convenient to maintain a % prevailing non-zero \parskip (end-of-paragaph skip). The only trouble is % that the skip becomes a problem in macro definitions which require no skip % and so we have to turn the skip on and off. The following two macros % simplify this process. \def\fwparskipon{\parskip=\medskipamount} \def\fwparskipoff{\parskip=0pt} \fwparskipon % Setting raggedbottom allows TeX to leave a bit of space at the bottom of the % page in order to better vertically align the rest of the page (e.g. skips % won't stretch as much). It also means that headings are less likely to be % isolated at the bottom of the page without any following text. \raggedbottom % Fonts % ----- % Most of the typeset output is set in 10pt roman and 10pt tt font. % The major extra font needs spring from titles and headings. % For portability's sake we use only the following fonts: % cmr10 % cmbx10 % cmtt10 % and some enlargements of them. These fonts are all "standard" fonts % in Plain TeX. See The TeXbook p.350. \font\fwfontnote=cmr7 \font\fwfontnorm=cmr10 \font\fwfontnorma=cmr10 scaled \magstep1 \font\fwfontnormb=cmr10 scaled \magstep2 \font\fwfontbold=cmbx10 \font\fwfontbolda=cmbx10 scaled \magstep1 \font\fwfontboldb=cmbx10 scaled \magstep2 \font\fwfontboldc=cmbx10 scaled \magstep3 \font\fwfontboldd=cmbx10 scaled \magstep4 % Macros for Stylistic Details % ---------------------------- % This section contains all the fiddly little macros for setting the details % of each macro definition. % Macro definitions are sandwiched by calls to these macros which can be used % to sort out the spacing before and after the macro definition. \def\fwbeginmacro{\fwparskipoff\bigskip} \def\fwendmacro{\fwparskipon\par} % These macros deal with the macro name and definition line. \def\fwmacroname#1#2{{\sl #1\/}$\lbrack$#2$\rbrack$} \def\fwfilename#1#2{{\bf #1}$\lbrack$#2$\rbrack$} \def\fwzero#1{{\bf Z}} \def\fwmany#1{{\bf M}} \def\fwlib#1{{\bf L}} \def\fwequals{ $\equiv$} \def\fwplusequals{ $+\equiv$} % Now for the actual body of the definition. It looks nice to have the tt % code indented a little. Again, we use macros instead of writing direct TeX, % so as to allow the user to fiddle this stuff to taste without having to % modify the FunnelWeb C code. \def\fwodef{\parindent=15pt\vskip0pt$\lbrace$\parindent=20pt} \def\fwcdef{$\rbrace$\vskip0pt\parindent=0pt} \def\fwoquote{`} \def\fwcquote{'} \def\fwoparen{$($} \def\fwcomma{$,$} \def\fwcparen{$)$} \def\fwparam#1{$\diamond #1$} \def\fwparams#1{$(\diamond #1)$} % These macros deal with the notes that are appended at the end of each % macro definition. Note that even though \fwisafile,\fwusedin, and \fwseealso % have the same definition, they are given different names so as to allow the % user to redefine these macros to typeset each kind of information differently % if desired. \def\fwbeginmacronotes{\begingroup\baselineskip=9pt\smallskip} \def\fwnote#1{{\fwfontnote #1}\par} \def\fwisafile#1{\fwnote{#1}} \def\fwusedin#1{\fwnote{#1}} \def\fwseealso#1{\fwnote{#1}} \def\fwendmacronotes{\endgroup} % Macros to Typeset Program Code Verbatim % --------------------------------------- % This is by far the hairiest and most difficult part of the typesetting task % because we have to turn off most of TeX's natural instincts in order to % typeset the program text exactly as it appears in the input file. % Two macros are defined to pull this off: \fwbtx and \fwverbatimgobble. % Their code was inspired by the following sections of "The TeXbook": % Appendix D: Dirty Tricks, 3.Verbatim listing, p.380-382. % Appendix E: Example Formats, p.421. % The \fwbtx[ (for "FunnelWeb Begin TeXt") macro does most of the hard work. % The liberal use of "%" is because I don't understand TeX well enough to % understand when an end of line will cause trouble, and I am playing it safe. % Before defining the main \fwbtx macro, we have to stash away some definitions % in the hidden part of TeX's environment. Let's hope that these "hidden" % definitions don't affect anything except what is desired to be affected. % The tt font in which we wish to set the text has two Latin lurking ligatures! % These are ?` and !`. To disable them, we define the left quote when ACTIVE % to be defined in such a way as to prevent ligatures. The main TeX text will % normally not be exposed to this definition because normally the leftquote % character is not active. The \fwbtx macro temporarily makes the left quote % character active thus activating the deactivation of left quote ligatures. % See The TeXbook p.381. {\catcode`\`=\active \gdef`{\relax\lq}} % TeX is fairly carefree about spaces and so we have to make it more serious. % To do so we pull the same trick as above, setting up a definition for active % space, but only making space active during the span of the verbatim text. % In Plain TeX the active space is defined to be simply a space, but here we % define it to be a control space. This ensures that the space cannot % be gobbled up by one of TeX's mysterious mechanisms when activated. % See The TeXbook, p.381 and p.352. {\obeyspaces\global\let =\ } % Here is the main \fwbtx verbatim text macro. % Note: The order in which all these pieces of business have to be done is % still a partial mystery to me. Don't fiddle with this stuff unless you % think you know what you are doing. \def\fwbtx[{% % % The funnies involved in getting verbatim output are safely housed inside % this \begingroup, and the \endgroup in \fwverbatimgobble. Groups are used % instead of curly braces because we have to be able to signal the end of % this macro with a curly brace. \begingroup% % % \pars at the end of empty lines in the verbatim text won't come out normally % because TeX is in vertical mode and they get gobbled up. To prevent this, % we force \par to exit vertical mode first. See The TeXbook p.381. \def\par{\leavevmode\endgraf}% % % Activate the leftquote character so as to avoid ligatures (see above). \catcode`\`=\active% % % The \obeylines macro simply defines end of line (^M) to be \par. This ensures % that TeX will treat each verbatim line as a new paragraph. \obeylines% % % To get verbatim output, we have to desex all the special characters. This % is explained in detail in The TeXbook p.380. \def\do##1{\catcode`##1=12 }\dospecials% % % Activate the space character so as to make TeX treat blanks seriously. % This activation invokes an eralier definition (see above). \obeyspaces % % Interparagraph skips do not help the cause. % Note: We have to preserve the indentation though, as the code is actually % indented in the final output. See \fwodef in an earlier section. \parskip=0pt% % % We typeset the verbatim text in tt font (courier on the Macintosh) for a % number of reasons: % - tt font has the same horizontal spacing for each character. % - tt font covers the ASCII character set. % - tt font doesn't have many surprises (e.g. ligatures). % - tt font looks much what you might see on a computer terminal screen. \tt% % % Having set up an environment for verbatim, we are ready to use it. % By invoking \fwverbatimgobble, this \fwbtx macro gobbles up text verbatim (as % part of the parameter of \fwverbatimgobble) until it sees the termination % string "]fwetx=" (the "=" was thrown in to add obscurity as this sequence % must never occur in the verbatim text). \fwverbatimgobble} % The \fwverbatimgobble macro exists to allow \fwbtx to bracket verbatim text. \def\fwverbatimgobble#1]fwetx={#1\endgroup} % Table of Contents % ----------------- % The five levels of table of contents that FunnelWeb supports are identified % by the five letters [A..E]. These are used throughout the following macros. % The following macros are utilities to the TOC macros to follow. \def\fwrule{\medskip\hrule\medskip} \def\fwqh{\hskip1.5em\relax} \def\fwbeforesec{\penalty-200\bigskip\medskip\par} % The following macros are used to typeset the table of contents. \def\fwtocstart#1{\fwrule\leftline{\fwfontbolda Table of Contents}\fwrule} \def\fwtoca#1#2{\leftline{{\bf #1 #2}}} \def\fwtocb#1#2{\leftline{\fwqh #1 #2}} \def\fwtocc#1#2{\leftline{\fwqh\fwqh #1 #2}} \def\fwtocd#1#2{\leftline{\fwqh\fwqh\fwqh #1 #2}} \def\fwtoce#1#2{\leftline{\fwqh\fwqh\fwqh\fwqh #1 #2}} \def\fwtocfinish#1{\fwrule} % The following "library" macros define five different strengths of headings % which can be used later in the section macros. \def\fwliba#1#2{\vfill\eject{\fwfontboldc #1 #2}\penalty200\smallskip} \def\fwlibb#1#2{\fwbeforesec{\fwfontboldb #1 #2}\penalty200\smallskip} \def\fwlibc#1#2{\fwbeforesec{\fwfontnormb #1 #2}\penalty200\smallskip} \def\fwlibd#1#2{\fwbeforesec{\bf #1 #2}\penalty200} \def\fwlibe#1#2{\fwbeforesec{\bf #1 #2}} % Here are the macros that actually typeset the section headings throughout % the document. The fwlib system has been employed so as to easily allow the % user to redefine the strengths of headings to taste. For example, the % user could insert in the input document a similar set of definitions to these % but with the b..e headings set to \fwlibc. This would tone down the output. \def\fwseca#1#2{\fwliba{#1}{#2}} \def\fwsecb#1#2{\fwlibb{#1}{#2}} \def\fwsecc#1#2{\fwlibc{#1}{#2}} \def\fwsecd#1#2{\fwlibd{#1}{#2}} \def\fwsece#1#2{\fwlibe{#1}{#2}} % Support for Explicit Typesetting % -------------------------------- % FunnelWeb supports pragmas and other constructs that allow % typesetter-independent typesetting commands to be given. The % following macros support these features. % The in-text literal @{sloth@} and emphasise @[walrus@] features. \def\fwlit#1{{\tt #1}} \def\fwemp#1{{\it #1}} % The "@p new_page" pragma. \def\fwnewpage{\vfill\eject} % The "@p vskip Nmm" pragma. \def\fwvskip#1{\null\vskip #1mm} % The "@p title " pragma. \def\fwfontnormal#1{{\fwfontnorm {#1}}} \def\fwfonttitle#1{{\fwfontboldd {#1}}} \def\fwfontsmalltitle#1{{\fwfontboldb {#1}}} \def\fwleftline#1{\leftline{#1}} \def\fwcenterline#1{\centerline{#1}} \def\fwrightline#1{\rightline{#1}} % Support for Old FunnelWeb % ------------------------- % The following macros were used extensively in the first version of % FunnelWeb and are retained so that these older input files will still % typeset cleanly. \def\p#1{{\tt #1}} % P for Program text. \def\flagpage#1#2{ \null \vfill \centerline{\fwfontboldd #1} \vskip 1cm \centerline{\fwfontboldd #2} \vfill \null \vfill } %====================== End of FunnelWeb TeX Definitions ======================= EX15: This example demonstrates some of FunnelWeb's generic typesetting constructs. \fwvskip{40} \fwcenterline{\fwfonttitle{Hairy Wombat}} \fwcenterline{\fwfonttitle{Simulation}} \fwvskip{10} \fwcenterline{\fwfontsmalltitle{A Program in Six Parts}} \fwcenterline{\fwfontsmalltitle{Simulating the Life of Some Hairy Wombats}} \fwvskip{20} \fwleftline{\fwfontnormal{By Zqitzypbuswapzra Ypongtatoslrtzz}} \fwnewpage \fwtocstart{} \fwtoca{1}{Section One} \fwtoca{2}{Section Two} \fwtocfinish{} \fwnewpage \fwseca{1}{Section One} \fwseca{2}{Section Two} \fwbeginmacro \fwfilename{ex15.out}{1}\fwequals \fwodef \fwbtx[Dummy ]fwetx=% \fwcdef \fwbeginmacronotes \fwisafile{This macro is attached to an output file.} \fwendmacronotes \fwendmacro \bye %******************************************************************************* %* END OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* dd=cmbx10 scaled \magstep4 % Macros for Stylistic Details % ---------------------------- % This section contains all the fiddly little macros ffw_src/answers/ex16.lis 644 0 0 525 6717354012 10235 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed ex16.out. Weave: Completed <>. SUCCESS: No diagnostics. \lbrace$\parindent=20pt} \def\fwcdef{$\rbrace$\vskip0pt\parindent=0pt} \def\fwoquote{`} \def\fwcquote{'} \def\fwoparen{$($} \def\fwcomma{$,$} \def\fwcparen{$)$} \def\fwparfw_src/answers/ex16.out 644 0 0 705 6717354013 10256 with text_io; use text_io; procedure example is n : constant natural := 10; -- How many numbers? (Ans: [1,n]). p : constant natural := 5; -- How many powers? (Ans: [1,p]). begin -- example for i in 1..n loop declare ip : natural := 1; begin for power in 1..p loop ip:=ip*i; put(natural'image(ip) & " "); end loop; new_line; end; end loop; end example; timgobble. % Their code was inspired by the following sectifw_src/answers/ex16.tex 644 0 0 42737 6717354013 10322 %******************************************************************************* %* START OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* %* * %* This TeX file was automatically generated by the FunnelWeb preprocessor. * %* You can typeset this file to produce printed documentation by running it * %* through the TeX typesetter using a command such as: * %* tex thisfilename * %* The resultant file thisfilename.dvi can be printed using a command such as: * %* lpr -Plaser -d thisfilename.dvi * %* * %* FunnelWeb is a preprocessor that allows programmers to weave programs and * %* their documentation together in a single document. The FunnelWeb program * %* analyses such documents producing both program files and typeset * %* documentation such as this TeX file. * %* FunnelWeb was created by Ross N. Williams. * %* * %* For more information on FunnelWeb see http://www.ross.net/funnelweb/ * %* * %******************************************************************************* %===================== Start of FunnelWeb TeX Definitions ====================== % Version % ------- % This is FunnelWeb TeX Macro Library Version 1.0. % Copyright % --------- % This set of FunnelWeb TeX definitions was written by Ross Williams and was % originally Copyright (C) 1992 Ross N. Williams. However, I, Ross Williams, % hereby forego any claim to Copyright in this set of FunnelWeb TeX definitions % and hereby authorize that the set of TeX definitions pass into the public % domain. -- Ross N. Williams, 3:41pm 07-May-1992, Adelaide, Australia. % Modification % ------------ % Please record all modifications to these TeX definitions here. Unless % otherwise specified, all modified definitions fall in the public domain too. % % Programmers: % RNW Ross N. Williams ross@ross.net % % Changes: % 07-May-1992 RNW Prepared this work for public domain release. % 10-May-1999 RNW Added \fwlib macro. % General Comments % ---------------- % This set of TeX definitions exists for two reasons: % % 1. To shorten and neaten the FunnelWeb TeX output. % 2. To allow users to fiddle with the output format in their input files % (by inserting redefining "\def"s) without having to resort to % modifying the FunnelWeb code. % % The user is warned that these definitions may be changed from time to time % (but probably not much). The user should not be too sneaky. In particular, % users wishing to redefine some of these macros should do so in an explicitly % defined section at the top of their input file. This will mean that in the % event of problems, that section can simply be deleted or commented out to % allow the document to at least be typeset in the default format. Users should % limit themselves to redefining these macros in such a section and should % refrain from using the macros throughout their documents. % Environment Parameters % ---------------------- % \tolerance tells TeX how tolerant it should be about making bad line and % page breaks. Here we set it to it's maximum, as % 1) Computer programs are likely to cause lots of bad breaks. % 2) In most cases the user would probably rather get the TeX file through % TeX without any errors than fiddle with spacings for perfection. \tolerance=10000 % I don't like indentation as it makes the page look more busy. Instead, % paragraphs are separated by a little space (see next). \parindent=0pt % In many cases, users will produce documents with long runs of paragraphs. % In order to space out these paragraphs, it is convenient to maintain a % prevailing non-zero \parskip (end-of-paragaph skip). The only trouble is % that the skip becomes a problem in macro definitions which require no skip % and so we have to turn the skip on and off. The following two macros % simplify this process. \def\fwparskipon{\parskip=\medskipamount} \def\fwparskipoff{\parskip=0pt} \fwparskipon % Setting raggedbottom allows TeX to leave a bit of space at the bottom of the % page in order to better vertically align the rest of the page (e.g. skips % won't stretch as much). It also means that headings are less likely to be % isolated at the bottom of the page without any following text. \raggedbottom % Fonts % ----- % Most of the typeset output is set in 10pt roman and 10pt tt font. % The major extra font needs spring from titles and headings. % For portability's sake we use only the following fonts: % cmr10 % cmbx10 % cmtt10 % and some enlargements of them. These fonts are all "standard" fonts % in Plain TeX. See The TeXbook p.350. \font\fwfontnote=cmr7 \font\fwfontnorm=cmr10 \font\fwfontnorma=cmr10 scaled \magstep1 \font\fwfontnormb=cmr10 scaled \magstep2 \font\fwfontbold=cmbx10 \font\fwfontbolda=cmbx10 scaled \magstep1 \font\fwfontboldb=cmbx10 scaled \magstep2 \font\fwfontboldc=cmbx10 scaled \magstep3 \font\fwfontboldd=cmbx10 scaled \magstep4 % Macros for Stylistic Details % ---------------------------- % This section contains all the fiddly little macros for setting the details % of each macro definition. % Macro definitions are sandwiched by calls to these macros which can be used % to sort out the spacing before and after the macro definition. \def\fwbeginmacro{\fwparskipoff\bigskip} \def\fwendmacro{\fwparskipon\par} % These macros deal with the macro name and definition line. \def\fwmacroname#1#2{{\sl #1\/}$\lbrack$#2$\rbrack$} \def\fwfilename#1#2{{\bf #1}$\lbrack$#2$\rbrack$} \def\fwzero#1{{\bf Z}} \def\fwmany#1{{\bf M}} \def\fwlib#1{{\bf L}} \def\fwequals{ $\equiv$} \def\fwplusequals{ $+\equiv$} % Now for the actual body of the definition. It looks nice to have the tt % code indented a little. Again, we use macros instead of writing direct TeX, % so as to allow the user to fiddle this stuff to taste without having to % modify the FunnelWeb C code. \def\fwodef{\parindent=15pt\vskip0pt$\lbrace$\parindent=20pt} \def\fwcdef{$\rbrace$\vskip0pt\parindent=0pt} \def\fwoquote{`} \def\fwcquote{'} \def\fwoparen{$($} \def\fwcomma{$,$} \def\fwcparen{$)$} \def\fwparam#1{$\diamond #1$} \def\fwparams#1{$(\diamond #1)$} % These macros deal with the notes that are appended at the end of each % macro definition. Note that even though \fwisafile,\fwusedin, and \fwseealso % have the same definition, they are given different names so as to allow the % user to redefine these macros to typeset each kind of information differently % if desired. \def\fwbeginmacronotes{\begingroup\baselineskip=9pt\smallskip} \def\fwnote#1{{\fwfontnote #1}\par} \def\fwisafile#1{\fwnote{#1}} \def\fwusedin#1{\fwnote{#1}} \def\fwseealso#1{\fwnote{#1}} \def\fwendmacronotes{\endgroup} % Macros to Typeset Program Code Verbatim % --------------------------------------- % This is by far the hairiest and most difficult part of the typesetting task % because we have to turn off most of TeX's natural instincts in order to % typeset the program text exactly as it appears in the input file. % Two macros are defined to pull this off: \fwbtx and \fwverbatimgobble. % Their code was inspired by the following sections of "The TeXbook": % Appendix D: Dirty Tricks, 3.Verbatim listing, p.380-382. % Appendix E: Example Formats, p.421. % The \fwbtx[ (for "FunnelWeb Begin TeXt") macro does most of the hard work. % The liberal use of "%" is because I don't understand TeX well enough to % understand when an end of line will cause trouble, and I am playing it safe. % Before defining the main \fwbtx macro, we have to stash away some definitions % in the hidden part of TeX's environment. Let's hope that these "hidden" % definitions don't affect anything except what is desired to be affected. % The tt font in which we wish to set the text has two Latin lurking ligatures! % These are ?` and !`. To disable them, we define the left quote when ACTIVE % to be defined in such a way as to prevent ligatures. The main TeX text will % normally not be exposed to this definition because normally the leftquote % character is not active. The \fwbtx macro temporarily makes the left quote % character active thus activating the deactivation of left quote ligatures. % See The TeXbook p.381. {\catcode`\`=\active \gdef`{\relax\lq}} % TeX is fairly carefree about spaces and so we have to make it more serious. % To do so we pull the same trick as above, setting up a definition for active % space, but only making space active during the span of the verbatim text. % In Plain TeX the active space is defined to be simply a space, but here we % define it to be a control space. This ensures that the space cannot % be gobbled up by one of TeX's mysterious mechanisms when activated. % See The TeXbook, p.381 and p.352. {\obeyspaces\global\let =\ } % Here is the main \fwbtx verbatim text macro. % Note: The order in which all these pieces of business have to be done is % still a partial mystery to me. Don't fiddle with this stuff unless you % think you know what you are doing. \def\fwbtx[{% % % The funnies involved in getting verbatim output are safely housed inside % this \begingroup, and the \endgroup in \fwverbatimgobble. Groups are used % instead of curly braces because we have to be able to signal the end of % this macro with a curly brace. \begingroup% % % \pars at the end of empty lines in the verbatim text won't come out normally % because TeX is in vertical mode and they get gobbled up. To prevent this, % we force \par to exit vertical mode first. See The TeXbook p.381. \def\par{\leavevmode\endgraf}% % % Activate the leftquote character so as to avoid ligatures (see above). \catcode`\`=\active% % % The \obeylines macro simply defines end of line (^M) to be \par. This ensures % that TeX will treat each verbatim line as a new paragraph. \obeylines% % % To get verbatim output, we have to desex all the special characters. This % is explained in detail in The TeXbook p.380. \def\do##1{\catcode`##1=12 }\dospecials% % % Activate the space character so as to make TeX treat blanks seriously. % This activation invokes an eralier definition (see above). \obeyspaces % % Interparagraph skips do not help the cause. % Note: We have to preserve the indentation though, as the code is actually % indented in the final output. See \fwodef in an earlier section. \parskip=0pt% % % We typeset the verbatim text in tt font (courier on the Macintosh) for a % number of reasons: % - tt font has the same horizontal spacing for each character. % - tt font covers the ASCII character set. % - tt font doesn't have many surprises (e.g. ligatures). % - tt font looks much what you might see on a computer terminal screen. \tt% % % Having set up an environment for verbatim, we are ready to use it. % By invoking \fwverbatimgobble, this \fwbtx macro gobbles up text verbatim (as % part of the parameter of \fwverbatimgobble) until it sees the termination % string "]fwetx=" (the "=" was thrown in to add obscurity as this sequence % must never occur in the verbatim text). \fwverbatimgobble} % The \fwverbatimgobble macro exists to allow \fwbtx to bracket verbatim text. \def\fwverbatimgobble#1]fwetx={#1\endgroup} % Table of Contents % ----------------- % The five levels of table of contents that FunnelWeb supports are identified % by the five letters [A..E]. These are used throughout the following macros. % The following macros are utilities to the TOC macros to follow. \def\fwrule{\medskip\hrule\medskip} \def\fwqh{\hskip1.5em\relax} \def\fwbeforesec{\penalty-200\bigskip\medskip\par} % The following macros are used to typeset the table of contents. \def\fwtocstart#1{\fwrule\leftline{\fwfontbolda Table of Contents}\fwrule} \def\fwtoca#1#2{\leftline{{\bf #1 #2}}} \def\fwtocb#1#2{\leftline{\fwqh #1 #2}} \def\fwtocc#1#2{\leftline{\fwqh\fwqh #1 #2}} \def\fwtocd#1#2{\leftline{\fwqh\fwqh\fwqh #1 #2}} \def\fwtoce#1#2{\leftline{\fwqh\fwqh\fwqh\fwqh #1 #2}} \def\fwtocfinish#1{\fwrule} % The following "library" macros define five different strengths of headings % which can be used later in the section macros. \def\fwliba#1#2{\vfill\eject{\fwfontboldc #1 #2}\penalty200\smallskip} \def\fwlibb#1#2{\fwbeforesec{\fwfontboldb #1 #2}\penalty200\smallskip} \def\fwlibc#1#2{\fwbeforesec{\fwfontnormb #1 #2}\penalty200\smallskip} \def\fwlibd#1#2{\fwbeforesec{\bf #1 #2}\penalty200} \def\fwlibe#1#2{\fwbeforesec{\bf #1 #2}} % Here are the macros that actually typeset the section headings throughout % the document. The fwlib system has been employed so as to easily allow the % user to redefine the strengths of headings to taste. For example, the % user could insert in the input document a similar set of definitions to these % but with the b..e headings set to \fwlibc. This would tone down the output. \def\fwseca#1#2{\fwliba{#1}{#2}} \def\fwsecb#1#2{\fwlibb{#1}{#2}} \def\fwsecc#1#2{\fwlibc{#1}{#2}} \def\fwsecd#1#2{\fwlibd{#1}{#2}} \def\fwsece#1#2{\fwlibe{#1}{#2}} % Support for Explicit Typesetting % -------------------------------- % FunnelWeb supports pragmas and other constructs that allow % typesetter-independent typesetting commands to be given. The % following macros support these features. % The in-text literal @{sloth@} and emphasise @[walrus@] features. \def\fwlit#1{{\tt #1}} \def\fwemp#1{{\it #1}} % The "@p new_page" pragma. \def\fwnewpage{\vfill\eject} % The "@p vskip Nmm" pragma. \def\fwvskip#1{\null\vskip #1mm} % The "@p title " pragma. \def\fwfontnormal#1{{\fwfontnorm {#1}}} \def\fwfonttitle#1{{\fwfontboldd {#1}}} \def\fwfontsmalltitle#1{{\fwfontboldb {#1}}} \def\fwleftline#1{\leftline{#1}} \def\fwcenterline#1{\centerline{#1}} \def\fwrightline#1{\rightline{#1}} % Support for Old FunnelWeb % ------------------------- % The following macros were used extensively in the first version of % FunnelWeb and are retained so that these older input files will still % typeset cleanly. \def\p#1{{\tt #1}} % P for Program text. \def\flagpage#1#2{ \null \vfill \centerline{\fwfontboldd #1} \vskip 1cm \centerline{\fwfontboldd #2} \vfill \null \vfill } %====================== End of FunnelWeb TeX Definitions ======================= \fwvskip{40} \fwcenterline{\fwfonttitle{Powers:}} \fwcenterline{\fwfonttitle{An Example of}} \fwcenterline{\fwfonttitle{A Short}} \fwcenterline{\fwfonttitle{FunnelWeb .fw File}} \fwvskip{10} \fwcenterline{\fwfontsmalltitle{by Ross Williams}} \fwcenterline{\fwfontsmalltitle{26 January 1992}} \fwvskip{20} \fwtocstart{} \fwtoca{1}{FunnelWeb Example Program} \fwtocb{1.1}{ex16.out} \fwtocb{1.2}{Pull in packages} \fwtocb{1.3}{Write out the first p powers of i on a single line} \fwtocfinish{} \fwseca{1}{FunnelWeb Example Program} This program writes out each of the first \fwlit{p} powers of the first \fwlit{n} integers. These constant parameters are located here so that they are easy to change. \fwbeginmacro \fwmacroname{Constants}{1}\fwequals \fwodef \fwbtx[n : constant natural := 10; -- How many numbers? (Ans: [1,n]). p : constant natural := 5; -- How many powers? (Ans: [1,p]).]fwetx=% \fwcdef \fwbeginmacronotes \fwusedin{This macro is invoked in definition 2.} \fwendmacronotes \fwendmacro \fwsecb{1.1}{ex16.out} Here is the outline of the program. This FunnelWeb file generates a single Ada output file called \fwlit{Power.ada}. The main program consists of a loop that iterates once for each number to be written out. \fwbeginmacro \fwfilename{ex16.out}{2}\fwequals \fwodef \fwmacroname{Pull in packages}{3}\fwbtx[ procedure example is ]fwetx=% \fwmacroname{Constants}{1}\fwbtx[ begin -- example for i in 1..n loop ]fwetx=% \fwmacroname{Write out the first p powers of i on a single line}{4}\fwbtx[ end loop; end example; ]fwetx=% \fwcdef \fwbeginmacronotes \fwisafile{This macro is attached to an output file.} \fwendmacronotes \fwendmacro \fwsecb{1.2}{Pull in packages} In this section, we pull in the packages that this program needs to run. In fact, all we need is the IO package so that we can write out the results. To use the IO package, we first of all need to haul it in (\fwlit{with text\_io}) and then we need to make all its identifiers visible at the top level (\fwlit{use text\_io}). \fwbeginmacro \fwmacroname{Pull in packages}{3}\fwequals \fwodef \fwbtx[with text_io; use text_io;]fwetx=% \fwcdef \fwbeginmacronotes \fwusedin{This macro is invoked in definition 2.} \fwendmacronotes \fwendmacro \fwsecb{1.3}{Write out the first p powers of i on a single line} Here is the bit that writes out the first \fwlit{p} powers of \fwlit{i}. The power values are calculated incrementally in \fwlit{ip} to avoid the use of the exponentiation operator. \fwbeginmacro \fwmacroname{Write out the first p powers of i on a single line}{4}\fwequals \fwodef \fwbtx[declare ip : natural := 1; begin for power in 1..p loop ip:=ip*i; put(natural'image(ip) & " "); end loop; new_line; end;]fwetx=% \fwcdef \fwbeginmacronotes \fwusedin{This macro is invoked in definition 2.} \fwendmacronotes \fwendmacro \bye %******************************************************************************* %* END OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* s inspired by the following sectifw_src/answers/generate.lis 644 0 0 606 6717353632 11253 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed sc06.fw. Tangle: Completed sc08.fw. Tangle: Completed sc09.fw. Tangle: Completed sc13e.fwi. SUCCESS: No diagnostics. racter is not active. The \fwbtx macro temporarily makes the left quote % character active thus activating the deactivatiofw_src/answers/hi01.lis 644 0 0 464 6717354014 10217 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed hi01.out. SUCCESS: No diagnostics. what you are doing. \def\fwbtx[{% % % The funnies involved in getting verbatim output are safely housed inside % this \begingroup, and the \endgroup in \fwverbatimgobble. Groups are used % instead of curfw_src/answers/hi01.out 644 0 0 220 6717354014 10225 while the_walrus_is_sleepy do begin writeln('zzzzzzz'); wake_up_the_walrus(the_walrus); writeln('Umpharumpha...'); end; all the special characters. This % is explained in detail in The TeXbook p.380. \def\do##1{\catcode`##1=12 }\dospecials% % % Activate the space character so as to make TeX treat blanks seriously. % This activation invokes an eralier definition (see above). \obeyspaces % % Interparagraph skips do not help the cause. % Note: We have to preserve the indentation though,fw_src/answers/hi02.lis 644 0 0 464 6717354015 10221 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed hi02.out. SUCCESS: No diagnostics. le} % The \fwverbatimgobble macro exists to allow \fwbtx to bracket verbatim text. \def\fwverbatimgobble#1]fwetx={#1\endgroup} % Table of Contents % ----------------- % The five levels of table of contfw_src/answers/hi02.out 644 0 0 235 6717354015 10235 while sloth=walrus!!!!!!!"); assert(timer=timermax!!!"); inc(sloth); end loop #1 #2}} \def\fwtocfinish#1{\fwrule} % The following "library" macros define five different strengths of headings % which can be used later in the section macros. \def\fwliba#1#2{\vfill\eject{\fwfontboldc #1 #2}\penalty200\smallskip} \def\fwlibb#1#2{\fwbeforesec{\fwfontboldb #1 #2}\penalty200\smallskip} \def\fwlibc#1#2{\fwbeforesec{\fwfontnormb #1 #2}\pfw_src/answers/hi03.lis 644 0 0 464 6717354016 10223 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed hi03.out. SUCCESS: No diagnostics. setter-independent typesetting commands to be given. The % following macros support these features. % The in-text literal @{sloth@} and emphasise @[walrus@] features. \def\fwlit#1{{\tt #1}} \def\fwemp#1{fw_src/answers/hi03.out 644 0 0 243 6717354016 10236 while sloth=walrus!!!!!!!"); assert(timer=timermax!!!"); inc(sloth); end loop lagpage#1#2{ \null \vfill \centerline{\fwfontboldd #1} \vskip 1cm \centerline{\fwfontboldd #2} \vfill \null \vfill } %====================== End of FunnelWeb TeX Definitions ======================= \fwvskip{40} \fwcenterline{\fwfonttitle{Powers:}} \fwcenterline{\fwfonttitle{An Example of}} \fwcenterline{\fwfonttitle{A Shofw_src/answers/hi04.lis 644 0 0 464 6717354020 10217 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed hi04.out. SUCCESS: No diagnostics. s \fwusedin{This macro is invoked in definition 2.} \fwendmacronotes \fwendmacro \fwsecb{1.1}{ex16.out} Here is the outline of the program. This FunnelWeb file generates a single Ada output file calfw_src/answers/hi04.out 644 0 0 53 6717354020 10211 ------- get_command_line(comline) ------- \fwsecb{1.2}{Pull in packages} In this section, we pull in the packages that this program needs to run. In fact, all we need is the IO package so that we can write out the results. To use the IO package, we first of all need to haul it in (\fwlit{with text\_io}) and then we need to make all its identifiers visible at the top level (\fwlit{use text\_io}). \fwbeginmacro \fwmacroname{Pull in packages}{3}\fwequals \fwodef \fwbtx[with text_io; use text_io;]fwetx=%fw_src/answers/hi05.lis 644 0 0 464 6717354021 10221 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed hi05.out. SUCCESS: No diagnostics. ******* %* END OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* s inspired by the following sectifw_src/answers/hi05.out 644 0 0 355 6717354021 10240 Unreadable Postscript code /print { push pop pop push turn around and jump up and down and print it} def Unreadable Postscript code /zap { push pop pop push turn around and jump up and down and print it} def Unreadable Postscript code --------------- Tangle: Completed sc06.fw. Tangle: Completed sc08.fw. Tangle: Completed sc09.fw. Tangle: Completed sc13e.fwi. SUCCESS: No diagnostics. racter is not active. The \fwbtx macro temporarily makes the left quote % character active thus activating the deactivatiofw_src/answers/hi06.lis 644 0 0 522 6717354022 10216 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed hi06a.out. Tangle: Completed hi06b.out. SUCCESS: No diagnostics. x[{% % % The funnies involved in getting verbatim output are safely housed inside % this \begingroup, and the \endgroup in \fwverbatimgobble. Groups are used % instead of curfw_src/answers/hi06a.out 644 0 0 66 6717354022 10362 DCL commands copy printme.txt unixnode:: DCL commands zzzzz'); wake_up_the_walrus(the_walrus); writeln('Umpharumpha...'); end; all the special characters. This % is explained in detail in The TeXbook p.380. \def\do##1{\catcode`##1=12 }\dospecials% % % Activate the space character so as to make TeX treat blanks seriously. % This activation invokes an eralier definition (see above). \obeyspaces % % Interparagraph skips do not help the cause. % Note: We have to preserve the indentation though,fw_src/answers/hi06b.out 644 0 0 56 6717354022 10362 unix commands print printme.txt unix commands Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed hi02.out. SUCCESS: No diagnostics. le} % The \fwverbatimgobble macro exists to allow \fwbtx to bracket verbatim text. \def\fwverbatimgobble#1]fwetx={#1\endgroup} % Table of Contents % ----------------- % The five levels of table of contfw_src/answers/hi07.lis 644 0 0 522 6717354023 10220 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed hi07a.out. Tangle: Completed hi07b.out. SUCCESS: No diagnostics. fill\eject{\fwfontboldc #1 #2}\penalty200\smallskip} \def\fwlibb#1#2{\fwbeforesec{\fwfontboldb #1 #2}\penalty200\smallskip} \def\fwlibc#1#2{\fwbeforesec{\fwfontnormb #1 #2}\pfw_src/answers/hi07a.out 644 0 0 164 6717354023 10403 First lump of text shared by both documents. Text for first document Second lump of text shared by both documents. ------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed hi03.out. SUCCESS: No diagnostics. setter-independent typesetting commands to be given. The % following macros support these features. % The in-text literal @{sloth@} and emphasise @[walrus@] features. \def\fwlit#1{{\tt #1}} \def\fwemp#1{fw_src/answers/hi07b.out 644 0 0 165 6717354023 10405 First lump of text shared by both documents. Text for second document Second lump of text shared by both documents. timer>=timermax!!!"); inc(sloth); end loop lagpage#1#2{ \null \vfill \centerline{\fwfontboldd #1} \vskip 1cm \centerline{\fwfontboldd #2} \vfill \null \vfill } %====================== End of FunnelWeb TeX Definitions ======================= \fwvskip{40} \fwcenterline{\fwfonttitle{Powers:}} \fwcenterline{\fwfonttitle{An Example of}} \fwcenterline{\fwfonttitle{A Shofw_src/answers/hi08.lis 644 0 0 464 6717354024 10227 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed hi08.out. SUCCESS: No diagnostics. s \fwusedin{This macro is invoked in definition 2.} \fwendmacronotes \fwendmacro \fwsecb{1.1}{ex16.out} Here is the outline of the program. This FunnelWeb file generates a single Ada output file calfw_src/answers/hi08.out 644 0 0 576 6717354024 10253 1992 ANNUAL REPORT TO Shareholders ================================== This has been a very good year for The Very Big Corporation of America. With your help, we have been able to successfully screw the customers for every cent they have. With gross earnings approaching six trillion dollars, we have been able to increase dividends. We expect to have an even better year next year. \fwlit{use text\_io}). \fwbeginmacro \fwmacroname{Pull in packages}{3}\fwequals \fwodef \fwbtx[with text_io; use text_io;]fwetx=%fw_src/answers/hi09.lis 644 0 0 464 6717354026 10232 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed hi09.out. SUCCESS: No diagnostics. ******* %* END OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* s inspired by the following sectifw_src/answers/hi09.out 644 0 0 5615 6717354026 10275 [inherit ('NaryTree'), environment ('NaryTreeSet')] module NaryTreeSet; type NaryTreeSet = ^NaryTreeSetRecord; NaryTreeSetRecord = record Member: NaryTree; Next: NaryTreeSet; end; procedure NullNaryTreeSet (var Result: NaryTreeSet); begin new (Result); Result^.Member := (- MaxInt)::NaryTree; Result^.Next := nil end; function IsNullNaryTreeSet (S: NaryTreeSet): boolean; begin IsNullNaryTreeSet := S^.Member::integer = - MaxInt end; procedure ForEachNaryTree (S: NaryTreeSet; procedure DoIt (i: NaryTree)); var ThisS, NextS: NaryTreeSet; begin ThisS := S; while ThisS^.Member::integer <> - MaxInt do begin NextS := ThisS^.Next; DoIt (ThisS^.Member); ThisS := NextS end; end; function FirstNaryTree (S: NaryTreeSet): NaryTree; begin FirstNaryTree := S^.Member end; function IsNaryTreeInSet (i: NaryTree; S: NaryTreeSet): boolean; procedure TestEquals (j: NaryTree); begin if EqualNaryTree (i, j) then IsNaryTreeInSet := true; end; begin IsNaryTreeInSet := false; ForEachNaryTree (S, TestEquals); end; function IncludesNaryTreeSet (S1, S2: NaryTreeSet): boolean; var Result: boolean; procedure TestIfInS1 (i: NaryTree); begin if Result then if not IsNaryTreeInSet (i, S1) then Result := false; end; begin Result := true; ForEachNaryTree (S2, TestIfInS1); IncludesNaryTreeSet := Result end; function DisjointNaryTreeSets (S1, S2: NaryTreeSet): boolean; var Result: boolean; procedure TestIfInS1 (i: NaryTree); begin if Result then if IsNaryTreeInSet (i, S1) then Result := false; end; begin Result := true; ForEachNaryTree (S2, TestIfInS1); DisjointNaryTreeSets := Result end; function EqualNaryTreeSet (S1, S2: NaryTreeSet): boolean; begin EqualNaryTreeSet := IncludesNaryTreeSet (S1, S2) and IncludesNaryTreeSet (S2, S1); end; procedure InsertNaryTree (i: NaryTree; var S: NaryTreeSet); var This, Pred, Succ: NaryTreeSet; begin if not IsNaryTreeInSet (i, S) then begin Pred := nil; Succ := S; while Succ^.Member::integer > i::integer do begin Pred := Succ; Succ := Succ^.Next end; if Succ^.Member::integer < i::integer then begin new (This); This^.Next := Succ; This^.Member := i; if Pred <> nil then Pred^.Next := This else S := This; end; end; end; procedure InsertNaryTrees (S1: NaryTreeSet; var S2: NaryTreeSet); var This, Pred, Succ: NaryTreeSet; procedure AddNaryTree (i: NaryTree); begin InsertNaryTree (i, S2) end; begin ForEachNaryTree (S1, AddNaryTree); end; procedure RemoveNaryTree (i: NaryTree; var S: NaryTreeSet); var Pred, This: NaryTreeSet; begin Pred := nil; This := S; while not EqualNaryTree (This^.Member, i) do begin Pred := This; This := This^.Next end; if Pred <> nil then Pred^.Next := This^.Next else S := This^.Next; Dispose (This); end; procedure DisposeNaryTreeSet (var S: NaryTreeSet); var Old: NaryTreeSet; begin while S <> nil do begin Old := S; S := S^.Next; Dispose (Old) end; end; end. fw_src/answers/hi10.lis 644 0 0 464 6717354027 10223 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed hi10.out. SUCCESS: No diagnostics. fw_src/answers/hi10.out 644 0 0 635 6717354027 10243 /* Pre: sorted(b). */ i=1; p=1; while (i != N) { /* Invariant: sorted(b) and 1<=i<=N and */ /* p is len of longest run in b[1..i]. */ i++; if (b[i] != b[i-p]) p++; } /* Post: sorted(b) and p is the length of the longest run in b[1..N]. */ bool comp(p,q) char *p,*q; { while (TRUE) { if (*p != *q ) return FALSE; if (*p == '\0') return TRUE; p++; q++; } } fw_src/answers/pr01.lis 644 0 0 34536 6717353702 10312 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 50 52 30 31 3A 20 54 65 73 74 20 74 68 65 20 69 | PR01: Test the i | | 6E 6C 69 6E 65 20 74 79 70 65 73 65 74 74 69 6E | nline typesettin | | 67 20 66 65 61 74 75 72 65 73 2E 0A 0A 31 2E 20 | g features...1. | | 46 69 72 73 74 20 77 65 20 74 65 73 74 20 74 68 | First we test th | | 65 20 6C 65 67 61 6C 20 75 73 65 20 6F 66 20 74 | e legal use of t | | 68 65 20 40 7B 6C 69 74 65 72 61 6C 40 7D 20 63 | he @{literal@} c | | 6F 6E 73 74 72 75 63 74 2E 0A 0A 32 2E 54 65 73 | onstruct...2.Tes | | 74 20 40 7B 40 7D 20 28 69 6C 6C 65 67 61 6C 29 | t @{@} (illegal) | | 2E 0A 40 41 40 3C 45 72 72 6F 72 20 52 65 63 6F | ..@A@..3. | | 20 54 65 73 74 20 74 68 65 20 63 6F 6E 73 74 72 | Test the constr | | 75 63 74 20 40 7B 61 63 72 6F 73 73 0A 20 20 20 | uct @{across. | | 6D 6F 72 65 20 74 68 61 6E 20 6F 6E 65 20 6C 69 | more than one li | | 6E 65 40 7D 2E 0A 0A 34 2E 20 4E 6F 77 20 77 65 | ne@}...4. Now we | | 20 74 65 73 74 20 74 68 65 20 63 6F 6E 73 74 72 | test the constr | | 75 63 74 20 77 69 74 68 20 6E 6F 6E 2D 74 65 78 | uct with non-tex | | 74 20 66 6F 6C 6C 6F 77 69 6E 67 20 69 74 2E 0A | t following it.. | | 20 20 20 40 7B 40 3C 73 6C 6F 74 68 40 3E 40 7D | @{@@} | | 0A 40 41 40 3C 45 72 72 6F 72 20 52 65 63 6F 76 | .@A@. @ | | 7B 20 20 20 20 20 40 3E 20 20 20 40 7D 0A 40 41 | { @> @}.@A | | 40 3C 45 72 72 6F 72 20 52 65 63 6F 76 65 72 79 | @..5. Tes | | 74 20 74 68 65 20 6C 65 67 61 6C 20 75 73 65 20 | t the legal use | | 6F 66 20 74 68 65 20 40 2F 65 6D 70 68 61 73 69 | of the @/emphasi | | 73 40 2F 20 63 6F 6E 73 74 72 75 63 74 2E 0A 0A | s@/ construct... | | 36 2E 54 65 73 74 20 40 2F 40 2F 20 28 69 6C 6C | 6.Test @/@/ (ill | | 65 67 61 6C 29 2E 0A 40 41 40 3C 45 72 72 6F 72 | egal)..@A@..7. Test the c | | 6F 6E 73 74 72 75 63 74 20 40 2F 61 63 72 6F 73 | onstruct @/acros | | 73 0A 20 20 20 6D 6F 72 65 20 74 68 61 6E 20 6F | s. more than o | | 6E 65 20 6C 69 6E 65 40 2F 2E 0A 0A 38 2E 20 4E | ne line@/...8. N | | 6F 77 20 77 65 20 74 65 73 74 20 74 68 65 20 63 | ow we test the c | | 6F 6E 73 74 72 75 63 74 20 77 69 74 68 20 6E 6F | onstruct with no | | 6E 2D 74 65 78 74 20 66 6F 6C 6C 6F 77 69 6E 67 | n-text following | | 20 69 74 2E 0A 20 20 20 40 2F 40 3C 73 6C 6F 74 | it.. @/@@/.@A@ | | 0A 20 20 20 40 2F 20 20 20 20 20 40 3C 20 20 20 | . @/ @< | | 40 2F 0A 0A 0A 0A | @/.... | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| PR01: Test the inline typesetting features.<010> 00002 00002| <010> 00003 00003| 1. First we test the legal use of the @{literal@} construct.<010> 00004 00004| <010> 00005 00005| 2.Test @{@} (illegal).<010> 00006 00006| @A@<010> 00007 00007| <010> 00008 00008| 3. Test the construct @{across<010> 00009 00009| more than one line@}.<010> 00010 00010| <010> 00011 00011| 4. Now we test the construct with non-text following it.<010> 00012 00012| @{@@}<010> 00013 00013| @A@<010> 00014 00014| @{ @> @}<010> 00015 00015| @A@<010> 00016 00016| <010> 00017 00017| 5. Test the legal use of the @/emphasis@/ construct.<010> 00018 00018| <010> 00019 00019| 6.Test @/@/ (illegal).<010> 00020 00020| @A@<010> 00021 00021| <010> 00022 00022| 7. Test the construct @/across<010> 00023 00023| more than one line@/.<010> 00024 00024| <010> 00025 00025| 8. Now we test the construct with non-text following it.<010> 00026 00026| @/@@/<010> 00027 00027| @A@<010> 00028 00028| @/ @< @/<010> 00029 00029| <010> 00030 00030| <010> 00031 00031| <010> 00032 00032| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 73 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="PR01: Test the inline typesetting features.<010> <010> 1. First we test the legal use of the " 0003[39]: @{ Open defn. 0003[41]: Text. Text scrap[Grey]="literal" 0003[48]: @} Close defn. 0003[50]: Text. Text scrap[Grey]=" construct.<010> <010> 2.Test " 0005[08]: @{ Open defn. 0005[10]: @} Close defn. 0005[12]: Text. Text scrap[Grey]=" (illegal).<010> " 0006[01]: @A New section (Level 1). 0006[03]: @< Open name. 0006[05]: Text. Text scrap[Grey]="Error Recovery Point" 0006[25]: @> Close name. 0006[27]: Text. Text scrap[Grey]="<010> <010> 3. Test the construct " 0008[23]: @{ Open defn. 0008[25]: Text. Text scrap[Grey]="across<010> more than one line" 0009[22]: @} Close defn. 0009[24]: Text. Text scrap[Grey]=".<010> <010> 4. Now we test the construct with non-text following it.<010> " 0012[04]: @{ Open defn. 0012[06]: @< Open name. 0012[08]: Text. Text scrap[Grey]="sloth" 0012[13]: @> Close name. 0012[15]: @} Close defn. 0012[17]: Text. Text scrap[White]="<010> " 0013[01]: @A New section (Level 1). 0013[03]: @< Open name. 0013[05]: Text. Text scrap[Grey]="Error Recovery Point" 0013[25]: @> Close name. 0013[27]: Text. Text scrap[White]="<010> " 0014[04]: @{ Open defn. 0014[06]: Text. Text scrap[White]=" " 0014[11]: @> Close name. 0014[13]: Text. Text scrap[White]=" " 0014[16]: @} Close defn. 0014[18]: Text. Text scrap[White]="<010> " 0015[01]: @A New section (Level 1). 0015[03]: @< Open name. 0015[05]: Text. Text scrap[Grey]="Error Recovery Point" 0015[25]: @> Close name. 0015[27]: Text. Text scrap[Grey]="<010> <010> 5. Test the legal use of the " 0017[30]: @/ Emphasise. 0017[32]: Text. Text scrap[Grey]="emphasis" 0017[40]: @/ Emphasise. 0017[42]: Text. Text scrap[Grey]=" construct.<010> <010> 6.Test " 0019[08]: @/ Emphasise. 0019[10]: @/ Emphasise. 0019[12]: Text. Text scrap[Grey]=" (illegal).<010> " 0020[01]: @A New section (Level 1). 0020[03]: @< Open name. 0020[05]: Text. Text scrap[Grey]="Error Recovery Point" 0020[25]: @> Close name. 0020[27]: Text. Text scrap[Grey]="<010> <010> 7. Test the construct " 0022[23]: @/ Emphasise. 0022[25]: Text. Text scrap[Grey]="across<010> more than one line" 0023[22]: @/ Emphasise. 0023[24]: Text. Text scrap[Grey]=".<010> <010> 8. Now we test the construct with non-text following it.<010> " 0026[04]: @/ Emphasise. 0026[06]: @< Open name. 0026[08]: Text. Text scrap[Grey]="sloth" 0026[13]: @> Close name. 0026[15]: @/ Emphasise. 0026[17]: Text. Text scrap[White]="<010> " 0027[01]: @A New section (Level 1). 0027[03]: @< Open name. 0027[05]: Text. Text scrap[Grey]="Error Recovery Point" 0027[25]: @> Close name. 0027[27]: Text. Text scrap[White]="<010> " 0028[04]: @/ Emphasise. 0028[06]: Text. Text scrap[White]=" " 0028[11]: @< Open name. 0028[13]: Text. Text scrap[White]=" " 0028[16]: @/ Emphasise. 0028[18]: Text. Text scrap[White]="<010> <010> <010> <010> " 0032[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ ========================== Start of MACRO TABLE DUMP =========================== =========================== End of MACRO TABLE DUMP ============================ ========================= Start of DOCUMENT LIST DUMP ========================== TEXT COMPONENT: Pos(L,C)=(1,1). -- Start of Text Scrap List -- Text scrap[Grey]="PR01: Test the inline typesetting features.<010> <010> 1. First we test the legal use of the " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Open literal. TEXT COMPONENT: Pos(L,C)=(3,41). -- Start of Text Scrap List -- Text scrap[Grey]="literal" --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Close literal. TEXT COMPONENT: Pos(L,C)=(3,50). -- Start of Text Scrap List -- Text scrap[Grey]=" construct.<010> <010> 2.Test " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Open literal. TYPESETTER DIRECTIVE COMPONENT: Section "1", Section name="Error Recovery Point". TEXT COMPONENT: Pos(L,C)=(6,27). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 3. Test the construct " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Open literal. TEXT COMPONENT: Pos(L,C)=(8,25). -- Start of Text Scrap List -- Text scrap[Grey]="across<010> more than one line" --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Close literal. TEXT COMPONENT: Pos(L,C)=(9,24). -- Start of Text Scrap List -- Text scrap[Grey]=".<010> <010> 4. Now we test the construct with non-text following it.<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Open literal. TYPESETTER DIRECTIVE COMPONENT: Section "2", Section name="Error Recovery Point". TEXT COMPONENT: Pos(L,C)=(13,27). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Open literal. TEXT COMPONENT: Pos(L,C)=(14,6). -- Start of Text Scrap List -- Text scrap[White]=" " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "3", Section name="Error Recovery Point". TEXT COMPONENT: Pos(L,C)=(15,27). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 5. Test the legal use of the " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Open emphasise. TEXT COMPONENT: Pos(L,C)=(17,32). -- Start of Text Scrap List -- Text scrap[Grey]="emphasis" --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Close emphasise. TEXT COMPONENT: Pos(L,C)=(17,42). -- Start of Text Scrap List -- Text scrap[Grey]=" construct.<010> <010> 6.Test " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Open emphasise. TYPESETTER DIRECTIVE COMPONENT: Section "4", Section name="Error Recovery Point". TEXT COMPONENT: Pos(L,C)=(20,27). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 7. Test the construct " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Open emphasise. TEXT COMPONENT: Pos(L,C)=(22,25). -- Start of Text Scrap List -- Text scrap[Grey]="across<010> more than one line" --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Close emphasise. TEXT COMPONENT: Pos(L,C)=(23,24). -- Start of Text Scrap List -- Text scrap[Grey]=".<010> <010> 8. Now we test the construct with non-text following it.<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Open emphasise. TYPESETTER DIRECTIVE COMPONENT: Section "5", Section name="Error Recovery Point". TEXT COMPONENT: Pos(L,C)=(27,27). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Open emphasise. TEXT COMPONENT: Pos(L,C)=(28,6). -- Start of Text Scrap List -- Text scrap[White]=" " --- End of Text Scrap List --- ========================== End of DOCUMENT LIST DUMP =========================== Global Local| Input File ------------+------------------------------------------------------------------- 1 1| PR01: Test the inline typesetting features. 2 2| 3 3| 1. First we test the legal use of the @{literal@} construct. 4 4| 5 5| 2.Test @{@} (illegal). Error|..........^Text expected after open literal token "@{". |..........^Sorry, empty literal strings are not allowed. |..........^Skipping after error to the next major construct... 6 6| @A@ |.^...skipped to here after the error. 7 7| 8 8| 3. Test the construct @{across 9 9| more than one line@}. 10 10| 11 11| 4. Now we test the construct with non-text following it. 12 12| @{@@} Error|......^Text expected after open literal token "@{". |......^Skipping after error to the next major construct... 13 13| @A@ |.^...skipped to here after the error. 14 14| @{ @> @} Error|...........^Expecting '@}'. |...........^Skipping after error to the next major construct... 15 15| @A@ |.^...skipped to here after the error. 16 16| 17 17| 5. Test the legal use of the @/emphasis@/ construct. 18 18| 19 19| 6.Test @/@/ (illegal). Error|..........^Text expected after open emphasise token "@/". |..........^Sorry, empty emphasised strings are not allowed. |..........^Skipping after error to the next major construct... 20 20| @A@ |.^...skipped to here after the error. 21 21| 22 22| 7. Test the construct @/across 23 23| more than one line@/. 24 24| 25 25| 8. Now we test the construct with non-text following it. 26 26| @/@@/ Error|......^Text expected after open emphasise token "@/". |......^Skipping after error to the next major construct... 27 27| @A@ |.^...skipped to here after the error. 28 28| @/ @< @/ Error|...........^Expecting '@/'. |...........^Skipping after error to the next major construct... 29 29| 30 30| 31 31| | |.^...skipped to here after the error. ------------+------------------------------------------------------------------- There were 6 Errors. e@/.<010> 00024 00024| <010> 00025 00025| 8. Now we test the construct with non-text following it.<010> 00026 00026| @/@@/<010> 00027 00027| @A@>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 50 52 30 32 3A 20 54 65 73 74 20 74 68 65 20 70 | PR02: Test the p | | 61 72 73 69 6E 67 20 6F 66 20 74 79 70 65 73 65 | arsing of typese | | 74 74 65 72 20 64 69 72 65 63 74 69 76 65 73 2E | tter directives. | | 0A 0A 31 2E 20 54 65 73 74 20 70 61 72 73 69 6E | ..1. Test parsin | | 67 20 6F 66 20 6E 65 77 20 70 61 67 65 20 64 69 | g of new page di | | 72 65 63 74 69 76 65 2E 0A 40 74 20 6E 65 77 5F | rective..@t new_ | | 70 61 67 65 0A 0A 32 2E 20 54 65 73 74 20 70 61 | page..2. Test pa | | 72 73 69 6E 67 20 6F 66 20 74 61 62 6C 65 20 6F | rsing of table o | | 66 20 63 6F 6E 74 65 6E 74 73 20 64 69 72 65 63 | f contents direc | | 74 69 76 65 2E 0A 40 74 20 74 61 62 6C 65 5F 6F | tive..@t table_o | | 66 5F 63 6F 6E 74 65 6E 74 73 0A 0A 33 2E 20 54 | f_contents..3. T | | 65 73 74 20 70 61 72 73 69 6E 67 20 6F 66 20 76 | est parsing of v | | 73 6B 69 70 20 64 69 72 65 63 74 69 76 65 2E 0A | skip directive.. | | 40 74 20 76 73 6B 69 70 20 33 32 20 6D 6D 0A 0A | @t vskip 32 mm.. | | 34 2E 20 54 65 73 74 20 70 61 72 73 69 6E 67 20 | 4. Test parsing | | 6F 66 20 74 69 74 6C 65 20 64 69 72 65 63 74 69 | of title directi | | 76 65 2E 0A 40 74 20 74 69 74 6C 65 20 74 69 74 | ve..@t title tit | | 6C 65 66 6F 6E 74 20 6C 65 66 74 20 22 53 6C 6F | lefont left "Slo | | 74 68 22 0A 0A | th".. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| PR02: Test the parsing of typesetter directives.<010> 00002 00002| <010> 00003 00003| 1. Test parsing of new page directive.<010> 00004 00004| @t new_page<010> 00005 00005| <010> 00006 00006| 2. Test parsing of table of contents directive.<010> 00007 00007| @t table_of_contents<010> 00008 00008| <010> 00009 00009| 3. Test parsing of vskip directive.<010> 00010 00010| @t vskip 32 mm<010> 00011 00011| <010> 00012 00012| 4. Test parsing of title directive.<010> 00013 00013| @t title titlefont left "Sloth"<010> 00014 00014| <010> 00015 00015| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 10 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="PR02: Test the parsing of typesetter directives.<010> <010> 1. Test parsing of new page directive.<010> " 0004[01]: @t.. Newpage. 0005[01]: Text. Text scrap[Grey]="<010> 2. Test parsing of table of contents directive.<010> " 0007[01]: @t.. TOC. 0008[01]: Text. Text scrap[Grey]="<010> 3. Test parsing of vskip directive.<010> " 0010[01]: @t.. Vertical skip. Vertical space skipped=32mm. 0011[01]: Text. Text scrap[Grey]="<010> 4. Test parsing of title directive.<010> " 0013[01]: @t.. Title. Font=Title, Alignment=Left. Title text follows: Text scrap[Grey]="Sloth" 0014[01]: Text. Text scrap[White]="<010> " 0015[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ ========================== Start of MACRO TABLE DUMP =========================== =========================== End of MACRO TABLE DUMP ============================ ========================= Start of DOCUMENT LIST DUMP ========================== TEXT COMPONENT: Pos(L,C)=(1,1). -- Start of Text Scrap List -- Text scrap[Grey]="PR02: Test the parsing of typesetter directives.<010> <010> 1. Test parsing of new page directive.<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: New page. TEXT COMPONENT: Pos(L,C)=(5,1). -- Start of Text Scrap List -- Text scrap[Grey]="<010> 2. Test parsing of table of contents directive.<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Table of contents. TEXT COMPONENT: Pos(L,C)=(8,1). -- Start of Text Scrap List -- Text scrap[Grey]="<010> 3. Test parsing of vskip directive.<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Vertical skip by 32 mm. TEXT COMPONENT: Pos(L,C)=(11,1). -- Start of Text Scrap List -- Text scrap[Grey]="<010> 4. Test parsing of title directive.<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Font=Title, Alignment=Left. Title text follows: Text scrap[Grey]="Sloth" TEXT COMPONENT: Pos(L,C)=(14,1). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- ========================== End of DOCUMENT LIST DUMP =========================== E: No macros defined. E: No output files specified. Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- There were 2 Errors. ENT: Pos(L,C)=(17,32). -- Start of Text Scrap List -- Text scrap[Grey]="emphasis" --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Close emphasise. TEXT COMPONENT: Pos(L,C)=(17,42). -- Start of Text Scrap List fw_src/answers/pr03.lis 644 0 0 33711 6717353704 10310 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 50 52 30 33 3A 20 54 65 73 74 20 74 68 65 20 70 | PR03: Test the p | | 61 72 73 69 6E 67 20 61 6E 64 20 73 65 6D 61 6E | arsing and seman | | 74 69 63 73 20 6F 66 20 73 65 63 74 69 6F 6E 73 | tics of sections | | 2E 0A 0A 34 2E 20 54 65 73 74 20 66 69 72 73 74 | ...4. Test first | | 20 73 65 63 74 69 6F 6E 20 6F 66 20 64 6F 63 75 | section of docu | | 6D 65 6E 74 20 69 73 20 6E 6F 74 20 3C 73 70 65 | ment is not A..@B@..1. Test secti | | 6F 6E 20 77 69 74 68 20 6E 6F 20 6E 61 6D 65 2E | on with no name. | | 0A 40 41 20 54 68 69 73 20 73 65 63 74 69 6F 6E | .@A This section | | 20 68 61 73 20 6E 6F 20 6E 61 6D 65 2E 0A 40 24 | has no name..@$ | | 40 3C 54 68 65 20 73 65 63 74 69 6F 6E 20 6E 61 | @@{Walrus@}.. | | 32 2E 20 54 65 73 74 20 73 65 63 74 69 6F 6E 20 | 2. Test section | | 77 69 74 68 20 61 20 6E 61 6D 65 0A 40 41 40 3C | with a name.@A@< | | 54 68 69 73 20 73 65 63 74 69 6F 6E 20 68 61 73 | This section has | | 20 6E 6F 20 6E 61 6D 65 2E 40 3E 0A 0A 33 2E 20 | no name.@>..3. | | 54 65 73 74 20 74 68 65 20 65 6E 74 69 72 65 20 | Test the entire | | 68 69 65 72 61 72 63 68 79 2E 0A 40 41 40 3C 4F | hierarchy..@A@.@B@.@ | | 43 40 3C 54 68 72 65 65 40 3E 0A 40 44 40 3C 46 | C@.@D@.@E@ | | 0A 0A 35 2E 20 54 65 73 74 20 64 65 74 65 63 74 | ..5. Test detect | | 69 6F 6E 20 6F 66 20 64 69 73 63 6F 6E 74 69 6E | ion of discontin | | 75 69 74 79 20 69 6E 20 6C 65 76 65 6C 73 2E 0A | uity in levels.. | | 40 41 40 3C 4F 6E 65 40 3E 0A 40 43 40 3C 54 68 | @A@.@C@.@E@ | | 0A 0A 40 41 40 3C 4F 6E 65 40 3E 0A 40 42 40 3C | ..@A@.@B@< | | 54 68 72 65 65 40 3E 0A 40 44 40 3C 46 69 76 65 | Three@>.@D@. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| PR03: Test the parsing and semantics of sections.<010> 00002 00002| <010> 00003 00003| 4. Test first section of document is not A.<010> 00004 00004| @B@<010> 00005 00005| <010> 00006 00006| 1. Test section with no name.<010> 00007 00007| @A This section has no name.<010> 00008 00008| @$@@{Walrus@}<010> 00009 00009| <010> 00010 00010| 2. Test section with a name<010> 00011 00011| @A@<010> 00012 00012| <010> 00013 00013| 3. Test the entire hierarchy.<010> 00014 00014| @A@<010> 00015 00015| @B@<010> 00016 00016| @C@<010> 00017 00017| @D@<010> 00018 00018| @E@<010> 00019 00019| <010> 00020 00020| 5. Test detection of discontinuity in levels.<010> 00021 00021| @A@<010> 00022 00022| @C@<010> 00023 00023| @E@<010> 00024 00024| <010> 00025 00025| @A@<010> 00026 00026| @B@<010> 00027 00027| @D@<010> 00028 00028| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 77 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="PR03: Test the parsing and semantics of sections.<010> <010> 4. Test first section of document is not A.<010> " 0004[01]: @B New section (Level 2). 0004[03]: @< Open name. 0004[05]: Text. Text scrap[Grey]="This section is out of order (and so is this test!)" 0004[56]: @> Close name. 0004[58]: Text. Text scrap[Grey]="<010> <010> 1. Test section with no name.<010> " 0007[01]: @A New section (Level 1). 0007[03]: Text. Text scrap[Grey]=" This section has no name.<010> " 0008[01]: @$ Macro defn. 0008[03]: @< Open name. 0008[05]: Text. Text scrap[Grey]="The section name inherits the name of this macro" 0008[53]: @> Close name. 0008[55]: @{ Open defn. 0008[57]: Text. Text scrap[Grey]="Walrus" 0008[63]: @} Close defn. 0008[65]: Text. Text scrap[Grey]="<010> <010> 2. Test section with a name<010> " 0011[01]: @A New section (Level 1). 0011[03]: @< Open name. 0011[05]: Text. Text scrap[Grey]="This section has no name." 0011[30]: @> Close name. 0011[32]: Text. Text scrap[Grey]="<010> <010> 3. Test the entire hierarchy.<010> " 0014[01]: @A New section (Level 1). 0014[03]: @< Open name. 0014[05]: Text. Text scrap[Grey]="One" 0014[08]: @> Close name. 0014[10]: Text. Text scrap[White]="<010> " 0015[01]: @B New section (Level 2). 0015[03]: @< Open name. 0015[05]: Text. Text scrap[Grey]="Two" 0015[08]: @> Close name. 0015[10]: Text. Text scrap[White]="<010> " 0016[01]: @C New section (Level 3). 0016[03]: @< Open name. 0016[05]: Text. Text scrap[Grey]="Three" 0016[10]: @> Close name. 0016[12]: Text. Text scrap[White]="<010> " 0017[01]: @D New section (Level 4). 0017[03]: @< Open name. 0017[05]: Text. Text scrap[Grey]="Four" 0017[09]: @> Close name. 0017[11]: Text. Text scrap[White]="<010> " 0018[01]: @E New section (Level 5). 0018[03]: @< Open name. 0018[05]: Text. Text scrap[Grey]="Five" 0018[09]: @> Close name. 0018[11]: Text. Text scrap[Grey]="<010> <010> 5. Test detection of discontinuity in levels.<010> " 0021[01]: @A New section (Level 1). 0021[03]: @< Open name. 0021[05]: Text. Text scrap[Grey]="One" 0021[08]: @> Close name. 0021[10]: Text. Text scrap[White]="<010> " 0022[01]: @C New section (Level 3). 0022[03]: @< Open name. 0022[05]: Text. Text scrap[Grey]="Three" 0022[10]: @> Close name. 0022[12]: Text. Text scrap[White]="<010> " 0023[01]: @E New section (Level 5). 0023[03]: @< Open name. 0023[05]: Text. Text scrap[Grey]="Five" 0023[09]: @> Close name. 0023[11]: Text. Text scrap[White]="<010> <010> " 0025[01]: @A New section (Level 1). 0025[03]: @< Open name. 0025[05]: Text. Text scrap[Grey]="One" 0025[08]: @> Close name. 0025[10]: Text. Text scrap[White]="<010> " 0026[01]: @B New section (Level 2). 0026[03]: @< Open name. 0026[05]: Text. Text scrap[Grey]="Three" 0026[10]: @> Close name. 0026[12]: Text. Text scrap[White]="<010> " 0027[01]: @D New section (Level 4). 0027[03]: @< Open name. 0027[05]: Text. Text scrap[Grey]="Five" 0027[09]: @> Close name. 0027[11]: Text. Text scrap[White]="<010> " 0028[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ ========================== Start of MACRO TABLE DUMP =========================== ------------------- Start of Macro Dump -------------------- Macro Name : "The section name inherits the name of this macro" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (8,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=1, Pos(L,C)=(8,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Walrus" ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- =========================== End of MACRO TABLE DUMP ============================ ========================= Start of DOCUMENT LIST DUMP ========================== TEXT COMPONENT: Pos(L,C)=(1,1). -- Start of Text Scrap List -- Text scrap[Grey]="PR03: Test the parsing and semantics of sections.<010> <010> 4. Test first section of document is not A.<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "1.2", Section name="This section is out of order (and so is this test!)". TEXT COMPONENT: Pos(L,C)=(4,58). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 1. Test section with no name.<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "2", Section name="The section name inherits the name of this macro". TEXT COMPONENT: Pos(L,C)=(7,3). -- Start of Text Scrap List -- Text scrap[Grey]=" This section has no name.<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(8,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(8,65). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 2. Test section with a name<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "3", Section name="This section has no name.". TEXT COMPONENT: Pos(L,C)=(11,32). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 3. Test the entire hierarchy.<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "4", Section name="One". TEXT COMPONENT: Pos(L,C)=(14,10). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "4.1", Section name="Two". TEXT COMPONENT: Pos(L,C)=(15,10). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "4.1.1", Section name="Three". TEXT COMPONENT: Pos(L,C)=(16,12). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "4.1.1.1", Section name="Four". TEXT COMPONENT: Pos(L,C)=(17,11). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "4.1.1.1.1", Section name="Five". TEXT COMPONENT: Pos(L,C)=(18,11). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 5. Test detection of discontinuity in levels.<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "5", Section name="One". TEXT COMPONENT: Pos(L,C)=(21,10). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "1.1.2", Section name="Three". TEXT COMPONENT: Pos(L,C)=(22,12). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "1.1.1.1.2", Section name="Five". TEXT COMPONENT: Pos(L,C)=(23,11). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "2", Section name="One". TEXT COMPONENT: Pos(L,C)=(25,10). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "2.1", Section name="Three". TEXT COMPONENT: Pos(L,C)=(26,12). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "1.1.1.2", Section name="Five". TEXT COMPONENT: Pos(L,C)=(27,11). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- ========================== End of DOCUMENT LIST DUMP =========================== Global Local| Input File ------------+------------------------------------------------------------------- 1 1| PR03: Test the parsing and semantics of sections. 2 2| 3 3| 4. Test first section of document is not A. 4 4| @B@ Error|.^The first section in a document must be an @A section. 5 5| 6 6| 1. Test section with no name. 7 7| @A This section has no name. 8 8| @$@@{Walrus@} 9 9| 10 10| 2. Test section with a name 11 11| @A@ 12 12| 13 13| 3. Test the entire hierarchy. 14 14| @A@ 15 15| @B@ 16 16| @C@ 17 17| @D@ 18 18| @E@ 19 19| 20 20| 5. Test detection of discontinuity in levels. 21 21| @A@ |.^The next section (at line 22) is too deep. 22 22| @C@ Error|.^This section is more than one level deeper than the last |.^section (at line 21). Example: @B followed by @D is not allowed. |.^The next section (at line 23) is too deep. 23 23| @E@ Error|.^This section is more than one level deeper than the last |.^section (at line 22). Example: @B followed by @D is not allowed. 24 24| 25 25| @A@ 26 26| @B@ |.^The next section (at line 27) is too deep. 27 27| @D@ Error|.^This section is more than one level deeper than the last |.^section (at line 26). Example: @B followed by @D is not allowed. | ------------+------------------------------------------------------------------- There were 4 Errors. 025 00025| @A@<010> 00026 00026| @B@<010>fw_src/answers/pr04.lis 644 0 0 54256 6717353706 10322 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 50 52 30 34 3A 20 54 65 73 74 20 74 68 65 20 64 | PR04: Test the d | | 65 66 69 6E 69 74 69 6F 6E 20 6F 66 20 6F 72 64 | efinition of ord | | 69 6E 61 72 79 20 6D 61 63 72 6F 73 2E 0A 0A 31 | inary macros...1 | | 2E 20 54 65 73 74 20 61 6E 20 6F 72 64 69 6E 61 | . Test an ordina | | 72 79 20 6D 61 63 72 6F 20 64 65 66 69 6E 69 74 | ry macro definit | | 69 6F 6E 2E 0A 40 24 40 3C 4F 72 64 69 6E 61 72 | ion..@$@@{The text of | | 20 6F 72 64 69 6E 61 72 79 40 7D 0A 0A 32 2E 20 | ordinary@}..2. | | 54 65 73 74 20 61 6E 20 6F 72 64 69 6E 61 72 79 | Test an ordinary | | 20 64 65 66 69 6E 69 74 69 6F 6E 20 75 73 69 6E | definition usin | | 67 20 61 20 71 75 69 63 6B 6E 61 6D 65 2E 0A 40 | g a quickname..@ | | 24 40 23 7C 40 7B 54 68 65 20 74 65 78 74 20 6F | $@#|@{The text o | | 66 20 6F 72 64 69 6E 61 72 79 40 7D 0A 0A 33 2E | f ordinary@}..3. | | 20 54 65 73 74 20 61 20 6E 61 6D 65 20 74 68 61 | Test a name tha | | 74 20 69 6E 63 6C 75 64 65 73 20 45 4F 4C 2E 0A | t includes EOL.. | | 40 24 40 3C 54 68 69 73 20 6E 61 6D 65 20 69 73 | @$@@{And people | | 20 77 68 6F 20 63 72 6F 73 73 20 6C 69 6F 6E 73 | who cross lions | | 20 74 65 6E 64 20 74 6F 20 67 65 74 20 65 61 74 | tend to get eat | | 65 6E 2E 40 7D 0A 40 41 40 3C 45 72 72 6F 72 20 | en.@}.@A@ | | 0A 0A 34 2E 20 54 65 73 74 20 74 68 65 20 6D 69 | ..4. Test the mi | | 6E 69 6D 75 6D 20 6C 65 6E 67 74 68 20 6E 61 6D | nimum length nam | | 65 20 28 74 68 65 20 65 6D 70 74 79 20 6E 61 6D | e (the empty nam | | 65 29 2E 0A 40 24 40 3C 40 3E 40 7B 54 68 65 20 | e)..@$@<@>@{The | | 65 6D 70 74 79 20 6D 61 63 72 6F 20 6E 61 6D 65 | empty macro name | | 20 69 73 20 71 75 69 74 65 20 6C 65 67 61 6C 20 | is quite legal | | 69 6E 20 46 75 6E 6E 65 6C 57 65 62 2E 40 7D 0A | in FunnelWeb.@}. | | 0A 35 2E 20 54 65 73 74 20 61 20 6E 61 6D 65 20 | .5. Test a name | | 61 74 20 74 68 65 20 6D 61 78 69 6D 75 6D 20 6E | at the maximum n | | 61 6D 65 20 6C 65 6E 67 74 68 20 6C 69 6D 69 74 | ame length limit | | 20 28 38 30 29 2E 0A 4F 4E 6C 79 20 74 68 65 20 | (80)..ONly the | | 73 65 63 6F 6E 64 20 6F 66 20 74 68 65 20 74 77 | second of the tw | | 6F 20 6D 61 63 72 6F 73 20 73 68 6F 75 6C 64 20 | o macros should | | 67 65 6E 65 72 61 74 65 20 61 6E 20 65 72 72 6F | generate an erro | | 72 2E 0A 40 70 20 6D 61 78 69 6D 75 6D 5F 69 6E | r..@p maximum_in | | 70 75 74 5F 6C 69 6E 65 5F 6C 65 6E 67 74 68 20 | put_line_length | | 3D 20 31 30 30 0A 40 24 40 3C 31 32 33 34 35 36 | = 100.@$@<123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 40 3E 40 7B 40 7D | 1234567890@>@{@} | | 0A 40 24 40 3C 31 32 33 34 35 36 37 38 39 30 31 | .@$@<12345678901 | | 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 | 2345678901234567 | | 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 | 8901234567890123 | | 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 | 4567890123456789 | | 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 | 0123456789012345 | | 36 37 38 39 30 31 40 3E 40 7B 40 7D 0A 40 41 40 | 678901@>@{@}.@A@ | | 3C 45 72 72 6F 72 20 52 65 63 6F 76 65 72 79 20 | ..6. Test | | 20 6E 61 6D 65 73 20 77 69 74 68 20 61 6C 6C 20 | names with all | | 6C 65 67 61 6C 20 63 68 61 72 61 63 74 65 72 73 | legal characters | | 2E 20 54 68 65 72 65 20 73 68 6F 75 6C 64 20 62 | . There should b | | 65 20 6E 6F 20 65 72 72 6F 72 73 2E 0A 40 24 40 | e no errors..@$@ | | 3C 20 21 22 23 24 25 27 28 29 2A 2B 2C 2D 2E 2F | < !"#$%'()*+,-./ | | 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F | 0123456789:;<=>? | | 40 3E 40 7B 40 7D 0A 40 24 40 3C 41 42 43 44 45 | @>@{@}.@$@@{@ | | 7D 0A 40 24 40 3C 61 62 63 64 65 66 67 68 69 6A | }.@$@@{@}..7. T | | 65 73 74 20 61 20 6E 61 6D 65 20 74 68 61 74 20 | est a name that | | 68 61 73 20 69 6E 73 65 72 74 65 64 20 74 65 78 | has inserted tex | | 74 20 73 65 71 75 65 6E 63 65 73 2E 0A 0A 40 24 | t sequences...@$ | | 40 3C 40 5E 44 28 30 36 35 29 40 40 40 3E 3D 3D | @<@^D(065)@@@>== | | 40 7B 40 7D 0A 0A 0A | @{@}... | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| PR04: Test the definition of ordinary macros.<010> 00002 00002| <010> 00003 00003| 1. Test an ordinary macro definition.<010> 00004 00004| @$@@{The text of ordinary@}<010> 00005 00005| <010> 00006 00006| 2. Test an ordinary definition using a quickname.<010> 00007 00007| @$@#|@{The text of ordinary@}<010> 00008 00008| <010> 00009 00009| 3. Test a name that includes EOL.<010> 00010 00010| @$@ 00011 00011| it crosses a lion@>@{And people who cross lions tend to get eaten.@}<010> 00012 00012| @A@<010> 00013 00013| <010> 00014 00014| 4. Test the minimum length name (the empty name).<010> 00015 00015| @$@<@>@{The empty macro name is quite legal in FunnelWeb.@}<010> 00016 00016| <010> 00017 00017| 5. Test a name at the maximum name length limit (80).<010> 00018 00018| ONly the second of the two macros should generate an error.<010> 00019 00019| @p maximum_input_line_length = 100<010> 00020 00020| @$@<12345678901234567890123456789012345678901234567890123456789012345678901234567890@>@{@}<010> 00021 00021| @$@<123456789012345678901234567890123456789012345678901234567890123456789012345678901@>@{@}<010> 00022 00022| @A@<010> 00023 00023| <010> 00024 00024| 6. Test names with all legal characters. There should be no errors.<010> 00025 00025| @$@< !"#$%'()*+,-./0123456789:;<=>?@>@{@}<010> 00026 00026| @$@@{@}<010> 00027 00027| @$@@{@}<010> 00028 00028| <010> 00029 00029| 7. Test a name that has inserted text sequences.<010> 00030 00030| <010> 00031 00031| @$@<@^D(065)@@@>==@{@}<010> 00032 00032| <010> 00033 00033| <010> 00034 00034| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 85 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="PR04: Test the definition of ordinary macros.<010> <010> 1. Test an ordinary macro definition.<010> " 0004[01]: @$ Macro defn. 0004[03]: @< Open name. 0004[05]: Text. Text scrap[Grey]="Ordinary" 0004[13]: @> Close name. 0004[15]: @{ Open defn. 0004[17]: Text. Text scrap[Grey]="The text of ordinary" 0004[37]: @} Close defn. 0004[39]: Text. Text scrap[Grey]="<010> <010> 2. Test an ordinary definition using a quickname.<010> " 0007[01]: @$ Macro defn. 0007[03]: @# Name. Character='|'. 0007[06]: @{ Open defn. 0007[08]: Text. Text scrap[Grey]="The text of ordinary" 0007[28]: @} Close defn. 0007[30]: Text. Text scrap[Grey]="<010> <010> 3. Test a name that includes EOL.<010> " 0010[01]: @$ Macro defn. 0010[03]: @< Open name. 0010[05]: Text. Text scrap[Grey]="This name is illegal because<010> it crosses a lion" 0011[18]: @> Close name. 0011[20]: @{ Open defn. 0011[22]: Text. Text scrap[Grey]="And people who cross lions tend to get eaten." 0011[67]: @} Close defn. 0011[69]: Text. Text scrap[White]="<010> " 0012[01]: @A New section (Level 1). 0012[03]: @< Open name. 0012[05]: Text. Text scrap[Grey]="Error Recovery Point" 0012[25]: @> Close name. 0012[27]: Text. Text scrap[Grey]="<010> <010> 4. Test the minimum length name (the empty name).<010> " 0015[01]: @$ Macro defn. 0015[03]: @< Open name. 0015[05]: @> Close name. 0015[07]: @{ Open defn. 0015[09]: Text. Text scrap[Grey]="The empty macro name is quite legal in FunnelWeb." 0015[58]: @} Close defn. 0015[60]: Text. Text scrap[Grey]="<010> <010> 5. Test a name at the maximum name length limit (80).<010> ONly the second of the two macros should generate an error.<010> " 0020[01]: @$ Macro defn. 0020[03]: @< Open name. 0020[05]: Text. Text scrap[Grey]="12345678901234567890123456789012345678901234567890123456789012345678901234567890" 0020[85]: @> Close name. 0020[87]: @{ Open defn. 0020[89]: @} Close defn. 0020[91]: Text. Text scrap[White]="<010> " 0021[01]: @$ Macro defn. 0021[03]: @< Open name. 0021[05]: Text. Text scrap[Grey]="123456789012345678901234567890123456789012345678901234567890123456789012345678901" 0021[86]: @> Close name. 0021[88]: @{ Open defn. 0021[90]: @} Close defn. 0021[92]: Text. Text scrap[White]="<010> " 0022[01]: @A New section (Level 1). 0022[03]: @< Open name. 0022[05]: Text. Text scrap[Grey]="Error Recovery Point" 0022[25]: @> Close name. 0022[27]: Text. Text scrap[Grey]="<010> <010> 6. Test names with all legal characters. There should be no errors.<010> " 0025[01]: @$ Macro defn. 0025[03]: @< Open name. 0025[05]: Text. Text scrap[Grey]=" !"#$%'()*+,-./0123456789:;<=>?" 0025[36]: @> Close name. 0025[38]: @{ Open defn. 0025[40]: @} Close defn. 0025[42]: Text. Text scrap[White]="<010> " 0026[01]: @$ Macro defn. 0026[03]: @< Open name. 0026[05]: Text. Text scrap[Grey]="ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`" 0026[37]: @> Close name. 0026[39]: @{ Open defn. 0026[41]: @} Close defn. 0026[43]: Text. Text scrap[White]="<010> " 0027[01]: @$ Macro defn. 0027[03]: @< Open name. 0027[05]: Text. Text scrap[Grey]="abcdefghijklmnopqrstuvwxyz{|}~" 0027[35]: @> Close name. 0027[37]: @{ Open defn. 0027[39]: @} Close defn. 0027[41]: Text. Text scrap[Grey]="<010> <010> 7. Test a name that has inserted text sequences.<010> <010> " 0031[01]: @$ Macro defn. 0031[03]: @< Open name. 0031[05]: Text. Text scrap[Grey]="A" 0031[13]: Text. Text scrap[Grey]="@" 0031[15]: @> Close name. 0031[17]: Text. Text scrap[Grey]="==" 0031[19]: @{ Open defn. 0031[21]: @} Close defn. 0031[23]: Text. Text scrap[White]="<010> <010> <010> " 0034[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ ========================== Start of MACRO TABLE DUMP =========================== ------------------- Start of Macro Dump -------------------- Macro Name : "" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (15,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=3, Pos(L,C)=(15,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="The empty macro name is quite legal in FunnelWeb." ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : " !"#$%'()*+,-./0123456789:;<=>?" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (25,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=5, Pos(L,C)=(25,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "12345678901234567890123456789012345678901234567890123456789012345678901234567890" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (20,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=4, Pos(L,C)=(20,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "A@" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (31,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=8, Pos(L,C)=(31,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (26,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=6, Pos(L,C)=(26,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Ordinary" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (4,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=1, Pos(L,C)=(4,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="The text of ordinary" ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "abcdefghijklmnopqrstuvwxyz{|}~" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (27,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=7, Pos(L,C)=(27,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "|" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (7,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=2, Pos(L,C)=(7,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="The text of ordinary" ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- =========================== End of MACRO TABLE DUMP ============================ ========================= Start of DOCUMENT LIST DUMP ========================== TEXT COMPONENT: Pos(L,C)=(1,1). -- Start of Text Scrap List -- Text scrap[Grey]="PR04: Test the definition of ordinary macros.<010> <010> 1. Test an ordinary macro definition.<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(4,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(4,39). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 2. Test an ordinary definition using a quickname.<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(7,1). Part 1 of level 0 of macro @<|@>. TEXT COMPONENT: Pos(L,C)=(7,30). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 3. Test a name that includes EOL.<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "1", Section name="Error Recovery Point". TEXT COMPONENT: Pos(L,C)=(12,27). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 4. Test the minimum length name (the empty name).<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(15,1). Part 1 of level 0 of macro @<@>. TEXT COMPONENT: Pos(L,C)=(15,60). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 5. Test a name at the maximum name length limit (80).<010> ONly the second of the two macros should generate an error.<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(20,1). Part 1 of level 0 of macro @<12345678901234567890123456789012345678901234567890123456789012345678901234567890@>. TEXT COMPONENT: Pos(L,C)=(20,91). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "2", Section name="Error Recovery Point". TEXT COMPONENT: Pos(L,C)=(22,27). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 6. Test names with all legal characters. There should be no errors.<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(25,1). Part 1 of level 0 of macro @< !"#$%'()*+,-./0123456789:;<=>?@>. TEXT COMPONENT: Pos(L,C)=(25,42). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(26,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(26,43). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(27,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(27,41). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 7. Test a name that has inserted text sequences.<010> <010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(31,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(31,23). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> <010> " --- End of Text Scrap List --- ========================== End of DOCUMENT LIST DUMP =========================== Global Local| Input File ------------+------------------------------------------------------------------- 1 1| PR04: Test the definition of ordinary macros. 2 2| 3 3| 1. Test an ordinary macro definition. 4 4| @$@@{The text of ordinary@} 5 5| 6 6| 2. Test an ordinary definition using a quickname. 7 7| @$@#|@{The text of ordinary@} 8 8| 9 9| 3. Test a name that includes EOL. 10 10| @$@@{And people who cross lions tend to get eaten.@} 12 12| @A@ |.^...skipped to here after the error. 13 13| 14 14| 4. Test the minimum length name (the empty name). 15 15| @$@<@>@{The empty macro name is quite legal in FunnelWeb.@} 16 16| 17 17| 5. Test a name at the maximum name length limit (80). 18 18| ONly the second of the two macros should generate an error. 19 19| @p maximum_input_line_length = 100 20 20| @$@<12345678901234567890123456789012345678901234567890123456789012345678901234567890@>@{@} 21 21| @$@<123456789012345678901234567890123456789012345678901234567890123456789012345678901@>@{@} Error|.....^Name is too long. |.....^The maximum length of a legal name is 80 characters. |.....^Skipping after error to the next major construct... 22 22| @A@ |.^...skipped to here after the error. 23 23| 24 24| 6. Test names with all legal characters. There should be no errors. 25 25| @$@< !"#$%'()*+,-./0123456789:;<=>?@>@{@} 26 26| @$@@{@} 27 27| @$@@{@} 28 28| 29 29| 7. Test a name that has inserted text sequences. 30 30| 31 31| @$@<@^D(065)@@@>==@{@} 32 32| 33 33| | ------------+------------------------------------------------------------------- There were 2 Errors. eters : 0 Pos(L,C) : (25,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=5, Pos(L,C)=(25,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Levefw_src/answers/pr05.lis 644 0 0 74525 6717353711 10320 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 50 52 30 35 3A 20 54 65 73 74 20 74 68 65 20 70 | PR05: Test the p | | 61 72 73 69 6E 67 20 6F 66 20 66 6F 72 6D 61 6C | arsing of formal | | 20 70 61 72 61 6D 65 74 65 72 20 6C 69 73 74 73 | parameter lists | | 2E 0A 0A 46 69 72 73 74 20 74 72 69 70 20 74 68 | ...First trip th | | 65 20 70 61 72 73 65 72 20 73 6F 20 77 65 20 64 | e parser so we d | | 6F 6E 27 74 20 67 65 74 20 70 61 73 74 20 74 68 | on't get past th | | 65 20 70 61 72 73 65 72 2E 0A 40 3E 0A 0A 31 2E | e parser..@>..1. | | 20 54 65 73 74 20 6D 61 63 72 6F 20 64 65 66 69 | Test macro defi | | 6E 69 74 69 6F 6E 20 77 69 74 68 20 6E 6F 20 66 | nition with no f | | 6F 72 6D 61 6C 20 70 61 72 61 6D 65 74 65 72 73 | ormal parameters | | 2E 0A 40 24 40 3C 53 6C 6F 74 68 40 3E 40 7B 53 | ..@$@@{S | | 6C 6F 74 68 74 65 78 74 40 7D 0A 0A 32 2E 20 54 | lothtext@}..2. T | | 65 73 74 20 6D 61 63 72 6F 20 64 65 66 69 6E 69 | est macro defini | | 74 69 6F 6E 20 77 69 74 68 20 6F 6E 65 20 66 6F | tion with one fo | | 72 6D 61 6C 20 70 61 72 61 6D 65 74 65 72 2E 0A | rmal parameter.. | | 40 24 40 3C 53 6C 6F 74 68 20 77 69 74 68 20 6F | @$@@(@1@)@{Slot | | 68 74 65 78 74 40 7D 0A 0A 33 2E 20 54 65 73 74 | htext@}..3. Test | | 20 6D 61 63 72 6F 20 64 65 66 69 6E 69 74 69 6F | macro definitio | | 6E 20 77 69 74 68 20 6D 61 6E 79 20 66 6F 72 6D | n with many form | | 61 6C 20 70 61 72 61 6D 65 74 65 72 73 2E 0A 40 | al parameters..@ | | 24 40 3C 53 6C 6F 74 68 20 77 69 74 68 20 32 40 | $@@(@2@)@{Slothte | | 78 74 40 7D 0A 40 24 40 3C 53 6C 6F 74 68 20 77 | xt@}.@$@@(@3@)@{S | | 6C 6F 74 68 74 65 78 74 40 7D 0A 40 24 40 3C 53 | lothtext@}.@$@@(@ | | 34 40 29 40 7B 53 6C 6F 74 68 74 65 78 74 40 7D | 4@)@{Slothtext@} | | 0A 40 24 40 3C 53 6C 6F 74 68 20 77 69 74 68 20 | .@$@@(@5@)@{Sloth | | 74 65 78 74 40 7D 0A 40 24 40 3C 53 6C 6F 74 68 | text@}.@$@@(@6@)@ | | 7B 53 6C 6F 74 68 74 65 78 74 40 7D 0A 40 24 40 | {Slothtext@}.@$@ | | 3C 53 6C 6F 74 68 20 77 69 74 68 20 37 40 3E 40 | @ | | 28 40 37 40 29 40 7B 53 6C 6F 74 68 74 65 78 74 | (@7@)@{Slothtext | | 40 7D 0A 40 24 40 3C 53 6C 6F 74 68 20 77 69 74 | @}.@$@@(@8@)@{Slo | | 74 68 74 65 78 74 40 7D 0A 40 24 40 3C 53 6C 6F | thtext@}.@$@@(@9@ | | 29 40 7B 53 6C 6F 74 68 74 65 78 74 40 7D 0A 0A | )@{Slothtext@}.. | | 34 2E 20 54 65 73 74 20 77 69 74 68 20 73 79 6E | 4. Test with syn | | 74 61 78 20 65 72 72 6F 72 73 20 69 6E 20 74 68 | tax errors in th | | 65 20 70 61 72 61 6D 65 74 65 72 20 6C 69 73 74 | e parameter list | | 2E 0A 0A 40 24 40 3C 53 6C 6F 74 68 20 61 40 3E | ...@$@ | | 40 28 40 2B 40 39 40 29 40 7B 53 6C 6F 74 68 74 | @(@+@9@)@{Slotht | | 65 78 74 40 7D 0A 40 41 40 3C 45 72 72 6F 72 20 | ext@}.@A@ | | 0A 0A 40 24 40 3C 53 6C 6F 74 68 20 62 40 3E 40 | ..@$@@ | | 39 40 29 40 7B 53 6C 6F 74 68 74 65 78 74 40 7D | 9@)@{Slothtext@} | | 0A 40 41 40 3C 45 72 72 6F 72 20 72 65 63 6F 76 | .@A@..@$@ | | 3C 53 6C 6F 74 68 20 63 40 3E 40 28 39 40 29 40 | @(9@)@ | | 7B 53 6C 6F 74 68 74 65 78 74 40 7D 0A 40 41 40 | {Slothtext@}.@A@ | | 3C 45 72 72 6F 72 20 72 65 63 6F 76 65 72 79 20 | ..@$@@9@)@{Slot | | 68 74 65 78 74 40 7D 0A 40 41 40 3C 45 72 72 6F | htext@}.@A@..@$@@(@9@)@)@{Sloth | | 74 65 78 74 40 7D 0A 40 41 40 3C 45 72 72 6F 72 | text@}.@A@.... | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| PR05: Test the parsing of formal parameter lists.<010> 00002 00002| <010> 00003 00003| First trip the parser so we don't get past the parser.<010> 00004 00004| @><010> 00005 00005| <010> 00006 00006| 1. Test macro definition with no formal parameters.<010> 00007 00007| @$@@{Slothtext@}<010> 00008 00008| <010> 00009 00009| 2. Test macro definition with one formal parameter.<010> 00010 00010| @$@@(@1@)@{Slothtext@}<010> 00011 00011| <010> 00012 00012| 3. Test macro definition with many formal parameters.<010> 00013 00013| @$@@(@2@)@{Slothtext@}<010> 00014 00014| @$@@(@3@)@{Slothtext@}<010> 00015 00015| @$@@(@4@)@{Slothtext@}<010> 00016 00016| @$@@(@5@)@{Slothtext@}<010> 00017 00017| @$@@(@6@)@{Slothtext@}<010> 00018 00018| @$@@(@7@)@{Slothtext@}<010> 00019 00019| @$@@(@8@)@{Slothtext@}<010> 00020 00020| @$@@(@9@)@{Slothtext@}<010> 00021 00021| <010> 00022 00022| 4. Test with syntax errors in the parameter list.<010> 00023 00023| <010> 00024 00024| @$@@(@+@9@)@{Slothtext@}<010> 00025 00025| @A@<010> 00026 00026| <010> 00027 00027| @$@@9@)@{Slothtext@}<010> 00028 00028| @A@<010> 00029 00029| <010> 00030 00030| @$@@(9@)@{Slothtext@}<010> 00031 00031| @A@<010> 00032 00032| <010> 00033 00033| @$@@9@)@{Slothtext@}<010> 00034 00034| @A@<010> 00035 00035| <010> 00036 00036| @$@@(@9@)@)@{Slothtext@}<010> 00037 00037| @A@<010> 00038 00038| <010> 00039 00039| <010> 00040 00040| <010> 00041 00041| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 191 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="PR05: Test the parsing of formal parameter lists.<010> <010> First trip the parser so we don't get past the parser.<010> " 0004[01]: @> Close name. 0004[03]: Text. Text scrap[Grey]="<010> <010> 1. Test macro definition with no formal parameters.<010> " 0007[01]: @$ Macro defn. 0007[03]: @< Open name. 0007[05]: Text. Text scrap[Grey]="Sloth" 0007[10]: @> Close name. 0007[12]: @{ Open defn. 0007[14]: Text. Text scrap[Grey]="Slothtext" 0007[23]: @} Close defn. 0007[25]: Text. Text scrap[Grey]="<010> <010> 2. Test macro definition with one formal parameter.<010> " 0010[01]: @$ Macro defn. 0010[03]: @< Open name. 0010[05]: Text. Text scrap[Grey]="Sloth with one" 0010[19]: @> Close name. 0010[21]: @( Open param. 0010[23]: @n Parameter. Parameterno=1. 0010[25]: @} Close param. 0010[27]: @{ Open defn. 0010[29]: Text. Text scrap[Grey]="Slothtext" 0010[38]: @} Close defn. 0010[40]: Text. Text scrap[Grey]="<010> <010> 3. Test macro definition with many formal parameters.<010> " 0013[01]: @$ Macro defn. 0013[03]: @< Open name. 0013[05]: Text. Text scrap[Grey]="Sloth with 2" 0013[17]: @> Close name. 0013[19]: @( Open param. 0013[21]: @n Parameter. Parameterno=2. 0013[23]: @} Close param. 0013[25]: @{ Open defn. 0013[27]: Text. Text scrap[Grey]="Slothtext" 0013[36]: @} Close defn. 0013[38]: Text. Text scrap[White]="<010> " 0014[01]: @$ Macro defn. 0014[03]: @< Open name. 0014[05]: Text. Text scrap[Grey]="Sloth with 3" 0014[17]: @> Close name. 0014[19]: @( Open param. 0014[21]: @n Parameter. Parameterno=3. 0014[23]: @} Close param. 0014[25]: @{ Open defn. 0014[27]: Text. Text scrap[Grey]="Slothtext" 0014[36]: @} Close defn. 0014[38]: Text. Text scrap[White]="<010> " 0015[01]: @$ Macro defn. 0015[03]: @< Open name. 0015[05]: Text. Text scrap[Grey]="Sloth with 4" 0015[17]: @> Close name. 0015[19]: @( Open param. 0015[21]: @n Parameter. Parameterno=4. 0015[23]: @} Close param. 0015[25]: @{ Open defn. 0015[27]: Text. Text scrap[Grey]="Slothtext" 0015[36]: @} Close defn. 0015[38]: Text. Text scrap[White]="<010> " 0016[01]: @$ Macro defn. 0016[03]: @< Open name. 0016[05]: Text. Text scrap[Grey]="Sloth with 5" 0016[17]: @> Close name. 0016[19]: @( Open param. 0016[21]: @n Parameter. Parameterno=5. 0016[23]: @} Close param. 0016[25]: @{ Open defn. 0016[27]: Text. Text scrap[Grey]="Slothtext" 0016[36]: @} Close defn. 0016[38]: Text. Text scrap[White]="<010> " 0017[01]: @$ Macro defn. 0017[03]: @< Open name. 0017[05]: Text. Text scrap[Grey]="Sloth with 6" 0017[17]: @> Close name. 0017[19]: @( Open param. 0017[21]: @n Parameter. Parameterno=6. 0017[23]: @} Close param. 0017[25]: @{ Open defn. 0017[27]: Text. Text scrap[Grey]="Slothtext" 0017[36]: @} Close defn. 0017[38]: Text. Text scrap[White]="<010> " 0018[01]: @$ Macro defn. 0018[03]: @< Open name. 0018[05]: Text. Text scrap[Grey]="Sloth with 7" 0018[17]: @> Close name. 0018[19]: @( Open param. 0018[21]: @n Parameter. Parameterno=7. 0018[23]: @} Close param. 0018[25]: @{ Open defn. 0018[27]: Text. Text scrap[Grey]="Slothtext" 0018[36]: @} Close defn. 0018[38]: Text. Text scrap[White]="<010> " 0019[01]: @$ Macro defn. 0019[03]: @< Open name. 0019[05]: Text. Text scrap[Grey]="Sloth with 8" 0019[17]: @> Close name. 0019[19]: @( Open param. 0019[21]: @n Parameter. Parameterno=8. 0019[23]: @} Close param. 0019[25]: @{ Open defn. 0019[27]: Text. Text scrap[Grey]="Slothtext" 0019[36]: @} Close defn. 0019[38]: Text. Text scrap[White]="<010> " 0020[01]: @$ Macro defn. 0020[03]: @< Open name. 0020[05]: Text. Text scrap[Grey]="Sloth with 9" 0020[17]: @> Close name. 0020[19]: @( Open param. 0020[21]: @n Parameter. Parameterno=9. 0020[23]: @} Close param. 0020[25]: @{ Open defn. 0020[27]: Text. Text scrap[Grey]="Slothtext" 0020[36]: @} Close defn. 0020[38]: Text. Text scrap[Grey]="<010> <010> 4. Test with syntax errors in the parameter list.<010> <010> " 0024[01]: @$ Macro defn. 0024[03]: @< Open name. 0024[05]: Text. Text scrap[Grey]="Sloth a" 0024[12]: @> Close name. 0024[14]: @( Open param. 0024[16]: Text. Text scrap[White]="<010> " 0024[18]: @n Parameter. Parameterno=9. 0024[20]: @} Close param. 0024[22]: @{ Open defn. 0024[24]: Text. Text scrap[Grey]="Slothtext" 0024[33]: @} Close defn. 0024[35]: Text. Text scrap[White]="<010> " 0025[01]: @A New section (Level 1). 0025[03]: @< Open name. 0025[05]: Text. Text scrap[Grey]="Error recovery point" 0025[25]: @> Close name. 0025[27]: Text. Text scrap[White]="<010> <010> " 0027[01]: @$ Macro defn. 0027[03]: @< Open name. 0027[05]: Text. Text scrap[Grey]="Sloth b" 0027[12]: @> Close name. 0027[14]: @n Parameter. Parameterno=9. 0027[16]: @} Close param. 0027[18]: @{ Open defn. 0027[20]: Text. Text scrap[Grey]="Slothtext" 0027[29]: @} Close defn. 0027[31]: Text. Text scrap[White]="<010> " 0028[01]: @A New section (Level 1). 0028[03]: @< Open name. 0028[05]: Text. Text scrap[Grey]="Error recovery point" 0028[25]: @> Close name. 0028[27]: Text. Text scrap[White]="<010> <010> " 0030[01]: @$ Macro defn. 0030[03]: @< Open name. 0030[05]: Text. Text scrap[Grey]="Sloth c" 0030[12]: @> Close name. 0030[14]: @( Open param. 0030[16]: Text. Text scrap[Grey]="9" 0030[17]: @} Close param. 0030[19]: @{ Open defn. 0030[21]: Text. Text scrap[Grey]="Slothtext" 0030[30]: @} Close defn. 0030[32]: Text. Text scrap[White]="<010> " 0031[01]: @A New section (Level 1). 0031[03]: @< Open name. 0031[05]: Text. Text scrap[Grey]="Error recovery point" 0031[25]: @> Close name. 0031[27]: Text. Text scrap[White]="<010> <010> " 0033[01]: @$ Macro defn. 0033[03]: @< Open name. 0033[05]: Text. Text scrap[Grey]="Sloth d" 0033[12]: @> Close name. 0033[14]: @n Parameter. Parameterno=9. 0033[16]: @} Close param. 0033[18]: @{ Open defn. 0033[20]: Text. Text scrap[Grey]="Slothtext" 0033[29]: @} Close defn. 0033[31]: Text. Text scrap[White]="<010> " 0034[01]: @A New section (Level 1). 0034[03]: @< Open name. 0034[05]: Text. Text scrap[Grey]="Error recovery point" 0034[25]: @> Close name. 0034[27]: Text. Text scrap[White]="<010> <010> " 0036[01]: @$ Macro defn. 0036[03]: @< Open name. 0036[05]: Text. Text scrap[Grey]="Sloth e" 0036[12]: @> Close name. 0036[14]: @( Open param. 0036[16]: @n Parameter. Parameterno=9. 0036[18]: @} Close param. 0036[20]: @} Close param. 0036[22]: @{ Open defn. 0036[24]: Text. Text scrap[Grey]="Slothtext" 0036[33]: @} Close defn. 0036[35]: Text. Text scrap[White]="<010> " 0037[01]: @A New section (Level 1). 0037[03]: @< Open name. 0037[05]: Text. Text scrap[Grey]="Error recovery point" 0037[25]: @> Close name. 0037[27]: Text. Text scrap[White]="<010> <010> <010> <010> " 0041[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ ========================== Start of MACRO TABLE DUMP =========================== ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (7,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=1, Pos(L,C)=(7,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Slothtext" ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth a" Macro MinLv : 6 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth b" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (27,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 0 body parts. ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth c" Macro MinLv : 6 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth d" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (33,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 0 body parts. ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth e" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 9 Pos(L,C) : (36,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 0 body parts. ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth with 2" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 2 Pos(L,C) : (13,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=3, Pos(L,C)=(13,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Slothtext" ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth with 3" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 3 Pos(L,C) : (14,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=4, Pos(L,C)=(14,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Slothtext" ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth with 4" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 4 Pos(L,C) : (15,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=5, Pos(L,C)=(15,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Slothtext" ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth with 5" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 5 Pos(L,C) : (16,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=6, Pos(L,C)=(16,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Slothtext" ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth with 6" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 6 Pos(L,C) : (17,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=7, Pos(L,C)=(17,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Slothtext" ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth with 7" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 7 Pos(L,C) : (18,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=8, Pos(L,C)=(18,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Slothtext" ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth with 8" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 8 Pos(L,C) : (19,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=9, Pos(L,C)=(19,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Slothtext" ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth with 9" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 9 Pos(L,C) : (20,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=10, Pos(L,C)=(20,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Slothtext" ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth with one" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 1 Pos(L,C) : (10,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=2, Pos(L,C)=(10,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Slothtext" ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- =========================== End of MACRO TABLE DUMP ============================ ========================= Start of DOCUMENT LIST DUMP ========================== TEXT COMPONENT: Pos(L,C)=(1,1). -- Start of Text Scrap List -- Text scrap[Grey]="PR05: Test the parsing of formal parameter lists.<010> <010> First trip the parser so we don't get past the parser.<010> " --- End of Text Scrap List --- TEXT COMPONENT: Pos(L,C)=(4,3). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 1. Test macro definition with no formal parameters.<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(7,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(7,25). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 2. Test macro definition with one formal parameter.<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(10,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(10,40). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 3. Test macro definition with many formal parameters.<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(13,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(13,38). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(14,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(14,38). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(15,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(15,38). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(16,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(16,38). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(17,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(17,38). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(18,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(18,38). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(19,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(19,38). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(20,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(20,38). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 4. Test with syntax errors in the parameter list.<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "1", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(25,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "2", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(28,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "3", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(31,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "4", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(34,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "5", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(37,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> <010> <010> " --- End of Text Scrap List --- ========================== End of DOCUMENT LIST DUMP =========================== Global Local| Input File ------------+------------------------------------------------------------------- 1 1| PR05: Test the parsing of formal parameter lists. 2 2| 3 3| First trip the parser so we don't get past the parser. 4 4| @> Error|.^The parser was at the top level and was expecting |.^one of: {Directive, Text, Macro definition, EOF}. 5 5| 6 6| 1. Test macro definition with no formal parameters. 7 7| @$@@{Slothtext@} 8 8| 9 9| 2. Test macro definition with one formal parameter. 10 10| @$@@(@1@)@{Slothtext@} 11 11| 12 12| 3. Test macro definition with many formal parameters. 13 13| @$@@(@2@)@{Slothtext@} 14 14| @$@@(@3@)@{Slothtext@} 15 15| @$@@(@4@)@{Slothtext@} 16 16| @$@@(@5@)@{Slothtext@} 17 17| @$@@(@6@)@{Slothtext@} 18 18| @$@@(@7@)@{Slothtext@} 19 19| @$@@(@8@)@{Slothtext@} 20 20| @$@@(@9@)@{Slothtext@} 21 21| 22 22| 4. Test with syntax errors in the parameter list. 23 23| 24 24| @$@@(@+@9@)@{Slothtext@} Error|................^Expecting one of [@1..@9]. |................^Skipping after error to the next major construct... 25 25| @A@ |.^...skipped to here after the error. 26 26| 27 27| @$@@9@)@{Slothtext@} Error|..............^Expecting '@{'. |..............^Skipping after error to the next major construct... 28 28| @A@ |.^...skipped to here after the error. 29 29| 30 30| @$@@(9@)@{Slothtext@} Error|................^Expecting one of [@1..@9]. |................^Skipping after error to the next major construct... 31 31| @A@ |.^...skipped to here after the error. 32 32| 33 33| @$@@9@)@{Slothtext@} Error|..............^Expecting '@{'. |..............^Skipping after error to the next major construct... 34 34| @A@ |.^...skipped to here after the error. 35 35| 36 36| @$@@(@9@)@)@{Slothtext@} Error|....................^Expecting '@{'. |....................^Skipping after error to the next major construct... 37 37| @A@ |.^...skipped to here after the error. 38 38| 39 39| 40 40| | ------------+------------------------------------------------------------------- There were 6 Errors. . Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ---------fw_src/answers/pr06.lis 644 0 0 55044 6717353712 10315 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 50 52 30 36 3A 20 54 65 73 74 20 74 68 65 20 70 | PR06: Test the p | | 61 72 73 69 6E 67 20 6F 6E 20 69 6E 76 6F 63 61 | arsing on invoca | | 74 69 6F 6E 20 6E 75 6D 62 65 72 20 63 6F 6E 73 | tion number cons | | 74 72 61 69 6E 74 73 2E 0A 0A 54 72 69 70 20 74 | traints...Trip t | | 68 65 20 70 61 72 73 65 72 20 73 6F 20 77 65 20 | he parser so we | | 64 6F 6E 27 74 20 67 65 74 20 70 61 73 74 20 69 | don't get past i | | 74 2E 0A 40 3E 0A 0A 31 2E 20 54 65 73 74 20 77 | t..@>..1. Test w | | 69 74 68 20 6E 6F 20 7A 65 72 6F 20 61 6E 64 20 | ith no zero and | | 6E 6F 20 6D 61 6E 79 2E 0A 40 24 40 3C 53 6C 6F | no many..@$@@{No zero an | | 64 20 6E 6F 20 6D 61 6E 79 20 69 6E 20 74 68 69 | d no many in thi | | 73 20 6D 61 63 72 6F 40 7D 0A 0A 32 2E 20 54 65 | s macro@}..2. Te | | 73 74 20 77 69 74 68 20 61 20 7A 65 72 6F 2E 0A | st with a zero.. | | 40 24 40 3C 53 6C 6F 74 68 20 7A 65 72 6F 40 3E | @$@ | | 40 5A 40 7B 43 61 6E 20 62 65 20 63 61 6C 6C 65 | @Z@{Can be calle | | 64 20 66 72 6F 6D 20 30 20 74 6F 20 31 20 74 69 | d from 0 to 1 ti | | 6D 65 73 2E 40 7D 0A 0A 33 2E 20 54 65 73 74 20 | mes.@}..3. Test | | 77 69 74 68 20 61 20 6D 61 6E 79 2E 0A 40 24 40 | with a many..@$@ | | 3C 53 6C 6F 74 68 20 6D 61 6E 79 40 3E 40 4D 40 | @M@ | | 7B 43 61 6E 20 62 65 20 63 61 6C 6C 65 64 20 66 | {Can be called f | | 72 6F 6D 20 31 20 74 6F 20 69 6E 66 69 6E 69 74 | rom 1 to infinit | | 79 20 74 69 6D 65 73 2E 40 7D 0A 0A 34 2E 20 54 | y times.@}..4. T | | 65 73 74 20 77 69 74 68 20 61 20 7A 65 72 6F 20 | est with a zero | | 61 6E 64 20 61 20 6D 61 6E 79 2E 0A 40 24 40 3C | and a many..@$@< | | 53 6C 6F 74 68 20 7A 65 72 6F 6D 61 6E 79 40 3E | Sloth zeromany@> | | 40 5A 40 4D 40 7B 43 61 6E 20 62 65 20 63 61 6C | @Z@M@{Can be cal | | 6C 65 64 20 66 72 6F 6D 20 30 20 74 6F 20 69 6E | led from 0 to in | | 66 69 6E 69 74 79 20 74 69 6D 65 73 2E 40 7D 0A | finity times.@}. | | 0A 35 2E 20 54 65 73 74 20 77 69 74 68 20 61 20 | .5. Test with a | | 7A 65 72 6F 20 61 6E 64 20 61 20 6D 61 6E 79 20 | zero and a many | | 62 75 74 20 6F 75 74 20 6F 66 20 6F 72 64 65 72 | but out of order | | 20 28 73 68 6F 75 6C 64 20 67 69 76 65 20 65 72 | (should give er | | 72 6F 72 29 2E 0A 40 24 40 3C 53 6C 6F 74 68 20 | ror)..@$@@M@Z@{ | | 4F 6F 70 73 2E 40 7D 0A 40 41 40 3C 45 72 72 6F | Oops.@}.@A@..6. Test with | | 20 73 79 6E 74 61 63 74 69 63 20 65 72 72 6F 72 | syntactic error | | 73 2E 0A 0A 40 24 40 3C 53 6C 6F 74 68 20 61 40 | s...@$@ @M @Z @{Oops.@ | | 7D 0A 40 41 40 3C 45 72 72 6F 72 20 72 65 63 6F | }.@A@..@$ | | 40 3C 53 6C 6F 74 68 20 62 40 3E 40 5A 40 5A 40 | @@Z@Z@ | | 7B 4F 6F 70 73 2E 40 7D 0A 40 41 40 3C 45 72 72 | {Oops.@}.@A@..@$@@{Oops.@}.@A | | 40 3C 45 72 72 6F 72 20 72 65 63 6F 76 65 72 79 | @..@$@Z@{Oops.@ | | 7D 0A 40 41 40 3C 45 72 72 6F 72 20 72 65 63 6F | }.@A@..@$ | | 40 3C 53 6C 6F 74 68 20 64 40 3E 40 5A 4D 40 7B | @@ZM@{ | | 4F 6F 70 73 2E 40 7D 0A 40 41 40 3C 45 72 72 6F | Oops.@}.@A@... | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| PR06: Test the parsing on invocation number constraints.<010> 00002 00002| <010> 00003 00003| Trip the parser so we don't get past it.<010> 00004 00004| @><010> 00005 00005| <010> 00006 00006| 1. Test with no zero and no many.<010> 00007 00007| @$@@{No zero and no many in this macro@}<010> 00008 00008| <010> 00009 00009| 2. Test with a zero.<010> 00010 00010| @$@@Z@{Can be called from 0 to 1 times.@}<010> 00011 00011| <010> 00012 00012| 3. Test with a many.<010> 00013 00013| @$@@M@{Can be called from 1 to infinity times.@}<010> 00014 00014| <010> 00015 00015| 4. Test with a zero and a many.<010> 00016 00016| @$@@Z@M@{Can be called from 0 to infinity times.@}<010> 00017 00017| <010> 00018 00018| 5. Test with a zero and a many but out of order (should give error).<010> 00019 00019| @$@@M@Z@{Oops.@}<010> 00020 00020| @A@<010> 00021 00021| <010> 00022 00022| 6. Test with syntactic errors.<010> 00023 00023| <010> 00024 00024| @$@ @M @Z @{Oops.@}<010> 00025 00025| @A@<010> 00026 00026| <010> 00027 00027| @$@@Z@Z@{Oops.@}<010> 00028 00028| @A@<010> 00029 00029| <010> 00030 00030| @$@@{Oops.@}<010> 00031 00031| @A@<010> 00032 00032| <010> 00033 00033| @$@Z@{Oops.@}<010> 00034 00034| @A@<010> 00035 00035| <010> 00036 00036| @$@@ZM@{Oops.@}<010> 00037 00037| @A@<010> 00038 00038| <010> 00039 00039| <010> 00040 00040| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 131 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="PR06: Test the parsing on invocation number constraints.<010> <010> Trip the parser so we don't get past it.<010> " 0004[01]: @> Close name. 0004[03]: Text. Text scrap[Grey]="<010> <010> 1. Test with no zero and no many.<010> " 0007[01]: @$ Macro defn. 0007[03]: @< Open name. 0007[05]: Text. Text scrap[Grey]="Sloth" 0007[10]: @> Close name. 0007[12]: @{ Open defn. 0007[14]: Text. Text scrap[Grey]="No zero and no many in this macro" 0007[47]: @} Close defn. 0007[49]: Text. Text scrap[Grey]="<010> <010> 2. Test with a zero.<010> " 0010[01]: @$ Macro defn. 0010[03]: @< Open name. 0010[05]: Text. Text scrap[Grey]="Sloth zero" 0010[15]: @> Close name. 0010[17]: @Z Zero calls. 0010[19]: @{ Open defn. 0010[21]: Text. Text scrap[Grey]="Can be called from 0 to 1 times." 0010[53]: @} Close defn. 0010[55]: Text. Text scrap[Grey]="<010> <010> 3. Test with a many.<010> " 0013[01]: @$ Macro defn. 0013[03]: @< Open name. 0013[05]: Text. Text scrap[Grey]="Sloth many" 0013[15]: @> Close name. 0013[17]: @M Many calls. 0013[19]: @{ Open defn. 0013[21]: Text. Text scrap[Grey]="Can be called from 1 to infinity times." 0013[60]: @} Close defn. 0013[62]: Text. Text scrap[Grey]="<010> <010> 4. Test with a zero and a many.<010> " 0016[01]: @$ Macro defn. 0016[03]: @< Open name. 0016[05]: Text. Text scrap[Grey]="Sloth zeromany" 0016[19]: @> Close name. 0016[21]: @Z Zero calls. 0016[23]: @M Many calls. 0016[25]: @{ Open defn. 0016[27]: Text. Text scrap[Grey]="Can be called from 0 to infinity times." 0016[66]: @} Close defn. 0016[68]: Text. Text scrap[Grey]="<010> <010> 5. Test with a zero and a many but out of order (should give error).<010> " 0019[01]: @$ Macro defn. 0019[03]: @< Open name. 0019[05]: Text. Text scrap[Grey]="Sloth manyzero" 0019[19]: @> Close name. 0019[21]: @M Many calls. 0019[23]: @Z Zero calls. 0019[25]: @{ Open defn. 0019[27]: Text. Text scrap[Grey]="Oops." 0019[32]: @} Close defn. 0019[34]: Text. Text scrap[White]="<010> " 0020[01]: @A New section (Level 1). 0020[03]: @< Open name. 0020[05]: Text. Text scrap[Grey]="Error recovery point" 0020[25]: @> Close name. 0020[27]: Text. Text scrap[Grey]="<010> <010> 6. Test with syntactic errors.<010> <010> " 0024[01]: @$ Macro defn. 0024[03]: @< Open name. 0024[05]: Text. Text scrap[Grey]="Sloth a" 0024[12]: @> Close name. 0024[14]: Text. Text scrap[White]=" " 0024[15]: @M Many calls. 0024[17]: Text. Text scrap[White]=" " 0024[18]: @Z Zero calls. 0024[20]: Text. Text scrap[White]=" " 0024[21]: @{ Open defn. 0024[23]: Text. Text scrap[Grey]="Oops." 0024[28]: @} Close defn. 0024[30]: Text. Text scrap[White]="<010> " 0025[01]: @A New section (Level 1). 0025[03]: @< Open name. 0025[05]: Text. Text scrap[Grey]="Error recovery point" 0025[25]: @> Close name. 0025[27]: Text. Text scrap[White]="<010> <010> " 0027[01]: @$ Macro defn. 0027[03]: @< Open name. 0027[05]: Text. Text scrap[Grey]="Sloth b" 0027[12]: @> Close name. 0027[14]: @Z Zero calls. 0027[16]: @Z Zero calls. 0027[18]: @{ Open defn. 0027[20]: Text. Text scrap[Grey]="Oops." 0027[25]: @} Close defn. 0027[27]: Text. Text scrap[White]="<010> " 0028[01]: @A New section (Level 1). 0028[03]: @< Open name. 0028[05]: Text. Text scrap[Grey]="Error recovery point" 0028[25]: @> Close name. 0028[27]: Text. Text scrap[White]="<010> <010> " 0030[01]: @$ Macro defn. 0030[03]: @< Open name. 0030[05]: Text. Text scrap[Grey]="Sloth c" 0030[12]: @Z Zero calls. 0030[14]: @> Close name. 0030[16]: @{ Open defn. 0030[18]: Text. Text scrap[Grey]="Oops." 0030[23]: @} Close defn. 0030[25]: Text. Text scrap[White]="<010> " 0031[01]: @A New section (Level 1). 0031[03]: @< Open name. 0031[05]: Text. Text scrap[Grey]="Error recovery point" 0031[25]: @> Close name. 0031[27]: Text. Text scrap[White]="<010> <010> " 0033[01]: @$ Macro defn. 0033[03]: @< Open name. 0033[05]: Text. Text scrap[Grey]="Sloth d" 0033[12]: @> Close name. 0033[14]: Text. Text scrap[Grey]="Z" 0033[15]: @{ Open defn. 0033[17]: Text. Text scrap[Grey]="Oops." 0033[22]: @} Close defn. 0033[24]: Text. Text scrap[White]="<010> " 0034[01]: @A New section (Level 1). 0034[03]: @< Open name. 0034[05]: Text. Text scrap[Grey]="Error recovery point" 0034[25]: @> Close name. 0034[27]: Text. Text scrap[White]="<010> <010> " 0036[01]: @$ Macro defn. 0036[03]: @< Open name. 0036[05]: Text. Text scrap[Grey]="Sloth d" 0036[12]: @> Close name. 0036[14]: @Z Zero calls. 0036[16]: Text. Text scrap[Grey]="M" 0036[17]: @{ Open defn. 0036[19]: Text. Text scrap[Grey]="Oops." 0036[24]: @} Close defn. 0036[26]: Text. Text scrap[White]="<010> " 0037[01]: @A New section (Level 1). 0037[03]: @< Open name. 0037[05]: Text. Text scrap[Grey]="Error recovery point" 0037[25]: @> Close name. 0037[27]: Text. Text scrap[White]="<010> <010> <010> " 0040[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ ========================== Start of MACRO TABLE DUMP =========================== ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (7,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=1, Pos(L,C)=(7,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="No zero and no many in this macro" ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth a" Macro MinLv : 6 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth b" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (27,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 0 body parts. ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth d" Macro MinLv : 6 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth many" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (13,1) Additive? : No. Zero Calls? : No. Many Calls? : Yes. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=3, Pos(L,C)=(13,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Can be called from 1 to infinity times." ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth manyzero" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (19,1) Additive? : No. Zero Calls? : No. Many Calls? : Yes. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 0 body parts. ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth zero" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (10,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=2, Pos(L,C)=(10,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Can be called from 0 to 1 times." ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth zeromany" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (16,1) Additive? : No. Zero Calls? : Yes. Many Calls? : Yes. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=4, Pos(L,C)=(16,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Can be called from 0 to infinity times." ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- =========================== End of MACRO TABLE DUMP ============================ ========================= Start of DOCUMENT LIST DUMP ========================== TEXT COMPONENT: Pos(L,C)=(1,1). -- Start of Text Scrap List -- Text scrap[Grey]="PR06: Test the parsing on invocation number constraints.<010> <010> Trip the parser so we don't get past it.<010> " --- End of Text Scrap List --- TEXT COMPONENT: Pos(L,C)=(4,3). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 1. Test with no zero and no many.<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(7,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(7,49). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 2. Test with a zero.<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(10,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(10,55). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 3. Test with a many.<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(13,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(13,62). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 4. Test with a zero and a many.<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(16,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(16,68). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 5. Test with a zero and a many but out of order (should give error).<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "1", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(20,27). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 6. Test with syntactic errors.<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "2", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(25,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "3", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(28,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "4", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(31,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "5", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(34,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "6", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(37,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> <010> " --- End of Text Scrap List --- ========================== End of DOCUMENT LIST DUMP =========================== Global Local| Input File ------------+------------------------------------------------------------------- 1 1| PR06: Test the parsing on invocation number constraints. 2 2| 3 3| Trip the parser so we don't get past it. 4 4| @> Error|.^The parser was at the top level and was expecting |.^one of: {Directive, Text, Macro definition, EOF}. 5 5| 6 6| 1. Test with no zero and no many. 7 7| @$@@{No zero and no many in this macro@} 8 8| 9 9| 2. Test with a zero. 10 10| @$@@Z@{Can be called from 0 to 1 times.@} 11 11| 12 12| 3. Test with a many. 13 13| @$@@M@{Can be called from 1 to infinity times.@} 14 14| 15 15| 4. Test with a zero and a many. 16 16| @$@@Z@M@{Can be called from 0 to infinity times.@} 17 17| 18 18| 5. Test with a zero and a many but out of order (should give error). 19 19| @$@@M@Z@{Oops.@} Error|.......................^Expecting '@{'. |.......................^Skipping after error to the next major construct... 20 20| @A@ |.^...skipped to here after the error. 21 21| 22 22| 6. Test with syntactic errors. 23 23| 24 24| @$@ @M @Z @{Oops.@} Error|..............^Expecting "==@{" or "+=@{" or just "@{". |..............^(or @Z or @M or @L if they have not already appeared). |..............^Note: FunnelWeb is intolerant of spaces at this point. |...............^Skipping after error to the next major construct... 25 25| @A@ |.^...skipped to here after the error. 26 26| 27 27| @$@@Z@Z@{Oops.@} Error|................^Expecting '@{'. |................^Skipping after error to the next major construct... 28 28| @A@ |.^...skipped to here after the error. 29 29| 30 30| @$@@{Oops.@} Error|............^Illegal character or symbol in name. |............^Skipping after error to the next major construct... 31 31| @A@ |.^...skipped to here after the error. 32 32| 33 33| @$@Z@{Oops.@} Error|..............^Expecting "==@{" or "+=@{" or just "@{". |..............^(or @Z or @M or @L if they have not already appeared). |..............^Note: FunnelWeb is intolerant of spaces at this point. |...............^Skipping after error to the next major construct... 34 34| @A@ |.^...skipped to here after the error. 35 35| 36 36| @$@@ZM@{Oops.@} Error|................^Expecting "==@{" or "+=@{" or just "@{". |................^(or @Z or @M or @L if they have not already appeared). |................^Note: FunnelWeb is intolerant of spaces at this point. |.................^Skipping after error to the next major construct... 37 37| @A@ |.^...skipped to here after the error. 38 38| 39 39| | ------------+------------------------------------------------------------------- There were 7 Errors. Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (27,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 0 body parts. ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -fw_src/answers/pr07.lis 644 0 0 51721 6717353714 10316 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 50 52 30 37 3A 20 54 65 73 74 20 74 68 65 20 70 | PR07: Test the p | | 61 72 73 69 6E 67 20 6F 66 20 3D 3D 20 61 6E 64 | arsing of == and | | 20 2B 3D 20 69 6E 20 6D 61 63 72 6F 20 64 65 66 | += in macro def | | 69 6E 69 74 69 6F 6E 73 2E 0A 0A 54 72 69 70 20 | initions...Trip | | 74 68 65 20 70 61 72 73 65 72 20 73 6F 20 77 65 | the parser so we | | 20 64 6F 6E 27 74 20 67 65 74 20 61 6E 79 20 66 | don't get any f | | 75 72 74 68 65 72 2E 0A 40 3E 0A 0A 31 2E 20 54 | urther..@>..1. T | | 65 73 74 20 77 69 74 68 20 6E 6F 20 65 71 75 61 | est with no equa | | 6C 73 2E 0A 40 24 40 3C 53 6C 6F 74 68 40 3E 40 | ls..@$@@ | | 7B 4E 6F 20 65 71 75 61 6C 73 20 69 6E 20 74 68 | {No equals in th | | 69 73 20 6D 61 63 72 6F 20 64 65 66 69 6E 69 74 | is macro definit | | 69 6F 6E 2E 40 7D 0A 0A 32 2E 20 54 65 73 74 20 | ion.@}..2. Test | | 77 69 74 68 20 3D 3D 2E 0A 40 24 40 3C 53 6C 6F | with ==..@$@ | | 3D 3D 40 7B 4E 6F 20 65 71 75 61 6C 73 20 69 6E | ==@{No equals in | | 20 74 68 69 73 20 6D 61 63 72 6F 20 64 65 66 69 | this macro defi | | 6E 69 74 69 6F 6E 2E 40 7D 0A 0A 33 2E 20 54 65 | nition.@}..3. Te | | 73 74 20 77 69 74 68 20 2B 3D 2E 0A 40 24 40 3C | st with +=..@$@< | | 53 6C 6F 74 68 20 77 69 74 68 20 70 6C 75 73 40 | Sloth with plus@ | | 3E 2B 3D 40 7B 4E 6F 20 65 71 75 61 6C 73 20 69 | >+=@{No equals i | | 6E 20 74 68 69 73 20 6D 61 63 72 6F 20 64 65 66 | n this macro def | | 69 6E 69 74 69 6F 6E 2E 40 7D 0A 0A 34 2E 20 54 | inition.@}..4. T | | 65 73 74 20 77 69 74 68 20 73 79 6E 74 61 78 20 | est with syntax | | 65 72 72 6F 72 73 2E 0A 0A 40 24 40 3C 45 72 72 | errors...@$@++@{No equa | | 6C 73 20 69 6E 20 74 68 69 73 20 6D 61 63 72 6F | ls in this macro | | 20 64 65 66 69 6E 69 74 69 6F 6E 2E 40 7D 0A 40 | definition.@}.@ | | 41 40 3C 45 72 72 6F 72 20 72 65 63 6F 76 65 72 | A@..@$@@+=@{No e | | 71 75 61 6C 73 20 69 6E 20 74 68 69 73 20 6D 61 | quals in this ma | | 63 72 6F 20 64 65 66 69 6E 69 74 69 6F 6E 2E 40 | cro definition.@ | | 7D 0A 40 41 40 3C 45 72 72 6F 72 20 72 65 63 6F | }.@A@..@$ | | 40 3C 45 72 72 6F 72 33 40 3E 2B 3D 3D 2B 40 7B | @+==+@{ | | 4E 6F 20 65 71 75 61 6C 73 20 69 6E 20 74 68 69 | No equals in thi | | 73 20 6D 61 63 72 6F 20 64 65 66 69 6E 69 74 69 | s macro definiti | | 6F 6E 2E 40 7D 0A 40 41 40 3C 45 72 72 6F 72 20 | on.@}.@A@ | | 0A 0A 40 24 40 3C 45 72 72 6F 72 34 40 3E 3D 2B | ..@$@=+ | | 40 7B 4E 6F 20 65 71 75 61 6C 73 20 69 6E 20 74 | @{No equals in t | | 68 69 73 20 6D 61 63 72 6F 20 64 65 66 69 6E 69 | his macro defini | | 74 69 6F 6E 2E 40 7D 0A 40 41 40 3C 45 72 72 6F | tion.@}.@A@..@$@ | | 40 3D 40 3D 40 7B 4E 6F 20 65 71 75 61 6C 73 20 | @=@=@{No equals | | 69 6E 20 74 68 69 73 20 6D 61 63 72 6F 20 64 65 | in this macro de | | 66 69 6E 69 74 69 6F 6E 2E 40 7D 0A 40 41 40 3C | finition.@}.@A@< | | 45 72 72 6F 72 20 72 65 63 6F 76 65 72 79 20 70 | Error recovery p | | 6F 69 6E 74 40 3E 0A 0A 40 24 40 3C 45 72 72 6F | oint@>..@$@@+@=@{No equ | | 61 6C 73 20 69 6E 20 74 68 69 73 20 6D 61 63 72 | als in this macr | | 6F 20 64 65 66 69 6E 69 74 69 6F 6E 2E 40 7D 0A | o definition.@}. | | 40 41 40 3C 45 72 72 6F 72 20 72 65 63 6F 76 65 | @A@.... | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| PR07: Test the parsing of == and += in macro definitions.<010> 00002 00002| <010> 00003 00003| Trip the parser so we don't get any further.<010> 00004 00004| @><010> 00005 00005| <010> 00006 00006| 1. Test with no equals.<010> 00007 00007| @$@@{No equals in this macro definition.@}<010> 00008 00008| <010> 00009 00009| 2. Test with ==.<010> 00010 00010| @$@==@{No equals in this macro definition.@}<010> 00011 00011| <010> 00012 00012| 3. Test with +=.<010> 00013 00013| @$@+=@{No equals in this macro definition.@}<010> 00014 00014| <010> 00015 00015| 4. Test with syntax errors.<010> 00016 00016| <010> 00017 00017| @$@++@{No equals in this macro definition.@}<010> 00018 00018| @A@<010> 00019 00019| <010> 00020 00020| @$@@+=@{No equals in this macro definition.@}<010> 00021 00021| @A@<010> 00022 00022| <010> 00023 00023| @$@+==+@{No equals in this macro definition.@}<010> 00024 00024| @A@<010> 00025 00025| <010> 00026 00026| @$@=+@{No equals in this macro definition.@}<010> 00027 00027| @A@<010> 00028 00028| <010> 00029 00029| @$@@=@=@{No equals in this macro definition.@}<010> 00030 00030| @A@<010> 00031 00031| <010> 00032 00032| @$@@+@=@{No equals in this macro definition.@}<010> 00033 00033| @A@<010> 00034 00034| <010> 00035 00035| <010> 00036 00036| <010> 00037 00037| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 114 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="PR07: Test the parsing of == and += in macro definitions.<010> <010> Trip the parser so we don't get any further.<010> " 0004[01]: @> Close name. 0004[03]: Text. Text scrap[Grey]="<010> <010> 1. Test with no equals.<010> " 0007[01]: @$ Macro defn. 0007[03]: @< Open name. 0007[05]: Text. Text scrap[Grey]="Sloth" 0007[10]: @> Close name. 0007[12]: @{ Open defn. 0007[14]: Text. Text scrap[Grey]="No equals in this macro definition." 0007[49]: @} Close defn. 0007[51]: Text. Text scrap[Grey]="<010> <010> 2. Test with ==.<010> " 0010[01]: @$ Macro defn. 0010[03]: @< Open name. 0010[05]: Text. Text scrap[Grey]="Sloth with equals" 0010[22]: @> Close name. 0010[24]: Text. Text scrap[Grey]="==" 0010[26]: @{ Open defn. 0010[28]: Text. Text scrap[Grey]="No equals in this macro definition." 0010[63]: @} Close defn. 0010[65]: Text. Text scrap[Grey]="<010> <010> 3. Test with +=.<010> " 0013[01]: @$ Macro defn. 0013[03]: @< Open name. 0013[05]: Text. Text scrap[Grey]="Sloth with plus" 0013[20]: @> Close name. 0013[22]: Text. Text scrap[Grey]="+=" 0013[24]: @{ Open defn. 0013[26]: Text. Text scrap[Grey]="No equals in this macro definition." 0013[61]: @} Close defn. 0013[63]: Text. Text scrap[Grey]="<010> <010> 4. Test with syntax errors.<010> <010> " 0017[01]: @$ Macro defn. 0017[03]: @< Open name. 0017[05]: Text. Text scrap[Grey]="Error1" 0017[11]: @> Close name. 0017[13]: Text. Text scrap[Grey]="++" 0017[15]: @{ Open defn. 0017[17]: Text. Text scrap[Grey]="No equals in this macro definition." 0017[52]: @} Close defn. 0017[54]: Text. Text scrap[White]="<010> " 0018[01]: @A New section (Level 1). 0018[03]: @< Open name. 0018[05]: Text. Text scrap[Grey]="Error recovery point" 0018[25]: @> Close name. 0018[27]: Text. Text scrap[White]="<010> <010> " 0020[01]: @$ Macro defn. 0020[03]: @< Open name. 0020[05]: Text. Text scrap[Grey]="Error2" 0020[11]: @> Close name. 0020[13]: Text. Text scrap[White]="<010> " 0020[15]: Text. Text scrap[Grey]="=" 0020[16]: @{ Open defn. 0020[18]: Text. Text scrap[Grey]="No equals in this macro definition." 0020[53]: @} Close defn. 0020[55]: Text. Text scrap[White]="<010> " 0021[01]: @A New section (Level 1). 0021[03]: @< Open name. 0021[05]: Text. Text scrap[Grey]="Error recovery point" 0021[25]: @> Close name. 0021[27]: Text. Text scrap[White]="<010> <010> " 0023[01]: @$ Macro defn. 0023[03]: @< Open name. 0023[05]: Text. Text scrap[Grey]="Error3" 0023[11]: @> Close name. 0023[13]: Text. Text scrap[Grey]="+==+" 0023[17]: @{ Open defn. 0023[19]: Text. Text scrap[Grey]="No equals in this macro definition." 0023[54]: @} Close defn. 0023[56]: Text. Text scrap[White]="<010> " 0024[01]: @A New section (Level 1). 0024[03]: @< Open name. 0024[05]: Text. Text scrap[Grey]="Error recovery point" 0024[25]: @> Close name. 0024[27]: Text. Text scrap[White]="<010> <010> " 0026[01]: @$ Macro defn. 0026[03]: @< Open name. 0026[05]: Text. Text scrap[Grey]="Error4" 0026[11]: @> Close name. 0026[13]: Text. Text scrap[Grey]="=+" 0026[15]: @{ Open defn. 0026[17]: Text. Text scrap[Grey]="No equals in this macro definition." 0026[52]: @} Close defn. 0026[54]: Text. Text scrap[White]="<010> " 0027[01]: @A New section (Level 1). 0027[03]: @< Open name. 0027[05]: Text. Text scrap[Grey]="Error recovery point" 0027[25]: @> Close name. 0027[27]: Text. Text scrap[White]="<010> <010> " 0029[01]: @$ Macro defn. 0029[03]: @< Open name. 0029[05]: Text. Text scrap[Grey]="Error4" 0029[11]: @> Close name. 0029[16]: Text. Text scrap[Grey]="=" 0029[17]: @{ Open defn. 0029[19]: Text. Text scrap[Grey]="No equals in this macro definition." 0029[54]: @} Close defn. 0029[56]: Text. Text scrap[White]="<010> " 0030[01]: @A New section (Level 1). 0030[03]: @< Open name. 0030[05]: Text. Text scrap[Grey]="Error recovery point" 0030[25]: @> Close name. 0030[27]: Text. Text scrap[White]="<010> <010> " 0032[01]: @$ Macro defn. 0032[03]: @< Open name. 0032[05]: Text. Text scrap[Grey]="Error4" 0032[11]: @> Close name. 0032[13]: Text. Text scrap[White]="<010> " 0032[18]: Text. Text scrap[Grey]="{No equals in this macro definition." 0032[54]: @} Close defn. 0032[56]: Text. Text scrap[White]="<010> " 0033[01]: @A New section (Level 1). 0033[03]: @< Open name. 0033[05]: Text. Text scrap[Grey]="Error recovery point" 0033[25]: @> Close name. 0033[27]: Text. Text scrap[White]="<010> <010> <010> <010> " 0037[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ ========================== Start of MACRO TABLE DUMP =========================== ------------------- Start of Macro Dump -------------------- Macro Name : "Error1" Macro MinLv : 6 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Error2" Macro MinLv : 6 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Error3" Macro MinLv : 6 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Error4" Macro MinLv : 6 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (7,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=1, Pos(L,C)=(7,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="No equals in this macro definition." ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth with equals" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (10,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=2, Pos(L,C)=(10,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="No equals in this macro definition." ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth with plus" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (13,1) Additive? : Yes. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=3, Pos(L,C)=(13,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="No equals in this macro definition." ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- =========================== End of MACRO TABLE DUMP ============================ ========================= Start of DOCUMENT LIST DUMP ========================== TEXT COMPONENT: Pos(L,C)=(1,1). -- Start of Text Scrap List -- Text scrap[Grey]="PR07: Test the parsing of == and += in macro definitions.<010> <010> Trip the parser so we don't get any further.<010> " --- End of Text Scrap List --- TEXT COMPONENT: Pos(L,C)=(4,3). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 1. Test with no equals.<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(7,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(7,51). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 2. Test with ==.<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(10,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(10,65). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 3. Test with +=.<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(13,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(13,63). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 4. Test with syntax errors.<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "1", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(18,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "2", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(21,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "3", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(24,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "4", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(27,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "5", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(30,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "6", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(33,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> <010> <010> " --- End of Text Scrap List --- ========================== End of DOCUMENT LIST DUMP =========================== Global Local| Input File ------------+------------------------------------------------------------------- 1 1| PR07: Test the parsing of == and += in macro definitions. 2 2| 3 3| Trip the parser so we don't get any further. 4 4| @> Error|.^The parser was at the top level and was expecting |.^one of: {Directive, Text, Macro definition, EOF}. 5 5| 6 6| 1. Test with no equals. 7 7| @$@@{No equals in this macro definition.@} 8 8| 9 9| 2. Test with ==. 10 10| @$@==@{No equals in this macro definition.@} 11 11| 12 12| 3. Test with +=. 13 13| @$@+=@{No equals in this macro definition.@} 14 14| 15 15| 4. Test with syntax errors. 16 16| 17 17| @$@++@{No equals in this macro definition.@} Error|.............^Expecting "==@{" or "+=@{" or just "@{". |.............^(or @Z or @M or @L if they have not already appeared). |.............^Note: FunnelWeb is intolerant of spaces at this point. |...............^Skipping after error to the next major construct... 18 18| @A@ |.^...skipped to here after the error. 19 19| 20 20| @$@@+=@{No equals in this macro definition.@} Error|.............^Expecting "==@{" or "+=@{" or just "@{". |.............^(or @Z or @M or @L if they have not already appeared). |.............^Note: FunnelWeb is intolerant of spaces at this point. |................^Skipping after error to the next major construct... 21 21| @A@ |.^...skipped to here after the error. 22 22| 23 23| @$@+==+@{No equals in this macro definition.@} Error|.............^Expecting "==@{" or "+=@{" or just "@{". |.............^(or @Z or @M or @L if they have not already appeared). |.............^Note: FunnelWeb is intolerant of spaces at this point. |.................^Skipping after error to the next major construct... 24 24| @A@ |.^...skipped to here after the error. 25 25| 26 26| @$@=+@{No equals in this macro definition.@} Error|.............^Expecting "==@{" or "+=@{" or just "@{". |.............^(or @Z or @M or @L if they have not already appeared). |.............^Note: FunnelWeb is intolerant of spaces at this point. |...............^Skipping after error to the next major construct... 27 27| @A@ |.^...skipped to here after the error. 28 28| 29 29| @$@@=@=@{No equals in this macro definition.@} Error|................^Expecting "==@{" or "+=@{" or just "@{". |................^(or @Z or @M or @L if they have not already appeared). |................^Note: FunnelWeb is intolerant of spaces at this point. |.................^Skipping after error to the next major construct... 30 30| @A@ |.^...skipped to here after the error. 31 31| 32 32| @$@@+@=@{No equals in this macro definition.@} Error|.............^Expecting "==@{" or "+=@{" or just "@{". |.............^(or @Z or @M or @L if they have not already appeared). |.............^Note: FunnelWeb is intolerant of spaces at this point. |......................................................^Skipping after error to the next major construct... 33 33| @A@ |.^...skipped to here after the error. 34 34| 35 35| 36 36| | ------------+------------------------------------------------------------------- There were 7 Errors. s not defined. Level 2 is not defined. Level 3 fw_src/answers/pr08.lis 644 0 0 142140 6717353717 10336 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 50 52 30 38 3A 20 54 65 73 74 20 73 65 6D 61 6E | PR08: Test seman | | 74 69 63 20 63 68 65 63 6B 69 6E 67 20 6F 66 20 | tic checking of | | 6D 61 63 72 6F 20 64 65 66 69 6E 69 74 69 6F 6E | macro definition | | 73 2E 0A 0A 54 72 69 70 20 70 61 72 73 65 72 20 | s...Trip parser | | 74 6F 20 62 65 20 73 75 72 65 20 74 68 61 74 20 | to be sure that | | 77 65 20 77 6F 6E 27 74 20 67 65 74 20 61 6E 79 | we won't get any | | 20 6F 75 74 70 75 74 20 66 69 6C 65 73 21 0A 40 | output files!.@ | | 3E 0A 0A 31 2E 20 46 69 6C 65 20 6D 61 63 72 6F | >..1. File macro | | 20 68 61 73 20 70 61 72 61 6D 65 74 65 72 73 2E | has parameters. | | 20 45 72 72 6F 72 2E 0A 40 4F 40 3C 53 6C 6F 74 | Error..@O@@(@3@)@{Wal | | 72 75 73 40 7D 0A 40 41 40 3C 45 72 72 6F 72 20 | rus@}.@A@ | | 0A 0A 32 2E 20 46 69 6C 65 20 6D 61 63 72 6F 20 | ..2. File macro | | 69 73 20 61 64 64 69 74 69 76 65 2E 20 45 72 72 | is additive. Err | | 6F 72 2E 0A 40 4F 40 3C 53 6C 6F 74 68 20 32 40 | or..@O@+=@{Walrus@}.@A | | 40 3C 45 72 72 6F 72 20 72 65 63 6F 76 65 72 79 | @..3. Fil | | 65 20 6D 61 63 72 6F 20 68 61 73 20 74 6F 6F 20 | e macro has too | | 6C 6F 6E 67 20 61 20 6E 61 6D 65 2E 20 54 68 65 | long a name. The | | 20 74 65 73 74 20 6E 61 6D 65 20 68 61 73 20 31 | test name has 1 | | 32 30 30 20 63 68 61 72 61 63 74 65 72 73 2E 20 | 200 characters. | | 45 72 72 2E 0A 4E 6F 74 65 3A 20 54 68 69 73 20 | Err..Note: This | | 74 65 73 74 20 63 61 6E 27 74 20 74 65 73 74 20 | test can't test | | 74 68 65 20 65 72 72 6F 72 20 6D 65 73 73 61 67 | the error messag | | 65 20 69 66 20 74 68 65 20 6D 61 78 69 6D 75 6D | e if the maximum | | 20 6C 65 6E 67 74 68 20 6F 66 20 61 0A 6D 61 63 | length of a.mac | | 72 6F 20 6E 61 6D 65 20 69 73 20 6C 65 73 73 20 | ro name is less | | 74 68 61 6E 20 74 68 65 20 6D 61 78 69 6D 75 6D | than the maximum | | 20 6C 65 6E 67 74 68 20 6F 66 20 61 20 66 69 6C | length of a fil | | 65 20 6E 61 6D 65 20 61 73 20 74 68 65 20 6E 61 | e name as the na | | 6D 65 0A 65 72 72 6F 72 20 69 73 20 63 61 75 67 | me.error is caug | | 68 74 20 66 69 72 73 74 2E 0A 40 70 20 6D 61 78 | ht first..@p max | | 69 6D 75 6D 5F 69 6E 70 75 74 5F 6C 69 6E 65 5F | imum_input_line_ | | 6C 65 6E 67 74 68 20 3D 20 69 6E 66 69 6E 69 74 | length = infinit | | 79 0A 40 4F 40 3C 31 32 33 34 35 36 37 38 39 30 | y.@O@<1234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 40 3E 40 7B 40 7D 0A 40 41 40 | 567890@>@{@}.@A@ | | 3C 45 72 72 6F 72 20 72 65 63 6F 76 65 72 79 20 | ..4. File | | 20 6D 61 63 72 6F 20 68 61 73 20 7A 65 72 6F 20 | macro has zero | | 6F 72 20 6D 61 6E 79 20 61 74 74 72 69 62 75 74 | or many attribut | | 65 73 2E 20 45 72 72 6F 72 2E 0A 40 4F 40 3C 53 | es. Error..@O@@Z@{Walr | | 75 73 40 7D 0A 40 41 40 3C 45 72 72 6F 72 20 72 | us@}.@A@. | | 0A 40 4F 40 3C 53 6C 6F 74 68 20 34 40 3E 40 4D | .@O@@M | | 40 7B 57 61 6C 72 75 73 40 7D 0A 40 41 40 3C 45 | @{Walrus@}.@A@..@O@@Z@M@{Walrus | | 40 7D 0A 40 41 40 3C 45 72 72 6F 72 20 72 65 63 | @}.@A@..5 | | 2E 20 50 72 65 76 69 6F 75 73 20 64 65 66 69 6E | . Previous defin | | 69 74 69 6F 6E 20 69 73 20 66 75 6C 6C 2C 20 63 | ition is full, c | | 75 72 72 65 6E 74 20 69 73 20 61 64 64 69 74 69 | urrent is additi | | 76 65 2E 0A 40 24 40 3C 57 61 6C 72 75 73 20 31 | ve..@$@==@{Sloth@}.@$ | | 40 3C 57 61 6C 72 75 73 20 31 40 3E 2B 3D 40 7B | @+=@{ | | 41 61 72 64 76 61 72 6B 40 7D 0A 40 41 40 3C 45 | Aardvark@}.@A@..6. Previo | | 75 73 20 64 65 66 69 6E 69 74 69 6F 6E 20 69 73 | us definition is | | 20 61 64 64 69 74 69 76 65 2C 20 63 75 72 72 65 | additive, curre | | 6E 74 20 69 73 20 66 75 6C 6C 2E 0A 40 24 40 3C | nt is full..@$@< | | 57 61 6C 72 75 73 20 32 40 3E 2B 3D 40 7B 53 6C | Walrus 2@>+=@{Sl | | 6F 74 68 40 7D 0A 40 24 40 3C 57 61 6C 72 75 73 | oth@}.@$@==@{Aardvark | | 40 7D 0A 40 41 40 3C 45 72 72 6F 72 20 72 65 63 | @}.@A@..7 | | 2E 20 4E 6F 6E 2D 66 69 72 73 74 20 62 6F 64 79 | . Non-first body | | 20 70 61 72 74 20 6F 66 20 70 61 72 74 69 61 6C | part of partial | | 20 68 61 73 20 70 61 72 61 6D 65 74 65 72 2E 0A | has parameter.. | | 40 24 40 3C 55 6E 69 63 6F 72 6E 40 3E 40 28 40 | @$@@(@ | | 33 40 29 2B 3D 40 7B 54 75 72 6B 65 79 40 7D 0A | 3@)+=@{Turkey@}. | | 40 24 40 3C 55 6E 69 63 6F 72 6E 40 3E 40 28 40 | @$@@(@ | | 33 40 29 2B 3D 40 7B 54 75 72 6B 65 79 40 7D 0A | 3@)+=@{Turkey@}. | | 40 41 40 3C 45 72 72 6F 72 20 72 65 63 6F 76 65 | @A@..8. Z | | 65 72 6F 20 6F 72 20 6D 61 6E 79 20 61 74 74 72 | ero or many attr | | 69 62 75 74 65 73 20 6F 6E 20 6E 6F 6E 2D 66 69 | ibutes on non-fi | | 72 73 74 20 62 6F 64 79 20 70 61 72 74 20 6F 66 | rst body part of | | 20 61 64 64 69 74 69 76 65 2E 0A 40 24 40 3C 45 | additive..@$@@Z@M+=@ | | 7B 54 75 72 6B 65 79 40 7D 0A 40 24 40 3C 45 6C | {Turkey@}.@$@@Z@M+=@{ | | 54 75 72 6B 65 79 40 7D 0A 40 41 40 3C 45 72 72 | Turkey@}.@A@..9. Check th | | 61 74 20 6E 6F 6E 2D 65 78 69 73 74 65 6E 74 20 | at non-existent | | 66 6F 72 6D 61 6C 20 70 61 72 61 6D 65 74 65 72 | formal parameter | | 73 20 61 72 65 20 63 61 75 67 68 74 2E 0A 0A 40 | s are caught...@ | | 24 40 3C 5A 65 72 6F 40 3E 40 5A 40 7B 53 6C 6F | $@@Z@{Slo | | 74 68 40 31 57 61 6C 72 75 73 40 7D 0A 40 41 40 | th@1Walrus@}.@A@ | | 3C 45 72 72 6F 72 20 72 65 63 6F 76 65 72 79 20 | ..@$@@(@1@)@Z@{Slot | | 68 40 32 57 61 6C 72 75 73 40 7D 0A 40 41 40 3C | h@2Walrus@}.@A@< | | 45 72 72 6F 72 20 72 65 63 6F 76 65 72 79 20 70 | Error recovery p | | 6F 69 6E 74 40 3E 0A 0A 40 24 40 3C 4D 61 6E 79 | oint@>..@$@@(@7@)@Z@{Slot | | 68 40 38 57 61 6C 72 75 73 40 7D 0A 40 41 40 3C | h@8Walrus@}.@A@< | | 45 72 72 6F 72 20 72 65 63 6F 76 65 72 79 20 70 | Error recovery p | | 6F 69 6E 74 40 3E 0A | oint@>. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| PR08: Test semantic checking of macro definitions.<010> 00002 00002| <010> 00003 00003| Trip parser to be sure that we won't get any output files!<010> 00004 00004| @><010> 00005 00005| <010> 00006 00006| 1. File macro has parameters. Error.<010> 00007 00007| @O@@(@3@)@{Walrus@}<010> 00008 00008| @A@<010> 00009 00009| <010> 00010 00010| 2. File macro is additive. Error.<010> 00011 00011| @O@+=@{Walrus@}<010> 00012 00012| @A@<010> 00013 00013| <010> 00014 00014| 3. File macro has too long a name. The test name has 1200 characters. Err.<010> 00015 00015| Note: This test can't test the error message if the maximum length of a<010> 00016 00016| macro name is less than the maximum length of a file name as the name<010> 00017 00017| error is caught first.<010> 00018 00018| @p maximum_input_line_length = infinity<010> 00019 00019| @O@<123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890@>@{@}<010> 00020 00020| @A@<010> 00021 00021| <010> 00022 00022| 4. File macro has zero or many attributes. Error.<010> 00023 00023| @O@@Z@{Walrus@}<010> 00024 00024| @A@<010> 00025 00025| <010> 00026 00026| @O@@M@{Walrus@}<010> 00027 00027| @A@<010> 00028 00028| <010> 00029 00029| @O@@Z@M@{Walrus@}<010> 00030 00030| @A@<010> 00031 00031| <010> 00032 00032| 5. Previous definition is full, current is additive.<010> 00033 00033| @$@==@{Sloth@}<010> 00034 00034| @$@+=@{Aardvark@}<010> 00035 00035| @A@<010> 00036 00036| <010> 00037 00037| 6. Previous definition is additive, current is full.<010> 00038 00038| @$@+=@{Sloth@}<010> 00039 00039| @$@==@{Aardvark@}<010> 00040 00040| @A@<010> 00041 00041| <010> 00042 00042| 7. Non-first body part of partial has parameter.<010> 00043 00043| @$@@(@3@)+=@{Turkey@}<010> 00044 00044| @$@@(@3@)+=@{Turkey@}<010> 00045 00045| @A@<010> 00046 00046| <010> 00047 00047| 8. Zero or many attributes on non-first body part of additive.<010> 00048 00048| @$@@Z@M+=@{Turkey@}<010> 00049 00049| @$@@Z@M+=@{Turkey@}<010> 00050 00050| @A@<010> 00051 00051| <010> 00052 00052| 9. Check that non-existent formal parameters are caught.<010> 00053 00053| <010> 00054 00054| @$@@Z@{Sloth@1Walrus@}<010> 00055 00055| @A@<010> 00056 00056| <010> 00057 00057| @$@@(@1@)@Z@{Sloth@2Walrus@}<010> 00058 00058| @A@<010> 00059 00059| <010> 00060 00060| @$@@(@7@)@Z@{Sloth@8Walrus@}<010> 00061 00061| @A@<010> 00062 00062| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 245 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="PR08: Test semantic checking of macro definitions.<010> <010> Trip parser to be sure that we won't get any output files!<010> " 0004[01]: @> Close name. 0004[03]: Text. Text scrap[Grey]="<010> <010> 1. File macro has parameters. Error.<010> " 0007[01]: @F File defn. 0007[03]: @< Open name. 0007[05]: Text. Text scrap[Grey]="Sloth 1" 0007[12]: @> Close name. 0007[14]: @( Open param. 0007[16]: @n Parameter. Parameterno=3. 0007[18]: @} Close param. 0007[20]: @{ Open defn. 0007[22]: Text. Text scrap[Grey]="Walrus" 0007[28]: @} Close defn. 0007[30]: Text. Text scrap[White]="<010> " 0008[01]: @A New section (Level 1). 0008[03]: @< Open name. 0008[05]: Text. Text scrap[Grey]="Error recovery point" 0008[25]: @> Close name. 0008[27]: Text. Text scrap[Grey]="<010> <010> 2. File macro is additive. Error.<010> " 0011[01]: @F File defn. 0011[03]: @< Open name. 0011[05]: Text. Text scrap[Grey]="Sloth 2" 0011[12]: @> Close name. 0011[14]: Text. Text scrap[Grey]="+=" 0011[16]: @{ Open defn. 0011[18]: Text. Text scrap[Grey]="Walrus" 0011[24]: @} Close defn. 0011[26]: Text. Text scrap[White]="<010> " 0012[01]: @A New section (Level 1). 0012[03]: @< Open name. 0012[05]: Text. Text scrap[Grey]="Error recovery point" 0012[25]: @> Close name. 0012[27]: Text. Text scrap[Grey]="<010> <010> 3. File macro has too long a name. The test name has 1200 characters. Err.<010> Note: This test can't test the error message if the maximum length of a<010> macro name is less than the maximum length of a file name as the name<010> error is caught first.<010> " 0019[01]: @F File defn. 0019[03]: @< Open name. 0019[05]: Text. Text scrap[Grey]="123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" 0019[1205]: @> Close name. 0019[1207]: @{ Open defn. 0019[1209]: @} Close defn. 0019[1211]: Text. Text scrap[White]="<010> " 0020[01]: @A New section (Level 1). 0020[03]: @< Open name. 0020[05]: Text. Text scrap[Grey]="Error recovery point" 0020[25]: @> Close name. 0020[27]: Text. Text scrap[Grey]="<010> <010> 4. File macro has zero or many attributes. Error.<010> " 0023[01]: @F File defn. 0023[03]: @< Open name. 0023[05]: Text. Text scrap[Grey]="Sloth 3" 0023[12]: @> Close name. 0023[14]: @Z Zero calls. 0023[16]: @{ Open defn. 0023[18]: Text. Text scrap[Grey]="Walrus" 0023[24]: @} Close defn. 0023[26]: Text. Text scrap[White]="<010> " 0024[01]: @A New section (Level 1). 0024[03]: @< Open name. 0024[05]: Text. Text scrap[Grey]="Error recovery point" 0024[25]: @> Close name. 0024[27]: Text. Text scrap[White]="<010> <010> " 0026[01]: @F File defn. 0026[03]: @< Open name. 0026[05]: Text. Text scrap[Grey]="Sloth 4" 0026[12]: @> Close name. 0026[14]: @M Many calls. 0026[16]: @{ Open defn. 0026[18]: Text. Text scrap[Grey]="Walrus" 0026[24]: @} Close defn. 0026[26]: Text. Text scrap[White]="<010> " 0027[01]: @A New section (Level 1). 0027[03]: @< Open name. 0027[05]: Text. Text scrap[Grey]="Error recovery point" 0027[25]: @> Close name. 0027[27]: Text. Text scrap[White]="<010> <010> " 0029[01]: @F File defn. 0029[03]: @< Open name. 0029[05]: Text. Text scrap[Grey]="Sloth 5" 0029[12]: @> Close name. 0029[14]: @Z Zero calls. 0029[16]: @M Many calls. 0029[18]: @{ Open defn. 0029[20]: Text. Text scrap[Grey]="Walrus" 0029[26]: @} Close defn. 0029[28]: Text. Text scrap[White]="<010> " 0030[01]: @A New section (Level 1). 0030[03]: @< Open name. 0030[05]: Text. Text scrap[Grey]="Error recovery point" 0030[25]: @> Close name. 0030[27]: Text. Text scrap[Grey]="<010> <010> 5. Previous definition is full, current is additive.<010> " 0033[01]: @$ Macro defn. 0033[03]: @< Open name. 0033[05]: Text. Text scrap[Grey]="Walrus 1" 0033[13]: @> Close name. 0033[15]: Text. Text scrap[Grey]="==" 0033[17]: @{ Open defn. 0033[19]: Text. Text scrap[Grey]="Sloth" 0033[24]: @} Close defn. 0033[26]: Text. Text scrap[White]="<010> " 0034[01]: @$ Macro defn. 0034[03]: @< Open name. 0034[05]: Text. Text scrap[Grey]="Walrus 1" 0034[13]: @> Close name. 0034[15]: Text. Text scrap[Grey]="+=" 0034[17]: @{ Open defn. 0034[19]: Text. Text scrap[Grey]="Aardvark" 0034[27]: @} Close defn. 0034[29]: Text. Text scrap[White]="<010> " 0035[01]: @A New section (Level 1). 0035[03]: @< Open name. 0035[05]: Text. Text scrap[Grey]="Error recovery point" 0035[25]: @> Close name. 0035[27]: Text. Text scrap[Grey]="<010> <010> 6. Previous definition is additive, current is full.<010> " 0038[01]: @$ Macro defn. 0038[03]: @< Open name. 0038[05]: Text. Text scrap[Grey]="Walrus 2" 0038[13]: @> Close name. 0038[15]: Text. Text scrap[Grey]="+=" 0038[17]: @{ Open defn. 0038[19]: Text. Text scrap[Grey]="Sloth" 0038[24]: @} Close defn. 0038[26]: Text. Text scrap[White]="<010> " 0039[01]: @$ Macro defn. 0039[03]: @< Open name. 0039[05]: Text. Text scrap[Grey]="Walrus 2" 0039[13]: @> Close name. 0039[15]: Text. Text scrap[Grey]="==" 0039[17]: @{ Open defn. 0039[19]: Text. Text scrap[Grey]="Aardvark" 0039[27]: @} Close defn. 0039[29]: Text. Text scrap[White]="<010> " 0040[01]: @A New section (Level 1). 0040[03]: @< Open name. 0040[05]: Text. Text scrap[Grey]="Error recovery point" 0040[25]: @> Close name. 0040[27]: Text. Text scrap[Grey]="<010> <010> 7. Non-first body part of partial has parameter.<010> " 0043[01]: @$ Macro defn. 0043[03]: @< Open name. 0043[05]: Text. Text scrap[Grey]="Unicorn" 0043[12]: @> Close name. 0043[14]: @( Open param. 0043[16]: @n Parameter. Parameterno=3. 0043[18]: @} Close param. 0043[20]: Text. Text scrap[Grey]="+=" 0043[22]: @{ Open defn. 0043[24]: Text. Text scrap[Grey]="Turkey" 0043[30]: @} Close defn. 0043[32]: Text. Text scrap[White]="<010> " 0044[01]: @$ Macro defn. 0044[03]: @< Open name. 0044[05]: Text. Text scrap[Grey]="Unicorn" 0044[12]: @> Close name. 0044[14]: @( Open param. 0044[16]: @n Parameter. Parameterno=3. 0044[18]: @} Close param. 0044[20]: Text. Text scrap[Grey]="+=" 0044[22]: @{ Open defn. 0044[24]: Text. Text scrap[Grey]="Turkey" 0044[30]: @} Close defn. 0044[32]: Text. Text scrap[White]="<010> " 0045[01]: @A New section (Level 1). 0045[03]: @< Open name. 0045[05]: Text. Text scrap[Grey]="Error recovery point" 0045[25]: @> Close name. 0045[27]: Text. Text scrap[Grey]="<010> <010> 8. Zero or many attributes on non-first body part of additive.<010> " 0048[01]: @$ Macro defn. 0048[03]: @< Open name. 0048[05]: Text. Text scrap[Grey]="Elephant" 0048[13]: @> Close name. 0048[15]: @Z Zero calls. 0048[17]: @M Many calls. 0048[19]: Text. Text scrap[Grey]="+=" 0048[21]: @{ Open defn. 0048[23]: Text. Text scrap[Grey]="Turkey" 0048[29]: @} Close defn. 0048[31]: Text. Text scrap[White]="<010> " 0049[01]: @$ Macro defn. 0049[03]: @< Open name. 0049[05]: Text. Text scrap[Grey]="Elephant" 0049[13]: @> Close name. 0049[15]: @Z Zero calls. 0049[17]: @M Many calls. 0049[19]: Text. Text scrap[Grey]="+=" 0049[21]: @{ Open defn. 0049[23]: Text. Text scrap[Grey]="Turkey" 0049[29]: @} Close defn. 0049[31]: Text. Text scrap[White]="<010> " 0050[01]: @A New section (Level 1). 0050[03]: @< Open name. 0050[05]: Text. Text scrap[Grey]="Error recovery point" 0050[25]: @> Close name. 0050[27]: Text. Text scrap[Grey]="<010> <010> 9. Check that non-existent formal parameters are caught.<010> <010> " 0054[01]: @$ Macro defn. 0054[03]: @< Open name. 0054[05]: Text. Text scrap[Grey]="Zero" 0054[09]: @> Close name. 0054[11]: @Z Zero calls. 0054[13]: @{ Open defn. 0054[15]: Text. Text scrap[Grey]="Sloth" 0054[20]: @n Parameter. Parameterno=1. 0054[22]: Text. Text scrap[Grey]="Walrus" 0054[28]: @} Close defn. 0054[30]: Text. Text scrap[White]="<010> " 0055[01]: @A New section (Level 1). 0055[03]: @< Open name. 0055[05]: Text. Text scrap[Grey]="Error recovery point" 0055[25]: @> Close name. 0055[27]: Text. Text scrap[White]="<010> <010> " 0057[01]: @$ Macro defn. 0057[03]: @< Open name. 0057[05]: Text. Text scrap[Grey]="One" 0057[08]: @> Close name. 0057[10]: @( Open param. 0057[12]: @n Parameter. Parameterno=1. 0057[14]: @} Close param. 0057[16]: @Z Zero calls. 0057[18]: @{ Open defn. 0057[20]: Text. Text scrap[Grey]="Sloth" 0057[25]: @n Parameter. Parameterno=2. 0057[27]: Text. Text scrap[Grey]="Walrus" 0057[33]: @} Close defn. 0057[35]: Text. Text scrap[White]="<010> " 0058[01]: @A New section (Level 1). 0058[03]: @< Open name. 0058[05]: Text. Text scrap[Grey]="Error recovery point" 0058[25]: @> Close name. 0058[27]: Text. Text scrap[White]="<010> <010> " 0060[01]: @$ Macro defn. 0060[03]: @< Open name. 0060[05]: Text. Text scrap[Grey]="Many" 0060[09]: @> Close name. 0060[11]: @( Open param. 0060[13]: @n Parameter. Parameterno=7. 0060[15]: @} Close param. 0060[17]: @Z Zero calls. 0060[19]: @{ Open defn. 0060[21]: Text. Text scrap[Grey]="Sloth" 0060[26]: @n Parameter. Parameterno=8. 0060[28]: Text. Text scrap[Grey]="Walrus" 0060[34]: @} Close defn. 0060[36]: Text. Text scrap[White]="<010> " 0061[01]: @A New section (Level 1). 0061[03]: @< Open name. 0061[05]: Text. Text scrap[Grey]="Error recovery point" 0061[25]: @> Close name. 0061[27]: Text. Text scrap[White]="<010> " 0062[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ ========================== Start of MACRO TABLE DUMP =========================== ------------------- Start of Macro Dump -------------------- Macro Name : "Elephant" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (48,1) Additive? : Yes. Zero Calls? : Yes. Many Calls? : Yes. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=4, Pos(L,C)=(48,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Turkey" ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Many" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 7 Pos(L,C) : (60,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=7, Pos(L,C)=(60,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Sloth" ------ End Text Element ------ -- Start Parameter Element -- Parameter number=8. Parameter is of macro "Many". --- End Parameter Element --- ----- Start Text Element ----- Text scrap[Grey]="Walrus" ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "One" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 1 Pos(L,C) : (57,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=6, Pos(L,C)=(57,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Sloth" ------ End Text Element ------ -- Start Parameter Element -- Parameter number=2. Parameter is of macro "One". --- End Parameter Element --- ----- Start Text Element ----- Text scrap[Grey]="Walrus" ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth 1" Macro MinLv : 6 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth 2" Macro MinLv : 6 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth 3" Macro MinLv : 6 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth 4" Macro MinLv : 6 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth 5" Macro MinLv : 6 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Unicorn" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 3 Pos(L,C) : (43,1) Additive? : Yes. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=3, Pos(L,C)=(43,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Turkey" ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Walrus 1" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (33,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=1, Pos(L,C)=(33,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Sloth" ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Walrus 2" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (38,1) Additive? : Yes. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=2, Pos(L,C)=(38,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Sloth" ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Zero" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (54,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=5, Pos(L,C)=(54,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Sloth" ------ End Text Element ------ -- Start Parameter Element -- Parameter number=1. Parameter is of macro "Zero". --- End Parameter Element --- ----- Start Text Element ----- Text scrap[Grey]="Walrus" ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- =========================== End of MACRO TABLE DUMP ============================ ========================= Start of DOCUMENT LIST DUMP ========================== TEXT COMPONENT: Pos(L,C)=(1,1). -- Start of Text Scrap List -- Text scrap[Grey]="PR08: Test semantic checking of macro definitions.<010> <010> Trip parser to be sure that we won't get any output files!<010> " --- End of Text Scrap List --- TEXT COMPONENT: Pos(L,C)=(4,3). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 1. File macro has parameters. Error.<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "1", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(8,27). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 2. File macro is additive. Error.<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "2", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(12,27). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 3. File macro has too long a name. The test name has 1200 characters. Err.<010> Note: This test can't test the error message if the maximum length of a<010> macro name is less than the maximum length of a file name as the name<010> error is caught first.<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "3", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(20,27). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 4. File macro has zero or many attributes. Error.<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "4", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(24,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "5", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(27,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "6", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(30,27). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 5. Previous definition is full, current is additive.<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(33,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(33,26). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "7", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(35,27). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 6. Previous definition is additive, current is full.<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(38,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(38,26). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "8", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(40,27). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 7. Non-first body part of partial has parameter.<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(43,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(43,32). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "9", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(45,27). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 8. Zero or many attributes on non-first body part of additive.<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(48,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(48,31). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "10", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(50,27). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 9. Check that non-existent formal parameters are caught.<010> <010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(54,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(54,30). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "11", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(55,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(57,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(57,35). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "12", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(58,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(60,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(60,36). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "13", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(61,27). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- ========================== End of DOCUMENT LIST DUMP =========================== Global Local| Input File ------------+------------------------------------------------------------------- 1 1| PR08: Test semantic checking of macro definitions. 2 2| 3 3| Trip parser to be sure that we won't get any output files! 4 4| @> Error|.^The parser was at the top level and was expecting |.^one of: {Directive, Text, Macro definition, EOF}. 5 5| 6 6| 1. File macro has parameters. Error. 7 7| @O@@(@3@)@{Walrus@} |...^Macro definition ignored. Error|................^Macros attached to output files cannot be parameterized. |................^Reason: No actual parameters would be available during |................^ output file generation. |....................^Skipping after error to the next major construct... 8 8| @A@ |.^...skipped to here after the error. 9 9| 10 10| 2. File macro is additive. Error. 11 11| @O@+=@{Walrus@} |...^Macro definition ignored. Error|..............^Macros attached to output files cannot be additive. |..............^Reason: Preventing this makes it easy to find output |..............^file macros later, because there will be exactly one |..............^@O declaration in the input file for each output file. |..............^To do what you are trying to do, just create an additive |..............^bridging macro, like this: |..............^ @O@@{@@} |..............^ @$@+=@{void stringhack()...@} |..............^ @$@+=@{main()...@} |................^Skipping after error to the next major construct... 12 12| @A@ |.^...skipped to here after the error. 13 13| 14 14| 3. File macro has too long a name. The test name has 1200 characters. Err. 15 15| Note: This test can't test the error message if the maximum length of a 16 16| macro name is less than the maximum length of a file name as the name 17 17| error is caught first. 18 18| @p maximum_input_line_length = infinity 19 19| @O@<123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890@>@{@} Error|.....^Name is too long. |.....^The maximum length of a legal name is 80 characters. |.....^Skipping after error to the next major construct... 20 20| @A@ |.^...skipped to here after the error. 21 21| 22 22| 4. File macro has zero or many attributes. Error. 23 23| @O@@Z@{Walrus@} |...^Macro definition ignored. Error|..............^Macros attached to output files cannot have @Z or @M. |..............^Reason: They are always called once to generate their |..............^output file and they cannot be called from other macros. |..............^Hence they are always called exactly once and so there |..............^can be no need for @Z or @M in their declarations. |................^Skipping after error to the next major construct... 24 24| @A@ |.^...skipped to here after the error. 25 25| 26 26| @O@@M@{Walrus@} |...^Macro definition ignored. Error|..............^Macros attached to output files cannot have @Z or @M. |..............^Reason: They are always called once to generate their |..............^output file and they cannot be called from other macros. |..............^Hence they are always called exactly once and so there |..............^can be no need for @Z or @M in their declarations. |................^Skipping after error to the next major construct... 27 27| @A@ |.^...skipped to here after the error. 28 28| 29 29| @O@@Z@M@{Walrus@} |...^Macro definition ignored. Error|..............^Macros attached to output files cannot have @Z or @M. |..............^Reason: They are always called once to generate their |..............^output file and they cannot be called from other macros. |..............^Hence they are always called exactly once and so there |..............^can be no need for @Z or @M in their declarations. |..................^Skipping after error to the next major construct... 30 30| @A@ |.^...skipped to here after the error. 31 31| 32 32| 5. Previous definition is full, current is additive. 33 33| @$@==@{Sloth@} 34 34| @$@+=@{Aardvark@} Error|...^A full definition of this macro appears at line 33. |...^Full and additive definitions of the same macro cannot coexist. |...^Macro definition ignored. |.................^Skipping after error to the next major construct... 35 35| @A@ |.^...skipped to here after the error. 36 36| 37 37| 6. Previous definition is additive, current is full. 38 38| @$@+=@{Sloth@} 39 39| @$@==@{Aardvark@} Error|...^An additive definition of this macro appears at line 38. |...^Full and additive definitions of the same macro cannot coexist. |...^Macro definition ignored. |.................^Skipping after error to the next major construct... 40 40| @A@ |.^...skipped to here after the error. 41 41| 42 42| 7. Non-first body part of partial has parameter. 43 43| @$@@(@3@)+=@{Turkey@} 44 44| @$@@(@3@)+=@{Turkey@} |...^Macro definition ignored. Error|................^The formal parameter list of an additive macro |................^must be placed only in the first definition part. |................^The first part of this macro appears at line 43. |......................^Skipping after error to the next major construct... 45 45| @A@ |.^...skipped to here after the error. 46 46| 47 47| 8. Zero or many attributes on non-first body part of additive. 48 48| @$@@Z@M+=@{Turkey@} 49 49| @$@@Z@M+=@{Turkey@} |...^Macro definition ignored. Error|...............^@Z and @M modifiers for additive macros must |...............^be placed only in the first definition part. |...............^The first part of this macro appears at line 48. |.....................^Skipping after error to the next major construct... 50 50| @A@ |.^...skipped to here after the error. 51 51| 52 52| 9. Check that non-existent formal parameters are caught. 53 53| 54 54| @$@@Z@{Sloth@1Walrus@} Error|....................^Macro being defined has only 0 parameters. 55 55| @A@ 56 56| 57 57| @$@@(@1@)@Z@{Sloth@2Walrus@} Error|.........................^Macro being defined has only 1 parameter. 58 58| @A@ 59 59| 60 60| @$@@(@7@)@Z@{Sloth@8Walrus@} Error|..........................^Macro being defined has only 7 parameters. 61 61| @A@ | ------------+------------------------------------------------------------------- There were 14 Errors. t scrap[White]="<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "11", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(55,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(57,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(57,35). -- Start of Text Scfw_src/answers/pr09.lis 644 0 0 171015 6717353722 10336 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 50 52 30 39 3A 20 54 65 73 74 20 63 61 6C 6C 73 | PR09: Test calls | | 20 61 6E 64 20 61 63 74 75 61 6C 20 70 61 72 61 | and actual para | | 6D 65 74 65 72 20 6C 69 73 74 73 2E 0A 0A 46 69 | meter lists...Fi | | 72 73 74 20 74 72 69 70 20 75 70 20 74 68 65 20 | rst trip up the | | 70 61 72 73 65 72 20 73 6F 20 77 65 20 64 6F 6E | parser so we don | | 27 74 20 67 65 74 20 61 6E 79 20 66 75 72 74 68 | 't get any furth | | 65 72 2E 0A 40 3E 0A 0A 4E 6F 77 20 64 65 66 69 | er..@>..Now defi | | 6E 65 20 73 6F 6D 65 20 6D 61 63 72 6F 73 20 74 | ne some macros t | | 6F 20 63 61 6C 6C 2E 20 4E 6F 20 65 72 72 6F 72 | o call. No error | | 2E 0A 0A 40 24 40 3C 5A 65 72 6F 40 3E 40 7B 40 | ...@$@@{@ | | 7D 0A 40 24 40 3C 4F 6E 65 40 3E 40 28 40 31 40 | }.@$@@(@1@ | | 29 40 7B 40 7D 0A 40 24 40 3C 54 77 6F 40 3E 40 | )@{@}.@$@@ | | 28 40 32 40 29 40 7B 40 7D 0A 40 24 40 3C 54 68 | (@2@)@{@}.@$@@(@3@)@{@}. | | 40 24 40 3C 4E 69 6E 65 40 3E 40 28 40 39 40 29 | @$@@(@9@) | | 40 7B 40 7D 0A 40 24 40 23 22 40 7B 40 7D 0A 0A | @{@}.@$@#"@{@}.. | | 54 68 65 20 66 6F 6C 6C 6F 77 69 6E 67 20 74 65 | The following te | | 73 74 20 63 61 6C 6C 73 20 73 68 6F 75 6C 64 20 | st calls should | | 4E 4F 54 20 67 65 6E 65 72 61 74 65 20 61 6E 79 | NOT generate any | | 20 65 72 72 6F 72 73 2E 0A 0A 40 24 40 3C 4D 61 | errors...@$@==@{.1. Te | | 73 74 20 6D 61 63 72 6F 20 63 61 6C 6C 20 77 69 | st macro call wi | | 74 68 20 6E 6F 20 70 61 72 61 6D 65 74 65 72 20 | th no parameter | | 6C 69 73 74 2E 0A 40 3C 5A 65 72 6F 40 3E 0A 0A | list..@.. | | 32 2E 20 54 65 73 74 20 6D 61 63 72 6F 20 63 61 | 2. Test macro ca | | 6C 6C 20 77 69 74 68 20 71 75 69 63 6B 20 6E 61 | ll with quick na | | 6D 65 2E 0A 40 23 22 0A 0A 33 2E 20 54 65 73 74 | me..@#"..3. Test | | 20 6D 61 63 72 6F 20 63 61 6C 6C 20 77 69 74 68 | macro call with | | 20 6F 6E 65 20 70 61 72 61 6D 65 74 65 72 2E 0A | one parameter.. | | 40 3C 4F 6E 65 40 3E 40 28 54 6F 75 63 61 6E 40 | @@(Toucan@ | | 29 0A 0A 34 2E 20 54 65 73 74 20 6D 61 63 72 6F | )..4. Test macro | | 20 63 61 6C 6C 20 77 69 74 68 20 6D 61 6E 79 20 | call with many | | 70 61 72 61 6D 65 74 65 72 73 2E 0A 40 3C 54 77 | parameters..@@(Toucan@,Tea | | 70 6F 74 40 29 0A 40 3C 54 68 72 65 65 40 3E 40 | pot@).@@ | | 28 54 6F 75 63 61 6E 40 2C 54 65 61 70 6F 74 40 | (Toucan@,Teapot@ | | 2C 57 61 6C 72 75 73 40 29 0A 40 3C 4E 69 6E 65 | ,Walrus@).@@(Toucan@,Teap | | 6F 74 40 2C 57 61 6C 72 75 73 40 2C 0A 20 20 20 | ot@,Walrus@,. | | 20 20 20 20 20 20 20 54 6F 75 63 61 6E 40 2C 54 | Toucan@,T | | 65 61 70 6F 74 40 2C 57 61 6C 72 75 73 40 2C 0A | eapot@,Walrus@,. | | 20 20 20 20 20 20 20 20 20 20 54 6F 75 63 61 6E | Toucan | | 40 2C 54 65 61 70 6F 74 40 2C 57 61 6C 72 75 73 | @,Teapot@,Walrus | | 40 29 0A 0A 35 2E 20 54 65 73 74 20 6D 61 63 72 | @)..5. Test macr | | 6F 20 63 61 6C 6C 73 20 77 69 74 68 20 64 6F 75 | o calls with dou | | 62 6C 65 20 71 75 6F 74 65 73 20 6F 6E 20 70 61 | ble quotes on pa | | 72 61 6D 65 74 65 72 73 2E 0A 40 3C 4F 6E 65 40 | rameters..@@( @"Toucan@"@) | | 0A 40 3C 54 77 6F 40 3E 40 28 40 22 54 6F 75 63 | .@@(@"Touc | | 61 6E 40 22 20 20 20 40 2C 20 20 20 40 22 54 65 | an@" @, @"Te | | 61 70 6F 74 40 22 40 29 0A 40 3C 54 68 72 65 65 | apot@"@).@@(@"Toucan@" @ | | 2C 0A 20 20 20 20 20 20 20 20 20 20 20 40 22 54 | ,. @"T | | 65 61 70 6F 74 40 22 20 40 2C 0A 20 20 20 20 20 | eapot@" @,. | | 20 20 20 20 20 20 40 22 57 61 6C 72 75 73 40 22 | @"Walrus@" | | 20 40 29 0A 40 3C 4E 69 6E 65 40 3E 40 28 20 40 | @).@@( @ | | 22 54 6F 75 63 61 6E 40 22 20 40 2C 20 40 22 54 | "Toucan@" @, @"T | | 65 61 70 6F 74 40 22 20 40 2C 20 40 22 57 61 6C | eapot@" @, @"Wal | | 72 75 73 40 22 20 40 2C 0A 20 20 20 20 20 20 20 | rus@" @,. | | 20 20 20 20 40 22 54 6F 75 63 61 6E 40 22 20 40 | @"Toucan@" @ | | 2C 20 40 22 54 65 61 70 6F 74 40 22 20 40 2C 20 | , @"Teapot@" @, | | 40 22 57 61 6C 72 75 73 40 22 20 40 2C 0A 20 20 | @"Walrus@" @,. | | 20 20 20 20 20 20 20 20 20 40 22 54 6F 75 63 61 | @"Touca | | 6E 40 22 20 40 2C 20 40 22 54 65 61 70 6F 74 40 | n@" @, @"Teapot@ | | 22 20 40 2C 20 40 22 57 61 6C 72 75 73 40 22 20 | " @, @"Walrus@" | | 40 29 0A 0A 37 2E 20 54 65 73 74 20 6D 61 63 72 | @)..7. Test macr | | 6F 20 63 61 6C 6C 73 20 77 69 74 68 20 6D 69 78 | o calls with mix | | 65 64 20 64 6F 75 62 6C 65 20 71 75 6F 74 65 73 | ed double quotes | | 20 6F 6E 20 70 61 72 61 6D 65 74 65 72 73 2E 0A | on parameters.. | | 40 3C 54 77 6F 40 3E 40 28 40 22 54 6F 75 63 61 | @@(@"Touca | | 6E 40 22 20 20 20 40 2C 54 65 61 70 6F 74 40 29 | n@" @,Teapot@) | | 0A 40 3C 54 68 72 65 65 40 3E 40 28 40 22 54 6F | .@@(@"To | | 75 63 61 6E 40 22 20 40 2C 0A 20 20 20 20 20 20 | ucan@" @,. | | 20 20 20 20 20 40 22 54 65 61 70 6F 74 40 22 20 | @"Teapot@" | | 40 2C 57 61 6C 72 75 73 40 29 0A 40 3C 4E 69 6E | @,Walrus@).@@( @"Toucan@" | | 20 40 2C 20 40 22 54 65 61 70 6F 74 40 22 20 40 | @, @"Teapot@" @ | | 2C 20 20 20 57 61 6C 72 75 73 20 20 20 40 2C 0A | , Walrus @,. | | 20 20 20 20 20 20 20 20 20 20 20 40 22 54 6F 75 | @"Tou | | 63 61 6E 40 22 20 40 2C 20 20 20 54 65 61 70 6F | can@" @, Teapo | | 74 20 20 20 40 2C 20 40 22 57 61 6C 72 75 73 40 | t @, @"Walrus@ | | 22 20 40 2C 0A 20 20 20 20 20 20 20 20 20 20 20 | " @,. | | 40 22 54 6F 75 63 61 6E 40 22 20 40 2C 20 40 22 | @"Toucan@" @, @" | | 54 65 61 70 6F 74 40 22 20 40 2C 20 40 22 57 61 | Teapot@" @, @"Wa | | 6C 72 75 73 40 22 20 40 29 0A 0A 40 7D 20 40 21 | lrus@" @)..@} @! | | 20 45 6E 64 20 6F 66 20 6D 61 63 72 6F 20 64 65 | End of macro de | | 66 69 6E 69 74 69 6F 6E 20 65 6E 63 6C 6F 73 69 | finition enclosi | | 6E 67 20 61 6C 6C 20 74 68 65 73 65 20 6C 65 67 | ng all these leg | | 61 6C 20 74 65 73 74 73 2E 0A 0A 38 2E 20 54 65 | al tests...8. Te | | 73 74 20 6D 61 63 72 6F 20 63 61 6C 6C 73 20 77 | st macro calls w | | 69 74 68 20 61 20 76 61 72 69 65 74 79 20 6F 66 | ith a variety of | | 20 73 79 6E 74 61 78 20 65 72 72 6F 72 73 20 69 | syntax errors i | | 6E 20 70 61 72 61 6D 65 74 65 72 20 6C 69 73 74 | n parameter list | | 2E 0A 40 24 40 3C 45 72 72 6F 72 31 40 3E 40 7B | ..@$@@{ | | 0A 40 3C 5A 65 72 6F 40 3E 40 28 0A 40 7D 0A 40 | .@@(.@}.@ | | 41 40 3C 45 72 72 6F 72 20 72 65 63 6F 76 65 72 | A@..@$@@{.@@).@}.@A@..@$@ | | 40 7B 0A 40 3C 4F 6E 65 40 3E 40 28 40 22 54 6F | @{.@@(@"To | | 75 63 61 6E 40 29 0A 40 7D 0A 40 41 40 3C 45 72 | ucan@).@}.@A@..@$@@{.@@(@" | | 54 6F 75 63 61 6E 40 22 40 22 53 6C 6F 74 68 40 | Toucan@"@"Sloth@ | | 22 40 29 0A 40 7D 0A 40 41 40 3C 45 72 72 6F 72 | "@).@}.@A@..@$@@ | | 7B 0A 40 3C 54 77 6F 40 3E 40 28 40 22 54 6F 75 | {.@@(@"Tou | | 63 61 6E 40 22 54 65 61 70 6F 74 40 29 0A 40 7D | can@"Teapot@).@} | | 0A 40 41 40 3C 45 72 72 6F 72 20 72 65 63 6F 76 | .@A@..@$@ | | 3C 45 72 72 6F 72 36 40 3E 40 7B 0A 40 3C 54 77 | @{.@@(@"Toucan@"T | | 65 61 70 6F 74 0A 40 7D 0A 40 41 40 3C 45 72 72 | eapot.@}.@A@..@$@@{.@@(@"T | | 6F 75 63 61 6E 40 22 54 65 61 70 6F 74 0A 40 3C | oucan@"Teapot.@< | | 54 68 72 65 65 40 3E 40 28 54 6F 75 63 61 6E 40 | Three@>@(Toucan@ | | 2C 0A 20 20 20 20 20 20 20 20 20 20 20 40 22 54 | ,. @"T | | 65 61 70 6F 74 40 2C 57 61 6C 72 75 73 0A 0A 40 | eapot@,Walrus..@ | | 7D 0A 40 41 40 3C 45 72 72 6F 72 20 72 65 63 6F | }.@A@.. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| PR09: Test calls and actual parameter lists.<010> 00002 00002| <010> 00003 00003| First trip up the parser so we don't get any further.<010> 00004 00004| @><010> 00005 00005| <010> 00006 00006| Now define some macros to call. No error.<010> 00007 00007| <010> 00008 00008| @$@@{@}<010> 00009 00009| @$@@(@1@)@{@}<010> 00010 00010| @$@@(@2@)@{@}<010> 00011 00011| @$@@(@3@)@{@}<010> 00012 00012| @$@@(@9@)@{@}<010> 00013 00013| @$@#"@{@}<010> 00014 00014| <010> 00015 00015| The following test calls should NOT generate any errors.<010> 00016 00016| <010> 00017 00017| @$@==@{<010> 00018 00018| 1. Test macro call with no parameter list.<010> 00019 00019| @<010> 00020 00020| <010> 00021 00021| 2. Test macro call with quick name.<010> 00022 00022| @#"<010> 00023 00023| <010> 00024 00024| 3. Test macro call with one parameter.<010> 00025 00025| @@(Toucan@)<010> 00026 00026| <010> 00027 00027| 4. Test macro call with many parameters.<010> 00028 00028| @@(Toucan@,Teapot@)<010> 00029 00029| @@(Toucan@,Teapot@,Walrus@)<010> 00030 00030| @@(Toucan@,Teapot@,Walrus@,<010> 00031 00031| Toucan@,Teapot@,Walrus@,<010> 00032 00032| Toucan@,Teapot@,Walrus@)<010> 00033 00033| <010> 00034 00034| 5. Test macro calls with double quotes on parameters.<010> 00035 00035| @@( @"Toucan@"@)<010> 00036 00036| @@(@"Toucan@" @, @"Teapot@"@)<010> 00037 00037| @@(@"Toucan@" @,<010> 00038 00038| @"Teapot@" @,<010> 00039 00039| @"Walrus@" @)<010> 00040 00040| @@( @"Toucan@" @, @"Teapot@" @, @"Walrus@" @,<010> 00041 00041| @"Toucan@" @, @"Teapot@" @, @"Walrus@" @,<010> 00042 00042| @"Toucan@" @, @"Teapot@" @, @"Walrus@" @)<010> 00043 00043| <010> 00044 00044| 7. Test macro calls with mixed double quotes on parameters.<010> 00045 00045| @@(@"Toucan@" @,Teapot@)<010> 00046 00046| @@(@"Toucan@" @,<010> 00047 00047| @"Teapot@" @,Walrus@)<010> 00048 00048| @@( @"Toucan@" @, @"Teapot@" @, Walrus @,<010> 00049 00049| @"Toucan@" @, Teapot @, @"Walrus@" @,<010> 00050 00050| @"Toucan@" @, @"Teapot@" @, @"Walrus@" @)<010> 00051 00051| <010> 00052 00052| @} @! End of macro definition enclosing all these legal tests.<010> 00053 00053| <010> 00054 00054| 8. Test macro calls with a variety of syntax errors in parameter list.<010> 00055 00055| @$@@{<010> 00056 00056| @@(<010> 00057 00057| @}<010> 00058 00058| @A@<010> 00059 00059| <010> 00060 00060| @$@@{<010> 00061 00061| @@)<010> 00062 00062| @}<010> 00063 00063| @A@<010> 00064 00064| <010> 00065 00065| @$@@{<010> 00066 00066| @@(@"Toucan@)<010> 00067 00067| @}<010> 00068 00068| @A@<010> 00069 00069| <010> 00070 00070| @$@@{<010> 00071 00071| @@(@"Toucan@"@"Sloth@"@)<010> 00072 00072| @}<010> 00073 00073| @A@<010> 00074 00074| <010> 00075 00075| @$@@{<010> 00076 00076| @@(@"Toucan@"Teapot@)<010> 00077 00077| @}<010> 00078 00078| @A@<010> 00079 00079| <010> 00080 00080| @$@@{<010> 00081 00081| @@(@"Toucan@"Teapot<010> 00082 00082| @}<010> 00083 00083| @A@<010> 00084 00084| <010> 00085 00085| @$@@{<010> 00086 00086| @@(@"Toucan@"Teapot<010> 00087 00087| @@(Toucan@,<010> 00088 00088| @"Teapot@,Walrus<010> 00089 00089| <010> 00090 00090| @}<010> 00091 00091| @A@<010> 00092 00092| <010> 00093 00093| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 467 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="PR09: Test calls and actual parameter lists.<010> <010> First trip up the parser so we don't get any further.<010> " 0004[01]: @> Close name. 0004[03]: Text. Text scrap[Grey]="<010> <010> Now define some macros to call. No error.<010> <010> " 0008[01]: @$ Macro defn. 0008[03]: @< Open name. 0008[05]: Text. Text scrap[Grey]="Zero" 0008[09]: @> Close name. 0008[11]: @{ Open defn. 0008[13]: @} Close defn. 0008[15]: Text. Text scrap[White]="<010> " 0009[01]: @$ Macro defn. 0009[03]: @< Open name. 0009[05]: Text. Text scrap[Grey]="One" 0009[08]: @> Close name. 0009[10]: @( Open param. 0009[12]: @n Parameter. Parameterno=1. 0009[14]: @} Close param. 0009[16]: @{ Open defn. 0009[18]: @} Close defn. 0009[20]: Text. Text scrap[White]="<010> " 0010[01]: @$ Macro defn. 0010[03]: @< Open name. 0010[05]: Text. Text scrap[Grey]="Two" 0010[08]: @> Close name. 0010[10]: @( Open param. 0010[12]: @n Parameter. Parameterno=2. 0010[14]: @} Close param. 0010[16]: @{ Open defn. 0010[18]: @} Close defn. 0010[20]: Text. Text scrap[White]="<010> " 0011[01]: @$ Macro defn. 0011[03]: @< Open name. 0011[05]: Text. Text scrap[Grey]="Three" 0011[10]: @> Close name. 0011[12]: @( Open param. 0011[14]: @n Parameter. Parameterno=3. 0011[16]: @} Close param. 0011[18]: @{ Open defn. 0011[20]: @} Close defn. 0011[22]: Text. Text scrap[White]="<010> " 0012[01]: @$ Macro defn. 0012[03]: @< Open name. 0012[05]: Text. Text scrap[Grey]="Nine" 0012[09]: @> Close name. 0012[11]: @( Open param. 0012[13]: @n Parameter. Parameterno=9. 0012[15]: @} Close param. 0012[17]: @{ Open defn. 0012[19]: @} Close defn. 0012[21]: Text. Text scrap[White]="<010> " 0013[01]: @$ Macro defn. 0013[03]: @# Name. Character='"'. 0013[06]: @{ Open defn. 0013[08]: @} Close defn. 0013[10]: Text. Text scrap[Grey]="<010> <010> The following test calls should NOT generate any errors.<010> <010> " 0017[01]: @$ Macro defn. 0017[03]: @< Open name. 0017[05]: Text. Text scrap[Grey]="Macro containing the test macro calls." 0017[43]: @> Close name. 0017[45]: Text. Text scrap[Grey]="==" 0017[47]: @{ Open defn. 0017[49]: Text. Text scrap[Grey]="<010> 1. Test macro call with no parameter list.<010> " 0019[01]: @< Open name. 0019[03]: Text. Text scrap[Grey]="Zero" 0019[07]: @> Close name. 0019[09]: Text. Text scrap[Grey]="<010> <010> 2. Test macro call with quick name.<010> " 0022[01]: @# Name. Character='"'. 0022[04]: Text. Text scrap[Grey]="<010> <010> 3. Test macro call with one parameter.<010> " 0025[01]: @< Open name. 0025[03]: Text. Text scrap[Grey]="One" 0025[06]: @> Close name. 0025[08]: @( Open param. 0025[10]: Text. Text scrap[Grey]="Toucan" 0025[16]: @} Close param. 0025[18]: Text. Text scrap[Grey]="<010> <010> 4. Test macro call with many parameters.<010> " 0028[01]: @< Open name. 0028[03]: Text. Text scrap[Grey]="Two" 0028[06]: @> Close name. 0028[08]: @( Open param. 0028[10]: Text. Text scrap[Grey]="Toucan" 0028[16]: @, Comma. 0028[18]: Text. Text scrap[Grey]="Teapot" 0028[24]: @} Close param. 0028[26]: Text. Text scrap[White]="<010> " 0029[01]: @< Open name. 0029[03]: Text. Text scrap[Grey]="Three" 0029[08]: @> Close name. 0029[10]: @( Open param. 0029[12]: Text. Text scrap[Grey]="Toucan" 0029[18]: @, Comma. 0029[20]: Text. Text scrap[Grey]="Teapot" 0029[26]: @, Comma. 0029[28]: Text. Text scrap[Grey]="Walrus" 0029[34]: @} Close param. 0029[36]: Text. Text scrap[White]="<010> " 0030[01]: @< Open name. 0030[03]: Text. Text scrap[Grey]="Nine" 0030[07]: @> Close name. 0030[09]: @( Open param. 0030[11]: Text. Text scrap[Grey]="Toucan" 0030[17]: @, Comma. 0030[19]: Text. Text scrap[Grey]="Teapot" 0030[25]: @, Comma. 0030[27]: Text. Text scrap[Grey]="Walrus" 0030[33]: @, Comma. 0030[35]: Text. Text scrap[Grey]="<010> Toucan" 0031[17]: @, Comma. 0031[19]: Text. Text scrap[Grey]="Teapot" 0031[25]: @, Comma. 0031[27]: Text. Text scrap[Grey]="Walrus" 0031[33]: @, Comma. 0031[35]: Text. Text scrap[Grey]="<010> Toucan" 0032[17]: @, Comma. 0032[19]: Text. Text scrap[Grey]="Teapot" 0032[25]: @, Comma. 0032[27]: Text. Text scrap[Grey]="Walrus" 0032[33]: @} Close param. 0032[35]: Text. Text scrap[Grey]="<010> <010> 5. Test macro calls with double quotes on parameters.<010> " 0035[01]: @< Open name. 0035[03]: Text. Text scrap[Grey]="One" 0035[06]: @> Close name. 0035[08]: @( Open param. 0035[10]: Text. Text scrap[White]=" " 0035[11]: @" Quote. 0035[13]: Text. Text scrap[Grey]="Toucan" 0035[19]: @" Quote. 0035[21]: @} Close param. 0035[23]: Text. Text scrap[White]="<010> " 0036[01]: @< Open name. 0036[03]: Text. Text scrap[Grey]="Two" 0036[06]: @> Close name. 0036[08]: @( Open param. 0036[10]: @" Quote. 0036[12]: Text. Text scrap[Grey]="Toucan" 0036[18]: @" Quote. 0036[20]: Text. Text scrap[White]=" " 0036[23]: @, Comma. 0036[25]: Text. Text scrap[White]=" " 0036[28]: @" Quote. 0036[30]: Text. Text scrap[Grey]="Teapot" 0036[36]: @" Quote. 0036[38]: @} Close param. 0036[40]: Text. Text scrap[White]="<010> " 0037[01]: @< Open name. 0037[03]: Text. Text scrap[Grey]="Three" 0037[08]: @> Close name. 0037[10]: @( Open param. 0037[12]: @" Quote. 0037[14]: Text. Text scrap[Grey]="Toucan" 0037[20]: @" Quote. 0037[22]: Text. Text scrap[White]=" " 0037[23]: @, Comma. 0037[25]: Text. Text scrap[White]="<010> " 0038[12]: @" Quote. 0038[14]: Text. Text scrap[Grey]="Teapot" 0038[20]: @" Quote. 0038[22]: Text. Text scrap[White]=" " 0038[23]: @, Comma. 0038[25]: Text. Text scrap[White]="<010> " 0039[12]: @" Quote. 0039[14]: Text. Text scrap[Grey]="Walrus" 0039[20]: @" Quote. 0039[22]: Text. Text scrap[White]=" " 0039[23]: @} Close param. 0039[25]: Text. Text scrap[White]="<010> " 0040[01]: @< Open name. 0040[03]: Text. Text scrap[Grey]="Nine" 0040[07]: @> Close name. 0040[09]: @( Open param. 0040[11]: Text. Text scrap[White]=" " 0040[12]: @" Quote. 0040[14]: Text. Text scrap[Grey]="Toucan" 0040[20]: @" Quote. 0040[22]: Text. Text scrap[White]=" " 0040[23]: @, Comma. 0040[25]: Text. Text scrap[White]=" " 0040[26]: @" Quote. 0040[28]: Text. Text scrap[Grey]="Teapot" 0040[34]: @" Quote. 0040[36]: Text. Text scrap[White]=" " 0040[37]: @, Comma. 0040[39]: Text. Text scrap[White]=" " 0040[40]: @" Quote. 0040[42]: Text. Text scrap[Grey]="Walrus" 0040[48]: @" Quote. 0040[50]: Text. Text scrap[White]=" " 0040[51]: @, Comma. 0040[53]: Text. Text scrap[White]="<010> " 0041[12]: @" Quote. 0041[14]: Text. Text scrap[Grey]="Toucan" 0041[20]: @" Quote. 0041[22]: Text. Text scrap[White]=" " 0041[23]: @, Comma. 0041[25]: Text. Text scrap[White]=" " 0041[26]: @" Quote. 0041[28]: Text. Text scrap[Grey]="Teapot" 0041[34]: @" Quote. 0041[36]: Text. Text scrap[White]=" " 0041[37]: @, Comma. 0041[39]: Text. Text scrap[White]=" " 0041[40]: @" Quote. 0041[42]: Text. Text scrap[Grey]="Walrus" 0041[48]: @" Quote. 0041[50]: Text. Text scrap[White]=" " 0041[51]: @, Comma. 0041[53]: Text. Text scrap[White]="<010> " 0042[12]: @" Quote. 0042[14]: Text. Text scrap[Grey]="Toucan" 0042[20]: @" Quote. 0042[22]: Text. Text scrap[White]=" " 0042[23]: @, Comma. 0042[25]: Text. Text scrap[White]=" " 0042[26]: @" Quote. 0042[28]: Text. Text scrap[Grey]="Teapot" 0042[34]: @" Quote. 0042[36]: Text. Text scrap[White]=" " 0042[37]: @, Comma. 0042[39]: Text. Text scrap[White]=" " 0042[40]: @" Quote. 0042[42]: Text. Text scrap[Grey]="Walrus" 0042[48]: @" Quote. 0042[50]: Text. Text scrap[White]=" " 0042[51]: @} Close param. 0042[53]: Text. Text scrap[Grey]="<010> <010> 7. Test macro calls with mixed double quotes on parameters.<010> " 0045[01]: @< Open name. 0045[03]: Text. Text scrap[Grey]="Two" 0045[06]: @> Close name. 0045[08]: @( Open param. 0045[10]: @" Quote. 0045[12]: Text. Text scrap[Grey]="Toucan" 0045[18]: @" Quote. 0045[20]: Text. Text scrap[White]=" " 0045[23]: @, Comma. 0045[25]: Text. Text scrap[Grey]="Teapot" 0045[31]: @} Close param. 0045[33]: Text. Text scrap[White]="<010> " 0046[01]: @< Open name. 0046[03]: Text. Text scrap[Grey]="Three" 0046[08]: @> Close name. 0046[10]: @( Open param. 0046[12]: @" Quote. 0046[14]: Text. Text scrap[Grey]="Toucan" 0046[20]: @" Quote. 0046[22]: Text. Text scrap[White]=" " 0046[23]: @, Comma. 0046[25]: Text. Text scrap[White]="<010> " 0047[12]: @" Quote. 0047[14]: Text. Text scrap[Grey]="Teapot" 0047[20]: @" Quote. 0047[22]: Text. Text scrap[White]=" " 0047[23]: @, Comma. 0047[25]: Text. Text scrap[Grey]="Walrus" 0047[31]: @} Close param. 0047[33]: Text. Text scrap[White]="<010> " 0048[01]: @< Open name. 0048[03]: Text. Text scrap[Grey]="Nine" 0048[07]: @> Close name. 0048[09]: @( Open param. 0048[11]: Text. Text scrap[White]=" " 0048[12]: @" Quote. 0048[14]: Text. Text scrap[Grey]="Toucan" 0048[20]: @" Quote. 0048[22]: Text. Text scrap[White]=" " 0048[23]: @, Comma. 0048[25]: Text. Text scrap[White]=" " 0048[26]: @" Quote. 0048[28]: Text. Text scrap[Grey]="Teapot" 0048[34]: @" Quote. 0048[36]: Text. Text scrap[White]=" " 0048[37]: @, Comma. 0048[39]: Text. Text scrap[Grey]=" Walrus " 0048[51]: @, Comma. 0048[53]: Text. Text scrap[White]="<010> " 0049[12]: @" Quote. 0049[14]: Text. Text scrap[Grey]="Toucan" 0049[20]: @" Quote. 0049[22]: Text. Text scrap[White]=" " 0049[23]: @, Comma. 0049[25]: Text. Text scrap[Grey]=" Teapot " 0049[37]: @, Comma. 0049[39]: Text. Text scrap[White]=" " 0049[40]: @" Quote. 0049[42]: Text. Text scrap[Grey]="Walrus" 0049[48]: @" Quote. 0049[50]: Text. Text scrap[White]=" " 0049[51]: @, Comma. 0049[53]: Text. Text scrap[White]="<010> " 0050[12]: @" Quote. 0050[14]: Text. Text scrap[Grey]="Toucan" 0050[20]: @" Quote. 0050[22]: Text. Text scrap[White]=" " 0050[23]: @, Comma. 0050[25]: Text. Text scrap[White]=" " 0050[26]: @" Quote. 0050[28]: Text. Text scrap[Grey]="Teapot" 0050[34]: @" Quote. 0050[36]: Text. Text scrap[White]=" " 0050[37]: @, Comma. 0050[39]: Text. Text scrap[White]=" " 0050[40]: @" Quote. 0050[42]: Text. Text scrap[Grey]="Walrus" 0050[48]: @" Quote. 0050[50]: Text. Text scrap[White]=" " 0050[51]: @} Close param. 0050[53]: Text. Text scrap[White]="<010> <010> " 0052[01]: @} Close defn. 0052[03]: Text. Text scrap[White]=" " 0053[01]: Text. Text scrap[Grey]="<010> 8. Test macro calls with a variety of syntax errors in parameter list.<010> " 0055[01]: @$ Macro defn. 0055[03]: @< Open name. 0055[05]: Text. Text scrap[Grey]="Error1" 0055[11]: @> Close name. 0055[13]: @{ Open defn. 0055[15]: Text. Text scrap[White]="<010> " 0056[01]: @< Open name. 0056[03]: Text. Text scrap[Grey]="Zero" 0056[07]: @> Close name. 0056[09]: @( Open param. 0056[11]: Text. Text scrap[White]="<010> " 0057[01]: @} Close defn. 0057[03]: Text. Text scrap[White]="<010> " 0058[01]: @A New section (Level 1). 0058[03]: @< Open name. 0058[05]: Text. Text scrap[Grey]="Error recovery point" 0058[25]: @> Close name. 0058[27]: Text. Text scrap[White]="<010> <010> " 0060[01]: @$ Macro defn. 0060[03]: @< Open name. 0060[05]: Text. Text scrap[Grey]="Error2" 0060[11]: @> Close name. 0060[13]: @{ Open defn. 0060[15]: Text. Text scrap[White]="<010> " 0061[01]: @< Open name. 0061[03]: Text. Text scrap[Grey]="Zero" 0061[07]: @> Close name. 0061[09]: @} Close param. 0061[11]: Text. Text scrap[White]="<010> " 0062[01]: @} Close defn. 0062[03]: Text. Text scrap[White]="<010> " 0063[01]: @A New section (Level 1). 0063[03]: @< Open name. 0063[05]: Text. Text scrap[Grey]="Error recovery point" 0063[25]: @> Close name. 0063[27]: Text. Text scrap[White]="<010> <010> " 0065[01]: @$ Macro defn. 0065[03]: @< Open name. 0065[05]: Text. Text scrap[Grey]="Error3" 0065[11]: @> Close name. 0065[13]: @{ Open defn. 0065[15]: Text. Text scrap[White]="<010> " 0066[01]: @< Open name. 0066[03]: Text. Text scrap[Grey]="One" 0066[06]: @> Close name. 0066[08]: @( Open param. 0066[10]: @" Quote. 0066[12]: Text. Text scrap[Grey]="Toucan" 0066[18]: @} Close param. 0066[20]: Text. Text scrap[White]="<010> " 0067[01]: @} Close defn. 0067[03]: Text. Text scrap[White]="<010> " 0068[01]: @A New section (Level 1). 0068[03]: @< Open name. 0068[05]: Text. Text scrap[Grey]="Error recovery point" 0068[25]: @> Close name. 0068[27]: Text. Text scrap[White]="<010> <010> " 0070[01]: @$ Macro defn. 0070[03]: @< Open name. 0070[05]: Text. Text scrap[Grey]="Error4" 0070[11]: @> Close name. 0070[13]: @{ Open defn. 0070[15]: Text. Text scrap[White]="<010> " 0071[01]: @< Open name. 0071[03]: Text. Text scrap[Grey]="One" 0071[06]: @> Close name. 0071[08]: @( Open param. 0071[10]: @" Quote. 0071[12]: Text. Text scrap[Grey]="Toucan" 0071[18]: @" Quote. 0071[20]: @" Quote. 0071[22]: Text. Text scrap[Grey]="Sloth" 0071[27]: @" Quote. 0071[29]: @} Close param. 0071[31]: Text. Text scrap[White]="<010> " 0072[01]: @} Close defn. 0072[03]: Text. Text scrap[White]="<010> " 0073[01]: @A New section (Level 1). 0073[03]: @< Open name. 0073[05]: Text. Text scrap[Grey]="Error recovery point" 0073[25]: @> Close name. 0073[27]: Text. Text scrap[White]="<010> <010> " 0075[01]: @$ Macro defn. 0075[03]: @< Open name. 0075[05]: Text. Text scrap[Grey]="Error5" 0075[11]: @> Close name. 0075[13]: @{ Open defn. 0075[15]: Text. Text scrap[White]="<010> " 0076[01]: @< Open name. 0076[03]: Text. Text scrap[Grey]="Two" 0076[06]: @> Close name. 0076[08]: @( Open param. 0076[10]: @" Quote. 0076[12]: Text. Text scrap[Grey]="Toucan" 0076[18]: @" Quote. 0076[20]: Text. Text scrap[Grey]="Teapot" 0076[26]: @} Close param. 0076[28]: Text. Text scrap[White]="<010> " 0077[01]: @} Close defn. 0077[03]: Text. Text scrap[White]="<010> " 0078[01]: @A New section (Level 1). 0078[03]: @< Open name. 0078[05]: Text. Text scrap[Grey]="Error recovery point" 0078[25]: @> Close name. 0078[27]: Text. Text scrap[White]="<010> <010> " 0080[01]: @$ Macro defn. 0080[03]: @< Open name. 0080[05]: Text. Text scrap[Grey]="Error6" 0080[11]: @> Close name. 0080[13]: @{ Open defn. 0080[15]: Text. Text scrap[White]="<010> " 0081[01]: @< Open name. 0081[03]: Text. Text scrap[Grey]="Two" 0081[06]: @> Close name. 0081[08]: @( Open param. 0081[10]: @" Quote. 0081[12]: Text. Text scrap[Grey]="Toucan" 0081[18]: @" Quote. 0081[20]: Text. Text scrap[Grey]="Teapot<010> " 0082[01]: @} Close defn. 0082[03]: Text. Text scrap[White]="<010> " 0083[01]: @A New section (Level 1). 0083[03]: @< Open name. 0083[05]: Text. Text scrap[Grey]="Error recovery point" 0083[25]: @> Close name. 0083[27]: Text. Text scrap[White]="<010> <010> " 0085[01]: @$ Macro defn. 0085[03]: @< Open name. 0085[05]: Text. Text scrap[Grey]="Error7" 0085[11]: @> Close name. 0085[13]: @{ Open defn. 0085[15]: Text. Text scrap[White]="<010> " 0086[01]: @< Open name. 0086[03]: Text. Text scrap[Grey]="Two" 0086[06]: @> Close name. 0086[08]: @( Open param. 0086[10]: @" Quote. 0086[12]: Text. Text scrap[Grey]="Toucan" 0086[18]: @" Quote. 0086[20]: Text. Text scrap[Grey]="Teapot<010> " 0087[01]: @< Open name. 0087[03]: Text. Text scrap[Grey]="Three" 0087[08]: @> Close name. 0087[10]: @( Open param. 0087[12]: Text. Text scrap[Grey]="Toucan" 0087[18]: @, Comma. 0087[20]: Text. Text scrap[White]="<010> " 0088[12]: @" Quote. 0088[14]: Text. Text scrap[Grey]="Teapot" 0088[20]: @, Comma. 0088[22]: Text. Text scrap[Grey]="Walrus<010> <010> " 0090[01]: @} Close defn. 0090[03]: Text. Text scrap[White]="<010> " 0091[01]: @A New section (Level 1). 0091[03]: @< Open name. 0091[05]: Text. Text scrap[Grey]="Error recovery point" 0091[25]: @> Close name. 0091[27]: Text. Text scrap[White]="<010> <010> " 0093[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ ========================== Start of MACRO TABLE DUMP =========================== ------------------- Start of Macro Dump -------------------- Macro Name : """ Macro MinLv : 0 Call list : Call 1: Parameters=0, Sequence num=7, Position(L,C)=(22,1). Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (13,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=6, Pos(L,C)=(13,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Error1" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (55,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 0 body parts. ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Error2" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (60,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 0 body parts. ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Error3" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (65,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 0 body parts. ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Error4" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (70,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 0 body parts. ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Error5" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (75,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=8, Pos(L,C)=(75,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[White]="<010> " ------ End Text Element ------ -- Begin Invocation Element -- Invocation of macro @ This invocation has 1 actual parameters. Actual parameter list follows as a sequence of expressions: (Text crud before and after parameter has been omitted). Expression for parameter number 1: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Toucan" ------ End Text Element ------ ----- End of Expression ----- --- End Invocation Element --- ----- Start Text Element ----- Text scrap[White]="<010> " ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Error6" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (80,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 0 body parts. ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Error7" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (85,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 0 body parts. ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Macro containing the test macro calls." Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (17,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=7, Pos(L,C)=(17,3), Expression follows: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="<010> 1. Test macro call with no parameter list.<010> " ------ End Text Element ------ -- Begin Invocation Element -- Invocation of macro @ No actual parameters. --- End Invocation Element --- ----- Start Text Element ----- Text scrap[Grey]="<010> <010> 2. Test macro call with quick name.<010> " ------ End Text Element ------ -- Begin Invocation Element -- Invocation of macro @<"@> No actual parameters. --- End Invocation Element --- ----- Start Text Element ----- Text scrap[Grey]="<010> <010> 3. Test macro call with one parameter.<010> " ------ End Text Element ------ -- Begin Invocation Element -- Invocation of macro @ This invocation has 1 actual parameters. Actual parameter list follows as a sequence of expressions: (Text crud before and after parameter has been omitted). Expression for parameter number 1: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Toucan" ------ End Text Element ------ ----- End of Expression ----- --- End Invocation Element --- ----- Start Text Element ----- Text scrap[Grey]="<010> <010> 4. Test macro call with many parameters.<010> " ------ End Text Element ------ -- Begin Invocation Element -- Invocation of macro @ This invocation has 2 actual parameters. Actual parameter list follows as a sequence of expressions: (Text crud before and after parameter has been omitted). Expression for parameter number 1: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Toucan" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 2: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Teapot" ------ End Text Element ------ ----- End of Expression ----- --- End Invocation Element --- ----- Start Text Element ----- Text scrap[White]="<010> " ------ End Text Element ------ -- Begin Invocation Element -- Invocation of macro @ This invocation has 3 actual parameters. Actual parameter list follows as a sequence of expressions: (Text crud before and after parameter has been omitted). Expression for parameter number 1: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Toucan" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 2: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Teapot" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 3: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Walrus" ------ End Text Element ------ ----- End of Expression ----- --- End Invocation Element --- ----- Start Text Element ----- Text scrap[White]="<010> " ------ End Text Element ------ -- Begin Invocation Element -- Invocation of macro @ This invocation has 9 actual parameters. Actual parameter list follows as a sequence of expressions: (Text crud before and after parameter has been omitted). Expression for parameter number 1: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Toucan" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 2: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Teapot" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 3: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Walrus" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 4: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="<010> Toucan" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 5: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Teapot" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 6: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Walrus" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 7: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="<010> Toucan" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 8: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Teapot" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 9: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Walrus" ------ End Text Element ------ ----- End of Expression ----- --- End Invocation Element --- ----- Start Text Element ----- Text scrap[Grey]="<010> <010> 5. Test macro calls with double quotes on parameters.<010> " ------ End Text Element ------ -- Begin Invocation Element -- Invocation of macro @ This invocation has 1 actual parameters. Actual parameter list follows as a sequence of expressions: (Text crud before and after parameter has been omitted). Expression for parameter number 1: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Toucan" ------ End Text Element ------ ----- End of Expression ----- --- End Invocation Element --- ----- Start Text Element ----- Text scrap[White]="<010> " ------ End Text Element ------ -- Begin Invocation Element -- Invocation of macro @ This invocation has 2 actual parameters. Actual parameter list follows as a sequence of expressions: (Text crud before and after parameter has been omitted). Expression for parameter number 1: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Toucan" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 2: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Teapot" ------ End Text Element ------ ----- End of Expression ----- --- End Invocation Element --- ----- Start Text Element ----- Text scrap[White]="<010> " ------ End Text Element ------ -- Begin Invocation Element -- Invocation of macro @ This invocation has 3 actual parameters. Actual parameter list follows as a sequence of expressions: (Text crud before and after parameter has been omitted). Expression for parameter number 1: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Toucan" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 2: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Teapot" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 3: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Walrus" ------ End Text Element ------ ----- End of Expression ----- --- End Invocation Element --- ----- Start Text Element ----- Text scrap[White]="<010> " ------ End Text Element ------ -- Begin Invocation Element -- Invocation of macro @ This invocation has 9 actual parameters. Actual parameter list follows as a sequence of expressions: (Text crud before and after parameter has been omitted). Expression for parameter number 1: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Toucan" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 2: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Teapot" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 3: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Walrus" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 4: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Toucan" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 5: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Teapot" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 6: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Walrus" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 7: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Toucan" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 8: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Teapot" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 9: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Walrus" ------ End Text Element ------ ----- End of Expression ----- --- End Invocation Element --- ----- Start Text Element ----- Text scrap[Grey]="<010> <010> 7. Test macro calls with mixed double quotes on parameters.<010> " ------ End Text Element ------ -- Begin Invocation Element -- Invocation of macro @ This invocation has 2 actual parameters. Actual parameter list follows as a sequence of expressions: (Text crud before and after parameter has been omitted). Expression for parameter number 1: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Toucan" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 2: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Teapot" ------ End Text Element ------ ----- End of Expression ----- --- End Invocation Element --- ----- Start Text Element ----- Text scrap[White]="<010> " ------ End Text Element ------ -- Begin Invocation Element -- Invocation of macro @ This invocation has 3 actual parameters. Actual parameter list follows as a sequence of expressions: (Text crud before and after parameter has been omitted). Expression for parameter number 1: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Toucan" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 2: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Teapot" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 3: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Walrus" ------ End Text Element ------ ----- End of Expression ----- --- End Invocation Element --- ----- Start Text Element ----- Text scrap[White]="<010> " ------ End Text Element ------ -- Begin Invocation Element -- Invocation of macro @ This invocation has 9 actual parameters. Actual parameter list follows as a sequence of expressions: (Text crud before and after parameter has been omitted). Expression for parameter number 1: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Toucan" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 2: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Teapot" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 3: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]=" Walrus " ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 4: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Toucan" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 5: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]=" Teapot " ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 6: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Walrus" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 7: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Toucan" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 8: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Teapot" ------ End Text Element ------ ----- End of Expression ----- Expression for parameter number 9: ---- Start of Expression ---- ----- Start Text Element ----- Text scrap[Grey]="Walrus" ------ End Text Element ------ ----- End of Expression ----- --- End Invocation Element --- ----- Start Text Element ----- Text scrap[White]="<010> <010> " ------ End Text Element ------ ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Nine" Macro MinLv : 0 Call list : Call 1: Parameters=9, Sequence num=7, Position(L,C)=(30,1). Call 2: Parameters=9, Sequence num=7, Position(L,C)=(40,1). Call 3: Parameters=9, Sequence num=7, Position(L,C)=(48,1). Level 0 is defined as follows. Parameters : 9 Pos(L,C) : (12,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=5, Pos(L,C)=(12,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "One" Macro MinLv : 0 Call list : Call 1: Parameters=1, Sequence num=7, Position(L,C)=(25,1). Call 2: Parameters=1, Sequence num=7, Position(L,C)=(35,1). Level 0 is defined as follows. Parameters : 1 Pos(L,C) : (9,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=2, Pos(L,C)=(9,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Three" Macro MinLv : 0 Call list : Call 1: Parameters=3, Sequence num=7, Position(L,C)=(29,1). Call 2: Parameters=3, Sequence num=7, Position(L,C)=(37,1). Call 3: Parameters=3, Sequence num=7, Position(L,C)=(46,1). Level 0 is defined as follows. Parameters : 3 Pos(L,C) : (11,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=4, Pos(L,C)=(11,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Two" Macro MinLv : 0 Call list : Call 1: Parameters=2, Sequence num=7, Position(L,C)=(28,1). Call 2: Parameters=2, Sequence num=7, Position(L,C)=(36,1). Call 3: Parameters=2, Sequence num=7, Position(L,C)=(45,1). Call 4: Parameters=1, Sequence num=8, Position(L,C)=(76,1). Level 0 is defined as follows. Parameters : 2 Pos(L,C) : (10,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=3, Pos(L,C)=(10,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Zero" Macro MinLv : 0 Call list : Call 1: Parameters=0, Sequence num=7, Position(L,C)=(19,1). Call 2: Parameters=0, Sequence num=8, Position(L,C)=(61,1). Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (8,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=1, Pos(L,C)=(8,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- =========================== End of MACRO TABLE DUMP ============================ ========================= Start of DOCUMENT LIST DUMP ========================== TEXT COMPONENT: Pos(L,C)=(1,1). -- Start of Text Scrap List -- Text scrap[Grey]="PR09: Test calls and actual parameter lists.<010> <010> First trip up the parser so we don't get any further.<010> " --- End of Text Scrap List --- TEXT COMPONENT: Pos(L,C)=(4,3). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> Now define some macros to call. No error.<010> <010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(8,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(8,15). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(9,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(9,20). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(10,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(10,20). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(11,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(11,22). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(12,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(12,21). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(13,1). Part 1 of level 0 of macro @<"@>. TEXT COMPONENT: Pos(L,C)=(13,10). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> The following test calls should NOT generate any errors.<010> <010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(17,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(52,3). -- Start of Text Scrap List -- Text scrap[White]=" " Text scrap[Grey]="<010> 8. Test macro calls with a variety of syntax errors in parameter list.<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "1", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(58,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "2", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(63,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "3", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(68,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "4", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(73,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(75,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(77,3). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "5", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(78,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "6", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(83,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "7", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(91,27). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- ========================== End of DOCUMENT LIST DUMP =========================== Global Local| Input File ------------+------------------------------------------------------------------- 1 1| PR09: Test calls and actual parameter lists. 2 2| 3 3| First trip up the parser so we don't get any further. 4 4| @> Error|.^The parser was at the top level and was expecting |.^one of: {Directive, Text, Macro definition, EOF}. 5 5| 6 6| Now define some macros to call. No error. 7 7| 8 8| @$@@{@} 9 9| @$@@(@1@)@{@} 10 10| @$@@(@2@)@{@} 11 11| @$@@(@3@)@{@} 12 12| @$@@(@9@)@{@} 13 13| @$@#"@{@} 14 14| 15 15| The following test calls should NOT generate any errors. 16 16| 17 17| @$@==@{ 18 18| 1. Test macro call with no parameter list. 19 19| @ 20 20| 21 21| 2. Test macro call with quick name. 22 22| @#" 23 23| 24 24| 3. Test macro call with one parameter. 25 25| @@(Toucan@) 26 26| 27 27| 4. Test macro call with many parameters. 28 28| @@(Toucan@,Teapot@) 29 29| @@(Toucan@,Teapot@,Walrus@) 30 30| @@(Toucan@,Teapot@,Walrus@, 31 31| Toucan@,Teapot@,Walrus@, 32 32| Toucan@,Teapot@,Walrus@) 33 33| 34 34| 5. Test macro calls with double quotes on parameters. 35 35| @@( @"Toucan@"@) 36 36| @@(@"Toucan@" @, @"Teapot@"@) 37 37| @@(@"Toucan@" @, 38 38| @"Teapot@" @, 39 39| @"Walrus@" @) 40 40| @@( @"Toucan@" @, @"Teapot@" @, @"Walrus@" @, 41 41| @"Toucan@" @, @"Teapot@" @, @"Walrus@" @, 42 42| @"Toucan@" @, @"Teapot@" @, @"Walrus@" @) 43 43| 44 44| 7. Test macro calls with mixed double quotes on parameters. 45 45| @@(@"Toucan@" @,Teapot@) 46 46| @@(@"Toucan@" @, 47 47| @"Teapot@" @,Walrus@) 48 48| @@( @"Toucan@" @, @"Teapot@" @, Walrus @, 49 49| @"Toucan@" @, Teapot @, @"Walrus@" @, 50 50| @"Toucan@" @, @"Teapot@" @, @"Walrus@" @) 51 51| 52 52| @} @! End of macro definition enclosing all these legal tests. 53 53| 54 54| 8. Test macro calls with a variety of syntax errors in parameter list. 55 55| @$@@{ 56 56| @@( Error|.........^This parameter list contains a syntax error. 57 57| @} Error|.^Expecting @" or @, or @). |.^Skipping after error to the next major construct... 58 58| @A@ |.^...skipped to here after the error. 59 59| 60 60| @$@@{ 61 61| @@) Error|.........^Expecting '@}'. |.........^Skipping after error to the next major construct... 62 62| @} 63 63| @A@ |.^...skipped to here after the error. 64 64| 65 65| @$@@{ 66 66| @@(@"Toucan@) Error|..................^Expecting '@"'. |..................^Skipping after error to the next major construct... 67 67| @} 68 68| @A@ |.^...skipped to here after the error. 69 69| 70 70| @$@@{ 71 71| @@(@"Toucan@"@"Sloth@"@) Error|........^This parameter list contains a syntax error. Error|....................^Expecting @, or @). |....................^Skipping after error to the next major construct... 72 72| @} 73 73| @A@ |.^...skipped to here after the error. 74 74| 75 75| @$@@{ 76 76| @@(@"Toucan@"Teapot@) Error|....................^Expecting whitespace text. 77 77| @} 78 78| @A@ 79 79| 80 80| @$@@{ 81 81| @@(@"Toucan@"Teapot Error|........^This parameter list contains a syntax error. Error|....................^Expecting whitespace text. 82 82| @} Error|.^Expecting @, or @). |.^Skipping after error to the next major construct... 83 83| @A@ |.^...skipped to here after the error. 84 84| 85 85| @$@@{ 86 86| @@(@"Toucan@"Teapot Error|........^This parameter list contains a syntax error. Error|....................^Expecting whitespace text. 87 87| @@(Toucan@, Error|.^Expecting @, or @). |.^Skipping after error to the next major construct... 88 88| @"Teapot@,Walrus 89 89| 90 90| @} 91 91| @A@ |.^...skipped to here after the error. 92 92| | ------------+------------------------------------------------------------------- There were 14 Errors. of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Zero" Macro MinLv : 0 Call list : Call 1: Parameters=0, Sequence num=7, Position(L,C)=(19,1). Call 2: Parameters=0, Sequence num=8, Position(L,C)=(61,1). Level 0 is defined as follows. Parameters : 0 Pos(L,C) fw_src/answers/pr10.lis 644 0 0 32065 6717353725 10312 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 50 52 31 30 3A 20 54 65 73 74 20 73 79 6E 74 61 | PR10: Test synta | | 63 74 69 63 20 65 72 72 6F 72 20 72 65 63 6F 76 | ctic error recov | | 65 72 79 2E 0A 0A 31 2E 20 54 65 73 74 20 72 65 | ery...1. Test re | | 63 6F 76 65 72 79 20 61 74 20 74 6F 70 20 70 61 | covery at top pa | | 72 73 69 6E 67 20 6C 65 76 65 6C 2E 0A 40 3C 0A | rsing level..@<. | | 0A 40 41 40 3C 45 72 72 6F 72 20 72 65 63 6F 76 | .@A@..2. | | 54 65 73 74 20 72 65 63 6F 76 65 72 79 20 69 6E | Test recovery in | | 73 69 64 65 20 6D 61 63 72 6F 20 64 65 66 69 6E | side macro defin | | 69 74 69 6F 6E 2E 0A 0A 40 24 40 3C 53 6C 6F 74 | ition...@$@@>==@{.Walru | | 73 40 7D 0A 0A 40 24 40 3C 53 6C 6F 74 68 32 40 | s@}..@$@==@{.@.. | | 33 2E 20 54 65 73 74 20 72 65 63 6F 76 65 72 79 | 3. Test recovery | | 20 69 6E 73 69 64 65 20 61 63 74 75 61 6C 20 70 | inside actual p | | 61 72 61 6D 65 74 65 72 20 6C 69 73 74 20 69 6E | arameter list in | | 20 6D 61 63 72 6F 20 64 65 66 69 6E 69 74 69 6F | macro definitio | | 6E 2E 0A 40 24 40 3C 53 6C 6F 74 68 33 40 3E 3D | n..@$@= | | 3D 40 7B 0A 40 3C 57 61 6C 72 75 73 40 3E 40 28 | =@{.@@( | | 40 22 61 61 72 64 76 61 72 6B 40 3E 0A 40 7D 0A | @"aardvark@>.@}. | | 40 41 40 3C 45 72 72 6F 72 20 72 65 63 6F 76 65 | @A@..4. T | | 65 73 74 20 45 4F 46 20 69 6E 20 74 68 65 20 6D | est EOF in the m | | 69 64 64 6C 65 20 6F 66 20 61 20 63 6F 6D 70 6C | iddle of a compl | | 69 63 61 74 65 64 20 63 6F 6E 73 74 72 75 63 74 | icated construct | | 2E 0A 54 68 65 20 66 6F 6C 6C 6F 77 69 6E 67 20 | ..The following | | 6D 61 6B 65 73 20 74 68 65 20 65 6E 64 20 6F 66 | makes the end of | | 20 74 68 65 20 66 69 6C 65 20 6C 6F 6F 6B 65 64 | the file looked | | 20 63 68 6F 70 70 65 64 20 6F 66 66 2C 20 62 75 | chopped off, bu | | 74 20 69 74 20 69 73 0A 61 63 74 75 61 6C 6C 79 | t it is.actually | | 20 69 6E 74 65 6E 74 69 6F 6E 61 6C 2E 0A 40 24 | intentional..@$ | | 40 3C 53 6C 6F 74 68 34 40 3E 3D 3D 40 7B 0A 40 | @==@{.@ | | 3C 57 61 6C 72 75 73 40 3E 40 28 40 22 61 61 72 | @(@"aar | | 64 76 61 0A | dva. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| PR10: Test syntactic error recovery.<010> 00002 00002| <010> 00003 00003| 1. Test recovery at top parsing level.<010> 00004 00004| @<<010> 00005 00005| <010> 00006 00006| @A@<010> 00007 00007| <010> 00008 00008| 2. Test recovery inside macro definition.<010> 00009 00009| <010> 00010 00010| @$@@>==@{<010> 00011 00011| Walrus@}<010> 00012 00012| <010> 00013 00013| @$@==@{<010> 00014 00014| @ 00015 00015| @}<010> 00016 00016| @A@<010> 00017 00017| <010> 00018 00018| 3. Test recovery inside actual parameter list in macro definition.<010> 00019 00019| @$@==@{<010> 00020 00020| @@(@"aardvark@><010> 00021 00021| @}<010> 00022 00022| @A@<010> 00023 00023| <010> 00024 00024| 4. Test EOF in the middle of a complicated construct.<010> 00025 00025| The following makes the end of the file looked chopped off, but it is<010> 00026 00026| actually intentional.<010> 00027 00027| @$@==@{<010> 00028 00028| @@(@"aardva<010> 00029 00029| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 72 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="PR10: Test syntactic error recovery.<010> <010> 1. Test recovery at top parsing level.<010> " 0004[01]: @< Open name. 0004[03]: Text. Text scrap[White]="<010> <010> " 0006[01]: @A New section (Level 1). 0006[03]: @< Open name. 0006[05]: Text. Text scrap[Grey]="Error recovery point" 0006[25]: @> Close name. 0006[27]: Text. Text scrap[Grey]="<010> <010> 2. Test recovery inside macro definition.<010> <010> " 0010[01]: @$ Macro defn. 0010[03]: @< Open name. 0010[05]: Text. Text scrap[Grey]="Sloth1" 0010[11]: @> Close name. 0010[13]: @> Close name. 0010[15]: Text. Text scrap[Grey]="==" 0010[17]: @{ Open defn. 0010[19]: Text. Text scrap[Grey]="<010> Walrus" 0011[07]: @} Close defn. 0011[09]: Text. Text scrap[White]="<010> <010> " 0013[01]: @$ Macro defn. 0013[03]: @< Open name. 0013[05]: Text. Text scrap[Grey]="Sloth2" 0013[11]: @> Close name. 0013[13]: Text. Text scrap[Grey]="==" 0013[15]: @{ Open defn. 0013[17]: Text. Text scrap[White]="<010> " 0014[01]: @< Open name. 0014[03]: Text. Text scrap[Grey]="Walrus" 0014[09]: @< Open name. 0014[11]: Text. Text scrap[White]="<010> " 0015[01]: @} Close defn. 0015[03]: Text. Text scrap[White]="<010> " 0016[01]: @A New section (Level 1). 0016[03]: @< Open name. 0016[05]: Text. Text scrap[Grey]="Error recovery point" 0016[25]: @> Close name. 0016[27]: Text. Text scrap[Grey]="<010> <010> 3. Test recovery inside actual parameter list in macro definition.<010> " 0019[01]: @$ Macro defn. 0019[03]: @< Open name. 0019[05]: Text. Text scrap[Grey]="Sloth3" 0019[11]: @> Close name. 0019[13]: Text. Text scrap[Grey]="==" 0019[15]: @{ Open defn. 0019[17]: Text. Text scrap[White]="<010> " 0020[01]: @< Open name. 0020[03]: Text. Text scrap[Grey]="Walrus" 0020[09]: @> Close name. 0020[11]: @( Open param. 0020[13]: @" Quote. 0020[15]: Text. Text scrap[Grey]="aardvark" 0020[23]: @> Close name. 0020[25]: Text. Text scrap[White]="<010> " 0021[01]: @} Close defn. 0021[03]: Text. Text scrap[White]="<010> " 0022[01]: @A New section (Level 1). 0022[03]: @< Open name. 0022[05]: Text. Text scrap[Grey]="Error recovery point" 0022[25]: @> Close name. 0022[27]: Text. Text scrap[Grey]="<010> <010> 4. Test EOF in the middle of a complicated construct.<010> The following makes the end of the file looked chopped off, but it is<010> actually intentional.<010> " 0027[01]: @$ Macro defn. 0027[03]: @< Open name. 0027[05]: Text. Text scrap[Grey]="Sloth4" 0027[11]: @> Close name. 0027[13]: Text. Text scrap[Grey]="==" 0027[15]: @{ Open defn. 0027[17]: Text. Text scrap[White]="<010> " 0028[01]: @< Open name. 0028[03]: Text. Text scrap[Grey]="Walrus" 0028[09]: @> Close name. 0028[11]: @( Open param. 0028[13]: @" Quote. 0028[15]: Text. Text scrap[Grey]="aardva<010> " 0029[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ ========================== Start of MACRO TABLE DUMP =========================== ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth1" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (10,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 0 body parts. ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth2" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (13,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 0 body parts. ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth3" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (19,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 0 body parts. ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth4" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (27,1) Additive? : No. Zero Calls? : No. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 0 body parts. ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- =========================== End of MACRO TABLE DUMP ============================ ========================= Start of DOCUMENT LIST DUMP ========================== TEXT COMPONENT: Pos(L,C)=(1,1). -- Start of Text Scrap List -- Text scrap[Grey]="PR10: Test syntactic error recovery.<010> <010> 1. Test recovery at top parsing level.<010> " --- End of Text Scrap List --- TEXT COMPONENT: Pos(L,C)=(4,3). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "1", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(6,27). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 2. Test recovery inside macro definition.<010> <010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "2", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(16,27). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 3. Test recovery inside actual parameter list in macro definition.<010> " --- End of Text Scrap List --- TYPESETTER DIRECTIVE COMPONENT: Section "3", Section name="Error recovery point". TEXT COMPONENT: Pos(L,C)=(22,27). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 4. Test EOF in the middle of a complicated construct.<010> The following makes the end of the file looked chopped off, but it is<010> actually intentional.<010> " --- End of Text Scrap List --- ========================== End of DOCUMENT LIST DUMP =========================== Global Local| Input File ------------+------------------------------------------------------------------- 1 1| PR10: Test syntactic error recovery. 2 2| 3 3| 1. Test recovery at top parsing level. 4 4| @< Error|.^The parser was at the top level and was expecting |.^one of: {Directive, Text, Macro definition, EOF}. 5 5| 6 6| @A@ 7 7| 8 8| 2. Test recovery inside macro definition. 9 9| 10 10| @$@@>==@{ Error|.............^Expecting '@{'. |.............^Skipping after error to the next major construct... 11 11| Walrus@} 12 12| 13 13| @$@==@{ |.^...skipped to here after the error. 14 14| @ |.^...skipped to here after the error. 17 17| 18 18| 3. Test recovery inside actual parameter list in macro definition. 19 19| @$@==@{ 20 20| @@(@"aardvark@> Error|.......................^Expecting '@"'. |.......................^Skipping after error to the next major construct... 21 21| @} 22 22| @A@ |.^...skipped to here after the error. 23 23| 24 24| 4. Test EOF in the middle of a complicated construct. 25 25| The following makes the end of the file looked chopped off, but it is 26 26| actually intentional. 27 27| @$@==@{ 28 28| @@(@"aardva | Error|.^Expecting '@"'. |.^Skipping after error to the next major construct... |.^...skipped to here after the error. ------------+------------------------------------------------------------------- There were 5 Errors. -------------------------------------- 00001 00001| PR10: Test syntactic error recovery.<010> 00002 00002| <010> 00003 00003| 1. Test recovery at top parsing level.<010> 00004 00004| @<<010> 00005 00005| <010> 00006 00006| @A@<010> 00007 00007| <010> 00008 00008| 2. Test recovery inside macro definition.<010> 00009 00009| <010> 00010 00010| @$@@>==@{<010> 00011 00011| Walrus@}<010> 00012 00012| <010> 00013 00013| @$@>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 50 52 31 31 3A 20 54 65 73 74 20 70 61 72 73 69 | PR11: Test parsi | | 6E 67 20 6F 66 20 6C 69 62 72 61 72 79 20 6D 61 | ng of library ma | | 63 72 6F 73 2E 0A 0A 31 2E 20 45 6E 73 75 72 65 | cros...1. Ensure | | 20 74 68 61 74 20 30 2E 2E 35 20 4C 73 20 61 72 | that 0..5 Ls ar | | 65 20 4F 4B 2C 20 62 75 74 20 73 69 78 20 6F 72 | e OK, but six or | | 20 73 65 76 65 6E 20 69 73 20 61 6E 20 65 72 72 | seven is an err | | 6F 72 2E 0A 0A 40 24 40 3C 53 6C 6F 74 68 5F 4C | or...@$@@Z@{@}.@$@@Z@L@{@} | | 0A 40 24 40 3C 53 6C 6F 74 68 5F 4C 32 40 3E 40 | .@$@@ | | 5A 40 4C 40 4C 40 7B 40 7D 0A 40 24 40 3C 53 6C | Z@L@L@{@}.@$@@Z@L@L@L | | 40 7B 40 7D 0A 40 24 40 3C 53 6C 6F 74 68 5F 4C | @{@}.@$@@Z@L@L@L@L@{@ | | 7D 0A 40 24 40 3C 53 6C 6F 74 68 5F 4C 35 40 3E | }.@$@ | | 40 5A 40 4C 40 4C 40 4C 40 4C 40 4C 40 7B 40 7D | @Z@L@L@L@L@L@{@} | | 0A 40 24 40 3C 53 6C 6F 74 68 5F 4C 36 40 3E 40 | .@$@@ | | 5A 40 4C 40 4C 40 4C 40 4C 40 4C 40 4C 40 7B 40 | Z@L@L@L@L@L@L@{@ | | 7D 0A 40 24 40 3C 53 6C 6F 74 68 5F 4C 37 40 3E | }.@$@ | | 40 5A 40 4C 40 4C 40 4C 40 4C 40 4C 40 4C 40 4C | @Z@L@L@L@L@L@L@L | | 40 7B 40 7D 0A 0A 32 2E 20 45 6E 73 75 72 65 20 | @{@}..2. Ensure | | 74 68 61 74 20 6F 75 74 70 75 74 20 6D 61 63 72 | that output macr | | 6F 73 20 63 61 6E 27 74 20 61 6C 73 6F 20 62 65 | os can't also be | | 20 6C 69 62 72 61 72 79 20 6D 61 63 72 6F 73 2E | library macros. | | 0A 0A 40 4F 40 3C 70 72 31 31 2E 6F 75 74 40 3E | ..@O@ | | 40 4C 40 7B 40 7D 0A 0A 33 2E 20 45 6E 73 75 72 | @L@{@}..3. Ensur | | 65 20 74 68 61 74 20 79 6F 75 20 63 61 6E 6E 6F | e that you canno | | 74 20 64 65 66 69 6E 65 20 74 77 6F 20 6D 61 63 | t define two mac | | 72 6F 73 20 77 69 74 68 20 62 6F 74 68 20 74 68 | ros with both th | | 65 0A 73 61 6D 65 20 6E 61 6D 65 20 61 6E 64 20 | e.same name and | | 6C 65 76 65 6C 2E 20 45 6E 73 75 72 65 20 74 68 | level. Ensure th | | 61 74 20 74 68 69 73 20 77 6F 72 6B 73 20 66 6F | at this works fo | | 72 20 61 6C 6C 20 6C 65 76 65 6C 73 2E 0A 0A 40 | r all levels...@ | | 24 40 3C 57 61 6C 72 75 73 5F 4C 30 40 3E 40 5A | $@@Z | | 40 7B 40 7D 0A 40 24 40 3C 57 61 6C 72 75 73 5F | @{@}.@$@@Z@{@}..@$@< | | 57 61 6C 72 75 73 5F 4C 31 40 3E 40 5A 40 4C 40 | Walrus_L1@>@Z@L@ | | 7B 40 7D 0A 40 24 40 3C 57 61 6C 72 75 73 5F 4C | {@}.@$@@Z@L@{@}..@$@ | | 3C 57 61 6C 72 75 73 5F 4C 32 40 3E 40 5A 40 4C | @Z@L | | 40 4C 40 7B 40 7D 0A 40 24 40 3C 57 61 6C 72 75 | @L@{@}.@$@@Z@L@L@{@} | | 0A 0A 40 24 40 3C 57 61 6C 72 75 73 5F 4C 33 40 | ..@$@@Z@L@L@L@{@}.@$ | | 40 3C 57 61 6C 72 75 73 5F 4C 33 40 3E 40 5A 40 | @@Z@ | | 4C 40 4C 40 4C 40 7B 40 7D 0A 0A 40 24 40 3C 57 | L@L@L@{@}..@$@@Z@L@L | | 40 4C 40 4C 40 7B 40 7D 0A 40 24 40 3C 57 61 6C | @L@L@{@}.@$@@Z@L@L@L | | 40 4C 40 7B 40 7D 0A 0A 40 24 40 3C 57 61 6C 72 | @L@{@}..@$@@Z@L@L@L@ | | 4C 40 4C 40 7B 40 7D 0A 40 24 40 3C 57 61 6C 72 | L@L@{@}.@$@@Z@L@L@L@ | | 4C 40 4C 40 7B 40 7D 0A 0A 34 2E 20 45 6E 73 75 | L@L@{@}..4. Ensu | | 72 65 20 74 68 61 74 20 73 69 78 20 69 64 65 6E | re that six iden | | 74 69 63 61 6C 20 6C 65 76 65 6C 73 20 63 61 6E | tical levels can | | 20 73 69 6D 75 6C 74 61 6E 65 6F 75 73 6C 79 20 | simultaneously | | 65 78 69 73 74 2E 0A 0A 40 24 40 3C 41 61 72 64 | exist...@$@@Z@{@}. | | 40 24 40 3C 41 61 72 64 76 61 72 6B 5F 4C 31 40 | @$@@Z@L@{@}.@$@@Z@L@ | | 4C 40 7B 40 7D 0A 40 24 40 3C 41 61 72 64 76 61 | L@{@}.@$@@Z@L@L@L@ | | 7B 40 7D 0A 40 24 40 3C 41 61 72 64 76 61 72 6B | {@}.@$@@Z@L@L@L@L@ | | 7B 40 7D 0A 40 24 40 3C 41 61 72 64 76 61 72 6B | {@}.@$@@Z@L@L@L@L@ | | 4C 40 7B 40 7D 0A 0A 35 2E 20 45 6E 73 75 72 65 | L@{@}..5. Ensure | | 20 74 68 61 74 20 64 69 66 66 65 72 65 6E 74 20 | that different | | 6C 65 76 65 6C 73 20 63 61 6E 20 68 61 76 65 20 | levels can have | | 64 69 66 66 65 72 65 6E 74 20 6D 6F 64 69 66 69 | different modifi | | 65 72 73 2E 0A 0A 40 24 40 3C 45 6D 75 40 3E 40 | ers...@$@@ | | 5A 40 4D 40 7B 40 7D 0A 40 24 40 3C 45 6D 75 40 | Z@M@{@}.@$@@Z@L@{@}..6. En | | 73 75 72 65 20 74 68 61 74 20 64 69 66 66 65 72 | sure that differ | | 65 6E 74 20 6C 65 76 65 6C 73 20 63 61 6E 20 68 | ent levels can h | | 61 76 65 20 64 69 66 66 65 72 65 6E 74 20 70 61 | ave different pa | | 72 61 6D 65 74 65 72 20 6C 69 73 74 73 2E 0A 0A | rameter lists... | | 40 24 40 3C 57 6F 6D 62 61 74 40 3E 40 28 40 33 | @$@@(@3 | | 40 29 40 5A 40 7B 40 7D 0A 40 24 40 3C 57 6F 6D | @)@Z@{@}.@$@@(@1@)@Z@L@ | | 7B 40 7D 0A 0A 37 2E 20 45 6E 73 75 72 65 20 74 | {@}..7. Ensure t | | 68 61 74 20 64 69 66 66 65 72 65 6E 74 20 6C 65 | hat different le | | 76 65 6C 73 20 63 61 6E 20 68 61 76 65 20 64 69 | vels can have di | | 66 66 65 72 65 6E 74 6C 79 20 61 64 64 69 74 69 | fferently additi | | 76 65 2E 0A 0A 40 24 40 3C 50 65 6E 67 75 69 6E | ve...@$@@Z==@{@}.@$@

@Z@L+=@{ | | 40 7D 0A 0A 45 6E 64 20 6F 66 20 6C 69 62 72 61 | @}..End of libra | | 72 79 20 63 6F 6E 73 74 72 75 63 74 20 70 61 72 | ry construct par | | 73 65 72 20 74 65 73 74 73 2E 0A | ser tests.. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| PR11: Test parsing of library macros.<010> 00002 00002| <010> 00003 00003| 1. Ensure that 0..5 Ls are OK, but six or seven is an error.<010> 00004 00004| <010> 00005 00005| @$@@Z@{@}<010> 00006 00006| @$@@Z@L@{@}<010> 00007 00007| @$@@Z@L@L@{@}<010> 00008 00008| @$@@Z@L@L@L@{@}<010> 00009 00009| @$@@Z@L@L@L@L@{@}<010> 00010 00010| @$@@Z@L@L@L@L@L@{@}<010> 00011 00011| @$@@Z@L@L@L@L@L@L@{@}<010> 00012 00012| @$@@Z@L@L@L@L@L@L@L@{@}<010> 00013 00013| <010> 00014 00014| 2. Ensure that output macros can't also be library macros.<010> 00015 00015| <010> 00016 00016| @O@@L@{@}<010> 00017 00017| <010> 00018 00018| 3. Ensure that you cannot define two macros with both the<010> 00019 00019| same name and level. Ensure that this works for all levels.<010> 00020 00020| <010> 00021 00021| @$@@Z@{@}<010> 00022 00022| @$@@Z@{@}<010> 00023 00023| <010> 00024 00024| @$@@Z@L@{@}<010> 00025 00025| @$@@Z@L@{@}<010> 00026 00026| <010> 00027 00027| @$@@Z@L@L@{@}<010> 00028 00028| @$@@Z@L@L@{@}<010> 00029 00029| <010> 00030 00030| @$@@Z@L@L@L@{@}<010> 00031 00031| @$@@Z@L@L@L@{@}<010> 00032 00032| <010> 00033 00033| @$@@Z@L@L@L@L@{@}<010> 00034 00034| @$@@Z@L@L@L@L@{@}<010> 00035 00035| <010> 00036 00036| @$@@Z@L@L@L@L@L@{@}<010> 00037 00037| @$@@Z@L@L@L@L@L@{@}<010> 00038 00038| <010> 00039 00039| 4. Ensure that six identical levels can simultaneously exist.<010> 00040 00040| <010> 00041 00041| @$@@Z@{@}<010> 00042 00042| @$@@Z@L@{@}<010> 00043 00043| @$@@Z@L@L@{@}<010> 00044 00044| @$@@Z@L@L@L@{@}<010> 00045 00045| @$@@Z@L@L@L@L@{@}<010> 00046 00046| @$@@Z@L@L@L@L@L@{@}<010> 00047 00047| <010> 00048 00048| 5. Ensure that different levels can have different modifiers.<010> 00049 00049| <010> 00050 00050| @$@@Z@M@{@}<010> 00051 00051| @$@@Z@L@{@}<010> 00052 00052| <010> 00053 00053| 6. Ensure that different levels can have different parameter lists.<010> 00054 00054| <010> 00055 00055| @$@@(@3@)@Z@{@}<010> 00056 00056| @$@@(@1@)@Z@L@{@}<010> 00057 00057| <010> 00058 00058| 7. Ensure that different levels can have differently additive.<010> 00059 00059| <010> 00060 00060| @$@@Z==@{@}<010> 00061 00061| @$@@Z@L+=@{@}<010> 00062 00062| <010> 00063 00063| End of library construct parser tests.<010> 00064 00064| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 351 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="PR11: Test parsing of library macros.<010> <010> 1. Ensure that 0..5 Ls are OK, but six or seven is an error.<010> <010> " 0005[01]: @$ Macro defn. 0005[03]: @< Open name. 0005[05]: Text. Text scrap[Grey]="Sloth_L0" 0005[13]: @> Close name. 0005[15]: @Z Zero calls. 0005[17]: @{ Open defn. 0005[19]: @} Close defn. 0005[21]: Text. Text scrap[White]="<010> " 0006[01]: @$ Macro defn. 0006[03]: @< Open name. 0006[05]: Text. Text scrap[Grey]="Sloth_L1" 0006[13]: @> Close name. 0006[15]: @Z Zero calls. 0006[17]: @L Library. 0006[19]: @{ Open defn. 0006[21]: @} Close defn. 0006[23]: Text. Text scrap[White]="<010> " 0007[01]: @$ Macro defn. 0007[03]: @< Open name. 0007[05]: Text. Text scrap[Grey]="Sloth_L2" 0007[13]: @> Close name. 0007[15]: @Z Zero calls. 0007[17]: @L Library. 0007[19]: @L Library. 0007[21]: @{ Open defn. 0007[23]: @} Close defn. 0007[25]: Text. Text scrap[White]="<010> " 0008[01]: @$ Macro defn. 0008[03]: @< Open name. 0008[05]: Text. Text scrap[Grey]="Sloth_L3" 0008[13]: @> Close name. 0008[15]: @Z Zero calls. 0008[17]: @L Library. 0008[19]: @L Library. 0008[21]: @L Library. 0008[23]: @{ Open defn. 0008[25]: @} Close defn. 0008[27]: Text. Text scrap[White]="<010> " 0009[01]: @$ Macro defn. 0009[03]: @< Open name. 0009[05]: Text. Text scrap[Grey]="Sloth_L4" 0009[13]: @> Close name. 0009[15]: @Z Zero calls. 0009[17]: @L Library. 0009[19]: @L Library. 0009[21]: @L Library. 0009[23]: @L Library. 0009[25]: @{ Open defn. 0009[27]: @} Close defn. 0009[29]: Text. Text scrap[White]="<010> " 0010[01]: @$ Macro defn. 0010[03]: @< Open name. 0010[05]: Text. Text scrap[Grey]="Sloth_L5" 0010[13]: @> Close name. 0010[15]: @Z Zero calls. 0010[17]: @L Library. 0010[19]: @L Library. 0010[21]: @L Library. 0010[23]: @L Library. 0010[25]: @L Library. 0010[27]: @{ Open defn. 0010[29]: @} Close defn. 0010[31]: Text. Text scrap[White]="<010> " 0011[01]: @$ Macro defn. 0011[03]: @< Open name. 0011[05]: Text. Text scrap[Grey]="Sloth_L6" 0011[13]: @> Close name. 0011[15]: @Z Zero calls. 0011[17]: @L Library. 0011[19]: @L Library. 0011[21]: @L Library. 0011[23]: @L Library. 0011[25]: @L Library. 0011[27]: @L Library. 0011[29]: @{ Open defn. 0011[31]: @} Close defn. 0011[33]: Text. Text scrap[White]="<010> " 0012[01]: @$ Macro defn. 0012[03]: @< Open name. 0012[05]: Text. Text scrap[Grey]="Sloth_L7" 0012[13]: @> Close name. 0012[15]: @Z Zero calls. 0012[17]: @L Library. 0012[19]: @L Library. 0012[21]: @L Library. 0012[23]: @L Library. 0012[25]: @L Library. 0012[27]: @L Library. 0012[29]: @L Library. 0012[31]: @{ Open defn. 0012[33]: @} Close defn. 0012[35]: Text. Text scrap[Grey]="<010> <010> 2. Ensure that output macros can't also be library macros.<010> <010> " 0016[01]: @F File defn. 0016[03]: @< Open name. 0016[05]: Text. Text scrap[Grey]="pr11.out" 0016[13]: @> Close name. 0016[15]: @L Library. 0016[17]: @{ Open defn. 0016[19]: @} Close defn. 0016[21]: Text. Text scrap[Grey]="<010> <010> 3. Ensure that you cannot define two macros with both the<010> same name and level. Ensure that this works for all levels.<010> <010> " 0021[01]: @$ Macro defn. 0021[03]: @< Open name. 0021[05]: Text. Text scrap[Grey]="Walrus_L0" 0021[14]: @> Close name. 0021[16]: @Z Zero calls. 0021[18]: @{ Open defn. 0021[20]: @} Close defn. 0021[22]: Text. Text scrap[White]="<010> " 0022[01]: @$ Macro defn. 0022[03]: @< Open name. 0022[05]: Text. Text scrap[Grey]="Walrus_L0" 0022[14]: @> Close name. 0022[16]: @Z Zero calls. 0022[18]: @{ Open defn. 0022[20]: @} Close defn. 0022[22]: Text. Text scrap[White]="<010> <010> " 0024[01]: @$ Macro defn. 0024[03]: @< Open name. 0024[05]: Text. Text scrap[Grey]="Walrus_L1" 0024[14]: @> Close name. 0024[16]: @Z Zero calls. 0024[18]: @L Library. 0024[20]: @{ Open defn. 0024[22]: @} Close defn. 0024[24]: Text. Text scrap[White]="<010> " 0025[01]: @$ Macro defn. 0025[03]: @< Open name. 0025[05]: Text. Text scrap[Grey]="Walrus_L1" 0025[14]: @> Close name. 0025[16]: @Z Zero calls. 0025[18]: @L Library. 0025[20]: @{ Open defn. 0025[22]: @} Close defn. 0025[24]: Text. Text scrap[White]="<010> <010> " 0027[01]: @$ Macro defn. 0027[03]: @< Open name. 0027[05]: Text. Text scrap[Grey]="Walrus_L2" 0027[14]: @> Close name. 0027[16]: @Z Zero calls. 0027[18]: @L Library. 0027[20]: @L Library. 0027[22]: @{ Open defn. 0027[24]: @} Close defn. 0027[26]: Text. Text scrap[White]="<010> " 0028[01]: @$ Macro defn. 0028[03]: @< Open name. 0028[05]: Text. Text scrap[Grey]="Walrus_L2" 0028[14]: @> Close name. 0028[16]: @Z Zero calls. 0028[18]: @L Library. 0028[20]: @L Library. 0028[22]: @{ Open defn. 0028[24]: @} Close defn. 0028[26]: Text. Text scrap[White]="<010> <010> " 0030[01]: @$ Macro defn. 0030[03]: @< Open name. 0030[05]: Text. Text scrap[Grey]="Walrus_L3" 0030[14]: @> Close name. 0030[16]: @Z Zero calls. 0030[18]: @L Library. 0030[20]: @L Library. 0030[22]: @L Library. 0030[24]: @{ Open defn. 0030[26]: @} Close defn. 0030[28]: Text. Text scrap[White]="<010> " 0031[01]: @$ Macro defn. 0031[03]: @< Open name. 0031[05]: Text. Text scrap[Grey]="Walrus_L3" 0031[14]: @> Close name. 0031[16]: @Z Zero calls. 0031[18]: @L Library. 0031[20]: @L Library. 0031[22]: @L Library. 0031[24]: @{ Open defn. 0031[26]: @} Close defn. 0031[28]: Text. Text scrap[White]="<010> <010> " 0033[01]: @$ Macro defn. 0033[03]: @< Open name. 0033[05]: Text. Text scrap[Grey]="Walrus_L4" 0033[14]: @> Close name. 0033[16]: @Z Zero calls. 0033[18]: @L Library. 0033[20]: @L Library. 0033[22]: @L Library. 0033[24]: @L Library. 0033[26]: @{ Open defn. 0033[28]: @} Close defn. 0033[30]: Text. Text scrap[White]="<010> " 0034[01]: @$ Macro defn. 0034[03]: @< Open name. 0034[05]: Text. Text scrap[Grey]="Walrus_L4" 0034[14]: @> Close name. 0034[16]: @Z Zero calls. 0034[18]: @L Library. 0034[20]: @L Library. 0034[22]: @L Library. 0034[24]: @L Library. 0034[26]: @{ Open defn. 0034[28]: @} Close defn. 0034[30]: Text. Text scrap[White]="<010> <010> " 0036[01]: @$ Macro defn. 0036[03]: @< Open name. 0036[05]: Text. Text scrap[Grey]="Walrus_L5" 0036[14]: @> Close name. 0036[16]: @Z Zero calls. 0036[18]: @L Library. 0036[20]: @L Library. 0036[22]: @L Library. 0036[24]: @L Library. 0036[26]: @L Library. 0036[28]: @{ Open defn. 0036[30]: @} Close defn. 0036[32]: Text. Text scrap[White]="<010> " 0037[01]: @$ Macro defn. 0037[03]: @< Open name. 0037[05]: Text. Text scrap[Grey]="Walrus_L5" 0037[14]: @> Close name. 0037[16]: @Z Zero calls. 0037[18]: @L Library. 0037[20]: @L Library. 0037[22]: @L Library. 0037[24]: @L Library. 0037[26]: @L Library. 0037[28]: @{ Open defn. 0037[30]: @} Close defn. 0037[32]: Text. Text scrap[Grey]="<010> <010> 4. Ensure that six identical levels can simultaneously exist.<010> <010> " 0041[01]: @$ Macro defn. 0041[03]: @< Open name. 0041[05]: Text. Text scrap[Grey]="Aardvark_L0" 0041[16]: @> Close name. 0041[18]: @Z Zero calls. 0041[20]: @{ Open defn. 0041[22]: @} Close defn. 0041[24]: Text. Text scrap[White]="<010> " 0042[01]: @$ Macro defn. 0042[03]: @< Open name. 0042[05]: Text. Text scrap[Grey]="Aardvark_L1" 0042[16]: @> Close name. 0042[18]: @Z Zero calls. 0042[20]: @L Library. 0042[22]: @{ Open defn. 0042[24]: @} Close defn. 0042[26]: Text. Text scrap[White]="<010> " 0043[01]: @$ Macro defn. 0043[03]: @< Open name. 0043[05]: Text. Text scrap[Grey]="Aardvark_L2" 0043[16]: @> Close name. 0043[18]: @Z Zero calls. 0043[20]: @L Library. 0043[22]: @L Library. 0043[24]: @{ Open defn. 0043[26]: @} Close defn. 0043[28]: Text. Text scrap[White]="<010> " 0044[01]: @$ Macro defn. 0044[03]: @< Open name. 0044[05]: Text. Text scrap[Grey]="Aardvark_L3" 0044[16]: @> Close name. 0044[18]: @Z Zero calls. 0044[20]: @L Library. 0044[22]: @L Library. 0044[24]: @L Library. 0044[26]: @{ Open defn. 0044[28]: @} Close defn. 0044[30]: Text. Text scrap[White]="<010> " 0045[01]: @$ Macro defn. 0045[03]: @< Open name. 0045[05]: Text. Text scrap[Grey]="Aardvark_L4" 0045[16]: @> Close name. 0045[18]: @Z Zero calls. 0045[20]: @L Library. 0045[22]: @L Library. 0045[24]: @L Library. 0045[26]: @L Library. 0045[28]: @{ Open defn. 0045[30]: @} Close defn. 0045[32]: Text. Text scrap[White]="<010> " 0046[01]: @$ Macro defn. 0046[03]: @< Open name. 0046[05]: Text. Text scrap[Grey]="Aardvark_L5" 0046[16]: @> Close name. 0046[18]: @Z Zero calls. 0046[20]: @L Library. 0046[22]: @L Library. 0046[24]: @L Library. 0046[26]: @L Library. 0046[28]: @L Library. 0046[30]: @{ Open defn. 0046[32]: @} Close defn. 0046[34]: Text. Text scrap[Grey]="<010> <010> 5. Ensure that different levels can have different modifiers.<010> <010> " 0050[01]: @$ Macro defn. 0050[03]: @< Open name. 0050[05]: Text. Text scrap[Grey]="Emu" 0050[08]: @> Close name. 0050[10]: @Z Zero calls. 0050[12]: @M Many calls. 0050[14]: @{ Open defn. 0050[16]: @} Close defn. 0050[18]: Text. Text scrap[White]="<010> " 0051[01]: @$ Macro defn. 0051[03]: @< Open name. 0051[05]: Text. Text scrap[Grey]="Emu" 0051[08]: @> Close name. 0051[10]: @Z Zero calls. 0051[12]: @L Library. 0051[14]: @{ Open defn. 0051[16]: @} Close defn. 0051[18]: Text. Text scrap[Grey]="<010> <010> 6. Ensure that different levels can have different parameter lists.<010> <010> " 0055[01]: @$ Macro defn. 0055[03]: @< Open name. 0055[05]: Text. Text scrap[Grey]="Wombat" 0055[11]: @> Close name. 0055[13]: @( Open param. 0055[15]: @n Parameter. Parameterno=3. 0055[17]: @} Close param. 0055[19]: @Z Zero calls. 0055[21]: @{ Open defn. 0055[23]: @} Close defn. 0055[25]: Text. Text scrap[White]="<010> " 0056[01]: @$ Macro defn. 0056[03]: @< Open name. 0056[05]: Text. Text scrap[Grey]="Wombat" 0056[11]: @> Close name. 0056[13]: @( Open param. 0056[15]: @n Parameter. Parameterno=1. 0056[17]: @} Close param. 0056[19]: @Z Zero calls. 0056[21]: @L Library. 0056[23]: @{ Open defn. 0056[25]: @} Close defn. 0056[27]: Text. Text scrap[Grey]="<010> <010> 7. Ensure that different levels can have differently additive.<010> <010> " 0060[01]: @$ Macro defn. 0060[03]: @< Open name. 0060[05]: Text. Text scrap[Grey]="Penguin" 0060[12]: @> Close name. 0060[14]: @Z Zero calls. 0060[16]: Text. Text scrap[Grey]="==" 0060[18]: @{ Open defn. 0060[20]: @} Close defn. 0060[22]: Text. Text scrap[White]="<010> " 0061[01]: @$ Macro defn. 0061[03]: @< Open name. 0061[05]: Text. Text scrap[Grey]="Penguin" 0061[12]: @> Close name. 0061[14]: @Z Zero calls. 0061[16]: @L Library. 0061[18]: Text. Text scrap[Grey]="+=" 0061[20]: @{ Open defn. 0061[22]: @} Close defn. 0061[24]: Text. Text scrap[Grey]="<010> <010> End of library construct parser tests.<010> " 0064[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ ========================== Start of MACRO TABLE DUMP =========================== ------------------- Start of Macro Dump -------------------- Macro Name : "Aardvark_L0" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (41,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=13, Pos(L,C)=(41,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Aardvark_L1" Macro MinLv : 1 Call list : Level 0 is not defined. Level 1 is defined as follows. Parameters : 0 Pos(L,C) : (42,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=14, Pos(L,C)=(42,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Aardvark_L2" Macro MinLv : 2 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is defined as follows. Parameters : 0 Pos(L,C) : (43,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=15, Pos(L,C)=(43,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Aardvark_L3" Macro MinLv : 3 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is defined as follows. Parameters : 0 Pos(L,C) : (44,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=16, Pos(L,C)=(44,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Aardvark_L4" Macro MinLv : 4 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is defined as follows. Parameters : 0 Pos(L,C) : (45,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=17, Pos(L,C)=(45,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Aardvark_L5" Macro MinLv : 5 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is defined as follows. Parameters : 0 Pos(L,C) : (46,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=18, Pos(L,C)=(46,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Emu" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (50,1) Additive? : No. Zero Calls? : Yes. Many Calls? : Yes. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=19, Pos(L,C)=(50,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is defined as follows. Parameters : 0 Pos(L,C) : (51,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=20, Pos(L,C)=(51,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Penguin" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (60,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=23, Pos(L,C)=(60,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is defined as follows. Parameters : 0 Pos(L,C) : (61,1) Additive? : Yes. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=24, Pos(L,C)=(61,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth_L0" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (5,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=1, Pos(L,C)=(5,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth_L1" Macro MinLv : 1 Call list : Level 0 is not defined. Level 1 is defined as follows. Parameters : 0 Pos(L,C) : (6,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=2, Pos(L,C)=(6,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth_L2" Macro MinLv : 2 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is defined as follows. Parameters : 0 Pos(L,C) : (7,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=3, Pos(L,C)=(7,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth_L3" Macro MinLv : 3 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is defined as follows. Parameters : 0 Pos(L,C) : (8,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=4, Pos(L,C)=(8,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth_L4" Macro MinLv : 4 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is defined as follows. Parameters : 0 Pos(L,C) : (9,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=5, Pos(L,C)=(9,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth_L5" Macro MinLv : 5 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is defined as follows. Parameters : 0 Pos(L,C) : (10,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=6, Pos(L,C)=(10,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth_L6" Macro MinLv : 6 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Sloth_L7" Macro MinLv : 6 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Walrus_L0" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 0 Pos(L,C) : (21,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=7, Pos(L,C)=(21,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Walrus_L1" Macro MinLv : 1 Call list : Level 0 is not defined. Level 1 is defined as follows. Parameters : 0 Pos(L,C) : (24,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=8, Pos(L,C)=(24,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Walrus_L2" Macro MinLv : 2 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is defined as follows. Parameters : 0 Pos(L,C) : (27,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=9, Pos(L,C)=(27,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Walrus_L3" Macro MinLv : 3 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is defined as follows. Parameters : 0 Pos(L,C) : (30,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=10, Pos(L,C)=(30,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Walrus_L4" Macro MinLv : 4 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is defined as follows. Parameters : 0 Pos(L,C) : (33,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=11, Pos(L,C)=(33,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Walrus_L5" Macro MinLv : 5 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is defined as follows. Parameters : 0 Pos(L,C) : (36,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=12, Pos(L,C)=(36,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "Wombat" Macro MinLv : 0 Call list : Level 0 is defined as follows. Parameters : 3 Pos(L,C) : (55,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=21, Pos(L,C)=(55,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 1 is defined as follows. Parameters : 1 Pos(L,C) : (56,1) Additive? : No. Zero Calls? : Yes. Many Calls? : No. Output File?: No. Macro body : --Start of List of Body Parts-- This macro has 1 body part. Body part 1: Seqnum=22, Pos(L,C)=(56,3), Expression follows: ---- Start of Expression ---- ----- End of Expression ----- ---End of List of Body Parts--- Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- ------------------- Start of Macro Dump -------------------- Macro Name : "pr11.out" Macro MinLv : 6 Call list : Level 0 is not defined. Level 1 is not defined. Level 2 is not defined. Level 3 is not defined. Level 4 is not defined. Level 5 is not defined. -------------------- End of Macro Dump --------------------- =========================== End of MACRO TABLE DUMP ============================ ========================= Start of DOCUMENT LIST DUMP ========================== TEXT COMPONENT: Pos(L,C)=(1,1). -- Start of Text Scrap List -- Text scrap[Grey]="PR11: Test parsing of library macros.<010> <010> 1. Ensure that 0..5 Ls are OK, but six or seven is an error.<010> <010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(5,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(5,21). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(6,1). Part 1 of level 1 of macro @. TEXT COMPONENT: Pos(L,C)=(6,23). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(7,1). Part 1 of level 2 of macro @. TEXT COMPONENT: Pos(L,C)=(7,25). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(8,1). Part 1 of level 3 of macro @. TEXT COMPONENT: Pos(L,C)=(8,27). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(9,1). Part 1 of level 4 of macro @. TEXT COMPONENT: Pos(L,C)=(9,29). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(10,1). Part 1 of level 5 of macro @. TEXT COMPONENT: Pos(L,C)=(10,31). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(21,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(21,22). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(24,1). Part 1 of level 1 of macro @. TEXT COMPONENT: Pos(L,C)=(24,24). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(27,1). Part 1 of level 2 of macro @. TEXT COMPONENT: Pos(L,C)=(27,26). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(30,1). Part 1 of level 3 of macro @. TEXT COMPONENT: Pos(L,C)=(30,28). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(33,1). Part 1 of level 4 of macro @. TEXT COMPONENT: Pos(L,C)=(33,30). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(36,1). Part 1 of level 5 of macro @. TEXT COMPONENT: Pos(L,C)=(36,32). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(41,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(41,24). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(42,1). Part 1 of level 1 of macro @. TEXT COMPONENT: Pos(L,C)=(42,26). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(43,1). Part 1 of level 2 of macro @. TEXT COMPONENT: Pos(L,C)=(43,28). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(44,1). Part 1 of level 3 of macro @. TEXT COMPONENT: Pos(L,C)=(44,30). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(45,1). Part 1 of level 4 of macro @. TEXT COMPONENT: Pos(L,C)=(45,32). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(46,1). Part 1 of level 5 of macro @. TEXT COMPONENT: Pos(L,C)=(46,34). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 5. Ensure that different levels can have different modifiers.<010> <010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(50,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(50,18). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(51,1). Part 1 of level 1 of macro @. TEXT COMPONENT: Pos(L,C)=(51,18). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 6. Ensure that different levels can have different parameter lists.<010> <010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(55,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(55,25). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(56,1). Part 1 of level 1 of macro @. TEXT COMPONENT: Pos(L,C)=(56,27). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> 7. Ensure that different levels can have differently additive.<010> <010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(60,1). Part 1 of level 0 of macro @. TEXT COMPONENT: Pos(L,C)=(60,22). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(61,1). Part 1 of level 1 of macro @. TEXT COMPONENT: Pos(L,C)=(61,24). -- Start of Text Scrap List -- Text scrap[Grey]="<010> <010> End of library construct parser tests.<010> " --- End of Text Scrap List --- ========================== End of DOCUMENT LIST DUMP =========================== Global Local| Input File ------------+------------------------------------------------------------------- 1 1| PR11: Test parsing of library macros. 2 2| 3 3| 1. Ensure that 0..5 Ls are OK, but six or seven is an error. 4 4| 5 5| @$@@Z@{@} 6 6| @$@@Z@L@{@} 7 7| @$@@Z@L@L@{@} 8 8| @$@@Z@L@L@L@{@} 9 9| @$@@Z@L@L@L@L@{@} 10 10| @$@@Z@L@L@L@L@L@{@} 11 11| @$@@Z@L@L@L@L@L@L@{@} Error|.............................^You cannot specify more than 5 @L library markers. |.............................^Skipping after error to the next major construct... 12 12| @$@@Z@L@L@L@L@L@L@L@{@} |.^...skipped to here after the error. Error|...............................^You cannot specify more than 5 @L library markers. |...............................^Skipping after error to the next major construct... 13 13| 14 14| 2. Ensure that output macros can't also be library macros. 15 15| 16 16| @O@@L@{@} |.^...skipped to here after the error. |...^Macro definition ignored. Error|...............^Macros attached to output files cannot be library (@L) macros. |...............^Reason: It's important to be able to quickly determine what |...............^output files a FunnelWeb file will produce, and that task is. |...............^made much more difficult if some file macros are overruling |...............^others. To do what you are trying to do, just create a bridge |...............^macro, like this: |...............^ @O@@{@@} |...............^ @$@@L@{void stringhack1()...@} |...............^ ... |...............^ @$@@{void stringhack2()...@} |.................^Skipping after error to the next major construct... 17 17| 18 18| 3. Ensure that you cannot define two macros with both the 19 19| same name and level. Ensure that this works for all levels. 20 20| 21 21| @$@@Z@{@} |.^...skipped to here after the error. 22 22| @$@@Z@{@} Error|...^This macro is already fully defined (at line 21). |...^Macro definition ignored. |..................^Skipping after error to the next major construct... 23 23| 24 24| @$@@Z@L@{@} |.^...skipped to here after the error. 25 25| @$@@Z@L@{@} Error|...^This macro is already fully defined (at line 24). |...^Macro definition ignored. |....................^Skipping after error to the next major construct... 26 26| 27 27| @$@@Z@L@L@{@} |.^...skipped to here after the error. 28 28| @$@@Z@L@L@{@} Error|...^This macro is already fully defined (at line 27). |...^Macro definition ignored. |......................^Skipping after error to the next major construct... 29 29| 30 30| @$@@Z@L@L@L@{@} |.^...skipped to here after the error. 31 31| @$@@Z@L@L@L@{@} Error|...^This macro is already fully defined (at line 30). |...^Macro definition ignored. |........................^Skipping after error to the next major construct... 32 32| 33 33| @$@@Z@L@L@L@L@{@} |.^...skipped to here after the error. 34 34| @$@@Z@L@L@L@L@{@} Error|...^This macro is already fully defined (at line 33). |...^Macro definition ignored. |..........................^Skipping after error to the next major construct... 35 35| 36 36| @$@@Z@L@L@L@L@L@{@} |.^...skipped to here after the error. 37 37| @$@@Z@L@L@L@L@L@{@} Error|...^This macro is already fully defined (at line 36). |...^Macro definition ignored. |............................^Skipping after error to the next major construct... 38 38| 39 39| 4. Ensure that six identical levels can simultaneously exist. 40 40| 41 41| @$@@Z@{@} |.^...skipped to here after the error. 42 42| @$@@Z@L@{@} 43 43| @$@@Z@L@L@{@} 44 44| @$@@Z@L@L@L@{@} 45 45| @$@@Z@L@L@L@L@{@} 46 46| @$@@Z@L@L@L@L@L@{@} 47 47| 48 48| 5. Ensure that different levels can have different modifiers. 49 49| 50 50| @$@@Z@M@{@} 51 51| @$@@Z@L@{@} 52 52| 53 53| 6. Ensure that different levels can have different parameter lists. 54 54| 55 55| @$@@(@3@)@Z@{@} 56 56| @$@@(@1@)@Z@L@{@} 57 57| 58 58| 7. Ensure that different levels can have differently additive. 59 59| 60 60| @$@@Z==@{@} 61 61| @$@@Z@L+=@{@} 62 62| 63 63| End of library construct parser tests. | ------------+------------------------------------------------------------------- There were 9 Errors. ext Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(9,1). Part 1 of level 4 of macro @. TEXT COMPONENT: Pos(L,C)=(9,29). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(10,1). Part 1 of level 5 of macro @. TEXT COMPONENT: Pos(L,C)=(10,31). -- Start of Text Scrap List -- Text scrap[White]="<010> " fw_src/answers/sc01.lis 644 0 0 2150 6717353634 10245 FUNNELWEB LISTING FILE ====================== S: Error opening input file "<>". =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 1 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- There was 1 Severe error. XT COMPONENT: Pos(L,C)=(42,26). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(43,1). Part 1 of level 2 of macro @. TEXT COMPONENT: Pos(L,C)=(43,28). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- MACRO DEFINITION COMPONENT: Pos(L,C)=(44,1). Part 1 of level 3 ofw_src/answers/sc02.lis 644 0 0 3431 6717353634 10251 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 1 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ ========================== Start of MACRO TABLE DUMP =========================== =========================== End of MACRO TABLE DUMP ============================ ========================= Start of DOCUMENT LIST DUMP ========================== ========================== End of DOCUMENT LIST DUMP =========================== E: No macros defined. E: No output files specified. Global Local| Input File ------------+------------------------------------------------------------------- | Warning|.^Input file is empty (not a byte in syte)! ------------+------------------------------------------------------------------- There were 2 Errors and 1 Warning. ------------ 1 1| PR11: Test parsing of library macros. 2 2| 3 3| 1. Ensure that 0..5 Ls are OK, but six or seven is an error. 4 4| 5 5| @$@@Z@{@} 6 6| @$@>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 0A | . | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| <010> 00002 00002| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 2 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[White]="<010> " 0002[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ ========================== Start of MACRO TABLE DUMP =========================== =========================== End of MACRO TABLE DUMP ============================ ========================= Start of DOCUMENT LIST DUMP ========================== TEXT COMPONENT: Pos(L,C)=(1,1). -- Start of Text Scrap List -- Text scrap[White]="<010> " --- End of Text Scrap List --- ========================== End of DOCUMENT LIST DUMP =========================== E: No macros defined. E: No output files specified. Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- There were 2 Errors. |....................^Skipping after error tfw_src/answers/sc04.lis 644 0 0 3751 6717353636 10262 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 0A 0A | .. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| <010> 00002 00002| <010> 00003 00003| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 2 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[White]="<010> <010> " 0003[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ ========================== Start of MACRO TABLE DUMP =========================== =========================== End of MACRO TABLE DUMP ============================ ========================= Start of DOCUMENT LIST DUMP ========================== TEXT COMPONENT: Pos(L,C)=(1,1). -- Start of Text Scrap List -- Text scrap[White]="<010> <010> " --- End of Text Scrap List --- ========================== End of DOCUMENT LIST DUMP =========================== E: No macros defined. E: No output files specified. Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- There were 2 Errors. -----------------------fw_src/answers/sc05.lis 644 0 0 4652 6717353637 10265 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 30 35 3A 20 54 68 69 73 20 69 6E 70 75 74 | SC05: This input | | 20 66 69 6C 65 20 63 6F 6E 74 61 69 6E 73 20 61 | file contains a | | 20 73 69 6E 67 6C 65 20 6C 69 6E 65 20 63 6F 6E | single line con | | 74 61 69 6E 69 6E 67 20 74 68 69 73 20 74 65 78 | taining this tex | | 74 21 0A | t!. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC05: This input file contains a single line containing this text!<010> 00002 00002| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 2 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC05: This input file contains a single line containing this text!<010> " 0002[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ ========================== Start of MACRO TABLE DUMP =========================== =========================== End of MACRO TABLE DUMP ============================ ========================= Start of DOCUMENT LIST DUMP ========================== TEXT COMPONENT: Pos(L,C)=(1,1). -- Start of Text Scrap List -- Text scrap[Grey]="SC05: This input file contains a single line containing this text!<010> " --- End of Text Scrap List --- ========================== End of DOCUMENT LIST DUMP =========================== E: No macros defined. E: No output files specified. Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- There were 2 Errors. fw_src/answers/sc06.lis 644 0 0 6537 6717353640 10264 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 30 36 3A 20 54 65 73 74 20 46 75 6E 6E 65 | SC06: Test Funne | | 6C 57 65 62 20 6F 6E 20 61 20 66 69 6C 65 20 77 | lWeb on a file w | | 68 6F 73 65 20 6C 61 73 74 20 6C 69 6E 65 20 69 | hose last line i | | 73 20 6E 6F 74 20 74 65 72 6D 69 6E 61 74 65 64 | s not terminated | | 20 70 72 6F 70 65 72 6C 79 0A 77 69 74 68 20 61 | properly.with a | | 6E 20 65 6E 64 20 6F 66 20 6C 69 6E 65 20 6D 61 | n end of line ma | | 72 6B 65 72 2E 0A 0A 48 65 72 65 20 69 73 20 74 | rker...Here is t | | 68 65 20 69 6D 70 72 6F 70 65 72 20 74 65 72 6D | he improper term | | 69 6E 61 74 69 6F 6E 21 2D 2D 2D 2D 3E | ination!----> | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC06: Test FunnelWeb on a file whose last line is not terminated properly<010> 00002 00002| with an end of line marker.<010> 00003 00003| <010> 00004 00004| Here is the improper termination!----><010> 00005 00005| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 2 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC06: Test FunnelWeb on a file whose last line is not terminated properly<010> with an end of line marker.<010> <010> Here is the improper termination!----><010> " 0005[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ ========================== Start of MACRO TABLE DUMP =========================== =========================== End of MACRO TABLE DUMP ============================ ========================= Start of DOCUMENT LIST DUMP ========================== TEXT COMPONENT: Pos(L,C)=(1,1). -- Start of Text Scrap List -- Text scrap[Grey]="SC06: Test FunnelWeb on a file whose last line is not terminated properly<010> with an end of line marker.<010> <010> Here is the improper termination!----><010> " --- End of Text Scrap List --- ========================== End of DOCUMENT LIST DUMP =========================== E: No macros defined. E: No output files specified. Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC06: Test FunnelWeb on a file whose last line is not terminated properly 2 2| with an end of line marker. 3 3| 4 4| Here is the improper termination!----> | Warning|.^The last line of the input file was terminated by EOF. |.^An EOL was inserted at the end of the last line. ------------+------------------------------------------------------------------- There were 2 Errors and 1 Warning. MACRO TABLE DUMP ============================ ========================= Start of DOCUMENT LIST DUMP ========================== TEXT COMPONENT: Pos(L,C)=(1,1fw_src/answers/sc07.lis 644 0 0 24352 6717353640 10300 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 30 37 3A 20 50 72 6F 63 65 73 73 69 6E 67 | SC07: Processing | | 20 6F 66 20 6C 6F 6E 67 20 6C 69 6E 65 73 2E 0A | of long lines.. | | 0A 53 43 30 37 2E 31 3A 20 44 65 74 65 63 74 69 | .SC07.1: Detecti | | 6F 6E 20 6F 66 20 61 20 6C 69 6E 65 20 6C 6F 6E | on of a line lon | | 67 65 72 20 74 68 61 6E 20 74 68 65 20 64 65 66 | ger than the def | | 61 75 6C 74 20 6C 69 6D 69 74 2E 0A 0A 54 68 65 | ault limit...The | | 20 64 65 66 61 75 6C 74 20 6C 69 6D 69 74 20 69 | default limit i | | 73 20 38 30 20 63 68 61 72 61 63 74 65 72 73 20 | s 80 characters | | 73 6F 20 77 65 20 77 69 6C 6C 20 74 65 73 74 20 | so we will test | | 6F 6E 20 65 69 74 68 65 72 20 73 69 64 65 20 6F | on either side o | | 66 0A 74 68 61 74 3A 0A 20 20 20 20 20 20 20 20 | f.that:. | | 20 31 20 20 20 20 20 20 20 20 20 32 20 20 20 20 | 1 2 | | 20 20 20 20 20 33 20 20 20 20 20 20 20 20 20 34 | 3 4 | | 20 20 20 20 20 20 20 20 20 35 20 20 20 20 20 20 | 5 | | 20 20 20 36 20 20 20 20 20 20 20 20 20 37 20 20 | 6 7 | | 20 20 20 20 20 20 20 38 0A 31 32 33 34 35 36 37 | 8.1234567 | | 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 | 8901234567890123 | | 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 | 4567890123456789 | | 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 | 0123456789012345 | | 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 | 6789012345678901 | | 32 33 34 35 36 37 38 39 30 0A 54 68 65 20 61 62 | 234567890.The ab | | 6F 76 65 20 73 68 6F 75 6C 64 20 6E 6F 74 20 74 | ove should not t | | 72 69 67 67 65 72 20 61 20 22 6C 69 6E 65 20 74 | rigger a "line t | | 6F 6F 20 6C 6F 6E 67 20 65 72 72 6F 72 22 2E 20 | oo long error". | | 42 75 74 20 74 68 69 73 20 6C 69 6E 65 20 73 68 | But this line sh | | 6F 75 6C 64 21 2D 2D 2D 2D 2D 2D 0A 0A 53 43 30 | ould!------..SC0 | | 37 2E 33 3A 20 54 65 73 74 20 74 68 65 20 6C 69 | 7.3: Test the li | | 6D 69 74 20 73 65 74 20 61 74 20 69 6E 66 69 6E | mit set at infin | | 69 74 79 2E 0A 0A 40 70 20 6D 61 78 69 6D 75 6D | ity...@p maximum | | 5F 69 6E 70 75 74 5F 6C 69 6E 65 5F 6C 65 6E 67 | _input_line_leng | | 74 68 20 3D 20 69 6E 66 69 6E 69 74 79 0A 0A 20 | th = infinity.. | | 20 20 20 20 20 20 20 20 31 20 20 20 20 20 20 20 | 1 | | 20 20 32 20 20 20 20 20 20 20 20 20 33 20 20 20 | 2 3 | | 20 20 20 20 20 20 34 20 20 20 20 20 20 20 20 20 | 4 | | 35 20 20 20 20 20 20 20 20 20 36 20 20 20 20 20 | 5 6 | | 20 20 20 20 37 20 20 20 20 20 20 20 20 20 38 0A | 7 8. | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 0A 54 68 65 20 61 62 6F 76 65 20 73 68 6F 75 6C | .The above shoul | | 64 20 6E 6F 74 20 74 72 69 67 67 65 72 20 61 20 | d not trigger a | | 22 6C 69 6E 65 20 74 6F 6F 20 6C 6F 6E 67 20 65 | "line too long e | | 72 72 6F 72 22 2E 20 4E 6F 72 20 73 68 6F 75 6C | rror". Nor shoul | | 64 20 74 68 69 73 20 6F 6E 65 21 2D 2D 2D 2D 2D | d this one!----- | | 2D 2D 0A 0A 53 43 30 37 2E 33 3A 20 54 65 73 74 | --..SC07.3: Test | | 20 74 68 65 20 6C 69 6D 69 74 20 73 65 74 20 6C | the limit set l | | 6F 77 65 72 2E 0A 0A 40 70 20 6D 61 78 69 6D 75 | ower...@p maximu | | 6D 5F 69 6E 70 75 74 5F 6C 69 6E 65 5F 6C 65 6E | m_input_line_len | | 67 74 68 20 3D 20 35 30 0A 0A 20 20 20 20 20 20 | gth = 50.. | | 20 20 20 31 20 20 20 20 20 20 20 20 20 32 20 20 | 1 2 | | 20 20 20 20 20 20 20 33 20 20 20 20 20 20 20 20 | 3 | | 20 34 20 20 20 20 20 20 20 20 20 35 0A 31 32 33 | 4 5.123 | | 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 | 4567890123456789 | | 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 | 0123456789012345 | | 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 0A | 678901234567890. | | 4E 6F 20 65 72 72 6F 72 20 66 6F 72 20 74 68 65 | No error for the | | 20 61 62 6F 76 65 20 62 75 74 20 74 68 69 73 20 | above but this | | 6C 69 6E 65 20 77 69 6C 6C 21 2D 2D 2D 2D 2D 2D | line will!------ | | 2D 2D 2D 0A | ---. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC07: Processing of long lines.<010> 00002 00002| <010> 00003 00003| SC07.1: Detection of a line longer than the default limit.<010> 00004 00004| <010> 00005 00005| The default limit is 80 characters so we will test on either side of<010> 00006 00006| that:<010> 00007 00007| 1 2 3 4 5 6 7 8<010> 00008 00008| 12345678901234567890123456789012345678901234567890123456789012345678901234567890<010> 00009 00009| The above should not trigger a "line too long error". But this line should!------<010> 00010 00010| <010> 00011 00011| SC07.3: Test the limit set at infinity.<010> 00012 00012| <010> 00013 00013| @p maximum_input_line_length = infinity<010> 00014 00014| <010> 00015 00015| 1 2 3 4 5 6 7 8<010> 00016 00016| 12345678901234567890123456789012345678901234567890123456789012345678901234567890<010> 00017 00017| The above should not trigger a "line too long error". Nor should this one!-------<010> 00018 00018| <010> 00019 00019| SC07.3: Test the limit set lower.<010> 00020 00020| <010> 00021 00021| @p maximum_input_line_length = 50<010> 00022 00022| <010> 00023 00023| 1 2 3 4 5<010> 00024 00024| 12345678901234567890123456789012345678901234567890<010> 00025 00025| No error for the above but this line will!---------<010> 00026 00026| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 4 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC07: Processing of long lines.<010> <010> SC07.1: Detection of a line longer than the default limit.<010> <010> The default limit is 80 characters so we will test on either side of<010> that:<010> 1 2 3 4 5 6 7 8<010> 12345678901234567890123456789012345678901234567890123456789012345678901234567890<010> The above should not trigger a "line too long error". But this line should!------<010> <010> SC07.3: Test the limit set at infinity.<010> <010> " 0014[01]: Text. Text scrap[Grey]="<010> 1 2 3 4 5 6 7 8<010> 12345678901234567890123456789012345678901234567890123456789012345678901234567890<010> The above should not trigger a "line too long error". Nor should this one!-------<010> <010> SC07.3: Test the limit set lower.<010> <010> " 0022[01]: Text. Text scrap[Grey]="<010> 1 2 3 4 5<010> 12345678901234567890123456789012345678901234567890<010> No error for the above but this line will!---------<010> " 0026[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC07: Processing of long lines. 2 2| 3 3| SC07.1: Detection of a line longer than the default limit. 4 4| 5 5| The default limit is 80 characters so we will test on either side of 6 6| that: 7 7| 1 2 3 4 5 6 7 8 8 8| 12345678901234567890123456789012345678901234567890123456789012345678901234567890 9 9| The above should not trigger a "line too long error". But this line should!------ Error|.................................................................................^Input line is too long (this character is the first offender). |.................................................................................^Currently, the maximum allowable input line length is 80. |.................................................................................^Note: You can change this using a pragma directive (@p). 10 10| 11 11| SC07.3: Test the limit set at infinity. 12 12| 13 13| @p maximum_input_line_length = infinity 14 14| 15 15| 1 2 3 4 5 6 7 8 16 16| 12345678901234567890123456789012345678901234567890123456789012345678901234567890 17 17| The above should not trigger a "line too long error". Nor should this one!------- 18 18| 19 19| SC07.3: Test the limit set lower. 20 20| 21 21| @p maximum_input_line_length = 50 22 22| 23 23| 1 2 3 4 5 24 24| 12345678901234567890123456789012345678901234567890 25 25| No error for the above but this line will!--------- Error|...................................................^Input line is too long (this character is the first offender). |...................................................^Currently, the maximum allowable input line length is 50. |...................................................^Note: You can change this using a pragma directive (@p). | ------------+------------------------------------------------------------------- There were 2 Errors. 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 30 37 3A 20 50 72 6F 63 65 73 73 69 6E 67 | SC07: Processing | | 20 6F 66 20 6C 6F 6E 67 20 6C 69 6E 65 73 2E 0A | of long lines.. | | 0A 53 43 30 37fw_src/answers/sc08.lis 644 0 0 10150 6717353641 10271 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 30 38 3A 20 44 65 74 65 63 74 69 6F 6E 20 | SC08: Detection | | 6F 66 20 74 72 61 69 6C 69 6E 67 20 73 70 61 63 | of trailing spac | | 65 73 2E 0A 0A 54 68 69 73 20 6C 69 6E 65 20 68 | es...This line h | | 61 73 20 7A 65 72 6F 20 20 74 72 61 69 6C 69 6E | as zero trailin | | 67 20 73 70 61 63 65 73 20 7C 0A 54 68 69 73 20 | g spaces |.This | | 6C 69 6E 65 20 68 61 73 20 6F 6E 65 20 20 20 74 | line has one t | | 72 61 69 6C 69 6E 67 20 73 70 61 63 65 20 20 7C | railing space | | | 20 0A 54 68 69 73 20 6C 69 6E 65 20 68 61 73 20 | .This line has | | 74 77 6F 20 20 20 74 72 61 69 6C 69 6E 67 20 73 | two trailing s | | 70 61 63 65 73 20 7C 20 20 0A 54 68 69 73 20 6C | paces | .This l | | 69 6E 65 20 68 61 73 20 74 68 72 65 65 20 74 72 | ine has three tr | | 61 69 6C 69 6E 67 20 73 70 61 63 65 73 20 7C 20 | ailing spaces | | | 20 20 0A | . | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC08: Detection of trailing spaces.<010> 00002 00002| <010> 00003 00003| This line has zero trailing spaces |<010> 00004 00004| This line has one trailing space | <010> 00005 00005| This line has two trailing spaces | <010> 00006 00006| This line has three trailing spaces | <010> 00007 00007| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 2 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC08: Detection of trailing spaces.<010> <010> This line has zero trailing spaces |<010> This line has one trailing space | <010> This line has two trailing spaces | <010> This line has three trailing spaces | <010> " 0007[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ ========================== Start of MACRO TABLE DUMP =========================== =========================== End of MACRO TABLE DUMP ============================ ========================= Start of DOCUMENT LIST DUMP ========================== TEXT COMPONENT: Pos(L,C)=(1,1). -- Start of Text Scrap List -- Text scrap[Grey]="SC08: Detection of trailing spaces.<010> <010> This line has zero trailing spaces |<010> This line has one trailing space | <010> This line has two trailing spaces | <010> This line has three trailing spaces | <010> " --- End of Text Scrap List --- ========================== End of DOCUMENT LIST DUMP =========================== E: No macros defined. E: No output files specified. Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC08: Detection of trailing spaces. 2 2| 3 3| This line has zero trailing spaces | 4 4| This line has one trailing space | Warning|......................................^Line has trailing spaces up to and including this space. 5 5| This line has two trailing spaces | Warning|.......................................^Line has trailing spaces up to and including this space. 6 6| This line has three trailing spaces | Warning|........................................^Line has trailing spaces up to and including this space. | ------------+------------------------------------------------------------------- There were 2 Errors and 3 Warnings. 07| 1 2 3 4 5 6 7 8<010> 00008 00008| 12345678901234567890123456789012345678901234567890123456789012345678901234567890<010> 00009 00009| The above should not trigger a "line too long error". But this line should!------<010> 00010 00010| <010> 00011 00011| SC07.3: Test the limit set at infinity.<010> 00012 00012| <010> 00013 00013| @p maximumfw_src/answers/sc09.lis 644 0 0 12146 6717353642 10302 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 30 39 3A 20 44 65 74 65 63 74 69 6F 6E 20 | SC09: Detection | | 6F 66 20 63 6F 6E 74 72 6F 6C 20 63 68 61 72 61 | of control chara | | 63 74 65 72 73 2E 0A 0A 53 43 30 39 2E 31 20 54 | cters...SC09.1 T | | 65 73 74 20 74 68 61 74 20 63 6F 6E 74 72 6F 6C | est that control | | 20 63 68 61 72 61 63 74 65 72 73 20 61 72 65 20 | characters are | | 64 65 74 65 63 74 65 64 20 61 6E 64 20 72 65 70 | detected and rep | | 6C 61 63 65 64 20 62 79 20 22 3F 22 2E 0A 53 43 | laced by "?"..SC | | 30 39 2E 32 20 54 65 73 74 20 6E 6F 6E 20 70 72 | 09.2 Test non pr | | 69 6E 74 61 62 6C 65 20 74 68 61 74 20 68 61 73 | intable that has | | 20 61 20 6D 6E 65 6D 6F 6E 69 63 2E 0A 0A 54 68 | a mnemonic...Th | | 65 72 65 20 69 73 20 61 20 74 61 62 20 62 65 74 | ere is a tab bet | | 77 65 65 6E 20 74 68 65 73 65 20 74 77 6F 20 62 | ween these two b | | 61 72 73 20 7C 09 7C 20 77 68 69 63 68 20 73 68 | ars |.| which sh | | 6F 75 6C 64 20 63 6F 6D 65 20 6F 75 74 20 61 73 | ould come out as | | 20 22 3F 22 2E 0A 54 68 65 20 61 62 6F 76 65 20 | "?"..The above | | 65 72 72 6F 72 20 6D 65 73 73 61 67 65 20 73 68 | error message sh | | 6F 75 6C 64 20 63 6F 6E 74 61 69 6E 20 74 68 65 | ould contain the | | 20 6D 6E 65 6D 6F 6E 69 63 20 22 48 54 22 2E 0A | mnemonic "HT".. | | 0A 53 43 30 39 2E 33 20 54 65 73 74 20 6E 6F 6E | .SC09.3 Test non | | 20 70 72 69 6E 74 61 62 6C 65 20 74 68 61 74 20 | printable that | | 68 61 73 20 6E 6F 20 6D 6E 65 6D 6F 6E 69 63 2E | has no mnemonic. | | 0A 0A 54 68 65 72 65 20 69 73 20 61 20 6E 6F 6E | ..There is a non | | 2D 6D 6E 65 6D 6F 6E 69 63 20 63 6F 6E 74 72 6F | -mnemonic contro | | 6C 20 63 68 61 72 61 63 74 65 72 20 62 65 74 77 | l character betw | | 65 65 6E 20 74 68 65 73 65 20 62 61 72 73 20 7C | een these bars | | | EA 7C 2E 0A | .|.. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC09: Detection of control characters.<010> 00002 00002| <010> 00003 00003| SC09.1 Test that control characters are detected and replaced by "?".<010> 00004 00004| SC09.2 Test non printable that has a mnemonic.<010> 00005 00005| <010> 00006 00006| There is a tab between these two bars |?| which should come out as "?".<010> 00007 00007| The above error message should contain the mnemonic "HT".<010> 00008 00008| <010> 00009 00009| SC09.3 Test non printable that has no mnemonic.<010> 00010 00010| <010> 00011 00011| There is a non-mnemonic control character between these bars |?|.<010> 00012 00012| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 2 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC09: Detection of control characters.<010> <010> SC09.1 Test that control characters are detected and replaced by "?".<010> SC09.2 Test non printable that has a mnemonic.<010> <010> There is a tab between these two bars |?| which should come out as "?".<010> The above error message should contain the mnemonic "HT".<010> <010> SC09.3 Test non printable that has no mnemonic.<010> <010> There is a non-mnemonic control character between these bars |?|.<010> " 0012[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC09: Detection of control characters. 2 2| 3 3| SC09.1 Test that control characters are detected and replaced by "?". 4 4| SC09.2 Test non printable that has a mnemonic. 5 5| 6 6| There is a tab between these two bars |?| which should come out as "?". Error|........................................^Non printable character (Sym=HT, Dec=009, Hex=09, Oct=011). 7 7| The above error message should contain the mnemonic "HT". 8 8| 9 9| SC09.3 Test non printable that has no mnemonic. 10 10| 11 11| There is a non-mnemonic control character between these bars |?|. Error|...............................................................^Non printable character (Sym=, Dec=234, Hex=EA, Oct=352). | ------------+------------------------------------------------------------------- There were 2 Errors. APPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 30 38 3A 20 44 65 74 65 63 74 69 6F 6E 20 | SC08: Detection | | 6F 66 20 74 72 61 69 6C 69 6E 67 20 73 70 61 63 | of trailing spac | | 65 73 2E 0A 0Afw_src/answers/sc10.lis 644 0 0 127526 6717353643 10324 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 63 61 6E 6E 65 72 20 54 65 73 74 3A 20 53 70 | Scanner Test: Sp | | 65 63 69 61 6C 20 53 65 71 75 65 6E 63 65 20 52 | ecial Sequence R | | 65 63 6F 67 6E 69 74 69 6F 6E 0A 3D 3D 3D 3D 3D | ecognition.===== | | 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D | ================ | | 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D | ================ | | 3D 3D 3D 3D 3D 0A 54 68 69 73 20 74 65 73 74 20 | =====.This test | | 74 65 73 74 73 20 74 6F 20 73 65 65 20 74 68 61 | tests to see tha | | 74 20 46 75 6E 6E 65 6C 57 65 62 20 69 73 20 72 | t FunnelWeb is r | | 65 63 6F 67 6E 69 73 69 6E 67 20 74 68 65 20 66 | ecognising the f | | 75 6C 6C 20 73 65 74 20 6F 66 20 73 70 65 63 69 | ull set of speci | | 61 6C 0A 73 65 71 75 65 6E 63 65 73 2E 0A 0A 54 | al.sequences...T | | 75 72 6E 20 4F 66 66 20 74 68 65 20 50 61 72 73 | urn Off the Pars | | 65 72 0A 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D | er.------------- | | 2D 2D 2D 2D 2D 2D 0A 46 69 72 73 74 20 77 65 20 | ------.First we | | 63 61 75 73 65 20 61 20 64 65 6C 69 62 65 72 61 | cause a delibera | | 74 65 20 73 63 61 6E 6E 65 72 20 65 72 72 6F 72 | te scanner error | | 20 73 6F 20 61 73 20 74 6F 20 70 72 65 76 65 6E | so as to preven | | 74 20 74 68 65 20 70 61 72 73 65 72 20 66 72 6F | t the parser fro | | 6D 0A 67 65 6E 65 72 61 74 69 6E 67 20 6C 6F 74 | m.generating lot | | 73 20 6F 66 20 65 72 72 6F 72 73 20 6F 76 65 72 | s of errors over | | 20 74 68 65 20 73 79 6E 74 61 63 74 69 63 20 72 | the syntactic r | | 75 62 62 69 73 68 20 70 72 65 73 65 6E 74 65 64 | ubbish presented | | 20 68 65 72 65 2E 0A 0A 20 20 20 40 20 0A 0A 4C | here... @ ..L | | 69 73 74 20 6F 66 20 41 6C 6C 20 50 6F 73 73 69 | ist of All Possi | | 62 6C 65 20 53 70 65 63 69 61 6C 20 53 65 71 75 | ble Special Sequ | | 65 6E 63 65 73 0A 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D | ences.---------- | | 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D | ---------------- | | 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 0A 54 68 65 | ------------.The | | 20 66 6F 6C 6C 6F 77 69 6E 67 20 69 73 20 61 20 | following is a | | 6C 69 73 74 20 6F 66 20 74 68 65 20 64 65 66 61 | list of the defa | | 75 6C 74 20 73 70 65 63 69 61 6C 20 63 68 61 72 | ult special char | | 61 63 74 65 72 20 66 6F 6C 6C 6F 77 65 64 20 62 | acter followed b | | 79 20 65 61 63 68 20 6F 66 0A 74 68 65 20 41 53 | y each of.the AS | | 43 49 49 20 70 72 69 6E 74 61 62 6C 65 73 2E 0A | CII printables.. | | 30 30 30 20 74 6F 20 30 33 31 20 61 72 65 20 75 | 000 to 031 are u | | 6E 70 72 69 6E 74 61 62 6C 65 20 63 6F 6E 74 72 | nprintable contr | | 6F 6C 20 63 68 61 72 61 63 74 65 72 73 2E 0A 0A | ol characters... | | 30 33 32 20 20 40 20 20 20 20 2D 20 49 4C 4C 45 | 032 @ - ILLE | | 47 41 4C 2E 20 20 28 4E 6F 74 65 3A 20 48 79 70 | GAL. (Note: Hyp | | 68 65 6E 20 69 73 20 6E 65 65 64 65 64 20 74 6F | hen is needed to | | 20 61 76 6F 69 64 20 74 72 61 69 6C 69 6E 67 20 | avoid trailing | | 62 6C 61 6E 6B 73 20 65 72 72 6F 72 2E 29 0A 30 | blanks error.).0 | | 33 33 20 20 40 21 20 20 20 2D 20 43 6F 6D 6D 65 | 33 @! - Comme | | 6E 74 2E 0A 30 33 34 20 20 40 22 20 20 20 2D 20 | nt..034 @" - | | 50 61 72 61 6D 65 74 65 72 20 64 65 6C 69 6D 65 | Parameter delime | | 74 65 72 2E 0A 30 33 35 20 20 40 23 58 20 20 2D | ter..035 @#X - | | 20 53 68 6F 72 74 20 6E 61 6D 65 20 73 65 71 75 | Short name sequ | | 65 6E 63 65 2E 0A 40 24 20 20 20 30 33 36 20 20 | ence..@$ 036 | | 2D 20 44 65 66 69 6E 65 20 6D 61 63 72 6F 2E 20 | - Define macro. | | 48 61 73 20 74 6F 20 62 65 20 61 74 20 73 74 61 | Has to be at sta | | 72 74 20 6F 66 20 6C 69 6E 65 2E 0A 30 33 37 20 | rt of line..037 | | 20 40 25 20 20 20 2D 20 49 4C 4C 45 47 41 4C 2E | @% - ILLEGAL. | | 0A 30 33 38 20 20 40 26 20 20 20 2D 20 49 4C 4C | .038 @& - ILL | | 45 47 41 4C 2E 0A 30 33 39 20 20 40 27 20 20 20 | EGAL..039 @' | | 2D 20 49 4C 4C 45 47 41 4C 2E 0A 30 34 30 20 20 | - ILLEGAL..040 | | 40 28 20 20 20 2D 20 4F 70 65 6E 20 70 61 72 61 | @( - Open para | | 6D 65 74 65 72 20 6C 69 73 74 2E 0A 30 34 31 20 | meter list..041 | | 20 40 29 20 20 20 2D 20 43 6C 6F 73 65 20 70 61 | @) - Close pa | | 72 61 6D 65 74 65 72 20 6C 69 73 74 2E 0A 30 34 | rameter list..04 | | 32 0A 40 2A 20 20 20 20 20 20 20 20 2D 20 4F 6C | 2.@* - Ol | | 64 20 66 61 73 68 69 6F 6E 65 64 20 73 65 63 74 | d fashioned sect | | 69 6F 6E 20 6D 61 72 6B 65 72 20 28 68 61 73 20 | ion marker (has | | 74 6F 20 62 65 20 61 74 20 73 74 61 72 74 20 6F | to be at start o | | 66 20 61 20 6C 69 6E 65 2E 29 2E 0A 30 34 33 20 | f a line.)..043 | | 20 40 2B 20 20 20 2D 20 49 6E 73 65 72 74 20 6E | @+ - Insert n | | 65 77 6C 69 6E 65 2E 0A 30 34 34 20 20 40 2C 20 | ewline..044 @, | | 20 20 2D 20 50 61 72 61 6D 65 74 65 72 20 73 65 | - Parameter se | | 70 61 72 61 74 6F 72 2E 0A 30 34 35 20 20 40 2D | parator..045 @- | | 0A 20 20 20 20 20 20 20 20 20 20 2D 20 49 67 6E | . - Ign | | 6F 72 65 20 65 6E 64 20 6F 66 20 6C 69 6E 65 20 | ore end of line | | 6D 61 72 6B 65 72 20 28 68 61 73 20 74 6F 20 62 | marker (has to b | | 65 20 61 74 20 65 6E 64 20 6F 66 20 6C 69 6E 65 | e at end of line | | 29 2E 0A 30 34 36 20 20 40 2E 20 20 20 2D 20 49 | )..046 @. - I | | 4C 4C 45 47 41 4C 2E 0A 30 34 37 20 20 40 2F 20 | LLEGAL..047 @/ | | 20 20 2D 20 45 6D 70 68 61 73 69 73 65 64 20 74 | - Emphasised t | | 65 78 74 2E 0A 30 34 38 20 20 40 30 20 20 20 2D | ext..048 @0 - | | 20 49 4C 4C 45 47 41 4C 2E 0A 30 34 39 20 20 40 | ILLEGAL..049 @ | | 31 20 20 20 2D 20 46 6F 72 6D 61 6C 20 70 61 72 | 1 - Formal par | | 61 6D 65 74 65 72 20 31 2E 0A 30 35 30 20 20 40 | ameter 1..050 @ | | 32 20 20 20 2D 20 46 6F 72 6D 61 6C 20 70 61 72 | 2 - Formal par | | 61 6D 65 74 65 72 20 32 2E 0A 30 35 31 20 20 40 | ameter 2..051 @ | | 33 20 20 20 2D 20 46 6F 72 6D 61 6C 20 70 61 72 | 3 - Formal par | | 61 6D 65 74 65 72 20 33 2E 0A 30 35 32 20 20 40 | ameter 3..052 @ | | 34 20 20 20 2D 20 46 6F 72 6D 61 6C 20 70 61 72 | 4 - Formal par | | 61 6D 65 74 65 72 20 34 2E 0A 30 35 33 20 20 40 | ameter 4..053 @ | | 35 20 20 20 2D 20 46 6F 72 6D 61 6C 20 70 61 72 | 5 - Formal par | | 61 6D 65 74 65 72 20 35 2E 0A 30 35 34 20 20 40 | ameter 5..054 @ | | 36 20 20 20 2D 20 46 6F 72 6D 61 6C 20 70 61 72 | 6 - Formal par | | 61 6D 65 74 65 72 20 36 2E 0A 30 35 35 20 20 40 | ameter 6..055 @ | | 37 20 20 20 2D 20 46 6F 72 6D 61 6C 20 70 61 72 | 7 - Formal par | | 61 6D 65 74 65 72 20 37 2E 0A 30 35 36 20 20 40 | ameter 7..056 @ | | 38 20 20 20 2D 20 46 6F 72 6D 61 6C 20 70 61 72 | 8 - Formal par | | 61 6D 65 74 65 72 20 38 2E 0A 30 35 37 20 20 40 | ameter 8..057 @ | | 39 20 20 20 2D 20 46 6F 72 6D 61 6C 20 70 61 72 | 9 - Formal par | | 61 6D 65 74 65 72 20 39 2E 0A 30 35 38 20 20 40 | ameter 9..058 @ | | 3A 20 20 20 2D 20 49 4C 4C 45 47 41 4C 2E 0A 30 | : - ILLEGAL..0 | | 35 39 20 20 40 3B 20 20 20 2D 20 49 4C 4C 45 47 | 59 @; - ILLEG | | 41 4C 2E 0A 30 36 30 20 20 40 3C 20 20 20 2D 20 | AL..060 @< - | | 4F 70 65 6E 20 6D 61 63 72 6F 20 6E 61 6D 65 2E | Open macro name. | | 0A 30 36 31 20 20 40 3D 40 20 20 2D 20 53 65 74 | .061 @=@ - Set | | 20 73 70 65 63 69 61 6C 20 63 68 61 72 61 63 74 | special charact | | 65 72 2E 0A 30 36 32 20 20 40 3E 20 20 20 2D 20 | er..062 @> - | | 43 6C 6F 73 65 20 6D 61 63 72 6F 20 6E 61 6D 65 | Close macro name | | 2E 0A 30 36 33 20 20 40 3F 20 20 20 2D 20 49 4C | ..063 @? - IL | | 4C 45 47 41 4C 2E 0A 30 36 34 20 20 40 40 20 20 | LEGAL..064 @@ | | 20 2D 20 49 6E 73 65 72 74 20 73 70 65 63 69 61 | - Insert specia | | 6C 20 63 68 61 72 61 63 74 65 72 20 69 6E 74 6F | l character into | | 20 74 65 78 74 2E 0A 40 41 20 20 30 36 35 20 20 | text..@A 065 | | 20 2D 20 4E 65 77 20 73 65 63 74 69 6F 6E 20 28 | - New section ( | | 6C 65 76 65 6C 20 31 29 2E 20 4D 75 73 74 20 62 | level 1). Must b | | 65 20 61 74 20 73 74 61 72 74 20 6F 66 20 61 20 | e at start of a | | 6C 69 6E 65 2E 0A 40 42 20 20 30 36 36 20 20 20 | line..@B 066 | | 2D 20 4E 65 77 20 73 65 63 74 69 6F 6E 20 28 6C | - New section (l | | 65 76 65 6C 20 32 29 2E 20 4D 75 73 74 20 62 65 | evel 2). Must be | | 20 61 74 20 73 74 61 72 74 20 6F 66 20 61 20 6C | at start of a l | | 69 6E 65 2E 0A 40 43 20 20 30 36 37 20 20 20 2D | ine..@C 067 - | | 20 4E 65 77 20 73 65 63 74 69 6F 6E 20 28 6C 65 | New section (le | | 76 65 6C 20 33 29 2E 20 4D 75 73 74 20 62 65 20 | vel 3). Must be | | 61 74 20 73 74 61 72 74 20 6F 66 20 61 20 6C 69 | at start of a li | | 6E 65 2E 0A 40 44 20 20 30 36 38 20 20 20 2D 20 | ne..@D 068 - | | 4E 65 77 20 73 65 63 74 69 6F 6E 20 28 6C 65 76 | New section (lev | | 65 6C 20 34 29 2E 20 4D 75 73 74 20 62 65 20 61 | el 4). Must be a | | 74 20 73 74 61 72 74 20 6F 66 20 61 20 6C 69 6E | t start of a lin | | 65 2E 0A 40 45 20 20 30 36 39 20 20 20 2D 20 4E | e..@E 069 - N | | 65 77 20 73 65 63 74 69 6F 6E 20 28 6C 65 76 65 | ew section (leve | | 6C 20 35 29 2E 20 4D 75 73 74 20 62 65 20 61 74 | l 5). Must be at | | 20 73 74 61 72 74 20 6F 66 20 61 20 6C 69 6E 65 | start of a line | | 2E 0A 30 37 30 20 20 40 46 20 20 20 2D 20 49 4C | ..070 @F - IL | | 4C 45 47 41 4C 2E 0A 30 37 31 20 20 40 47 20 20 | LEGAL..071 @G | | 20 2D 20 49 4C 4C 45 47 41 4C 2E 0A 30 37 32 20 | - ILLEGAL..072 | | 20 40 48 20 20 20 2D 20 49 4C 4C 45 47 41 4C 2E | @H - ILLEGAL. | | 0A 30 37 33 20 20 40 49 20 20 20 2D 20 49 6E 63 | .073 @I - Inc | | 6C 75 64 65 20 66 69 6C 65 2E 20 57 69 6C 6C 20 | lude file. Will | | 70 72 6F 76 6F 6B 65 20 61 6E 20 65 72 72 6F 72 | provoke an error | | 20 68 65 72 65 20 74 68 6F 75 67 68 2E 0A 30 37 | here though..07 | | 34 20 20 40 4A 20 20 20 2D 20 49 4C 4C 45 47 41 | 4 @J - ILLEGA | | 4C 2E 0A 30 37 35 20 20 40 4B 20 20 20 2D 20 49 | L..075 @K - I | | 4C 4C 45 47 41 4C 2E 0A 30 37 36 20 20 40 4C 20 | LLEGAL..076 @L | | 20 20 2D 20 4C 69 62 72 61 72 79 20 6D 61 63 72 | - Library macr | | 6F 20 74 61 67 2E 0A 30 37 37 20 20 40 4D 20 20 | o tag..077 @M | | 20 2D 20 54 61 67 73 20 6D 61 63 72 6F 20 61 73 | - Tags macro as | | 20 62 65 69 6E 67 20 61 6C 6C 6F 77 65 64 20 74 | being allowed t | | 6F 20 62 65 20 63 61 6C 6C 65 64 20 6D 61 6E 79 | o be called many | | 20 74 69 6D 65 73 2E 0A 30 37 38 20 20 40 4E 20 | times..078 @N | | 20 20 2D 20 49 4C 4C 45 47 41 4C 2E 0A 40 4F 20 | - ILLEGAL..@O | | 20 20 30 37 39 20 20 2D 20 4E 65 77 20 6D 61 63 | 079 - New mac | | 72 6F 20 61 74 74 61 63 68 65 64 20 74 6F 20 6F | ro attached to o | | 75 74 70 75 74 20 66 69 6C 65 2E 20 48 61 73 20 | utput file. Has | | 74 6F 20 62 65 20 61 74 20 73 74 61 72 74 20 6F | to be at start o | | 66 20 6C 69 6E 65 2E 0A 30 38 30 20 20 40 50 20 | f line..080 @P | | 20 20 2D 20 50 72 61 67 6D 61 2E 20 57 69 6C 6C | - Pragma. Will | | 20 63 61 75 73 65 20 65 72 72 6F 72 20 68 65 72 | cause error her | | 65 20 74 68 6F 75 67 68 2E 0A 30 38 31 20 20 40 | e though..081 @ | | 51 20 20 20 2D 20 49 4C 4C 45 47 41 4C 2E 0A 30 | Q - ILLEGAL..0 | | 38 32 20 20 40 52 20 20 20 2D 20 49 4C 4C 45 47 | 82 @R - ILLEG | | 41 4C 2E 0A 30 38 33 20 20 40 53 20 20 20 2D 20 | AL..083 @S - | | 49 4C 4C 45 47 41 4C 2E 0A 30 38 34 20 20 40 54 | ILLEGAL..084 @T | | 20 20 20 2D 20 54 79 70 65 73 65 74 74 65 72 20 | - Typesetter | | 64 69 72 65 63 74 69 76 65 2E 20 57 69 6C 6C 20 | directive. Will | | 63 61 75 73 65 20 61 6E 20 65 72 72 6F 72 20 68 | cause an error h | | 65 72 65 20 74 68 6F 75 67 68 2E 0A 30 38 35 20 | ere though..085 | | 20 40 55 20 20 20 2D 20 49 4C 4C 45 47 41 4C 2E | @U - ILLEGAL. | | 0A 30 38 36 20 20 40 56 20 20 20 2D 20 49 4C 4C | .086 @V - ILL | | 45 47 41 4C 2E 0A 30 38 37 20 20 40 57 20 20 20 | EGAL..087 @W | | 2D 20 49 4C 4C 45 47 41 4C 2E 0A 30 38 38 20 20 | - ILLEGAL..088 | | 40 58 20 20 20 2D 20 49 4C 4C 45 47 41 4C 2E 0A | @X - ILLEGAL.. | | 30 38 39 20 20 40 59 20 20 20 2D 20 49 4C 4C 45 | 089 @Y - ILLE | | 47 41 4C 2E 0A 30 39 30 20 20 40 5A 20 20 20 2D | GAL..090 @Z - | | 20 54 61 67 73 20 6D 61 63 72 6F 20 61 73 20 62 | Tags macro as b | | 65 69 6E 67 20 61 6C 6C 6F 77 65 64 20 74 6F 20 | eing allowed to | | 62 65 20 63 61 6C 6C 65 64 20 7A 65 72 6F 20 74 | be called zero t | | 69 6D 65 73 2E 0A 30 39 31 20 20 40 5B 20 20 20 | imes..091 @[ | | 2D 20 49 4C 4C 45 47 41 4C 2E 0A 30 39 32 20 20 | - ILLEGAL..092 | | 40 5C 20 20 20 2D 20 49 4C 4C 45 47 41 4C 2E 0A | @\ - ILLEGAL.. | | 30 39 33 20 20 40 5D 20 20 20 2D 20 49 4C 4C 45 | 093 @] - ILLE | | 47 41 4C 2E 0A 30 39 34 20 20 40 5E 44 28 30 36 | GAL..094 @^D(06 | | 35 29 20 2D 20 49 6E 73 65 72 74 20 63 6F 6E 74 | 5) - Insert cont | | 72 6F 6C 20 63 68 61 72 61 63 74 65 72 20 69 6E | rol character in | | 74 6F 20 74 65 78 74 0A 30 39 35 20 20 40 5F 20 | to text.095 @_ | | 20 20 2D 20 49 4C 4C 45 47 41 4C 2E 0A 30 39 36 | - ILLEGAL..096 | | 20 20 40 60 20 20 20 2D 20 49 4C 4C 45 47 41 4C | @` - ILLEGAL | | 2E 0A 40 61 20 20 20 30 39 37 20 20 2D 20 4E 65 | ..@a 097 - Ne | | 77 20 73 65 63 74 69 6F 6E 20 28 6C 65 76 65 6C | w section (level | | 20 31 29 2E 20 4D 75 73 74 20 62 65 20 61 74 20 | 1). Must be at | | 73 74 61 72 74 20 6F 66 20 61 20 6C 69 6E 65 2E | start of a line. | | 0A 40 62 20 20 20 30 39 38 20 20 2D 20 4E 65 77 | .@b 098 - New | | 20 73 65 63 74 69 6F 6E 20 28 6C 65 76 65 6C 20 | section (level | | 31 29 2E 20 4D 75 73 74 20 62 65 20 61 74 20 73 | 1). Must be at s | | 74 61 72 74 20 6F 66 20 61 20 6C 69 6E 65 2E 0A | tart of a line.. | | 40 63 20 20 20 30 39 39 20 20 2D 20 4E 65 77 20 | @c 099 - New | | 73 65 63 74 69 6F 6E 20 28 6C 65 76 65 6C 20 31 | section (level 1 | | 29 2E 20 4D 75 73 74 20 62 65 20 61 74 20 73 74 | ). Must be at st | | 61 72 74 20 6F 66 20 61 20 6C 69 6E 65 2E 0A 40 | art of a line..@ | | 64 20 20 20 31 30 30 20 20 2D 20 4E 65 77 20 73 | d 100 - New s | | 65 63 74 69 6F 6E 20 28 6C 65 76 65 6C 20 31 29 | ection (level 1) | | 2E 20 4D 75 73 74 20 62 65 20 61 74 20 73 74 61 | . Must be at sta | | 72 74 20 6F 66 20 61 20 6C 69 6E 65 2E 0A 40 65 | rt of a line..@e | | 20 20 20 31 30 31 20 20 2D 20 4E 65 77 20 73 65 | 101 - New se | | 63 74 69 6F 6E 20 28 6C 65 76 65 6C 20 31 29 2E | ction (level 1). | | 20 4D 75 73 74 20 62 65 20 61 74 20 73 74 61 72 | Must be at star | | 74 20 6F 66 20 61 20 6C 69 6E 65 2E 0A 31 30 32 | t of a line..102 | | 20 20 40 66 20 20 20 2D 20 49 4C 4C 45 47 41 4C | @f - ILLEGAL | | 2E 0A 31 30 33 20 20 40 67 20 20 20 2D 20 49 4C | ..103 @g - IL | | 4C 45 47 41 4C 2E 0A 31 30 34 20 20 40 68 20 20 | LEGAL..104 @h | | 20 2D 20 49 4C 4C 45 47 41 4C 2E 0A 31 30 35 20 | - ILLEGAL..105 | | 20 40 69 20 20 20 2D 20 49 6E 63 6C 75 64 65 20 | @i - Include | | 66 69 6C 65 2E 20 57 69 6C 6C 20 70 72 6F 76 6F | file. Will provo | | 6B 65 20 61 6E 20 65 72 72 6F 72 20 68 65 72 65 | ke an error here | | 20 74 68 6F 75 67 68 2E 0A 31 30 36 20 20 40 6A | though..106 @j | | 20 20 20 2D 20 49 4C 4C 45 47 41 4C 2E 0A 31 30 | - ILLEGAL..10 | | 37 20 20 40 6B 20 20 20 2D 20 49 4C 4C 45 47 41 | 7 @k - ILLEGA | | 4C 2E 0A 31 30 38 20 20 40 6C 20 20 20 2D 20 4C | L..108 @l - L | | 69 62 72 61 72 79 20 6D 61 63 72 6F 20 74 61 67 | ibrary macro tag | | 2E 0A 31 30 39 20 20 40 6D 20 20 20 2D 20 54 61 | ..109 @m - Ta | | 67 73 20 6D 61 63 72 6F 20 61 73 20 62 65 69 6E | gs macro as bein | | 67 20 61 6C 6C 6F 77 65 64 20 74 6F 20 62 65 20 | g allowed to be | | 63 61 6C 6C 65 64 20 6D 61 6E 79 20 74 69 6D 65 | called many time | | 73 2E 0A 31 31 30 20 20 40 6E 20 20 20 2D 20 49 | s..110 @n - I | | 4C 4C 45 47 41 4C 2E 0A 40 4F 20 20 20 31 31 31 | LLEGAL..@O 111 | | 20 20 2D 20 4E 65 77 20 6D 61 63 72 6F 20 61 74 | - New macro at | | 74 61 63 68 65 64 20 74 6F 20 6F 75 74 70 75 74 | tached to output | | 20 66 69 6C 65 2E 20 48 61 73 20 74 6F 20 62 65 | file. Has to be | | 20 61 74 20 73 74 61 72 74 20 6F 66 20 6C 69 6E | at start of lin | | 65 2E 0A 31 31 32 20 20 40 70 20 20 20 2D 20 50 | e..112 @p - P | | 72 61 67 6D 61 2E 20 57 69 6C 6C 20 63 61 75 73 | ragma. Will caus | | 65 20 65 72 72 6F 72 20 68 65 72 65 20 74 68 6F | e error here tho | | 75 67 68 2E 0A 31 31 33 20 20 40 71 20 20 20 2D | ugh..113 @q - | | 20 49 4C 4C 45 47 41 4C 2E 0A 31 31 34 20 20 40 | ILLEGAL..114 @ | | 72 20 20 20 2D 20 49 4C 4C 45 47 41 4C 2E 0A 31 | r - ILLEGAL..1 | | 31 35 20 20 40 73 20 20 20 2D 20 49 4C 4C 45 47 | 15 @s - ILLEG | | 41 4C 2E 0A 31 31 36 20 20 40 74 20 20 20 2D 20 | AL..116 @t - | | 54 79 70 65 73 65 74 74 65 72 20 64 69 72 65 63 | Typesetter direc | | 74 69 76 65 2E 20 57 69 6C 6C 20 63 61 75 73 65 | tive. Will cause | | 20 61 6E 20 65 72 72 6F 72 20 68 65 72 65 20 74 | an error here t | | 68 6F 75 67 68 2E 0A 31 31 37 20 20 40 75 20 20 | hough..117 @u | | 20 2D 20 49 4C 4C 45 47 41 4C 2E 0A 31 31 38 20 | - ILLEGAL..118 | | 20 40 76 20 20 20 2D 20 49 4C 4C 45 47 41 4C 2E | @v - ILLEGAL. | | 0A 31 31 39 20 20 40 77 20 20 20 2D 20 49 4C 4C | .119 @w - ILL | | 45 47 41 4C 2E 0A 31 32 30 20 20 40 78 20 20 20 | EGAL..120 @x | | 2D 20 49 4C 4C 45 47 41 4C 2E 0A 31 32 31 20 20 | - ILLEGAL..121 | | 40 79 20 20 20 2D 20 49 4C 4C 45 47 41 4C 2E 0A | @y - ILLEGAL.. | | 31 32 32 20 20 40 7A 20 20 20 2D 20 54 61 67 73 | 122 @z - Tags | | 20 6D 61 63 72 6F 20 61 73 20 62 65 69 6E 67 20 | macro as being | | 61 6C 6C 6F 77 65 64 20 74 6F 20 62 65 20 63 61 | allowed to be ca | | 6C 6C 65 64 20 7A 65 72 6F 20 74 69 6D 65 73 2E | lled zero times. | | 0A 31 32 33 20 20 40 7B 20 20 20 2D 20 4F 70 65 | .123 @{ - Ope | | 6E 20 6D 61 63 72 6F 20 62 6F 64 79 2E 0A 31 32 | n macro body..12 | | 34 20 20 40 7C 20 20 20 2D 20 49 4C 4C 45 47 41 | 4 @| - ILLEGA | | 4C 2E 0A 31 32 35 20 20 40 7D 20 20 20 2D 20 43 | L..125 @} - C | | 6C 6F 73 65 20 6D 61 63 72 6F 20 62 6F 64 79 2E | lose macro body. | | 0A 31 32 36 20 20 40 7E 20 20 20 2D 20 49 4C 4C | .126 @~ - ILL | | 45 47 41 4C 2E 0A 31 32 37 20 74 6F 20 32 35 35 | EGAL..127 to 255 | | 20 61 72 65 20 6E 6F 74 20 73 74 61 6E 64 61 72 | are not standar | | 64 20 70 72 69 6E 74 61 62 6C 65 20 41 53 43 49 | d printable ASCI | | 49 20 63 68 61 72 61 63 74 65 72 73 2E 0A | I characters.. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| Scanner Test: Special Sequence Recognition<010> 00002 00002| ==========================================<010> 00003 00003| This test tests to see that FunnelWeb is recognising the full set of special<010> 00004 00004| sequences.<010> 00005 00005| <010> 00006 00006| Turn Off the Parser<010> 00007 00007| -------------------<010> 00008 00008| First we cause a deliberate scanner error so as to prevent the parser from<010> 00009 00009| generating lots of errors over the syntactic rubbish presented here.<010> 00010 00010| <010> 00011 00011| @ <010> 00012 00012| <010> 00013 00013| List of All Possible Special Sequences<010> 00014 00014| --------------------------------------<010> 00015 00015| The following is a list of the default special character followed by each of<010> 00016 00016| the ASCII printables.<010> 00017 00017| 000 to 031 are unprintable control characters.<010> 00018 00018| <010> 00019 00019| 032 @ - ILLEGAL. (Note: Hyphen is needed to avoid trailing blanks error.)<010> 00020 00020| 033 @! - Comment.<010> 00021 00021| 034 @" - Parameter delimeter.<010> 00022 00022| 035 @#X - Short name sequence.<010> 00023 00023| @$ 036 - Define macro. Has to be at start of line.<010> 00024 00024| 037 @% - ILLEGAL.<010> 00025 00025| 038 @& - ILLEGAL.<010> 00026 00026| 039 @' - ILLEGAL.<010> 00027 00027| 040 @( - Open parameter list.<010> 00028 00028| 041 @) - Close parameter list.<010> 00029 00029| 042<010> 00030 00030| @* - Old fashioned section marker (has to be at start of a line.).<010> 00031 00031| 043 @+ - Insert newline.<010> 00032 00032| 044 @, - Parameter separator.<010> 00033 00033| 045 @-<010> 00034 00034| - Ignore end of line marker (has to be at end of line).<010> 00035 00035| 046 @. - ILLEGAL.<010> 00036 00036| 047 @/ - Emphasised text.<010> 00037 00037| 048 @0 - ILLEGAL.<010> 00038 00038| 049 @1 - Formal parameter 1.<010> 00039 00039| 050 @2 - Formal parameter 2.<010> 00040 00040| 051 @3 - Formal parameter 3.<010> 00041 00041| 052 @4 - Formal parameter 4.<010> 00042 00042| 053 @5 - Formal parameter 5.<010> 00043 00043| 054 @6 - Formal parameter 6.<010> 00044 00044| 055 @7 - Formal parameter 7.<010> 00045 00045| 056 @8 - Formal parameter 8.<010> 00046 00046| 057 @9 - Formal parameter 9.<010> 00047 00047| 058 @: - ILLEGAL.<010> 00048 00048| 059 @; - ILLEGAL.<010> 00049 00049| 060 @< - Open macro name.<010> 00050 00050| 061 @=@ - Set special character.<010> 00051 00051| 062 @> - Close macro name.<010> 00052 00052| 063 @? - ILLEGAL.<010> 00053 00053| 064 @@ - Insert special character into text.<010> 00054 00054| @A 065 - New section (level 1). Must be at start of a line.<010> 00055 00055| @B 066 - New section (level 2). Must be at start of a line.<010> 00056 00056| @C 067 - New section (level 3). Must be at start of a line.<010> 00057 00057| @D 068 - New section (level 4). Must be at start of a line.<010> 00058 00058| @E 069 - New section (level 5). Must be at start of a line.<010> 00059 00059| 070 @F - ILLEGAL.<010> 00060 00060| 071 @G - ILLEGAL.<010> 00061 00061| 072 @H - ILLEGAL.<010> 00062 00062| 073 @I - Include file. Will provoke an error here though.<010> 00063 00063| 074 @J - ILLEGAL.<010> 00064 00064| 075 @K - ILLEGAL.<010> 00065 00065| 076 @L - Library macro tag.<010> 00066 00066| 077 @M - Tags macro as being allowed to be called many times.<010> 00067 00067| 078 @N - ILLEGAL.<010> 00068 00068| @O 079 - New macro attached to output file. Has to be at start of line.<010> 00069 00069| 080 @P - Pragma. Will cause error here though.<010> 00070 00070| 081 @Q - ILLEGAL.<010> 00071 00071| 082 @R - ILLEGAL.<010> 00072 00072| 083 @S - ILLEGAL.<010> 00073 00073| 084 @T - Typesetter directive. Will cause an error here though.<010> 00074 00074| 085 @U - ILLEGAL.<010> 00075 00075| 086 @V - ILLEGAL.<010> 00076 00076| 087 @W - ILLEGAL.<010> 00077 00077| 088 @X - ILLEGAL.<010> 00078 00078| 089 @Y - ILLEGAL.<010> 00079 00079| 090 @Z - Tags macro as being allowed to be called zero times.<010> 00080 00080| 091 @[ - ILLEGAL.<010> 00081 00081| 092 @\ - ILLEGAL.<010> 00082 00082| 093 @] - ILLEGAL.<010> 00083 00083| 094 @^D(065) - Insert control character into text<010> 00084 00084| 095 @_ - ILLEGAL.<010> 00085 00085| 096 @` - ILLEGAL.<010> 00086 00086| @a 097 - New section (level 1). Must be at start of a line.<010> 00087 00087| @b 098 - New section (level 1). Must be at start of a line.<010> 00088 00088| @c 099 - New section (level 1). Must be at start of a line.<010> 00089 00089| @d 100 - New section (level 1). Must be at start of a line.<010> 00090 00090| @e 101 - New section (level 1). Must be at start of a line.<010> 00091 00091| 102 @f - ILLEGAL.<010> 00092 00092| 103 @g - ILLEGAL.<010> 00093 00093| 104 @h - ILLEGAL.<010> 00094 00094| 105 @i - Include file. Will provoke an error here though.<010> 00095 00095| 106 @j - ILLEGAL.<010> 00096 00096| 107 @k - ILLEGAL.<010> 00097 00097| 108 @l - Library macro tag.<010> 00098 00098| 109 @m - Tags macro as being allowed to be called many times.<010> 00099 00099| 110 @n - ILLEGAL.<010> 00100 00100| @O 111 - New macro attached to output file. Has to be at start of line.<010> 00101 00101| 112 @p - Pragma. Will cause error here though.<010> 00102 00102| 113 @q - ILLEGAL.<010> 00103 00103| 114 @r - ILLEGAL.<010> 00104 00104| 115 @s - ILLEGAL.<010> 00105 00105| 116 @t - Typesetter directive. Will cause an error here though.<010> 00106 00106| 117 @u - ILLEGAL.<010> 00107 00107| 118 @v - ILLEGAL.<010> 00108 00108| 119 @w - ILLEGAL.<010> 00109 00109| 120 @x - ILLEGAL.<010> 00110 00110| 121 @y - ILLEGAL.<010> 00111 00111| 122 @z - Tags macro as being allowed to be called zero times.<010> 00112 00112| 123 @{ - Open macro body.<010> 00113 00113| 124 @| - ILLEGAL.<010> 00114 00114| 125 @} - Close macro body.<010> 00115 00115| 126 @~ - ILLEGAL.<010> 00116 00116| 127 to 255 are not standard printable ASCII characters.<010> 00117 00117| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 139 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="Scanner Test: Special Sequence Recognition<010> ==========================================<010> This test tests to see that FunnelWeb is recognising the full set of special<010> sequences.<010> <010> Turn Off the Parser<010> -------------------<010> First we cause a deliberate scanner error so as to prevent the parser from<010> generating lots of errors over the syntactic rubbish presented here.<010> <010> " 0011[06]: Text. Text scrap[Grey]="<010> <010> List of All Possible Special Sequences<010> --------------------------------------<010> The following is a list of the default special character followed by each of<010> the ASCII printables.<010> 000 to 031 are unprintable control characters.<010> <010> 032 " 0019[08]: Text. Text scrap[Grey]=" - ILLEGAL. (Note: Hyphen is needed to avoid trailing blanks error.)<010> 033 " 0021[01]: Text. Text scrap[Grey]="034 " 0021[06]: @" Quote. 0021[08]: Text. Text scrap[Grey]=" - Parameter delimeter.<010> 035 " 0022[06]: @# Name. Character='X'. 0022[09]: Text. Text scrap[Grey]=" - Short name sequence.<010> " 0023[01]: @$ Macro defn. 0023[03]: Text. Text scrap[Grey]=" 036 - Define macro. Has to be at start of line.<010> 037 " 0024[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 038 " 0025[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 039 " 0026[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 040 " 0027[06]: @( Open param. 0027[08]: Text. Text scrap[Grey]=" - Open parameter list.<010> 041 " 0028[06]: @} Close param. 0028[08]: Text. Text scrap[Grey]=" - Close parameter list.<010> 042<010> " 0030[03]: Text. Text scrap[Grey]=" - Old fashioned section marker (has to be at start of a line.).<010> 043 " 0031[06]: Text. Text scrap[White]="<010> " 0031[08]: Text. Text scrap[Grey]=" - Insert newline.<010> 044 " 0032[06]: @, Comma. 0032[08]: Text. Text scrap[Grey]=" - Parameter separator.<010> 045 " 0034[01]: Text. Text scrap[Grey]=" - Ignore end of line marker (has to be at end of line).<010> 046 " 0035[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 047 " 0036[06]: @/ Emphasise. 0036[08]: Text. Text scrap[Grey]=" - Emphasised text.<010> 048 " 0037[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 049 " 0038[06]: @n Parameter. Parameterno=1. 0038[08]: Text. Text scrap[Grey]=" - Formal parameter 1.<010> 050 " 0039[06]: @n Parameter. Parameterno=2. 0039[08]: Text. Text scrap[Grey]=" - Formal parameter 2.<010> 051 " 0040[06]: @n Parameter. Parameterno=3. 0040[08]: Text. Text scrap[Grey]=" - Formal parameter 3.<010> 052 " 0041[06]: @n Parameter. Parameterno=4. 0041[08]: Text. Text scrap[Grey]=" - Formal parameter 4.<010> 053 " 0042[06]: @n Parameter. Parameterno=5. 0042[08]: Text. Text scrap[Grey]=" - Formal parameter 5.<010> 054 " 0043[06]: @n Parameter. Parameterno=6. 0043[08]: Text. Text scrap[Grey]=" - Formal parameter 6.<010> 055 " 0044[06]: @n Parameter. Parameterno=7. 0044[08]: Text. Text scrap[Grey]=" - Formal parameter 7.<010> 056 " 0045[06]: @n Parameter. Parameterno=8. 0045[08]: Text. Text scrap[Grey]=" - Formal parameter 8.<010> 057 " 0046[06]: @n Parameter. Parameterno=9. 0046[08]: Text. Text scrap[Grey]=" - Formal parameter 9.<010> 058 " 0047[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 059 " 0048[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 060 " 0049[06]: @< Open name. 0049[08]: Text. Text scrap[Grey]=" - Open macro name.<010> 061 " 0050[09]: Text. Text scrap[Grey]=" - Set special character.<010> 062 " 0051[06]: @> Close name. 0051[08]: Text. Text scrap[Grey]=" - Close macro name.<010> 063 " 0052[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 064 " 0053[06]: Text. Text scrap[Grey]="@" 0053[08]: Text. Text scrap[Grey]=" - Insert special character into text.<010> " 0054[01]: @A New section (Level 1). 0054[03]: Text. Text scrap[Grey]=" 065 - New section (level 1). Must be at start of a line.<010> " 0055[01]: @B New section (Level 2). 0055[03]: Text. Text scrap[Grey]=" 066 - New section (level 2). Must be at start of a line.<010> " 0056[01]: @C New section (Level 3). 0056[03]: Text. Text scrap[Grey]=" 067 - New section (level 3). Must be at start of a line.<010> " 0057[01]: @D New section (Level 4). 0057[03]: Text. Text scrap[Grey]=" 068 - New section (level 4). Must be at start of a line.<010> " 0058[01]: @E New section (Level 5). 0058[03]: Text. Text scrap[Grey]=" 069 - New section (level 5). Must be at start of a line.<010> 070 " 0059[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 071 " 0060[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 072 " 0061[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 073 " 0063[01]: Text. Text scrap[Grey]="074 " 0063[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 075 " 0064[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 076 " 0065[06]: @L Library. 0065[08]: Text. Text scrap[Grey]=" - Library macro tag.<010> 077 " 0066[06]: @M Many calls. 0066[08]: Text. Text scrap[Grey]=" - Tags macro as being allowed to be called many times.<010> 078 " 0067[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> " 0068[01]: @F File defn. 0068[03]: Text. Text scrap[Grey]=" 079 - New macro attached to output file. Has to be at start of line.<010> 080 " 0070[01]: Text. Text scrap[Grey]="081 " 0070[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 082 " 0071[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 083 " 0072[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 084 " 0074[01]: Text. Text scrap[Grey]="085 " 0074[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 086 " 0075[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 087 " 0076[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 088 " 0077[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 089 " 0078[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 090 " 0079[06]: @Z Zero calls. 0079[08]: Text. Text scrap[Grey]=" - Tags macro as being allowed to be called zero times.<010> 091 " 0080[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 092 " 0081[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 093 " 0082[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 094 " 0083[06]: Text. Text scrap[Grey]="A" 0083[14]: Text. Text scrap[Grey]=" - Insert control character into text<010> 095 " 0084[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 096 " 0085[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> " 0086[01]: @A New section (Level 1). 0086[03]: Text. Text scrap[Grey]=" 097 - New section (level 1). Must be at start of a line.<010> " 0087[01]: @B New section (Level 2). 0087[03]: Text. Text scrap[Grey]=" 098 - New section (level 1). Must be at start of a line.<010> " 0088[01]: @C New section (Level 3). 0088[03]: Text. Text scrap[Grey]=" 099 - New section (level 1). Must be at start of a line.<010> " 0089[01]: @D New section (Level 4). 0089[03]: Text. Text scrap[Grey]=" 100 - New section (level 1). Must be at start of a line.<010> " 0090[01]: @E New section (Level 5). 0090[03]: Text. Text scrap[Grey]=" 101 - New section (level 1). Must be at start of a line.<010> 102 " 0091[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 103 " 0092[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 104 " 0093[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 105 " 0095[01]: Text. Text scrap[Grey]="106 " 0095[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 107 " 0096[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 108 " 0097[06]: @L Library. 0097[08]: Text. Text scrap[Grey]=" - Library macro tag.<010> 109 " 0098[06]: @M Many calls. 0098[08]: Text. Text scrap[Grey]=" - Tags macro as being allowed to be called many times.<010> 110 " 0099[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> " 0100[01]: @F File defn. 0100[03]: Text. Text scrap[Grey]=" 111 - New macro attached to output file. Has to be at start of line.<010> 112 " 0102[01]: Text. Text scrap[Grey]="113 " 0102[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 114 " 0103[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 115 " 0104[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 116 " 0106[01]: Text. Text scrap[Grey]="117 " 0106[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 118 " 0107[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 119 " 0108[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 120 " 0109[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 121 " 0110[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 122 " 0111[06]: @Z Zero calls. 0111[08]: Text. Text scrap[Grey]=" - Tags macro as being allowed to be called zero times.<010> 123 " 0112[06]: @{ Open defn. 0112[08]: Text. Text scrap[Grey]=" - Open macro body.<010> 124 " 0113[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 125 " 0114[06]: @} Close defn. 0114[08]: Text. Text scrap[Grey]=" - Close macro body.<010> 126 " 0115[08]: Text. Text scrap[Grey]=" - ILLEGAL.<010> 127 to 255 are not standard printable ASCII characters.<010> " 0117[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). Global Local| Input File ------------+------------------------------------------------------------------- 1 1| Scanner Test: Special Sequence Recognition 2 2| ========================================== 3 3| This test tests to see that FunnelWeb is recognising the full set of special 4 4| sequences. 5 5| 6 6| Turn Off the Parser 7 7| ------------------- 8 8| First we cause a deliberate scanner error so as to prevent the parser from 9 9| generating lots of errors over the syntactic rubbish presented here. 10 10| 11 11| @ Error|....^ is not a legal special sequence. Warning|.....^Line has trailing spaces up to and including this space. 12 12| 13 13| List of All Possible Special Sequences 14 14| -------------------------------------- 15 15| The following is a list of the default special character followed by each of 16 16| the ASCII printables. 17 17| 000 to 031 are unprintable control characters. 18 18| 19 19| 032 @ - ILLEGAL. (Note: Hyphen is needed to avoid trailing blanks error.) Error|......^ is not a legal special sequence. 20 20| 033 @! - Comment. 21 21| 034 @" - Parameter delimeter. 22 22| 035 @#X - Short name sequence. 23 23| @$ 036 - Define macro. Has to be at start of line. 24 24| 037 @% - ILLEGAL. Error|......^Unknown special sequence. 25 25| 038 @& - ILLEGAL. Error|......^Unknown special sequence. 26 26| 039 @' - ILLEGAL. Error|......^Unknown special sequence. 27 27| 040 @( - Open parameter list. 28 28| 041 @) - Close parameter list. 29 29| 042 30 30| @* - Old fashioned section marker (has to be at start of a line.). Error|.^Unknown special sequence. 31 31| 043 @+ - Insert newline. 32 32| 044 @, - Parameter separator. 33 33| 045 @- 34 34| - Ignore end of line marker (has to be at end of line). 35 35| 046 @. - ILLEGAL. Error|......^Unknown special sequence. 36 36| 047 @/ - Emphasised text. 37 37| 048 @0 - ILLEGAL. Error|......^Unknown special sequence. 38 38| 049 @1 - Formal parameter 1. 39 39| 050 @2 - Formal parameter 2. 40 40| 051 @3 - Formal parameter 3. 41 41| 052 @4 - Formal parameter 4. 42 42| 053 @5 - Formal parameter 5. 43 43| 054 @6 - Formal parameter 6. 44 44| 055 @7 - Formal parameter 7. 45 45| 056 @8 - Formal parameter 8. 46 46| 057 @9 - Formal parameter 9. 47 47| 058 @: - ILLEGAL. Error|......^Unknown special sequence. 48 48| 059 @; - ILLEGAL. Error|......^Unknown special sequence. 49 49| 060 @< - Open macro name. 50 50| 061 @=@ - Set special character. 51 51| 062 @> - Close macro name. 52 52| 063 @? - ILLEGAL. Error|......^Unknown special sequence. 53 53| 064 @@ - Insert special character into text. 54 54| @A 065 - New section (level 1). Must be at start of a line. 55 55| @B 066 - New section (level 2). Must be at start of a line. 56 56| @C 067 - New section (level 3). Must be at start of a line. 57 57| @D 068 - New section (level 4). Must be at start of a line. 58 58| @E 069 - New section (level 5). Must be at start of a line. 59 59| 070 @F - ILLEGAL. Error|......^Unknown special sequence. 60 60| 071 @G - ILLEGAL. Error|......^Unknown special sequence. 61 61| 072 @H - ILLEGAL. Error|......^Unknown special sequence. 62 62| 073 @I - Include file. Will provoke an error here though. Error|......^Include sequence must be at the beginning of a line. |......^Include ignored. 63 63| 074 @J - ILLEGAL. Error|......^Unknown special sequence. 64 64| 075 @K - ILLEGAL. Error|......^Unknown special sequence. 65 65| 076 @L - Library macro tag. 66 66| 077 @M - Tags macro as being allowed to be called many times. 67 67| 078 @N - ILLEGAL. Error|......^Unknown special sequence. 68 68| @O 079 - New macro attached to output file. Has to be at start of line. 69 69| 080 @P - Pragma. Will cause error here though. Error|......^Pragma sequence @p must be at the start of a line. |......^The rest of this line will be ignored. Error|......^Unrecognised pragma. Possible legal pragmas are: |......^ @p indentation = none | blank |......^ @p maximum_input_line_length = |infinity |......^ @p maximum_output_line_length = |infinity |......^ @p typesetter = none | tex |......^The blanks between arguments are important. |......^Pragma ignored. 70 70| 081 @Q - ILLEGAL. Error|......^Unknown special sequence. 71 71| 082 @R - ILLEGAL. Error|......^Unknown special sequence. 72 72| 083 @S - ILLEGAL. Error|......^Unknown special sequence. 73 73| 084 @T - Typesetter directive. Will cause an error here though. Error|......^Typesetter directive @t must be at the start of a line. |......^The rest of this line will be ignored. Error|......^Unrecognised typesetter directive. Legal ones are: |......^ @t new_page |......^ @t table_of_contents |......^ @t title |......^ @t vskip mm |......^The blanks between arguments are important. |......^Typesetter directive ignored. 74 74| 085 @U - ILLEGAL. Error|......^Unknown special sequence. 75 75| 086 @V - ILLEGAL. Error|......^Unknown special sequence. 76 76| 087 @W - ILLEGAL. Error|......^Unknown special sequence. 77 77| 088 @X - ILLEGAL. Error|......^Unknown special sequence. 78 78| 089 @Y - ILLEGAL. Error|......^Unknown special sequence. 79 79| 090 @Z - Tags macro as being allowed to be called zero times. 80 80| 091 @[ - ILLEGAL. Error|......^Unknown special sequence. 81 81| 092 @\ - ILLEGAL. Error|......^Unknown special sequence. 82 82| 093 @] - ILLEGAL. Error|......^Unknown special sequence. 83 83| 094 @^D(065) - Insert control character into text 84 84| 095 @_ - ILLEGAL. Error|......^Unknown special sequence. 85 85| 096 @` - ILLEGAL. Error|......^Unknown special sequence. 86 86| @a 097 - New section (level 1). Must be at start of a line. 87 87| @b 098 - New section (level 1). Must be at start of a line. 88 88| @c 099 - New section (level 1). Must be at start of a line. 89 89| @d 100 - New section (level 1). Must be at start of a line. 90 90| @e 101 - New section (level 1). Must be at start of a line. 91 91| 102 @f - ILLEGAL. Error|......^Unknown special sequence. 92 92| 103 @g - ILLEGAL. Error|......^Unknown special sequence. 93 93| 104 @h - ILLEGAL. Error|......^Unknown special sequence. 94 94| 105 @i - Include file. Will provoke an error here though. Error|......^Include sequence must be at the beginning of a line. |......^Include ignored. 95 95| 106 @j - ILLEGAL. Error|......^Unknown special sequence. 96 96| 107 @k - ILLEGAL. Error|......^Unknown special sequence. 97 97| 108 @l - Library macro tag. 98 98| 109 @m - Tags macro as being allowed to be called many times. 99 99| 110 @n - ILLEGAL. Error|......^Unknown special sequence. 100 100| @O 111 - New macro attached to output file. Has to be at start of line. 101 101| 112 @p - Pragma. Will cause error here though. Error|......^Pragma sequence @p must be at the start of a line. |......^The rest of this line will be ignored. Error|......^Unrecognised pragma. Possible legal pragmas are: |......^ @p indentation = none | blank |......^ @p maximum_input_line_length = |infinity |......^ @p maximum_output_line_length = |infinity |......^ @p typesetter = none | tex |......^The blanks between arguments are important. |......^Pragma ignored. 102 102| 113 @q - ILLEGAL. Error|......^Unknown special sequence. 103 103| 114 @r - ILLEGAL. Error|......^Unknown special sequence. 104 104| 115 @s - ILLEGAL. Error|......^Unknown special sequence. 105 105| 116 @t - Typesetter directive. Will cause an error here though. Error|......^Typesetter directive @t must be at the start of a line. |......^The rest of this line will be ignored. Error|......^Unrecognised typesetter directive. Legal ones are: |......^ @t new_page |......^ @t table_of_contents |......^ @t title |......^ @t vskip mm |......^The blanks between arguments are important. |......^Typesetter directive ignored. 106 106| 117 @u - ILLEGAL. Error|......^Unknown special sequence. 107 107| 118 @v - ILLEGAL. Error|......^Unknown special sequence. 108 108| 119 @w - ILLEGAL. Error|......^Unknown special sequence. 109 109| 120 @x - ILLEGAL. Error|......^Unknown special sequence. 110 110| 121 @y - ILLEGAL. Error|......^Unknown special sequence. 111 111| 122 @z - Tags macro as being allowed to be called zero times. 112 112| 123 @{ - Open macro body. 113 113| 124 @| - ILLEGAL. Error|......^Unknown special sequence. 114 114| 125 @} - Close macro body. 115 115| 126 @~ - ILLEGAL. Error|......^Unknown special sequence. 116 116| 127 to 255 are not standard printable ASCII characters. | ------------+------------------------------------------------------------------- There were 56 Errors and 1 Warning. tests to see that FunnelWeb is recognising the full set of special 4 4| sequences. 5 5| 6 6| Turn Off the Parser 7 7| --------------fw_src/answers/sc11.lis 644 0 0 207506 6717353651 10321 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 31 31 3A 20 53 79 6E 74 61 78 20 6F 66 20 | SC11: Syntax of | | 74 68 65 20 69 6E 63 6C 75 64 65 20 70 72 61 67 | the include prag | | 6D 61 2E 0A 0A 31 2E 20 54 65 73 74 20 69 6E 63 | ma...1. Test inc | | 6C 75 64 65 20 70 72 61 67 6D 61 20 6E 6F 74 20 | lude pragma not | | 61 74 20 73 74 61 72 74 20 6F 66 20 6C 69 6E 65 | at start of line | | 2E 0A 0A 20 20 20 40 69 0A 0A 32 2E 20 54 65 73 | ... @i..2. Tes | | 74 20 41 54 69 20 6E 6F 74 20 66 6F 6C 6C 6F 77 | t ATi not follow | | 65 64 20 62 79 20 61 20 62 6C 61 6E 6B 2E 0A 0A | ed by a blank... | | 40 69 78 0A 0A 33 2E 20 54 65 73 74 20 69 6E 63 | @ix..3. Test inc | | 6C 75 64 65 20 66 69 6C 65 6E 61 6D 65 20 69 73 | lude filename is | | 20 74 6F 6F 20 6C 6F 6E 67 2E 20 54 68 65 20 6D | too long. The m | | 61 78 69 6D 75 6D 20 6F 6E 20 74 68 65 20 4D 61 | aximum on the Ma | | 63 69 6E 74 6F 73 68 20 69 73 0A 20 20 20 32 35 | cintosh is. 25 | | 35 20 62 75 74 20 73 6F 6D 65 20 55 6E 69 78 20 | 5 but some Unix | | 73 79 73 74 65 6D 73 20 68 61 76 65 20 61 20 6D | systems have a m | | 61 78 69 6D 75 6D 20 6F 66 20 34 30 39 35 20 73 | aximum of 4095 s | | 6F 20 77 65 20 68 61 76 65 20 74 6F 0A 20 20 20 | o we have to. | | 6D 61 6B 65 20 74 68 65 20 6C 69 6E 65 20 74 68 | make the line th | | 61 74 20 6C 6F 6E 67 20 74 6F 20 64 6F 20 74 68 | at long to do th | | 69 73 20 74 65 73 74 2E 20 54 68 65 20 61 63 74 | is test. The act | | 75 61 6C 20 6C 65 6E 67 74 68 20 75 73 65 64 0A | ual length used. | | 20 20 20 69 73 20 34 34 30 30 20 69 6E 20 74 68 | is 4400 in th | | 65 20 66 69 6C 65 6E 61 6D 65 20 69 74 73 65 6C | e filename itsel | | 66 2E 0A 0A 20 20 20 20 20 20 20 20 20 20 20 20 | f... | | 31 20 20 20 20 20 20 20 20 20 32 20 20 20 20 20 | 1 2 | | 20 20 20 20 33 20 20 20 20 20 20 20 20 20 34 20 | 3 4 | | 20 20 20 20 20 20 20 20 35 20 20 20 20 20 20 20 | 5 | | 20 20 36 20 20 20 20 20 20 20 20 20 37 20 20 20 | 6 7 | | 20 20 20 20 20 20 38 20 20 20 20 20 20 20 20 20 | 8 | | 39 20 20 20 20 20 20 20 20 20 30 20 20 20 20 20 | 9 0 | | 20 20 20 20 31 20 20 20 20 20 20 20 20 20 32 20 | 1 2 | | 20 20 20 20 20 20 20 20 33 20 20 20 20 20 20 20 | 3 | | 20 20 34 20 20 20 20 20 20 20 20 20 35 20 20 20 | 4 5 | | 20 20 20 20 20 20 36 20 20 20 20 20 20 20 20 20 | 6 | | 37 20 20 20 20 20 20 20 20 20 38 20 20 20 20 20 | 7 8 | | 20 20 20 20 39 20 20 20 20 20 20 20 20 20 30 20 | 9 0 | | 20 20 20 20 20 20 20 20 31 20 20 20 20 20 20 20 | 1 | | 20 20 32 20 20 20 20 20 20 20 20 20 33 20 20 20 | 2 3 | | 20 20 20 20 20 20 34 20 20 20 20 20 20 20 20 20 | 4 | | 35 20 20 20 20 20 20 20 20 20 36 20 20 20 20 20 | 5 6 | | 20 20 20 20 37 20 20 20 20 20 20 20 20 20 38 20 | 7 8 | | 20 20 20 20 20 20 20 20 39 20 20 20 20 20 20 20 | 9 | | 20 20 30 20 20 20 20 20 20 20 20 20 31 20 20 20 | 0 1 | | 20 20 20 20 20 20 32 20 20 20 20 20 20 20 20 20 | 2 | | 33 20 20 20 20 20 20 20 20 20 34 20 20 20 20 20 | 3 4 | | 20 20 20 20 35 20 20 20 20 20 20 20 20 20 36 20 | 5 6 | | 20 20 20 20 20 20 20 20 37 20 20 20 20 20 20 20 | 7 | | 20 20 38 20 20 20 20 20 20 20 20 20 39 20 20 20 | 8 9 | | 20 20 20 20 20 20 30 20 20 20 20 20 20 20 20 20 | 0 | | 31 20 20 20 20 20 20 20 20 20 32 20 20 20 20 20 | 1 2 | | 20 20 20 20 33 20 20 20 20 20 20 20 20 20 34 20 | 3 4 | | 20 20 20 20 20 20 20 20 35 20 20 20 20 20 20 20 | 5 | | 20 20 36 20 20 20 20 20 20 20 20 20 37 20 20 20 | 6 7 | | 20 20 20 20 20 20 38 20 20 20 20 20 20 20 20 20 | 8 | | 39 20 20 20 20 20 20 20 20 20 30 20 20 20 20 20 | 9 0 | | 20 20 20 20 31 20 20 20 20 20 20 20 20 20 32 20 | 1 2 | | 20 20 20 20 20 20 20 20 33 20 20 20 20 20 20 20 | 3 | | 20 20 34 20 20 20 20 20 20 20 20 20 35 20 20 20 | 4 5 | | 20 20 20 20 20 20 36 20 20 20 20 20 20 20 20 20 | 6 | | 37 20 20 20 20 20 20 20 20 20 38 20 20 20 20 20 | 7 8 | | 20 20 20 20 39 20 20 20 20 20 20 20 20 20 30 20 | 9 0 | | 20 20 20 20 20 20 20 20 31 20 20 20 20 20 20 20 | 1 | | 20 20 32 20 20 20 20 20 20 20 20 20 33 20 20 20 | 2 3 | | 20 20 20 20 20 20 34 20 20 20 20 20 20 20 20 20 | 4 | | 35 20 20 20 20 20 20 20 20 20 36 20 20 20 20 20 | 5 6 | | 20 20 20 20 37 20 20 20 20 20 20 20 20 20 38 20 | 7 8 | | 20 20 20 20 20 20 20 20 39 20 20 20 20 20 20 20 | 9 | | 20 20 30 20 20 20 20 20 20 20 20 20 31 20 20 20 | 0 1 | | 20 20 20 20 20 20 32 20 20 20 20 20 20 20 20 20 | 2 | | 33 20 20 20 20 20 20 20 20 20 34 20 20 20 20 20 | 3 4 | | 20 20 20 20 35 20 20 20 20 20 20 20 20 20 36 20 | 5 6 | | 20 20 20 20 20 20 20 20 37 20 20 20 20 20 20 20 | 7 | | 20 20 38 20 20 20 20 20 20 20 20 20 39 20 20 20 | 8 9 | | 20 20 20 20 20 20 30 20 20 20 20 20 20 20 20 20 | 0 | | 31 20 20 20 20 20 20 20 20 20 32 20 20 20 20 20 | 1 2 | | 20 20 20 20 33 20 20 20 20 20 20 20 20 20 34 20 | 3 4 | | 20 20 20 20 20 20 20 20 35 20 20 20 20 20 20 20 | 5 | | 20 20 36 20 20 20 20 20 20 20 20 20 37 20 20 20 | 6 7 | | 20 20 20 20 20 20 38 20 20 20 20 20 20 20 20 20 | 8 | | 39 20 20 20 20 20 20 20 20 20 30 20 20 20 20 20 | 9 0 | | 20 20 20 20 31 20 20 20 20 20 20 20 20 20 32 20 | 1 2 | | 20 20 20 20 20 20 20 20 33 20 20 20 20 20 20 20 | 3 | | 20 20 34 20 20 20 20 20 20 20 20 20 35 20 20 20 | 4 5 | | 20 20 20 20 20 20 36 20 20 20 20 20 20 20 20 20 | 6 | | 37 20 20 20 20 20 20 20 20 20 38 20 20 20 20 20 | 7 8 | | 20 20 20 20 39 20 20 20 20 20 20 20 20 20 30 20 | 9 0 | | 20 20 20 20 20 20 20 20 31 20 20 20 20 20 20 20 | 1 | | 20 20 32 20 20 20 20 20 20 20 20 20 33 20 20 20 | 2 3 | | 20 20 20 20 20 20 34 20 20 20 20 20 20 20 20 20 | 4 | | 35 20 20 20 20 20 20 20 20 20 36 20 20 20 20 20 | 5 6 | | 20 20 20 20 37 20 20 20 20 20 20 20 20 20 38 20 | 7 8 | | 20 20 20 20 20 20 20 20 39 20 20 20 20 20 20 20 | 9 | | 20 20 30 20 20 20 20 20 20 20 20 20 31 20 20 20 | 0 1 | | 20 20 20 20 20 20 32 20 20 20 20 20 20 20 20 20 | 2 | | 33 20 20 20 20 20 20 20 20 20 34 20 20 20 20 20 | 3 4 | | 20 20 20 20 35 20 20 20 20 20 20 20 20 20 36 20 | 5 6 | | 20 20 20 20 20 20 20 20 37 20 20 20 20 20 20 20 | 7 | | 20 20 38 20 20 20 20 20 20 20 20 20 39 20 20 20 | 8 9 | | 20 20 20 20 20 20 30 20 20 20 20 20 20 20 20 20 | 0 | | 31 20 20 20 20 20 20 20 20 20 32 20 20 20 20 20 | 1 2 | | 20 20 20 20 33 20 20 20 20 20 20 20 20 20 34 20 | 3 4 | | 20 20 20 20 20 20 20 20 35 20 20 20 20 20 20 20 | 5 | | 20 20 36 20 20 20 20 20 20 20 20 20 37 20 20 20 | 6 7 | | 20 20 20 20 20 20 38 20 20 20 20 20 20 20 20 20 | 8 | | 39 20 20 20 20 20 20 20 20 20 30 20 20 20 20 20 | 9 0 | | 20 20 20 20 31 20 20 20 20 20 20 20 20 20 32 20 | 1 2 | | 20 20 20 20 20 20 20 20 33 20 20 20 20 20 20 20 | 3 | | 20 20 34 20 20 20 20 20 20 20 20 20 35 20 20 20 | 4 5 | | 20 20 20 20 20 20 36 20 20 20 20 20 20 20 20 20 | 6 | | 37 20 20 20 20 20 20 20 20 20 38 20 20 20 20 20 | 7 8 | | 20 20 20 20 39 20 20 20 20 20 20 20 20 20 30 20 | 9 0 | | 20 20 20 20 20 20 20 20 31 20 20 20 20 20 20 20 | 1 | | 20 20 32 20 20 20 20 20 20 20 20 20 33 20 20 20 | 2 3 | | 20 20 20 20 20 20 34 20 20 20 20 20 20 20 20 20 | 4 | | 35 20 20 20 20 20 20 20 20 20 36 20 20 20 20 20 | 5 6 | | 20 20 20 20 37 20 20 20 20 20 20 20 20 20 38 20 | 7 8 | | 20 20 20 20 20 20 20 20 39 20 20 20 20 20 20 20 | 9 | | 20 20 30 20 20 20 20 20 20 20 20 20 31 20 20 20 | 0 1 | | 20 20 20 20 20 20 32 20 20 20 20 20 20 20 20 20 | 2 | | 33 20 20 20 20 20 20 20 20 20 34 20 20 20 20 20 | 3 4 | | 20 20 20 20 35 20 20 20 20 20 20 20 20 20 36 20 | 5 6 | | 20 20 20 20 20 20 20 20 37 20 20 20 20 20 20 20 | 7 | | 20 20 38 20 20 20 20 20 20 20 20 20 39 20 20 20 | 8 9 | | 20 20 20 20 20 20 30 20 20 20 20 20 20 20 20 20 | 0 | | 31 20 20 20 20 20 20 20 20 20 32 20 20 20 20 20 | 1 2 | | 20 20 20 20 33 20 20 20 20 20 20 20 20 20 34 20 | 3 4 | | 20 20 20 20 20 20 20 20 35 20 20 20 20 20 20 20 | 5 | | 20 20 36 20 20 20 20 20 20 20 20 20 37 20 20 20 | 6 7 | | 20 20 20 20 20 20 38 20 20 20 20 20 20 20 20 20 | 8 | | 39 20 20 20 20 20 20 20 20 20 30 20 20 20 20 20 | 9 0 | | 20 20 20 20 31 20 20 20 20 20 20 20 20 20 32 20 | 1 2 | | 20 20 20 20 20 20 20 20 33 20 20 20 20 20 20 20 | 3 | | 20 20 34 20 20 20 20 20 20 20 20 20 35 20 20 20 | 4 5 | | 20 20 20 20 20 20 36 20 20 20 20 20 20 20 20 20 | 6 | | 37 20 20 20 20 20 20 20 20 20 38 20 20 20 20 20 | 7 8 | | 20 20 20 20 39 20 20 20 20 20 20 20 20 20 30 20 | 9 0 | | 20 20 20 20 20 20 20 20 31 20 20 20 20 20 20 20 | 1 | | 20 20 32 20 20 20 20 20 20 20 20 20 33 20 20 20 | 2 3 | | 20 20 20 20 20 20 34 20 20 20 20 20 20 20 20 20 | 4 | | 35 20 20 20 20 20 20 20 20 20 36 20 20 20 20 20 | 5 6 | | 20 20 20 20 37 20 20 20 20 20 20 20 20 20 38 20 | 7 8 | | 20 20 20 20 20 20 20 20 39 20 20 20 20 20 20 20 | 9 | | 20 20 30 20 20 20 20 20 20 20 20 20 31 20 20 20 | 0 1 | | 20 20 20 20 20 20 32 20 20 20 20 20 20 20 20 20 | 2 | | 33 20 20 20 20 20 20 20 20 20 34 20 20 20 20 20 | 3 4 | | 20 20 20 20 35 20 20 20 20 20 20 20 20 20 36 20 | 5 6 | | 20 20 20 20 20 20 20 20 37 20 20 20 20 20 20 20 | 7 | | 20 20 38 20 20 20 20 20 20 20 20 20 39 20 20 20 | 8 9 | | 20 20 20 20 20 20 30 20 20 20 20 20 20 20 20 20 | 0 | | 31 20 20 20 20 20 20 20 20 20 32 20 20 20 20 20 | 1 2 | | 20 20 20 20 33 20 20 20 20 20 20 20 20 20 34 20 | 3 4 | | 20 20 20 20 20 20 20 20 35 20 20 20 20 20 20 20 | 5 | | 20 20 36 20 20 20 20 20 20 20 20 20 37 20 20 20 | 6 7 | | 20 20 20 20 20 20 38 20 20 20 20 20 20 20 20 20 | 8 | | 39 20 20 20 20 20 20 20 20 20 30 20 20 20 20 20 | 9 0 | | 20 20 20 20 31 20 20 20 20 20 20 20 20 20 32 20 | 1 2 | | 20 20 20 20 20 20 20 20 33 20 20 20 20 20 20 20 | 3 | | 20 20 34 20 20 20 20 20 20 20 20 20 35 20 20 20 | 4 5 | | 20 20 20 20 20 20 36 20 20 20 20 20 20 20 20 20 | 6 | | 37 20 20 20 20 20 20 20 20 20 38 20 20 20 20 20 | 7 8 | | 20 20 20 20 39 20 20 20 20 20 20 20 20 20 30 20 | 9 0 | | 20 20 20 20 20 20 20 20 20 20 20 31 20 20 20 20 | 1 | | 20 20 20 20 20 32 20 20 20 20 20 20 20 20 20 33 | 2 3 | | 20 20 20 20 20 20 20 20 20 34 20 20 20 20 20 20 | 4 | | 20 20 20 35 20 20 20 20 20 20 20 20 20 36 20 20 | 5 6 | | 20 20 20 20 20 20 20 37 20 20 20 20 20 20 20 20 | 7 | | 20 38 20 20 20 20 20 20 20 20 20 39 20 20 20 20 | 8 9 | | 20 20 20 20 20 30 20 20 20 20 20 20 20 20 20 31 | 0 1 | | 20 20 20 20 20 20 20 20 20 32 20 20 20 20 20 20 | 2 | | 20 20 20 33 20 20 20 20 20 20 20 20 20 34 20 20 | 3 4 | | 20 20 20 20 20 20 20 35 20 20 20 20 20 20 20 20 | 5 | | 20 36 20 20 20 20 20 20 20 20 20 37 20 20 20 20 | 6 7 | | 20 20 20 20 20 38 20 20 20 20 20 20 20 20 20 39 | 8 9 | | 20 20 20 20 20 20 20 20 20 30 20 20 20 20 20 20 | 0 | | 20 20 20 31 20 20 20 20 20 20 20 20 20 32 20 20 | 1 2 | | 20 20 20 20 20 20 20 33 20 20 20 20 20 20 20 20 | 3 | | 20 34 20 20 20 20 20 20 20 20 20 35 20 20 20 20 | 4 5 | | 20 20 20 20 20 36 20 20 20 20 20 20 20 20 20 37 | 6 7 | | 20 20 20 20 20 20 20 20 20 38 20 20 20 20 20 20 | 8 | | 20 20 20 39 20 20 20 20 20 20 20 20 20 30 20 20 | 9 0 | | 20 20 20 20 20 20 20 31 20 20 20 20 20 20 20 20 | 1 | | 20 32 20 20 20 20 20 20 20 20 20 33 20 20 20 20 | 2 3 | | 20 20 20 20 20 34 20 20 20 20 20 20 20 20 20 35 | 4 5 | | 20 20 20 20 20 20 20 20 20 36 20 20 20 20 20 20 | 6 | | 20 20 20 37 20 20 20 20 20 20 20 20 20 38 20 20 | 7 8 | | 20 20 20 20 20 20 20 39 20 20 20 20 20 20 20 20 | 9 | | 20 30 20 20 20 20 20 20 20 20 20 31 20 20 20 20 | 0 1 | | 20 20 20 20 20 32 20 20 20 20 20 20 20 20 20 33 | 2 3 | | 20 20 20 20 20 20 20 20 20 34 20 20 20 20 20 20 | 4 | | 20 20 20 35 20 20 20 20 20 20 20 20 20 36 20 20 | 5 6 | | 20 20 20 20 20 20 20 37 20 20 20 20 20 20 20 20 | 7 | | 20 38 20 20 20 20 20 20 20 20 20 39 20 20 20 20 | 8 9 | | 20 20 20 20 20 30 20 20 20 20 20 20 20 20 20 31 | 0 1 | | 20 20 20 20 20 20 20 20 20 32 20 20 20 20 20 20 | 2 | | 20 20 20 33 20 20 20 20 20 20 20 20 20 34 20 20 | 3 4 | | 20 20 20 20 20 20 20 35 20 20 20 20 20 20 20 20 | 5 | | 20 36 20 20 20 20 20 20 20 20 20 37 20 20 20 20 | 6 7 | | 20 20 20 20 20 38 20 20 20 20 20 20 20 20 20 39 | 8 9 | | 20 20 20 20 20 20 20 20 20 30 20 20 20 20 20 20 | 0 | | 20 20 20 31 20 20 20 20 20 20 20 20 20 32 20 20 | 1 2 | | 20 20 20 20 20 20 20 33 20 20 20 20 20 20 20 20 | 3 | | 20 34 20 20 20 20 20 20 20 20 20 35 20 20 20 20 | 4 5 | | 20 20 20 20 20 36 20 20 20 20 20 20 20 20 20 37 | 6 7 | | 20 20 20 20 20 20 20 20 20 38 20 20 20 20 20 20 | 8 | | 20 20 20 39 20 20 20 20 20 20 20 20 20 30 20 20 | 9 0 | | 20 20 20 20 20 20 20 31 20 20 20 20 20 20 20 20 | 1 | | 20 32 20 20 20 20 20 20 20 20 20 33 20 20 20 20 | 2 3 | | 20 20 20 20 20 34 20 20 20 20 20 20 20 20 20 35 | 4 5 | | 20 20 20 20 20 20 20 20 20 36 20 20 20 20 20 20 | 6 | | 20 20 20 37 20 20 20 20 20 20 20 20 20 38 20 20 | 7 8 | | 20 20 20 20 20 20 20 39 20 20 20 20 20 20 20 20 | 9 | | 20 30 20 20 20 20 20 20 20 20 20 31 20 20 20 20 | 0 1 | | 20 20 20 20 20 32 20 20 20 20 20 20 20 20 20 33 | 2 3 | | 20 20 20 20 20 20 20 20 20 34 20 20 20 20 20 20 | 4 | | 20 20 20 35 20 20 20 20 20 20 20 20 20 36 20 20 | 5 6 | | 20 20 20 20 20 20 20 37 20 20 20 20 20 20 20 20 | 7 | | 20 38 20 20 20 20 20 20 20 20 20 39 20 20 20 20 | 8 9 | | 20 20 20 20 20 30 20 20 20 20 20 20 20 20 20 31 | 0 1 | | 20 20 20 20 20 20 20 20 20 32 20 20 20 20 20 20 | 2 | | 20 20 20 33 20 20 20 20 20 20 20 20 20 34 20 20 | 3 4 | | 20 20 20 20 20 20 20 35 20 20 20 20 20 20 20 20 | 5 | | 20 36 20 20 20 20 20 20 20 20 20 37 20 20 20 20 | 6 7 | | 20 20 20 20 20 38 20 20 20 20 20 20 20 20 20 39 | 8 9 | | 20 20 20 20 20 20 20 20 20 30 20 20 20 20 20 20 | 0 | | 20 20 20 31 20 20 20 20 20 20 20 20 20 32 20 20 | 1 2 | | 20 20 20 20 20 20 20 33 20 20 20 20 20 20 20 20 | 3 | | 20 34 20 20 20 20 20 20 20 20 20 35 20 20 20 20 | 4 5 | | 20 20 20 20 20 36 20 20 20 20 20 20 20 20 20 37 | 6 7 | | 20 20 20 20 20 20 20 20 20 38 20 20 20 20 20 20 | 8 | | 20 20 20 39 20 20 20 20 20 20 20 20 20 30 20 20 | 9 0 | | 20 20 20 20 20 20 20 31 20 20 20 20 20 20 20 20 | 1 | | 20 32 20 20 20 20 20 20 20 20 20 33 20 20 20 20 | 2 3 | | 20 20 20 20 20 34 20 20 20 20 20 20 20 20 20 35 | 4 5 | | 20 20 20 20 20 20 20 20 20 36 20 20 20 20 20 20 | 6 | | 20 20 20 37 20 20 20 20 20 20 20 20 20 38 20 20 | 7 8 | | 20 20 20 20 20 20 20 39 20 20 20 20 20 20 20 20 | 9 | | 20 30 20 20 20 20 20 20 20 20 20 31 20 20 20 20 | 0 1 | | 20 20 20 20 20 32 20 20 20 20 20 20 20 20 20 33 | 2 3 | | 20 20 20 20 20 20 20 20 20 34 20 20 20 20 20 20 | 4 | | 20 20 20 35 20 20 20 20 20 20 20 20 20 36 20 20 | 5 6 | | 20 20 20 20 20 20 20 37 20 20 20 20 20 20 20 20 | 7 | | 20 38 20 20 20 20 20 20 20 20 20 39 20 20 20 20 | 8 9 | | 20 20 20 20 20 30 20 20 20 20 20 20 20 20 20 31 | 0 1 | | 20 20 20 20 20 20 20 20 20 32 20 20 20 20 20 20 | 2 | | 20 20 20 33 20 20 20 20 20 20 20 20 20 34 20 20 | 3 4 | | 20 20 20 20 20 20 20 35 20 20 20 20 20 20 20 20 | 5 | | 20 36 20 20 20 20 20 20 20 20 20 37 20 20 20 20 | 6 7 | | 20 20 20 20 20 38 20 20 20 20 20 20 20 20 20 39 | 8 9 | | 20 20 20 20 20 20 20 20 20 30 20 20 20 20 20 20 | 0 | | 20 20 20 31 20 20 20 20 20 20 20 20 20 32 20 20 | 1 2 | | 20 20 20 20 20 20 20 33 20 20 20 20 20 20 20 20 | 3 | | 20 34 20 20 20 20 20 20 20 20 20 35 20 20 20 20 | 4 5 | | 20 20 20 20 20 36 20 20 20 20 20 20 20 20 20 37 | 6 7 | | 20 20 20 20 20 20 20 20 20 38 20 20 20 20 20 20 | 8 | | 20 20 20 39 20 20 20 20 20 20 20 20 20 30 20 20 | 9 0 | | 20 20 20 20 20 20 20 31 20 20 20 20 20 20 20 20 | 1 | | 20 32 20 20 20 20 20 20 20 20 20 33 20 20 20 20 | 2 3 | | 20 20 20 20 20 34 20 20 20 20 20 20 20 20 20 35 | 4 5 | | 20 20 20 20 20 20 20 20 20 36 20 20 20 20 20 20 | 6 | | 20 20 20 37 20 20 20 20 20 20 20 20 20 38 20 20 | 7 8 | | 20 20 20 20 20 20 20 39 20 20 20 20 20 20 20 20 | 9 | | 20 30 20 20 20 20 20 20 20 20 20 31 20 20 20 20 | 0 1 | | 20 20 20 20 20 32 20 20 20 20 20 20 20 20 20 33 | 2 3 | | 20 20 20 20 20 20 20 20 20 34 20 20 20 20 20 20 | 4 | | 20 20 20 35 20 20 20 20 20 20 20 20 20 36 20 20 | 5 6 | | 20 20 20 20 20 20 20 37 20 20 20 20 20 20 20 20 | 7 | | 20 38 20 20 20 20 20 20 20 20 20 39 20 20 20 20 | 8 9 | | 20 20 20 20 20 30 20 20 20 20 20 20 20 20 20 31 | 0 1 | | 20 20 20 20 20 20 20 20 20 32 20 20 20 20 20 20 | 2 | | 20 20 20 33 20 20 20 20 20 20 20 20 20 34 20 20 | 3 4 | | 20 20 20 20 20 20 20 35 20 20 20 20 20 20 20 20 | 5 | | 20 36 20 20 20 20 20 20 20 20 20 37 20 20 20 20 | 6 7 | | 20 20 20 20 20 38 20 20 20 20 20 20 20 20 20 39 | 8 9 | | 20 20 20 20 20 20 20 20 20 30 20 20 20 20 20 20 | 0 | | 20 20 20 31 20 20 20 20 20 20 20 20 20 32 20 20 | 1 2 | | 20 20 20 20 20 20 20 33 20 20 20 20 20 20 20 20 | 3 | | 20 34 20 20 20 20 20 20 20 20 20 35 20 20 20 20 | 4 5 | | 20 20 20 20 20 36 20 20 20 20 20 20 20 20 20 37 | 6 7 | | 20 20 20 20 20 20 20 20 20 38 20 20 20 20 20 20 | 8 | | 20 20 20 39 20 20 20 20 20 20 20 20 20 30 20 20 | 9 0 | | 20 20 20 20 20 20 20 31 20 20 20 20 20 20 20 20 | 1 | | 20 32 20 20 20 20 20 20 20 20 20 33 20 20 20 20 | 2 3 | | 20 20 20 20 20 34 20 20 20 20 20 20 20 20 20 35 | 4 5 | | 20 20 20 20 20 20 20 20 20 36 20 20 20 20 20 20 | 6 | | 20 20 20 37 20 20 20 20 20 20 20 20 20 38 20 20 | 7 8 | | 20 20 20 20 20 20 20 39 20 20 20 20 20 20 20 20 | 9 | | 20 30 20 20 20 20 20 20 20 20 20 31 20 20 20 20 | 0 1 | | 20 20 20 20 20 32 20 20 20 20 20 20 20 20 20 33 | 2 3 | | 20 20 20 20 20 20 20 20 20 34 20 20 20 20 20 20 | 4 | | 20 20 20 35 20 20 20 20 20 20 20 20 20 36 20 20 | 5 6 | | 20 20 20 20 20 20 20 37 20 20 20 20 20 20 20 20 | 7 | | 20 38 20 20 20 20 20 20 20 20 20 39 20 20 20 20 | 8 9 | | 20 20 20 20 20 30 20 20 20 20 20 20 20 20 20 31 | 0 1 | | 20 20 20 20 20 20 20 20 20 32 20 20 20 20 20 20 | 2 | | 20 20 20 33 20 20 20 20 20 20 20 20 20 34 20 20 | 3 4 | | 20 20 20 20 20 20 20 35 20 20 20 20 20 20 20 20 | 5 | | 20 36 20 20 20 20 20 20 20 20 20 37 20 20 20 20 | 6 7 | | 20 20 20 20 20 38 20 20 20 20 20 20 20 20 20 39 | 8 9 | | 20 20 20 20 20 20 20 20 20 30 0A 40 69 20 31 32 | 0.@i 12 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 0A 0A | 78901234567890.. | | 34 2E 20 49 6E 63 6C 75 64 65 20 70 72 61 67 6D | 4. Include pragm | | 61 20 68 61 73 20 61 6E 20 65 6D 70 74 79 20 66 | a has an empty f | | 69 6C 65 6E 61 6D 65 2E 20 4E 6F 74 65 3A 20 42 | ilename. Note: B | | 65 63 61 75 73 65 20 74 68 65 20 41 54 69 20 68 | ecause the ATi h | | 61 73 20 74 6F 20 62 65 0A 20 20 20 66 6F 6C 6C | as to be. foll | | 6F 77 65 64 20 62 79 20 61 20 62 6C 61 6E 6B 2C | owed by a blank, | | 20 77 65 20 68 61 76 65 20 74 6F 20 69 6E 63 75 | we have to incu | | 72 20 61 20 74 72 61 69 6C 69 6E 67 20 62 6C 61 | r a trailing bla | | 6E 6B 20 65 72 72 6F 72 20 68 65 72 65 20 69 6E | nk error here in | | 0A 20 20 20 6F 72 64 65 72 20 74 6F 20 70 72 6F | . order to pro | | 76 6F 6B 65 20 74 68 65 20 65 72 72 6F 72 20 77 | voke the error w | | 65 20 72 65 61 6C 6C 79 20 77 61 6E 74 20 74 6F | e really want to | | 20 73 65 65 2E 0A 0A 40 69 20 0A 0A | see...@i .. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC11: Syntax of the include pragma.<010> 00002 00002| <010> 00003 00003| 1. Test include pragma not at start of line.<010> 00004 00004| <010> 00005 00005| @i<010> 00006 00006| <010> 00007 00007| 2. Test ATi not followed by a blank.<010> 00008 00008| <010> 00009 00009| @ix<010> 00010 00010| <010> 00011 00011| 3. Test include filename is too long. The maximum on the Macintosh is<010> 00012 00012| 255 but some Unix systems have a maximum of 4095 so we have to<010> 00013 00013| make the line that long to do this test. The actual length used<010> 00014 00014| is 4400 in the filename itself.<010> 00015 00015| <010> 00016 00016| 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0<010> 00017 00017| @i 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890<010> 00018 00018| <010> 00019 00019| 4. Include pragma has an empty filename. Note: Because the ATi has to be<010> 00020 00020| followed by a blank, we have to incur a trailing blank error here in<010> 00021 00021| order to provoke the error we really want to see.<010> 00022 00022| <010> 00023 00023| @i <010> 00024 00024| <010> 00025 00025| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 6 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC11: Syntax of the include pragma.<010> <010> 1. Test include pragma not at start of line.<010> <010> " 0006[01]: Text. Text scrap[Grey]="<010> 2. Test ATi not followed by a blank.<010> <010> " 0010[01]: Text. Text scrap[Grey]="<010> 3. Test include filename is too long. The maximum on the Macintosh is<010> 255 but some Unix systems have a maximum of 4095 so we have to<010> make the line that long to do this test. The actual length used<010> is 4400 in the filename itself.<010> <010> 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0<010> " 0018[01]: Text. Text scrap[Grey]="<010> 4. Include pragma has an empty filename. Note: Because the ATi has to be<010> followed by a blank, we have to incur a trailing blank error here in<010> order to provoke the error we really want to see.<010> <010> " 0024[01]: Text. Text scrap[White]="<010> " 0025[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC11: Syntax of the include pragma. 2 2| 3 3| 1. Test include pragma not at start of line. 4 4| 5 5| @i Error|....^Include sequence must be at the beginning of a line. |....^Include ignored. 6 6| 7 7| 2. Test ATi not followed by a blank. 8 8| 9 9| @ix Error|...^Include sequence (@i) must be followed by a blank. |...^Example include: @i macros.fwi |...^Include ignored. 10 10| 11 11| 3. Test include filename is too long. The maximum on the Macintosh is 12 12| 255 but some Unix systems have a maximum of 4095 so we have to 13 13| make the line that long to do this test. The actual length used 14 14| is 4400 in the filename itself. 15 15| 16 16| 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 Error|.................................................................................^Input line is too long (this character is the first offender). |.................................................................................^Currently, the maximum allowable input line length is 80. |.................................................................................^Note: You can change this using a pragma directive (@p). 17 17| @i 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 Error|.^This include command's file specification is too long. |.^The maximum file name length is <> characters. |.^Include ignored. Error|.................................................................................^Input line is too long (this character is the first offender). |.................................................................................^Currently, the maximum allowable input line length is 80. |.................................................................................^Note: You can change this using a pragma directive (@p). 18 18| 19 19| 4. Include pragma has an empty filename. Note: Because the ATi has to be 20 20| followed by a blank, we have to incur a trailing blank error here in 21 21| order to provoke the error we really want to see. 22 22| 23 23| @i Warning|...^Line has trailing spaces up to and including this space. Error|....^Expecting the name of a file to include. 24 24| | ------------+------------------------------------------------------------------- There were 6 Errors and 1 Warning. 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 fw_src/answers/sc12.lis 644 0 0 6253 6717353654 10261 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 31 32 3A 20 49 6E 63 6C 75 64 65 20 66 69 | SC12: Include fi | | 6C 65 20 63 61 6E 6E 6F 74 20 62 65 20 66 6F 75 | le cannot be fou | | 6E 64 2E 0A 54 65 73 74 20 70 65 72 73 6F 6E 3A | nd..Test person: | | 20 44 4F 4E 54 20 63 72 65 61 74 65 20 73 63 31 | DONT create sc1 | | 32 61 2E 69 6E 63 2E 20 49 74 20 69 73 20 6E 6F | 2a.inc. It is no | | 74 20 73 75 70 70 6F 73 65 64 20 74 6F 20 65 78 | t supposed to ex | | 69 73 74 21 0A 54 68 65 20 66 6F 6C 6C 6F 77 69 | ist!.The followi | | 6E 67 20 69 6E 63 6C 75 64 65 20 73 68 6F 75 6C | ng include shoul | | 64 20 79 69 65 6C 64 20 61 20 22 66 69 6C 65 20 | d yield a "file | | 6E 6F 74 20 66 6F 75 6E 64 20 65 72 72 6F 72 2E | not found error. | | 22 0A 0A 40 69 20 73 63 31 32 61 2E 69 6E 63 0A | "..@i sc12a.inc. | | 0A | . | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC12: Include file cannot be found.<010> 00002 00002| Test person: DONT create sc12a.inc. It is not supposed to exist!<010> 00003 00003| The following include should yield a "file not found error."<010> 00004 00004| <010> 00005 00005| @i sc12a.inc<010> 00006 00006| <010> 00007 00007| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 3 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC12: Include file cannot be found.<010> Test person: DONT create sc12a.inc. It is not supposed to exist!<010> The following include should yield a "file not found error."<010> <010> " 0006[01]: Text. Text scrap[White]="<010> " 0007[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC12: Include file cannot be found. 2 2| Test person: DONT create sc12a.inc. It is not supposed to exist! 3 3| The following include should yield a "file not found error." 4 4| 5 5| @i sc12a.inc Error|....^Error opening include file. |....^The include file's expanded name was "<>". 6 6| | ------------+------------------------------------------------------------------- There was 1 Error. 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 Error|.................................................................................^Input line is too long (this character is the fifw_src/answers/sc13.lis 644 0 0 41271 6717353654 10301 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 31 33 3A 20 56 61 72 69 6F 75 73 20 6B 69 | SC13: Various ki | | 6E 64 73 20 6F 66 20 69 6E 63 6C 75 64 65 20 66 | nds of include f | | 69 6C 65 2E 0A 0A 31 2E 20 49 6E 63 6C 75 64 65 | ile...1. Include | | 20 66 69 6C 65 20 69 73 20 65 6D 70 74 79 2E 0A | file is empty.. | | 42 65 66 6F 72 65 20 69 6E 63 6C 75 64 65 0A 40 | Before include.@ | | 69 20 73 63 31 33 61 0A 41 66 74 65 72 20 69 6E | i sc13a.After in | | 63 6C 75 64 65 0A 0A 32 2E 20 49 6E 63 6C 75 64 | clude..2. Includ | | 65 20 66 69 6C 65 20 63 6F 6E 74 61 69 6E 73 20 | e file contains | | 61 20 73 69 6E 67 6C 65 20 62 6C 61 6E 6B 20 6C | a single blank l | | 69 6E 65 2E 0A 42 65 66 6F 72 65 20 69 6E 63 6C | ine..Before incl | | 75 64 65 0A 40 69 20 73 63 31 33 62 0A 41 66 74 | ude.@i sc13b.Aft | | 65 72 20 69 6E 63 6C 75 64 65 0A 0A 33 2E 20 49 | er include..3. I | | 6E 63 6C 75 64 65 20 66 69 6C 65 20 63 6F 6E 74 | nclude file cont | | 61 69 6E 73 20 74 77 6F 20 62 6C 61 6E 6B 20 6C | ains two blank l | | 69 6E 65 73 2E 0A 42 65 66 6F 72 65 20 69 6E 63 | ines..Before inc | | 6C 75 64 65 0A 40 69 20 73 63 31 33 63 0A 41 66 | lude.@i sc13c.Af | | 74 65 72 20 69 6E 63 6C 75 64 65 0A 0A 34 2E 20 | ter include..4. | | 49 6E 63 6C 75 64 65 20 66 69 6C 65 20 63 6F 6E | Include file con | | 74 61 69 6E 73 20 61 20 73 69 6E 67 6C 65 20 6C | tains a single l | | 69 6E 65 20 77 69 74 68 20 74 65 78 74 20 6F 6E | ine with text on | | 20 69 74 2E 0A 42 65 66 6F 72 65 20 69 6E 63 6C | it..Before incl | | 75 64 65 0A 40 69 20 73 63 31 33 64 0A 41 66 74 | ude.@i sc13d.Aft | | 65 72 20 69 6E 63 6C 75 64 65 0A 0A 35 2E 20 49 | er include..5. I | | 6E 63 6C 75 64 65 20 66 69 6C 65 27 73 20 6C 61 | nclude file's la | | 73 74 20 6C 69 6E 65 20 69 73 20 6E 6F 74 20 70 | st line is not p | | 72 6F 70 65 72 6C 79 20 74 65 72 6D 69 6E 61 74 | roperly terminat | | 65 64 2E 0A 42 65 66 6F 72 65 20 69 6E 63 6C 75 | ed..Before inclu | | 64 65 0A 40 69 20 73 63 31 33 65 0A 41 66 74 65 | de.@i sc13e.Afte | | 72 20 69 6E 63 6C 75 64 65 0A 0A 36 2E 20 49 6E | r include..6. In | | 63 6C 75 64 65 20 66 69 6C 65 20 69 73 20 6F 72 | clude file is or | | 64 69 6E 61 72 79 2E 0A 42 65 66 6F 72 65 20 69 | dinary..Before i | | 6E 63 6C 75 64 65 0A 40 69 20 73 63 31 33 66 0A | nclude.@i sc13f. | | 41 66 74 65 72 20 69 6E 63 6C 75 64 65 0A 0A 37 | After include..7 | | 2E 20 54 65 73 74 20 75 70 70 65 72 20 63 61 73 | . Test upper cas | | 65 20 49 20 61 6E 64 20 66 69 6C 65 20 65 78 74 | e I and file ext | | 65 6E 73 69 6F 6E 20 69 6E 68 65 72 69 74 61 6E | ension inheritan | | 63 65 2E 0A 42 65 66 6F 72 65 20 69 6E 63 6C 75 | ce..Before inclu | | 64 65 0A 40 49 20 73 63 31 33 66 0A 41 66 74 65 | de.@I sc13f.Afte | | 72 20 69 6E 63 6C 75 64 65 0A 0A 45 6E 64 20 6F | r include..End o | | 66 20 74 65 73 74 20 46 69 6C 65 2E 0A | f test File.. | +-------------------------------------------------+------------------+ Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ +-------------------------------------------------+------------------+ Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 0A | . | +-------------------------------------------------+------------------+ Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 0A 0A | .. | +-------------------------------------------------+------------------+ Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 54 68 69 73 20 69 73 20 74 68 65 20 69 6E 63 6C | This is the incl | | 75 64 65 20 66 69 6C 65 20 66 6F 72 20 74 65 73 | ude file for tes | | 74 20 53 43 31 33 64 2E 20 4A 75 73 74 20 61 20 | t SC13d. Just a | | 66 69 6C 65 20 63 6F 6E 74 61 69 6E 69 6E 67 20 | file containing | | 6F 6E 65 20 6C 69 6E 65 2E 0A | one line.. | +-------------------------------------------------+------------------+ Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 54 68 69 73 20 69 73 20 74 68 65 20 69 6E 63 6C | This is the incl | | 75 64 65 20 66 69 6C 65 20 66 6F 72 20 74 65 73 | ude file for tes | | 74 20 53 43 31 33 65 2E 20 54 68 65 20 74 65 73 | t SC13e. The tes | | 74 20 69 73 20 74 6F 20 73 65 65 20 68 6F 77 20 | t is to see how | | 46 75 6E 6E 65 6C 57 65 62 0A 63 6F 70 65 73 20 | FunnelWeb.copes | | 77 69 74 68 20 61 6E 20 69 6E 63 6C 75 64 65 20 | with an include | | 66 69 6C 65 20 74 68 61 74 20 68 61 73 20 61 6E | file that has an | | 20 69 6D 70 72 6F 70 65 72 6C 79 20 74 65 72 6D | improperly term | | 69 6E 61 74 65 64 20 6C 61 73 74 20 6C 69 6E 65 | inated last line | | 2E 0A 0A 48 65 72 65 20 69 73 20 74 68 65 20 69 | ...Here is the i | | 6D 70 72 6F 70 65 72 20 74 65 72 6D 69 6E 61 74 | mproper terminat | | 69 6F 6E 21 2D 2D 2D 2D 3E | ion!----> | +-------------------------------------------------+------------------+ Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 54 68 69 73 20 69 73 20 74 68 65 20 69 6E 63 6C | This is the incl | | 75 64 65 20 66 69 6C 65 20 66 6F 72 20 74 65 73 | ude file for tes | | 74 73 20 53 43 31 33 2E 36 20 61 6E 64 20 53 43 | ts SC13.6 and SC | | 31 33 2E 37 2E 0A 54 68 65 72 65 20 61 72 65 20 | 13.7..There are | | 6F 6E 6C 79 20 74 77 6F 20 6C 69 6E 65 73 2C 20 | only two lines, | | 61 6E 64 20 74 68 69 73 20 69 73 20 74 68 65 20 | and this is the | | 73 65 63 6F 6E 64 20 6F 6E 65 2E 0A | second one.. | +-------------------------------------------------+------------------+ Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 54 68 69 73 20 69 73 20 74 68 65 20 69 6E 63 6C | This is the incl | | 75 64 65 20 66 69 6C 65 20 66 6F 72 20 74 65 73 | ude file for tes | | 74 73 20 53 43 31 33 2E 36 20 61 6E 64 20 53 43 | ts SC13.6 and SC | | 31 33 2E 37 2E 0A 54 68 65 72 65 20 61 72 65 20 | 13.7..There are | | 6F 6E 6C 79 20 74 77 6F 20 6C 69 6E 65 73 2C 20 | only two lines, | | 61 6E 64 20 74 68 69 73 20 69 73 20 74 68 65 20 | and this is the | | 73 65 63 6F 6E 64 20 6F 6E 65 2E 0A | second one.. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC13: Various kinds of include file.<010> 00002 00002| <010> 00003 00003| 1. Include file is empty.<010> 00004 00004| Before include<010> 00005 00005| @i sc13a<010> 00006 00006| After include<010> 00007 00007| <010> 00008 00008| 2. Include file contains a single blank line.<010> 00009 00009| Before include<010> 00010 00010| @i sc13b<010> 00011 00001| <010> 00012 00011| After include<010> 00013 00012| <010> 00014 00013| 3. Include file contains two blank lines.<010> 00015 00014| Before include<010> 00016 00015| @i sc13c<010> 00017 00001| <010> 00018 00002| <010> 00019 00016| After include<010> 00020 00017| <010> 00021 00018| 4. Include file contains a single line with text on it.<010> 00022 00019| Before include<010> 00023 00020| @i sc13d<010> 00024 00001| This is the include file for test SC13d. Just a file containing one line.<010> 00025 00021| After include<010> 00026 00022| <010> 00027 00023| 5. Include file's last line is not properly terminated.<010> 00028 00024| Before include<010> 00029 00025| @i sc13e<010> 00030 00001| This is the include file for test SC13e. The test is to see how FunnelWeb<010> 00031 00002| copes with an include file that has an improperly terminated last line.<010> 00032 00003| <010> 00033 00004| Here is the improper termination!----><010> 00034 00026| After include<010> 00035 00027| <010> 00036 00028| 6. Include file is ordinary.<010> 00037 00029| Before include<010> 00038 00030| @i sc13f<010> 00039 00001| This is the include file for tests SC13.6 and SC13.7.<010> 00040 00002| There are only two lines, and this is the second one.<010> 00041 00031| After include<010> 00042 00032| <010> 00043 00033| 7. Test upper case I and file extension inheritance.<010> 00044 00034| Before include<010> 00045 00035| @I sc13f<010> 00046 00001| This is the include file for tests SC13.6 and SC13.7.<010> 00047 00002| There are only two lines, and this is the second one.<010> 00048 00036| After include<010> 00049 00037| <010> 00050 00038| End of test File.<010> 00051 00039| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 15 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC13: Various kinds of include file.<010> <010> 1. Include file is empty.<010> Before include<010> " 0006[01]: Text. Text scrap[Grey]="After include<010> <010> 2. Include file contains a single blank line.<010> Before include<010> " 0011[01]: Text. Text scrap[White]="<010> " 0012[01]: Text. Text scrap[Grey]="After include<010> <010> 3. Include file contains two blank lines.<010> Before include<010> " 0017[01]: Text. Text scrap[White]="<010> <010> " 0019[01]: Text. Text scrap[Grey]="After include<010> <010> 4. Include file contains a single line with text on it.<010> Before include<010> " 0024[01]: Text. Text scrap[Grey]="This is the include file for test SC13d. Just a file containing one line.<010> " 0025[01]: Text. Text scrap[Grey]="After include<010> <010> 5. Include file's last line is not properly terminated.<010> Before include<010> " 0030[01]: Text. Text scrap[Grey]="This is the include file for test SC13e. The test is to see how FunnelWeb<010> copes with an include file that has an improperly terminated last line.<010> <010> Here is the improper termination!----><010> " 0034[01]: Text. Text scrap[Grey]="After include<010> <010> 6. Include file is ordinary.<010> Before include<010> " 0039[01]: Text. Text scrap[Grey]="This is the include file for tests SC13.6 and SC13.7.<010> There are only two lines, and this is the second one.<010> " 0041[01]: Text. Text scrap[Grey]="After include<010> <010> 7. Test upper case I and file extension inheritance.<010> Before include<010> " 0046[01]: Text. Text scrap[Grey]="This is the include file for tests SC13.6 and SC13.7.<010> There are only two lines, and this is the second one.<010> " 0048[01]: Text. Text scrap[Grey]="After include<010> <010> End of test File.<010> " 0051[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ ========================== Start of MACRO TABLE DUMP =========================== =========================== End of MACRO TABLE DUMP ============================ ========================= Start of DOCUMENT LIST DUMP ========================== TEXT COMPONENT: Pos(L,C)=(1,1). -- Start of Text Scrap List -- Text scrap[Grey]="SC13: Various kinds of include file.<010> <010> 1. Include file is empty.<010> Before include<010> " Text scrap[Grey]="After include<010> <010> 2. Include file contains a single blank line.<010> Before include<010> " Text scrap[White]="<010> " Text scrap[Grey]="After include<010> <010> 3. Include file contains two blank lines.<010> Before include<010> " Text scrap[White]="<010> <010> " Text scrap[Grey]="After include<010> <010> 4. Include file contains a single line with text on it.<010> Before include<010> " Text scrap[Grey]="This is the include file for test SC13d. Just a file containing one line.<010> " Text scrap[Grey]="After include<010> <010> 5. Include file's last line is not properly terminated.<010> Before include<010> " Text scrap[Grey]="This is the include file for test SC13e. The test is to see how FunnelWeb<010> copes with an include file that has an improperly terminated last line.<010> <010> Here is the improper termination!----><010> " Text scrap[Grey]="After include<010> <010> 6. Include file is ordinary.<010> Before include<010> " Text scrap[Grey]="This is the include file for tests SC13.6 and SC13.7.<010> There are only two lines, and this is the second one.<010> " Text scrap[Grey]="After include<010> <010> 7. Test upper case I and file extension inheritance.<010> Before include<010> " Text scrap[Grey]="This is the include file for tests SC13.6 and SC13.7.<010> There are only two lines, and this is the second one.<010> " Text scrap[Grey]="After include<010> <010> End of test File.<010> " --- End of Text Scrap List --- ========================== End of DOCUMENT LIST DUMP =========================== E: No macros defined. E: No output files specified. Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC13: Various kinds of include file. 2 2| 3 3| 1. Include file is empty. 4 4| Before include 5 5| @i sc13a Warning|.^Include file "<>" is empty (not a byte in syte)! 6 6| After include 7 7| 8 8| 2. Include file contains a single blank line. 9 9| Before include 10 10| @i sc13b 11 1| 12 11| After include 13 12| 14 13| 3. Include file contains two blank lines. 15 14| Before include 16 15| @i sc13c 17 1| 18 2| 19 16| After include 20 17| 21 18| 4. Include file contains a single line with text on it. 22 19| Before include 23 20| @i sc13d 24 1| This is the include file for test SC13d. Just a file containing one line. 25 21| After include 26 22| 27 23| 5. Include file's last line is not properly terminated. 28 24| Before include 29 25| @i sc13e 30 1| This is the include file for test SC13e. The test is to see how FunnelWeb 31 2| copes with an include file that has an improperly terminated last line. 32 3| 33 4| Here is the improper termination!----> 34 26| After include Warning|.^The last line of the include file "<>" was terminated by EOF. |.^An EOL was inserted at the end of the last line. 35 27| 36 28| 6. Include file is ordinary. 37 29| Before include 38 30| @i sc13f 39 1| This is the include file for tests SC13.6 and SC13.7. 40 2| There are only two lines, and this is the second one. 41 31| After include 42 32| 43 33| 7. Test upper case I and file extension inheritance. 44 34| Before include 45 35| @I sc13f 46 1| This is the include file for tests SC13.6 and SC13.7. 47 2| There are only two lines, and this is the second one. 48 36| After include 49 37| 50 38| End of test File. | ------------+------------------------------------------------------------------- There were 2 Errors and 2 Warnings. 0 74 68 65 20 69 6E 63 6C | This is the incl | | 75 64 65 20 66 69 6C 65 20 66 6F 72 20 74 65 73 | ude file for tes | | 74 73 20 53 43 31 33 2E 36 20 61 6E 64 20 53 43 | ts SC13.6 and SC | | 31 33 2E 37 2E 0A 54 68 65 72 65 20 61 72 65 20 | 13.7..There are | | 6F 6E 6C 79 20 74 77 6F 20 6C 69 6E 65 73 2C 20 | only two lines,fw_src/answers/sc14.lis 644 0 0 54235 6717353656 10310 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 31 34 3A 20 54 65 73 74 20 74 68 61 74 20 | SC14: Test that | | 74 68 65 20 6D 61 78 69 6D 75 6D 20 6E 75 6D 62 | the maximum numb | | 65 72 20 6F 66 20 6C 65 76 65 6C 73 20 6F 66 20 | er of levels of | | 69 6E 63 6C 75 64 65 20 66 69 6C 65 20 69 73 20 | include file is | | 31 30 2E 0A 54 68 69 73 20 69 73 20 6D 6F 73 74 | 10..This is most | | 20 65 61 73 69 6C 79 20 64 6F 6E 65 20 77 69 74 | easily done wit | | 68 20 61 20 72 65 63 75 72 73 69 76 65 20 69 6E | h a recursive in | | 63 6C 75 73 69 6F 6E 2E 0A 0A 42 65 66 6F 72 65 | clusion...Before | | 20 74 68 65 20 69 6E 63 6C 75 64 65 0A 40 69 20 | the include.@i | | 73 63 31 34 2E 66 77 0A 41 66 74 65 72 20 74 68 | sc14.fw.After th | | 65 20 69 6E 63 6C 75 64 65 0A | e include. | +-------------------------------------------------+------------------+ Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 31 34 3A 20 54 65 73 74 20 74 68 61 74 20 | SC14: Test that | | 74 68 65 20 6D 61 78 69 6D 75 6D 20 6E 75 6D 62 | the maximum numb | | 65 72 20 6F 66 20 6C 65 76 65 6C 73 20 6F 66 20 | er of levels of | | 69 6E 63 6C 75 64 65 20 66 69 6C 65 20 69 73 20 | include file is | | 31 30 2E 0A 54 68 69 73 20 69 73 20 6D 6F 73 74 | 10..This is most | | 20 65 61 73 69 6C 79 20 64 6F 6E 65 20 77 69 74 | easily done wit | | 68 20 61 20 72 65 63 75 72 73 69 76 65 20 69 6E | h a recursive in | | 63 6C 75 73 69 6F 6E 2E 0A 0A 42 65 66 6F 72 65 | clusion...Before | | 20 74 68 65 20 69 6E 63 6C 75 64 65 0A 40 69 20 | the include.@i | | 73 63 31 34 2E 66 77 0A 41 66 74 65 72 20 74 68 | sc14.fw.After th | | 65 20 69 6E 63 6C 75 64 65 0A | e include. | +-------------------------------------------------+------------------+ Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 31 34 3A 20 54 65 73 74 20 74 68 61 74 20 | SC14: Test that | | 74 68 65 20 6D 61 78 69 6D 75 6D 20 6E 75 6D 62 | the maximum numb | | 65 72 20 6F 66 20 6C 65 76 65 6C 73 20 6F 66 20 | er of levels of | | 69 6E 63 6C 75 64 65 20 66 69 6C 65 20 69 73 20 | include file is | | 31 30 2E 0A 54 68 69 73 20 69 73 20 6D 6F 73 74 | 10..This is most | | 20 65 61 73 69 6C 79 20 64 6F 6E 65 20 77 69 74 | easily done wit | | 68 20 61 20 72 65 63 75 72 73 69 76 65 20 69 6E | h a recursive in | | 63 6C 75 73 69 6F 6E 2E 0A 0A 42 65 66 6F 72 65 | clusion...Before | | 20 74 68 65 20 69 6E 63 6C 75 64 65 0A 40 69 20 | the include.@i | | 73 63 31 34 2E 66 77 0A 41 66 74 65 72 20 74 68 | sc14.fw.After th | | 65 20 69 6E 63 6C 75 64 65 0A | e include. | +-------------------------------------------------+------------------+ Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 31 34 3A 20 54 65 73 74 20 74 68 61 74 20 | SC14: Test that | | 74 68 65 20 6D 61 78 69 6D 75 6D 20 6E 75 6D 62 | the maximum numb | | 65 72 20 6F 66 20 6C 65 76 65 6C 73 20 6F 66 20 | er of levels of | | 69 6E 63 6C 75 64 65 20 66 69 6C 65 20 69 73 20 | include file is | | 31 30 2E 0A 54 68 69 73 20 69 73 20 6D 6F 73 74 | 10..This is most | | 20 65 61 73 69 6C 79 20 64 6F 6E 65 20 77 69 74 | easily done wit | | 68 20 61 20 72 65 63 75 72 73 69 76 65 20 69 6E | h a recursive in | | 63 6C 75 73 69 6F 6E 2E 0A 0A 42 65 66 6F 72 65 | clusion...Before | | 20 74 68 65 20 69 6E 63 6C 75 64 65 0A 40 69 20 | the include.@i | | 73 63 31 34 2E 66 77 0A 41 66 74 65 72 20 74 68 | sc14.fw.After th | | 65 20 69 6E 63 6C 75 64 65 0A | e include. | +-------------------------------------------------+------------------+ Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 31 34 3A 20 54 65 73 74 20 74 68 61 74 20 | SC14: Test that | | 74 68 65 20 6D 61 78 69 6D 75 6D 20 6E 75 6D 62 | the maximum numb | | 65 72 20 6F 66 20 6C 65 76 65 6C 73 20 6F 66 20 | er of levels of | | 69 6E 63 6C 75 64 65 20 66 69 6C 65 20 69 73 20 | include file is | | 31 30 2E 0A 54 68 69 73 20 69 73 20 6D 6F 73 74 | 10..This is most | | 20 65 61 73 69 6C 79 20 64 6F 6E 65 20 77 69 74 | easily done wit | | 68 20 61 20 72 65 63 75 72 73 69 76 65 20 69 6E | h a recursive in | | 63 6C 75 73 69 6F 6E 2E 0A 0A 42 65 66 6F 72 65 | clusion...Before | | 20 74 68 65 20 69 6E 63 6C 75 64 65 0A 40 69 20 | the include.@i | | 73 63 31 34 2E 66 77 0A 41 66 74 65 72 20 74 68 | sc14.fw.After th | | 65 20 69 6E 63 6C 75 64 65 0A | e include. | +-------------------------------------------------+------------------+ Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 31 34 3A 20 54 65 73 74 20 74 68 61 74 20 | SC14: Test that | | 74 68 65 20 6D 61 78 69 6D 75 6D 20 6E 75 6D 62 | the maximum numb | | 65 72 20 6F 66 20 6C 65 76 65 6C 73 20 6F 66 20 | er of levels of | | 69 6E 63 6C 75 64 65 20 66 69 6C 65 20 69 73 20 | include file is | | 31 30 2E 0A 54 68 69 73 20 69 73 20 6D 6F 73 74 | 10..This is most | | 20 65 61 73 69 6C 79 20 64 6F 6E 65 20 77 69 74 | easily done wit | | 68 20 61 20 72 65 63 75 72 73 69 76 65 20 69 6E | h a recursive in | | 63 6C 75 73 69 6F 6E 2E 0A 0A 42 65 66 6F 72 65 | clusion...Before | | 20 74 68 65 20 69 6E 63 6C 75 64 65 0A 40 69 20 | the include.@i | | 73 63 31 34 2E 66 77 0A 41 66 74 65 72 20 74 68 | sc14.fw.After th | | 65 20 69 6E 63 6C 75 64 65 0A | e include. | +-------------------------------------------------+------------------+ Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 31 34 3A 20 54 65 73 74 20 74 68 61 74 20 | SC14: Test that | | 74 68 65 20 6D 61 78 69 6D 75 6D 20 6E 75 6D 62 | the maximum numb | | 65 72 20 6F 66 20 6C 65 76 65 6C 73 20 6F 66 20 | er of levels of | | 69 6E 63 6C 75 64 65 20 66 69 6C 65 20 69 73 20 | include file is | | 31 30 2E 0A 54 68 69 73 20 69 73 20 6D 6F 73 74 | 10..This is most | | 20 65 61 73 69 6C 79 20 64 6F 6E 65 20 77 69 74 | easily done wit | | 68 20 61 20 72 65 63 75 72 73 69 76 65 20 69 6E | h a recursive in | | 63 6C 75 73 69 6F 6E 2E 0A 0A 42 65 66 6F 72 65 | clusion...Before | | 20 74 68 65 20 69 6E 63 6C 75 64 65 0A 40 69 20 | the include.@i | | 73 63 31 34 2E 66 77 0A 41 66 74 65 72 20 74 68 | sc14.fw.After th | | 65 20 69 6E 63 6C 75 64 65 0A | e include. | +-------------------------------------------------+------------------+ Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 31 34 3A 20 54 65 73 74 20 74 68 61 74 20 | SC14: Test that | | 74 68 65 20 6D 61 78 69 6D 75 6D 20 6E 75 6D 62 | the maximum numb | | 65 72 20 6F 66 20 6C 65 76 65 6C 73 20 6F 66 20 | er of levels of | | 69 6E 63 6C 75 64 65 20 66 69 6C 65 20 69 73 20 | include file is | | 31 30 2E 0A 54 68 69 73 20 69 73 20 6D 6F 73 74 | 10..This is most | | 20 65 61 73 69 6C 79 20 64 6F 6E 65 20 77 69 74 | easily done wit | | 68 20 61 20 72 65 63 75 72 73 69 76 65 20 69 6E | h a recursive in | | 63 6C 75 73 69 6F 6E 2E 0A 0A 42 65 66 6F 72 65 | clusion...Before | | 20 74 68 65 20 69 6E 63 6C 75 64 65 0A 40 69 20 | the include.@i | | 73 63 31 34 2E 66 77 0A 41 66 74 65 72 20 74 68 | sc14.fw.After th | | 65 20 69 6E 63 6C 75 64 65 0A | e include. | +-------------------------------------------------+------------------+ Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 31 34 3A 20 54 65 73 74 20 74 68 61 74 20 | SC14: Test that | | 74 68 65 20 6D 61 78 69 6D 75 6D 20 6E 75 6D 62 | the maximum numb | | 65 72 20 6F 66 20 6C 65 76 65 6C 73 20 6F 66 20 | er of levels of | | 69 6E 63 6C 75 64 65 20 66 69 6C 65 20 69 73 20 | include file is | | 31 30 2E 0A 54 68 69 73 20 69 73 20 6D 6F 73 74 | 10..This is most | | 20 65 61 73 69 6C 79 20 64 6F 6E 65 20 77 69 74 | easily done wit | | 68 20 61 20 72 65 63 75 72 73 69 76 65 20 69 6E | h a recursive in | | 63 6C 75 73 69 6F 6E 2E 0A 0A 42 65 66 6F 72 65 | clusion...Before | | 20 74 68 65 20 69 6E 63 6C 75 64 65 0A 40 69 20 | the include.@i | | 73 63 31 34 2E 66 77 0A 41 66 74 65 72 20 74 68 | sc14.fw.After th | | 65 20 69 6E 63 6C 75 64 65 0A | e include. | +-------------------------------------------------+------------------+ Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 31 34 3A 20 54 65 73 74 20 74 68 61 74 20 | SC14: Test that | | 74 68 65 20 6D 61 78 69 6D 75 6D 20 6E 75 6D 62 | the maximum numb | | 65 72 20 6F 66 20 6C 65 76 65 6C 73 20 6F 66 20 | er of levels of | | 69 6E 63 6C 75 64 65 20 66 69 6C 65 20 69 73 20 | include file is | | 31 30 2E 0A 54 68 69 73 20 69 73 20 6D 6F 73 74 | 10..This is most | | 20 65 61 73 69 6C 79 20 64 6F 6E 65 20 77 69 74 | easily done wit | | 68 20 61 20 72 65 63 75 72 73 69 76 65 20 69 6E | h a recursive in | | 63 6C 75 73 69 6F 6E 2E 0A 0A 42 65 66 6F 72 65 | clusion...Before | | 20 74 68 65 20 69 6E 63 6C 75 64 65 0A 40 69 20 | the include.@i | | 73 63 31 34 2E 66 77 0A 41 66 74 65 72 20 74 68 | sc14.fw.After th | | 65 20 69 6E 63 6C 75 64 65 0A | e include. | +-------------------------------------------------+------------------+ Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 31 34 3A 20 54 65 73 74 20 74 68 61 74 20 | SC14: Test that | | 74 68 65 20 6D 61 78 69 6D 75 6D 20 6E 75 6D 62 | the maximum numb | | 65 72 20 6F 66 20 6C 65 76 65 6C 73 20 6F 66 20 | er of levels of | | 69 6E 63 6C 75 64 65 20 66 69 6C 65 20 69 73 20 | include file is | | 31 30 2E 0A 54 68 69 73 20 69 73 20 6D 6F 73 74 | 10..This is most | | 20 65 61 73 69 6C 79 20 64 6F 6E 65 20 77 69 74 | easily done wit | | 68 20 61 20 72 65 63 75 72 73 69 76 65 20 69 6E | h a recursive in | | 63 6C 75 73 69 6F 6E 2E 0A 0A 42 65 66 6F 72 65 | clusion...Before | | 20 74 68 65 20 69 6E 63 6C 75 64 65 0A 40 69 20 | the include.@i | | 73 63 31 34 2E 66 77 0A 41 66 74 65 72 20 74 68 | sc14.fw.After th | | 65 20 69 6E 63 6C 75 64 65 0A | e include. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC14: Test that the maximum number of levels of include file is 10.<010> 00002 00002| This is most easily done with a recursive inclusion.<010> 00003 00003| <010> 00004 00004| Before the include<010> 00005 00005| @i sc14.fw<010> 00006 00001| SC14: Test that the maximum number of levels of include file is 10.<010> 00007 00002| This is most easily done with a recursive inclusion.<010> 00008 00003| <010> 00009 00004| Before the include<010> 00010 00005| @i sc14.fw<010> 00011 00001| SC14: Test that the maximum number of levels of include file is 10.<010> 00012 00002| This is most easily done with a recursive inclusion.<010> 00013 00003| <010> 00014 00004| Before the include<010> 00015 00005| @i sc14.fw<010> 00016 00001| SC14: Test that the maximum number of levels of include file is 10.<010> 00017 00002| This is most easily done with a recursive inclusion.<010> 00018 00003| <010> 00019 00004| Before the include<010> 00020 00005| @i sc14.fw<010> 00021 00001| SC14: Test that the maximum number of levels of include file is 10.<010> 00022 00002| This is most easily done with a recursive inclusion.<010> 00023 00003| <010> 00024 00004| Before the include<010> 00025 00005| @i sc14.fw<010> 00026 00001| SC14: Test that the maximum number of levels of include file is 10.<010> 00027 00002| This is most easily done with a recursive inclusion.<010> 00028 00003| <010> 00029 00004| Before the include<010> 00030 00005| @i sc14.fw<010> 00031 00001| SC14: Test that the maximum number of levels of include file is 10.<010> 00032 00002| This is most easily done with a recursive inclusion.<010> 00033 00003| <010> 00034 00004| Before the include<010> 00035 00005| @i sc14.fw<010> 00036 00001| SC14: Test that the maximum number of levels of include file is 10.<010> 00037 00002| This is most easily done with a recursive inclusion.<010> 00038 00003| <010> 00039 00004| Before the include<010> 00040 00005| @i sc14.fw<010> 00041 00001| SC14: Test that the maximum number of levels of include file is 10.<010> 00042 00002| This is most easily done with a recursive inclusion.<010> 00043 00003| <010> 00044 00004| Before the include<010> 00045 00005| @i sc14.fw<010> 00046 00001| SC14: Test that the maximum number of levels of include file is 10.<010> 00047 00002| This is most easily done with a recursive inclusion.<010> 00048 00003| <010> 00049 00004| Before the include<010> 00050 00005| @i sc14.fw<010> 00051 00001| SC14: Test that the maximum number of levels of include file is 10.<010> 00052 00002| This is most easily done with a recursive inclusion.<010> 00053 00003| <010> 00054 00004| Before the include<010> 00055 00005| @i sc14.fw<010> 00056 00006| After the include<010> 00057 00006| After the include<010> 00058 00006| After the include<010> 00059 00006| After the include<010> 00060 00006| After the include<010> 00061 00006| After the include<010> 00062 00006| After the include<010> 00063 00006| After the include<010> 00064 00006| After the include<010> 00065 00006| After the include<010> 00066 00006| After the include<010> 00067 00007| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 23 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC14: Test that the maximum number of levels of include file is 10.<010> This is most easily done with a recursive inclusion.<010> <010> Before the include<010> " 0006[01]: Text. Text scrap[Grey]="SC14: Test that the maximum number of levels of include file is 10.<010> This is most easily done with a recursive inclusion.<010> <010> Before the include<010> " 0011[01]: Text. Text scrap[Grey]="SC14: Test that the maximum number of levels of include file is 10.<010> This is most easily done with a recursive inclusion.<010> <010> Before the include<010> " 0016[01]: Text. Text scrap[Grey]="SC14: Test that the maximum number of levels of include file is 10.<010> This is most easily done with a recursive inclusion.<010> <010> Before the include<010> " 0021[01]: Text. Text scrap[Grey]="SC14: Test that the maximum number of levels of include file is 10.<010> This is most easily done with a recursive inclusion.<010> <010> Before the include<010> " 0026[01]: Text. Text scrap[Grey]="SC14: Test that the maximum number of levels of include file is 10.<010> This is most easily done with a recursive inclusion.<010> <010> Before the include<010> " 0031[01]: Text. Text scrap[Grey]="SC14: Test that the maximum number of levels of include file is 10.<010> This is most easily done with a recursive inclusion.<010> <010> Before the include<010> " 0036[01]: Text. Text scrap[Grey]="SC14: Test that the maximum number of levels of include file is 10.<010> This is most easily done with a recursive inclusion.<010> <010> Before the include<010> " 0041[01]: Text. Text scrap[Grey]="SC14: Test that the maximum number of levels of include file is 10.<010> This is most easily done with a recursive inclusion.<010> <010> Before the include<010> " 0046[01]: Text. Text scrap[Grey]="SC14: Test that the maximum number of levels of include file is 10.<010> This is most easily done with a recursive inclusion.<010> <010> Before the include<010> " 0051[01]: Text. Text scrap[Grey]="SC14: Test that the maximum number of levels of include file is 10.<010> This is most easily done with a recursive inclusion.<010> <010> Before the include<010> " 0056[01]: Text. Text scrap[Grey]="After the include<010> " 0057[01]: Text. Text scrap[Grey]="After the include<010> " 0058[01]: Text. Text scrap[Grey]="After the include<010> " 0059[01]: Text. Text scrap[Grey]="After the include<010> " 0060[01]: Text. Text scrap[Grey]="After the include<010> " 0061[01]: Text. Text scrap[Grey]="After the include<010> " 0062[01]: Text. Text scrap[Grey]="After the include<010> " 0063[01]: Text. Text scrap[Grey]="After the include<010> " 0064[01]: Text. Text scrap[Grey]="After the include<010> " 0065[01]: Text. Text scrap[Grey]="After the include<010> " 0066[01]: Text. Text scrap[Grey]="After the include<010> " 0067[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC14: Test that the maximum number of levels of include file is 10. 2 2| This is most easily done with a recursive inclusion. 3 3| 4 4| Before the include 5 5| @i sc14.fw 6 1| SC14: Test that the maximum number of levels of include file is 10. 7 2| This is most easily done with a recursive inclusion. 8 3| 9 4| Before the include 10 5| @i sc14.fw 11 1| SC14: Test that the maximum number of levels of include file is 10. 12 2| This is most easily done with a recursive inclusion. 13 3| 14 4| Before the include 15 5| @i sc14.fw 16 1| SC14: Test that the maximum number of levels of include file is 10. 17 2| This is most easily done with a recursive inclusion. 18 3| 19 4| Before the include 20 5| @i sc14.fw 21 1| SC14: Test that the maximum number of levels of include file is 10. 22 2| This is most easily done with a recursive inclusion. 23 3| 24 4| Before the include 25 5| @i sc14.fw 26 1| SC14: Test that the maximum number of levels of include file is 10. 27 2| This is most easily done with a recursive inclusion. 28 3| 29 4| Before the include 30 5| @i sc14.fw 31 1| SC14: Test that the maximum number of levels of include file is 10. 32 2| This is most easily done with a recursive inclusion. 33 3| 34 4| Before the include 35 5| @i sc14.fw 36 1| SC14: Test that the maximum number of levels of include file is 10. 37 2| This is most easily done with a recursive inclusion. 38 3| 39 4| Before the include 40 5| @i sc14.fw 41 1| SC14: Test that the maximum number of levels of include file is 10. 42 2| This is most easily done with a recursive inclusion. 43 3| 44 4| Before the include 45 5| @i sc14.fw 46 1| SC14: Test that the maximum number of levels of include file is 10. 47 2| This is most easily done with a recursive inclusion. 48 3| 49 4| Before the include 50 5| @i sc14.fw 51 1| SC14: Test that the maximum number of levels of include file is 10. 52 2| This is most easily done with a recursive inclusion. 53 3| 54 4| Before the include 55 5| @i sc14.fw Error|.^This include file is nested too deeply. It's probably recursive. |.^The maximum level of nested includes is 10. |.^Include ignored. 56 6| After the include 57 6| After the include 58 6| After the include 59 6| After the include 60 6| After the include 61 6| After the include 62 6| After the include 63 6| After the include 64 6| After the include 65 6| After the include 66 6| After the include | ------------+------------------------------------------------------------------- There was 1 Error. in | | 63 6C 75 73 69 6F 6E 2E 0A 0A 42 65 66 6F 72 65 | clusion...Before | | 20 74 68 65 20 69 6E 63 6C 75 64 65 0A 40 69 20 | the include.@i | | 73 63 31 34 2E 66 77 0A 41 66 74 65 72 20 74 68 | sc14.fw.After th | | 65 20 69 6E 63 6C 75 64 65 0A | e include. | +-------------------------------------------------+--------------fw_src/answers/sc15.lis 644 0 0 46533 6717353661 10307 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 31 35 3A 20 54 65 73 74 20 74 68 61 74 20 | SC15: Test that | | 63 65 72 74 61 69 6E 20 61 74 74 72 69 62 75 74 | certain attribut | | 65 73 20 61 72 65 20 73 61 76 65 64 20 61 63 72 | es are saved acr | | 6F 73 73 20 69 6E 63 6C 75 73 69 6F 6E 73 2E 0A | oss inclusions.. | | 0A 31 2E 20 4D 61 78 69 6D 75 6D 20 69 6E 70 75 | .1. Maximum inpu | | 74 20 6C 69 6E 65 20 6C 65 6E 67 74 68 2E 0A 32 | t line length..2 | | 2E 20 53 70 65 63 69 61 6C 20 63 68 61 72 61 63 | . Special charac | | 74 65 72 2E 0A 33 2E 20 4C 6F 63 61 6C 20 6C 69 | ter..3. Local li | | 6E 65 20 6E 75 6D 62 65 72 2E 0A 0A 54 6F 20 74 | ne number...To t | | 65 73 74 20 74 68 69 73 2C 20 77 65 20 66 69 72 | est this, we fir | | 73 74 20 73 65 74 20 74 68 65 20 66 69 72 73 74 | st set the first | | 20 74 77 6F 20 61 74 74 72 69 62 75 74 65 73 20 | two attributes | | 61 77 61 79 20 66 72 6F 6D 20 74 68 65 0A 64 65 | away from the.de | | 66 61 75 6C 74 2E 20 54 68 69 73 20 77 69 6C 6C | fault. This will | | 20 65 6E 61 62 6C 65 20 75 73 20 74 6F 20 62 65 | enable us to be | | 20 73 75 72 65 20 74 68 61 74 20 77 68 65 6E 20 | sure that when | | 74 68 65 79 20 61 72 65 20 72 65 73 74 6F 72 65 | they are restore | | 64 20 74 68 61 74 0A 74 68 65 79 20 61 72 65 20 | d that.they are | | 62 65 69 6E 67 20 72 65 73 74 6F 72 65 64 20 74 | being restored t | | 6F 20 74 68 65 69 72 20 66 6F 72 6D 65 72 20 76 | o their former v | | 61 6C 75 65 73 20 61 6E 64 20 6E 6F 74 20 6A 75 | alues and not ju | | 73 74 20 73 65 74 20 74 6F 20 74 68 65 0A 64 65 | st set to the.de | | 66 61 75 6C 74 2E 0A 0A 40 3D 2A 20 20 20 2A 21 | fault...@=* *! | | 20 43 68 61 6E 67 65 20 74 68 65 20 73 70 65 63 | Change the spec | | 69 61 6C 20 63 68 61 72 61 63 74 65 72 2E 0A 2A | ial character..* | | 70 20 6D 61 78 69 6D 75 6D 5F 69 6E 70 75 74 5F | p maximum_input_ | | 6C 69 6E 65 5F 6C 65 6E 67 74 68 20 3D 20 37 35 | line_length = 75 | | 0A 0A 42 65 66 6F 72 65 20 69 6E 63 6C 75 64 65 | ..Before include | | 2E 0A 2A 69 20 73 63 31 35 61 0A 41 66 74 65 72 | ..*i sc15a.After | | 20 69 6E 63 6C 75 64 65 2E 0A 0A 49 66 20 74 68 | include...If th | | 65 20 6D 61 78 69 6D 75 6D 20 69 6E 70 75 74 20 | e maximum input | | 6C 69 6E 65 20 6C 65 6E 67 74 68 20 68 61 73 20 | line length has | | 62 65 65 6E 20 63 6F 72 72 65 63 74 6C 79 20 72 | been correctly r | | 65 73 74 6F 72 65 64 20 74 68 65 6E 20 74 68 65 | estored then the | | 0A 73 65 63 6F 6E 64 20 6F 66 20 74 68 65 20 66 | .second of the f | | 6F 6C 6C 6F 77 69 6E 67 20 74 77 6F 20 6C 69 6E | ollowing two lin | | 65 73 20 73 68 6F 75 6C 64 20 67 69 76 65 20 61 | es should give a | | 6E 20 65 72 72 6F 72 2C 20 62 75 74 20 6E 6F 74 | n error, but not | | 20 74 68 65 20 66 69 72 73 74 2E 0A 31 32 33 34 | the first..1234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 0A 31 32 33 34 35 36 37 38 | 9012345.12345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 0A 0A 49 66 20 74 68 65 20 73 70 65 | 3456..If the spe | | 63 69 61 6C 20 63 68 61 72 61 63 74 65 72 20 68 | cial character h | | 61 73 20 62 65 65 6E 20 70 72 65 73 65 72 76 65 | as been preserve | | 64 2C 20 74 68 65 6E 20 74 68 65 20 66 6F 6C 6C | d, then the foll | | 6F 77 69 6E 67 20 73 68 6F 75 6C 64 0A 67 65 6E | owing should.gen | | 65 72 61 74 65 20 61 6E 20 65 72 72 6F 72 2E 0A | erate an error.. | | 0A 2A 20 20 20 2D 20 54 68 69 73 20 73 68 6F 75 | .* - This shou | | 6C 64 20 67 65 6E 65 72 61 74 65 20 61 6E 20 65 | ld generate an e | | 72 72 6F 72 20 69 66 20 61 6C 6C 20 69 73 20 77 | rror if all is w | | 65 6C 6C 2E 0A 0A 50 72 65 73 65 72 76 61 74 69 | ell...Preservati | | 6F 6E 20 6F 66 20 74 68 65 20 6C 6F 63 61 6C 20 | on of the local | | 6C 69 6E 65 20 6E 75 6D 62 65 72 20 63 61 6E 20 | line number can | | 62 65 20 63 68 65 63 6B 65 64 20 62 79 20 6C 6F | be checked by lo | | 6F 6B 69 6E 67 20 61 74 20 74 68 65 0A 6C 69 73 | oking at the.lis | | 74 69 6E 67 20 66 69 6C 65 2E 0A | ting file.. | +-------------------------------------------------+------------------+ Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 54 68 69 73 20 69 73 20 74 68 65 20 69 6E 63 6C | This is the incl | | 75 64 65 20 66 69 6C 65 20 66 6F 72 20 74 65 73 | ude file for tes | | 74 20 53 43 31 35 2E 20 54 68 65 20 53 43 31 35 | t SC15. The SC15 | | 20 74 65 73 74 20 63 68 65 63 6B 73 20 74 6F 20 | test checks to | | 6D 61 6B 65 0A 73 75 72 65 20 74 68 61 74 20 46 | make.sure that F | | 75 6E 6E 65 6C 57 65 62 20 69 73 20 73 61 76 69 | unnelWeb is savi | | 6E 67 20 61 6E 64 20 72 65 73 74 6F 72 69 6E 67 | ng and restoring | | 20 74 68 72 65 65 20 73 63 61 6E 6E 69 6E 67 0A | three scanning. | | 61 74 74 72 69 62 75 74 65 73 20 61 63 72 6F 73 | attributes acros | | 73 20 69 6E 63 6C 75 64 65 20 66 69 6C 65 73 2E | s include files. | | 20 57 65 20 61 6C 73 6F 20 77 61 6E 74 20 74 6F | We also want to | | 20 6D 61 6B 65 20 73 75 72 65 0A 74 68 61 74 20 | make sure.that | | 74 68 65 20 73 63 61 6E 6E 65 72 20 69 73 20 69 | the scanner is i | | 6E 69 74 69 61 6C 69 7A 69 6E 67 20 74 68 65 73 | nitializing thes | | 65 20 61 74 74 72 69 62 75 74 65 73 20 63 6F 72 | e attributes cor | | 72 65 63 74 6C 79 20 77 69 74 68 69 6E 0A 74 68 | rectly within.th | | 65 20 69 6E 63 6C 75 64 65 20 66 69 6C 65 2E 0A | e include file.. | | 0A 53 43 31 35 2E 34 3A 20 4D 61 6B 65 20 73 75 | .SC15.4: Make su | | 72 65 20 74 68 61 74 20 74 68 65 20 73 70 65 63 | re that the spec | | 69 61 6C 20 63 68 61 72 61 63 74 65 72 20 69 73 | ial character is | | 20 41 54 20 61 74 20 74 68 65 20 73 74 61 72 74 | AT at the start | | 20 6F 66 0A 69 6E 63 6C 75 64 65 20 66 69 6C 65 | of.include file | | 73 2E 0A 0A 40 20 20 20 20 2D 20 54 68 69 73 20 | s...@ - This | | 73 68 6F 75 6C 64 20 79 69 65 6C 64 20 61 6E 20 | should yield an | | 65 72 72 6F 72 2E 0A 0A 53 43 31 35 2E 35 20 45 | error...SC15.5 E | | 6E 73 75 72 65 20 74 68 61 74 20 74 68 65 20 6D | nsure that the m | | 61 78 69 6D 75 6D 20 69 6E 70 75 74 20 6C 69 6E | aximum input lin | | 65 20 6C 65 6E 67 74 68 20 69 73 20 38 30 20 61 | e length is 80 a | | 74 20 74 68 65 20 73 74 61 72 74 0A 6F 66 20 61 | t the start.of a | | 6E 20 69 6E 63 6C 75 64 65 20 66 69 6C 65 2E 20 | n include file. | | 49 66 20 61 6C 6C 20 69 73 20 77 65 6C 6C 2C 20 | If all is well, | | 6F 6E 6C 79 20 74 68 65 20 73 65 63 6F 6E 64 20 | only the second | | 6F 66 20 74 68 65 20 66 6F 6C 6C 6F 77 69 6E 67 | of the following | | 20 74 77 6F 0A 6C 69 6E 65 73 20 77 69 6C 6C 20 | two.lines will | | 70 72 6F 76 6F 6B 65 20 61 20 22 6C 69 6E 65 20 | provoke a "line | | 74 6F 6F 20 6C 6F 6E 67 22 20 65 72 72 6F 72 2E | too long" error. | | 0A 0A 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | ..12345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 0A 31 32 33 34 35 36 37 38 39 30 31 32 33 | 90.1234567890123 | | 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 | 4567890123456789 | | 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 | 0123456789012345 | | 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 | 6789012345678901 | | 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 | 2345678901234567 | | 38 39 30 31 0A 0A 4E 6F 77 20 74 68 61 74 20 77 | 8901..Now that w | | 65 20 68 61 76 65 20 63 68 65 63 6B 65 64 20 74 | e have checked t | | 68 65 20 64 65 66 61 75 6C 74 20 61 74 74 72 69 | he default attri | | 62 75 74 65 73 20 6F 6E 20 65 6E 74 65 72 69 6E | butes on enterin | | 67 20 61 6E 20 69 6E 63 6C 75 64 65 20 66 69 6C | g an include fil | | 65 2C 0A 77 65 20 77 61 6E 74 20 74 6F 20 73 74 | e,.we want to st | | 75 66 66 20 74 68 65 6D 20 75 70 20 73 6F 20 61 | uff them up so a | | 73 20 74 6F 20 6D 61 6B 65 20 73 75 72 65 20 74 | s to make sure t | | 68 61 74 20 74 68 65 20 61 74 74 72 69 62 75 74 | hat the attribut | | 65 73 0A 70 72 65 76 61 69 6C 69 6E 67 20 77 68 | es.prevailing wh | | 65 6E 20 74 68 65 20 69 6E 63 6C 75 64 65 20 77 | en the include w | | 61 73 20 68 69 74 20 61 72 65 20 72 65 73 74 6F | as hit are resto | | 72 65 64 2E 0A 0A 40 70 20 6D 61 78 69 6D 75 6D | red...@p maximum | | 5F 69 6E 70 75 74 5F 6C 69 6E 65 5F 6C 65 6E 67 | _input_line_leng | | 74 68 20 3D 20 36 35 0A 40 3D 2B 0A 0A | th = 65.@=+.. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC15: Test that certain attributes are saved across inclusions.<010> 00002 00002| <010> 00003 00003| 1. Maximum input line length.<010> 00004 00004| 2. Special character.<010> 00005 00005| 3. Local line number.<010> 00006 00006| <010> 00007 00007| To test this, we first set the first two attributes away from the<010> 00008 00008| default. This will enable us to be sure that when they are restored that<010> 00009 00009| they are being restored to their former values and not just set to the<010> 00010 00010| default.<010> 00011 00011| <010> 00012 00012| @=* *! Change the special character.<010> 00013 00013| *p maximum_input_line_length = 75<010> 00014 00014| <010> 00015 00015| Before include.<010> 00016 00016| *i sc15a<010> 00017 00001| This is the include file for test SC15. The SC15 test checks to make<010> 00018 00002| sure that FunnelWeb is saving and restoring three scanning<010> 00019 00003| attributes across include files. We also want to make sure<010> 00020 00004| that the scanner is initializing these attributes correctly within<010> 00021 00005| the include file.<010> 00022 00006| <010> 00023 00007| SC15.4: Make sure that the special character is AT at the start of<010> 00024 00008| include files.<010> 00025 00009| <010> 00026 00010| @ - This should yield an error.<010> 00027 00011| <010> 00028 00012| SC15.5 Ensure that the maximum input line length is 80 at the start<010> 00029 00013| of an include file. If all is well, only the second of the following two<010> 00030 00014| lines will provoke a "line too long" error.<010> 00031 00015| <010> 00032 00016| 12345678901234567890123456789012345678901234567890123456789012345678901234567890<010> 00033 00017| 123456789012345678901234567890123456789012345678901234567890123456789012345678901<010> 00034 00018| <010> 00035 00019| Now that we have checked the default attributes on entering an include file,<010> 00036 00020| we want to stuff them up so as to make sure that the attributes<010> 00037 00021| prevailing when the include was hit are restored.<010> 00038 00022| <010> 00039 00023| @p maximum_input_line_length = 65<010> 00040 00024| @=+<010> 00041 00025| <010> 00042 00017| After include.<010> 00043 00018| <010> 00044 00019| If the maximum input line length has been correctly restored then the<010> 00045 00020| second of the following two lines should give an error, but not the first.<010> 00046 00021| 123456789012345678901234567890123456789012345678901234567890123456789012345<010> 00047 00022| 1234567890123456789012345678901234567890123456789012345678901234567890123456<010> 00048 00023| <010> 00049 00024| If the special character has been preserved, then the following should<010> 00050 00025| generate an error.<010> 00051 00026| <010> 00052 00027| * - This should generate an error if all is well.<010> 00053 00028| <010> 00054 00029| Preservation of the local line number can be checked by looking at the<010> 00055 00030| listing file.<010> 00056 00031| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 9 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC15: Test that certain attributes are saved across inclusions.<010> <010> 1. Maximum input line length.<010> 2. Special character.<010> 3. Local line number.<010> <010> To test this, we first set the first two attributes away from the<010> default. This will enable us to be sure that when they are restored that<010> they are being restored to their former values and not just set to the<010> default.<010> <010> " 0012[04]: Text. Text scrap[White]=" " 0014[01]: Text. Text scrap[Grey]="<010> Before include.<010> " 0017[01]: Text. Text scrap[Grey]="This is the include file for test SC15. The SC15 test checks to make<010> sure that FunnelWeb is saving and restoring three scanning<010> attributes across include files. We also want to make sure<010> that the scanner is initializing these attributes correctly within<010> the include file.<010> <010> SC15.4: Make sure that the special character is AT at the start of<010> include files.<010> <010> " 0026[03]: Text. Text scrap[Grey]=" - This should yield an error.<010> <010> SC15.5 Ensure that the maximum input line length is 80 at the start<010> of an include file. If all is well, only the second of the following two<010> lines will provoke a "line too long" error.<010> <010> 12345678901234567890123456789012345678901234567890123456789012345678901234567890<010> 123456789012345678901234567890123456789012345678901234567890123456789012345678901<010> <010> Now that we have checked the default attributes on entering an include file,<010> we want to stuff them up so as to make sure that the attributes<010> prevailing when the include was hit are restored.<010> <010> " 0040[04]: Text. Text scrap[White]="<010> <010> " 0042[01]: Text. Text scrap[Grey]="After include.<010> <010> If the maximum input line length has been correctly restored then the<010> second of the following two lines should give an error, but not the first.<010> 123456789012345678901234567890123456789012345678901234567890123456789012345<010> 1234567890123456789012345678901234567890123456789012345678901234567890123456<010> <010> If the special character has been preserved, then the following should<010> generate an error.<010> <010> " 0052[03]: Text. Text scrap[Grey]=" - This should generate an error if all is well.<010> <010> Preservation of the local line number can be checked by looking at the<010> listing file.<010> " 0056[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC15: Test that certain attributes are saved across inclusions. 2 2| 3 3| 1. Maximum input line length. 4 4| 2. Special character. 5 5| 3. Local line number. 6 6| 7 7| To test this, we first set the first two attributes away from the 8 8| default. This will enable us to be sure that when they are restored that 9 9| they are being restored to their former values and not just set to the 10 10| default. 11 11| 12 12| @=* *! Change the special character. 13 13| *p maximum_input_line_length = 75 14 14| 15 15| Before include. 16 16| *i sc15a 17 1| This is the include file for test SC15. The SC15 test checks to make 18 2| sure that FunnelWeb is saving and restoring three scanning 19 3| attributes across include files. We also want to make sure 20 4| that the scanner is initializing these attributes correctly within 21 5| the include file. 22 6| 23 7| SC15.4: Make sure that the special character is AT at the start of 24 8| include files. 25 9| 26 10| @ - This should yield an error. Error|.^ is not a legal special sequence. 27 11| 28 12| SC15.5 Ensure that the maximum input line length is 80 at the start 29 13| of an include file. If all is well, only the second of the following two 30 14| lines will provoke a "line too long" error. 31 15| 32 16| 12345678901234567890123456789012345678901234567890123456789012345678901234567890 33 17| 123456789012345678901234567890123456789012345678901234567890123456789012345678901 Error|.................................................................................^Input line is too long (this character is the first offender). |.................................................................................^Currently, the maximum allowable input line length is 80. |.................................................................................^Note: You can change this using a pragma directive (@p). 34 18| 35 19| Now that we have checked the default attributes on entering an include file, 36 20| we want to stuff them up so as to make sure that the attributes 37 21| prevailing when the include was hit are restored. 38 22| 39 23| @p maximum_input_line_length = 65 40 24| @=+ 41 25| 42 17| After include. 43 18| 44 19| If the maximum input line length has been correctly restored then the 45 20| second of the following two lines should give an error, but not the first. 46 21| 123456789012345678901234567890123456789012345678901234567890123456789012345 47 22| 1234567890123456789012345678901234567890123456789012345678901234567890123456 Error|............................................................................^Input line is too long (this character is the first offender). |............................................................................^Currently, the maximum allowable input line length is 75. |............................................................................^Note: You can change this using a pragma directive (@p). 48 23| 49 24| If the special character has been preserved, then the following should 50 25| generate an error. 51 26| 52 27| * - This should generate an error if all is well. Error|.^ is not a legal special sequence. 53 28| 54 29| Preservation of the local line number can be checked by looking at the 55 30| listing file. | ------------+------------------------------------------------------------------- There were 4 Errors. ------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+------fw_src/answers/sc16.lis 644 0 0 47147 6717353662 10313 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 31 36 3A 20 54 65 73 74 20 3C 73 70 65 63 | SC16: Test ^ sequence.. | | 0A 31 2E 20 54 65 73 74 20 74 68 61 74 20 61 6C | .1. Test that al | | 6C 20 62 61 73 65 20 63 68 61 72 61 63 74 65 72 | l base character | | 73 20 77 6F 72 6B 20 28 69 6E 20 62 6F 74 68 20 | s work (in both | | 63 61 73 65 73 29 2E 0A 20 20 20 54 68 65 73 65 | cases).. These | | 20 73 68 6F 75 6C 64 20 70 72 6F 76 6F 6B 65 20 | should provoke | | 6E 6F 20 65 72 72 6F 72 73 2E 0A 0A 20 20 20 40 | no errors... @ | | 5E 42 28 30 30 30 30 30 30 30 30 29 20 20 20 40 | ^B(00000000) @ | | 5E 62 28 30 30 30 30 30 30 30 30 29 0A 20 20 20 | ^b(00000000). | | 40 5E 4F 28 30 30 30 29 20 20 20 40 5E 6F 28 30 | @^O(000) @^o(0 | | 30 30 29 0A 20 20 20 40 5E 51 28 30 30 30 29 20 | 00). @^Q(000) | | 20 20 40 5E 71 28 30 30 30 29 0A 20 20 20 40 5E | @^q(000). @^ | | 44 28 30 30 30 29 20 20 20 40 5E 64 28 30 30 30 | D(000) @^d(000 | | 29 0A 20 20 20 40 5E 48 28 30 30 29 20 20 20 20 | ). @^H(00) | | 40 5E 68 28 30 30 29 0A 20 20 20 40 5E 58 28 30 | @^h(00). @^X(0 | | 30 29 20 20 20 20 40 5E 78 28 30 30 29 0A 0A 32 | 0) @^x(00)..2 | | 2E 20 54 65 73 74 20 74 68 61 74 20 73 6F 6D 65 | . Test that some | | 20 6F 74 68 65 72 20 62 61 73 65 20 63 68 61 72 | other base char | | 61 63 74 65 72 73 20 67 65 6E 65 72 61 74 65 20 | acters generate | | 61 6E 20 65 72 72 6F 72 2E 0A 0A 20 20 20 40 5E | an error... @^ | | 75 28 30 29 0A 20 20 20 40 5E 79 0A 20 20 20 40 | u(0). @^y. @ | | 5E 23 0A 20 20 20 40 5E 28 0A 0A 33 2E 20 54 65 | ^#. @^(..3. Te | | 73 74 20 74 68 61 74 20 61 6E 20 65 72 72 6F 72 | st that an error | | 20 69 73 20 67 65 6E 65 72 61 74 65 64 20 69 66 | is generated if | | 20 70 61 72 65 6E 74 68 65 73 69 73 20 69 73 20 | parenthesis is | | 6D 69 73 73 69 6E 67 2E 0A 0A 20 20 20 40 5E 44 | missing... @^D | | 33 34 29 0A 0A 34 2E 20 54 65 73 74 20 6C 65 67 | 34)..4. Test leg | | 61 6C 20 64 69 67 69 74 73 20 69 6E 20 65 61 63 | al digits in eac | | 68 20 62 61 73 65 2E 0A 0A 20 20 20 40 5E 42 28 | h base... @^B( | | 30 30 30 30 31 31 31 31 29 0A 20 20 20 40 5E 4F | 00001111). @^O | | 28 30 31 32 29 20 20 40 5E 4F 28 30 33 34 29 20 | (012) @^O(034) | | 40 5E 4F 28 30 35 36 29 20 40 5E 4F 28 30 37 37 | @^O(056) @^O(077 | | 29 0A 20 20 20 40 5E 44 28 30 31 32 29 20 20 40 | ). @^D(012) @ | | 5E 44 28 30 33 34 29 20 40 5E 44 28 30 35 36 29 | ^D(034) @^D(056) | | 20 40 5E 44 28 30 37 38 29 20 40 5E 44 28 30 39 | @^D(078) @^D(09 | | 39 29 0A 20 20 20 40 5E 48 28 30 31 29 20 40 5E | 9). @^H(01) @^ | | 48 28 32 33 29 20 40 5E 48 28 34 35 29 20 40 5E | H(23) @^H(45) @^ | | 48 28 36 37 29 0A 20 20 20 40 5E 48 28 38 39 29 | H(67). @^H(89) | | 20 40 5E 48 28 41 42 29 20 40 5E 58 28 43 44 29 | @^H(AB) @^X(CD) | | 20 40 5E 58 28 45 46 29 20 20 40 5E 78 28 61 66 | @^X(EF) @^x(af | | 29 0A 0A 35 2E 20 54 65 73 74 20 69 6C 6C 65 67 | )..5. Test illeg | | 61 6C 20 64 69 67 69 74 73 20 69 6E 20 65 61 63 | al digits in eac | | 68 20 62 61 73 65 2E 0A 0A 20 20 20 40 5E 42 28 | h base... @^B( | | 30 30 30 30 30 30 30 32 29 0A 20 20 20 40 5E 4F | 00000002). @^O | | 28 30 30 38 29 0A 20 20 20 40 5E 44 28 30 30 41 | (008). @^D(00A | | 29 0A 20 20 20 40 5E 48 28 30 47 29 0A 0A 36 2E | ). @^H(0G)..6. | | 20 54 65 73 74 20 77 68 61 74 20 68 61 70 70 65 | Test what happe | | 6E 73 20 69 66 20 74 68 65 72 65 20 61 72 65 20 | ns if there are | | 74 68 65 20 77 72 6F 6E 67 20 6E 75 6D 62 65 72 | the wrong number | | 20 6F 66 20 64 69 67 69 74 73 0A 20 20 20 28 74 | of digits. (t | | 6F 6F 20 66 65 77 2C 20 74 6F 6F 20 6D 61 6E 79 | oo few, too many | | 29 2E 0A 0A 20 20 20 40 5E 42 28 31 29 0A 20 20 | )... @^B(1). | | 20 40 5E 4F 28 31 29 0A 20 20 20 40 5E 44 28 31 | @^O(1). @^D(1 | | 29 0A 20 20 20 40 5E 48 28 31 29 0A 0A 20 20 20 | ). @^H(1).. | | 40 5E 42 28 30 30 30 30 30 30 30 30 31 29 0A 20 | @^B(000000001). | | 20 20 40 5E 4F 28 30 30 30 34 29 0A 20 20 20 40 | @^O(0004). @ | | 5E 44 28 30 30 30 31 29 0A 20 20 20 40 5E 48 28 | ^D(0001). @^H( | | 30 30 35 29 0A 0A 37 2E 20 54 65 73 74 20 74 68 | 005)..7. Test th | | 61 74 20 61 6E 20 65 72 72 6F 72 20 69 73 20 67 | at an error is g | | 65 6E 65 72 61 74 65 64 20 66 6F 72 20 61 20 6D | enerated for a m | | 69 73 73 69 6E 67 20 63 6C 6F 73 69 6E 67 20 70 | issing closing p | | 61 72 65 6E 74 68 65 73 69 73 2E 0A 0A 20 20 40 | arenthesis... @ | | 5E 42 28 30 30 30 30 30 30 30 30 0A 20 20 40 5E | ^B(00000000. @^ | | 44 28 30 34 35 28 0A 0A 38 2E 20 54 65 73 74 20 | D(045(..8. Test | | 77 68 61 74 20 68 61 70 70 65 6E 73 20 69 6E 20 | what happens in | | 6E 75 6D 62 65 72 20 69 73 20 6F 75 74 20 6F 66 | number is out of | | 20 74 68 65 20 72 61 6E 67 65 20 5B 30 2C 32 35 | the range [0,25 | | 35 5D 2E 0A 0A 20 20 40 5E 44 28 32 35 35 29 0A | 5]... @^D(255). | | 20 20 40 5E 44 28 32 35 36 29 0A 20 20 40 5E 44 | @^D(256). @^D | | 28 39 39 39 29 0A 0A | (999).. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC16: Test ^ sequence.<010> 00002 00002| <010> 00003 00003| 1. Test that all base characters work (in both cases).<010> 00004 00004| These should provoke no errors.<010> 00005 00005| <010> 00006 00006| @^B(00000000) @^b(00000000)<010> 00007 00007| @^O(000) @^o(000)<010> 00008 00008| @^Q(000) @^q(000)<010> 00009 00009| @^D(000) @^d(000)<010> 00010 00010| @^H(00) @^h(00)<010> 00011 00011| @^X(00) @^x(00)<010> 00012 00012| <010> 00013 00013| 2. Test that some other base characters generate an error.<010> 00014 00014| <010> 00015 00015| @^u(0)<010> 00016 00016| @^y<010> 00017 00017| @^#<010> 00018 00018| @^(<010> 00019 00019| <010> 00020 00020| 3. Test that an error is generated if parenthesis is missing.<010> 00021 00021| <010> 00022 00022| @^D34)<010> 00023 00023| <010> 00024 00024| 4. Test legal digits in each base.<010> 00025 00025| <010> 00026 00026| @^B(00001111)<010> 00027 00027| @^O(012) @^O(034) @^O(056) @^O(077)<010> 00028 00028| @^D(012) @^D(034) @^D(056) @^D(078) @^D(099)<010> 00029 00029| @^H(01) @^H(23) @^H(45) @^H(67)<010> 00030 00030| @^H(89) @^H(AB) @^X(CD) @^X(EF) @^x(af)<010> 00031 00031| <010> 00032 00032| 5. Test illegal digits in each base.<010> 00033 00033| <010> 00034 00034| @^B(00000002)<010> 00035 00035| @^O(008)<010> 00036 00036| @^D(00A)<010> 00037 00037| @^H(0G)<010> 00038 00038| <010> 00039 00039| 6. Test what happens if there are the wrong number of digits<010> 00040 00040| (too few, too many).<010> 00041 00041| <010> 00042 00042| @^B(1)<010> 00043 00043| @^O(1)<010> 00044 00044| @^D(1)<010> 00045 00045| @^H(1)<010> 00046 00046| <010> 00047 00047| @^B(000000001)<010> 00048 00048| @^O(0004)<010> 00049 00049| @^D(0001)<010> 00050 00050| @^H(005)<010> 00051 00051| <010> 00052 00052| 7. Test that an error is generated for a missing closing parenthesis.<010> 00053 00053| <010> 00054 00054| @^B(00000000<010> 00055 00055| @^D(045(<010> 00056 00056| <010> 00057 00057| 8. Test what happens in number is out of the range [0,255].<010> 00058 00058| <010> 00059 00059| @^D(255)<010> 00060 00060| @^D(256)<010> 00061 00061| @^D(999)<010> 00062 00062| <010> 00063 00063| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 87 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC16: Test ^ sequence.<010> <010> 1. Test that all base characters work (in both cases).<010> These should provoke no errors.<010> <010> " 0006[04]: Text. Text scrap[Grey]="<000>" 0006[17]: Text. Text scrap[White]=" " 0006[20]: Text. Text scrap[Grey]="<000>" 0006[33]: Text. Text scrap[White]="<010> " 0007[04]: Text. Text scrap[Grey]="<000>" 0007[12]: Text. Text scrap[White]=" " 0007[15]: Text. Text scrap[Grey]="<000>" 0007[23]: Text. Text scrap[White]="<010> " 0008[04]: Text. Text scrap[Grey]="<000>" 0008[12]: Text. Text scrap[White]=" " 0008[15]: Text. Text scrap[Grey]="<000>" 0008[23]: Text. Text scrap[White]="<010> " 0009[04]: Text. Text scrap[Grey]="<000>" 0009[12]: Text. Text scrap[White]=" " 0009[15]: Text. Text scrap[Grey]="<000>" 0009[23]: Text. Text scrap[White]="<010> " 0010[04]: Text. Text scrap[Grey]="<000>" 0010[11]: Text. Text scrap[White]=" " 0010[15]: Text. Text scrap[Grey]="<000>" 0010[22]: Text. Text scrap[White]="<010> " 0011[04]: Text. Text scrap[Grey]="<000>" 0011[11]: Text. Text scrap[White]=" " 0011[15]: Text. Text scrap[Grey]="<000>" 0011[22]: Text. Text scrap[Grey]="<010> <010> 2. Test that some other base characters generate an error.<010> <010> " 0015[07]: Text. Text scrap[Grey]="(0)<010> " 0016[07]: Text. Text scrap[White]="<010> " 0017[07]: Text. Text scrap[White]="<010> " 0018[07]: Text. Text scrap[Grey]="<010> <010> 3. Test that an error is generated if parenthesis is missing.<010> <010> " 0022[08]: Text. Text scrap[Grey]="4)<010> <010> 4. Test legal digits in each base.<010> <010> " 0026[04]: Text. Text scrap[Grey]="<015>" 0026[17]: Text. Text scrap[White]="<010> " 0027[04]: Text. Text scrap[Grey]="<010> " 0027[12]: Text. Text scrap[White]=" " 0027[14]: Text. Text scrap[Grey]="<028>" 0027[22]: Text. Text scrap[White]=" " 0027[23]: Text. Text scrap[Grey]="." 0027[31]: Text. Text scrap[White]=" " 0027[32]: Text. Text scrap[Grey]="?" 0027[40]: Text. Text scrap[White]="<010> " 0028[04]: Text. Text scrap[Grey]="<012>" 0028[12]: Text. Text scrap[White]=" " 0028[14]: Text. Text scrap[Grey]=""" 0028[22]: Text. Text scrap[White]=" " 0028[23]: Text. Text scrap[Grey]="8" 0028[31]: Text. Text scrap[White]=" " 0028[32]: Text. Text scrap[Grey]="N" 0028[40]: Text. Text scrap[White]=" " 0028[41]: Text. Text scrap[Grey]="c" 0028[49]: Text. Text scrap[White]="<010> " 0029[04]: Text. Text scrap[Grey]="<001>" 0029[11]: Text. Text scrap[White]=" " 0029[12]: Text. Text scrap[Grey]="#" 0029[19]: Text. Text scrap[White]=" " 0029[20]: Text. Text scrap[Grey]="E" 0029[27]: Text. Text scrap[White]=" " 0029[28]: Text. Text scrap[Grey]="g" 0029[35]: Text. Text scrap[White]="<010> " 0030[04]: Text. Text scrap[Grey]="<137>" 0030[11]: Text. Text scrap[White]=" " 0030[12]: Text. Text scrap[Grey]="<171>" 0030[19]: Text. Text scrap[White]=" " 0030[20]: Text. Text scrap[Grey]="<205>" 0030[27]: Text. Text scrap[White]=" " 0030[28]: Text. Text scrap[Grey]="<239>" 0030[35]: Text. Text scrap[White]=" " 0030[37]: Text. Text scrap[Grey]="<175>" 0030[44]: Text. Text scrap[Grey]="<010> <010> 5. Test illegal digits in each base.<010> <010> " 0034[16]: Text. Text scrap[Grey]=")<010> " 0035[11]: Text. Text scrap[Grey]=")<010> " 0036[11]: Text. Text scrap[Grey]=")<010> " 0037[10]: Text. Text scrap[Grey]=")<010> <010> 6. Test what happens if there are the wrong number of digits<010> (too few, too many).<010> <010> " 0042[10]: Text. Text scrap[White]="<010> " 0043[10]: Text. Text scrap[White]="<010> " 0044[10]: Text. Text scrap[White]="<010> " 0045[10]: Text. Text scrap[White]="<010> <010> " 0047[17]: Text. Text scrap[Grey]=")<010> " 0048[12]: Text. Text scrap[Grey]=")<010> " 0049[12]: Text. Text scrap[Grey]=")<010> " 0050[11]: Text. Text scrap[Grey]=")<010> <010> 7. Test that an error is generated for a missing closing parenthesis.<010> <010> " 0055[01]: Text. Text scrap[White]=" " 0055[11]: Text. Text scrap[Grey]="<010> <010> 8. Test what happens in number is out of the range [0,255].<010> <010> " 0059[03]: Text. Text scrap[Grey]="<255>" 0059[11]: Text. Text scrap[White]="<010> " 0060[11]: Text. Text scrap[White]="<010> " 0061[11]: Text. Text scrap[White]="<010> <010> " 0063[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC16: Test ^ sequence. 2 2| 3 3| 1. Test that all base characters work (in both cases). 4 4| These should provoke no errors. 5 5| 6 6| @^B(00000000) @^b(00000000) 7 7| @^O(000) @^o(000) 8 8| @^Q(000) @^q(000) 9 9| @^D(000) @^d(000) 10 10| @^H(00) @^h(00) 11 11| @^X(00) @^x(00) 12 12| 13 13| 2. Test that some other base characters generate an error. 14 14| 15 15| @^u(0) Error|......^Expecting one of 'B', 'Q', 'D', 'H'. |......^(For Binary, Octal, Decimal, and Hexadecimal). |......^A decimal character representation takes the form "@^D(ddd)". |......^(exactly 3 digits) where each digit d is in the range 0..9. 16 16| @^y Error|......^Expecting one of 'B', 'Q', 'D', 'H'. |......^(For Binary, Octal, Decimal, and Hexadecimal). |......^A decimal character representation takes the form "@^D(ddd)". |......^(exactly 3 digits) where each digit d is in the range 0..9. 17 17| @^# Error|......^Expecting one of 'B', 'Q', 'D', 'H'. |......^(For Binary, Octal, Decimal, and Hexadecimal). |......^A decimal character representation takes the form "@^D(ddd)". |......^(exactly 3 digits) where each digit d is in the range 0..9. 18 18| @^( Error|......^Expecting one of 'B', 'Q', 'D', 'H'. |......^(For Binary, Octal, Decimal, and Hexadecimal). |......^A decimal character representation takes the form "@^D(ddd)". |......^(exactly 3 digits) where each digit d is in the range 0..9. 19 19| 20 20| 3. Test that an error is generated if parenthesis is missing. 21 21| 22 22| @^D34) Error|.......^Expecting '('. |.......^A decimal character representation takes the form "@^D(ddd)". |.......^(exactly 3 digits) where each digit d is in the range 0..9. 23 23| 24 24| 4. Test legal digits in each base. 25 25| 26 26| @^B(00001111) 27 27| @^O(012) @^O(034) @^O(056) @^O(077) 28 28| @^D(012) @^D(034) @^D(056) @^D(078) @^D(099) 29 29| @^H(01) @^H(23) @^H(45) @^H(67) 30 30| @^H(89) @^H(AB) @^X(CD) @^X(EF) @^x(af) 31 31| 32 32| 5. Test illegal digits in each base. 33 33| 34 34| @^B(00000002) Error|...............^Illegal digit. |...............^A binary character representation takes the form "@^B(dddddddd)". |...............^(exactly 8 digits) where each digit d is either 0 or 1. 35 35| @^O(008) Error|..........^Illegal digit. |..........^An octal character representation takes the form "@^Q(ddd)" (or "@^O(ddd)"). |..........^(exactly 3 digits) where each digit d is in the range 0..7. 36 36| @^D(00A) Error|..........^Illegal digit. |..........^A decimal character representation takes the form "@^D(ddd)". |..........^(exactly 3 digits) where each digit d is in the range 0..9. 37 37| @^H(0G) Error|.........^Illegal digit. |.........^A hexadecimal character representation takes the form "@^X(dd)" (or "@^H(dd)"). |.........^(exactly 2 digits) where each digit d is in the range 0..9,A..F. 38 38| 39 39| 6. Test what happens if there are the wrong number of digits 40 40| (too few, too many). 41 41| 42 42| @^B(1) Error|.........^Illegal digit. |.........^A binary character representation takes the form "@^B(dddddddd)". |.........^(exactly 8 digits) where each digit d is either 0 or 1. 43 43| @^O(1) Error|.........^Illegal digit. |.........^An octal character representation takes the form "@^Q(ddd)" (or "@^O(ddd)"). |.........^(exactly 3 digits) where each digit d is in the range 0..7. 44 44| @^D(1) Error|.........^Illegal digit. |.........^A decimal character representation takes the form "@^D(ddd)". |.........^(exactly 3 digits) where each digit d is in the range 0..9. 45 45| @^H(1) Error|.........^Illegal digit. |.........^A hexadecimal character representation takes the form "@^X(dd)" (or "@^H(dd)"). |.........^(exactly 2 digits) where each digit d is in the range 0..9,A..F. 46 46| 47 47| @^B(000000001) Error|................^Expecting ')'. |................^A binary character representation takes the form "@^B(dddddddd)". |................^(exactly 8 digits) where each digit d is either 0 or 1. 48 48| @^O(0004) Error|...........^Expecting ')'. |...........^An octal character representation takes the form "@^Q(ddd)" (or "@^O(ddd)"). |...........^(exactly 3 digits) where each digit d is in the range 0..7. 49 49| @^D(0001) Error|...........^Expecting ')'. |...........^A decimal character representation takes the form "@^D(ddd)". |...........^(exactly 3 digits) where each digit d is in the range 0..9. 50 50| @^H(005) Error|..........^Expecting ')'. |..........^A hexadecimal character representation takes the form "@^X(dd)" (or "@^H(dd)"). |..........^(exactly 2 digits) where each digit d is in the range 0..9,A..F. 51 51| 52 52| 7. Test that an error is generated for a missing closing parenthesis. 53 53| 54 54| @^B(00000000 Error|...............^Expecting ')'. |...............^A binary character representation takes the form "@^B(dddddddd)". |...............^(exactly 8 digits) where each digit d is either 0 or 1. 55 55| @^D(045( Error|..........^Expecting ')'. |..........^A decimal character representation takes the form "@^D(ddd)". |..........^(exactly 3 digits) where each digit d is in the range 0..9. 56 56| 57 57| 8. Test what happens in number is out of the range [0,255]. 58 58| 59 59| @^D(255) 60 60| @^D(256) Error|..........^Character number is too large. |..........^Character number must be in the range [0,255] (decimal). |..........^A decimal character representation takes the form "@^D(ddd)". |..........^(exactly 3 digits) where each digit d is in the range 0..9. 61 61| @^D(999) Error|..........^Character number is too large. |..........^Character number must be in the range [0,255] (decimal). |..........^A decimal character representation takes the form "@^D(ddd)". |..........^(exactly 3 digits) where each digit d is in the range 0..9. 62 62| | ------------+------------------------------------------------------------------- There were 21 Errors. 10> " 0022[08]: Text. Text scrap[Grey]="4)<010> <010> 4. Test legal digits in each base.<010> <010> " 0026[04]: Text. Text scrap[Grey]="<015>" 0026[17]: Text. Text scrap[White]="<010> " 0027[04]: Text. Text scrap[Grey]="<010> " 0027[12]: Text. Text scrap[White]=" " 0027[14]: Text. Text scrap[Grey]="<028>" 0027[22]: Text. Text scrap[White]=" " 0027[23]: Text. Text scrap[Grey]="." 0027[31]: Text. Tfw_src/answers/sc17.lis 644 0 0 33460 6717353664 10307 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 31 37 3A 20 54 65 73 74 20 3C 73 70 65 63 | SC17: Test #...First we | | 20 74 72 69 70 20 75 70 20 74 68 65 20 73 63 61 | trip up the sca | | 6E 6E 65 72 20 73 6F 20 6E 6F 20 66 75 72 74 68 | nner so no furth | | 65 72 20 70 61 73 73 65 73 20 74 61 6B 65 20 70 | er passes take p | | 6C 61 63 65 2E 0A 0A 40 0A 0A 31 2E 20 54 65 73 | lace...@..1. Tes | | 74 20 77 69 74 68 20 61 6C 6C 20 70 6F 73 73 69 | t with all possi | | 62 6C 65 20 70 72 69 6E 74 61 62 6C 65 20 63 68 | ble printable ch | | 61 72 61 63 74 65 72 73 2E 0A 0A 40 23 21 20 40 | aracters...@#! @ | | 23 22 20 40 23 23 20 40 23 24 20 40 23 25 20 40 | #" @## @#$ @#% @ | | 23 26 20 40 23 27 20 40 23 28 20 40 23 29 20 40 | #& @#' @#( @#) @ | | 23 2A 20 40 23 2B 20 40 23 2C 20 40 23 2D 20 40 | #* @#+ @#, @#- @ | | 23 2E 20 40 23 2F 0A 40 23 30 20 40 23 31 20 40 | #. @#/.@#0 @#1 @ | | 23 32 20 40 23 33 20 40 23 34 20 40 23 35 20 40 | #2 @#3 @#4 @#5 @ | | 23 36 20 40 23 37 20 40 23 38 20 40 23 39 20 40 | #6 @#7 @#8 @#9 @ | | 23 3A 20 40 23 3B 20 40 23 3C 20 40 23 3D 20 40 | #: @#; @#< @#= @ | | 23 3E 0A 40 23 3F 20 40 23 40 20 40 23 41 20 40 | #>.@#? @#@ @#A @ | | 23 42 20 40 23 43 20 40 23 44 20 40 23 45 20 40 | #B @#C @#D @#E @ | | 23 46 20 40 23 47 20 40 23 48 20 40 23 49 20 40 | #F @#G @#H @#I @ | | 23 4A 20 40 23 4B 20 40 23 4C 20 40 23 4D 0A 40 | #J @#K @#L @#M.@ | | 23 4E 20 40 23 4F 20 40 23 50 20 40 23 51 20 40 | #N @#O @#P @#Q @ | | 23 52 20 40 23 53 20 40 23 54 20 40 23 55 20 40 | #R @#S @#T @#U @ | | 23 56 20 40 23 57 20 40 23 58 20 40 23 59 20 40 | #V @#W @#X @#Y @ | | 23 5A 20 40 23 5B 20 40 23 5C 0A 40 23 5D 20 40 | #Z @#[ @#\.@#] @ | | 23 5E 20 40 23 5F 20 40 23 60 20 40 23 61 20 40 | #^ @#_ @#` @#a @ | | 23 62 20 40 23 63 20 40 23 64 20 40 23 65 20 40 | #b @#c @#d @#e @ | | 23 66 20 40 23 67 20 40 23 68 20 40 23 69 20 40 | #f @#g @#h @#i @ | | 23 6A 20 40 23 6B 0A 40 23 6C 20 40 23 6D 20 40 | #j @#k.@#l @#m @ | | 23 6E 20 40 23 6F 20 40 23 70 20 40 23 71 20 40 | #n @#o @#p @#q @ | | 23 72 20 40 23 73 20 40 23 74 20 40 23 75 20 40 | #r @#s @#t @#u @ | | 23 76 20 40 23 77 20 40 23 78 20 40 23 79 20 40 | #v @#w @#x @#y @ | | 23 7A 0A 40 23 7B 20 40 23 7C 20 40 23 7D 20 40 | #z.@#{ @#| @#} @ | | 23 7E 0A 0A 32 2E 20 54 65 73 74 20 74 68 61 74 | #~..2. Test that | | 20 3C 73 70 65 63 69 61 6C 3E 23 3C 73 70 61 63 | # is flagged as | | 20 61 6E 20 65 72 72 6F 72 2E 0A 0A 20 20 20 40 | an error... @ | | 23 20 20 20 20 20 40 21 20 53 68 6F 75 6C 64 20 | # @! Should | | 62 65 20 66 6C 61 67 67 65 64 20 61 73 20 61 6E | be flagged as an | | 20 65 72 72 6F 72 2E 0A 0A 33 2E 20 54 65 73 74 | error...3. Test | | 20 74 68 61 74 20 3C 73 70 65 63 69 61 6C 3E 23 | that # | | 45 4F 4C 20 69 73 20 66 6C 61 67 67 65 64 20 61 | EOL is flagged a | | 73 20 61 6E 20 65 72 72 6F 72 2E 0A 0A 20 20 20 | s an error... | | 40 23 0A 0A | @#.. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC17: Test #.<010> 00002 00002| <010> 00003 00003| First we trip up the scanner so no further passes take place.<010> 00004 00004| <010> 00005 00005| @<010> 00006 00006| <010> 00007 00007| 1. Test with all possible printable characters.<010> 00008 00008| <010> 00009 00009| @#! @#" @## @#$ @#% @#& @#' @#( @#) @#* @#+ @#, @#- @#. @#/<010> 00010 00010| @#0 @#1 @#2 @#3 @#4 @#5 @#6 @#7 @#8 @#9 @#: @#; @#< @#= @#><010> 00011 00011| @#? @#@ @#A @#B @#C @#D @#E @#F @#G @#H @#I @#J @#K @#L @#M<010> 00012 00012| @#N @#O @#P @#Q @#R @#S @#T @#U @#V @#W @#X @#Y @#Z @#[ @#\<010> 00013 00013| @#] @#^ @#_ @#` @#a @#b @#c @#d @#e @#f @#g @#h @#i @#j @#k<010> 00014 00014| @#l @#m @#n @#o @#p @#q @#r @#s @#t @#u @#v @#w @#x @#y @#z<010> 00015 00015| @#{ @#| @#} @#~<010> 00016 00016| <010> 00017 00017| 2. Test that # is flagged as an error.<010> 00018 00018| <010> 00019 00019| @# @! Should be flagged as an error.<010> 00020 00020| <010> 00021 00021| 3. Test that #EOL is flagged as an error.<010> 00022 00022| <010> 00023 00023| @#<010> 00024 00024| <010> 00025 00025| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 194 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC17: Test #.<010> <010> First we trip up the scanner so no further passes take place.<010> <010> " 0006[01]: Text. Text scrap[Grey]="<010> 1. Test with all possible printable characters.<010> <010> " 0009[01]: @# Name. Character='!'. 0009[04]: Text. Text scrap[White]=" " 0009[05]: @# Name. Character='"'. 0009[08]: Text. Text scrap[White]=" " 0009[09]: @# Name. Character='#'. 0009[12]: Text. Text scrap[White]=" " 0009[13]: @# Name. Character='$'. 0009[16]: Text. Text scrap[White]=" " 0009[17]: @# Name. Character='%'. 0009[20]: Text. Text scrap[White]=" " 0009[21]: @# Name. Character='&'. 0009[24]: Text. Text scrap[White]=" " 0009[25]: @# Name. Character='''. 0009[28]: Text. Text scrap[White]=" " 0009[29]: @# Name. Character='('. 0009[32]: Text. Text scrap[White]=" " 0009[33]: @# Name. Character=')'. 0009[36]: Text. Text scrap[White]=" " 0009[37]: @# Name. Character='*'. 0009[40]: Text. Text scrap[White]=" " 0009[41]: @# Name. Character='+'. 0009[44]: Text. Text scrap[White]=" " 0009[45]: @# Name. Character=','. 0009[48]: Text. Text scrap[White]=" " 0009[49]: @# Name. Character='-'. 0009[52]: Text. Text scrap[White]=" " 0009[53]: @# Name. Character='.'. 0009[56]: Text. Text scrap[White]=" " 0009[57]: @# Name. Character='/'. 0009[60]: Text. Text scrap[White]="<010> " 0010[01]: @# Name. Character='0'. 0010[04]: Text. Text scrap[White]=" " 0010[05]: @# Name. Character='1'. 0010[08]: Text. Text scrap[White]=" " 0010[09]: @# Name. Character='2'. 0010[12]: Text. Text scrap[White]=" " 0010[13]: @# Name. Character='3'. 0010[16]: Text. Text scrap[White]=" " 0010[17]: @# Name. Character='4'. 0010[20]: Text. Text scrap[White]=" " 0010[21]: @# Name. Character='5'. 0010[24]: Text. Text scrap[White]=" " 0010[25]: @# Name. Character='6'. 0010[28]: Text. Text scrap[White]=" " 0010[29]: @# Name. Character='7'. 0010[32]: Text. Text scrap[White]=" " 0010[33]: @# Name. Character='8'. 0010[36]: Text. Text scrap[White]=" " 0010[37]: @# Name. Character='9'. 0010[40]: Text. Text scrap[White]=" " 0010[41]: @# Name. Character=':'. 0010[44]: Text. Text scrap[White]=" " 0010[45]: @# Name. Character=';'. 0010[48]: Text. Text scrap[White]=" " 0010[49]: @# Name. Character='<'. 0010[52]: Text. Text scrap[White]=" " 0010[53]: @# Name. Character='='. 0010[56]: Text. Text scrap[White]=" " 0010[57]: @# Name. Character='>'. 0010[60]: Text. Text scrap[White]="<010> " 0011[01]: @# Name. Character='?'. 0011[04]: Text. Text scrap[White]=" " 0011[05]: @# Name. Character='@'. 0011[08]: Text. Text scrap[White]=" " 0011[09]: @# Name. Character='A'. 0011[12]: Text. Text scrap[White]=" " 0011[13]: @# Name. Character='B'. 0011[16]: Text. Text scrap[White]=" " 0011[17]: @# Name. Character='C'. 0011[20]: Text. Text scrap[White]=" " 0011[21]: @# Name. Character='D'. 0011[24]: Text. Text scrap[White]=" " 0011[25]: @# Name. Character='E'. 0011[28]: Text. Text scrap[White]=" " 0011[29]: @# Name. Character='F'. 0011[32]: Text. Text scrap[White]=" " 0011[33]: @# Name. Character='G'. 0011[36]: Text. Text scrap[White]=" " 0011[37]: @# Name. Character='H'. 0011[40]: Text. Text scrap[White]=" " 0011[41]: @# Name. Character='I'. 0011[44]: Text. Text scrap[White]=" " 0011[45]: @# Name. Character='J'. 0011[48]: Text. Text scrap[White]=" " 0011[49]: @# Name. Character='K'. 0011[52]: Text. Text scrap[White]=" " 0011[53]: @# Name. Character='L'. 0011[56]: Text. Text scrap[White]=" " 0011[57]: @# Name. Character='M'. 0011[60]: Text. Text scrap[White]="<010> " 0012[01]: @# Name. Character='N'. 0012[04]: Text. Text scrap[White]=" " 0012[05]: @# Name. Character='O'. 0012[08]: Text. Text scrap[White]=" " 0012[09]: @# Name. Character='P'. 0012[12]: Text. Text scrap[White]=" " 0012[13]: @# Name. Character='Q'. 0012[16]: Text. Text scrap[White]=" " 0012[17]: @# Name. Character='R'. 0012[20]: Text. Text scrap[White]=" " 0012[21]: @# Name. Character='S'. 0012[24]: Text. Text scrap[White]=" " 0012[25]: @# Name. Character='T'. 0012[28]: Text. Text scrap[White]=" " 0012[29]: @# Name. Character='U'. 0012[32]: Text. Text scrap[White]=" " 0012[33]: @# Name. Character='V'. 0012[36]: Text. Text scrap[White]=" " 0012[37]: @# Name. Character='W'. 0012[40]: Text. Text scrap[White]=" " 0012[41]: @# Name. Character='X'. 0012[44]: Text. Text scrap[White]=" " 0012[45]: @# Name. Character='Y'. 0012[48]: Text. Text scrap[White]=" " 0012[49]: @# Name. Character='Z'. 0012[52]: Text. Text scrap[White]=" " 0012[53]: @# Name. Character='['. 0012[56]: Text. Text scrap[White]=" " 0012[57]: @# Name. Character='\'. 0012[60]: Text. Text scrap[White]="<010> " 0013[01]: @# Name. Character=']'. 0013[04]: Text. Text scrap[White]=" " 0013[05]: @# Name. Character='^'. 0013[08]: Text. Text scrap[White]=" " 0013[09]: @# Name. Character='_'. 0013[12]: Text. Text scrap[White]=" " 0013[13]: @# Name. Character='`'. 0013[16]: Text. Text scrap[White]=" " 0013[17]: @# Name. Character='a'. 0013[20]: Text. Text scrap[White]=" " 0013[21]: @# Name. Character='b'. 0013[24]: Text. Text scrap[White]=" " 0013[25]: @# Name. Character='c'. 0013[28]: Text. Text scrap[White]=" " 0013[29]: @# Name. Character='d'. 0013[32]: Text. Text scrap[White]=" " 0013[33]: @# Name. Character='e'. 0013[36]: Text. Text scrap[White]=" " 0013[37]: @# Name. Character='f'. 0013[40]: Text. Text scrap[White]=" " 0013[41]: @# Name. Character='g'. 0013[44]: Text. Text scrap[White]=" " 0013[45]: @# Name. Character='h'. 0013[48]: Text. Text scrap[White]=" " 0013[49]: @# Name. Character='i'. 0013[52]: Text. Text scrap[White]=" " 0013[53]: @# Name. Character='j'. 0013[56]: Text. Text scrap[White]=" " 0013[57]: @# Name. Character='k'. 0013[60]: Text. Text scrap[White]="<010> " 0014[01]: @# Name. Character='l'. 0014[04]: Text. Text scrap[White]=" " 0014[05]: @# Name. Character='m'. 0014[08]: Text. Text scrap[White]=" " 0014[09]: @# Name. Character='n'. 0014[12]: Text. Text scrap[White]=" " 0014[13]: @# Name. Character='o'. 0014[16]: Text. Text scrap[White]=" " 0014[17]: @# Name. Character='p'. 0014[20]: Text. Text scrap[White]=" " 0014[21]: @# Name. Character='q'. 0014[24]: Text. Text scrap[White]=" " 0014[25]: @# Name. Character='r'. 0014[28]: Text. Text scrap[White]=" " 0014[29]: @# Name. Character='s'. 0014[32]: Text. Text scrap[White]=" " 0014[33]: @# Name. Character='t'. 0014[36]: Text. Text scrap[White]=" " 0014[37]: @# Name. Character='u'. 0014[40]: Text. Text scrap[White]=" " 0014[41]: @# Name. Character='v'. 0014[44]: Text. Text scrap[White]=" " 0014[45]: @# Name. Character='w'. 0014[48]: Text. Text scrap[White]=" " 0014[49]: @# Name. Character='x'. 0014[52]: Text. Text scrap[White]=" " 0014[53]: @# Name. Character='y'. 0014[56]: Text. Text scrap[White]=" " 0014[57]: @# Name. Character='z'. 0014[60]: Text. Text scrap[White]="<010> " 0015[01]: @# Name. Character='{'. 0015[04]: Text. Text scrap[White]=" " 0015[05]: @# Name. Character='|'. 0015[08]: Text. Text scrap[White]=" " 0015[09]: @# Name. Character='}'. 0015[12]: Text. Text scrap[White]=" " 0015[13]: @# Name. Character='~'. 0015[16]: Text. Text scrap[Grey]="<010> <010> 2. Test that # is flagged as an error.<010> <010> " 0019[07]: Text. Text scrap[White]=" " 0020[01]: Text. Text scrap[Grey]="<010> 3. Test that #EOL is flagged as an error.<010> <010> " 0024[01]: Text. Text scrap[White]="<010> " 0025[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC17: Test #. 2 2| 3 3| First we trip up the scanner so no further passes take place. 4 4| 5 5| @ Error|.^ is not a legal special sequence. 6 6| 7 7| 1. Test with all possible printable characters. 8 8| 9 9| @#! @#" @## @#$ @#% @#& @#' @#( @#) @#* @#+ @#, @#- @#. @#/ 10 10| @#0 @#1 @#2 @#3 @#4 @#5 @#6 @#7 @#8 @#9 @#: @#; @#< @#= @#> 11 11| @#? @#@ @#A @#B @#C @#D @#E @#F @#G @#H @#I @#J @#K @#L @#M 12 12| @#N @#O @#P @#Q @#R @#S @#T @#U @#V @#W @#X @#Y @#Z @#[ @#\ 13 13| @#] @#^ @#_ @#` @#a @#b @#c @#d @#e @#f @#g @#h @#i @#j @#k 14 14| @#l @#m @#n @#o @#p @#q @#r @#s @#t @#u @#v @#w @#x @#y @#z 15 15| @#{ @#| @#} @#~ 16 16| 17 17| 2. Test that # is flagged as an error. 18 18| 19 19| @# @! Should be flagged as an error. Error|......^Expecting a printable character. 20 20| 21 21| 3. Test that #EOL is flagged as an error. 22 22| 23 23| @# Error|......^Expecting a printable character. 24 24| | ------------+------------------------------------------------------------------- There were 3 Errors. possible printable characters.<010> 00008 00008| <010> 00009 00009| @#! @#" @## @#$ @#% @#& @#' @#( @#) @#* @#+ @#, @#- @#. @#/<010> 00010 00010| @#0 @#1 @#2 @#3 @#4 @#5 @#6 @#7 @#8 @#9 @#: @#; @#< @#= @#><0fw_src/answers/sc18.lis 644 0 0 25532 6717353665 10312 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 31 38 3A 20 54 65 73 74 20 3C 73 70 65 63 | SC18: Test #=..First we | | 20 74 72 69 70 20 75 70 20 74 68 65 20 73 63 61 | trip up the sca | | 6E 6E 65 72 20 73 6F 20 6E 6F 20 66 75 72 74 68 | nner so no furth | | 65 72 20 70 61 73 73 65 73 20 74 61 6B 65 20 70 | er passes take p | | 6C 61 63 65 2E 0A 0A 40 0A 0A 31 2E 20 54 65 73 | lace...@..1. Tes | | 74 20 77 69 74 68 20 61 6C 6C 20 70 6F 73 73 69 | t with all possi | | 62 6C 65 20 70 72 69 6E 74 61 62 6C 65 20 63 68 | ble printable ch | | 61 72 61 63 74 65 72 73 2E 0A 0A 40 3D 21 20 21 | aracters...@=! ! | | 3D 22 20 22 3D 23 20 23 3D 24 20 24 3D 25 20 25 | =" "=# #=$ $=% % | | 3D 26 20 26 3D 27 20 27 3D 28 20 28 3D 29 20 29 | =& &=' '=( (=) ) | | 3D 2A 20 2A 3D 2B 20 2B 3D 2C 20 2C 3D 2D 20 2D | =* *=+ +=, ,=- - | | 3D 2E 20 2E 3D 2F 0A 2F 3D 30 20 30 3D 31 20 31 | =. .=/./=0 0=1 1 | | 3D 32 20 32 3D 33 20 33 3D 34 20 34 3D 35 20 35 | =2 2=3 3=4 4=5 5 | | 3D 36 20 36 3D 37 20 37 3D 38 20 38 3D 39 20 39 | =6 6=7 7=8 8=9 9 | | 3D 3A 20 3A 3D 3B 20 3B 3D 3C 20 3C 3D 3D 20 3D | =: :=; ;=< <== = | | 3D 3E 0A 3E 3D 3F 20 3F 3D 40 20 40 3D 41 20 41 | =>.>=? ?=@ @=A A | | 3D 42 20 42 3D 43 20 43 3D 44 20 44 3D 45 20 45 | =B B=C C=D D=E E | | 3D 46 20 46 3D 47 20 47 3D 48 20 48 3D 49 20 49 | =F F=G G=H H=I I | | 3D 4A 20 4A 3D 4B 20 4B 3D 4C 20 4C 3D 4D 0A 4D | =J J=K K=L L=M.M | | 3D 4E 20 4E 3D 4F 20 4F 3D 50 20 50 3D 51 20 51 | =N N=O O=P P=Q Q | | 3D 52 20 52 3D 53 20 53 3D 54 20 54 3D 55 20 55 | =R R=S S=T T=U U | | 3D 56 20 56 3D 57 20 57 3D 58 20 58 3D 59 20 59 | =V V=W W=X X=Y Y | | 3D 5A 20 5A 3D 5B 20 5B 3D 5C 0A 5C 3D 5D 20 5D | =Z Z=[ [=\.\=] ] | | 3D 5E 20 5E 3D 5F 20 5F 3D 60 20 60 3D 61 20 61 | =^ ^=_ _=` `=a a | | 3D 62 20 62 3D 63 20 63 3D 64 20 64 3D 65 20 65 | =b b=c c=d d=e e | | 3D 66 20 66 3D 67 20 67 3D 68 20 68 3D 69 20 69 | =f f=g g=h h=i i | | 3D 6A 20 6A 3D 6B 0A 6B 3D 6C 20 6C 3D 6D 20 6D | =j j=k.k=l l=m m | | 3D 6E 20 6E 3D 6F 20 6F 3D 70 20 70 3D 71 20 71 | =n n=o o=p p=q q | | 3D 72 20 72 3D 73 20 73 3D 74 20 74 3D 75 20 75 | =r r=s s=t t=u u | | 3D 76 20 76 3D 77 20 77 3D 78 20 78 3D 79 20 79 | =v v=w w=x x=y y | | 3D 7A 0A 7A 3D 7B 20 7B 3D 7C 20 7C 3D 7D 20 7D | =z.z={ {=| |=} } | | 3D 7E 20 7E 3D 40 0A 0A 32 2E 20 54 65 73 74 20 | =~ ~=@..2. Test | | 74 68 61 74 20 3C 73 70 65 63 69 61 6C 3E 3D 3C | that =< | | 73 70 61 63 65 3E 20 69 73 20 66 6C 61 67 67 65 | space> is flagge | | 64 20 61 73 20 61 6E 20 65 72 72 6F 72 2E 0A 0A | d as an error... | | 20 20 20 40 3D 20 20 20 20 20 40 21 20 53 68 6F | @= @! Sho | | 75 6C 64 20 62 65 20 66 6C 61 67 67 65 64 20 61 | uld be flagged a | | 73 20 61 6E 20 65 72 72 6F 72 2E 0A 0A 33 2E 20 | s an error...3. | | 54 65 73 74 20 74 68 61 74 20 3C 73 70 65 63 69 | Test that =EOL is flagg | | 65 64 20 61 73 20 61 6E 20 65 72 72 6F 72 2E 0A | ed as an error.. | | 0A 20 20 20 40 3D 0A 0A | . @=.. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC18: Test #=<010> 00002 00002| <010> 00003 00003| First we trip up the scanner so no further passes take place.<010> 00004 00004| <010> 00005 00005| @<010> 00006 00006| <010> 00007 00007| 1. Test with all possible printable characters.<010> 00008 00008| <010> 00009 00009| @=! !=" "=# #=$ $=% %=& &=' '=( (=) )=* *=+ +=, ,=- -=. .=/<010> 00010 00010| /=0 0=1 1=2 2=3 3=4 4=5 5=6 6=7 7=8 8=9 9=: :=; ;=< <== ==><010> 00011 00011| >=? ?=@ @=A A=B B=C C=D D=E E=F F=G G=H H=I I=J J=K K=L L=M<010> 00012 00012| M=N N=O O=P P=Q Q=R R=S S=T T=U U=V V=W W=X X=Y Y=Z Z=[ [=\<010> 00013 00013| \=] ]=^ ^=_ _=` `=a a=b b=c c=d d=e e=f f=g g=h h=i i=j j=k<010> 00014 00014| k=l l=m m=n n=o o=p p=q q=r r=s s=t t=u u=v v=w w=x x=y y=z<010> 00015 00015| z={ {=| |=} }=~ ~=@<010> 00016 00016| <010> 00017 00017| 2. Test that = is flagged as an error.<010> 00018 00018| <010> 00019 00019| @= @! Should be flagged as an error.<010> 00020 00020| <010> 00021 00021| 3. Test that =EOL is flagged as an error.<010> 00022 00022| <010> 00023 00023| @=<010> 00024 00024| <010> 00025 00025| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 101 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC18: Test #=<010> <010> First we trip up the scanner so no further passes take place.<010> <010> " 0006[01]: Text. Text scrap[Grey]="<010> 1. Test with all possible printable characters.<010> <010> " 0009[04]: Text. Text scrap[White]=" " 0009[08]: Text. Text scrap[White]=" " 0009[12]: Text. Text scrap[White]=" " 0009[16]: Text. Text scrap[White]=" " 0009[20]: Text. Text scrap[White]=" " 0009[24]: Text. Text scrap[White]=" " 0009[28]: Text. Text scrap[White]=" " 0009[32]: Text. Text scrap[White]=" " 0009[36]: Text. Text scrap[White]=" " 0009[40]: Text. Text scrap[White]=" " 0009[44]: Text. Text scrap[White]=" " 0009[48]: Text. Text scrap[White]=" " 0009[52]: Text. Text scrap[White]=" " 0009[56]: Text. Text scrap[White]=" " 0009[60]: Text. Text scrap[White]="<010> " 0010[04]: Text. Text scrap[White]=" " 0010[08]: Text. Text scrap[White]=" " 0010[12]: Text. Text scrap[White]=" " 0010[16]: Text. Text scrap[White]=" " 0010[20]: Text. Text scrap[White]=" " 0010[24]: Text. Text scrap[White]=" " 0010[28]: Text. Text scrap[White]=" " 0010[32]: Text. Text scrap[White]=" " 0010[36]: Text. Text scrap[White]=" " 0010[40]: Text. Text scrap[White]=" " 0010[44]: Text. Text scrap[White]=" " 0010[48]: Text. Text scrap[White]=" " 0010[52]: Text. Text scrap[White]=" " 0010[56]: Text. Text scrap[White]=" " 0010[60]: Text. Text scrap[White]="<010> " 0011[04]: Text. Text scrap[White]=" " 0011[08]: Text. Text scrap[White]=" " 0011[12]: Text. Text scrap[White]=" " 0011[16]: Text. Text scrap[White]=" " 0011[20]: Text. Text scrap[White]=" " 0011[24]: Text. Text scrap[White]=" " 0011[28]: Text. Text scrap[White]=" " 0011[32]: Text. Text scrap[White]=" " 0011[36]: Text. Text scrap[White]=" " 0011[40]: Text. Text scrap[White]=" " 0011[44]: Text. Text scrap[White]=" " 0011[48]: Text. Text scrap[White]=" " 0011[52]: Text. Text scrap[White]=" " 0011[56]: Text. Text scrap[White]=" " 0011[60]: Text. Text scrap[White]="<010> " 0012[04]: Text. Text scrap[White]=" " 0012[08]: Text. Text scrap[White]=" " 0012[12]: Text. Text scrap[White]=" " 0012[16]: Text. Text scrap[White]=" " 0012[20]: Text. Text scrap[White]=" " 0012[24]: Text. Text scrap[White]=" " 0012[28]: Text. Text scrap[White]=" " 0012[32]: Text. Text scrap[White]=" " 0012[36]: Text. Text scrap[White]=" " 0012[40]: Text. Text scrap[White]=" " 0012[44]: Text. Text scrap[White]=" " 0012[48]: Text. Text scrap[White]=" " 0012[52]: Text. Text scrap[White]=" " 0012[56]: Text. Text scrap[White]=" " 0012[60]: Text. Text scrap[White]="<010> " 0013[04]: Text. Text scrap[White]=" " 0013[08]: Text. Text scrap[White]=" " 0013[12]: Text. Text scrap[White]=" " 0013[16]: Text. Text scrap[White]=" " 0013[20]: Text. Text scrap[White]=" " 0013[24]: Text. Text scrap[White]=" " 0013[28]: Text. Text scrap[White]=" " 0013[32]: Text. Text scrap[White]=" " 0013[36]: Text. Text scrap[White]=" " 0013[40]: Text. Text scrap[White]=" " 0013[44]: Text. Text scrap[White]=" " 0013[48]: Text. Text scrap[White]=" " 0013[52]: Text. Text scrap[White]=" " 0013[56]: Text. Text scrap[White]=" " 0013[60]: Text. Text scrap[White]="<010> " 0014[04]: Text. Text scrap[White]=" " 0014[08]: Text. Text scrap[White]=" " 0014[12]: Text. Text scrap[White]=" " 0014[16]: Text. Text scrap[White]=" " 0014[20]: Text. Text scrap[White]=" " 0014[24]: Text. Text scrap[White]=" " 0014[28]: Text. Text scrap[White]=" " 0014[32]: Text. Text scrap[White]=" " 0014[36]: Text. Text scrap[White]=" " 0014[40]: Text. Text scrap[White]=" " 0014[44]: Text. Text scrap[White]=" " 0014[48]: Text. Text scrap[White]=" " 0014[52]: Text. Text scrap[White]=" " 0014[56]: Text. Text scrap[White]=" " 0014[60]: Text. Text scrap[White]="<010> " 0015[04]: Text. Text scrap[White]=" " 0015[08]: Text. Text scrap[White]=" " 0015[12]: Text. Text scrap[White]=" " 0015[16]: Text. Text scrap[White]=" " 0015[20]: Text. Text scrap[Grey]="<010> <010> 2. Test that = is flagged as an error.<010> <010> " 0019[07]: Text. Text scrap[White]=" " 0020[01]: Text. Text scrap[Grey]="<010> 3. Test that =EOL is flagged as an error.<010> <010> " 0024[01]: Text. Text scrap[White]="<010> " 0025[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC18: Test #= 2 2| 3 3| First we trip up the scanner so no further passes take place. 4 4| 5 5| @ Error|.^ is not a legal special sequence. 6 6| 7 7| 1. Test with all possible printable characters. 8 8| 9 9| @=! !=" "=# #=$ $=% %=& &=' '=( (=) )=* *=+ +=, ,=- -=. .=/ 10 10| /=0 0=1 1=2 2=3 3=4 4=5 5=6 6=7 7=8 8=9 9=: :=; ;=< <== ==> 11 11| >=? ?=@ @=A A=B B=C C=D D=E E=F F=G G=H H=I I=J J=K K=L L=M 12 12| M=N N=O O=P P=Q Q=R R=S S=T T=U U=V V=W W=X X=Y Y=Z Z=[ [=\ 13 13| \=] ]=^ ^=_ _=` `=a a=b b=c c=d d=e e=f f=g g=h h=i i=j j=k 14 14| k=l l=m m=n n=o o=p p=q q=r r=s s=t t=u u=v v=w w=x x=y y=z 15 15| z={ {=| |=} }=~ ~=@ 16 16| 17 17| 2. Test that = is flagged as an error. 18 18| 19 19| @= @! Should be flagged as an error. Error|....^You cannot set the special character to ! |....^Special sequence ignored. 20 20| 21 21| 3. Test that =EOL is flagged as an error. 22 22| 23 23| @= Error|....^You cannot set the special character to ! |....^Special sequence ignored. 24 24| | ------------+------------------------------------------------------------------- There were 3 Errors. 65 20 70 72 69 6E 74 61 62 6C 65 20 63 68 | ble printable ch | | 61 72 61 63 74 65 72 73 2E 0A 0A 40 3D 21 20 21 | aracters...@=! ! | | 3D 22 20 22 3D 23 20 23 3D 24fw_src/answers/sc19.lis 644 0 0 7417 6717353667 10277 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 31 39 3A 20 54 65 73 74 20 3C 73 70 65 63 | SC19: Test -..1. Test t | | 68 61 74 20 65 72 72 6F 72 20 69 73 20 66 6C 61 | hat error is fla | | 67 67 65 64 20 69 66 20 73 65 71 75 65 6E 63 65 | gged if sequence | | 20 69 73 20 6E 6F 74 20 61 74 20 74 68 65 20 65 | is not at the e | | 6E 64 20 6F 66 20 61 20 6C 69 6E 65 2E 0A 0A 54 | nd of a line...T | | 68 69 73 20 69 73 20 61 20 6C 69 6E 65 20 63 6F | his is a line co | | 6E 74 61 69 6E 69 6E 67 20 40 2D 20 74 68 65 20 | ntaining @- the | | 65 6E 64 20 6F 66 20 6C 69 6E 65 20 73 75 70 70 | end of line supp | | 72 65 73 73 6F 72 2E 0A 0A 32 2E 20 54 65 73 74 | ressor...2. Test | | 20 74 68 65 20 73 65 71 75 65 6E 63 65 20 66 6F | the sequence fo | | 6C 6C 6F 77 65 64 20 62 79 20 74 72 61 69 6C 69 | llowed by traili | | 6E 67 20 62 6C 61 6E 6B 73 2E 0A 0A 20 20 20 20 | ng blanks... | | 20 40 2D 20 20 20 0A 0A | @- .. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC19: Test -<010> 00002 00002| <010> 00003 00003| 1. Test that error is flagged if sequence is not at the end of a line.<010> 00004 00004| <010> 00005 00005| This is a line containing @- the end of line suppressor.<010> 00006 00006| <010> 00007 00007| 2. Test the sequence followed by trailing blanks.<010> 00008 00008| <010> 00009 00009| @- <010> 00010 00010| <010> 00011 00011| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 4 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC19: Test -<010> <010> 1. Test that error is flagged if sequence is not at the end of a line.<010> <010> This is a line containing " 0005[29]: Text. Text scrap[Grey]=" the end of line suppressor.<010> <010> 2. Test the sequence followed by trailing blanks.<010> <010> " 0009[08]: Text. Text scrap[White]=" <010> <010> " 0011[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC19: Test - 2 2| 3 3| 1. Test that error is flagged if sequence is not at the end of a line. 4 4| 5 5| This is a line containing @- the end of line suppressor. Error|...........................^Suppress EOL sequence is legal only at the end of a line. 6 6| 7 7| 2. Test the sequence followed by trailing blanks. 8 8| 9 9| @- Error|......^Suppress EOL sequence is legal only at the end of a line. Warning|..........^Line has trailing spaces up to and including this space. 10 10| | ------------+------------------------------------------------------------------- There were 2 Errors and 1 Warning. le printable characters.<010> <010> " 0009[04]: Text. Text scrap[White]=" " 0009[08]: Text. Text scrap[White]=" " 0009[12]: Text. Text scrap[White]=" " 0009[16]: Text. Text scrap[White]=" " 0009[20]: Text. Text scrap[White]=" " 0009[24]: Texfw_src/answers/sc20.lis 644 0 0 7621 6717353667 10264 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 32 30 3A 20 54 65 73 74 20 40 21 0A 0A 31 | SC20: Test @!..1 | | 2E 20 54 65 73 74 20 61 74 20 74 68 65 20 73 74 | . Test at the st | | 61 72 74 20 6F 66 20 61 20 6C 69 6E 65 2E 0A 0A | art of a line... | | 40 21 20 54 68 69 73 20 69 73 20 61 20 63 6F 6D | @! This is a com | | 6D 65 6E 74 20 61 6E 64 20 77 65 20 63 61 6E 20 | ment and we can | | 73 74 69 63 6B 20 61 6E 79 20 73 6F 72 74 20 6F | stick any sort o | | 66 20 72 75 62 62 69 73 68 20 69 6E 20 69 74 2E | f rubbish in it. | | 0A 40 21 20 40 23 20 40 69 20 40 5E 64 73 3B 61 | .@! @# @i @^ds;a | | 66 3B 6C 73 64 6D 66 3B 6C 61 6E 64 20 6F 74 68 | f;lsdmf;land oth | | 65 72 20 40 20 72 75 62 62 69 73 68 2E 0A 0A 32 | er @ rubbish...2 | | 2E 20 54 65 73 74 20 68 61 6C 66 77 61 79 20 74 | . Test halfway t | | 68 72 6F 75 67 68 20 61 20 6C 69 6E 65 2E 0A 0A | hrough a line... | | 54 68 69 73 20 69 73 20 61 20 6C 69 6E 65 20 40 | This is a line @ | | 21 20 77 68 6F 73 65 20 73 65 63 6F 6E 64 20 68 | ! whose second h | | 61 6C 66 20 6E 65 76 65 72 20 73 65 65 73 20 74 | alf never sees t | | 68 65 20 64 61 79 6C 69 67 68 74 2E 20 40 69 20 | he daylight. @i | | 40 3C 0A 0A | @<.. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC20: Test @!<010> 00002 00002| <010> 00003 00003| 1. Test at the start of a line.<010> 00004 00004| <010> 00005 00005| @! This is a comment and we can stick any sort of rubbish in it.<010> 00006 00006| @! @# @i @^ds;af;lsdmf;land other @ rubbish.<010> 00007 00007| <010> 00008 00008| 2. Test halfway through a line.<010> 00009 00009| <010> 00010 00010| This is a line @! whose second half never sees the daylight. @i @<<010> 00011 00011| <010> 00012 00012| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 5 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC20: Test " 0002[01]: Text. Text scrap[Grey]="<010> 1. Test at the start of a line.<010> <010> " 0007[01]: Text. Text scrap[Grey]="<010> 2. Test halfway through a line.<010> <010> This is a line " 0011[01]: Text. Text scrap[White]="<010> " 0012[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ ========================== Start of MACRO TABLE DUMP =========================== =========================== End of MACRO TABLE DUMP ============================ ========================= Start of DOCUMENT LIST DUMP ========================== TEXT COMPONENT: Pos(L,C)=(1,1). -- Start of Text Scrap List -- Text scrap[Grey]="SC20: Test " Text scrap[Grey]="<010> 1. Test at the start of a line.<010> <010> " Text scrap[Grey]="<010> 2. Test halfway through a line.<010> <010> This is a line " Text scrap[White]="<010> " --- End of Text Scrap List --- ========================== End of DOCUMENT LIST DUMP =========================== E: No macros defined. E: No output files specified. Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- There were 2 Errors. 1 11| >=? ?=@ @=A A=B B=C C=D D=E E=F F=G G=H H=I I=J J=K K=L L=M 12 12| M=N N=O O=P P=Q Q=R R=S S=T fw_src/answers/sc21.lis 644 0 0 45467 6717353670 10311 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 32 31 3A 20 54 65 73 74 20 67 65 6E 65 72 | SC21: Test gener | | 69 63 20 73 79 6E 74 61 78 20 63 68 65 63 6B 69 | ic syntax checki | | 6E 67 20 6F 66 20 70 72 61 67 6D 61 73 20 61 6E | ng of pragmas an | | 64 20 74 79 70 65 73 65 74 74 65 72 20 64 69 72 | d typesetter dir | | 65 63 74 69 76 65 73 2E 0A 0A 31 2E 20 54 65 73 | ectives...1. Tes | | 74 20 70 72 61 67 6D 61 20 6E 6F 74 20 61 74 20 | t pragma not at | | 74 68 65 20 73 74 61 72 74 20 6F 66 20 6C 69 6E | the start of lin | | 65 2E 0A 20 20 20 40 70 0A 20 20 20 40 74 0A 0A | e.. @p. @t.. | | 32 2E 20 54 65 73 74 20 63 68 61 72 61 63 74 65 | 2. Test characte | | 72 20 66 6F 6C 6C 6F 77 69 6E 67 20 3C 73 70 65 | r following p is not a | | 62 6C 61 6E 6B 2E 0A 40 70 78 0A 40 74 78 0A 40 | blank..@px.@tx.@ | | 70 0A 40 74 0A 0A 33 2E 20 54 65 73 74 20 70 72 | p.@t..3. Test pr | | 61 67 6D 61 20 6C 69 6E 65 20 69 73 20 74 6F 6F | agma line is too | | 20 6C 6F 6E 67 20 28 6C 69 6D 69 74 20 69 73 20 | long (limit is | | 31 30 30 29 0A 20 20 20 20 20 20 20 20 20 31 20 | 100). 1 | | 20 20 20 20 20 20 20 20 32 20 20 20 20 20 20 20 | 2 | | 20 20 33 20 20 20 20 20 20 20 20 20 34 20 20 20 | 3 4 | | 20 20 20 20 20 20 35 20 20 20 20 20 20 20 20 20 | 5 | | 36 20 20 20 20 20 20 20 20 20 37 20 20 20 20 20 | 6 7 | | 20 20 20 20 38 20 20 20 20 20 20 20 20 20 39 20 | 8 9 | | 20 20 20 20 20 20 20 20 31 0A 40 70 20 34 35 36 | 1.@p 456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 0A 40 | 78901234567890.@ | | 70 20 34 35 36 37 38 39 30 31 32 33 34 35 36 37 | p 45678901234567 | | 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 | 8901234567890123 | | 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 | 4567890123456789 | | 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 | 0123456789012345 | | 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 | 6789012345678901 | | 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 | 2345678901234567 | | 38 39 30 31 0A 40 74 20 34 35 36 37 38 39 30 31 | 8901.@t 45678901 | | 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 | 2345678901234567 | | 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 | 8901234567890123 | | 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 | 4567890123456789 | | 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 | 0123456789012345 | | 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 | 6789012345678901 | | 32 33 34 35 36 37 38 39 30 0A 40 74 20 34 35 36 | 234567890.@t 456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 | 7890123456789012 | | 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 | 3456789012345678 | | 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 | 9012345678901234 | | 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 | 5678901234567890 | | 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 | 1234567890123456 | | 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 0A | 789012345678901. | | 0A 34 2E 20 54 65 73 74 20 76 61 72 69 6F 75 73 | .4. Test various | | 20 64 69 66 66 65 72 65 6E 74 20 70 72 61 67 6D | different pragm | | 61 20 6C 69 6E 65 73 2E 0A 40 70 20 24 23 25 40 | a lines..@p $#%@ | | 20 32 35 32 35 20 20 73 6C 6F 74 68 0A 40 74 20 | 2525 sloth.@t | | 24 23 25 40 20 32 35 32 35 20 20 73 6C 6F 74 68 | $#%@ 2525 sloth | | 0A 0A 35 2E 20 54 65 73 74 20 70 72 61 67 6D 61 | ..5. Test pragma | | 20 77 69 74 68 20 6E 6F 20 61 72 67 75 6D 65 6E | with no argumen | | 74 73 2E 20 28 57 69 6C 6C 20 67 65 74 20 61 20 | ts. (Will get a | | 74 72 61 69 6C 69 6E 67 20 62 6C 61 6E 6B 73 20 | trailing blanks | | 65 72 72 6F 72 2E 29 2E 0A 40 70 20 20 20 20 0A | error.)..@p . | | 40 74 20 20 20 20 0A 0A 36 2E 20 54 65 73 74 20 | @t ..6. Test | | 70 72 61 67 6D 61 20 77 69 74 68 20 74 6F 6F 20 | pragma with too | | 6D 61 6E 79 20 61 72 67 75 6D 65 6E 74 73 2E 0A | many arguments.. | | 40 70 20 61 20 62 20 63 20 64 20 65 20 66 20 67 | @p a b c d e f g | | 20 68 20 69 20 6A 20 6B 20 6C 20 6D 20 6E 20 6F | h i j k l m n o | | 20 70 20 71 20 72 20 73 20 74 20 75 20 76 20 77 | p q r s t u v w | | 20 78 20 79 20 7A 0A 40 74 20 61 20 62 20 63 20 | x y z.@t a b c | | 64 20 65 20 66 20 67 20 68 20 69 20 6A 20 6B 20 | d e f g h i j k | | 6C 20 6D 20 6E 20 6F 20 70 20 71 20 72 20 73 20 | l m n o p q r s | | 74 20 75 20 76 20 77 20 78 20 79 20 7A 0A 0A | t u v w x y z.. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC21: Test generic syntax checking of pragmas and typesetter directives.<010> 00002 00002| <010> 00003 00003| 1. Test pragma not at the start of line.<010> 00004 00004| @p<010> 00005 00005| @t<010> 00006 00006| <010> 00007 00007| 2. Test character following p is not a blank.<010> 00008 00008| @px<010> 00009 00009| @tx<010> 00010 00010| @p<010> 00011 00011| @t<010> 00012 00012| <010> 00013 00013| 3. Test pragma line is too long (limit is 100)<010> 00014 00014| 1 2 3 4 5 6 7 8 9 1<010> 00015 00015| @p 4567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890<010> 00016 00016| @p 45678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901<010> 00017 00017| @t 4567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890<010> 00018 00018| @t 45678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901<010> 00019 00019| <010> 00020 00020| 4. Test various different pragma lines.<010> 00021 00021| @p $#%@ 2525 sloth<010> 00022 00022| @t $#%@ 2525 sloth<010> 00023 00023| <010> 00024 00024| 5. Test pragma with no arguments. (Will get a trailing blanks error.).<010> 00025 00025| @p <010> 00026 00026| @t <010> 00027 00027| <010> 00028 00028| 6. Test pragma with too many arguments.<010> 00029 00029| @p a b c d e f g h i j k l m n o p q r s t u v w x y z<010> 00030 00030| @t a b c d e f g h i j k l m n o p q r s t u v w x y z<010> 00031 00031| <010> 00032 00032| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 9 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC21: Test generic syntax checking of pragmas and typesetter directives.<010> <010> 1. Test pragma not at the start of line.<010> " 0005[01]: Text. Text scrap[White]=" " 0006[01]: Text. Text scrap[Grey]="<010> 2. Test character following p is not a blank.<010> " 0012[01]: Text. Text scrap[Grey]="<010> 3. Test pragma line is too long (limit is 100)<010> 1 2 3 4 5 6 7 8 9 1<010> " 0019[01]: Text. Text scrap[Grey]="<010> 4. Test various different pragma lines.<010> " 0023[01]: Text. Text scrap[Grey]="<010> 5. Test pragma with no arguments. (Will get a trailing blanks error.).<010> " 0027[01]: Text. Text scrap[Grey]="<010> 6. Test pragma with too many arguments.<010> " 0031[01]: Text. Text scrap[White]="<010> " 0032[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC21: Test generic syntax checking of pragmas and typesetter directives. 2 2| 3 3| 1. Test pragma not at the start of line. 4 4| @p Error|....^Pragma sequence @p must be at the start of a line. |....^The rest of this line will be ignored. Error|....^Unrecognised pragma. Possible legal pragmas are: |....^ @p indentation = none | blank |....^ @p maximum_input_line_length = |infinity |....^ @p maximum_output_line_length = |infinity |....^ @p typesetter = none | tex |....^The blanks between arguments are important. |....^Pragma ignored. 5 5| @t Error|....^Typesetter directive @t must be at the start of a line. |....^The rest of this line will be ignored. Error|....^Unrecognised typesetter directive. Legal ones are: |....^ @t new_page |....^ @t table_of_contents |....^ @t title |....^ @t vskip mm |....^The blanks between arguments are important. |....^Typesetter directive ignored. 6 6| 7 7| 2. Test character following p is not a blank. 8 8| @px Error|.^Pragma sequence @p must be followed by a blank. Error|.^Unrecognised pragma. Possible legal pragmas are: |.^ @p indentation = none | blank |.^ @p maximum_input_line_length = |infinity |.^ @p maximum_output_line_length = |infinity |.^ @p typesetter = none | tex |.^The blanks between arguments are important. |.^Pragma ignored. 9 9| @tx Error|.^Typesetter directive @t must be followed by a blank. Error|.^Unrecognised typesetter directive. Legal ones are: |.^ @t new_page |.^ @t table_of_contents |.^ @t title |.^ @t vskip mm |.^The blanks between arguments are important. |.^Typesetter directive ignored. 10 10| @p Error|.^Pragma sequence @p must be followed by a blank. Error|.^Unrecognised pragma. Possible legal pragmas are: |.^ @p indentation = none | blank |.^ @p maximum_input_line_length = |infinity |.^ @p maximum_output_line_length = |infinity |.^ @p typesetter = none | tex |.^The blanks between arguments are important. |.^Pragma ignored. 11 11| @t Error|.^Typesetter directive @t must be followed by a blank. Error|.^Unrecognised typesetter directive. Legal ones are: |.^ @t new_page |.^ @t table_of_contents |.^ @t title |.^ @t vskip mm |.^The blanks between arguments are important. |.^Typesetter directive ignored. 12 12| 13 13| 3. Test pragma line is too long (limit is 100) 14 14| 1 2 3 4 5 6 7 8 9 1 Error|.................................................................................^Input line is too long (this character is the first offender). |.................................................................................^Currently, the maximum allowable input line length is 80. |.................................................................................^Note: You can change this using a pragma directive (@p). 15 15| @p 4567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 Error|.^Unrecognised pragma. Possible legal pragmas are: |.^ @p indentation = none | blank |.^ @p maximum_input_line_length = |infinity |.^ @p maximum_output_line_length = |infinity |.^ @p typesetter = none | tex |.^The blanks between arguments are important. |.^Pragma ignored. Error|.................................................................................^Input line is too long (this character is the first offender). |.................................................................................^Currently, the maximum allowable input line length is 80. |.................................................................................^Note: You can change this using a pragma directive (@p). 16 16| @p 45678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901 Error|.^This pragma line is too long. |.^The maximum pragma line length is 100 characters. Error|.^Unrecognised pragma. Possible legal pragmas are: |.^ @p indentation = none | blank |.^ @p maximum_input_line_length = |infinity |.^ @p maximum_output_line_length = |infinity |.^ @p typesetter = none | tex |.^The blanks between arguments are important. |.^Pragma ignored. Error|.................................................................................^Input line is too long (this character is the first offender). |.................................................................................^Currently, the maximum allowable input line length is 80. |.................................................................................^Note: You can change this using a pragma directive (@p). 17 17| @t 4567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 Error|.^Unrecognised typesetter directive. Legal ones are: |.^ @t new_page |.^ @t table_of_contents |.^ @t title |.^ @t vskip mm |.^The blanks between arguments are important. |.^Typesetter directive ignored. Error|.................................................................................^Input line is too long (this character is the first offender). |.................................................................................^Currently, the maximum allowable input line length is 80. |.................................................................................^Note: You can change this using a pragma directive (@p). 18 18| @t 45678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901 Error|.^This typestter directive line is too long. |.^The maximum typesetter directive line length is 100 characters. Error|.^Unrecognised typesetter directive. Legal ones are: |.^ @t new_page |.^ @t table_of_contents |.^ @t title |.^ @t vskip mm |.^The blanks between arguments are important. |.^Typesetter directive ignored. Error|.................................................................................^Input line is too long (this character is the first offender). |.................................................................................^Currently, the maximum allowable input line length is 80. |.................................................................................^Note: You can change this using a pragma directive (@p). 19 19| 20 20| 4. Test various different pragma lines. 21 21| @p $#%@ 2525 sloth Error|.^Unrecognised pragma. Possible legal pragmas are: |.^ @p indentation = none | blank |.^ @p maximum_input_line_length = |infinity |.^ @p maximum_output_line_length = |infinity |.^ @p typesetter = none | tex |.^The blanks between arguments are important. |.^Pragma ignored. 22 22| @t $#%@ 2525 sloth Error|.^Unrecognised typesetter directive. Legal ones are: |.^ @t new_page |.^ @t table_of_contents |.^ @t title |.^ @t vskip mm |.^The blanks between arguments are important. |.^Typesetter directive ignored. 23 23| 24 24| 5. Test pragma with no arguments. (Will get a trailing blanks error.). 25 25| @p Error|.^Pragma sequence @p must be followed by a keyword. Error|.^Unrecognised pragma. Possible legal pragmas are: |.^ @p indentation = none | blank |.^ @p maximum_input_line_length = |infinity |.^ @p maximum_output_line_length = |infinity |.^ @p typesetter = none | tex |.^The blanks between arguments are important. |.^Pragma ignored. Warning|......^Line has trailing spaces up to and including this space. 26 26| @t Error|.^Typesetter directive @t must be followed by a keyword. Error|.^Unrecognised typesetter directive. Legal ones are: |.^ @t new_page |.^ @t table_of_contents |.^ @t title |.^ @t vskip mm |.^The blanks between arguments are important. |.^Typesetter directive ignored. Warning|......^Line has trailing spaces up to and including this space. 27 27| 28 28| 6. Test pragma with too many arguments. 29 29| @p a b c d e f g h i j k l m n o p q r s t u v w x y z Error|.^Unrecognised pragma. Possible legal pragmas are: |.^ @p indentation = none | blank |.^ @p maximum_input_line_length = |infinity |.^ @p maximum_output_line_length = |infinity |.^ @p typesetter = none | tex |.^The blanks between arguments are important. |.^Pragma ignored. 30 30| @t a b c d e f g h i j k l m n o p q r s t u v w x y z Error|.^Unrecognised typesetter directive. Legal ones are: |.^ @t new_page |.^ @t table_of_contents |.^ @t title |.^ @t vskip mm |.^The blanks between arguments are important. |.^Typesetter directive ignored. 31 31| | ------------+------------------------------------------------------------------- There were 31 Errors and 2 Warnings. imum_input_line_length = |infinity |....^ @p maximum_output_line_length = |infinity |....^ @p typesetter = none | tex |....^The blanks between argumenfw_src/answers/sc22.lis 644 0 0 16726 6717353672 10310 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 32 32 3A 20 54 65 73 74 20 73 79 6E 74 61 | SC22: Test synta | | 78 20 63 68 65 63 6B 69 6E 67 20 6F 66 20 69 6E | x checking of in | | 70 75 74 20 6C 69 6E 65 20 6C 65 6E 67 74 68 20 | put line length | | 70 72 61 67 6D 61 2E 0A 0A 31 2E 20 54 65 73 74 | pragma...1. Test | | 20 6E 6F 74 20 74 68 72 65 65 20 61 72 67 75 6D | not three argum | | 65 6E 74 73 2E 0A 40 70 20 6D 61 78 69 6D 75 6D | ents..@p maximum | | 5F 69 6E 70 75 74 5F 6C 69 6E 65 5F 6C 65 6E 67 | _input_line_leng | | 74 68 0A 40 70 20 6D 61 78 69 6D 75 6D 5F 69 6E | th.@p maximum_in | | 70 75 74 5F 6C 69 6E 65 5F 6C 65 6E 67 74 68 20 | put_line_length | | 3D 0A 40 70 20 6D 61 78 69 6D 75 6D 5F 69 6E 70 | =.@p maximum_inp | | 75 74 5F 6C 69 6E 65 5F 6C 65 6E 67 74 68 20 3D | ut_line_length = | | 20 78 78 78 20 79 79 79 0A 0A 32 2E 20 54 65 73 | xxx yyy..2. Tes | | 74 20 73 65 63 6F 6E 64 20 61 72 67 75 6D 65 6E | t second argumen | | 74 20 6E 6F 74 20 22 3D 22 2E 0A 40 70 20 6D 61 | t not "="..@p ma | | 78 69 6D 75 6D 5F 69 6E 70 75 74 5F 6C 69 6E 65 | ximum_input_line | | 5F 6C 65 6E 67 74 68 20 78 20 73 6C 6F 74 68 0A | _length x sloth. | | 0A 33 2E 20 54 65 73 74 20 76 61 6C 75 65 20 6F | .3. Test value o | | 66 20 69 6E 66 69 6E 69 74 79 2E 0A 40 70 20 6D | f infinity..@p m | | 61 78 69 6D 75 6D 5F 69 6E 70 75 74 5F 6C 69 6E | aximum_input_lin | | 65 5F 6C 65 6E 67 74 68 20 3D 20 69 6E 66 69 6E | e_length = infin | | 69 74 79 0A 0A 34 2E 20 54 65 73 74 20 6E 6F 6E | ity..4. Test non | | 2D 64 65 63 69 6D 61 6C 20 64 69 67 69 74 20 69 | -decimal digit i | | 6E 20 6E 75 6D 62 65 72 2E 0A 40 70 20 6D 61 78 | n number..@p max | | 69 6D 75 6D 5F 69 6E 70 75 74 5F 6C 69 6E 65 5F | imum_input_line_ | | 6C 65 6E 67 74 68 20 3D 20 32 65 66 0A 0A 35 2E | length = 2ef..5. | | 20 54 65 73 74 20 6E 75 6D 62 65 72 20 69 73 20 | Test number is | | 6D 6F 72 65 20 74 68 61 6E 20 65 69 67 68 74 20 | more than eight | | 64 69 67 69 74 73 20 6C 6F 6E 67 2E 0A 40 70 20 | digits long..@p | | 6D 61 78 69 6D 75 6D 5F 69 6E 70 75 74 5F 6C 69 | maximum_input_li | | 6E 65 5F 6C 65 6E 67 74 68 20 3D 20 31 32 33 34 | ne_length = 1234 | | 35 36 37 38 39 0A 0A 36 2E 20 54 65 73 74 20 6E | 56789..6. Test n | | 75 6D 62 65 72 20 69 73 20 65 78 61 63 74 6C 79 | umber is exactly | | 20 65 69 67 68 74 20 64 69 67 69 74 73 20 6C 6F | eight digits lo | | 6E 67 2E 0A 40 70 20 6D 61 78 69 6D 75 6D 5F 69 | ng..@p maximum_i | | 6E 70 75 74 5F 6C 69 6E 65 5F 6C 65 6E 67 74 68 | nput_line_length | | 20 3D 20 31 32 33 34 35 36 37 38 0A 0A 0A | = 12345678... | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC22: Test syntax checking of input line length pragma.<010> 00002 00002| <010> 00003 00003| 1. Test not three arguments.<010> 00004 00004| @p maximum_input_line_length<010> 00005 00005| @p maximum_input_line_length =<010> 00006 00006| @p maximum_input_line_length = xxx yyy<010> 00007 00007| <010> 00008 00008| 2. Test second argument not "=".<010> 00009 00009| @p maximum_input_line_length x sloth<010> 00010 00010| <010> 00011 00011| 3. Test value of infinity.<010> 00012 00012| @p maximum_input_line_length = infinity<010> 00013 00013| <010> 00014 00014| 4. Test non-decimal digit in number.<010> 00015 00015| @p maximum_input_line_length = 2ef<010> 00016 00016| <010> 00017 00017| 5. Test number is more than eight digits long.<010> 00018 00018| @p maximum_input_line_length = 123456789<010> 00019 00019| <010> 00020 00020| 6. Test number is exactly eight digits long.<010> 00021 00021| @p maximum_input_line_length = 12345678<010> 00022 00022| <010> 00023 00023| <010> 00024 00024| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 8 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC22: Test syntax checking of input line length pragma.<010> <010> 1. Test not three arguments.<010> " 0007[01]: Text. Text scrap[Grey]="<010> 2. Test second argument not "=".<010> " 0010[01]: Text. Text scrap[Grey]="<010> 3. Test value of infinity.<010> " 0013[01]: Text. Text scrap[Grey]="<010> 4. Test non-decimal digit in number.<010> " 0016[01]: Text. Text scrap[Grey]="<010> 5. Test number is more than eight digits long.<010> " 0019[01]: Text. Text scrap[Grey]="<010> 6. Test number is exactly eight digits long.<010> " 0022[01]: Text. Text scrap[White]="<010> <010> " 0024[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC22: Test syntax checking of input line length pragma. 2 2| 3 3| 1. Test not three arguments. 4 4| @p maximum_input_line_length Error|.^This pragma has the wrong number of arguments. |.^The correct format is: "@p maximum_input_line_length = |infinity". |.^Pragma ignored. 5 5| @p maximum_input_line_length = Error|.^This pragma has the wrong number of arguments. |.^The correct format is: "@p maximum_input_line_length = |infinity". |.^Pragma ignored. 6 6| @p maximum_input_line_length = xxx yyy Error|.^This pragma has the wrong number of arguments. |.^The correct format is: "@p maximum_input_line_length = |infinity". |.^Pragma ignored. 7 7| 8 8| 2. Test second argument not "=". 9 9| @p maximum_input_line_length x sloth |.^The correct format is: "@p maximum_input_line_length = |infinity". |.^Pragma ignored. Error|..............................^Expecting "=". 10 10| 11 11| 3. Test value of infinity. 12 12| @p maximum_input_line_length = infinity 13 13| 14 14| 4. Test non-decimal digit in number. 15 15| @p maximum_input_line_length = 2ef Error|.................................^Illegal digit. Value must consist entirely of decimal digits. |.................................^You can also use the value "infinity". |.................................^Pragma ignored. 16 16| 17 17| 5. Test number is more than eight digits long. 18 18| @p maximum_input_line_length = 123456789 Error|................................^Too many digits. The maximum is eight. |................................^Pragma ignored. 19 19| 20 20| 6. Test number is exactly eight digits long. 21 21| @p maximum_input_line_length = 12345678 22 22| 23 23| | ------------+------------------------------------------------------------------- There were 6 Errors. p maximum_input_line_length = |infinfw_src/answers/sc23.lis 644 0 0 21544 6717353673 10304 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 32 33 3A 20 54 65 73 74 20 73 79 6E 74 61 | SC23: Test synta | | 78 20 63 68 65 63 6B 69 6E 67 20 6F 66 20 6F 75 | x checking of ou | | 74 70 75 74 20 6C 69 6E 65 20 6C 65 6E 67 74 68 | tput line length | | 20 70 72 61 67 6D 61 2E 0A 0A 31 2E 20 54 65 73 | pragma...1. Tes | | 74 20 6E 6F 74 20 74 68 72 65 65 20 61 72 67 75 | t not three argu | | 6D 65 6E 74 73 2E 0A 40 70 20 6D 61 78 69 6D 75 | ments..@p maximu | | 6D 5F 6F 75 74 70 75 74 5F 6C 69 6E 65 5F 6C 65 | m_output_line_le | | 6E 67 74 68 0A 40 70 20 6D 61 78 69 6D 75 6D 5F | ngth.@p maximum_ | | 6F 75 74 70 75 74 5F 6C 69 6E 65 5F 6C 65 6E 67 | output_line_leng | | 74 68 20 3D 0A 40 70 20 6D 61 78 69 6D 75 6D 5F | th =.@p maximum_ | | 6F 75 74 70 75 74 5F 6C 69 6E 65 5F 6C 65 6E 67 | output_line_leng | | 74 68 20 3D 20 78 78 78 20 79 79 79 0A 0A 32 2E | th = xxx yyy..2. | | 20 54 65 73 74 20 73 65 63 6F 6E 64 20 61 72 67 | Test second arg | | 75 6D 65 6E 74 20 6E 6F 74 20 22 3D 22 2E 0A 40 | ument not "="..@ | | 70 20 6D 61 78 69 6D 75 6D 5F 6F 75 74 70 75 74 | p maximum_output | | 5F 6C 69 6E 65 5F 6C 65 6E 67 74 68 20 78 20 73 | _line_length x s | | 6C 6F 74 68 0A 0A 33 2E 20 54 65 73 74 20 76 61 | loth..3. Test va | | 6C 75 65 20 6F 66 20 69 6E 66 69 6E 69 74 79 2E | lue of infinity. | | 0A 40 70 20 6D 61 78 69 6D 75 6D 5F 6F 75 74 70 | .@p maximum_outp | | 75 74 5F 6C 69 6E 65 5F 6C 65 6E 67 74 68 20 3D | ut_line_length = | | 20 69 6E 66 69 6E 69 74 79 0A 0A 34 2E 20 54 65 | infinity..4. Te | | 73 74 20 6E 6F 6E 2D 64 65 63 69 6D 61 6C 20 64 | st non-decimal d | | 69 67 69 74 20 69 6E 20 6E 75 6D 62 65 72 2E 0A | igit in number.. | | 40 70 20 6D 61 78 69 6D 75 6D 5F 6F 75 74 70 75 | @p maximum_outpu | | 74 5F 6C 69 6E 65 5F 6C 65 6E 67 74 68 20 3D 20 | t_line_length = | | 32 65 66 0A 0A 35 2E 20 54 65 73 74 20 6E 75 6D | 2ef..5. Test num | | 62 65 72 20 69 73 20 6D 6F 72 65 20 74 68 61 6E | ber is more than | | 20 65 69 67 68 74 20 64 69 67 69 74 73 20 6C 6F | eight digits lo | | 6E 67 2E 0A 40 70 20 6D 61 78 69 6D 75 6D 5F 6F | ng..@p maximum_o | | 75 74 70 75 74 5F 6C 69 6E 65 5F 6C 65 6E 67 74 | utput_line_lengt | | 68 20 3D 20 31 32 33 34 35 36 37 38 39 0A 0A 36 | h = 123456789..6 | | 2E 20 54 65 73 74 20 6E 75 6D 62 65 72 20 69 73 | . Test number is | | 20 65 78 61 63 74 6C 79 20 65 69 67 68 74 20 64 | exactly eight d | | 69 67 69 74 73 20 6C 6F 6E 67 2E 0A 37 2E 20 54 | igits long..7. T | | 65 73 74 20 70 72 61 67 6D 61 20 6F 70 70 6F 73 | est pragma oppos | | 69 6E 67 20 65 61 72 6C 69 65 72 20 70 72 61 67 | ing earlier prag | | 6D 61 2E 0A 40 70 20 6D 61 78 69 6D 75 6D 5F 6F | ma..@p maximum_o | | 75 74 70 75 74 5F 6C 69 6E 65 5F 6C 65 6E 67 74 | utput_line_lengt | | 68 20 3D 20 31 32 33 34 35 36 37 38 0A 0A 38 2E | h = 12345678..8. | | 20 54 65 73 74 20 70 72 61 67 6D 61 20 6E 6F 74 | Test pragma not | | 20 6F 70 70 6F 73 69 6E 67 20 65 61 72 6C 69 65 | opposing earlie | | 72 20 70 72 61 67 6D 61 2E 0A 40 70 20 6D 61 78 | r pragma..@p max | | 69 6D 75 6D 5F 6F 75 74 70 75 74 5F 6C 69 6E 65 | imum_output_line | | 5F 6C 65 6E 67 74 68 20 3D 20 69 6E 66 69 6E 69 | _length = infini | | 74 79 0A 0A | ty.. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC23: Test syntax checking of output line length pragma.<010> 00002 00002| <010> 00003 00003| 1. Test not three arguments.<010> 00004 00004| @p maximum_output_line_length<010> 00005 00005| @p maximum_output_line_length =<010> 00006 00006| @p maximum_output_line_length = xxx yyy<010> 00007 00007| <010> 00008 00008| 2. Test second argument not "=".<010> 00009 00009| @p maximum_output_line_length x sloth<010> 00010 00010| <010> 00011 00011| 3. Test value of infinity.<010> 00012 00012| @p maximum_output_line_length = infinity<010> 00013 00013| <010> 00014 00014| 4. Test non-decimal digit in number.<010> 00015 00015| @p maximum_output_line_length = 2ef<010> 00016 00016| <010> 00017 00017| 5. Test number is more than eight digits long.<010> 00018 00018| @p maximum_output_line_length = 123456789<010> 00019 00019| <010> 00020 00020| 6. Test number is exactly eight digits long.<010> 00021 00021| 7. Test pragma opposing earlier pragma.<010> 00022 00022| @p maximum_output_line_length = 12345678<010> 00023 00023| <010> 00024 00024| 8. Test pragma not opposing earlier pragma.<010> 00025 00025| @p maximum_output_line_length = infinity<010> 00026 00026| <010> 00027 00027| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 9 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC23: Test syntax checking of output line length pragma.<010> <010> 1. Test not three arguments.<010> " 0007[01]: Text. Text scrap[Grey]="<010> 2. Test second argument not "=".<010> " 0010[01]: Text. Text scrap[Grey]="<010> 3. Test value of infinity.<010> " 0013[01]: Text. Text scrap[Grey]="<010> 4. Test non-decimal digit in number.<010> " 0016[01]: Text. Text scrap[Grey]="<010> 5. Test number is more than eight digits long.<010> " 0019[01]: Text. Text scrap[Grey]="<010> 6. Test number is exactly eight digits long.<010> 7. Test pragma opposing earlier pragma.<010> " 0023[01]: Text. Text scrap[Grey]="<010> 8. Test pragma not opposing earlier pragma.<010> " 0026[01]: Text. Text scrap[White]="<010> " 0027[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC23: Test syntax checking of output line length pragma. 2 2| 3 3| 1. Test not three arguments. 4 4| @p maximum_output_line_length Error|.^This pragma has the wrong number of arguments. |.^The correct format is: "@p maximum_output_line_length = |infinity". |.^Pragma ignored. 5 5| @p maximum_output_line_length = Error|.^This pragma has the wrong number of arguments. |.^The correct format is: "@p maximum_output_line_length = |infinity". |.^Pragma ignored. 6 6| @p maximum_output_line_length = xxx yyy Error|.^This pragma has the wrong number of arguments. |.^The correct format is: "@p maximum_output_line_length = |infinity". |.^Pragma ignored. 7 7| 8 8| 2. Test second argument not "=". 9 9| @p maximum_output_line_length x sloth |.^The correct format is: "@p maximum_output_line_length = |infinity". |.^Pragma ignored. Error|...............................^Expecting "=". 10 10| 11 11| 3. Test value of infinity. 12 12| @p maximum_output_line_length = infinity |.^This pragma is opposed by the pragma at line 22. 13 13| 14 14| 4. Test non-decimal digit in number. 15 15| @p maximum_output_line_length = 2ef Error|..................................^Illegal digit. Value must consist entirely of decimal digits. |..................................^You can also use the value "infinity". |..................................^Pragma ignored. 16 16| 17 17| 5. Test number is more than eight digits long. 18 18| @p maximum_output_line_length = 123456789 Error|.................................^Too many digits. The maximum is eight. |.................................^Pragma ignored. 19 19| 20 20| 6. Test number is exactly eight digits long. 21 21| 7. Test pragma opposing earlier pragma. 22 22| @p maximum_output_line_length = 12345678 Error|.^This pragma opposes the pragma at line 12. |.^You can have as many output line length pragmas |.^as you like, but they all have to be the same! |.^Pragma ignored. 23 23| 24 24| 8. Test pragma not opposing earlier pragma. 25 25| @p maximum_output_line_length = infinity 26 26| | ------------+------------------------------------------------------------------- There were 7 Errors. |.................................^Pragma ignored. 16 16| 17 17| 5. Test number is more than eight digits long. 18 18| @p maxifw_src/answers/sc24.lis 644 0 0 15563 6717353674 10312 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 32 33 3A 20 54 65 73 74 20 73 79 6E 74 61 | SC23: Test synta | | 78 20 63 68 65 63 6B 69 6E 67 20 6F 66 20 69 6E | x checking of in | | 64 65 6E 74 61 74 69 6F 6E 20 70 72 61 67 6D 61 | dentation pragma | | 2E 0A 0A 31 2E 20 54 65 73 74 20 6E 6F 74 20 74 | ...1. Test not t | | 68 72 65 65 20 61 72 67 75 6D 65 6E 74 73 2E 0A | hree arguments.. | | 40 70 20 69 6E 64 65 6E 74 61 74 69 6F 6E 0A 40 | @p indentation.@ | | 70 20 69 6E 64 65 6E 74 61 74 69 6F 6E 20 3D 0A | p indentation =. | | 40 70 20 69 6E 64 65 6E 74 61 74 69 6F 6E 20 3D | @p indentation = | | 20 78 78 78 20 79 79 79 0A 0A 32 2E 20 54 65 73 | xxx yyy..2. Tes | | 74 20 73 65 63 6F 6E 64 20 61 72 67 75 6D 65 6E | t second argumen | | 74 20 6E 6F 74 20 22 3D 22 2E 0A 40 70 20 69 6E | t not "="..@p in | | 64 65 6E 74 61 74 69 6F 6E 20 78 20 73 6C 6F 74 | dentation x slot | | 68 0A 0A 33 2E 20 54 65 73 74 20 74 68 69 72 64 | h..3. Test third | | 20 61 72 67 75 6D 65 6E 74 20 69 73 20 6E 6F 74 | argument is not | | 20 6C 65 67 61 6C 2E 0A 40 70 20 69 6E 64 65 6E | legal..@p inden | | 74 61 74 69 6F 6E 20 3D 20 73 6C 6F 74 68 0A 0A | tation = sloth.. | | 34 2E 20 54 65 73 74 20 74 68 69 72 64 20 61 72 | 4. Test third ar | | 67 75 6D 65 6E 74 20 69 73 20 6E 6F 6E 65 2E 0A | gument is none.. | | 40 70 20 69 6E 64 65 6E 74 61 74 69 6F 6E 20 3D | @p indentation = | | 20 6E 6F 6E 65 0A 0A 35 2E 20 54 65 73 74 20 74 | none..5. Test t | | 68 69 72 64 20 61 72 67 75 6D 65 6E 74 20 69 73 | hird argument is | | 20 62 6C 61 6E 6B 2E 0A 36 2E 20 54 65 73 74 20 | blank..6. Test | | 70 72 61 67 6D 61 20 6F 70 70 6F 73 65 73 20 65 | pragma opposes e | | 61 72 6C 69 65 72 20 70 72 61 67 6D 61 2E 0A 40 | arlier pragma..@ | | 70 20 69 6E 64 65 6E 74 61 74 69 6F 6E 20 3D 20 | p indentation = | | 62 6C 61 6E 6B 0A 0A 37 2E 20 54 65 73 74 20 70 | blank..7. Test p | | 72 61 67 6D 61 20 64 6F 65 73 20 6E 6F 74 20 6F | ragma does not o | | 70 70 6F 73 65 20 65 61 72 6C 69 65 72 20 70 72 | ppose earlier pr | | 61 67 6D 61 2E 0A 40 70 20 69 6E 64 65 6E 74 61 | agma..@p indenta | | 74 69 6F 6E 20 3D 20 6E 6F 6E 65 0A 0A | tion = none.. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC23: Test syntax checking of indentation pragma.<010> 00002 00002| <010> 00003 00003| 1. Test not three arguments.<010> 00004 00004| @p indentation<010> 00005 00005| @p indentation =<010> 00006 00006| @p indentation = xxx yyy<010> 00007 00007| <010> 00008 00008| 2. Test second argument not "=".<010> 00009 00009| @p indentation x sloth<010> 00010 00010| <010> 00011 00011| 3. Test third argument is not legal.<010> 00012 00012| @p indentation = sloth<010> 00013 00013| <010> 00014 00014| 4. Test third argument is none.<010> 00015 00015| @p indentation = none<010> 00016 00016| <010> 00017 00017| 5. Test third argument is blank.<010> 00018 00018| 6. Test pragma opposes earlier pragma.<010> 00019 00019| @p indentation = blank<010> 00020 00020| <010> 00021 00021| 7. Test pragma does not oppose earlier pragma.<010> 00022 00022| @p indentation = none<010> 00023 00023| <010> 00024 00024| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 8 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC23: Test syntax checking of indentation pragma.<010> <010> 1. Test not three arguments.<010> " 0007[01]: Text. Text scrap[Grey]="<010> 2. Test second argument not "=".<010> " 0010[01]: Text. Text scrap[Grey]="<010> 3. Test third argument is not legal.<010> " 0013[01]: Text. Text scrap[Grey]="<010> 4. Test third argument is none.<010> " 0016[01]: Text. Text scrap[Grey]="<010> 5. Test third argument is blank.<010> 6. Test pragma opposes earlier pragma.<010> " 0020[01]: Text. Text scrap[Grey]="<010> 7. Test pragma does not oppose earlier pragma.<010> " 0023[01]: Text. Text scrap[White]="<010> " 0024[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC23: Test syntax checking of indentation pragma. 2 2| 3 3| 1. Test not three arguments. 4 4| @p indentation Error|.^This indentation pragma has the wrong number of arguments. |.^The correct format is: "@p indentation = none|blank". |.^Pragma ignored. 5 5| @p indentation = Error|.^This indentation pragma has the wrong number of arguments. |.^The correct format is: "@p indentation = none|blank". |.^Pragma ignored. 6 6| @p indentation = xxx yyy Error|.^This indentation pragma has the wrong number of arguments. |.^The correct format is: "@p indentation = none|blank". |.^Pragma ignored. 7 7| 8 8| 2. Test second argument not "=". 9 9| @p indentation x sloth |.^The correct format is: "@p indentation = none|blank". |.^Pragma ignored. Error|................^Expecting "=". 10 10| 11 11| 3. Test third argument is not legal. 12 12| @p indentation = sloth |.^The correct format is: "@p indentation = none|blank". |.^Pragma ignored. Error|..................^Expecting either "none" or "blank". 13 13| 14 14| 4. Test third argument is none. 15 15| @p indentation = none |.^This pragma is opposed by the pragma at line 19. 16 16| 17 17| 5. Test third argument is blank. 18 18| 6. Test pragma opposes earlier pragma. 19 19| @p indentation = blank Error|.^This pragma opposes the pragma at line 15. |.^You can have as many indentation pragmas as you like, |.^but they all have to be the same! |.^Pragma ignored. 20 20| 21 21| 7. Test pragma does not oppose earlier pragma. 22 22| @p indentation = none 23 23| | ------------+------------------------------------------------------------------- There were 6 Errors. a. 2 2| 3 3| 1. Test not three arguments. 4 4| @p maximum_output_line_length Error|.^This pragma has the wfw_src/answers/sc25.lis 644 0 0 6641 6717353675 10271 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 32 35 3A 20 54 65 73 74 20 73 79 6E 74 61 | SC25: Test synta | | 78 20 63 68 65 63 6B 69 6E 67 20 6F 66 20 6E 65 | x checking of ne | | 77 20 70 61 67 65 20 74 79 70 65 73 65 74 74 65 | w page typesette | | 72 20 64 69 72 65 63 74 69 76 65 2E 0A 0A 31 2E | r directive...1. | | 20 4D 61 6B 65 20 73 75 72 65 20 74 68 61 74 20 | Make sure that | | 61 20 6C 65 67 61 6C 20 6E 65 77 20 70 61 67 65 | a legal new page | | 20 64 69 72 65 63 74 69 76 65 20 69 73 20 4F 4B | directive is OK | | 2E 0A 40 74 20 6E 65 77 5F 70 61 67 65 0A 0A 32 | ..@t new_page..2 | | 2E 20 43 68 65 63 6B 20 74 68 61 74 20 69 74 20 | . Check that it | | 64 6F 65 73 6E 27 74 20 73 74 61 6E 64 20 66 6F | doesn't stand fo | | 72 20 61 6E 79 20 6E 6F 6E 73 65 6E 73 65 2E 0A | r any nonsense.. | | 40 74 20 6E 65 77 5F 70 61 67 65 20 6E 6F 6E 73 | @t new_page nons | | 65 6E 73 65 0A 0A | ense.. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC25: Test syntax checking of new page typesetter directive.<010> 00002 00002| <010> 00003 00003| 1. Make sure that a legal new page directive is OK.<010> 00004 00004| @t new_page<010> 00005 00005| <010> 00006 00006| 2. Check that it doesn't stand for any nonsense.<010> 00007 00007| @t new_page nonsense<010> 00008 00008| <010> 00009 00009| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 5 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC25: Test syntax checking of new page typesetter directive.<010> <010> 1. Make sure that a legal new page directive is OK.<010> " 0004[01]: @t.. Newpage. 0005[01]: Text. Text scrap[Grey]="<010> 2. Check that it doesn't stand for any nonsense.<010> " 0008[01]: Text. Text scrap[White]="<010> " 0009[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC25: Test syntax checking of new page typesetter directive. 2 2| 3 3| 1. Make sure that a legal new page directive is OK. 4 4| @t new_page 5 5| 6 6| 2. Check that it doesn't stand for any nonsense. 7 7| @t new_page nonsense Error|.............^The new_page directive does not take arguments. |.............^Directive ignored. 8 8| | ------------+------------------------------------------------------------------- There was 1 Error. 78 78 20 79 79 79 0A 0A 32 2E 20 54 65 73 | xxx yyy..2. Tes | | 74 20 73 65 63 6F 6E 64 20 61fw_src/answers/sc26.lis 644 0 0 7232 6717353676 10270 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 32 36 3A 20 54 65 73 74 20 73 79 6E 74 61 | SC26: Test synta | | 78 20 63 68 65 63 6B 69 6E 67 20 6F 66 20 74 61 | x checking of ta | | 62 6C 65 20 6F 66 20 63 6F 6E 74 65 6E 74 73 20 | ble of contents | | 74 79 70 65 73 65 74 74 69 6E 67 20 70 72 61 67 | typesetting prag | | 6D 61 2E 0A 0A 31 2E 20 4D 61 6B 65 20 73 75 72 | ma...1. Make sur | | 65 20 74 68 61 74 20 61 20 6C 65 67 61 6C 20 74 | e that a legal t | | 61 62 6C 65 20 6F 66 20 63 6F 6E 74 65 6E 74 73 | able of contents | | 20 64 69 72 65 63 74 69 76 65 20 69 73 20 4F 4B | directive is OK | | 2E 0A 40 74 20 74 61 62 6C 65 5F 6F 66 5F 63 6F | ..@t table_of_co | | 6E 74 65 6E 74 73 0A 0A 32 2E 20 43 68 65 63 6B | ntents..2. Check | | 20 74 68 61 74 20 69 74 20 64 6F 65 73 6E 27 74 | that it doesn't | | 20 73 74 61 6E 64 20 66 6F 72 20 61 6E 79 20 6E | stand for any n | | 6F 6E 73 65 6E 73 65 2E 0A 40 74 20 74 61 62 6C | onsense..@t tabl | | 65 5F 6F 66 5F 63 6F 6E 74 65 6E 74 73 20 6E 6F | e_of_contents no | | 6E 73 65 6E 73 65 0A 0A | nsense.. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC26: Test syntax checking of table of contents typesetting pragma.<010> 00002 00002| <010> 00003 00003| 1. Make sure that a legal table of contents directive is OK.<010> 00004 00004| @t table_of_contents<010> 00005 00005| <010> 00006 00006| 2. Check that it doesn't stand for any nonsense.<010> 00007 00007| @t table_of_contents nonsense<010> 00008 00008| <010> 00009 00009| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 5 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC26: Test syntax checking of table of contents typesetting pragma.<010> <010> 1. Make sure that a legal table of contents directive is OK.<010> " 0004[01]: @t.. TOC. 0005[01]: Text. Text scrap[Grey]="<010> 2. Check that it doesn't stand for any nonsense.<010> " 0008[01]: Text. Text scrap[White]="<010> " 0009[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC26: Test syntax checking of table of contents typesetting pragma. 2 2| 3 3| 1. Make sure that a legal table of contents directive is OK. 4 4| @t table_of_contents 5 5| 6 6| 2. Check that it doesn't stand for any nonsense. 7 7| @t table_of_contents nonsense Error|......................^The table_of_contents directive does not take arguments. |......................^Directive ignored. 8 8| | ------------+------------------------------------------------------------------- There was 1 Error. ne|blank". |.^Pragma ignored. 5 5| @p indentation = Error|.^This indentation pragma has the wrong number of arguments. |.^The correct format is: "@p indentation = none|blank". |.^Pragma ignored. 6 6| @p indentation = xxx yyy Error|.^This indentation pragma has the wrong number of argumentsfw_src/answers/sc27.lis 644 0 0 13610 6717353677 10307 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 32 37 3A 20 54 65 73 74 20 73 79 6E 74 61 | SC27: Test synta | | 78 20 63 68 65 63 6B 69 6E 67 20 6F 66 20 76 73 | x checking of vs | | 6B 69 70 20 74 79 70 65 73 65 74 74 69 6E 67 20 | kip typesetting | | 64 69 72 65 63 74 69 76 65 2E 0A 0A 31 2E 20 54 | directive...1. T | | 65 73 74 20 6E 6F 74 20 65 78 61 63 74 6C 79 20 | est not exactly | | 74 68 72 65 65 20 61 72 67 75 6D 65 6E 74 73 20 | three arguments | | 28 69 6E 63 6C 75 64 65 73 20 76 73 6B 69 70 29 | (includes vskip) | | 2E 0A 40 74 20 76 73 6B 69 70 0A 40 74 20 76 73 | ..@t vskip.@t vs | | 6B 69 70 20 6F 6E 65 0A 40 74 20 76 73 6B 69 70 | kip one.@t vskip | | 20 6F 6E 65 20 74 77 6F 20 74 68 72 65 65 20 66 | one two three f | | 6F 75 72 0A 0A 32 2E 20 54 65 73 74 20 74 68 69 | our..2. Test thi | | 72 64 20 61 72 67 75 6D 65 6E 74 20 6E 6F 74 20 | rd argument not | | 22 6D 6D 22 2E 0A 40 74 20 76 73 6B 69 70 20 33 | "mm"..@t vskip 3 | | 32 20 78 78 0A 0A 33 2E 20 54 65 73 74 20 73 65 | 2 xx..3. Test se | | 63 6F 6E 64 20 61 72 67 75 6D 65 6E 74 20 68 61 | cond argument ha | | 73 20 62 61 64 20 64 69 67 69 74 2E 0A 40 74 20 | s bad digit..@t | | 76 73 6B 69 70 20 33 66 20 6D 6D 0A 0A 34 2E 20 | vskip 3f mm..4. | | 54 65 73 74 20 6E 75 6D 62 65 72 20 68 61 73 20 | Test number has | | 6D 6F 72 65 20 74 68 61 6E 20 74 68 72 65 65 20 | more than three | | 64 69 67 69 74 73 0A 0A 40 74 20 76 73 6B 69 70 | digits..@t vskip | | 20 34 33 35 35 20 6D 6D 0A 0A 35 2E 20 54 65 73 | 4355 mm..5. Tes | | 74 20 61 20 6C 65 67 61 6C 20 6F 6E 65 20 74 6F | t a legal one to | | 6F 2E 0A 40 74 20 76 73 6B 69 70 20 32 30 20 6D | o..@t vskip 20 m | | 6D 0A 0A | m.. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC27: Test syntax checking of vskip typesetting directive.<010> 00002 00002| <010> 00003 00003| 1. Test not exactly three arguments (includes vskip).<010> 00004 00004| @t vskip<010> 00005 00005| @t vskip one<010> 00006 00006| @t vskip one two three four<010> 00007 00007| <010> 00008 00008| 2. Test third argument not "mm".<010> 00009 00009| @t vskip 32 xx<010> 00010 00010| <010> 00011 00011| 3. Test second argument has bad digit.<010> 00012 00012| @t vskip 3f mm<010> 00013 00013| <010> 00014 00014| 4. Test number has more than three digits<010> 00015 00015| <010> 00016 00016| @t vskip 4355 mm<010> 00017 00017| <010> 00018 00018| 5. Test a legal one too.<010> 00019 00019| @t vskip 20 mm<010> 00020 00020| <010> 00021 00021| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 8 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC27: Test syntax checking of vskip typesetting directive.<010> <010> 1. Test not exactly three arguments (includes vskip).<010> " 0007[01]: Text. Text scrap[Grey]="<010> 2. Test third argument not "mm".<010> " 0010[01]: Text. Text scrap[Grey]="<010> 3. Test second argument has bad digit.<010> " 0013[01]: Text. Text scrap[Grey]="<010> 4. Test number has more than three digits<010> <010> " 0017[01]: Text. Text scrap[Grey]="<010> 5. Test a legal one too.<010> " 0019[01]: @t.. Vertical skip. Vertical space skipped=20mm. 0020[01]: Text. Text scrap[White]="<010> " 0021[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC27: Test syntax checking of vskip typesetting directive. 2 2| 3 3| 1. Test not exactly three arguments (includes vskip). 4 4| @t vskip Error|.^This directive has the wrong number of arguments. |.^The correct format is: "@t vskip mm". |.^Directive ignored. 5 5| @t vskip one Error|.^This directive has the wrong number of arguments. |.^The correct format is: "@t vskip mm". |.^Directive ignored. 6 6| @t vskip one two three four Error|.^This directive has the wrong number of arguments. |.^The correct format is: "@t vskip mm". |.^Directive ignored. 7 7| 8 8| 2. Test third argument not "mm". 9 9| @t vskip 32 xx |.^The correct format is: "@t vskip mm". |.^Directive ignored. Error|.............^Expecting "mm". 10 10| 11 11| 3. Test second argument has bad digit. 12 12| @t vskip 3f mm Error|...........^Illegal digit. |...........^Value must consist entirely of decimal digits. |...........^Directive ignored. 13 13| 14 14| 4. Test number has more than three digits 15 15| 16 16| @t vskip 4355 mm Error|..........^Too many digits. The maximum is three. |..........^Directive ignored. 17 17| 18 18| 5. Test a legal one too. 19 19| @t vskip 20 mm 20 20| | ------------+------------------------------------------------------------------- There were 6 Errors. 79 6E 74 61 | SC26: Test synta | | 78 20 63 68 65 63 6B 69 6E 67 20 6F 66 20 74 61 | x checking of ta | | 62 6C 65 20 6Ffw_src/answers/sc28.lis 644 0 0 32026 6717353677 10312 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 32 38 3A 20 54 65 73 74 20 73 79 6E 74 61 | SC28: Test synta | | 78 20 63 68 65 63 6B 69 6E 67 20 6F 66 20 74 69 | x checking of ti | | 74 6C 65 20 74 79 70 65 73 65 74 74 69 6E 67 20 | tle typesetting | | 64 69 72 65 63 74 69 76 65 2E 0A 0A 31 2E 20 54 | directive...1. T | | 65 73 74 20 6C 65 73 73 20 74 68 61 6E 20 66 6F | est less than fo | | 75 72 20 61 72 67 75 6D 65 6E 74 73 20 28 69 6E | ur arguments (in | | 63 6C 75 64 65 73 20 74 69 74 6C 65 29 2E 0A 4E | cludes title)..N | | 6F 74 65 3A 20 54 68 65 20 74 69 74 6C 65 20 63 | ote: The title c | | 6F 6D 6D 61 6E 64 20 70 75 6C 6C 73 20 61 20 68 | ommand pulls a h | | 61 63 6B 20 74 72 65 61 74 69 6E 67 20 74 68 65 | ack treating the | | 20 72 65 73 74 20 6F 66 20 74 68 65 20 6C 69 6E | rest of the lin | | 65 20 61 66 74 65 72 0A 74 77 6F 20 61 72 67 75 | e after.two argu | | 6D 65 6E 74 73 20 61 73 20 74 68 65 20 73 74 72 | ments as the str | | 69 6E 67 2E 20 53 6F 20 69 74 20 63 61 6E 27 74 | ing. So it can't | | 20 64 65 74 65 63 74 20 61 6E 20 45 58 43 45 53 | detect an EXCES | | 53 20 6F 66 20 61 72 67 75 6D 65 6E 74 73 21 0A | S of arguments!. | | 40 74 20 74 69 74 6C 65 0A 40 74 20 74 69 74 6C | @t title.@t titl | | 65 20 74 77 6F 0A 40 74 20 74 69 74 6C 65 20 74 | e two.@t title t | | 77 6F 20 74 68 72 65 65 0A 0A 32 2E 20 54 65 73 | wo three..2. Tes | | 74 20 6F 75 74 20 62 61 64 20 66 6F 6E 74 2E 0A | t out bad font.. | | 40 74 20 74 69 74 6C 65 20 73 6C 6F 74 68 66 6F | @t title slothfo | | 6E 74 20 6C 65 66 74 20 22 53 6C 6F 74 68 22 0A | nt left "Sloth". | | 0A 33 2E 20 54 65 73 74 20 6F 75 74 20 62 61 64 | .3. Test out bad | | 20 61 6C 69 67 6E 6D 65 6E 74 2E 0A 40 74 20 74 | alignment..@t t | | 69 74 6C 65 20 74 69 74 6C 65 66 6F 6E 74 20 77 | itle titlefont w | | 65 73 74 77 61 72 64 20 22 53 6C 6F 74 68 22 0A | estward "Sloth". | | 0A 34 2E 20 54 65 73 74 20 6F 75 74 20 66 75 6E | .4. Test out fun | | 6E 79 20 73 74 72 69 6E 67 73 2E 0A 40 74 20 74 | ny strings..@t t | | 69 74 6C 65 20 74 69 74 6C 65 66 6F 6E 74 20 6C | itle titlefont l | | 65 66 74 20 22 0A 40 74 20 74 69 74 6C 65 20 74 | eft ".@t title t | | 69 74 6C 65 66 6F 6E 74 20 6C 65 66 74 20 22 22 | itlefont left "" | | 0A 40 21 20 4E 6F 74 65 3A 20 54 68 65 20 66 6F | .@! Note: The fo | | 6C 6C 6F 77 69 6E 67 2C 20 62 65 6C 69 65 76 65 | llowing, believe | | 20 69 74 20 6F 72 20 6E 6F 74 2C 20 69 73 20 61 | it or not, is a | | 63 74 75 61 6C 6C 79 20 4C 45 47 41 4C 21 0A 40 | ctually LEGAL!.@ | | 74 20 74 69 74 6C 65 20 74 69 74 6C 65 66 6F 6E | t title titlefon | | 74 20 6C 65 66 74 20 22 73 6C 6F 74 68 22 73 6C | t left "sloth"sl | | 6F 74 68 22 0A 0A 35 2E 20 54 65 73 74 20 6F 75 | oth"..5. Test ou | | 74 20 61 6C 6C 20 63 6F 6D 62 69 6E 61 74 69 6F | t all combinatio | | 6E 73 20 6F 66 20 66 6F 6E 74 20 61 6E 64 20 61 | ns of font and a | | 6C 69 67 6E 6D 65 6E 74 2E 0A 40 74 20 74 69 74 | lignment..@t tit | | 6C 65 20 74 69 74 6C 65 66 6F 6E 74 20 20 20 20 | le titlefont | | 20 20 6C 65 66 74 20 20 20 22 53 6C 6F 74 68 22 | left "Sloth" | | 0A 40 74 20 74 69 74 6C 65 20 74 69 74 6C 65 66 | .@t title titlef | | 6F 6E 74 20 20 20 20 20 20 63 65 6E 74 72 65 20 | ont centre | | 22 53 6C 6F 74 68 22 0A 40 74 20 74 69 74 6C 65 | "Sloth".@t title | | 20 74 69 74 6C 65 66 6F 6E 74 20 20 20 20 20 20 | titlefont | | 72 69 67 68 74 20 20 22 53 6C 6F 74 68 22 0A 40 | right "Sloth".@ | | 74 20 74 69 74 6C 65 20 73 6D 61 6C 6C 74 69 74 | t title smalltit | | 6C 65 66 6F 6E 74 20 6C 65 66 74 20 20 20 22 53 | lefont left "S | | 6C 6F 74 68 22 0A 40 74 20 74 69 74 6C 65 20 73 | loth".@t title s | | 6D 61 6C 6C 74 69 74 6C 65 66 6F 6E 74 20 63 65 | malltitlefont ce | | 6E 74 72 65 20 22 53 6C 6F 74 68 22 0A 40 74 20 | ntre "Sloth".@t | | 74 69 74 6C 65 20 73 6D 61 6C 6C 74 69 74 6C 65 | title smalltitle | | 66 6F 6E 74 20 72 69 67 68 74 20 20 22 53 6C 6F | font right "Slo | | 74 68 22 0A 40 74 20 74 69 74 6C 65 20 6E 6F 72 | th".@t title nor | | 6D 61 6C 66 6F 6E 74 20 20 20 20 20 6C 65 66 74 | malfont left | | 20 20 20 22 53 6C 6F 74 68 22 0A 40 74 20 74 69 | "Sloth".@t ti | | 74 6C 65 20 6E 6F 72 6D 61 6C 66 6F 6E 74 20 20 | tle normalfont | | 20 20 20 63 65 6E 74 72 65 20 22 53 6C 6F 74 68 | centre "Sloth | | 22 0A 40 74 20 74 69 74 6C 65 20 6E 6F 72 6D 61 | ".@t title norma | | 6C 66 6F 6E 74 20 20 20 20 20 72 69 67 68 74 20 | lfont right | | 20 22 53 6C 6F 74 68 22 0A 0A 36 2E 20 54 65 73 | "Sloth"..6. Tes | | 74 20 6D 69 73 73 70 65 6C 6C 69 6E 67 20 6F 66 | t misspelling of | | 20 63 65 6E 74 72 65 20 28 52 6F 73 73 27 73 20 | centre (Ross's | | 72 65 76 65 6E 67 65 29 2E 0A 40 74 20 74 69 74 | revenge)..@t tit | | 6C 65 20 6E 6F 72 6D 61 6C 66 6F 6E 74 20 20 20 | le normalfont | | 20 20 63 65 6E 74 65 72 20 22 53 6C 6F 74 68 22 | center "Sloth" | | 0A | . | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC28: Test syntax checking of title typesetting directive.<010> 00002 00002| <010> 00003 00003| 1. Test less than four arguments (includes title).<010> 00004 00004| Note: The title command pulls a hack treating the rest of the line after<010> 00005 00005| two arguments as the string. So it can't detect an EXCESS of arguments!<010> 00006 00006| @t title<010> 00007 00007| @t title two<010> 00008 00008| @t title two three<010> 00009 00009| <010> 00010 00010| 2. Test out bad font.<010> 00011 00011| @t title slothfont left "Sloth"<010> 00012 00012| <010> 00013 00013| 3. Test out bad alignment.<010> 00014 00014| @t title titlefont westward "Sloth"<010> 00015 00015| <010> 00016 00016| 4. Test out funny strings.<010> 00017 00017| @t title titlefont left "<010> 00018 00018| @t title titlefont left ""<010> 00019 00019| @! Note: The following, believe it or not, is actually LEGAL!<010> 00020 00020| @t title titlefont left "sloth"sloth"<010> 00021 00021| <010> 00022 00022| 5. Test out all combinations of font and alignment.<010> 00023 00023| @t title titlefont left "Sloth"<010> 00024 00024| @t title titlefont centre "Sloth"<010> 00025 00025| @t title titlefont right "Sloth"<010> 00026 00026| @t title smalltitlefont left "Sloth"<010> 00027 00027| @t title smalltitlefont centre "Sloth"<010> 00028 00028| @t title smalltitlefont right "Sloth"<010> 00029 00029| @t title normalfont left "Sloth"<010> 00030 00030| @t title normalfont centre "Sloth"<010> 00031 00031| @t title normalfont right "Sloth"<010> 00032 00032| <010> 00033 00033| 6. Test misspelling of centre (Ross's revenge).<010> 00034 00034| @t title normalfont center "Sloth"<010> 00035 00035| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 18 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC28: Test syntax checking of title typesetting directive.<010> <010> 1. Test less than four arguments (includes title).<010> Note: The title command pulls a hack treating the rest of the line after<010> two arguments as the string. So it can't detect an EXCESS of arguments!<010> " 0009[01]: Text. Text scrap[Grey]="<010> 2. Test out bad font.<010> " 0012[01]: Text. Text scrap[Grey]="<010> 3. Test out bad alignment.<010> " 0015[01]: Text. Text scrap[Grey]="<010> 4. Test out funny strings.<010> " 0018[01]: @t.. Title. Font=Title, Alignment=Left. Title text follows: Text scrap[Grey]="" 0020[01]: @t.. Title. Font=Title, Alignment=Left. Title text follows: Text scrap[Grey]="sloth"sloth" 0021[01]: Text. Text scrap[Grey]="<010> 5. Test out all combinations of font and alignment.<010> " 0023[01]: @t.. Title. Font=Title, Alignment=Left. Title text follows: Text scrap[Grey]="Sloth" 0024[01]: @t.. Title. Font=Title, Alignment=Centre. Title text follows: Text scrap[Grey]="Sloth" 0025[01]: @t.. Title. Font=Title, Alignment=Right. Title text follows: Text scrap[Grey]="Sloth" 0026[01]: @t.. Title. Font=Small Title, Alignment=Left. Title text follows: Text scrap[Grey]="Sloth" 0027[01]: @t.. Title. Font=Small Title, Alignment=Centre. Title text follows: Text scrap[Grey]="Sloth" 0028[01]: @t.. Title. Font=Small Title, Alignment=Right. Title text follows: Text scrap[Grey]="Sloth" 0029[01]: @t.. Title. Font=Normal, Alignment=Left. Title text follows: Text scrap[Grey]="Sloth" 0030[01]: @t.. Title. Font=Normal, Alignment=Centre. Title text follows: Text scrap[Grey]="Sloth" 0031[01]: @t.. Title. Font=Normal, Alignment=Right. Title text follows: Text scrap[Grey]="Sloth" 0032[01]: Text. Text scrap[Grey]="<010> 6. Test misspelling of centre (Ross's revenge).<010> " 0035[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC28: Test syntax checking of title typesetting directive. 2 2| 3 3| 1. Test less than four arguments (includes title). 4 4| Note: The title command pulls a hack treating the rest of the line after 5 5| two arguments as the string. So it can't detect an EXCESS of arguments! 6 6| @t title Error|.^This directive has too few arguments. |.^The correct format is: "@t title ". |.^ where = titlefont | smalltitlefont | normalfont. |.^ and = left | centre | right. |.^ and = text delimited by double quotes. |.^Directive ignored. 7 7| @t title two Error|.^This directive has too few arguments. |.^The correct format is: "@t title ". |.^ where = titlefont | smalltitlefont | normalfont. |.^ and = left | centre | right. |.^ and = text delimited by double quotes. |.^Directive ignored. 8 8| @t title two three Error|.^This directive has too few arguments. |.^The correct format is: "@t title ". |.^ where = titlefont | smalltitlefont | normalfont. |.^ and = left | centre | right. |.^ and = text delimited by double quotes. |.^Directive ignored. 9 9| 10 10| 2. Test out bad font. 11 11| @t title slothfont left "Sloth" Error|..........^Expecting one of {titlefont,smalltitlefont,normalfont}. |..........^Directive ignored. 12 12| 13 13| 3. Test out bad alignment. 14 14| @t title titlefont westward "Sloth" Error|....................^Expecting one of {left,right,centre}. |....................^Directive ignored. 15 15| 16 16| 4. Test out funny strings. 17 17| @t title titlefont left " Error|.........................^Text argument must be delimited by double quotes. |.........................^Directive ignored. 18 18| @t title titlefont left "" 19 19| @! Note: The following, believe it or not, is actually LEGAL! 20 20| @t title titlefont left "sloth"sloth" 21 21| 22 22| 5. Test out all combinations of font and alignment. 23 23| @t title titlefont left "Sloth" 24 24| @t title titlefont centre "Sloth" 25 25| @t title titlefont right "Sloth" 26 26| @t title smalltitlefont left "Sloth" 27 27| @t title smalltitlefont centre "Sloth" 28 28| @t title smalltitlefont right "Sloth" 29 29| @t title normalfont left "Sloth" 30 30| @t title normalfont centre "Sloth" 31 31| @t title normalfont right "Sloth" 32 32| 33 33| 6. Test misspelling of centre (Ross's revenge). 34 34| @t title normalfont center "Sloth" Error|.........................^Expecting one of {left,right,centre}. |.........................^Note: Centre is spelt centRE, not centER. |.........................^ This is my revenge for years of getting error messages |.........................^ from TeX whenever I accidentally wrote \centreline - Ross Williams. |.........................^Directive ignored. | ------------+------------------------------------------------------------------- There were 7 Errors. 4 69 6F | t all combinatio | | 6E 73 20 6F 66 20 66 6F 6E 74 20 61 6E 64 20 61 | ns of font and a | | 6C 69 67 6E 6D 65 6E 74 2E 0A 40 74 20 74 69 74 | lignment..@t tit | | 6C 65 20 74 69 74 6C 65 66 6F 6E 74 20 20 20 20 | le titlefont | | 20 20 6C 65 66 74 20 20 20 22 53 6C 6F 74 68 22 | left "Sloth" | | 0A 40 74 20 74 69 74 6C 65 20 74 69 74 6C 65 66 | .@t title titlef | | 6F 6E 74 20 20 20 20 20 20 63 65 6E 74 72 65 20 | ont centre | | 22 53 6C 6F 74 68 22 0A 40 74 20 fw_src/answers/sc29.lis 644 0 0 15421 6717353701 10277 FUNNELWEB LISTING FILE ====================== Dump of mapped file "<>". MEMORY DUMP OF MAPPED FILE ========================== +-------------------------------------------------+------------------+ | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF | +-------------------------------------------------+------------------+ | 53 43 32 39 3A 20 54 65 73 74 20 73 79 6E 74 61 | SC29: Test synta | | 78 20 63 68 65 63 6B 69 6E 67 20 6F 66 20 74 79 | x checking of ty | | 70 65 73 65 74 74 65 72 20 70 72 61 67 6D 61 2E | pesetter pragma. | | 0A 0A 31 2E 20 54 65 73 74 20 6E 6F 74 20 74 68 | ..1. Test not th | | 72 65 65 20 61 72 67 75 6D 65 6E 74 73 2E 0A 40 | ree arguments..@ | | 70 20 74 79 70 65 73 65 74 74 65 72 0A 40 70 20 | p typesetter.@p | | 74 79 70 65 73 65 74 74 65 72 20 3D 0A 40 70 20 | typesetter =.@p | | 74 79 70 65 73 65 74 74 65 72 20 3D 20 78 78 78 | typesetter = xxx | | 20 79 79 79 0A 0A 32 2E 20 54 65 73 74 20 73 65 | yyy..2. Test se | | 63 6F 6E 64 20 61 72 67 75 6D 65 6E 74 20 6E 6F | cond argument no | | 74 20 22 3D 22 2E 0A 40 70 20 74 79 70 65 73 65 | t "="..@p typese | | 74 74 65 72 20 78 20 73 6C 6F 74 68 0A 0A 33 2E | tter x sloth..3. | | 20 54 65 73 74 20 74 68 69 72 64 20 61 72 67 75 | Test third argu | | 6D 65 6E 74 20 69 73 20 6E 6F 74 20 6C 65 67 61 | ment is not lega | | 6C 2E 0A 40 70 20 74 79 70 65 73 65 74 74 65 72 | l..@p typesetter | | 20 3D 20 73 6C 6F 74 68 0A 0A 34 2E 20 54 65 73 | = sloth..4. Tes | | 74 20 74 68 69 72 64 20 61 72 67 75 6D 65 6E 74 | t third argument | | 20 69 73 20 6E 6F 6E 65 2E 0A 40 70 20 74 79 70 | is none..@p typ | | 65 73 65 74 74 65 72 20 3D 20 6E 6F 6E 65 0A 0A | esetter = none.. | | 35 2E 20 54 65 73 74 20 74 68 69 72 64 20 61 72 | 5. Test third ar | | 67 75 6D 65 6E 74 20 69 73 20 74 65 78 2E 0A 36 | gument is tex..6 | | 2E 20 54 65 73 74 20 70 72 61 67 6D 61 20 6F 70 | . Test pragma op | | 70 6F 73 65 73 20 65 61 72 6C 69 65 72 20 70 72 | poses earlier pr | | 61 67 6D 61 2E 0A 40 70 20 74 79 70 65 73 65 74 | agma..@p typeset | | 74 65 72 20 3D 20 74 65 78 0A 0A 37 2E 20 54 65 | ter = tex..7. Te | | 73 74 20 70 72 61 67 6D 61 20 64 6F 65 73 20 6E | st pragma does n | | 6F 74 20 6F 70 70 6F 73 65 20 65 61 72 6C 69 65 | ot oppose earlie | | 72 20 70 72 61 67 6D 61 2E 0A 40 70 20 74 79 70 | r pragma..@p typ | | 65 73 65 74 74 65 72 20 3D 20 6E 6F 6E 65 0A 0A | esetter = none.. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ============================ Globl Local| Text -----------+-------------------------------------------------------------------- 00001 00001| SC29: Test syntax checking of typesetter pragma.<010> 00002 00002| <010> 00003 00003| 1. Test not three arguments.<010> 00004 00004| @p typesetter<010> 00005 00005| @p typesetter =<010> 00006 00006| @p typesetter = xxx yyy<010> 00007 00007| <010> 00008 00008| 2. Test second argument not "=".<010> 00009 00009| @p typesetter x sloth<010> 00010 00010| <010> 00011 00011| 3. Test third argument is not legal.<010> 00012 00012| @p typesetter = sloth<010> 00013 00013| <010> 00014 00014| 4. Test third argument is none.<010> 00015 00015| @p typesetter = none<010> 00016 00016| <010> 00017 00017| 5. Test third argument is tex.<010> 00018 00018| 6. Test pragma opposes earlier pragma.<010> 00019 00019| @p typesetter = tex<010> 00020 00020| <010> 00021 00021| 7. Test pragma does not oppose earlier pragma.<010> 00022 00022| @p typesetter = none<010> 00023 00023| <010> 00024 00024| <010> -----------+-------------------------------------------------------------------- Globl Local| Text ============================ End of LINE LIST DUMP ============================= =========================== Start of TOKEN LIST DUMP =========================== Summary: There are 8 tokens in the token list. Line[Column]: Token Description ------------------------------- 0001[01]: Text. Text scrap[Grey]="SC29: Test syntax checking of typesetter pragma.<010> <010> 1. Test not three arguments.<010> " 0007[01]: Text. Text scrap[Grey]="<010> 2. Test second argument not "=".<010> " 0010[01]: Text. Text scrap[Grey]="<010> 3. Test third argument is not legal.<010> " 0013[01]: Text. Text scrap[Grey]="<010> 4. Test third argument is none.<010> " 0016[01]: Text. Text scrap[Grey]="<010> 5. Test third argument is tex.<010> 6. Test pragma opposes earlier pragma.<010> " 0020[01]: Text. Text scrap[Grey]="<010> 7. Test pragma does not oppose earlier pragma.<010> " 0023[01]: Text. Text scrap[White]="<010> " 0024[01]: End Of File. ============================ End of TOKEN LIST DUMP ============================ Macro table dump skipped (Parser was not invoked). Document list dump skipped (Parser was not invoked). Global Local| Input File ------------+------------------------------------------------------------------- 1 1| SC29: Test syntax checking of typesetter pragma. 2 2| 3 3| 1. Test not three arguments. 4 4| @p typesetter Error|.^This typesetter pragma has the wrong number of arguments. |.^The correct format is: "@p typesetter = none|tex|html". |.^Pragma ignored. 5 5| @p typesetter = Error|.^This typesetter pragma has the wrong number of arguments. |.^The correct format is: "@p typesetter = none|tex|html". |.^Pragma ignored. 6 6| @p typesetter = xxx yyy Error|.^This typesetter pragma has the wrong number of arguments. |.^The correct format is: "@p typesetter = none|tex|html". |.^Pragma ignored. 7 7| 8 8| 2. Test second argument not "=". 9 9| @p typesetter x sloth |.^The correct format is: "@p typesetter = none|tex|html". |.^Pragma ignored. Error|...............^Expecting "=". 10 10| 11 11| 3. Test third argument is not legal. 12 12| @p typesetter = sloth |.^The correct format is: "@p typesetter = none|tex|html". |.^Pragma ignored. Error|.................^Expecting one of [none,tex,html]. 13 13| 14 14| 4. Test third argument is none. 15 15| @p typesetter = none |.^This pragma is opposed by the pragma at line 19. 16 16| 17 17| 5. Test third argument is tex. 18 18| 6. Test pragma opposes earlier pragma. 19 19| @p typesetter = tex Error|.^This pragma opposes the pragma at line 15. |.^You can have as many typesetter pragmas as you like, |.^but they all have to be the same! |.^Pragma ignored. 20 20| 21 21| 7. Test pragma does not oppose earlier pragma. 22 22| @p typesetter = none 23 23| | ------------+------------------------------------------------------------------- There were 6 Errors. itlefont | smalltitlefont | normalfont. |.^ and = left | centre | right. |.^ and = text delimited by double quotes. |.^Directive ignored. 9 9| 10 10| 2. Test out fw_src/answers/tg01.lis 644 0 0 460 6717353735 10236 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed .out. SUCCESS: No diagnostics. loth" 21 21| 22 22| 5. Test out all combinations of font and alignment. 23 23| @t title titlefont left "Sloth" 24 24| @t title titlefont centre "Sloth" 25 25| @fw_src/answers/tg01.out 644 0 0 155 6717353735 10257 Patterson's prayer: "There is nothing I would rather be, than chairman of the ABC." - Les Patterson lt centRE, not centER. |.........................^ This is my revenge for years of getting error messages |.........................^ from TeX whenever I accidentally wrote \centreline - Ross Williams. |.........................^Directive ignored. | ------------+------------------------------------------------------------------- fw_src/answers/tg02.lis 644 0 0 464 6717353736 10244 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed tg02.out. SUCCESS: No diagnostics. fw_src/answers/tg02.out 644 0 0 1026 6717353736 10277 The other day upon the stair, I met a man who wasn't there. He wasn't there again today, I think he's from the CIA. In the output begin0 should be at the left margin, then begin1 to begin wayout should be indented by three spaces. Then the "It's scary" should be positioned over the "a" ofd margin. The rest should be at the left margin. begin0 begin1 begin2 begin3 begin4 begin wayout----------V It's scary out here So far from the left margin. end wayout----------^ end4 end3 end2 end1 end0 ond argument no | | 74 20 22 3D 22 2E 0A 40 70 20 74 79 70 65 73 65 | t "="..@p typese | | 74 74 65 72 20 78 20 73 6C 6F 74 68 0A 0A 33 2E | tter x sloth..3. | | 20 54 65 73 74 20 74 68 69 72 64 20 61 72 67 75 | Test third argu | | 6D 65 6E 74 20 69 73 20 6E 6F 74 20 6C 65 67 61 | ment is not lega | | 6C 2E 0A 40 70 20 74 79 70 65 73 65 74 74 65 72 | l..@p typesetter | | 20 3D 20 73 6C 6F 74 68 0A 0A 34 2E 20 54 65 73 | = sloth..4. Tes | | 74 20 74 68 69 72 64 20 61 72 67 75 6D 65 6Efw_src/answers/tg03.lis 644 0 0 464 6717353737 10246 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed tg03.out. SUCCESS: No diagnostics. 74 65 72 20 3D 20 6E 6F 6E 65 0A 0A | esetter = none.. | +-------------------------------------------------+------------------+ =========================== Start of LINE LIST DUMP ======================fw_src/answers/tg03.out 644 0 0 772 6717353737 10270 The other day upon the stair, I met a man who wasn't there. He wasn't there again today, I think he's from the CIA. The following nest of begin and ends should be indented in a nest. begin0 begin1 begin2 begin3 begin4 begin wayout----------V It's scary out here So far from the left margin. end wayout----------^ end4 end3 end2 end1 end0 ------fw_src/answers/tg04.lis 644 0 0 464 6717353740 10241 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed tg04.out. SUCCESS: No diagnostics. 6. Test pragma opposes earlier pragma.<010> " 0020[01]: Text. Text scrap[Grey]="<010> 7. Test pragma does not oppose earlier pragma.<010> " 0023[01]: Text. Text scrap[White]="<010> " 0024[01]: End Of Filefw_src/answers/tg04.out 644 0 0 724 6717353740 10260 1. Test macro call with no parameters. "Teapot" = "Teapot" 2. Test macro call with one parameter. "Left Testing Right" = "Left Testing Right" 3. Test macro call with many parameters. "Left x Middle y Right" = "Left x Middle y Right" 4. Test macro call as a parameter of another macro call. "Left Ostrich Middle Left Wombat Right Right" = "Left Ostrich Middle Left Wombat Right Right" 5. Test expression recursive macro call. "[X[[Walrus]]Y]" = "[X[[Walrus]]Y]" pesetter = none|tex|html". |.^Prfw_src/answers/tg05.lis 644 0 0 1051 6717353741 10254 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- E: Product file line is too long (line 4 of "<>"). Product file line length limit is 80 characters. Note: You can change the limit by specifying. @p maximum_output_line_length = somewhere in the input file. Tangle: Completed tg05.out. There was 1 Error. 21| 7. Test pragma does not oppose earlier pragma. 22 22| @p typesetter = none 23 23| | ------------+------------------------------------------------------------------- There were 6 Errors. itlefont | smalltitlefont | normalfont. |.^ and = left | centre | right. |.^ and = text delimited by double quotes. |.^Directive ignored. 9 9| 10 10| 2. Test out fw_src/answers/tg05.out 644 0 0 423 6717353741 10256 We test the default limit of 80 characters. Only the second of the following two lines should provoke an error. 12345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901 t. SUCCESS: No diagnostics. loth" 21 21| 22 22| 5. Test out all combinations of font and alignment. 23 23| @t title titlefont left "Sloth" 24 24| @t title titlefont centre "Sloth" 25 25| @fw_src/answers/tg06.lis 644 0 0 1051 6717353742 10256 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- E: Product file line is too long (line 6 of "<>"). Product file line length limit is 60 characters. Note: You can change the limit by specifying. @p maximum_output_line_length = somewhere in the input file. Tangle: Completed tg06.out. There was 1 Error. 644 0 0 464 6717353736 10244 fw_src/answers/tg06.out 644 0 0 452 6717353742 10262 We test the user-set limit of 60 characters. Only the third of the following three lines should provoke an error. 1 2 3 4 5 6 123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901 fw_src/answers/tg07.lis 644 0 0 464 6717353744 10250 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed tg07.out. SUCCESS: No diagnostics. t is not lega | | 6C 2E 0A 40 70 20 74 79 70 65 73 65 74 74 65 72 | l..@p typesetter | | 20 3D 20 73 6C 6F 74 68 0A 0A 34 2E 20 54 65 73 | = sloth..4. Tes | | 74 20 74 68 69 72 64 20 61 72 67 75 6D 65 6Efw_src/answers/tg07.out 644 0 0 1160 6717353744 10302 The following long line should not blow the line length limit. 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 0 0 772 6717353737 10270 fw_src/answers/tg08.lis 644 0 0 464 6717353744 10251 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed tg08.out. SUCCESS: No diagnostics. fw_src/answers/tg08.out 644 0 0 274 6717353745 10271 Is this a mouse I see before me? Its contours moulded for my hand? Come, let me clutch thee! Now might I drink hot jolt cola And create hacks in C That would not bear witness of the Sun. fw_src/answers/tg09.lis 644 0 0 464 6717353745 10253 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed tg09.out. SUCCESS: No diagnostics. fw_src/answers/tg09.out 644 0 0 723 6717353745 10271 A Megastar's Mantras -------------------- (Things that Mean a Lot to Me) A is for Australia The land I adore; It's so spotless and clean You can eat off the floor. B is for Boomerang, Which our quaint Abos launch In the hope it will bring back A roast quokka's haunch. C is for Culture Which blossoms unchecked, You can't move in my homeland for Beckett and Brecht. ...more... - Dame Edna Everage, "Neglected Poems and Other Creatures" by Barry Humphries, 1991. ed. 9 9| 10 10| 2. Test out fw_src/answers/tg10.lis 644 0 0 464 6717353746 10244 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Tangle: Completed tg10.out. SUCCESS: No diagnostics. " 21 21| 22 22| 5. Test out all combinations of font and alignment. 23 23| @t title titlefont left "Sloth" 24 24| @t title titlefont centre "Sloth" 25 25| @fw_src/answers/tg10.out 644 0 0 242 6717353746 10256 Sloth level zero (correct) Walrus level three (correct) Emu level two (correct) First aardvark level one text (correct) First aardvark level one text (correct) ......... ------------+------------------------------------------------------------------- E: Product file line is too long (line 6 of "<>"). Product file line length limit is 60 characters. Note: You can change the limit by specifying. @p maximum_output_line_length = somewhere in the input file. Tangle:fw_src/answers/wv01.htm 644 0 0 5266 6717353750 10307 Package wv01

WV01: Test basic typeset file output mechanism.


1. A section for no particular reason

1. File: wv01.out={Some text for no particular reason.
}
This macro is attached to an output file.


End Of File

012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789fw_src/answers/wv01.lis 644 0 0 532 6717353747 10263 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Weave: Completed <>. Weave: Completed <>. SUCCESS: No diagnostics. fw_src/answers/wv01.tex 644 0 0 35672 6717353750 10343 %******************************************************************************* %* START OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* %* * %* This TeX file was automatically generated by the FunnelWeb preprocessor. * %* You can typeset this file to produce printed documentation by running it * %* through the TeX typesetter using a command such as: * %* tex thisfilename * %* The resultant file thisfilename.dvi can be printed using a command such as: * %* lpr -Plaser -d thisfilename.dvi * %* * %* FunnelWeb is a preprocessor that allows programmers to weave programs and * %* their documentation together in a single document. The FunnelWeb program * %* analyses such documents producing both program files and typeset * %* documentation such as this TeX file. * %* FunnelWeb was created by Ross N. Williams. * %* * %* For more information on FunnelWeb see http://www.ross.net/funnelweb/ * %* * %******************************************************************************* %===================== Start of FunnelWeb TeX Definitions ====================== % Version % ------- % This is FunnelWeb TeX Macro Library Version 1.0. % Copyright % --------- % This set of FunnelWeb TeX definitions was written by Ross Williams and was % originally Copyright (C) 1992 Ross N. Williams. However, I, Ross Williams, % hereby forego any claim to Copyright in this set of FunnelWeb TeX definitions % and hereby authorize that the set of TeX definitions pass into the public % domain. -- Ross N. Williams, 3:41pm 07-May-1992, Adelaide, Australia. % Modification % ------------ % Please record all modifications to these TeX definitions here. Unless % otherwise specified, all modified definitions fall in the public domain too. % % Programmers: % RNW Ross N. Williams ross@ross.net % % Changes: % 07-May-1992 RNW Prepared this work for public domain release. % 10-May-1999 RNW Added \fwlib macro. % General Comments % ---------------- % This set of TeX definitions exists for two reasons: % % 1. To shorten and neaten the FunnelWeb TeX output. % 2. To allow users to fiddle with the output format in their input files % (by inserting redefining "\def"s) without having to resort to % modifying the FunnelWeb code. % % The user is warned that these definitions may be changed from time to time % (but probably not much). The user should not be too sneaky. In particular, % users wishing to redefine some of these macros should do so in an explicitly % defined section at the top of their input file. This will mean that in the % event of problems, that section can simply be deleted or commented out to % allow the document to at least be typeset in the default format. Users should % limit themselves to redefining these macros in such a section and should % refrain from using the macros throughout their documents. % Environment Parameters % ---------------------- % \tolerance tells TeX how tolerant it should be about making bad line and % page breaks. Here we set it to it's maximum, as % 1) Computer programs are likely to cause lots of bad breaks. % 2) In most cases the user would probably rather get the TeX file through % TeX without any errors than fiddle with spacings for perfection. \tolerance=10000 % I don't like indentation as it makes the page look more busy. Instead, % paragraphs are separated by a little space (see next). \parindent=0pt % In many cases, users will produce documents with long runs of paragraphs. % In order to space out these paragraphs, it is convenient to maintain a % prevailing non-zero \parskip (end-of-paragaph skip). The only trouble is % that the skip becomes a problem in macro definitions which require no skip % and so we have to turn the skip on and off. The following two macros % simplify this process. \def\fwparskipon{\parskip=\medskipamount} \def\fwparskipoff{\parskip=0pt} \fwparskipon % Setting raggedbottom allows TeX to leave a bit of space at the bottom of the % page in order to better vertically align the rest of the page (e.g. skips % won't stretch as much). It also means that headings are less likely to be % isolated at the bottom of the page without any following text. \raggedbottom % Fonts % ----- % Most of the typeset output is set in 10pt roman and 10pt tt font. % The major extra font needs spring from titles and headings. % For portability's sake we use only the following fonts: % cmr10 % cmbx10 % cmtt10 % and some enlargements of them. These fonts are all "standard" fonts % in Plain TeX. See The TeXbook p.350. \font\fwfontnote=cmr7 \font\fwfontnorm=cmr10 \font\fwfontnorma=cmr10 scaled \magstep1 \font\fwfontnormb=cmr10 scaled \magstep2 \font\fwfontbold=cmbx10 \font\fwfontbolda=cmbx10 scaled \magstep1 \font\fwfontboldb=cmbx10 scaled \magstep2 \font\fwfontboldc=cmbx10 scaled \magstep3 \font\fwfontboldd=cmbx10 scaled \magstep4 % Macros for Stylistic Details % ---------------------------- % This section contains all the fiddly little macros for setting the details % of each macro definition. % Macro definitions are sandwiched by calls to these macros which can be used % to sort out the spacing before and after the macro definition. \def\fwbeginmacro{\fwparskipoff\bigskip} \def\fwendmacro{\fwparskipon\par} % These macros deal with the macro name and definition line. \def\fwmacroname#1#2{{\sl #1\/}$\lbrack$#2$\rbrack$} \def\fwfilename#1#2{{\bf #1}$\lbrack$#2$\rbrack$} \def\fwzero#1{{\bf Z}} \def\fwmany#1{{\bf M}} \def\fwlib#1{{\bf L}} \def\fwequals{ $\equiv$} \def\fwplusequals{ $+\equiv$} % Now for the actual body of the definition. It looks nice to have the tt % code indented a little. Again, we use macros instead of writing direct TeX, % so as to allow the user to fiddle this stuff to taste without having to % modify the FunnelWeb C code. \def\fwodef{\parindent=15pt\vskip0pt$\lbrace$\parindent=20pt} \def\fwcdef{$\rbrace$\vskip0pt\parindent=0pt} \def\fwoquote{`} \def\fwcquote{'} \def\fwoparen{$($} \def\fwcomma{$,$} \def\fwcparen{$)$} \def\fwparam#1{$\diamond #1$} \def\fwparams#1{$(\diamond #1)$} % These macros deal with the notes that are appended at the end of each % macro definition. Note that even though \fwisafile,\fwusedin, and \fwseealso % have the same definition, they are given different names so as to allow the % user to redefine these macros to typeset each kind of information differently % if desired. \def\fwbeginmacronotes{\begingroup\baselineskip=9pt\smallskip} \def\fwnote#1{{\fwfontnote #1}\par} \def\fwisafile#1{\fwnote{#1}} \def\fwusedin#1{\fwnote{#1}} \def\fwseealso#1{\fwnote{#1}} \def\fwendmacronotes{\endgroup} % Macros to Typeset Program Code Verbatim % --------------------------------------- % This is by far the hairiest and most difficult part of the typesetting task % because we have to turn off most of TeX's natural instincts in order to % typeset the program text exactly as it appears in the input file. % Two macros are defined to pull this off: \fwbtx and \fwverbatimgobble. % Their code was inspired by the following sections of "The TeXbook": % Appendix D: Dirty Tricks, 3.Verbatim listing, p.380-382. % Appendix E: Example Formats, p.421. % The \fwbtx[ (for "FunnelWeb Begin TeXt") macro does most of the hard work. % The liberal use of "%" is because I don't understand TeX well enough to % understand when an end of line will cause trouble, and I am playing it safe. % Before defining the main \fwbtx macro, we have to stash away some definitions % in the hidden part of TeX's environment. Let's hope that these "hidden" % definitions don't affect anything except what is desired to be affected. % The tt font in which we wish to set the text has two Latin lurking ligatures! % These are ?` and !`. To disable them, we define the left quote when ACTIVE % to be defined in such a way as to prevent ligatures. The main TeX text will % normally not be exposed to this definition because normally the leftquote % character is not active. The \fwbtx macro temporarily makes the left quote % character active thus activating the deactivation of left quote ligatures. % See The TeXbook p.381. {\catcode`\`=\active \gdef`{\relax\lq}} % TeX is fairly carefree about spaces and so we have to make it more serious. % To do so we pull the same trick as above, setting up a definition for active % space, but only making space active during the span of the verbatim text. % In Plain TeX the active space is defined to be simply a space, but here we % define it to be a control space. This ensures that the space cannot % be gobbled up by one of TeX's mysterious mechanisms when activated. % See The TeXbook, p.381 and p.352. {\obeyspaces\global\let =\ } % Here is the main \fwbtx verbatim text macro. % Note: The order in which all these pieces of business have to be done is % still a partial mystery to me. Don't fiddle with this stuff unless you % think you know what you are doing. \def\fwbtx[{% % % The funnies involved in getting verbatim output are safely housed inside % this \begingroup, and the \endgroup in \fwverbatimgobble. Groups are used % instead of curly braces because we have to be able to signal the end of % this macro with a curly brace. \begingroup% % % \pars at the end of empty lines in the verbatim text won't come out normally % because TeX is in vertical mode and they get gobbled up. To prevent this, % we force \par to exit vertical mode first. See The TeXbook p.381. \def\par{\leavevmode\endgraf}% % % Activate the leftquote character so as to avoid ligatures (see above). \catcode`\`=\active% % % The \obeylines macro simply defines end of line (^M) to be \par. This ensures % that TeX will treat each verbatim line as a new paragraph. \obeylines% % % To get verbatim output, we have to desex all the special characters. This % is explained in detail in The TeXbook p.380. \def\do##1{\catcode`##1=12 }\dospecials% % % Activate the space character so as to make TeX treat blanks seriously. % This activation invokes an eralier definition (see above). \obeyspaces % % Interparagraph skips do not help the cause. % Note: We have to preserve the indentation though, as the code is actually % indented in the final output. See \fwodef in an earlier section. \parskip=0pt% % % We typeset the verbatim text in tt font (courier on the Macintosh) for a % number of reasons: % - tt font has the same horizontal spacing for each character. % - tt font covers the ASCII character set. % - tt font doesn't have many surprises (e.g. ligatures). % - tt font looks much what you might see on a computer terminal screen. \tt% % % Having set up an environment for verbatim, we are ready to use it. % By invoking \fwverbatimgobble, this \fwbtx macro gobbles up text verbatim (as % part of the parameter of \fwverbatimgobble) until it sees the termination % string "]fwetx=" (the "=" was thrown in to add obscurity as this sequence % must never occur in the verbatim text). \fwverbatimgobble} % The \fwverbatimgobble macro exists to allow \fwbtx to bracket verbatim text. \def\fwverbatimgobble#1]fwetx={#1\endgroup} % Table of Contents % ----------------- % The five levels of table of contents that FunnelWeb supports are identified % by the five letters [A..E]. These are used throughout the following macros. % The following macros are utilities to the TOC macros to follow. \def\fwrule{\medskip\hrule\medskip} \def\fwqh{\hskip1.5em\relax} \def\fwbeforesec{\penalty-200\bigskip\medskip\par} % The following macros are used to typeset the table of contents. \def\fwtocstart#1{\fwrule\leftline{\fwfontbolda Table of Contents}\fwrule} \def\fwtoca#1#2{\leftline{{\bf #1 #2}}} \def\fwtocb#1#2{\leftline{\fwqh #1 #2}} \def\fwtocc#1#2{\leftline{\fwqh\fwqh #1 #2}} \def\fwtocd#1#2{\leftline{\fwqh\fwqh\fwqh #1 #2}} \def\fwtoce#1#2{\leftline{\fwqh\fwqh\fwqh\fwqh #1 #2}} \def\fwtocfinish#1{\fwrule} % The following "library" macros define five different strengths of headings % which can be used later in the section macros. \def\fwliba#1#2{\vfill\eject{\fwfontboldc #1 #2}\penalty200\smallskip} \def\fwlibb#1#2{\fwbeforesec{\fwfontboldb #1 #2}\penalty200\smallskip} \def\fwlibc#1#2{\fwbeforesec{\fwfontnormb #1 #2}\penalty200\smallskip} \def\fwlibd#1#2{\fwbeforesec{\bf #1 #2}\penalty200} \def\fwlibe#1#2{\fwbeforesec{\bf #1 #2}} % Here are the macros that actually typeset the section headings throughout % the document. The fwlib system has been employed so as to easily allow the % user to redefine the strengths of headings to taste. For example, the % user could insert in the input document a similar set of definitions to these % but with the b..e headings set to \fwlibc. This would tone down the output. \def\fwseca#1#2{\fwliba{#1}{#2}} \def\fwsecb#1#2{\fwlibb{#1}{#2}} \def\fwsecc#1#2{\fwlibc{#1}{#2}} \def\fwsecd#1#2{\fwlibd{#1}{#2}} \def\fwsece#1#2{\fwlibe{#1}{#2}} % Support for Explicit Typesetting % -------------------------------- % FunnelWeb supports pragmas and other constructs that allow % typesetter-independent typesetting commands to be given. The % following macros support these features. % The in-text literal @{sloth@} and emphasise @[walrus@] features. \def\fwlit#1{{\tt #1}} \def\fwemp#1{{\it #1}} % The "@p new_page" pragma. \def\fwnewpage{\vfill\eject} % The "@p vskip Nmm" pragma. \def\fwvskip#1{\null\vskip #1mm} % The "@p title " pragma. \def\fwfontnormal#1{{\fwfontnorm {#1}}} \def\fwfonttitle#1{{\fwfontboldd {#1}}} \def\fwfontsmalltitle#1{{\fwfontboldb {#1}}} \def\fwleftline#1{\leftline{#1}} \def\fwcenterline#1{\centerline{#1}} \def\fwrightline#1{\rightline{#1}} % Support for Old FunnelWeb % ------------------------- % The following macros were used extensively in the first version of % FunnelWeb and are retained so that these older input files will still % typeset cleanly. \def\p#1{{\tt #1}} % P for Program text. \def\flagpage#1#2{ \null \vfill \centerline{\fwfontboldd #1} \vskip 1cm \centerline{\fwfontboldd #2} \vfill \null \vfill } %====================== End of FunnelWeb TeX Definitions ======================= WV01: Test basic typeset file output mechanism. \fwseca{1}{A section for no particular reason} \fwbeginmacro \fwfilename{wv01.out}{1}\fwequals \fwodef \fwbtx[Some text for no particular reason. ]fwetx=% \fwcdef \fwbeginmacronotes \fwisafile{This macro is attached to an output file.} \fwendmacronotes \fwendmacro \bye %******************************************************************************* %* END OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* cmr10 % cmbx10 % cmtt10 % and some enlargements of them. Thefw_src/answers/wv02.htm 644 0 0 14514 6717353752 10326 Package wv02

WV05: Test typesetting features.

1. File: wv05.out={
}
This macro is attached to an output file.

1. Test all five levels of headings with explicit titles.


1. One


1.1. Two


1.1.1. Three


1.1.1.1. Four


1.1.1.1.1. Five

2. Test all five levels of headings with implicit titles.


2. Macro at level one

2. Macro at level one[Z]={Sloth }
This macro is NEVER invoked.


2.1. Macro at level two

3. Macro at level two[Z]={Walrus }
This macro is NEVER invoked.


2.1.1. Macro at level three

4. Macro at level three[Z]={Aardvark }
This macro is NEVER invoked.


2.1.1.1. Macro at level four

5. Macro at level four[Z]={Teapot }
This macro is NEVER invoked.


2.1.1.1.1. Macro at level five

6. Macro at level five[Z]={Emu }
This macro is NEVER invoked.

3. Test the table of contents directive.

1. One
     1.1. Two
               1.1.1. Three
                    1.1.1.1. Four
                         1.1.1.1.1. Five
2. Macro at level one
     2.1. Macro at level two
               2.1.1. Macro at level three
                    2.1.1.1. Macro at level four
                         2.1.1.1.1. Macro at level five

4. Test the newpage directive.


5. Test the vskip directive.





6. Test the title directive.
This is a test Title


End Of File

used to typeset the table of contents. \def\fwtocstart#1{\fwrule\leftline{\fwfontbolda Table of Contents}\fwrule} \def\fwtoca#1#2{\leftline{{\bf #1 #2}}} \def\fwtocb#1#2{\leftlinefw_src/answers/wv02.lis 644 0 0 532 6717353752 10260 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Weave: Completed <>. Weave: Completed <>. SUCCESS: No diagnostics. xample, the % user could insert in the input document a similar set of definitions to these % but with the b..e headings set to \fwlibc. This would tone down the outpfw_src/answers/wv02.tex 644 0 0 41323 6717353752 10334 %******************************************************************************* %* START OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* %* * %* This TeX file was automatically generated by the FunnelWeb preprocessor. * %* You can typeset this file to produce printed documentation by running it * %* through the TeX typesetter using a command such as: * %* tex thisfilename * %* The resultant file thisfilename.dvi can be printed using a command such as: * %* lpr -Plaser -d thisfilename.dvi * %* * %* FunnelWeb is a preprocessor that allows programmers to weave programs and * %* their documentation together in a single document. The FunnelWeb program * %* analyses such documents producing both program files and typeset * %* documentation such as this TeX file. * %* FunnelWeb was created by Ross N. Williams. * %* * %* For more information on FunnelWeb see http://www.ross.net/funnelweb/ * %* * %******************************************************************************* %===================== Start of FunnelWeb TeX Definitions ====================== % Version % ------- % This is FunnelWeb TeX Macro Library Version 1.0. % Copyright % --------- % This set of FunnelWeb TeX definitions was written by Ross Williams and was % originally Copyright (C) 1992 Ross N. Williams. However, I, Ross Williams, % hereby forego any claim to Copyright in this set of FunnelWeb TeX definitions % and hereby authorize that the set of TeX definitions pass into the public % domain. -- Ross N. Williams, 3:41pm 07-May-1992, Adelaide, Australia. % Modification % ------------ % Please record all modifications to these TeX definitions here. Unless % otherwise specified, all modified definitions fall in the public domain too. % % Programmers: % RNW Ross N. Williams ross@ross.net % % Changes: % 07-May-1992 RNW Prepared this work for public domain release. % 10-May-1999 RNW Added \fwlib macro. % General Comments % ---------------- % This set of TeX definitions exists for two reasons: % % 1. To shorten and neaten the FunnelWeb TeX output. % 2. To allow users to fiddle with the output format in their input files % (by inserting redefining "\def"s) without having to resort to % modifying the FunnelWeb code. % % The user is warned that these definitions may be changed from time to time % (but probably not much). The user should not be too sneaky. In particular, % users wishing to redefine some of these macros should do so in an explicitly % defined section at the top of their input file. This will mean that in the % event of problems, that section can simply be deleted or commented out to % allow the document to at least be typeset in the default format. Users should % limit themselves to redefining these macros in such a section and should % refrain from using the macros throughout their documents. % Environment Parameters % ---------------------- % \tolerance tells TeX how tolerant it should be about making bad line and % page breaks. Here we set it to it's maximum, as % 1) Computer programs are likely to cause lots of bad breaks. % 2) In most cases the user would probably rather get the TeX file through % TeX without any errors than fiddle with spacings for perfection. \tolerance=10000 % I don't like indentation as it makes the page look more busy. Instead, % paragraphs are separated by a little space (see next). \parindent=0pt % In many cases, users will produce documents with long runs of paragraphs. % In order to space out these paragraphs, it is convenient to maintain a % prevailing non-zero \parskip (end-of-paragaph skip). The only trouble is % that the skip becomes a problem in macro definitions which require no skip % and so we have to turn the skip on and off. The following two macros % simplify this process. \def\fwparskipon{\parskip=\medskipamount} \def\fwparskipoff{\parskip=0pt} \fwparskipon % Setting raggedbottom allows TeX to leave a bit of space at the bottom of the % page in order to better vertically align the rest of the page (e.g. skips % won't stretch as much). It also means that headings are less likely to be % isolated at the bottom of the page without any following text. \raggedbottom % Fonts % ----- % Most of the typeset output is set in 10pt roman and 10pt tt font. % The major extra font needs spring from titles and headings. % For portability's sake we use only the following fonts: % cmr10 % cmbx10 % cmtt10 % and some enlargements of them. These fonts are all "standard" fonts % in Plain TeX. See The TeXbook p.350. \font\fwfontnote=cmr7 \font\fwfontnorm=cmr10 \font\fwfontnorma=cmr10 scaled \magstep1 \font\fwfontnormb=cmr10 scaled \magstep2 \font\fwfontbold=cmbx10 \font\fwfontbolda=cmbx10 scaled \magstep1 \font\fwfontboldb=cmbx10 scaled \magstep2 \font\fwfontboldc=cmbx10 scaled \magstep3 \font\fwfontboldd=cmbx10 scaled \magstep4 % Macros for Stylistic Details % ---------------------------- % This section contains all the fiddly little macros for setting the details % of each macro definition. % Macro definitions are sandwiched by calls to these macros which can be used % to sort out the spacing before and after the macro definition. \def\fwbeginmacro{\fwparskipoff\bigskip} \def\fwendmacro{\fwparskipon\par} % These macros deal with the macro name and definition line. \def\fwmacroname#1#2{{\sl #1\/}$\lbrack$#2$\rbrack$} \def\fwfilename#1#2{{\bf #1}$\lbrack$#2$\rbrack$} \def\fwzero#1{{\bf Z}} \def\fwmany#1{{\bf M}} \def\fwlib#1{{\bf L}} \def\fwequals{ $\equiv$} \def\fwplusequals{ $+\equiv$} % Now for the actual body of the definition. It looks nice to have the tt % code indented a little. Again, we use macros instead of writing direct TeX, % so as to allow the user to fiddle this stuff to taste without having to % modify the FunnelWeb C code. \def\fwodef{\parindent=15pt\vskip0pt$\lbrace$\parindent=20pt} \def\fwcdef{$\rbrace$\vskip0pt\parindent=0pt} \def\fwoquote{`} \def\fwcquote{'} \def\fwoparen{$($} \def\fwcomma{$,$} \def\fwcparen{$)$} \def\fwparam#1{$\diamond #1$} \def\fwparams#1{$(\diamond #1)$} % These macros deal with the notes that are appended at the end of each % macro definition. Note that even though \fwisafile,\fwusedin, and \fwseealso % have the same definition, they are given different names so as to allow the % user to redefine these macros to typeset each kind of information differently % if desired. \def\fwbeginmacronotes{\begingroup\baselineskip=9pt\smallskip} \def\fwnote#1{{\fwfontnote #1}\par} \def\fwisafile#1{\fwnote{#1}} \def\fwusedin#1{\fwnote{#1}} \def\fwseealso#1{\fwnote{#1}} \def\fwendmacronotes{\endgroup} % Macros to Typeset Program Code Verbatim % --------------------------------------- % This is by far the hairiest and most difficult part of the typesetting task % because we have to turn off most of TeX's natural instincts in order to % typeset the program text exactly as it appears in the input file. % Two macros are defined to pull this off: \fwbtx and \fwverbatimgobble. % Their code was inspired by the following sections of "The TeXbook": % Appendix D: Dirty Tricks, 3.Verbatim listing, p.380-382. % Appendix E: Example Formats, p.421. % The \fwbtx[ (for "FunnelWeb Begin TeXt") macro does most of the hard work. % The liberal use of "%" is because I don't understand TeX well enough to % understand when an end of line will cause trouble, and I am playing it safe. % Before defining the main \fwbtx macro, we have to stash away some definitions % in the hidden part of TeX's environment. Let's hope that these "hidden" % definitions don't affect anything except what is desired to be affected. % The tt font in which we wish to set the text has two Latin lurking ligatures! % These are ?` and !`. To disable them, we define the left quote when ACTIVE % to be defined in such a way as to prevent ligatures. The main TeX text will % normally not be exposed to this definition because normally the leftquote % character is not active. The \fwbtx macro temporarily makes the left quote % character active thus activating the deactivation of left quote ligatures. % See The TeXbook p.381. {\catcode`\`=\active \gdef`{\relax\lq}} % TeX is fairly carefree about spaces and so we have to make it more serious. % To do so we pull the same trick as above, setting up a definition for active % space, but only making space active during the span of the verbatim text. % In Plain TeX the active space is defined to be simply a space, but here we % define it to be a control space. This ensures that the space cannot % be gobbled up by one of TeX's mysterious mechanisms when activated. % See The TeXbook, p.381 and p.352. {\obeyspaces\global\let =\ } % Here is the main \fwbtx verbatim text macro. % Note: The order in which all these pieces of business have to be done is % still a partial mystery to me. Don't fiddle with this stuff unless you % think you know what you are doing. \def\fwbtx[{% % % The funnies involved in getting verbatim output are safely housed inside % this \begingroup, and the \endgroup in \fwverbatimgobble. Groups are used % instead of curly braces because we have to be able to signal the end of % this macro with a curly brace. \begingroup% % % \pars at the end of empty lines in the verbatim text won't come out normally % because TeX is in vertical mode and they get gobbled up. To prevent this, % we force \par to exit vertical mode first. See The TeXbook p.381. \def\par{\leavevmode\endgraf}% % % Activate the leftquote character so as to avoid ligatures (see above). \catcode`\`=\active% % % The \obeylines macro simply defines end of line (^M) to be \par. This ensures % that TeX will treat each verbatim line as a new paragraph. \obeylines% % % To get verbatim output, we have to desex all the special characters. This % is explained in detail in The TeXbook p.380. \def\do##1{\catcode`##1=12 }\dospecials% % % Activate the space character so as to make TeX treat blanks seriously. % This activation invokes an eralier definition (see above). \obeyspaces % % Interparagraph skips do not help the cause. % Note: We have to preserve the indentation though, as the code is actually % indented in the final output. See \fwodef in an earlier section. \parskip=0pt% % % We typeset the verbatim text in tt font (courier on the Macintosh) for a % number of reasons: % - tt font has the same horizontal spacing for each character. % - tt font covers the ASCII character set. % - tt font doesn't have many surprises (e.g. ligatures). % - tt font looks much what you might see on a computer terminal screen. \tt% % % Having set up an environment for verbatim, we are ready to use it. % By invoking \fwverbatimgobble, this \fwbtx macro gobbles up text verbatim (as % part of the parameter of \fwverbatimgobble) until it sees the termination % string "]fwetx=" (the "=" was thrown in to add obscurity as this sequence % must never occur in the verbatim text). \fwverbatimgobble} % The \fwverbatimgobble macro exists to allow \fwbtx to bracket verbatim text. \def\fwverbatimgobble#1]fwetx={#1\endgroup} % Table of Contents % ----------------- % The five levels of table of contents that FunnelWeb supports are identified % by the five letters [A..E]. These are used throughout the following macros. % The following macros are utilities to the TOC macros to follow. \def\fwrule{\medskip\hrule\medskip} \def\fwqh{\hskip1.5em\relax} \def\fwbeforesec{\penalty-200\bigskip\medskip\par} % The following macros are used to typeset the table of contents. \def\fwtocstart#1{\fwrule\leftline{\fwfontbolda Table of Contents}\fwrule} \def\fwtoca#1#2{\leftline{{\bf #1 #2}}} \def\fwtocb#1#2{\leftline{\fwqh #1 #2}} \def\fwtocc#1#2{\leftline{\fwqh\fwqh #1 #2}} \def\fwtocd#1#2{\leftline{\fwqh\fwqh\fwqh #1 #2}} \def\fwtoce#1#2{\leftline{\fwqh\fwqh\fwqh\fwqh #1 #2}} \def\fwtocfinish#1{\fwrule} % The following "library" macros define five different strengths of headings % which can be used later in the section macros. \def\fwliba#1#2{\vfill\eject{\fwfontboldc #1 #2}\penalty200\smallskip} \def\fwlibb#1#2{\fwbeforesec{\fwfontboldb #1 #2}\penalty200\smallskip} \def\fwlibc#1#2{\fwbeforesec{\fwfontnormb #1 #2}\penalty200\smallskip} \def\fwlibd#1#2{\fwbeforesec{\bf #1 #2}\penalty200} \def\fwlibe#1#2{\fwbeforesec{\bf #1 #2}} % Here are the macros that actually typeset the section headings throughout % the document. The fwlib system has been employed so as to easily allow the % user to redefine the strengths of headings to taste. For example, the % user could insert in the input document a similar set of definitions to these % but with the b..e headings set to \fwlibc. This would tone down the output. \def\fwseca#1#2{\fwliba{#1}{#2}} \def\fwsecb#1#2{\fwlibb{#1}{#2}} \def\fwsecc#1#2{\fwlibc{#1}{#2}} \def\fwsecd#1#2{\fwlibd{#1}{#2}} \def\fwsece#1#2{\fwlibe{#1}{#2}} % Support for Explicit Typesetting % -------------------------------- % FunnelWeb supports pragmas and other constructs that allow % typesetter-independent typesetting commands to be given. The % following macros support these features. % The in-text literal @{sloth@} and emphasise @[walrus@] features. \def\fwlit#1{{\tt #1}} \def\fwemp#1{{\it #1}} % The "@p new_page" pragma. \def\fwnewpage{\vfill\eject} % The "@p vskip Nmm" pragma. \def\fwvskip#1{\null\vskip #1mm} % The "@p title " pragma. \def\fwfontnormal#1{{\fwfontnorm {#1}}} \def\fwfonttitle#1{{\fwfontboldd {#1}}} \def\fwfontsmalltitle#1{{\fwfontboldb {#1}}} \def\fwleftline#1{\leftline{#1}} \def\fwcenterline#1{\centerline{#1}} \def\fwrightline#1{\rightline{#1}} % Support for Old FunnelWeb % ------------------------- % The following macros were used extensively in the first version of % FunnelWeb and are retained so that these older input files will still % typeset cleanly. \def\p#1{{\tt #1}} % P for Program text. \def\flagpage#1#2{ \null \vfill \centerline{\fwfontboldd #1} \vskip 1cm \centerline{\fwfontboldd #2} \vfill \null \vfill } %====================== End of FunnelWeb TeX Definitions ======================= WV05: Test typesetting features. \fwbeginmacro \fwfilename{wv05.out}{1}\fwequals \fwodef \fwbtx[ ]fwetx=% \fwcdef \fwbeginmacronotes \fwisafile{This macro is attached to an output file.} \fwendmacronotes \fwendmacro 1. Test all five levels of headings with explicit titles. \fwseca{1}{One} \fwsecb{1.1}{Two} \fwsecc{1.1.1}{Three} \fwsecd{1.1.1.1}{Four} \fwsece{1.1.1.1.1}{Five} 2. Test all five levels of headings with implicit titles. \fwseca{2}{Macro at level one} \fwbeginmacro \fwmacroname{Macro at level one}{2}\fwzero{}\fwequals \fwodef \fwbtx[Sloth]fwetx=% \fwcdef \fwbeginmacronotes \fwusedin{This macro is NEVER invoked.} \fwendmacronotes \fwendmacro \fwsecb{2.1}{Macro at level two} \fwbeginmacro \fwmacroname{Macro at level two}{3}\fwzero{}\fwequals \fwodef \fwbtx[Walrus]fwetx=% \fwcdef \fwbeginmacronotes \fwusedin{This macro is NEVER invoked.} \fwendmacronotes \fwendmacro \fwsecc{2.1.1}{Macro at level three} \fwbeginmacro \fwmacroname{Macro at level three}{4}\fwzero{}\fwequals \fwodef \fwbtx[Aardvark]fwetx=% \fwcdef \fwbeginmacronotes \fwusedin{This macro is NEVER invoked.} \fwendmacronotes \fwendmacro \fwsecd{2.1.1.1}{Macro at level four} \fwbeginmacro \fwmacroname{Macro at level four}{5}\fwzero{}\fwequals \fwodef \fwbtx[Teapot]fwetx=% \fwcdef \fwbeginmacronotes \fwusedin{This macro is NEVER invoked.} \fwendmacronotes \fwendmacro \fwsece{2.1.1.1.1}{Macro at level five} \fwbeginmacro \fwmacroname{Macro at level five}{6}\fwzero{}\fwequals \fwodef \fwbtx[Emu]fwetx=% \fwcdef \fwbeginmacronotes \fwusedin{This macro is NEVER invoked.} \fwendmacronotes \fwendmacro 3. Test the table of contents directive. \fwtocstart{} \fwtoca{1}{One} \fwtocb{1.1}{Two} \fwtocc{1.1.1}{Three} \fwtocd{1.1.1.1}{Four} \fwtoce{1.1.1.1.1}{Five} \fwtoca{2}{Macro at level one} \fwtocb{2.1}{Macro at level two} \fwtocc{2.1.1}{Macro at level three} \fwtocd{2.1.1.1}{Macro at level four} \fwtoce{2.1.1.1.1}{Macro at level five} \fwtocfinish{} 4. Test the newpage directive. \fwnewpage 5. Test the vskip directive. \fwvskip{50} 6. Test the title directive. \fwcenterline{\fwfonttitle{This is a test Title}} \bye %******************************************************************************* %* END OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* the same definition, they are given different names so as to allow the % user to redefine these macros to typeset each kind of information differently % if desired. \def\fwbeginmacronotes{\begingroup\baselineskip=9pt\smallskip} \def\fwnote#1{{\fwfontnote #1}\par} \def\fwisafile#1{\fwnote{#1}} \def\ffw_src/answers/wv03.htm 644 0 0 22677 6717353754 10342 Package wv03

WV03: Test the typesetting of various kinds of macros.

First create an output file to keep the analyser happy.

1. File: wv03.out={}
This macro is attached to an output file.

1. Test macro never used.

2. Never Used[Z]={}
This macro is NEVER invoked.

2. Test a macro used once.

3. Used Once={}
This macro is invoked in definition 7.

3. Test a macro used twice.

4. Used Twice[M]={}
This macro is invoked in definitions 7 and 8.

4. Test a macro used three times.

5. Used Thrice[M]={}
This macro is invoked in definitions 7, 8 and 9.

5. Test a macro used five times.

6. Used Quice[M]={}
This macro is invoked in definitions 7, 8, 9, 10 and 11.

Here is the macro that does all the calling for the above.

7. Dummy1[Z]={Used Once
Used Twice
Used Thrice
Used Quice
}
This macro is NEVER invoked.

8. Dummy2[Z]={Used Twice
Used Thrice
Used Quice
}
This macro is NEVER invoked.

9. Dummy3[Z]={Used Thrice
Used Quice
}
This macro is NEVER invoked.

10. Dummy4[Z]={Used Quice
}
This macro is NEVER invoked.

11. Dummy5[Z]={Used Quice
}
This macro is NEVER invoked.

6. Test a macro with two body parts.

12. Two body parts[Z]+={Sloth }
This macro is defined in definitions 12 and 13.
This macro is invoked in definition 21.

13. Two body parts[Z]+={Walrus }
This macro is defined in definitions 12 and 13.
This macro is invoked in definition 21.

7. Test a macro with three body parts.

14. Three body parts[Z]+={Sloth }
This macro is defined in definitions 14, 15 and 16.
This macro is invoked in definition 19.

15. Three body parts[Z]+={Walrus }
This macro is defined in definitions 14, 15 and 16.
This macro is invoked in definition 19.

16. Three body parts[Z]+={Aardvaark }
This macro is defined in definitions 14, 15 and 16.
This macro is invoked in definition 19.

8. Test a macro with five body parts.

17. Five body parts[Z]+={Sloth }
This macro is defined in definitions 17, 18, 19, 20 and 21.
This macro is NEVER invoked.

18. Five body parts[Z]+={Walrus }
This macro is defined in definitions 17, 18, 19, 20 and 21.
This macro is NEVER invoked.

19. Five body parts[Z]+={Three body parts}
This macro is defined in definitions 17, 18, 19, 20 and 21.
This macro is NEVER invoked.

20. Five body parts[Z]+={Aardvaark }
This macro is defined in definitions 17, 18, 19, 20 and 21.
This macro is NEVER invoked.

21. Five body parts[Z]+={Two body parts}
This macro is defined in definitions 17, 18, 19, 20 and 21.
This macro is NEVER invoked.


End Of File

note#1{{\fwfontnote #1}\par} \def\fwisafile#1{\fwnote{#1}} \def\ffw_src/answers/wv03.lis 644 0 0 532 6717353754 10263 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Weave: Completed <>. Weave: Completed <>. SUCCESS: No diagnostics. file was generated by the FunnelWeb literate programming --> Package wv04

WV04: Test ugly string processing.

1. File: wv04.out={}
This macro is attached to an output file.

1. Test ugly string in section name.


1. !"#$%'()*+,-./0123456789:;<=>?


2. ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`


3. abcdefghijklmnopqrstuvwxyz{|}~

2. Test ugly string in macro name.

2. !"#$%'()*+,-./0123456789:;<=>?[Z]={}
This macro is NEVER invoked.

3. ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`[Z]={}
This macro is NEVER invoked.

4. abcdefghijklmnopqrstuvwxyz{|}~[Z]={}
This macro is NEVER invoked.

3. Test ugly string in literal section. !"#$%'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~


End Of File

fwbeginmacro \fwmacroname{Used Once}{3}\fwequals \fwodef \fwcdef \fwbeginmacronotes \fwusedin{This macro is invoked in definition 7.} \fw_src/answers/wv04.lis 644 0 0 532 6717353756 10266 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Weave: Completed <>. Weave: Completed <>. SUCCESS: No diagnostics. \fwmacroname{Used Twice}{4}\fwbtx[ ]fwetx=% \fwmacroname{Used Thrice}{5}\fwbtx[ ]fwetx=% \fwmacroname{Used Quice}{6}\fwbtx[ ]fwetx=% \fwcdef \fwbeginmacronotes \fwusfw_src/answers/wv04.tex 644 0 0 37615 6717353756 10353 %******************************************************************************* %* START OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* %* * %* This TeX file was automatically generated by the FunnelWeb preprocessor. * %* You can typeset this file to produce printed documentation by running it * %* through the TeX typesetter using a command such as: * %* tex thisfilename * %* The resultant file thisfilename.dvi can be printed using a command such as: * %* lpr -Plaser -d thisfilename.dvi * %* * %* FunnelWeb is a preprocessor that allows programmers to weave programs and * %* their documentation together in a single document. The FunnelWeb program * %* analyses such documents producing both program files and typeset * %* documentation such as this TeX file. * %* FunnelWeb was created by Ross N. Williams. * %* * %* For more information on FunnelWeb see http://www.ross.net/funnelweb/ * %* * %******************************************************************************* %===================== Start of FunnelWeb TeX Definitions ====================== % Version % ------- % This is FunnelWeb TeX Macro Library Version 1.0. % Copyright % --------- % This set of FunnelWeb TeX definitions was written by Ross Williams and was % originally Copyright (C) 1992 Ross N. Williams. However, I, Ross Williams, % hereby forego any claim to Copyright in this set of FunnelWeb TeX definitions % and hereby authorize that the set of TeX definitions pass into the public % domain. -- Ross N. Williams, 3:41pm 07-May-1992, Adelaide, Australia. % Modification % ------------ % Please record all modifications to these TeX definitions here. Unless % otherwise specified, all modified definitions fall in the public domain too. % % Programmers: % RNW Ross N. Williams ross@ross.net % % Changes: % 07-May-1992 RNW Prepared this work for public domain release. % 10-May-1999 RNW Added \fwlib macro. % General Comments % ---------------- % This set of TeX definitions exists for two reasons: % % 1. To shorten and neaten the FunnelWeb TeX output. % 2. To allow users to fiddle with the output format in their input files % (by inserting redefining "\def"s) without having to resort to % modifying the FunnelWeb code. % % The user is warned that these definitions may be changed from time to time % (but probably not much). The user should not be too sneaky. In particular, % users wishing to redefine some of these macros should do so in an explicitly % defined section at the top of their input file. This will mean that in the % event of problems, that section can simply be deleted or commented out to % allow the document to at least be typeset in the default format. Users should % limit themselves to redefining these macros in such a section and should % refrain from using the macros throughout their documents. % Environment Parameters % ---------------------- % \tolerance tells TeX how tolerant it should be about making bad line and % page breaks. Here we set it to it's maximum, as % 1) Computer programs are likely to cause lots of bad breaks. % 2) In most cases the user would probably rather get the TeX file through % TeX without any errors than fiddle with spacings for perfection. \tolerance=10000 % I don't like indentation as it makes the page look more busy. Instead, % paragraphs are separated by a little space (see next). \parindent=0pt % In many cases, users will produce documents with long runs of paragraphs. % In order to space out these paragraphs, it is convenient to maintain a % prevailing non-zero \parskip (end-of-paragaph skip). The only trouble is % that the skip becomes a problem in macro definitions which require no skip % and so we have to turn the skip on and off. The following two macros % simplify this process. \def\fwparskipon{\parskip=\medskipamount} \def\fwparskipoff{\parskip=0pt} \fwparskipon % Setting raggedbottom allows TeX to leave a bit of space at the bottom of the % page in order to better vertically align the rest of the page (e.g. skips % won't stretch as much). It also means that headings are less likely to be % isolated at the bottom of the page without any following text. \raggedbottom % Fonts % ----- % Most of the typeset output is set in 10pt roman and 10pt tt font. % The major extra font needs spring from titles and headings. % For portability's sake we use only the following fonts: % cmr10 % cmbx10 % cmtt10 % and some enlargements of them. These fonts are all "standard" fonts % in Plain TeX. See The TeXbook p.350. \font\fwfontnote=cmr7 \font\fwfontnorm=cmr10 \font\fwfontnorma=cmr10 scaled \magstep1 \font\fwfontnormb=cmr10 scaled \magstep2 \font\fwfontbold=cmbx10 \font\fwfontbolda=cmbx10 scaled \magstep1 \font\fwfontboldb=cmbx10 scaled \magstep2 \font\fwfontboldc=cmbx10 scaled \magstep3 \font\fwfontboldd=cmbx10 scaled \magstep4 % Macros for Stylistic Details % ---------------------------- % This section contains all the fiddly little macros for setting the details % of each macro definition. % Macro definitions are sandwiched by calls to these macros which can be used % to sort out the spacing before and after the macro definition. \def\fwbeginmacro{\fwparskipoff\bigskip} \def\fwendmacro{\fwparskipon\par} % These macros deal with the macro name and definition line. \def\fwmacroname#1#2{{\sl #1\/}$\lbrack$#2$\rbrack$} \def\fwfilename#1#2{{\bf #1}$\lbrack$#2$\rbrack$} \def\fwzero#1{{\bf Z}} \def\fwmany#1{{\bf M}} \def\fwlib#1{{\bf L}} \def\fwequals{ $\equiv$} \def\fwplusequals{ $+\equiv$} % Now for the actual body of the definition. It looks nice to have the tt % code indented a little. Again, we use macros instead of writing direct TeX, % so as to allow the user to fiddle this stuff to taste without having to % modify the FunnelWeb C code. \def\fwodef{\parindent=15pt\vskip0pt$\lbrace$\parindent=20pt} \def\fwcdef{$\rbrace$\vskip0pt\parindent=0pt} \def\fwoquote{`} \def\fwcquote{'} \def\fwoparen{$($} \def\fwcomma{$,$} \def\fwcparen{$)$} \def\fwparam#1{$\diamond #1$} \def\fwparams#1{$(\diamond #1)$} % These macros deal with the notes that are appended at the end of each % macro definition. Note that even though \fwisafile,\fwusedin, and \fwseealso % have the same definition, they are given different names so as to allow the % user to redefine these macros to typeset each kind of information differently % if desired. \def\fwbeginmacronotes{\begingroup\baselineskip=9pt\smallskip} \def\fwnote#1{{\fwfontnote #1}\par} \def\fwisafile#1{\fwnote{#1}} \def\fwusedin#1{\fwnote{#1}} \def\fwseealso#1{\fwnote{#1}} \def\fwendmacronotes{\endgroup} % Macros to Typeset Program Code Verbatim % --------------------------------------- % This is by far the hairiest and most difficult part of the typesetting task % because we have to turn off most of TeX's natural instincts in order to % typeset the program text exactly as it appears in the input file. % Two macros are defined to pull this off: \fwbtx and \fwverbatimgobble. % Their code was inspired by the following sections of "The TeXbook": % Appendix D: Dirty Tricks, 3.Verbatim listing, p.380-382. % Appendix E: Example Formats, p.421. % The \fwbtx[ (for "FunnelWeb Begin TeXt") macro does most of the hard work. % The liberal use of "%" is because I don't understand TeX well enough to % understand when an end of line will cause trouble, and I am playing it safe. % Before defining the main \fwbtx macro, we have to stash away some definitions % in the hidden part of TeX's environment. Let's hope that these "hidden" % definitions don't affect anything except what is desired to be affected. % The tt font in which we wish to set the text has two Latin lurking ligatures! % These are ?` and !`. To disable them, we define the left quote when ACTIVE % to be defined in such a way as to prevent ligatures. The main TeX text will % normally not be exposed to this definition because normally the leftquote % character is not active. The \fwbtx macro temporarily makes the left quote % character active thus activating the deactivation of left quote ligatures. % See The TeXbook p.381. {\catcode`\`=\active \gdef`{\relax\lq}} % TeX is fairly carefree about spaces and so we have to make it more serious. % To do so we pull the same trick as above, setting up a definition for active % space, but only making space active during the span of the verbatim text. % In Plain TeX the active space is defined to be simply a space, but here we % define it to be a control space. This ensures that the space cannot % be gobbled up by one of TeX's mysterious mechanisms when activated. % See The TeXbook, p.381 and p.352. {\obeyspaces\global\let =\ } % Here is the main \fwbtx verbatim text macro. % Note: The order in which all these pieces of business have to be done is % still a partial mystery to me. Don't fiddle with this stuff unless you % think you know what you are doing. \def\fwbtx[{% % % The funnies involved in getting verbatim output are safely housed inside % this \begingroup, and the \endgroup in \fwverbatimgobble. Groups are used % instead of curly braces because we have to be able to signal the end of % this macro with a curly brace. \begingroup% % % \pars at the end of empty lines in the verbatim text won't come out normally % because TeX is in vertical mode and they get gobbled up. To prevent this, % we force \par to exit vertical mode first. See The TeXbook p.381. \def\par{\leavevmode\endgraf}% % % Activate the leftquote character so as to avoid ligatures (see above). \catcode`\`=\active% % % The \obeylines macro simply defines end of line (^M) to be \par. This ensures % that TeX will treat each verbatim line as a new paragraph. \obeylines% % % To get verbatim output, we have to desex all the special characters. This % is explained in detail in The TeXbook p.380. \def\do##1{\catcode`##1=12 }\dospecials% % % Activate the space character so as to make TeX treat blanks seriously. % This activation invokes an eralier definition (see above). \obeyspaces % % Interparagraph skips do not help the cause. % Note: We have to preserve the indentation though, as the code is actually % indented in the final output. See \fwodef in an earlier section. \parskip=0pt% % % We typeset the verbatim text in tt font (courier on the Macintosh) for a % number of reasons: % - tt font has the same horizontal spacing for each character. % - tt font covers the ASCII character set. % - tt font doesn't have many surprises (e.g. ligatures). % - tt font looks much what you might see on a computer terminal screen. \tt% % % Having set up an environment for verbatim, we are ready to use it. % By invoking \fwverbatimgobble, this \fwbtx macro gobbles up text verbatim (as % part of the parameter of \fwverbatimgobble) until it sees the termination % string "]fwetx=" (the "=" was thrown in to add obscurity as this sequence % must never occur in the verbatim text). \fwverbatimgobble} % The \fwverbatimgobble macro exists to allow \fwbtx to bracket verbatim text. \def\fwverbatimgobble#1]fwetx={#1\endgroup} % Table of Contents % ----------------- % The five levels of table of contents that FunnelWeb supports are identified % by the five letters [A..E]. These are used throughout the following macros. % The following macros are utilities to the TOC macros to follow. \def\fwrule{\medskip\hrule\medskip} \def\fwqh{\hskip1.5em\relax} \def\fwbeforesec{\penalty-200\bigskip\medskip\par} % The following macros are used to typeset the table of contents. \def\fwtocstart#1{\fwrule\leftline{\fwfontbolda Table of Contents}\fwrule} \def\fwtoca#1#2{\leftline{{\bf #1 #2}}} \def\fwtocb#1#2{\leftline{\fwqh #1 #2}} \def\fwtocc#1#2{\leftline{\fwqh\fwqh #1 #2}} \def\fwtocd#1#2{\leftline{\fwqh\fwqh\fwqh #1 #2}} \def\fwtoce#1#2{\leftline{\fwqh\fwqh\fwqh\fwqh #1 #2}} \def\fwtocfinish#1{\fwrule} % The following "library" macros define five different strengths of headings % which can be used later in the section macros. \def\fwliba#1#2{\vfill\eject{\fwfontboldc #1 #2}\penalty200\smallskip} \def\fwlibb#1#2{\fwbeforesec{\fwfontboldb #1 #2}\penalty200\smallskip} \def\fwlibc#1#2{\fwbeforesec{\fwfontnormb #1 #2}\penalty200\smallskip} \def\fwlibd#1#2{\fwbeforesec{\bf #1 #2}\penalty200} \def\fwlibe#1#2{\fwbeforesec{\bf #1 #2}} % Here are the macros that actually typeset the section headings throughout % the document. The fwlib system has been employed so as to easily allow the % user to redefine the strengths of headings to taste. For example, the % user could insert in the input document a similar set of definitions to these % but with the b..e headings set to \fwlibc. This would tone down the output. \def\fwseca#1#2{\fwliba{#1}{#2}} \def\fwsecb#1#2{\fwlibb{#1}{#2}} \def\fwsecc#1#2{\fwlibc{#1}{#2}} \def\fwsecd#1#2{\fwlibd{#1}{#2}} \def\fwsece#1#2{\fwlibe{#1}{#2}} % Support for Explicit Typesetting % -------------------------------- % FunnelWeb supports pragmas and other constructs that allow % typesetter-independent typesetting commands to be given. The % following macros support these features. % The in-text literal @{sloth@} and emphasise @[walrus@] features. \def\fwlit#1{{\tt #1}} \def\fwemp#1{{\it #1}} % The "@p new_page" pragma. \def\fwnewpage{\vfill\eject} % The "@p vskip Nmm" pragma. \def\fwvskip#1{\null\vskip #1mm} % The "@p title " pragma. \def\fwfontnormal#1{{\fwfontnorm {#1}}} \def\fwfonttitle#1{{\fwfontboldd {#1}}} \def\fwfontsmalltitle#1{{\fwfontboldb {#1}}} \def\fwleftline#1{\leftline{#1}} \def\fwcenterline#1{\centerline{#1}} \def\fwrightline#1{\rightline{#1}} % Support for Old FunnelWeb % ------------------------- % The following macros were used extensively in the first version of % FunnelWeb and are retained so that these older input files will still % typeset cleanly. \def\p#1{{\tt #1}} % P for Program text. \def\flagpage#1#2{ \null \vfill \centerline{\fwfontboldd #1} \vskip 1cm \centerline{\fwfontboldd #2} \vfill \null \vfill } %====================== End of FunnelWeb TeX Definitions ======================= WV04: Test ugly string processing. \fwbeginmacro \fwfilename{wv04.out}{1}\fwequals \fwodef \fwcdef \fwbeginmacronotes \fwisafile{This macro is attached to an output file.} \fwendmacronotes \fwendmacro 1. Test ugly string in section name. \fwseca{1}{ !\char`\"\#\$\%'()*+,-./0123456789:;$<$=$>$?} \fwseca{2}{ABCDEFGHIJKLMNOPQRSTUVWXYZ[$\backslash$]\char`\^\_`} \fwseca{3}{abcdefghijklmnopqrstuvwxyz$\{$$|$$\}$\char`\~} 2. Test ugly string in macro name. \fwbeginmacro \fwmacroname{ !\char`\"\#\$\%'()*+,-./0123456789:;$<$=$>$?}{2}\fwzero{}\fwequals \fwodef \fwcdef \fwbeginmacronotes \fwusedin{This macro is NEVER invoked.} \fwendmacronotes \fwendmacro \fwbeginmacro \fwmacroname{ABCDEFGHIJKLMNOPQRSTUVWXYZ[$\backslash$]\char`\^\_`}{3}\fwzero{}\fwequals \fwodef \fwcdef \fwbeginmacronotes \fwusedin{This macro is NEVER invoked.} \fwendmacronotes \fwendmacro \fwbeginmacro \fwmacroname{abcdefghijklmnopqrstuvwxyz$\{$$|$$\}$\char`\~}{4}\fwzero{}\fwequals \fwodef \fwcdef \fwbeginmacronotes \fwusedin{This macro is NEVER invoked.} \fwendmacronotes \fwendmacro 3. Test ugly string in literal section. \fwlit{ !\char`\"\#\$\%'()*+,-./0123456789:;\char`\<=\char`\>?} \fwlit{ABCDEFGHIJKLMNOPQRSTUVWXYZ[\char`\\]\char`\^\_`} \fwlit{abcdefghijklmnopqrstuvwxyz\char`\{\char`\|\char`\}\char`\~} \bye %******************************************************************************* %* END OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* ame#1#2{{\bf #1}$\lbrack$#2$\rbrack$} \def\fwzero#1{{\bf Z}} \def\fwmany#1{{\bf M}} \def\fwlib#1{{\bf L}} \def\fweqfw_src/answers/wv05.htm 644 0 0 7405 6717353761 10312 Package wv05

WV05: Test processing of ugly strings as ordinary and protected text with no typesetter set.

1. File: wv05.out={}
This macro is attached to an output file.

A paragraph in ordinary mode.

33 con!text 34 con"text 35 con#text 36 con$text 37 con%text 38 con&text 39 con'text 40 con(text 41 con)text 42 con*text 43 con+text 44 con,text 45 con-text 46 con.text 47 con/text 48-57 con0123456789text 58 con:text 59 con;text 60 con<text 61 con=text 62 con>text 63 con?text 64 con@text 65-90 conABCDEFGHIJKLMNOPQRSTUVWXYZtext 91 con[text 92 con\text 93 con]text 94 con^text 95 con_text 96 con`text 97-122 conabcdefghijklmnopqrstuvwxyztext 123 con{text 124 con|text 125 con}text 126 con~text

Now again, but this time inside protective braces.

33 con!text 34 con"text 35 con#text 36 con$text 37 con%text 38 con&text 39 con'text 40 con(text 41 con)text 42 con*text 43 con+text 44 con,text 45 con-text 46 con.text 47 con/text 48-57 con0123456789text 58 con:text 59 con;text 60 con<text 61 con=text 62 con>text 63 con?text 64 con@text 65-90 conABCDEFGHIJKLMNOPQRSTUVWXYZtext 91 con[text 92 con\text 93 con]text 94 con^text 95 con_text 96 con`text 97-122 conabcdefghijklmnopqrstuvwxyztext 123 con{text 124 con|text 125 con}text 126 con~text


End Of File

ls% % % Activate the space character so as to make TeX treat blanks seriously. % This activation invokes an eralier definition (see above). \obeyspaces % % Interparagraph skips do not help the cause. % Note: We have to preserve the indentation though,fw_src/answers/wv05.lis 644 0 0 532 6717353760 10262 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Weave: Completed <>. Weave: Completed <>. SUCCESS: No diagnostics. sts to allow \fwbtx to bracket verbatim text. \def\fwverbatimgobble#1]fwetx={#1\endgroup} % Table of Contents % ----------------- % The five levels of table of contfw_src/answers/wv05.tex 644 0 0 40061 6717353760 10334 %******************************************************************************* %* START OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* %* * %* This TeX file was automatically generated by the FunnelWeb preprocessor. * %* You can typeset this file to produce printed documentation by running it * %* through the TeX typesetter using a command such as: * %* tex thisfilename * %* The resultant file thisfilename.dvi can be printed using a command such as: * %* lpr -Plaser -d thisfilename.dvi * %* * %* FunnelWeb is a preprocessor that allows programmers to weave programs and * %* their documentation together in a single document. The FunnelWeb program * %* analyses such documents producing both program files and typeset * %* documentation such as this TeX file. * %* FunnelWeb was created by Ross N. Williams. * %* * %* For more information on FunnelWeb see http://www.ross.net/funnelweb/ * %* * %******************************************************************************* %===================== Start of FunnelWeb TeX Definitions ====================== % Version % ------- % This is FunnelWeb TeX Macro Library Version 1.0. % Copyright % --------- % This set of FunnelWeb TeX definitions was written by Ross Williams and was % originally Copyright (C) 1992 Ross N. Williams. However, I, Ross Williams, % hereby forego any claim to Copyright in this set of FunnelWeb TeX definitions % and hereby authorize that the set of TeX definitions pass into the public % domain. -- Ross N. Williams, 3:41pm 07-May-1992, Adelaide, Australia. % Modification % ------------ % Please record all modifications to these TeX definitions here. Unless % otherwise specified, all modified definitions fall in the public domain too. % % Programmers: % RNW Ross N. Williams ross@ross.net % % Changes: % 07-May-1992 RNW Prepared this work for public domain release. % 10-May-1999 RNW Added \fwlib macro. % General Comments % ---------------- % This set of TeX definitions exists for two reasons: % % 1. To shorten and neaten the FunnelWeb TeX output. % 2. To allow users to fiddle with the output format in their input files % (by inserting redefining "\def"s) without having to resort to % modifying the FunnelWeb code. % % The user is warned that these definitions may be changed from time to time % (but probably not much). The user should not be too sneaky. In particular, % users wishing to redefine some of these macros should do so in an explicitly % defined section at the top of their input file. This will mean that in the % event of problems, that section can simply be deleted or commented out to % allow the document to at least be typeset in the default format. Users should % limit themselves to redefining these macros in such a section and should % refrain from using the macros throughout their documents. % Environment Parameters % ---------------------- % \tolerance tells TeX how tolerant it should be about making bad line and % page breaks. Here we set it to it's maximum, as % 1) Computer programs are likely to cause lots of bad breaks. % 2) In most cases the user would probably rather get the TeX file through % TeX without any errors than fiddle with spacings for perfection. \tolerance=10000 % I don't like indentation as it makes the page look more busy. Instead, % paragraphs are separated by a little space (see next). \parindent=0pt % In many cases, users will produce documents with long runs of paragraphs. % In order to space out these paragraphs, it is convenient to maintain a % prevailing non-zero \parskip (end-of-paragaph skip). The only trouble is % that the skip becomes a problem in macro definitions which require no skip % and so we have to turn the skip on and off. The following two macros % simplify this process. \def\fwparskipon{\parskip=\medskipamount} \def\fwparskipoff{\parskip=0pt} \fwparskipon % Setting raggedbottom allows TeX to leave a bit of space at the bottom of the % page in order to better vertically align the rest of the page (e.g. skips % won't stretch as much). It also means that headings are less likely to be % isolated at the bottom of the page without any following text. \raggedbottom % Fonts % ----- % Most of the typeset output is set in 10pt roman and 10pt tt font. % The major extra font needs spring from titles and headings. % For portability's sake we use only the following fonts: % cmr10 % cmbx10 % cmtt10 % and some enlargements of them. These fonts are all "standard" fonts % in Plain TeX. See The TeXbook p.350. \font\fwfontnote=cmr7 \font\fwfontnorm=cmr10 \font\fwfontnorma=cmr10 scaled \magstep1 \font\fwfontnormb=cmr10 scaled \magstep2 \font\fwfontbold=cmbx10 \font\fwfontbolda=cmbx10 scaled \magstep1 \font\fwfontboldb=cmbx10 scaled \magstep2 \font\fwfontboldc=cmbx10 scaled \magstep3 \font\fwfontboldd=cmbx10 scaled \magstep4 % Macros for Stylistic Details % ---------------------------- % This section contains all the fiddly little macros for setting the details % of each macro definition. % Macro definitions are sandwiched by calls to these macros which can be used % to sort out the spacing before and after the macro definition. \def\fwbeginmacro{\fwparskipoff\bigskip} \def\fwendmacro{\fwparskipon\par} % These macros deal with the macro name and definition line. \def\fwmacroname#1#2{{\sl #1\/}$\lbrack$#2$\rbrack$} \def\fwfilename#1#2{{\bf #1}$\lbrack$#2$\rbrack$} \def\fwzero#1{{\bf Z}} \def\fwmany#1{{\bf M}} \def\fwlib#1{{\bf L}} \def\fwequals{ $\equiv$} \def\fwplusequals{ $+\equiv$} % Now for the actual body of the definition. It looks nice to have the tt % code indented a little. Again, we use macros instead of writing direct TeX, % so as to allow the user to fiddle this stuff to taste without having to % modify the FunnelWeb C code. \def\fwodef{\parindent=15pt\vskip0pt$\lbrace$\parindent=20pt} \def\fwcdef{$\rbrace$\vskip0pt\parindent=0pt} \def\fwoquote{`} \def\fwcquote{'} \def\fwoparen{$($} \def\fwcomma{$,$} \def\fwcparen{$)$} \def\fwparam#1{$\diamond #1$} \def\fwparams#1{$(\diamond #1)$} % These macros deal with the notes that are appended at the end of each % macro definition. Note that even though \fwisafile,\fwusedin, and \fwseealso % have the same definition, they are given different names so as to allow the % user to redefine these macros to typeset each kind of information differently % if desired. \def\fwbeginmacronotes{\begingroup\baselineskip=9pt\smallskip} \def\fwnote#1{{\fwfontnote #1}\par} \def\fwisafile#1{\fwnote{#1}} \def\fwusedin#1{\fwnote{#1}} \def\fwseealso#1{\fwnote{#1}} \def\fwendmacronotes{\endgroup} % Macros to Typeset Program Code Verbatim % --------------------------------------- % This is by far the hairiest and most difficult part of the typesetting task % because we have to turn off most of TeX's natural instincts in order to % typeset the program text exactly as it appears in the input file. % Two macros are defined to pull this off: \fwbtx and \fwverbatimgobble. % Their code was inspired by the following sections of "The TeXbook": % Appendix D: Dirty Tricks, 3.Verbatim listing, p.380-382. % Appendix E: Example Formats, p.421. % The \fwbtx[ (for "FunnelWeb Begin TeXt") macro does most of the hard work. % The liberal use of "%" is because I don't understand TeX well enough to % understand when an end of line will cause trouble, and I am playing it safe. % Before defining the main \fwbtx macro, we have to stash away some definitions % in the hidden part of TeX's environment. Let's hope that these "hidden" % definitions don't affect anything except what is desired to be affected. % The tt font in which we wish to set the text has two Latin lurking ligatures! % These are ?` and !`. To disable them, we define the left quote when ACTIVE % to be defined in such a way as to prevent ligatures. The main TeX text will % normally not be exposed to this definition because normally the leftquote % character is not active. The \fwbtx macro temporarily makes the left quote % character active thus activating the deactivation of left quote ligatures. % See The TeXbook p.381. {\catcode`\`=\active \gdef`{\relax\lq}} % TeX is fairly carefree about spaces and so we have to make it more serious. % To do so we pull the same trick as above, setting up a definition for active % space, but only making space active during the span of the verbatim text. % In Plain TeX the active space is defined to be simply a space, but here we % define it to be a control space. This ensures that the space cannot % be gobbled up by one of TeX's mysterious mechanisms when activated. % See The TeXbook, p.381 and p.352. {\obeyspaces\global\let =\ } % Here is the main \fwbtx verbatim text macro. % Note: The order in which all these pieces of business have to be done is % still a partial mystery to me. Don't fiddle with this stuff unless you % think you know what you are doing. \def\fwbtx[{% % % The funnies involved in getting verbatim output are safely housed inside % this \begingroup, and the \endgroup in \fwverbatimgobble. Groups are used % instead of curly braces because we have to be able to signal the end of % this macro with a curly brace. \begingroup% % % \pars at the end of empty lines in the verbatim text won't come out normally % because TeX is in vertical mode and they get gobbled up. To prevent this, % we force \par to exit vertical mode first. See The TeXbook p.381. \def\par{\leavevmode\endgraf}% % % Activate the leftquote character so as to avoid ligatures (see above). \catcode`\`=\active% % % The \obeylines macro simply defines end of line (^M) to be \par. This ensures % that TeX will treat each verbatim line as a new paragraph. \obeylines% % % To get verbatim output, we have to desex all the special characters. This % is explained in detail in The TeXbook p.380. \def\do##1{\catcode`##1=12 }\dospecials% % % Activate the space character so as to make TeX treat blanks seriously. % This activation invokes an eralier definition (see above). \obeyspaces % % Interparagraph skips do not help the cause. % Note: We have to preserve the indentation though, as the code is actually % indented in the final output. See \fwodef in an earlier section. \parskip=0pt% % % We typeset the verbatim text in tt font (courier on the Macintosh) for a % number of reasons: % - tt font has the same horizontal spacing for each character. % - tt font covers the ASCII character set. % - tt font doesn't have many surprises (e.g. ligatures). % - tt font looks much what you might see on a computer terminal screen. \tt% % % Having set up an environment for verbatim, we are ready to use it. % By invoking \fwverbatimgobble, this \fwbtx macro gobbles up text verbatim (as % part of the parameter of \fwverbatimgobble) until it sees the termination % string "]fwetx=" (the "=" was thrown in to add obscurity as this sequence % must never occur in the verbatim text). \fwverbatimgobble} % The \fwverbatimgobble macro exists to allow \fwbtx to bracket verbatim text. \def\fwverbatimgobble#1]fwetx={#1\endgroup} % Table of Contents % ----------------- % The five levels of table of contents that FunnelWeb supports are identified % by the five letters [A..E]. These are used throughout the following macros. % The following macros are utilities to the TOC macros to follow. \def\fwrule{\medskip\hrule\medskip} \def\fwqh{\hskip1.5em\relax} \def\fwbeforesec{\penalty-200\bigskip\medskip\par} % The following macros are used to typeset the table of contents. \def\fwtocstart#1{\fwrule\leftline{\fwfontbolda Table of Contents}\fwrule} \def\fwtoca#1#2{\leftline{{\bf #1 #2}}} \def\fwtocb#1#2{\leftline{\fwqh #1 #2}} \def\fwtocc#1#2{\leftline{\fwqh\fwqh #1 #2}} \def\fwtocd#1#2{\leftline{\fwqh\fwqh\fwqh #1 #2}} \def\fwtoce#1#2{\leftline{\fwqh\fwqh\fwqh\fwqh #1 #2}} \def\fwtocfinish#1{\fwrule} % The following "library" macros define five different strengths of headings % which can be used later in the section macros. \def\fwliba#1#2{\vfill\eject{\fwfontboldc #1 #2}\penalty200\smallskip} \def\fwlibb#1#2{\fwbeforesec{\fwfontboldb #1 #2}\penalty200\smallskip} \def\fwlibc#1#2{\fwbeforesec{\fwfontnormb #1 #2}\penalty200\smallskip} \def\fwlibd#1#2{\fwbeforesec{\bf #1 #2}\penalty200} \def\fwlibe#1#2{\fwbeforesec{\bf #1 #2}} % Here are the macros that actually typeset the section headings throughout % the document. The fwlib system has been employed so as to easily allow the % user to redefine the strengths of headings to taste. For example, the % user could insert in the input document a similar set of definitions to these % but with the b..e headings set to \fwlibc. This would tone down the output. \def\fwseca#1#2{\fwliba{#1}{#2}} \def\fwsecb#1#2{\fwlibb{#1}{#2}} \def\fwsecc#1#2{\fwlibc{#1}{#2}} \def\fwsecd#1#2{\fwlibd{#1}{#2}} \def\fwsece#1#2{\fwlibe{#1}{#2}} % Support for Explicit Typesetting % -------------------------------- % FunnelWeb supports pragmas and other constructs that allow % typesetter-independent typesetting commands to be given. The % following macros support these features. % The in-text literal @{sloth@} and emphasise @[walrus@] features. \def\fwlit#1{{\tt #1}} \def\fwemp#1{{\it #1}} % The "@p new_page" pragma. \def\fwnewpage{\vfill\eject} % The "@p vskip Nmm" pragma. \def\fwvskip#1{\null\vskip #1mm} % The "@p title " pragma. \def\fwfontnormal#1{{\fwfontnorm {#1}}} \def\fwfonttitle#1{{\fwfontboldd {#1}}} \def\fwfontsmalltitle#1{{\fwfontboldb {#1}}} \def\fwleftline#1{\leftline{#1}} \def\fwcenterline#1{\centerline{#1}} \def\fwrightline#1{\rightline{#1}} % Support for Old FunnelWeb % ------------------------- % The following macros were used extensively in the first version of % FunnelWeb and are retained so that these older input files will still % typeset cleanly. \def\p#1{{\tt #1}} % P for Program text. \def\flagpage#1#2{ \null \vfill \centerline{\fwfontboldd #1} \vskip 1cm \centerline{\fwfontboldd #2} \vfill \null \vfill } %====================== End of FunnelWeb TeX Definitions ======================= WV05: Test processing of ugly strings as ordinary and protected text with no typesetter set. \fwbeginmacro \fwfilename{wv05.out}{1}\fwequals \fwodef \fwcdef \fwbeginmacronotes \fwisafile{This macro is attached to an output file.} \fwendmacronotes \fwendmacro A paragraph in ordinary mode. 33 con!text 34 con\char`\"text 35 con\#text 36 con\$text 37 con\%text 38 con\&text 39 con'text 40 con(text 41 con)text 42 con*text 43 con+text 44 con,text 45 con-text 46 con.text 47 con/text 48-57 con0123456789text 58 con:text 59 con;text 60 con$<$text 61 con=text 62 con$>$text 63 con?text 64 con@text 65-90 conABCDEFGHIJKLMNOPQRSTUVWXYZtext 91 con[text 92 con$\backslash$text 93 con]text 94 con\char`\^text 95 con\_text 96 con`text 97-122 conabcdefghijklmnopqrstuvwxyztext 123 con$\{$text 124 con$|$text 125 con$\}$text 126 con\char`\~text Now again, but this time inside protective braces. \fwlit{ 33 con!text 34 con\char`\"text 35 con\#text 36 con\$text 37 con\%text 38 con\&text 39 con'text 40 con(text 41 con)text 42 con*text 43 con+text 44 con,text 45 con-text 46 con.text 47 con/text 48-57 con0123456789text 58 con:text 59 con;text 60 con\char`\text 63 con?text 64 con@text 65-90 conABCDEFGHIJKLMNOPQRSTUVWXYZtext 91 con[text 92 con\char`\\text 93 con]text 94 con\char`\^text 95 con\_text 96 con`text 97-122 conabcdefghijklmnopqrstuvwxyztext 123 con\char`\{text 124 con\char`\|text 125 con\char`\}text 126 con\char`\~text } \bye %******************************************************************************* %* END OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* Now for the actual body of the definition. It looks nice to have the tt % code indented a little. Again, we use macros instead of writing direct TeX, % so as to allow the user to fiddle this stuff to taste without having to % modify the FunnelWeb C code. \def\fwodef{\parindent=15pt\vskip0pt$\lbrace$\parindent=20pt} \def\fwcdef{$\rbrace$\vskip0pt\parindent=0pt} \def\fwoquote{`} \def\fwcquote{'} \def\fwoparen{$($} \def\fwcomma{$,$} \def\fwcparen{$)$} \def\fwparfw_src/answers/wv06.htm 644 0 0 471 6715275716 10270 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Weave: Completed <>. SUCCESS: No diagnostics. order to % typeset the program text exactly as it appears in the input file. % Two macros are defined to pull this off: \fwbtx and \fwverbatimgobble. % Their code was inspired by the following sectifw_src/answers/wv06.lis 644 0 0 471 6717353762 10267 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Weave: Completed <>. SUCCESS: No diagnostics. rmally not be exposed to this definition because normally the leftquote % character is not active. The \fwbtx macro temporarily makes the left quote % character active thus activating the deactivatiofw_src/answers/wv06.tex 644 0 0 40000 6717353762 10330 %******************************************************************************* %* START OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* %* * %* This TeX file was automatically generated by the FunnelWeb preprocessor. * %* You can typeset this file to produce printed documentation by running it * %* through the TeX typesetter using a command such as: * %* tex thisfilename * %* The resultant file thisfilename.dvi can be printed using a command such as: * %* lpr -Plaser -d thisfilename.dvi * %* * %* FunnelWeb is a preprocessor that allows programmers to weave programs and * %* their documentation together in a single document. The FunnelWeb program * %* analyses such documents producing both program files and typeset * %* documentation such as this TeX file. * %* FunnelWeb was created by Ross N. Williams. * %* * %* For more information on FunnelWeb see http://www.ross.net/funnelweb/ * %* * %******************************************************************************* %===================== Start of FunnelWeb TeX Definitions ====================== % Version % ------- % This is FunnelWeb TeX Macro Library Version 1.0. % Copyright % --------- % This set of FunnelWeb TeX definitions was written by Ross Williams and was % originally Copyright (C) 1992 Ross N. Williams. However, I, Ross Williams, % hereby forego any claim to Copyright in this set of FunnelWeb TeX definitions % and hereby authorize that the set of TeX definitions pass into the public % domain. -- Ross N. Williams, 3:41pm 07-May-1992, Adelaide, Australia. % Modification % ------------ % Please record all modifications to these TeX definitions here. Unless % otherwise specified, all modified definitions fall in the public domain too. % % Programmers: % RNW Ross N. Williams ross@ross.net % % Changes: % 07-May-1992 RNW Prepared this work for public domain release. % 10-May-1999 RNW Added \fwlib macro. % General Comments % ---------------- % This set of TeX definitions exists for two reasons: % % 1. To shorten and neaten the FunnelWeb TeX output. % 2. To allow users to fiddle with the output format in their input files % (by inserting redefining "\def"s) without having to resort to % modifying the FunnelWeb code. % % The user is warned that these definitions may be changed from time to time % (but probably not much). The user should not be too sneaky. In particular, % users wishing to redefine some of these macros should do so in an explicitly % defined section at the top of their input file. This will mean that in the % event of problems, that section can simply be deleted or commented out to % allow the document to at least be typeset in the default format. Users should % limit themselves to redefining these macros in such a section and should % refrain from using the macros throughout their documents. % Environment Parameters % ---------------------- % \tolerance tells TeX how tolerant it should be about making bad line and % page breaks. Here we set it to it's maximum, as % 1) Computer programs are likely to cause lots of bad breaks. % 2) In most cases the user would probably rather get the TeX file through % TeX without any errors than fiddle with spacings for perfection. \tolerance=10000 % I don't like indentation as it makes the page look more busy. Instead, % paragraphs are separated by a little space (see next). \parindent=0pt % In many cases, users will produce documents with long runs of paragraphs. % In order to space out these paragraphs, it is convenient to maintain a % prevailing non-zero \parskip (end-of-paragaph skip). The only trouble is % that the skip becomes a problem in macro definitions which require no skip % and so we have to turn the skip on and off. The following two macros % simplify this process. \def\fwparskipon{\parskip=\medskipamount} \def\fwparskipoff{\parskip=0pt} \fwparskipon % Setting raggedbottom allows TeX to leave a bit of space at the bottom of the % page in order to better vertically align the rest of the page (e.g. skips % won't stretch as much). It also means that headings are less likely to be % isolated at the bottom of the page without any following text. \raggedbottom % Fonts % ----- % Most of the typeset output is set in 10pt roman and 10pt tt font. % The major extra font needs spring from titles and headings. % For portability's sake we use only the following fonts: % cmr10 % cmbx10 % cmtt10 % and some enlargements of them. These fonts are all "standard" fonts % in Plain TeX. See The TeXbook p.350. \font\fwfontnote=cmr7 \font\fwfontnorm=cmr10 \font\fwfontnorma=cmr10 scaled \magstep1 \font\fwfontnormb=cmr10 scaled \magstep2 \font\fwfontbold=cmbx10 \font\fwfontbolda=cmbx10 scaled \magstep1 \font\fwfontboldb=cmbx10 scaled \magstep2 \font\fwfontboldc=cmbx10 scaled \magstep3 \font\fwfontboldd=cmbx10 scaled \magstep4 % Macros for Stylistic Details % ---------------------------- % This section contains all the fiddly little macros for setting the details % of each macro definition. % Macro definitions are sandwiched by calls to these macros which can be used % to sort out the spacing before and after the macro definition. \def\fwbeginmacro{\fwparskipoff\bigskip} \def\fwendmacro{\fwparskipon\par} % These macros deal with the macro name and definition line. \def\fwmacroname#1#2{{\sl #1\/}$\lbrack$#2$\rbrack$} \def\fwfilename#1#2{{\bf #1}$\lbrack$#2$\rbrack$} \def\fwzero#1{{\bf Z}} \def\fwmany#1{{\bf M}} \def\fwlib#1{{\bf L}} \def\fwequals{ $\equiv$} \def\fwplusequals{ $+\equiv$} % Now for the actual body of the definition. It looks nice to have the tt % code indented a little. Again, we use macros instead of writing direct TeX, % so as to allow the user to fiddle this stuff to taste without having to % modify the FunnelWeb C code. \def\fwodef{\parindent=15pt\vskip0pt$\lbrace$\parindent=20pt} \def\fwcdef{$\rbrace$\vskip0pt\parindent=0pt} \def\fwoquote{`} \def\fwcquote{'} \def\fwoparen{$($} \def\fwcomma{$,$} \def\fwcparen{$)$} \def\fwparam#1{$\diamond #1$} \def\fwparams#1{$(\diamond #1)$} % These macros deal with the notes that are appended at the end of each % macro definition. Note that even though \fwisafile,\fwusedin, and \fwseealso % have the same definition, they are given different names so as to allow the % user to redefine these macros to typeset each kind of information differently % if desired. \def\fwbeginmacronotes{\begingroup\baselineskip=9pt\smallskip} \def\fwnote#1{{\fwfontnote #1}\par} \def\fwisafile#1{\fwnote{#1}} \def\fwusedin#1{\fwnote{#1}} \def\fwseealso#1{\fwnote{#1}} \def\fwendmacronotes{\endgroup} % Macros to Typeset Program Code Verbatim % --------------------------------------- % This is by far the hairiest and most difficult part of the typesetting task % because we have to turn off most of TeX's natural instincts in order to % typeset the program text exactly as it appears in the input file. % Two macros are defined to pull this off: \fwbtx and \fwverbatimgobble. % Their code was inspired by the following sections of "The TeXbook": % Appendix D: Dirty Tricks, 3.Verbatim listing, p.380-382. % Appendix E: Example Formats, p.421. % The \fwbtx[ (for "FunnelWeb Begin TeXt") macro does most of the hard work. % The liberal use of "%" is because I don't understand TeX well enough to % understand when an end of line will cause trouble, and I am playing it safe. % Before defining the main \fwbtx macro, we have to stash away some definitions % in the hidden part of TeX's environment. Let's hope that these "hidden" % definitions don't affect anything except what is desired to be affected. % The tt font in which we wish to set the text has two Latin lurking ligatures! % These are ?` and !`. To disable them, we define the left quote when ACTIVE % to be defined in such a way as to prevent ligatures. The main TeX text will % normally not be exposed to this definition because normally the leftquote % character is not active. The \fwbtx macro temporarily makes the left quote % character active thus activating the deactivation of left quote ligatures. % See The TeXbook p.381. {\catcode`\`=\active \gdef`{\relax\lq}} % TeX is fairly carefree about spaces and so we have to make it more serious. % To do so we pull the same trick as above, setting up a definition for active % space, but only making space active during the span of the verbatim text. % In Plain TeX the active space is defined to be simply a space, but here we % define it to be a control space. This ensures that the space cannot % be gobbled up by one of TeX's mysterious mechanisms when activated. % See The TeXbook, p.381 and p.352. {\obeyspaces\global\let =\ } % Here is the main \fwbtx verbatim text macro. % Note: The order in which all these pieces of business have to be done is % still a partial mystery to me. Don't fiddle with this stuff unless you % think you know what you are doing. \def\fwbtx[{% % % The funnies involved in getting verbatim output are safely housed inside % this \begingroup, and the \endgroup in \fwverbatimgobble. Groups are used % instead of curly braces because we have to be able to signal the end of % this macro with a curly brace. \begingroup% % % \pars at the end of empty lines in the verbatim text won't come out normally % because TeX is in vertical mode and they get gobbled up. To prevent this, % we force \par to exit vertical mode first. See The TeXbook p.381. \def\par{\leavevmode\endgraf}% % % Activate the leftquote character so as to avoid ligatures (see above). \catcode`\`=\active% % % The \obeylines macro simply defines end of line (^M) to be \par. This ensures % that TeX will treat each verbatim line as a new paragraph. \obeylines% % % To get verbatim output, we have to desex all the special characters. This % is explained in detail in The TeXbook p.380. \def\do##1{\catcode`##1=12 }\dospecials% % % Activate the space character so as to make TeX treat blanks seriously. % This activation invokes an eralier definition (see above). \obeyspaces % % Interparagraph skips do not help the cause. % Note: We have to preserve the indentation though, as the code is actually % indented in the final output. See \fwodef in an earlier section. \parskip=0pt% % % We typeset the verbatim text in tt font (courier on the Macintosh) for a % number of reasons: % - tt font has the same horizontal spacing for each character. % - tt font covers the ASCII character set. % - tt font doesn't have many surprises (e.g. ligatures). % - tt font looks much what you might see on a computer terminal screen. \tt% % % Having set up an environment for verbatim, we are ready to use it. % By invoking \fwverbatimgobble, this \fwbtx macro gobbles up text verbatim (as % part of the parameter of \fwverbatimgobble) until it sees the termination % string "]fwetx=" (the "=" was thrown in to add obscurity as this sequence % must never occur in the verbatim text). \fwverbatimgobble} % The \fwverbatimgobble macro exists to allow \fwbtx to bracket verbatim text. \def\fwverbatimgobble#1]fwetx={#1\endgroup} % Table of Contents % ----------------- % The five levels of table of contents that FunnelWeb supports are identified % by the five letters [A..E]. These are used throughout the following macros. % The following macros are utilities to the TOC macros to follow. \def\fwrule{\medskip\hrule\medskip} \def\fwqh{\hskip1.5em\relax} \def\fwbeforesec{\penalty-200\bigskip\medskip\par} % The following macros are used to typeset the table of contents. \def\fwtocstart#1{\fwrule\leftline{\fwfontbolda Table of Contents}\fwrule} \def\fwtoca#1#2{\leftline{{\bf #1 #2}}} \def\fwtocb#1#2{\leftline{\fwqh #1 #2}} \def\fwtocc#1#2{\leftline{\fwqh\fwqh #1 #2}} \def\fwtocd#1#2{\leftline{\fwqh\fwqh\fwqh #1 #2}} \def\fwtoce#1#2{\leftline{\fwqh\fwqh\fwqh\fwqh #1 #2}} \def\fwtocfinish#1{\fwrule} % The following "library" macros define five different strengths of headings % which can be used later in the section macros. \def\fwliba#1#2{\vfill\eject{\fwfontboldc #1 #2}\penalty200\smallskip} \def\fwlibb#1#2{\fwbeforesec{\fwfontboldb #1 #2}\penalty200\smallskip} \def\fwlibc#1#2{\fwbeforesec{\fwfontnormb #1 #2}\penalty200\smallskip} \def\fwlibd#1#2{\fwbeforesec{\bf #1 #2}\penalty200} \def\fwlibe#1#2{\fwbeforesec{\bf #1 #2}} % Here are the macros that actually typeset the section headings throughout % the document. The fwlib system has been employed so as to easily allow the % user to redefine the strengths of headings to taste. For example, the % user could insert in the input document a similar set of definitions to these % but with the b..e headings set to \fwlibc. This would tone down the output. \def\fwseca#1#2{\fwliba{#1}{#2}} \def\fwsecb#1#2{\fwlibb{#1}{#2}} \def\fwsecc#1#2{\fwlibc{#1}{#2}} \def\fwsecd#1#2{\fwlibd{#1}{#2}} \def\fwsece#1#2{\fwlibe{#1}{#2}} % Support for Explicit Typesetting % -------------------------------- % FunnelWeb supports pragmas and other constructs that allow % typesetter-independent typesetting commands to be given. The % following macros support these features. % The in-text literal @{sloth@} and emphasise @[walrus@] features. \def\fwlit#1{{\tt #1}} \def\fwemp#1{{\it #1}} % The "@p new_page" pragma. \def\fwnewpage{\vfill\eject} % The "@p vskip Nmm" pragma. \def\fwvskip#1{\null\vskip #1mm} % The "@p title " pragma. \def\fwfontnormal#1{{\fwfontnorm {#1}}} \def\fwfonttitle#1{{\fwfontboldd {#1}}} \def\fwfontsmalltitle#1{{\fwfontboldb {#1}}} \def\fwleftline#1{\leftline{#1}} \def\fwcenterline#1{\centerline{#1}} \def\fwrightline#1{\rightline{#1}} % Support for Old FunnelWeb % ------------------------- % The following macros were used extensively in the first version of % FunnelWeb and are retained so that these older input files will still % typeset cleanly. \def\p#1{{\tt #1}} % P for Program text. \def\flagpage#1#2{ \null \vfill \centerline{\fwfontboldd #1} \vskip 1cm \centerline{\fwfontboldd #2} \vfill \null \vfill } %====================== End of FunnelWeb TeX Definitions ======================= WV06: Test processing of ugly strings as ordinary and protected text with typesetter = tex. \fwbeginmacro \fwfilename{wv06.out}{1}\fwequals \fwodef \fwcdef \fwbeginmacronotes \fwisafile{This macro is attached to an output file.} \fwendmacronotes \fwendmacro A paragraph in ordinary mode. 33 con!text 34 con"text 35 con#text 36 con$text 37 con%text 38 con&text 39 con'text 40 con(text 41 con)text 42 con*text 43 con+text 44 con,text 45 con-text 46 con.text 47 con/text 48-57 con0123456789text 58 con:text 59 con;text 60 context 63 con?text 64 con@text 65-90 conABCDEFGHIJKLMNOPQRSTUVWXYZtext 91 con[text 92 con\text 93 con]text 94 con^text 95 con_text 96 con`text 97-122 conabcdefghijklmnopqrstuvwxyztext 123 con{text 124 con|text 125 con}text 126 con~text Now again, but this time inside protective braces. \fwlit{ 33 con!text 34 con\char`\"text 35 con\#text 36 con\$text 37 con\%text 38 con\&text 39 con'text 40 con(text 41 con)text 42 con*text 43 con+text 44 con,text 45 con-text 46 con.text 47 con/text 48-57 con0123456789text 58 con:text 59 con;text 60 con\char`\text 63 con?text 64 con@text 65-90 conABCDEFGHIJKLMNOPQRSTUVWXYZtext 91 con[text 92 con\char`\\text 93 con]text 94 con\char`\^text 95 con\_text 96 con`text 97-122 conabcdefghijklmnopqrstuvwxyztext 123 con\char`\{text 124 con\char`\|text 125 con\char`\}text 126 con\char`\~text } \bye %******************************************************************************* %* END OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* fw_src/answers/wv07.htm 644 0 0 21441 6717353764 10333 Package wv07

WV07: Test the typesetting of library macros.


1. 1. Test an ordinary library macro.

1. Sloth[ZL]={I am the sloth }
This macro is NEVER invoked.


2. 2. Test a library macro with two body parts.

2. Two body parts[ZL]+={Sloth }
This macro is defined in definitions 2 and 3.
This macro is invoked in definition 11.

3. Two body parts[ZL]+={Walrus }
This macro is defined in definitions 2 and 3.
This macro is invoked in definition 11.


3. 3. Test a library macro with three body parts.

4. Three body parts[ZL]+={Sloth }
This macro is defined in definitions 4, 5 and 6.
This macro is invoked in definition 9.

5. Three body parts[ZL]+={Walrus }
This macro is defined in definitions 4, 5 and 6.
This macro is invoked in definition 9.

6. Three body parts[ZL]+={Aardvaark }
This macro is defined in definitions 4, 5 and 6.
This macro is invoked in definition 9.


4. 4. Test a library macro with five body parts.

7. Five body parts[ZL]+={Sloth }
This macro is defined in definitions 7, 8, 9, 10 and 11.
This macro is NEVER invoked.

8. Five body parts[ZL]+={Walrus }
This macro is defined in definitions 7, 8, 9, 10 and 11.
This macro is NEVER invoked.

9. Five body parts[ZL]+={Three body parts}
This macro is defined in definitions 7, 8, 9, 10 and 11.
This macro is NEVER invoked.

10. Five body parts[ZL]+={Aardvaark }
This macro is defined in definitions 7, 8, 9, 10 and 11.
This macro is NEVER invoked.

11. Five body parts[ZL]+={Two body parts}
This macro is defined in definitions 7, 8, 9, 10 and 11.
This macro is NEVER invoked.


5. 5. Test a library macro that is overruled.

12. Walrus[ZL]={Walrus library }
This library macro was overruled by definition 13 and is not active.

13. Walrus[Z]={Walrus main }
This macro is NEVER invoked.


6. 6. Test interlaced and overruled.

14. Aardvark[ZL]+={First aardvark level one text (correct)
}
This macro is defined in definitions 14 and 16.
This macro is invoked in definition 18.

15. Aardvark[LL]+={Second aardvark level two text }
This macro is defined in definitions 15 and 17.
This library macro was overruled by definition 14 and is not active.

16. Aardvark[ZL]+={First aardvark level one text (correct)
}
This macro is defined in definitions 14 and 16.
This macro is invoked in definition 18.

17. Aardvark[LL]+={Second aardvark level two text }
This macro is defined in definitions 15 and 17.
This library macro was overruled by definition 14 and is not active.

18. File: wv07.out={Aardvark}
This macro is attached to an output file.

End of tests.


End Of File

ext 39 con'text 40 con(text 41 con)text 42 con*text 43 con+text 44 con,text 45 con-text 46 con.text 47 con/text 48-57 con0123456789text 58 con:text 59 con;text 60 con\char`\text 63 con?text 6fw_src/answers/wv07.lis 644 0 0 532 6717353763 10267 FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- ................. ------------+------------------------------------------------------------------- Weave: Completed <>. Weave: Completed <>. SUCCESS: No diagnostics. fw_src/answers/wv07.tex 644 0 0 47402 6717353764 10350 %******************************************************************************* %* START OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* %* * %* This TeX file was automatically generated by the FunnelWeb preprocessor. * %* You can typeset this file to produce printed documentation by running it * %* through the TeX typesetter using a command such as: * %* tex thisfilename * %* The resultant file thisfilename.dvi can be printed using a command such as: * %* lpr -Plaser -d thisfilename.dvi * %* * %* FunnelWeb is a preprocessor that allows programmers to weave programs and * %* their documentation together in a single document. The FunnelWeb program * %* analyses such documents producing both program files and typeset * %* documentation such as this TeX file. * %* FunnelWeb was created by Ross N. Williams. * %* * %* For more information on FunnelWeb see http://www.ross.net/funnelweb/ * %* * %******************************************************************************* %===================== Start of FunnelWeb TeX Definitions ====================== % Version % ------- % This is FunnelWeb TeX Macro Library Version 1.0. % Copyright % --------- % This set of FunnelWeb TeX definitions was written by Ross Williams and was % originally Copyright (C) 1992 Ross N. Williams. However, I, Ross Williams, % hereby forego any claim to Copyright in this set of FunnelWeb TeX definitions % and hereby authorize that the set of TeX definitions pass into the public % domain. -- Ross N. Williams, 3:41pm 07-May-1992, Adelaide, Australia. % Modification % ------------ % Please record all modifications to these TeX definitions here. Unless % otherwise specified, all modified definitions fall in the public domain too. % % Programmers: % RNW Ross N. Williams ross@ross.net % % Changes: % 07-May-1992 RNW Prepared this work for public domain release. % 10-May-1999 RNW Added \fwlib macro. % General Comments % ---------------- % This set of TeX definitions exists for two reasons: % % 1. To shorten and neaten the FunnelWeb TeX output. % 2. To allow users to fiddle with the output format in their input files % (by inserting redefining "\def"s) without having to resort to % modifying the FunnelWeb code. % % The user is warned that these definitions may be changed from time to time % (but probably not much). The user should not be too sneaky. In particular, % users wishing to redefine some of these macros should do so in an explicitly % defined section at the top of their input file. This will mean that in the % event of problems, that section can simply be deleted or commented out to % allow the document to at least be typeset in the default format. Users should % limit themselves to redefining these macros in such a section and should % refrain from using the macros throughout their documents. % Environment Parameters % ---------------------- % \tolerance tells TeX how tolerant it should be about making bad line and % page breaks. Here we set it to it's maximum, as % 1) Computer programs are likely to cause lots of bad breaks. % 2) In most cases the user would probably rather get the TeX file through % TeX without any errors than fiddle with spacings for perfection. \tolerance=10000 % I don't like indentation as it makes the page look more busy. Instead, % paragraphs are separated by a little space (see next). \parindent=0pt % In many cases, users will produce documents with long runs of paragraphs. % In order to space out these paragraphs, it is convenient to maintain a % prevailing non-zero \parskip (end-of-paragaph skip). The only trouble is % that the skip becomes a problem in macro definitions which require no skip % and so we have to turn the skip on and off. The following two macros % simplify this process. \def\fwparskipon{\parskip=\medskipamount} \def\fwparskipoff{\parskip=0pt} \fwparskipon % Setting raggedbottom allows TeX to leave a bit of space at the bottom of the % page in order to better vertically align the rest of the page (e.g. skips % won't stretch as much). It also means that headings are less likely to be % isolated at the bottom of the page without any following text. \raggedbottom % Fonts % ----- % Most of the typeset output is set in 10pt roman and 10pt tt font. % The major extra font needs spring from titles and headings. % For portability's sake we use only the following fonts: % cmr10 % cmbx10 % cmtt10 % and some enlargements of them. These fonts are all "standard" fonts % in Plain TeX. See The TeXbook p.350. \font\fwfontnote=cmr7 \font\fwfontnorm=cmr10 \font\fwfontnorma=cmr10 scaled \magstep1 \font\fwfontnormb=cmr10 scaled \magstep2 \font\fwfontbold=cmbx10 \font\fwfontbolda=cmbx10 scaled \magstep1 \font\fwfontboldb=cmbx10 scaled \magstep2 \font\fwfontboldc=cmbx10 scaled \magstep3 \font\fwfontboldd=cmbx10 scaled \magstep4 % Macros for Stylistic Details % ---------------------------- % This section contains all the fiddly little macros for setting the details % of each macro definition. % Macro definitions are sandwiched by calls to these macros which can be used % to sort out the spacing before and after the macro definition. \def\fwbeginmacro{\fwparskipoff\bigskip} \def\fwendmacro{\fwparskipon\par} % These macros deal with the macro name and definition line. \def\fwmacroname#1#2{{\sl #1\/}$\lbrack$#2$\rbrack$} \def\fwfilename#1#2{{\bf #1}$\lbrack$#2$\rbrack$} \def\fwzero#1{{\bf Z}} \def\fwmany#1{{\bf M}} \def\fwlib#1{{\bf L}} \def\fwequals{ $\equiv$} \def\fwplusequals{ $+\equiv$} % Now for the actual body of the definition. It looks nice to have the tt % code indented a little. Again, we use macros instead of writing direct TeX, % so as to allow the user to fiddle this stuff to taste without having to % modify the FunnelWeb C code. \def\fwodef{\parindent=15pt\vskip0pt$\lbrace$\parindent=20pt} \def\fwcdef{$\rbrace$\vskip0pt\parindent=0pt} \def\fwoquote{`} \def\fwcquote{'} \def\fwoparen{$($} \def\fwcomma{$,$} \def\fwcparen{$)$} \def\fwparam#1{$\diamond #1$} \def\fwparams#1{$(\diamond #1)$} % These macros deal with the notes that are appended at the end of each % macro definition. Note that even though \fwisafile,\fwusedin, and \fwseealso % have the same definition, they are given different names so as to allow the % user to redefine these macros to typeset each kind of information differently % if desired. \def\fwbeginmacronotes{\begingroup\baselineskip=9pt\smallskip} \def\fwnote#1{{\fwfontnote #1}\par} \def\fwisafile#1{\fwnote{#1}} \def\fwusedin#1{\fwnote{#1}} \def\fwseealso#1{\fwnote{#1}} \def\fwendmacronotes{\endgroup} % Macros to Typeset Program Code Verbatim % --------------------------------------- % This is by far the hairiest and most difficult part of the typesetting task % because we have to turn off most of TeX's natural instincts in order to % typeset the program text exactly as it appears in the input file. % Two macros are defined to pull this off: \fwbtx and \fwverbatimgobble. % Their code was inspired by the following sections of "The TeXbook": % Appendix D: Dirty Tricks, 3.Verbatim listing, p.380-382. % Appendix E: Example Formats, p.421. % The \fwbtx[ (for "FunnelWeb Begin TeXt") macro does most of the hard work. % The liberal use of "%" is because I don't understand TeX well enough to % understand when an end of line will cause trouble, and I am playing it safe. % Before defining the main \fwbtx macro, we have to stash away some definitions % in the hidden part of TeX's environment. Let's hope that these "hidden" % definitions don't affect anything except what is desired to be affected. % The tt font in which we wish to set the text has two Latin lurking ligatures! % These are ?` and !`. To disable them, we define the left quote when ACTIVE % to be defined in such a way as to prevent ligatures. The main TeX text will % normally not be exposed to this definition because normally the leftquote % character is not active. The \fwbtx macro temporarily makes the left quote % character active thus activating the deactivation of left quote ligatures. % See The TeXbook p.381. {\catcode`\`=\active \gdef`{\relax\lq}} % TeX is fairly carefree about spaces and so we have to make it more serious. % To do so we pull the same trick as above, setting up a definition for active % space, but only making space active during the span of the verbatim text. % In Plain TeX the active space is defined to be simply a space, but here we % define it to be a control space. This ensures that the space cannot % be gobbled up by one of TeX's mysterious mechanisms when activated. % See The TeXbook, p.381 and p.352. {\obeyspaces\global\let =\ } % Here is the main \fwbtx verbatim text macro. % Note: The order in which all these pieces of business have to be done is % still a partial mystery to me. Don't fiddle with this stuff unless you % think you know what you are doing. \def\fwbtx[{% % % The funnies involved in getting verbatim output are safely housed inside % this \begingroup, and the \endgroup in \fwverbatimgobble. Groups are used % instead of curly braces because we have to be able to signal the end of % this macro with a curly brace. \begingroup% % % \pars at the end of empty lines in the verbatim text won't come out normally % because TeX is in vertical mode and they get gobbled up. To prevent this, % we force \par to exit vertical mode first. See The TeXbook p.381. \def\par{\leavevmode\endgraf}% % % Activate the leftquote character so as to avoid ligatures (see above). \catcode`\`=\active% % % The \obeylines macro simply defines end of line (^M) to be \par. This ensures % that TeX will treat each verbatim line as a new paragraph. \obeylines% % % To get verbatim output, we have to desex all the special characters. This % is explained in detail in The TeXbook p.380. \def\do##1{\catcode`##1=12 }\dospecials% % % Activate the space character so as to make TeX treat blanks seriously. % This activation invokes an eralier definition (see above). \obeyspaces % % Interparagraph skips do not help the cause. % Note: We have to preserve the indentation though, as the code is actually % indented in the final output. See \fwodef in an earlier section. \parskip=0pt% % % We typeset the verbatim text in tt font (courier on the Macintosh) for a % number of reasons: % - tt font has the same horizontal spacing for each character. % - tt font covers the ASCII character set. % - tt font doesn't have many surprises (e.g. ligatures). % - tt font looks much what you might see on a computer terminal screen. \tt% % % Having set up an environment for verbatim, we are ready to use it. % By invoking \fwverbatimgobble, this \fwbtx macro gobbles up text verbatim (as % part of the parameter of \fwverbatimgobble) until it sees the termination % string "]fwetx=" (the "=" was thrown in to add obscurity as this sequence % must never occur in the verbatim text). \fwverbatimgobble} % The \fwverbatimgobble macro exists to allow \fwbtx to bracket verbatim text. \def\fwverbatimgobble#1]fwetx={#1\endgroup} % Table of Contents % ----------------- % The five levels of table of contents that FunnelWeb supports are identified % by the five letters [A..E]. These are used throughout the following macros. % The following macros are utilities to the TOC macros to follow. \def\fwrule{\medskip\hrule\medskip} \def\fwqh{\hskip1.5em\relax} \def\fwbeforesec{\penalty-200\bigskip\medskip\par} % The following macros are used to typeset the table of contents. \def\fwtocstart#1{\fwrule\leftline{\fwfontbolda Table of Contents}\fwrule} \def\fwtoca#1#2{\leftline{{\bf #1 #2}}} \def\fwtocb#1#2{\leftline{\fwqh #1 #2}} \def\fwtocc#1#2{\leftline{\fwqh\fwqh #1 #2}} \def\fwtocd#1#2{\leftline{\fwqh\fwqh\fwqh #1 #2}} \def\fwtoce#1#2{\leftline{\fwqh\fwqh\fwqh\fwqh #1 #2}} \def\fwtocfinish#1{\fwrule} % The following "library" macros define five different strengths of headings % which can be used later in the section macros. \def\fwliba#1#2{\vfill\eject{\fwfontboldc #1 #2}\penalty200\smallskip} \def\fwlibb#1#2{\fwbeforesec{\fwfontboldb #1 #2}\penalty200\smallskip} \def\fwlibc#1#2{\fwbeforesec{\fwfontnormb #1 #2}\penalty200\smallskip} \def\fwlibd#1#2{\fwbeforesec{\bf #1 #2}\penalty200} \def\fwlibe#1#2{\fwbeforesec{\bf #1 #2}} % Here are the macros that actually typeset the section headings throughout % the document. The fwlib system has been employed so as to easily allow the % user to redefine the strengths of headings to taste. For example, the % user could insert in the input document a similar set of definitions to these % but with the b..e headings set to \fwlibc. This would tone down the output. \def\fwseca#1#2{\fwliba{#1}{#2}} \def\fwsecb#1#2{\fwlibb{#1}{#2}} \def\fwsecc#1#2{\fwlibc{#1}{#2}} \def\fwsecd#1#2{\fwlibd{#1}{#2}} \def\fwsece#1#2{\fwlibe{#1}{#2}} % Support for Explicit Typesetting % -------------------------------- % FunnelWeb supports pragmas and other constructs that allow % typesetter-independent typesetting commands to be given. The % following macros support these features. % The in-text literal @{sloth@} and emphasise @[walrus@] features. \def\fwlit#1{{\tt #1}} \def\fwemp#1{{\it #1}} % The "@p new_page" pragma. \def\fwnewpage{\vfill\eject} % The "@p vskip Nmm" pragma. \def\fwvskip#1{\null\vskip #1mm} % The "@p title " pragma. \def\fwfontnormal#1{{\fwfontnorm {#1}}} \def\fwfonttitle#1{{\fwfontboldd {#1}}} \def\fwfontsmalltitle#1{{\fwfontboldb {#1}}} \def\fwleftline#1{\leftline{#1}} \def\fwcenterline#1{\centerline{#1}} \def\fwrightline#1{\rightline{#1}} % Support for Old FunnelWeb % ------------------------- % The following macros were used extensively in the first version of % FunnelWeb and are retained so that these older input files will still % typeset cleanly. \def\p#1{{\tt #1}} % P for Program text. \def\flagpage#1#2{ \null \vfill \centerline{\fwfontboldd #1} \vskip 1cm \centerline{\fwfontboldd #2} \vfill \null \vfill } %====================== End of FunnelWeb TeX Definitions ======================= WV07: Test the typesetting of library macros. \fwseca{1}{1. Test an ordinary library macro.} \fwbeginmacro \fwmacroname{Sloth}{1}\fwzero{}\fwlib{}\fwequals \fwodef \fwbtx[I am the sloth]fwetx=% \fwcdef \fwbeginmacronotes \fwusedin{This macro is NEVER invoked.} \fwendmacronotes \fwendmacro \fwseca{2}{2. Test a library macro with two body parts.} \fwbeginmacro \fwmacroname{Two body parts}{2}\fwzero{}\fwlib{}\fwplusequals \fwodef \fwbtx[Sloth]fwetx=% \fwcdef \fwbeginmacronotes \fwseealso{This macro is defined in definitions 2 and 3.} \fwusedin{This macro is invoked in definition 11.} \fwendmacronotes \fwendmacro \fwbeginmacro \fwmacroname{Two body parts}{3}\fwzero{}\fwlib{}\fwplusequals \fwodef \fwbtx[Walrus]fwetx=% \fwcdef \fwbeginmacronotes \fwseealso{This macro is defined in definitions 2 and 3.} \fwusedin{This macro is invoked in definition 11.} \fwendmacronotes \fwendmacro \fwseca{3}{3. Test a library macro with three body parts.} \fwbeginmacro \fwmacroname{Three body parts}{4}\fwzero{}\fwlib{}\fwplusequals \fwodef \fwbtx[Sloth]fwetx=% \fwcdef \fwbeginmacronotes \fwseealso{This macro is defined in definitions 4, 5 and 6.} \fwusedin{This macro is invoked in definition 9.} \fwendmacronotes \fwendmacro \fwbeginmacro \fwmacroname{Three body parts}{5}\fwzero{}\fwlib{}\fwplusequals \fwodef \fwbtx[Walrus]fwetx=% \fwcdef \fwbeginmacronotes \fwseealso{This macro is defined in definitions 4, 5 and 6.} \fwusedin{This macro is invoked in definition 9.} \fwendmacronotes \fwendmacro \fwbeginmacro \fwmacroname{Three body parts}{6}\fwzero{}\fwlib{}\fwplusequals \fwodef \fwbtx[Aardvaark]fwetx=% \fwcdef \fwbeginmacronotes \fwseealso{This macro is defined in definitions 4, 5 and 6.} \fwusedin{This macro is invoked in definition 9.} \fwendmacronotes \fwendmacro \fwseca{4}{4. Test a library macro with five body parts.} \fwbeginmacro \fwmacroname{Five body parts}{7}\fwzero{}\fwlib{}\fwplusequals \fwodef \fwbtx[Sloth]fwetx=% \fwcdef \fwbeginmacronotes \fwseealso{This macro is defined in definitions 7, 8, 9, 10 and 11.} \fwusedin{This macro is NEVER invoked.} \fwendmacronotes \fwendmacro \fwbeginmacro \fwmacroname{Five body parts}{8}\fwzero{}\fwlib{}\fwplusequals \fwodef \fwbtx[Walrus]fwetx=% \fwcdef \fwbeginmacronotes \fwseealso{This macro is defined in definitions 7, 8, 9, 10 and 11.} \fwusedin{This macro is NEVER invoked.} \fwendmacronotes \fwendmacro \fwbeginmacro \fwmacroname{Five body parts}{9}\fwzero{}\fwlib{}\fwplusequals \fwodef \fwmacroname{Three body parts}{4}\fwcdef \fwbeginmacronotes \fwseealso{This macro is defined in definitions 7, 8, 9, 10 and 11.} \fwusedin{This macro is NEVER invoked.} \fwendmacronotes \fwendmacro \fwbeginmacro \fwmacroname{Five body parts}{10}\fwzero{}\fwlib{}\fwplusequals \fwodef \fwbtx[Aardvaark]fwetx=% \fwcdef \fwbeginmacronotes \fwseealso{This macro is defined in definitions 7, 8, 9, 10 and 11.} \fwusedin{This macro is NEVER invoked.} \fwendmacronotes \fwendmacro \fwbeginmacro \fwmacroname{Five body parts}{11}\fwzero{}\fwlib{}\fwplusequals \fwodef \fwmacroname{Two body parts}{2}\fwcdef \fwbeginmacronotes \fwseealso{This macro is defined in definitions 7, 8, 9, 10 and 11.} \fwusedin{This macro is NEVER invoked.} \fwendmacronotes \fwendmacro \fwseca{5}{5. Test a library macro that is overruled.} \fwbeginmacro \fwmacroname{Walrus}{13}\fwzero{}\fwlib{}\fwequals \fwodef \fwbtx[Walrus library]fwetx=% \fwcdef \fwbeginmacronotes \fwusedin{This library macro was overruled by definition 13 and is not active.} \fwendmacronotes \fwendmacro \fwbeginmacro \fwmacroname{Walrus}{13}\fwzero{}\fwequals \fwodef \fwbtx[Walrus main]fwetx=% \fwcdef \fwbeginmacronotes \fwusedin{This macro is NEVER invoked.} \fwendmacronotes \fwendmacro \fwseca{6}{6. Test interlaced and overruled.} \fwbeginmacro \fwmacroname{Aardvark}{14}\fwzero{}\fwlib{}\fwplusequals \fwodef \fwbtx[First aardvark level one text (correct) ]fwetx=% \fwcdef \fwbeginmacronotes \fwseealso{This macro is defined in definitions 14 and 16.} \fwusedin{This macro is invoked in definition 18.} \fwendmacronotes \fwendmacro \fwbeginmacro \fwmacroname{Aardvark}{14}\fwlib{}\fwlib{}\fwplusequals \fwodef \fwbtx[Second aardvark level two text]fwetx=% \fwcdef \fwbeginmacronotes \fwseealso{This macro is defined in definitions 15 and 17.} \fwusedin{This library macro was overruled by definition 14 and is not active.} \fwendmacronotes \fwendmacro \fwbeginmacro \fwmacroname{Aardvark}{16}\fwzero{}\fwlib{}\fwplusequals \fwodef \fwbtx[First aardvark level one text (correct) ]fwetx=% \fwcdef \fwbeginmacronotes \fwseealso{This macro is defined in definitions 14 and 16.} \fwusedin{This macro is invoked in definition 18.} \fwendmacronotes \fwendmacro \fwbeginmacro \fwmacroname{Aardvark}{16}\fwlib{}\fwlib{}\fwplusequals \fwodef \fwbtx[Second aardvark level two text]fwetx=% \fwcdef \fwbeginmacronotes \fwseealso{This macro is defined in definitions 15 and 17.} \fwusedin{This library macro was overruled by definition 14 and is not active.} \fwendmacronotes \fwendmacro \fwbeginmacro \fwfilename{wv07.out}{18}\fwequals \fwodef \fwmacroname{Aardvark}{14}\fwcdef \fwbeginmacronotes \fwisafile{This macro is attached to an output file.} \fwendmacronotes \fwendmacro End of tests. \bye %******************************************************************************* %* END OF AUTOMATICALLY GENERATED TEX FILE * %******************************************************************************* s, % we force \par to exit vertical mode first. See The TeXbook p.381. \def\par{\leavevmode\endgraf}% % % Activate the leftquote character so as to avoid ligatures (see above). \catcode`\`=\active% % % The \obeylines macro simply defines end of line (^M)fw_src/results/ 755 0 0 0 6717354144 7004 5fw_src/scripts/ 755 0 0 0 6717570334 6773 5fw_src/scripts/master.fws 644 0 0 17443 6717015366 11037 !======================================================= ! ! FUNNELWEB MASTER TEST SCRIPT ! ============================ ! This is the master FunnelWeb test script. ! To test FunnelWeb: ! 1. Create the following directory tree: ! ! scripts - A directory containing .fws scripts. ! tests - A directory containing .fw test files. ! results - An empty directory to receive results of testing. ! answers - A directory containing the correct answers. ! 2. Modify the "root test directory" section of this script as described. ! 3. Ensure that all of the directories and files are on Read/Write access. ! 4. Set default to the "scripts" directory. ! 5. Invoke FunnelWeb with the "+k" option. ! 6. Give the command "execute master.fws". ! 7. The test should last for a few minutes. ! 8. Read the test summary on the console at the end of the test. ! ! Notes on Script Mechanics ! ------------------------- ! * FunnelWeb predefines "$/" to be the character that separates ! directory specifications from file names on whatever machine it is ! running on. (e.g. Mac=":", Sun="/", Vax="]", PC="\"). write "" write "FUNNELWEB TEST SCRIPT" write "=====================" write "This FunnelWeb shellscript applies FunnelWeb to a suite of test files." write "The result is a differences report comparing the result files of this" write "run with a predefined set of correct "answer" files." write "" write "Do not be alarmed by errors occurring during the testing as these" write "are a consequence of tests of FunnelWeb's detection of various errors." write "" write "This script cleans up files lying around before testing, so if" write "it fails for some reason, you can run it again without having." write "to worry about cleaning up after the results of the previous run." write "" write "This script takes about 10 minutes to run on a 1 MIP machine." write "Here we go!" write "" ! ! Define Symbol For The Root Test Directory ! ----------------------------------------- ! IMPORTANT: THIS DEFINITION IS ALL YOU HAVE TO CHANGE TO GET THIS ! SCRIPT WORKING ON YOUR MACHINE. ! The script substitution variable R must point to the root ! directory (see above). Here are some examples of definitions ! of R on various machines onto which FunnelWeb has been ported. !SUN: define R "/usr2/users/ross/fwdir/" !VMS: define R "$$USERS:[ROSS.FWDIR." !PC : define R "\fwdir\" !Mac: define R "fatdisk:fwdir:" ! Place your definition here. define R "current:cprogramming:funnelweb:" ! Define Symbols for Test Directories ! ----------------------------------- ! S - The directory containing the .fws FunnelWeb test scripts. ! I - The directory containing the .fw input files. ! O - The directory where all the test output goes. ! A - The directory containing all the correct answers. ! D - The differences file. define S "$Rscripts$/" define I "$Rtests$/" define O "$Rresults$/" define A "$Ranswers$/" define D "$Rresults$/0testres.dif" ! Set FunnelWeb Options Default ! ----------------------------- ! The following options remain as default for all the runs. ! The only two options turned on are +c100 and +b7. ! The sub-scripts turn on the options they need explicitly. ! -f No input file specified. ! -j No journal file. ! =i..Include files come from the input directory. ! -o No product file(s). ! -t No typeset file. ! -l No Listing file. ! -d No deletion of output files. ! +c100 No suppression of listing in listing file. ! -q Messages to screen. ! -x No default script file to execute. ! -w No limit on product file line length imposed by command line. ! -k No interactive mode. ! -b1 No dump of input file map. ! -b2 No dump of line list. ! -b3 No dump of token list. ! -b4 No dump of macro table. ! -b5 No dump of document list. ! -b6 No dump of timing results. ! +b7 DONT write anything non-deterministic. set -f -j =i$I -o -t -l -d +c100 -q -x -w -k -b123456 +b7 ! Delete any Old Differences File ! ------------------------------- eneo $D ! Zero the Difference Summary Counters ! ------------------------------------ ! This is necessary in case the user runs this script twice in one session. diffzero ! Clean Test Scripts ! ------------------ ! When text files are copied from one machine to another, they can sometimes ! end up with end-of-line characters that are incorrect for the target machine. ! The following commands clean up the sub-scripts that we are about to invoke. fixeols $Stest_ld.fws fixeols $Stest_l.fws fixeols $Stest_lo.fws fixeols $Stest_lt.fws fixeols $Stest_lot.fws fixeols $Stest_lo2.fws ! Generate Tricky Test Files ! -------------------------- ! This process is a bit messy and requires operations similar to those in the ! other sub-scripts (test_ld.fws...), and so I have placed it all in ! test_gen.fws. execute $Stest_gen.fws ! Clean up the Include Files ! -------------------------- ! The test scripts all "purify" their file arguments by running them through ! the "fixeols" command. However, the include files aren't automated in this ! way, so we have to do them here explicitly. fixeols $Isc13a.fwi fixeols $Isc13b.fwi fixeols $Isc13c.fwi fixeols $Isc13d.fwi fixeols $Isc13e.fwi fixeols $Isc13f.fwi fixeols $Isc15a.fwi fixeols $Itg08a.fwi fixeols $Iex09a.fwi fixeols $Iex10a.fwi ! Skip Some Tests ! --------------- ! If you are debugging some tests, you may wish to move the "here" command ! further down in the testing so as to skip to the desired tests. ! X must be defined because FunnelWeb expands command lines even while skipping ! and generates a "leading spaces" error if X is not defined to be non-blank. define X "!" skipto here ! Test Scanner and Parser ! ----------------------- define X "execute $Stest_ld.fws" ! Special cases: ! sc01 does not exist (test of non-existence input file). ! sc09 contains control characters that we don't want FIXEOLS to frob. $X sc01 ! $X sc02 $X sc03 $X sc04 $X sc05 $X sc06 $X sc07 $X sc08 $X sc09 ! $X sc10 $X sc11 $X sc12 $X sc13 $X sc14 $X sc15 $X sc16 $X sc17 $X sc18 $X sc19 $X sc20 $X sc21 $X sc22 $X sc23 $X sc24 $X sc25 $X sc26 $X sc27 $X sc28 $X sc29 $X pr01 $X pr02 $X pr03 $X pr04 $X pr05 $X pr06 $X pr07 $X pr08 $X pr09 $X pr10 $X pr11 ! Test Analyser ! ------------- define X "execute $Stest_l.fws" $X an01 $X an02 $X an03 $X an04 $X an05 ! Test Tangle ! ----------- define X "execute $Stest_lo.fws" $X tg01 $X tg02 $X tg03 $X tg04 $X tg05 $X tg06 $X tg07 $X tg08 $X tg09 $X tg10 ! Test Weave ! ---------- define X "execute $Stest_lt.fws" $X wv01 $X wv02 $X wv03 $X wv04 $X wv05 define X "execute $Stest_lt2.fws" $X wv06 define X "execute $Stest_lt.fws" $X wv07 ! Examples in User Manual Tutorial ! -------------------------------- define X "execute $Stest_lo.fws" $X ex01 $X ex02 define X "execute $Stest_l.fws" $X ex03 define X "execute $Stest_lo.fws" $X ex04 $X ex05 $X ex06 $X ex07 $X ex08 $X ex09 $X ex10 define X "execute $Stest_lt.fws" $X ex11 $X ex12 $X ex13 $X ex14 $X ex15 define X "execute $Stest_lot.fws" $X ex16 ! Examples in Hints Chapter ! ------------------------- define X "execute $Stest_lo.fws" $X hi01 $X hi02 $X hi03 $X hi04 $X hi05 define X "execute $Stest_lo2.fws" $X hi06 $X hi07 define X "execute $Stest_lo.fws" $X hi08 $X hi09 $X hi10 ! Final Test Summary ! ------------------ write "" write "" write "The FunnelWeb test suite script has successfully completed." write "" diffsummary write "" write "If the differences summary above gives Different=0, then FunnelWeb" write "has passed the test suite and is ready for use." write "" write "If not, you should examine the file" write " "$D"" write "to see what went wrong." write "" write "By the way, there should be 1 Severe, 291 Errors, and 12 Warnings." write "" !========================================================= tes \fwendmacro \fwbeginmacro \fwfilename{wv07.out}{18}\fwequals \fwodef \fwmacroname{Aardvark}{14}\fwcdef \fwbeginmacronotes \fwisafile{This macro is attached to an output file.} \fwendmacronotes \fwendmacro End of fw_src/scripts/test_gen.fws 644 0 0 3022 5211006162 11276 !===================================================== ! ! Generate Tricky Input Files ! --------------------------- ! This script processes the "generate.fw" test file which not only tests ! FunnelWeb to some extent, but also generates a few ".fw" input test ! files which are tested later on in the test suite process. ! ! Inputs: None. ! Outputs: ! Listing file. ! Product files (which appear in the input $I directory as .fw files). ! Appendage to differences file. ! Announce this test. write "" write "" writeu "Basic Test and Generate Some Tricky Input Files" ! Delete any previous output files. eneo $Isc06.fw eneo $Isc08.fw eneo $Isc09.fw eneo $Isc13e.fwi eneo $Ogenerate.log eneo $Ogenerate.lis eneo $Ogenerate.tex eneo $Ogenerate.out ! Check input and answer files. exists $Igenerate.fw exists $Agenerate.lis absent $Agenerate.out absent $Agenerate.tex ! Clean input and answer files. fixeols $Igenerate.fw fixeols $Agenerate.lis ! Perform the actual FunnelWeb run. fw $Igenerate.fw +L$Ogenerate.lis +O$I ! Ensure that the correct files were generated. absent $Ogenerate.log absent $Ogenerate.tex absent $Ogenerate.out exists $Ogenerate.lis exists $Isc06.fw exists $Isc08.fw exists $Isc09.fw exists $Isc13e.fwi ! Compare the listing file with the correct answer. ! We can't check the other files because of the original problem this whole ! generation script is designed to solve! diff $Ogenerate.lis $Agenerate.lis $D !======================================================= ====================================== ! ! FUNNELWEB MASTER TEST SCRIPT ! ============================ ! This is the master FunnelWeb test script. ! To test FunnelWeb: ! 1. Create the following directory tree: ! ! scripts - A directory containing .fws scripts. ! tests - A directory containing .fw test files. ! results - An empty directory to receive results of testing. ! answers - A directory containing the cofw_src/scripts/test_l.fws 644 0 0 2242 6717353627 11012 !======================================================= ! ! Test With A Plain Listing File ! ------------------------------ ! Inputs: ! $1 = Name of the .fw file to be tested (e.g. $1="sc01"). ! $I = Directory containing .fw files. ! $A = Directory containing Answer files. ! $O = Directory to place Result files. ! $D = Name of the differences file. ! Outputs: ! Listing file. ! Appendage to differences file. ! Announce this test. write "" write "" writeu "Performing Test $1" ! Delete any previous output files. eneo $O$1.log eneo $O$1.lis eneo $O$1.tex eneo $O$1.out ! Check input and answer files. exists $I$1.fw exists $A$1.lis absent $A$1.out absent $A$1.tex ! Clean input and answer files. fixeols $I$1.fw fixeols $A$1.lis ! Perform the actual FunnelWeb run. ! Tolerate means "don't abort on warning, error, or severe". tolerate fw $I$1.fw +l$O$1.lis ! Ensure that only a listing file was generated. absent $O$1.log absent $O$1.tex absent $O$1.out exists $O$1.lis ! Compare the listing file with the answer file. diff $O$1.lis $A$1.lis $D !========================================================= able R must point to the root ! directory (see above). Here are some examples of definitions ! of R on various machines onto which FunnelWeb has been ported. !SUN: define R "/usr2/users/ross/fwdir/" !VMS: define R "$$USERS:[ROSS.FWDIR." !PC : define R "\fwdir\" !Mac: define R "fatdisk:fwdir:" ! Place your definition herefw_src/scripts/test_ld.fws 644 0 0 2711 6717353627 11157 !====================================================== ! ! Test With Listing File and Scanner Dumps ! ---------------------------------------- ! Inputs: ! $1 = Name of the .fw file to be tested (e.g. $1="sc01"). ! $2 = Empty ("") or "!" to suppress FIXEOLing and existence check ! of input file. ! $I = Directory containing .fw files. ! $A = Directory containing Answer files. ! $O = Directory to place Result files. ! $D = Name of the differences file. ! Outputs: ! Listing file containing dumps. ! Appendage to differences file. ! Announce this test. write "" write "" writeu "Performing Test $1" ! Delete any previous output files. eneo $O$1.log eneo $O$1.lis eneo $O$1.tex eneo $O$1.out ! Check input and answer files. $2exists $I$1.fw exists $A$1.lis absent $A$1.out absent $A$1.tex ! Clean input and answer files. $2fixeols $I$1.fw fixeols $A$1.lis ! Perform the actual FunnelWeb run. ! Tolerate means "don't abort on warning, error, or severe". ! Options: ! +b1 Dump input file map. ! +b2 Dump line list. ! +b3 Dump token list. ! +b4 Dump macro table. ! +b5 Dump document list. tolerate fw $I$1.fw +l$O$1.lis +b12345 ! Ensure that only a listing file was generated. absent $O$1.log absent $O$1.tex absent $O$1.out exists $O$1.lis ! Compare the listing file with the answer file. diff $O$1.lis $A$1.lis $D !======================================================== nds clean up the sub-scripts that we are about to invokfw_src/scripts/test_lo.fws 644 0 0 2404 6717353630 11163 !====================================================== ! ! Test With Listing File and Product File ! --------------------------------------- ! Inputs: ! $1 = Name of the .fw file to be tested (e.g. $1="sc01"). ! $I = Directory containing .fw files. ! $A = Directory containing Answer files. ! $O = Directory to place Result files. ! $D = Name of the differences file. ! Outputs: ! Listing file. ! Product file. ! Appendage to differences file. ! Announce this test. write "" write "" writeu "Performing Test $1" ! Delete any previous output files. eneo $O$1.log eneo $O$1.lis eneo $O$1.tex eneo $O$1.out ! Check input and answer files. exists $I$1.fw exists $A$1.lis exists $A$1.out absent $A$1.tex ! Clean input and answer files. fixeols $I$1.fw fixeols $A$1.lis fixeols $A$1.out ! Perform the actual FunnelWeb run. ! Tolerate means "don't abort on warning, error, or severe". tolerate fw $I$1.fw +l$O$1.lis +o$O$1.out ! Ensure that only a listing and an product file were generated. absent $O$1.log absent $O$1.tex exists $O$1.lis exists $O$1.out ! Compare the results with the answers. diff $O$1.lis $A$1.lis $D diff $O$1.out $A$1.out $D !======================================================== define X "execute $Stest_l.fws" $X an01 $X an02 $X an03 $X an04 $X an05 ! Test Tangle ! ----------- define X "execute $Stest_lo.fws" $X tg01 $X tg02 $X tg03 $X tg04 $X tg05 $X tg06 $X tg07 $X tg08 $X tg09 $X tg10 ! Test Weave ! ---------- define X "fw_src/scripts/test_lo2.fws 644 0 0 2616 6717353630 11252 !===================================================== ! ! Test With Listing File and Two Product Files ! -------------------------------------------- ! Inputs: ! $1 = Name of the .fw file to be tested (e.g. $1="sc01"). ! $I = Directory containing .fw files. ! $A = Directory containing Answer files. ! $O = Directory to place Result files. ! $D = Name of the differences file. ! Outputs: ! Listing file. ! Product file a. ! Product file b. ! Appendage to differences file. ! Announce this test. write "" write "" writeu "Performing Test $1" ! Delete any previous output files. eneo $O$1.log eneo $O$1.lis eneo $O$1.tex eneo $O$1a.out eneo $O$1b.out ! Check input and answer files. exists $I$1.fw exists $A$1.lis exists $A$1a.out exists $A$1b.out absent $A$1.tex ! Clean input and answer files. fixeols $I$1.fw fixeols $A$1.lis fixeols $A$1a.out fixeols $A$1b.out ! Perform the actual FunnelWeb run. ! Tolerate means "don't abort on warning, error, or severe". tolerate fw $I$1.fw +l$O$1.lis +o$O$1.out ! Ensure that only a listing and two product files were generated. absent $O$1.log absent $O$1.tex exists $O$1.lis exists $O$1a.out exists $O$1b.out ! Compare the results with the answers. diff $O$1.lis $A$1.lis $D diff $O$1a.out $A$1a.out $D diff $O$1b.out $A$1b.out $D !======================================================= fw_src/scripts/test_lot.fws 644 0 0 2536 6717353630 11355 !===================================================== ! ! Test With Listing File and Product File and Typeset File ! -------------------------------------------------------- ! Inputs: ! $1 = Name of the .fw file to be tested (e.g. $1="sc01"). ! $I = Directory containing .fw files. ! $A = Directory containing Answer files. ! $O = Directory to place Result files. ! $D = Name of the differences file. ! Outputs: ! Listing file. ! Product file. ! Typeset file. ! Appendage to differences file. ! Announce this test. write "" write "" writeu "Performing Test $1" ! Delete any previous output files. eneo $O$1.log eneo $O$1.lis eneo $O$1.tex eneo $O$1.out ! Check input and answer files. exists $I$1.fw exists $A$1.lis exists $A$1.tex exists $A$1.out ! Clean input and answer files. fixeols $I$1.fw fixeols $A$1.lis fixeols $A$1.tex fixeols $A$1.out ! Perform the actual FunnelWeb run. ! Tolerate means "don't abort on warning, error, or severe". tolerate fw $I$1.fw +l$O$1.lis +o$O +t$O$1.tex ! Ensure that all three output files were generated. absent $O$1.log exists $O$1.out exists $O$1.lis exists $O$1.tex ! Compare the results with the answers. diff $O$1.lis $A$1.lis $D diff $O$1.out $A$1.out $D diff $O$1.tex $A$1.tex $D !======================================================= - A directory containing .fw test files. ! results - An empty directory to receive results of testing. ! answers - A directory containing the cofw_src/scripts/test_lt.fws 644 0 0 2611 6717353630 11170 !====================================================== ! ! Test With Listing File and Typeset File ! --------------------------------------- ! Inputs: ! $1 = Name of the .fw file to be tested (e.g. $1="sc01"). ! $I = Directory containing .fw files. ! $A = Directory containing Answer files. ! $O = Directory to place Result files. ! $D = Name of the differences file. ! Outputs: ! Listing file. ! TeX typeset file. ! HTML typeset file. ! Appendage to differences file. ! Announce this test. write "" write "" writeu "Performing Test $1" ! Delete any previous output files. eneo $O$1.log eneo $O$1.lis eneo $O$1.tex eneo $O$1.htm eneo $O$1.out ! Check input and answer files. exists $I$1.fw exists $A$1.lis exists $A$1.tex exists $A$1.htm absent $A$1.out ! Clean input and answer files. fixeols $I$1.fw fixeols $A$1.lis fixeols $A$1.tex fixeols $A$1.htm ! Perform the actual FunnelWeb run. ! Tolerate means "don't abort on warning, error, or severe". tolerate fw $I$1.fw +l$O$1.lis +t$O$1.tex +u$O$1.htm ! Ensure that only a listing and two typeset files were generated. absent $O$1.log absent $O$1.out exists $O$1.lis exists $O$1.tex exists $O$1.htm ! Compare the results with the answers. diff $O$1.lis $A$1.lis $D diff $O$1.tex $A$1.tex $D diff $O$1.htm $A$1.htm $D !======================================================== define R "$$USERS:[ROSS.FWDIR." !PC : define R "\fwdir\" !Mac: define R "fatdisk:fwdir:" ! Place your definition herefw_src/scripts/test_lt2.fws 644 0 0 2416 6715276612 11257 !====================================================== ! ! Test With Listing File and Typeset File ! --------------------------------------- ! Inputs: ! $1 = Name of the .fw file to be tested (e.g. $1="sc01"). ! $I = Directory containing .fw files. ! $A = Directory containing Answer files. ! $O = Directory to place Result files. ! $D = Name of the differences file. ! Outputs: ! Listing file. ! TeX typeset file. ! Appendage to differences file. ! Announce this test. write "" write "" writeu "Performing Test $1" ! Delete any previous output files. eneo $O$1.log eneo $O$1.lis eneo $O$1.tex eneo $O$1.out ! Check input and answer files. exists $I$1.fw exists $A$1.lis exists $A$1.tex absent $A$1.out ! Clean input and answer files. fixeols $I$1.fw fixeols $A$1.lis fixeols $A$1.tex ! Perform the actual FunnelWeb run. ! Tolerate means "don't abort on warning, error, or severe". tolerate fw $I$1.fw +l$O$1.lis +t$O$1.tex ! Ensure that only a listing and two typeset files were generated. absent $O$1.log absent $O$1.out exists $O$1.lis exists $O$1.tex ! Compare the results with the answers. diff $O$1.lis $A$1.lis $D diff $O$1.tex $A$1.tex $D !======================================================== ent $O$1.out exists $O$1.lis ! Compare the listing file with the answer file. diff $O$1.lis $A$1.lis $D !======================================================== nds clean up the sub-scripts that we are about to invokfw_src/source/ 755 0 0 0 6717570217 6604 5fw_src/source/analyse.c 644 0 0 27171 6716661006 10430 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. 09-May-1999 RNW Modified to cater for multiple library levels. ##############################################################################*/ /******************************************************************************/ /* ANALYSE.C */ /******************************************************************************/ #include "style.h" #include "analyse.h" #include "as.h" #include "data.h" #include "lister.h" #include "misc.h" #include "table.h" /******************************************************************************/ LOCAL void chk_mac P_((p_ma_t)); LOCAL void chk_mac (p_ma) p_ma_t p_ma; { mc_t *call; p_md_t p_md; /* Deal with undefined macros by flagging the first invocation. */ if (!maisdef(p_ma)) { ls_loo(p_ma->ma_calls,(ulong) 1,PPV &call); as_cold(call!=NULL,"check_macro: No instances of \"undefined\" macro!"); lr_err(&call->mc_ps,"Call to undefined macro."); return; } p_md = &p_ma->ma_defn[p_ma->ma_minlev]; /* Assert: The macro has a definition. */ /* Check that all the calls to the macro have the correct number of params. */ ls_fir(p_ma->ma_calls); ls_nxt(p_ma->ma_calls,PPV &call); while (call!=NULL) { if (call->mc_npar != p_md->md_npar) { sprintf(linet1,"Call has %lu parameter%s, but the macro", (ulong) call->mc_npar, call->mc_npar==1 ? "" : "s"); lr_err(&(call->mc_ps),linet1); sprintf(linet1,"definition at line %lu specifies %lu parameter%s.", (ulong) p_md->md_ps.ps_line, (ulong) p_md->md_npar, p_md->md_npar==1 ? "" : "s"); lr_mes(&(call->mc_ps),linet1); if (p_md->md_npar==0 && call->mc_npar==1) { lr_mes(&(call->mc_ps),"Note: If your call looks like this: @@(@) then you"); lr_mes(&(call->mc_ps),"should be aware that FunnelWeb treats this as a call with"); lr_mes(&(call->mc_ps),"a single parameter consisting of the empty string. This"); lr_mes(&(call->mc_ps),"is a consequence of parameter delimiters @\"@\" being optional."); } } ls_nxt(p_ma->ma_calls,PPV &call); } /* Check that the number of calls of the macro is legal. */ if (p_md->md_isfil) { /* Flag all calls to a file macro as errors. */ if (ls_len(p_ma->ma_calls)>0) { lr_mes(&p_md->md_ps, "This file macro is called one or more times."); lr_mes(&p_md->md_ps, "Each call has been flagged with an error message."); } ls_fir(p_ma->ma_calls); ls_nxt(p_ma->ma_calls,PPV &call); while (call!=NULL) { lr_err(&(call->mc_ps),"Calls to file macros are not allowed."); lr_mes(&(call->mc_ps),"Reason: It should be possible to comment out a"); lr_mes(&(call->mc_ps),"file macro without a big fuss. Calling a file macro"); lr_mes(&(call->mc_ps),"just tangles it up in the macro structure,"); lr_mes(&(call->mc_ps),"making it more difficult to comment out later."); ls_nxt(p_ma->ma_calls,PPV &call); } } else { /* Non-file macros. */ if (ls_len(p_ma->ma_calls)==0 && !p_md->md_iszer) lr_err(&p_md->md_ps, "This macro is never used (and has no @Z)."); if (ls_len(p_ma->ma_calls)>1 && !p_md->md_isman) lr_err(&p_md->md_ps, "This macro is used more than once (and has no @M)."); } } /******************************************************************************/ LOCAL void chk_rec P_((void)); LOCAL void chk_rec() /* This macro analyses the calls between the macros in the macro */ /* table and flags all recursive macros with an error message. */ /* */ /* Def: A macro is a "level 0 macro" if it does not call any macros. */ /* Def: A macro is a "level n macro" if it calls at least one macro of level */ /* n-1, but does not call any macros of level n or higher. */ /* Def: A macro is a "level infinity macro" if it directly or indirectly */ /* calls itself. */ /* */ /* This function totally ignores undefined macros. This means that it can be */ /* invoked even if problems are detected by the other checks. */ /* */ /* Although the actions here may seem rather time expensive, they may not */ /* be. The function repeatedly runs through the macro table and each macro's */ /* bodypart list and expression lists. However, there are not likely to be */ /* many macros and each definition expression list is likely to be quite */ /* short, as each macro will be mainly text. */ /* Even if this stuff does take a while, it is better to detect recursion now */ /* than at tangle time! */ { p_ma_t p_ma; /* General purpose pointer to macro. */ name_t dummy_name; /* Dummy name variable acts as a placeholder in calls. */ uword level; /* Level of macro currently being tagged. */ bool gotone; /* TRUE iff current loop iteration tagged >0 macros. */ /* We need a concrete number to stand for level infinity. */ /* 30000 is a nice, large 15 bit number. */ #define LEVINF 30000 /* Make sure that our idea of infinity is big enough. */ as_cold(tb_len(macro_table)ma_level=LEVINF; gotone=TRUE; /* Work from level 0 upwards identifying macros of successive levels. */ for (level=0; levelma_level == LEVINF)) { p_md_t p_md = &p_ma->ma_defn[p_ma->ma_minlev]; p_bpls_t p_bpls = p_md->md_body; /* Run through each body part of the macro. */ ls_fir(p_bpls); while (TRUE) { p_bp_t p_bp; ls_nxt(p_bpls,PPV &p_bp); if (p_bp==NULL) break; /* Run through the list of expression elements. */ ls_fir(p_bp->bp_ex); while (TRUE) { p_el_t p_el; ls_nxt(p_bp->bp_ex,PPV &p_el); if (p_el==NULL) break; /* Don't tag anything that calls anything that isn't tagged. */ if ((p_el->el_kind==EL_INVC ) && (maisdef(p_el->el_p_mac) ) && (p_el->el_p_mac->ma_level==LEVINF)) goto nextmacro; } } /* If we got this far, then our macro must have called nothing but */ /* macros of levels [0,level-1]. Thus, we can tag it level 'level'. */ p_ma->ma_level=level; gotone=TRUE; } /* End if */ nextmacro:; } /* End while */ } /* End for loop. */ /* At this point, we have tagged all macros with their level number. Note */ /* that level infinity macros are discovered simply because they do not get */ /* tagged. The following loop flags all such recursive macros with errors. */ tb_fir(macro_table); while (tb_rea(macro_table,PV dummy_name,PV &p_ma)) if (maisdef(p_ma) && p_ma->ma_level==LEVINF) { p_md_t p_md = &p_ma->ma_defn[p_ma->ma_minlev]; lr_err(&p_md->md_ps,"This macro has an infinite expansion."); } /* Note: The above message is not "This macro is defined recursively", */ /* because this function catches not only recursive macros, but also all the */ /* non-recursive macros that call the recursive macros!! To detect only */ /* the recursive macros, we really ought to use Tarjan's algorithm for the */ /* detection of strongly connected components. However, I don't have the */ /* reference handy right now and I want to finish this version of FunnelWeb */ /* soon, so I'll leave the installation of Tarjan's algorithm as a possible */ /* future enhancement. Then the error message can be changed. */ } /******************************************************************************/ EXPORT void analyse() { name_t dummy_name; p_ma_t p_ma; /* Issue an error if there are no macros. */ if (tb_len(macro_table)==0) { char *m="E: No macros defined."; wl_l(m); if (option.op_s_b) wl_sj(m); num_err++; } /* Issue an error if there are no product (output) files. */ if (tb_len(file_table)==0) { char *m="E: No output files specified."; wl_l(m); if (option.op_s_b) wl_sj(m); num_err++; } /* Take a look at each macro and issue appropriate diagnostics. */ tb_fir(macro_table); while (tb_rea(macro_table,PV dummy_name,PV &p_ma)) chk_mac(p_ma); /* Check for recursive macros. */ chk_rec(); /* Run through the document list and flag any sections that still have not */ /* been given names. */ ls_fir(document_list); while (TRUE) { p_dc_t p_dc; ls_nxt(document_list,PPV &p_dc); if (p_dc==NULL) break; if (p_dc->dc_kind==DC_TYPE && p_dc->dc_pty->ty_kind==TY_NSEC && !p_dc->dc_pty->ty_isnam) { lr_err(&p_dc->dc_ps,"This section has no name."); lr_mes(&p_dc->dc_ps,"You can give it one explicitly (As in @A@) or implicitly by"); lr_mes(&p_dc->dc_ps,"defining a macro (whose name will be inherited) within the section."); } } } /******************************************************************************/ /* End of ANALYSE.C */ /******************************************************************************/ ************/ #include "style.h" #include "analyse.h" #include "as.h" #include "data.h" #include "lister.h" #include "misc.h" #include "table.h" /******************************************************************************/ LOCAL void chk_mac P_((p_ma_t)); LOCAL void chk_mac (p_ma) p_ma_t p_ma; { mc_t *call; p_md_t p_md; /* Deal with undefined macros by flagging the first invocafw_src/source/analyse.h 644 0 0 5471 6716661006 10414 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* ANALYSE.H */ /******************************************************************************/ /* */ /* This package exports a single function called analyse() that should be */ /* invoked just after the parser has finished. The scanner and parser */ /* serve only to construct a structured representation of the input file in */ /* memory; they do not critique it beyond syntax. In contrast, analyse() */ /* analyses the representation, checking it for "semantic" errors. Any */ /* problems that are found are sent to the lister package with appropriate */ /* positioning information so that the messages appear at exactly the right */ /* spot in the listing. */ /* */ /******************************************************************************/ #include "style.h" /******************************************************************************/ EXPORT void analyse P_((void)); /******************************************************************************/ /* End of ANALYSE.H */ /******************************************************************************/ el infinity macro" if it directly or indirectly */ /* calls itself. */ /* fw_src/source/as.c 644 0 0 4265 6716661011 7352 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* AS.C */ /******************************************************************************/ #include "style.h" #include "as.h" #include "machin.h" /******************************************************************************/ EXPORT void as_bomb(message) char *message; { fprintf(stderr,"%s\n",message); fprintf(stderr,"An assertion has failed! See the line above.\n"); fprintf(stderr,"Press return to abort FunnelWeb>\n"); (void) getchar(); exit(EXIT_FAILURE); } /******************************************************************************/ /* AS.C */ /******************************************************************************/ xt(p_bp->bp_ex,PPV &p_el); if (p_el==NULL) break; /* Don't tag anything that calls anything that isn't tagged. */ if ((p_el->el_kind==EL_INVC ) && (maisdef(p_el->el_p_mac) ) && (p_el->el_p_mac->ma_level==LEVINF)) fw_src/source/as.h 644 0 0 14133 6716661011 7372 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* AS.H */ /******************************************************************************/ /* */ /* ASSERTION PACKAGE */ /* ================= */ /* This package contains macros and functions that support assertions. An */ /* assertion is a boolean condition that is supposed always to be true at a */ /* particular point during program execution. An assertion statement tests */ /* such a condition and bombs the program if it is false; better to be */ /* alerted to such a condition rather than suffer and erroneous execution. */ /* */ /* Standard C supports asertions with the header file providing */ /* the "assert" macro. Unfortunately, this does not meet the needs of */ /* FunnelWeb for two reasons: */ /* */ /* 1) Portability is emphasised in FunnelWeb and the assert macro is fairly */ /* recent. Its only argument is the boolean condition, which means that */ /* without the ANSI macros __FILE__ and __LINE__, the macro would be */ /* unable to indicate where an assertion failure occurred, in a non-ANSI */ /* environment. */ /* */ /* 2) There is only one assert macro and it can be either on or off, the */ /* implication being that in production code, it should be turned off. In */ /* contrast, the execution speed of the assert macro will usually matter */ /* only in a small portion of the code as, in most programs, a small */ /* portion of the code accounts for most of the execution time. By having */ /* two categories of assertion, we can leave most of the assertions turned */ /* on in the production program. */ /* */ /* This reasoning leads to the slightly different assertion facilty provided */ /* by this package. Here, there are two assertion routines/macros, HOT */ /* assertions for HOT code (code in a program hot spot) and COLD assertions */ /* for COLD code (not in a hot spot). Only the HOT assertions can be turned */ /* off. */ /* */ /******************************************************************************/ /* Ensure that the body of this header file is included at most once. */ #ifndef DONE_AS #define DONE_AS /******************************************************************************/ #include "style.h" /******************************************************************************/ /* The following #define determines whether hot assertions are to be turned */ /* on or off. Set to 0 for OFF and 1 for ON. */ /* Note: I have left hot assertions on in the production version as FunnelWeb */ /* doesn't go slowly enough to make me want to turn it off. */ #define AS_DOHOT 1 /******************************************************************************/ EXPORT void as_bomb P_((char *)); /* This function writes out its argument string and then bombs the program. */ /* It should be called at any point where it has been determined that an */ /* illegal condition has been detected. The other assertion routines/macros */ /* call this function. */ /* The following two macros define hot and cold assertions. Be sure never to */ /* call them with arguments with side effects! */ #define as_cold(e,s) {if (!(e)) as_bomb(s);} #if AS_DOHOT #define as_hot(e,s) {if (!(e)) as_bomb(s);} #define AS_HCODE(CODE) {CODE} #else #define as_hot(e,s) ((void) 0) #define AS_HCODE(CODE) ((void) 0) #endif /******************************************************************************/ /* For #ifndef preventing multiple inclusion of the body of this header file. */ #endif /******************************************************************************/ /* AS.H */ /******************************************************************************/ **********************************************************/ /* End of ANALYSE.H */ /******************************************************************************/ el infinity macro" if it directly or indirectly */ /* calls itself. */ /* fw_src/source/clock.c 644 0 0 7417 6716661013 10046 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* CLOCK.C */ /******************************************************************************/ #include "style.h" #include "as.h" #include "clock.h" #include "machin.h" /******************************************************************************/ #define MAGIC_HEAD (565854L) #define MAGIC_TAIL (256194L) /******************************************************************************/ LOCAL void ck_check P_((p_ck_t)); LOCAL void ck_check(p_ck) p_ck_t p_ck; { as_cold(p_ck!=NULL,"ck_check: Clock pointer is NULL."); as_cold(p_ck->ck_mhead==MAGIC_HEAD, "ck_check: Magic number at head of record is incorrect."); as_cold(p_ck->ck_mtail==MAGIC_TAIL, "ck_check: Magic number at tail of record is incorrect."); } /******************************************************************************/ EXPORT void ck_ini(p_ck) p_ck_t p_ck; { p_ck->ck_mhead = MAGIC_HEAD; p_ck->ck_run = FALSE; p_ck->ck_csum = 0.0; p_ck->ck_rsum = 0.0; /* ck_csta and ck_rsta are undefined in a stopped clock. */ p_ck->ck_mtail = MAGIC_TAIL; } /******************************************************************************/ EXPORT void ck_start(p_ck) p_ck_t p_ck; { ck_check(p_ck); as_cold(!p_ck->ck_run,"ck_start: Clock is already running!"); p_ck->ck_run = TRUE; p_ck->ck_csta = tim_cpu(); p_ck->ck_rsta = tim_real(); } /******************************************************************************/ EXPORT void ck_stop(p_ck) p_ck_t p_ck; { ck_check(p_ck); as_cold(p_ck->ck_run,"ck_stop: Clock is already stopped!"); p_ck->ck_run = FALSE; p_ck->ck_csum += tim_cpu () - p_ck->ck_csta; p_ck->ck_rsum += tim_real() - p_ck->ck_rsta; } /******************************************************************************/ EXPORT float ck_cpu(p_ck) p_ck_t p_ck; { ck_check(p_ck); as_cold(!p_ck->ck_run,"ck_cpu: Clock is running."); return p_ck->ck_csum; } /******************************************************************************/ EXPORT float ck_real(p_ck) p_ck_t p_ck; { ck_check(p_ck); as_cold(!p_ck->ck_run,"ck_real: Clock is running."); return p_ck->ck_rsum; } /******************************************************************************/ /* End of CLOCK.H */ /******************************************************************************/ e along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of thfw_src/source/clock.h 644 0 0 11707 6716661014 10071 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* CLOCK.H */ /******************************************************************************/ /* */ /* This package implements a clock abstraction that is used to generate */ /* timing statistics which are useful for performance tuning. The package */ /* allows the measurement of both real and CPU time. This package gets its */ /* raw information from the tim_cpu() and tim_real() functions of the machine */ /* dependent module "machin". */ /* */ /******************************************************************************/ /* Ensure that the body of this header file is included at most once. */ #ifndef DONE_CLOCK #define DONE_CLOCK /******************************************************************************/ #include "style.h" /******************************************************************************/ /* The following clock type is supposed to be an ADT so don't frob any of its */ /* fields manually! */ typedef struct { ulong ck_mhead; /* Magic number helps detect corruptions. */ bool ck_run; /* TRUE iff the clock is running. */ float ck_csum; /* Accumulated CPU time. */ float ck_rsum; /* Accumulated real time. */ float ck_csta; /* ck_run => CPU time when clock was started. */ float ck_rsta; /* ck_run => Real time when clock was started. */ ulong ck_mtail; /* Magic number helps detect corruptions. */ } ck_t; typedef ck_t *p_ck_t; /******************************************************************************/ EXPORT void ck_ini P_((p_ck_t)); /* Initializes the clock. After this call, the argument clock will be in the */ /* STOPPED state and all its registers will be zero. A clock must be */ /* initialized before any other operations are performed on it. */ EXPORT void ck_start P_((p_ck_t)); /* Changes the clock from the STOPPED state to the RUNNING state. Starts */ /* accumulating real time and CPU time on its registers. */ /* Raises an error if the clock is not in the STOPPED state. */ EXPORT void ck_stop P_((p_ck_t)); /* Changes the clock from the RUNNING state to the STOPPED state. Stops */ /* accumulating real time and CPU time on its registers. */ /* Raises an error if the clock is not in the RUNNING state. */ EXPORT float ck_cpu P_((p_ck_t)); /* Returns the number of seconds of CPU time accumulated on the clock. */ /* Raises an error if the clock is not in the STOPPED state. */ EXPORT float ck_real P_((p_ck_t)); /* Returns the number of seconds of real time accumulated on the clock. */ /* Raises an error if the clock is not in the STOPPED state. */ /******************************************************************************/ /* For #ifndef preventing multiple inclusion of the body of this header file. */ #endif /******************************************************************************/ /* End of CLOCK.H */ /******************************************************************************/ fw_src/source/command.c 644 0 0 213237 6717362034 10432 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. 08-May-1999 RNW Added op_t_b. Split weave call into weaveh/weavet calls 11-May-1999 RNW Modified startup message. 11-May-1999 RNW Mod so if no args, executes init file rather than error. 11-May-1999 RNW Added termination message for Macintosh. 12-May-1999 RNW Fixed bug in do_diff when file can't be opened. ##############################################################################*/ /******************************************************************************/ /* COMMAND.C */ /******************************************************************************/ #include #include "style.h" #include "analyse.h" #include "as.h" #include "command.h" #include "data.h" #include "dump.h" #include "lister.h" #include "memory.h" #include "mapper.h" #include "misc.h" #include "option.h" #include "parser.h" #include "scanner.h" #include "tangle.h" #include "weaveh.h" #include "weavet.h" /******************************************************************************/ /* Because FunnelWeb has so many options ,it is convenient to allow the user */ /* to construct a startup file. This is its name. */ #define INITFILE "fwinit.fws" /* Set this to TRUE for memory debugging. */ #define MEM_REPORT FALSE /******************************************************************************/ /* Three variables hold options information in FunnelWeb. */ /* 'p_comopt' holds the options conveyed by the original raw command line. */ /* 'p_defopt' holds the options that are default in the FunnelWeb shell. */ /* 'option' is global and holds the options that have been specified for the */ /* current invocation of FunnelWeb proper. */ /* 'option' is global so here we see only 'p_comopt' and 'p_defopt'. */ LOCVAR op_t *p_comopt; /* Initial command line options. */ LOCVAR op_t *p_defopt; /* Default shell options. */ /* The FunnelWeb shell interpreter has many different commands and it is */ /* worth them sharing the same basic command line scanner. These two */ /* variables hold the numer of arguments and a pointer to strings holding */ /* copies of each argument. */ /* Note: The first argument is placed in arr_arg[0]. */ #define FWARG_MAX 5 LOCVAR uword arg_num; LOCVAR char *arg_arr[FWARG_MAX+1]; /* Is this +1 necessary? */ /* The FunnelWeb command interpreter allows 10 substitution strings. */ /* These strings are stored in the following array. */ #define NUM_SUBS (10+26) /* 0..9 and A..Z */ LOCVAR char *subval[NUM_SUBS]; LOCVAR ulong old_war; LOCVAR ulong old_err; LOCVAR ulong old_sev; /* The FunnelWeb script interpreter can echo (trace) each command before it */ /* executes it. Whether it does is determined by this variable. */ LOCVAR bool tracing; /* If this variable is set to true then the interpreter will not abort if the */ /* very next command (and that one only) generates an error or severe error. */ LOCVAR bool noabort; /* If the following boolean is true, the interpreter skips lines until it */ /* hits the HERE command. */ LOCVAR bool skipping; /* The following variables count how many times DIFF is invoked and how many */ /* times it succeeded. This allows us to output a summary at the end of the */ /* processing of the test suite. */ LOCVAR ulong difftotl = 0; LOCVAR ulong diffsucc = 0; /******************************************************************************/ /* Here are the prototypes for recursive or out-of-order functions. */ LOCAL void interstr P_((char *)); LOCAL void do_set P_((char *)); /******************************************************************************/ LOCAL char *sing P_((ulong,char *,char *)); LOCAL char *sing(num,sinstr,plustr) /* Return one or other string depending on whether first argument is singular.*/ ulong num; char *sinstr; char *plustr; { if (num==1) return sinstr; else return plustr; } /******************************************************************************/ LOCAL uword numpos P_((ulong,ulong,ulong)); LOCAL uword numpos(a,b,c) /* Returns the number of its arguments that are positive. */ ulong a,b,c; { uword result=0; if (a>0) result++; if (b>0) result++; if (c>0) result++; return result; } /******************************************************************************/ LOCAL void errsum P_((ulong,ulong,ulong,ulong)); LOCAL void errsum(fat,sev,err,war) /* Supply as arguments, the number of various kinds of diagnostics. */ /* Places in linet1 a string describing the diagnostics. */ ulong fat,sev,err,war; { char linet2[100]; if (fat+sev+err+war==0) {strcpy(linet1,"SUCCESS: No diagnostics."); return;} strcpy(linet1,"There "); /* "Was" or "were" depending on the plurality of highest level diagnostic. */ if (fat>0) strcat(linet1,sing(fat,"was","were")); else if (sev>0) strcat(linet1,sing(sev,"was","were")); else if (err>0) strcat(linet1,sing(err,"was","were")); else if (war>0) strcat(linet1,sing(war,"was","were")); else as_bomb("errsum: Error hierarchy failed!"); strcat(linet1," "); /* Fatal errors. */ if (fat>0) { sprintf(linet2,"%1lu Fatal error",fat); strcat(linet1,linet2); strcat(linet1,sing(fat,"","s")); } /* Joiner stuff. */ if (fat>0 && numpos(sev,err,war)>=2) strcat(linet1,", "); if (fat>0 && sev>0 && err==0 && war==0) strcat(linet1," and "); /* Severe errors. */ if (sev>0) { sprintf(linet2,"%1lu Severe error",sev); strcat(linet1,linet2); strcat(linet1,sing(sev,"","s")); } /* Joiner stuff. */ if (fat+sev>0 && err>0 && war >0) strcat(linet1,", "); if (fat+sev>0 && err>0 && war==0) strcat(linet1," and "); /* Errors. */ if (err>0) { sprintf(linet2,"%1lu Error",err); strcat(linet1,linet2); strcat(linet1,sing(err,"","s")); } /* Joiner stuff. */ if (fat+sev+err>0 && war>0) strcat(linet1," and "); /* Warnings. */ if (war > 0) { sprintf(linet2,"%1lu Warning",war); strcat(linet1,linet2); strcat(linet1,sing(war,"","s")); } /* The final full stop! */ strcat(linet1,"."); } /******************************************************************************/ LOCAL void allocarg P_((void)); LOCAL void allocarg() /* Some compilers don't allow much room for statics and so it is necessary to */ /* declare some variables as pointers and allocate them explicitly. This */ /* function allocates the command line argument array to point to strings. */ { uword i; for (i=0;i<=FWARG_MAX;i++) arg_arr[i]=(char *) mm_perm(sizeof(cl_t)); /* Also initialize the substitution strings. */ for (i=0;i COMLINE_MAX) goto toobig; while (*q!=EOS) *p++ = *q++; t++; } } *p=EOS; return; toobig: wl_sj("S: Expanded (i.e. after $1 etc) command line is too long."); num_sev++; strcpy(p,t); return; } /******************************************************************************/ LOCAL void fwonerun P_((void)); LOCAL void fwonerun() /* Performs a single run of FunnelWeb proper, using the global variable */ /* 'options' as the input command line. */ { fn_t lisnam; /* The following clocks record the time taken by various parts of FunnelWeb. */ ck_t mappck; ck_t scanck; ck_t parsck; ck_t analck; ck_t dumpck; ck_t lstrck; ck_t tangck; ck_t weavck; ck_t totlck; bool doweave = option.op_t_b || option.op_u_b; /* Intialize/zero all the clocks. */ ck_ini(&mappck); ck_ini(&scanck); ck_ini(&parsck); ck_ini(&analck); ck_ini(&dumpck); ck_ini(&lstrck); ck_ini(&tangck); ck_ini(&weavck); ck_ini(&totlck); /* Start the total time clock ticking. A total time clock is used to gather */ /* up the gaps between the invocations of the other clocks. */ ck_start(&totlck); ck_start(&lstrck); /* Establish the listing file output stream. */ strcpy(lisnam,""); /* Start with an empty string. */ fn_ins(lisnam,option.op_f_s); /* Insert input file name. */ fn_ins(lisnam,".lis"); /* Insert constant extension. */ fn_ins(lisnam,option.op_l_s); /* Insert command line spec. */ wf_ini(&f_l,option.op_l_b); /* Initialize the stream. */ wf_ope(&f_l,lisnam); /* Create the file. */ if (option.op_l_b && wf_err(&f_l)) { sprintf(linet1,"S: Error creating listing file \"%s\".",lisnam); wl_sj(linet1); wl_sj("Aborting..."); num_sev++; return; } wl_l("FUNNELWEB LISTING FILE"); wl_l("======================"); wl_l(""); /* Initialize the lister for this run. */ lr_ini(); ck_stop(&lstrck); /* Scanner comes first. */ ck_start(&scanck); scanner(&mappck,&scanck); ck_stop(&scanck); #if MEM_REPORT printf("After Scanner.\n"); mm_repo(); #endif /* Dump the line and token lists if requested. The scanner supplies sensible */ /* lists even if it encounters errors, so there is no danger here. */ ck_start(&dumpck); if (option.op_b2_b) dm_lnls(&f_l); if (option.op_b3_b) dm_tkls(&f_l); ck_stop(&dumpck); /* Invoke the parser if there were no serious scanner errors. */ if (num_sev+num_err==0) { ck_start(&parsck); parser(); ck_stop(&parsck); /* Only perform post parser dumps if the parser was run. */ ck_start(&dumpck); if (option.op_b4_b) dm_matb(&f_l); if (option.op_b5_b) dm_dcls(&f_l); ck_stop(&dumpck); } else { if (option.op_b4_b) wl_l("Macro table dump skipped (Parser was not invoked)."); if (option.op_b5_b) wl_l("Document list dump skipped (Parser was not invoked)."); } #if MEM_REPORT printf("After Parser.\n"); mm_repo(); #endif /* Invoke the macro structure analyser if still no errors. */ if (num_sev+num_err==0) { ck_start(&analck); analyse(); ck_stop(&analck); } /* The scanner, parser, and analyser send errors to the lister package. */ /* Send sorted listing to the listing file (and screen if desired). */ ck_start(&lstrck); if (option.op_l_b) lr_gen(&f_l,option.op_c_i); if (option.op_s_b) lr_gen(&f_s,option.op_s_i); if (option.op_s_b) lr_gen(&f_j,option.op_s_i); ck_stop(&lstrck); /* If the first stages went OK, invoke tangle and weave. */ if (num_sev+num_err==0) { if (option.op_o_b) { ck_start(&tangck); tangle(); ck_stop(&tangck); } if (doweave) { ck_start(&weavck); if (option.op_u_b) weaveh(); if (option.op_t_b) weavet(); ck_stop(&weavck); } /* Leave output lines from Tangle and Weave joined, but separate them */ /* from any further output. */ if (doweave || option.op_o_b) wl_sjl(""); } else { /* Otherwise tell the user that back-end phases will be skipped. */ if ( option.op_o_b || doweave) { if (num_sev+num_err==1) wr_sjl("Error caused "); else wr_sjl("Errors caused "); } if ( option.op_o_b && doweave) wr_sjl("tangle and weave phases"); if ( option.op_o_b && !doweave) wr_sjl("tangle phase"); if (!option.op_o_b && doweave) wr_sjl("weave phase"); if ( option.op_o_b || doweave) {wl_sjl(" to be skipped."); wl_sjl("");} } ck_stop(&totlck); /* If requested write out a summary of the time taken. */ if (option.op_b6_b) dm_times(&f_l, &mappck,&scanck,&parsck,&analck, &dumpck,&lstrck,&tangck,&weavck,&totlck); /* Write out a line summarizing the diagnostics for this run. */ errsum(0L,num_sev,num_err,num_war); wl_sjl(linet1); /* Close the listing file. */ if (!option.op_l_b) goto finishoff; if (wf_err(&f_l)) { wl_sj("S: Error writing to listing file. Aborting..."); num_sev++; goto finishoff; } wf_clo(&f_l); if (wf_err(&f_l)) { wl_sj("S: Error flushing and closing listing file. Aborting..."); num_sev++; } finishoff: /* VERY IMPORTANT: Ask the memory management package to free up all the */ /* temporary memory (allocated using mm_temp) that has been allocated. This */ /* ensures that the memory allocated for this FunnelWeb run will be recycled.*/ mm_zapt(); } /* End of fwonerun */ /******************************************************************************/ LOCAL void do_absen P_((void)); LOCAL void do_absen () { if (arg_num != 2) { wl_sj("S: The ABSENT command requires exactly one argument."); num_sev++; return; } if (fexists(arg_arr[1])) { sprintf(linet1,"S: ABSENT found \"%s\".",arg_arr[1]); wl_sj(linet1); num_sev++; return; } } /******************************************************************************/ LOCAL void do_cody P_((void)); LOCAL void do_cody () /* The CODIFY command takes an input text file and generates an output text */ /* file containing C code to write out the input text file. The need for this */ /* command springs from the weaver. Experience with FunnelWeb showed that use */ /* of a separate header file, to be included, while apparently sensible, */ /* caused no end of problems. In particular, problems with portably */ /* specifying where the header file should be found. In the end, it was */ /* decided that it would be better to write the header file out with the */ /* weave output. As the header file is quite long, it is best to automate the */ /* process of converting the file from text to C code to write out the text. */ /* That is what the CODIFY command does. */ { FILE *file1; FILE *file2; #define MAXHACK 1000 char hackline[MAXHACK+1]; uword lineno; if (arg_num != 3) { wl_sj("S: The CODIFY command requires exactly two arguments."); num_sev++; return; } /* Open the input file for text reading. */ file1=fopen(arg_arr[1],"r"); if (file1 == FOPEN_F) { wl_sj("S: Error opening the input file."); num_sev++; return; } file2=fopen(arg_arr[2],"w"); if (file2 == FOPEN_F) { fclose(file1); wl_sj("S: Error creating the output file."); num_sev++; return; } lineno=0; /* PROCESS A SINGLE LINE PER ITERATION. */ while (TRUE) { uword linelength; uword i; /* Read in a line of input and terminate loop if there are no more lines. */ fgets(hackline,MAXHACK,file1); if (ferror(file1)) {wl_sj("S: Error reading the input file.");num_sev++;return;} if (feof(file1)) break; lineno++; /* Complain if the input line is too long. */ if (strlen(hackline)>81) { sprintf(linet1,"Line %lu of input file is too long.", (ulong) strlen(hackline)); wl_sj(linet1); wl_sj("The maximum allowable length is 80 characters."); num_sev++; return; } /* Write the start-of-line string. */ if (fputs(" WX(\"",file2) == FPUTS_F) goto write_failure; /* Write out the line in sanitized form. */ linelength=strlen(hackline); for (i=0;i 5) { wl_sj("S: The DIFF command must be given either 3 or 4 arguments."); wl_sj(" Usage: diff f1 f2 logfile [abort]"); num_sev++; return; } /* Check that the fourth argument, if present, is legal. */ diffabort=FALSE; if (arg_num == 5) if (strcmp(arg_arr[4],"ABORT")==0 || strcmp(arg_arr[4],"abort")==0) diffabort=TRUE; else { wl_sj( "S: The DIFF command's fourth argument, if present, must be ABORT."); wl_sj(" Usage: diff f1 f2 logfile [abort]"); num_sev++; return; } /* Now open the log file to append result of compare. */ logfile=fopen(arg_arr[3],"a"); if (logfile == FOPEN_F) { wl_sj("S: DIFF: Error opening the log file (to append result of compare)."); num_sev++; return; } /* The following define simplifies writing to the log file. */ #define LOGLINE {if (fputs(linet1,logfile) == FPUTS_F) badwrite=TRUE;} #define LOGSTR(STR) {if (fputs((STR),logfile) == FPUTS_F) badwrite=TRUE;} #define LOGCHAR(CH) {if (fputc((CH),logfile) == FPUTC_F) badwrite=TRUE;} /* Write the header for this comparison to the log file. */ sprintf(linet1,"\n\n" ); LOGLINE; sprintf(linet1,"Comparing \"%s\"\n" ,arg_arr[1]); LOGLINE; sprintf(linet1," with \"%s\".\n",arg_arr[2]); LOGLINE; /* Now map in the two files to be compared. */ /* Once this is done, we MUST do a mm_zapt later or memory will leak. */ /* We attempt to map the second file, even if the first mapping has failed */ /* as, if the first file is absent, there is a good chance that the second */ /* is absent too, and it is useful to the user to know this. */ mess1=map_file(arg_arr[1],&p_file1,&len_file1); mess2=map_file(arg_arr[2],&p_file2,&len_file2); if (mess1 != NULL) { sprintf(linet1,"Error mapping \"%s\".\n",arg_arr[1]); LOGLINE; wr_sj("E: DIFF: "); wr_sj(linet1); sprintf(linet1," %s\n",mess1); LOGLINE; wr_sj(linet1); num_err++; } if (mess2 != NULL) { sprintf(linet1,"Error mapping \"%s\".\n",arg_arr[2]); LOGLINE; wr_sj("E: DIFF: "); wr_sj(linet1); sprintf(linet1," %s\n",mess2); LOGLINE; wr_sj(linet1); num_err++; } if ((mess1 != NULL) || (mess2 != NULL)) { is_same = FALSE; is_image = FALSE; goto frombadmap; } /* At this point the two files to be compared are sitting in memory and we */ /* have a ready-for-writing log file. We are now ready to compare. */ /* First perform a binary image comparison as a check for later. */ /* We could do this later, but it is better to do this now, in case the */ /* complicated comparison code somehow corrupts one of the images. */ is_image= ((len_file1 == len_file2) && (memcmp(p_file1,p_file2,(size_t) len_file1) == 0)); /* This anonymous block performs the actual comparison. */ { /* The comparison is performed by scrolling the two input files through two */ /* fixed-length line buffers (buf1 and buf2 - see below). To avoid copying, */ /* the buffers are made circular. Processing takes place by comparing the */ /* first line of each buffer. If the line is the same, the buffers are */ /* scrolled by one line. If they are different, then we have encountered a */ /* DIFFERENCES SECTION and we have to compare lines near the top of the */ /* buffers to find a match. When a match is found, each buffer is scrolled */ /* down to its match point and processing continues. */ /* LBUFSIZ is the number of number of lines that each buffer can hold. */ /* Lines are indexed from [0,LBUFSIZ-1]. */ /* WARNING: LBUFSIZ must be a power of two corresponding to WRAP(X). */ /* WARNING: Totally different input files will provoke O(LBUFSIZ^2) */ /* checksum comparisons per LBUFSIZ input lines. */ /* WRAP(X) is a macro that performs wraparound of buffer indices. */ /* GAP is the number of lines that have to match to end a diff section. */ /* MAXDIST is the maximum "distance" that is tested when matching. */ #define LBUFSIZ 64 #define WRAP(X) ((X) & 0x3F) #define GAP 3 #define MAXDIST (LBUFSIZ-GAP) /* The following macro compares two lines in the buffers. */ /* The arguments are absolute buffer indices, not relative ones. */ /* We assume that checksums will mismatch more often than line lengths. */ #define COMPLINE(INDA,INDB) \ ((buf1[INDA].c_line == buf2[INDB].c_line) && \ (buf1[INDA].l_line == buf2[INDB].l_line) && \ (memcmp(buf1[INDA].p_line,buf2[INDB].p_line, \ (size_t) buf1[INDA].l_line)==0)) /* The two line buffers buf1 and buf2 (see below) don't actually store */ /* lines. Instead they store line structures which store pointers to the */ /* lines in the mapped images of the files. They also store the length of */ /* each line, and a checksum of the line. The checksum is useful for */ /* speeding up the comparisons between lines when processing a differences */ /* section. */ typedef struct { char *p_line; /* Pointer to first byte in the line. */ ulong l_line; /* Number of bytes in the line. */ uword c_line; /* Checksum of the line. */ } line_t; char *p_next1 = p_file1; /* Points to next line in file1. */ char *p_next2 = p_file2; /* Points to next line in file2. */ char *p_post1 = p_file1+len_file1; /* Byte following image of file1. */ char *p_post2 = p_file2+len_file2; /* Byte following image of file2. */ line_t buf1[LBUFSIZ]; /* Comparison buffer for first file. */ line_t buf2[LBUFSIZ]; /* Comparison buffer for second file. */ ulong buf1top = 0; /* Index of first line in first buffer. */ ulong buf2top = 0; /* Index of first line in second buffer. */ ulong buf1fil = 0; /* Number of lines in first buffer. */ ulong buf2fil = 0; /* Number of lines in second buffer. */ ulong topnum1 = 1; /* Line number of first line of first buffer. */ ulong topnum2 = 1; /* Line number of first line of second buffer. */ /* The following loop compares the line(s) at the top of the two buffers */ /* and processes (lines1,lines2) lines of each. */ while (TRUE) { ulong lines1; /* Lines of file1 processed during this loop iteration. */ ulong lines2; /* Lines of file2 processed during this loop iteration. */ ulong d,g; /* Used in comparison loops. */ /* The first thing we do is to fill each buffer as full as possible. At */ /* the end of the next two lumps of code, the only reason that a file's */ /* is not full is that we have reached the end of the file. */ /* Fill the first buffer as full as possible. */ while ((buf1fil < LBUFSIZ) && (p_next1 != p_post1)) { ulong ind = WRAP(buf1top + buf1fil); ulong len = 0; uword csum = 0; char *p_lin = p_next1; while (TRUE) { if (p_next1 == p_post1) break; len++; csum=(csum+*p_next1++) & 0xFFFF; if (*(p_next1-1) == EOL) break; } buf1[ind].p_line = p_lin; buf1[ind].l_line = len; buf1[ind].c_line = csum; buf1fil++; } /* Fill the second buffer as full as possible. */ while ((buf2fil < LBUFSIZ) && (p_next2 != p_post2)) { ulong ind = WRAP(buf2top + buf2fil); ulong len = 0; uword csum = 0; char *p_lin = p_next2; while (TRUE) { if (p_next2 == p_post2) break; len++; csum=(csum+*p_next2++) & 0xFFFF; if (*(p_next2-1) == EOL) break; } buf2[ind].p_line = p_lin; buf2[ind].l_line = len; buf2[ind].c_line = csum; buf2fil++; } /* If the buffers are empty then we must be at the end of each file. */ if (buf1fil==0 && buf2fil==0) break; /* Try to peel a pair of matching lines off the top of the buffer. */ /* If we succeed, zip down to the end of the loop and flush them. */ /* We can't integrate this code into the next part because the next part */ /* requires GAP matches, whereas here we require just one. */ if ((buf1fil>0) && (buf2fil>0) && COMPLINE(buf1top,buf2top)) {lines1=lines2=1; goto flushlines;} /* At this point, we know we have a differences section. */ anydiff=TRUE; /* We now compare the top lines of the two buffers for a match. A match */ /* is only considered to have been found if we match GAP consecutive */ /* lines. The best match minimizes the DISTANCE which is the sum of the */ /* offsets (lines1,lines2) (in lines) from the top of each buffer where */ /* the match starts. Even better matches minimize abs(lines1-lines2) as */ /* well. All these nested loops are to ensure that we search best first. */ for (d=1;d<=MAXDIST;d++) { /* Calculate half distance on the high side. */ long half = (d/2)+1; long off; long sign_v; /* Explore up and down simultaneously from the halfway mark. */ for (off=0;off<=half;off++) for (sign_v= -1;sign_v<2;sign_v+=2) { long x = half + sign_v*off; /* The following test allows the above loops to be sloppy. */ if (0<=x && x<=d) { lines1=x; lines2=d-lines1; /* We now know that we want to test at (lines1,lines2). */ /* So compare the GAP lines starting at those positions. */ /* Note: lines1 and lines2, as well as being the number */ /* of lines processed, are also the offset to the first */ /* match line in our match gap. */ for (g=0;g=buf1fil) && (t2r>=buf2fil)) continue; /* If just one of the files has run out it's a mismatch. */ if ((t1r>=buf1fil) || (t2r>=buf2fil)) goto gapfail; /* We now know that we have two real lines. Compare them. */ /* Variables are to avoid big nested macro expansions. */ t1a = WRAP(buf1top+t1r); t2a = WRAP(buf2top+t2r); if (!COMPLINE(t1a,t2a)) goto gapfail; } /* If we dropped out of the gap loop, we must have found */ /* GAP consecutive matches. So we can run off and write out */ /* the difference section. */ goto writediff; /* Here's where we jump if we found a mismatch during gap */ /* looping. All we do is try next pair of offsets. */ gapfail:; } /* End sloppy if. */ } /* End for sign_v. */ } /* End for distance loop. */ /* If we got to here then we must have dropped out of the search loop */ /* which means that there must have been no match at all between the */ /* buffers. The only thing to do is to write out what we have as */ /* a differences section. */ lines1=buf1fil; lines2=buf2fil; /* Write out the differences section (lines1,lines2) to the log file. */ writediff: { /* Begin writediff */ ulong i,j; LOGSTR("\n"); LOGSTR(" +-----\n"); for (i=0;i>\n"); /* If we had problems with the log file at any stage, kick up a fuss now. */ if (badwrite) {wl_sj("S: DIFF: Error writing to log file."); num_sev++;} /* Close the log file. */ if (fclose(logfile) == FCLOSE_F) {wl_sj("S: DIFF: Error closing the log file."); num_sev++;} /* The above code is quite tricky and there is a chance that it contains */ /* bugs. So, as a safety check we compare the results from the binary memory */ /* image comparison performed earlier and the more complicated text */ /* comparison above. If they differ, then it's time to go kaboom. */ if (is_image && !is_same) as_bomb("do_diff: Image comparison succeeded, but text comparison failed."); if (!is_image && is_same) as_bomb("do_diff: Image comparison failed, but text comparison succeeded."); /* If files are non-same and ABORT option is turned on, set severe status. */ if (!is_same && diffabort) { wl_sj( "S: DIFF: Files have not been proven identical, and ABORT option is on."); num_sev++; } /* Tell the console whether comparison succeeded. */ if (compared) { if (is_same) wl_sj("The two files are IDENTICAL."); else wl_sj("The two files are DIFFERENT (see the differences file for the details)."); } /* Increment the difference summary counters. */ difftotl++; if (is_same) diffsucc++; } /******************************************************************************/ LOCAL void do_dsum P_((void)); LOCAL void do_dsum () { sprintf(linet1,"Summary of Differences"); wl_sj(linet1); sprintf(linet1,"----------------------"); wl_sj(linet1); sprintf(linet1,"Identical = %lu.",(ulong) diffsucc); wl_sj(linet1); sprintf(linet1,"Different = %lu.",(ulong) (difftotl-diffsucc)); wl_sj(linet1); sprintf(linet1,"Total = %lu.",(ulong) difftotl); wl_sj(linet1); } /******************************************************************************/ LOCAL void do_dzer P_((void)); LOCAL void do_dzer () /* Zaps difference counters. */ { difftotl = 0; diffsucc = 0; } /******************************************************************************/ LOCAL void do_eneo P_((void)); LOCAL void do_eneo () { if (arg_num != 2) { wl_sj("S: The ENEO command must be given exactly one argument."); num_sev++; return; } if (fexists(arg_arr[1])) if (remove(arg_arr[1]) != REMOVE_S) { sprintf(linet1,"S: ENEO failed to delete \"%s\".",arg_arr[1]); wl_sj(linet1); num_sev++; return; } } /******************************************************************************/ LOCAL void do_exec P_((void)); LOCAL void do_exec () { uword i; if (arg_num < 2) { wl_sj("S: The EXECUTE command requires at least one argument."); num_sev++; return; } if (arg_num > 10) { wl_sj("S: The EXECUTE command can have at most nine arguments."); num_sev++; return; } /* Zap all the numeric arguments. */ for (i=0; i<10; i++) subval[i][0]=EOS; /* Copy the arguments over to the $1 $2 etc substitution variables. */ for (i=1;i0 && (isascprn(ch) || seen[ch])) { if (fputc(EOL,tmpfile) == FPUTC_F) goto write_failure; for (i=0;i0) {if (fputc(EOL,tmpfile) == FPUTC_F) goto write_failure;} if (fflush(tmpfile) != FFLUSH_S) {wl_sj("S: FIXEOLS: Error flushing the temporary output file.");num_sev++;return;} if (fclose(infile) == FCLOSE_F) {wl_sj("S: FIXEOLS: Error closing the input file.");num_sev++;return;} if (fclose(tmpfile) == FCLOSE_F) {wl_sj("S: FIXEOLS: Error closing the temporary output file.");num_sev++;return;} /* If renaming to the input file, we have to delete the input file first. */ if (arg_num==2) { status=remove(arg_arr[1]); if (status != REMOVE_S) { wl_sj("S: FIXEOLS: Error deleting existing input file to replace it"); wl_sj(" with the temporary output file. Deleting temporary and aborting..."); remove(p_temp); num_sev++; return; } } /* Rename the temporary file to the target output file. */ status=rename(p_temp,p_target); /* Do the error checking. */ if (status != RENAME_S) { wl_sjl("S: FIXEOLS: Error renaming temporary output file to output file."); sprintf(linet1,"Temporary file name was \"%s\".",p_temp); wl_sjl(linet1); sprintf(linet1,"Output file name was \"%s\".",p_target); wl_sjl(linet1); wl_sjl("FunnelWeb will leave both files intact so you can look at them."); num_sev++; return; } return; write_failure: wl_sj("S: FIXEOLS: Error writing the output file.");num_sev++;return; #endif } /******************************************************************************/ LOCAL void do_fweb P_((char *)); LOCAL void do_fweb(p_cl) /* This function performs a single run of FunnelWeb proper. */ char *p_cl; { op_t saveop; /* Do set can do all the work for us. However, it operates on p_defopt so we */ /* have to do some juggling. */ ASSIGN(saveop,*p_defopt); do_set(p_cl); ASSIGN(option,*p_defopt); ASSIGN(*p_defopt,saveop); if (num_sev>0) return; /* do_set ensures that the user hasn't specified any action parameters such */ /* as +X and +K, but it necessarily doesn't check to make sure that the user */ /* has actually specified an input file! */ if (!option.op_f_b) { wl_sj("S: No input file specified in FW command."); num_sev++; return; } fwonerun(); } /******************************************************************************/ LOCAL void do_help P_((void)); LOCAL void do_help() { uword messno; if (arg_num == 1) { hel_wri(wr_sj,HL_MEN); return; } if (arg_num > 2) { wl_sj("S: The HELP command takes at most one argument."); num_sev++; return; } /* Translate message name to number. */ messno=hel_num(arg_arr[1]); if (messno == HL_ERR) { wl_sj( "S: Unrecognised help message name. Try just \"help\" for a list of names."); num_sev++; return; } hel_wri(wr_sj,messno); } /******************************************************************************/ LOCAL void do_set(p_comlin) /* The SET command allows the user to specify default FunnelWeb options. */ char *p_comlin; { op_t tmpopt; /* Experiment with temporary options, not the real thing. */ ASSIGN(tmpopt,*p_defopt); /* Now execute the effect of the command line on 'p_defopt'. */ if (!op_add(&tmpopt,p_comlin,wr_sj)) { wl_s("This is a severe error (S). Aborting to FunnelWeb shell..."); num_sev++; return; } /* Now make sure that the user didn't specify an option to do with the */ /* entire FunnelWeb run and not just this invocation of FunnelWeb proper. */ if (tmpopt.op_j_b) { wl_s("S: You cannot invoke FunnelWeb with +J from the FunnelWeb shell."); wl_s(" To create a journal file, exit FunnelWeb and reinvoke with \"fw +j\"."); wl_s("This is a severe error. Aborting to FunnelWeb shell..."); num_sev++; return; } if (tmpopt.op_x_b) { wl_s("S: You cannot invoke FunnelWeb with +X from the FunnelWeb shell."); wl_s("Use the interactive command EXECUTE instead."); wl_s("This is a severe error. Aborting to FunnelWeb shell..."); num_sev++; return; } if (tmpopt.op_k_b) { wl_s("S: You cannot invoke FunnelWeb with +K from the FunnelWeb shell."); wl_s("This is a severe error. Aborting to FunnelWeb shell..."); num_sev++; return; } if (tmpopt.op_h_b) { wl_s("S: You cannot invoke FunnelWeb with +H from the FunnelWeb shell."); wl_s("Use the interactive command HELP instead."); wl_s("This is a severe error. Aborting to FunnelWeb shell..."); num_sev++; return; } /* If we get to here, the options must be OK so we can set them as default. */ ASSIGN(*p_defopt,tmpopt); } /******************************************************************************/ LOCAL void do_show P_((void)); LOCAL void do_show() /* The SHOW command writes out the current options. */ { if (arg_num != 1) { wl_sj("S: The SHOW command does not take arguments."); num_sev++; return; } wl_sj("Here are the FunnelWeb command line options that are"); wl_sj("current in this FunnelWeb session:"); op_wri(p_defopt,wr_sj); } /******************************************************************************/ LOCAL void do_stat P_((void)); LOCAL void do_stat () /* The status command checks the number of diagnostics generated by the run. */ { uword i; char *thing; ulong cnum; if (arg_num<1 || arg_num>4) { wl_sj("S: The STATUS command requires zero to three arguments."); num_sev++; return; } /* Zero arguments just means write out status. */ if (arg_num == 1) { sprintf(linet1,"Last command: Severes=%lu, Errors=%lu, Warnings=%lu.", (ulong) old_sev, (ulong) old_err, (ulong) old_war); wl_sj(linet1); sprintf(linet1,"Totals : Severes=%lu, Errors=%lu, Warnings=%lu.", (ulong) sum_sev, (ulong) sum_err, (ulong) sum_war); wl_sj(linet1); return; } /* More than one argument means CHECK status. */ for (i=1;i."); num_sev++; return; } if (sscanf(&arg_arr[i][1],"%u",&num) != 1) { sprintf(linet1, "S: Argument %u of STATUS command has bad number.", (unsigned) i); wl_sj(linet1); wl_sj(" Arguments must be of the form ('W'|'E'|'S')."); num_sev++; return; } switch(ch) { case 'W': cnum=old_war; thing="warnings"; break; case 'E': cnum=old_err; thing="errors" ; break; case 'S': cnum=old_sev; thing="severes" ; break; default : as_bomb("do_stat: case defaulted."); } if (cnum != num) { sprintf(linet1, "S: STATUS command detected wrong number of %s.",thing); wl_sj(linet1); sprintf(linet1, "Specifed %s=%u, Actual %s=%u.", thing,(unsigned) num,thing,(unsigned) cnum); wl_sj(linet1); num_sev++; } } } /******************************************************************************/ LOCAL void do_trace P_((void)); LOCAL void do_trace() { if (arg_num != 2) goto help; strupper(arg_arr[1]); if (strcmp(arg_arr[1],"OFF") == 0) {tracing=FALSE; return;} if (strcmp(arg_arr[1], "ON") == 0) {tracing=TRUE ; return;} help: wl_sj("S: The TRACE command has two forms:"); wl_sj(" TRACE OFF"); wl_sj(" TRACE ON"); num_sev++; return; } /******************************************************************************/ LOCAL void do_write P_((char *)); LOCAL void do_write(p) char *p; { uword len; /* Skip over the main command and the following blanks. */ while (*p!=' ' && *p!=EOS) p++; while (*p==' ') p++; /* Now make sure that the remaining string is delimited by double quotes. */ len=strlen(p); if ((*p != '\"') || (p[len-1] != '\"') || len<2) { wl_sj("W: The argument to WRITE should be delimited by double quotes."); wl_sj(p); num_war++; return; } /* Now temporarily hack out the quotes and write out the string. */ p[len-1]=EOS; wl_sj(p+1); p[len-1]='\"'; } /******************************************************************************/ LOCAL void do_writu P_((char *)); LOCAL void do_writu(p) char *p; { uword len; /* Skip over the main command and the following blanks. */ while (*p!=' ' && *p!=EOS) p++; while (*p==' ') p++; /* Now make sure that the remaining string is delimited by double quotes. */ len=strlen(p); if ((*p != '\"') || (p[len-1] != '\"') || len<2) { wl_sj("W: The argument to WRITEU should be delimited by double quotes."); wl_sj(p); num_war++; return; } /* Now temporarily hack out the quotes and write out the string. */ p[len-1]=EOS; wl_sj(p+1); p[len-1]='\"'; /* Now write out another line underlining the above. */ {uword i; for (i=0;i0) goto finished; /* Ignore commands consisting entirely of blanks (or empty commands). */ { char *s=p_command; while (*s==' ') s++; if (*s==EOS) goto finished; } /* Reject command lines beginning with a blank. */ if (p_command[0]==' ') { wl_sj("S: Leading blanks are not allowed in command lines."); num_sev++; goto finished; } /* Ignore command lines commencing with the comment character. */ if (p_command[0]=='!') {restdia(); goto finished;} /* Parse the command line into arguments. */ explode(p_command); /* Complain if there is no command verb. */ as_cold(arg_num>0,"do_command: zero arguments!"); /* It's convenient to have v pointing to verb. */ v=arg_arr[0]; /* Convert the verb to upper case. */ strupper(v); /* Execute the verb. */ if (strcmp(v,"HERE")==0) skipping=FALSE; else if (!skipping) if (strcmp(v,"ABSENT" )==0) do_absen(); else if (strcmp(v,"CODIFY" )==0) do_cody (); else if (strcmp(v,"COMPARE" )==0) do_comp (); else if (strcmp(v,"DEFINE" )==0) do_defin(&p_command[0]); else if (strcmp(v,"DIFF" )==0) do_diff(); else if (strcmp(v,"DIFFSUMMARY")==0) do_dsum(); else if (strcmp(v,"DIFFZERO" )==0) do_dzer(); else if (strcmp(v,"ENEO" )==0) do_eneo (); else if (strcmp(v,"EXECUTE" )==0) do_exec (); else if (strcmp(v,"EXISTS" )==0) do_exist(); else if (strcmp(v,"FIXEOLS" )==0) do_fix (); else if (strcmp(v,"FW" )==0) do_fweb (&p_command[0]); else if (strcmp(v,"HELP" )==0) do_help (); else if (strcmp(v,"QUIT" )==0) result=TRUE; else if (strcmp(v,"SET" )==0) do_set (&p_command[0]); else if (strcmp(v,"SHOW" )==0) do_show (); else if (strcmp(v,"SKIPTO" )==0) skipping=TRUE; else if (strcmp(v,"STATUS" )==0) do_stat (); else if (strcmp(v,"TOLERATE" )==0) noabort=TRUE; else if (strcmp(v,"TRACE" )==0) do_trace(); else if (strcmp(v,"WRITE" )==0) do_write(&p_command[0]); else if (strcmp(v,"WRITEU" )==0) do_writu(&p_command[0]); else { /* The following trace is likely to confuse beginners. */ /* sprintf(linet1,"Expanded command line=\"%s\".",p_command); */ /* wl_sj(linet1); */ wl_sj("S: Unknown command. Type HELP for a list of commands."); num_sev++; goto finished; } finished: sumdia(); return result; } /******************************************************************************/ LOCAL void interpret P_((FILE *,char *)); LOCAL void interpret(p_file,filnam) /* p_file must be a file opened for reading. The file's name must be supplied */ /* in filnam for error reporting reasons. The function reads each line from */ /* the file and feeds it to the FunnelWeb interpreter command executer. */ FILE *p_file; char *filnam; { ulong lineno=0; char *result; bool b; cl_t comline; char *p_comline; p_comline = &comline[0]; while (TRUE) { bool oldnoabort = noabort; noabort=FALSE; if (p_file == stdin || tracing) wr_sj("FunnelWeb>"); result=fgets(p_comline,(int) COMLINE_MAX,p_file); if (feof(p_file)) { sprintf(linet1,"",filnam); if (p_file == stdin || tracing) wl_sj(linet1); break; } if (ferror(p_file) || (result == FGETS_FE)) { sprintf(linet1,"F: Error reading command file \"%s\".",filnam); wl_sj(linet1); wl_sj("Aborting..."); sum_fat++; return; } if (p_file == stdin || tracing) wr_j(p_comline); if (p_file != stdin && tracing) wr_s(p_comline); lineno++; if (strlen(p_comline)==COMLINE_MAX) { sprintf(linet1,"F: Line %lu of command file \"%s\" is too long.", (unsigned long) lineno,filnam); wl_sj(linet1); wl_sj("Aborting..."); sum_fat++; return; } as_cold(p_comline[strlen(p_comline)-1]==EOL,"interpret: NO NEWLINE!"); p_comline[strlen(p_comline)-1]=EOS; as_cold(strlen(p_comline)0) break; if ((p_file != stdin) && (num_sev+num_err>0) && !oldnoabort) { wl_sj("Error caused termination of FunnelWeb shellscript."); break; } } } /******************************************************************************/ LOCAL void interstr(filnam) /* The 'interpret' function (above) interprets each line of a file already */ /* opened for reading. This function does a little more, opening and closing */ /* the file before and after calling 'interpret'. */ char *filnam; { FILE *p_file; fn_t fn; /* Set up a default of ".fws" as a file extension. */ strcpy(&fn[0],".fws"); /* Inherit the actual filename. */ as_cold(strlen(filnam)<=PATHNAME_MAX,"interstr: Filename blasted."); fn_ins(&fn[0],filnam); p_file=fopen(fn,"r"); if (p_file == FOPEN_F) { sprintf(linet1,"S: Error opening command file \"%s\".",fn); wl_sj(linet1); sum_sev++; return; } interpret(p_file,&fn[0]); if (sum_fat>0) return; if (fclose(p_file) == FCLOSE_F) { sprintf(linet1,"F: Error closing command file \"%s\".",fn); wl_sj(linet1); wl_sj("Aborting..."); sum_fat++; return; } } /******************************************************************************/ LOCAL void chk_cline P_((void)); LOCAL void chk_cline() /* Checks to make sure that the command line specifies exactly one action. */ { uword countopt=0; /* Count the number of active action options are turned on. */ if (p_comopt->op_f_b) countopt++; if (p_comopt->op_x_b) countopt++; if (p_comopt->op_k_b) countopt++; if (p_comopt->op_h_b) countopt++; if (countopt == 0) { wl_sj("Your command line does not specify an action."); wl_sj("Here some common ways of invoking FunnelWeb."); wl_sj(""); wl_sj(" fw filename Tangle filename.fw."); wl_sj(" fw filename +t Tangle and weave filename.fw"); wl_sj(" fw +k Enter interactive mode."); wl_sj(" fw +xfilename Execute FunnelWeb shellscript filename.fws."); wl_sj(" fw +h Display help information about FunnelWeb."); wl_sj(""); if (countopt == 0) wl_sj("F: Aborting because command line does not specify an action."); sum_fat++; } } /******************************************************************************/ LOCAL void open_j P_((void)); LOCAL void open_j() /* Creates and opens the journal file. Note that the journal output stream is */ /* established regardless of whether the user requested a journal file. The */ /* only difference is that if the user did not specify a journal file, the */ /* stream is created in error mode which means that it never actually writes. */ { fn_t jname; /* Establish the journal file output stream. */ strcpy(jname,""); /* Start with an empty string. */ fn_ins(jname,p_comopt->op_f_s); /* Insert input file name. */ fn_ins(jname,".jrn"); /* Insert file extension. */ fn_ins(jname,p_comopt->op_j_s); /* Insert command line spec. */ wf_ini(&f_j,p_comopt->op_j_b); /* Initialize the stream. */ wf_ope(&f_j,jname); /* Create the file. */ if (p_comopt->op_j_b && wf_err(&f_j)) { sprintf(linet1,"F: Error creating journal file \"%s\".",jname); wl_s(linet1); wl_s("Aborting..."); sum_fat++; return; } } /******************************************************************************/ LOCAL void close_j P_((void)); LOCAL void close_j() /* Closes the journal file. */ { if (!p_comopt->op_j_b) return; if (wf_err(&f_j)) { wl_s("F: Error writing to journal file. Aborting..."); sum_fat++; return; } wf_clo(&f_j); if (wf_err(&f_j)) { wl_s("F: Error flushing and closing journal file. Aborting..."); sum_fat++; return; } } /******************************************************************************/ LOCAL void cl_help P_((void)); LOCAL void cl_help () { uword messno; /* Translate message name to number. This ought to work, as the options */ /* package is already have supposed to have cleared this argument as OK. */ messno=hel_num(p_comopt->op_h_s); as_cold(messno!=HL_ERR,"cl_help: Unknown help argument."); /* Write out the message. */ hel_wri(wr_sj,messno); } /******************************************************************************/ EXPORT void command(p_comline) /* Execute the top level command line. This is the place where we do all the */ /* "once per shell" things as opposed to the "once per run" things. */ /* If a fatal error occurs, the correct course of action here is to increment */ /* sum_fat and return immediately. The main() function deals with delivering */ /* the correct return status to the operating system. */ char *p_comline; { bool initexists = fexists(INITFILE); old_war=old_err=old_sev=0; tracing=FALSE; noabort=FALSE; skipping=FALSE; /* Allocate space for command line arguments. */ allocarg(); /* Set up the standard output (stdout) screen (console) output stream. */ wf_ini(&f_s,TRUE); wf_att(&f_s,stdout); /* Parse the command line and place the information in p_comopt-> */ op_ini(p_comopt); if (!op_add(p_comopt,p_comline,wr_s)) {wr_s("F: Command line error. Aborting..."); sum_fat++; goto windup;} /* If the user asked for some peace and quiet by setting +Q, disable the */ /* console stream. Note: FunnelWeb main() always issues a message using a */ /* printf if any diagnostics have been generated. */ if (p_comopt->op_q_b) wf_ini(&f_s,FALSE); /* Create and open the journal file. */ open_j(); if (sum_fat>0) goto windup; /* Note: To change the version number you need only change this and a help message */ /* in help.c */ wl_sj("FunnelWeb Version 3.2 (May 1999)"); wl_sj("--------------------------------"); wl_sj("Copyright (c) Ross N. Williams 1992. All rights reserved."); wl_sj("See http://www.ross.net/funnelweb/ There is ABSOLUTELY NO WARRANTY."); wl_sj("You are welcome to distribute this software under certain conditions."); if (p_comopt->op_k_b) wl_sj("For more information, type HELP."); else wl_sj("For more information, use the +h (help) option (e.g. \"fw +h\")."); wl_sj(""); /* Ensure that the user has specified at least one action. */ /* However, there need be no action if there is an init file. */ if (!initexists) { chk_cline(); if (sum_fat>0) goto windup; } /* Establish the default options for the shell run (if any). */ /* Get rid of any options not to do with a single run of FunnelWeb proper. */ ASSIGN(*p_defopt,*p_comopt); p_defopt->op_j_b=FALSE; p_defopt->op_x_b=FALSE; p_defopt->op_k_b=FALSE; /* In the absence of everything else, command line options are run options. */ ASSIGN(option,*p_comopt); /* Execute initialization file if any. */ if (initexists) { wr_sj("Executing initialization file "); wr_sj(INITFILE); wl_sj("."); interstr(INITFILE); } /* Execute the specified actions. */ if (p_comopt->op_x_b) interstr(p_comopt->op_x_s); if (p_comopt->op_f_b) {zerdia(); fwonerun(); sumdia();} if (p_comopt->op_h_b) cl_help(); if (p_comopt->op_k_b) interpret(stdin,"standard_input"); /* If we weren't in onerun mode, give a grand summary of errors. */ if (p_comopt->op_k_b || p_comopt->op_x_b) { wr_sj("Final diagnostics totals: "); errsum(sum_fat,sum_sev,sum_err,sum_war); wl_sj(linet1); } #if OS_MAC wl_sj(""); wl_sj("FunnelWeb has completed. Please select QUIT from the FILE menu."); wl_sj("You will be asked whether you want to save this console output."); #endif /* Close the journal file. */ close_j(); if (sum_fat>0) goto windup; /* Check for errors on the screen stream (standard output). */ if (p_comopt->op_s_b && wf_err(&f_s)) { /* No point in trying to write a message to the screen! */ /* But we can at least register a fatal error. */ sum_fat++; } windup: /* If the user has set +Q to turn off screen output and one or more */ /* diagnostics have been generated, we need to break through to warn the */ /* user. */ { ulong sum_all=sum_fat+sum_sev+sum_err+sum_war; if (p_comopt->op_q_b && sum_all>0) { errsum(sum_fat,sum_sev,sum_err,sum_war); fprintf(stderr,"%s\n",linet1); } } } /******************************************************************************/ /* End of COMMAND.C */ /******************************************************************************/ har *filnam; { ulong lineno=0; char *result; bool b; cl_t comline; char *p_comline; p_comline = &comline[0]; while (TRUE) { bool oldnoabort = noabort; noabort=FALSE; if (p_file == stdin || tracing) wr_sj("FunnelWeb>"); result=fgets(p_comline,(int) COMLINE_MAX,p_file); if (feof(p_file)) { sprintf(lfw_src/source/command.h 644 0 0 5347 6716661017 10402 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* COMMAND.H */ /******************************************************************************/ /* */ /* The command package is the mover and shaker of FunnelWeb. It exports a */ /* single function, whose argument is the command line given to FunnelWeb */ /* when it is invoked at the operating system level. The command package */ /* routine examines the command line and executes it, possibly invoking a */ /* mini-interpreter or calling the different component of FunnelWeb in turn */ /* (e.g. the parser). */ /* */ /******************************************************************************/ #include "style.h" #include "machin.h" /******************************************************************************/ void command P_((p_cl_t)); /* Executes the command line which is passed as the argument. */ /******************************************************************************/ /* End of COMMAND.H */ /******************************************************************************/ **************************************************/ LOCAL void open_j P_((void)); LOCAL void open_j() /* Creates and opens the journal file. Note that the journal output stream is */ /* established regardless of whether the user requested a journal file. The */ /* only differenfw_src/source/data.c 644 0 0 3774 6716661020 7664 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* DATA.C */ /******************************************************************************/ /* The following definition causes the definitions in data.h to be treated */ /* as real meaty declarations and not wimpy "external" ones. */ #define EXTERN #include "data.h" /******************************************************************************/ /* End of DATA.C */ /******************************************************************************/ utpufw_src/source/data.h 644 0 0 65473 6717361732 7725 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. 08-May-1999 RNW Added TR_HTML symbol. 09-May-1999 RNW Added TK_LIBR token. 15-May-1999 RNW Increased the size of linet1. ##############################################################################*/ /******************************************************************************/ /* DATA.H */ /******************************************************************************/ /* */ /* This package (data.h, data.c) contains ALL of the global variables in */ /* FunnelWeb. Some of the FunnelWeb packages (e.g. the lister) harbour hidden */ /* static state variables which could be considered to be a global variable, */ /* but, these aside, this package contains all the variables that are used */ /* directly by more than one package. In many programs, it would likely be */ /* appropriate to have a separate package for each distinct group of shared */ /* data so that only those packages needing a particular group of data need */ /* see it. However, in FunnelWeb's case, the variables are so few, and their */ /* use so widespread that they are clustered here in one package for all to */ /* see. */ /* */ /* This package also contains type definitions for the central FunnelWeb data */ /* structures. */ /* */ /******************************************************************************/ /* Ensure that the body of this header file is included at most once. */ #ifndef DONE_DATA #define DONE_DATA /******************************************************************************/ #include #include #include #include "style.h" #include "clock.h" #include "list.h" #include "table.h" #include "option.h" #include "section.h" #include "writfile.h" /******************************************************************************/ /* */ /* DATA TYPES */ /* ========== */ /* The following section contains all the data types of the global variables. */ /* */ /******************************************************************************/ /* The following structure defines a position in the global listing of the */ /* input data by storing a line number and a column number. The line number */ /* is a global line number meaning that it increases continuously through */ /* the lines of included files. The first line is line number 1. The first */ /* (leftmost) column is column number 1. */ typedef struct { ulong ps_line; ulong ps_column; } ps_t ; typedef ps_t *p_ps_t; /* A pointer to a position is handy too! */ /******************************************************************************/ /* A macro name is represented simply as a character array. */ #define MACN_MAX 80 typedef char name_t[MACN_MAX+1]; typedef name_t *p_name_t; /******************************************************************************/ /* SC stands for SCrap of text. A scrap of text is a contiguous group of */ /* printable bytes in memory. The following structure defines such a group by */ /* storing a pointer to the first and last character of the scrap. */ /* The scrap must contain at least one character (i.e. sc_last>=sc_first). */ typedef struct { char *sc_first; /* Pointer to the first byte of the scrap. */ char *sc_last; /* Pointer to the last byte of the scrap. */ bool sc_white; /* TRUE iff the scrap consists entirely of whitespace. */ } sc_t; typedef sc_t *p_sc_t; /******************************************************************************/ /* LN stands for LiNe. This record holds global and local line numbers as */ /* well as a scrap that points to the line in question. The scanner (which */ /* generates this list) guarantees that the last character of the line scrap */ /* is an EOL. */ typedef struct { sc_t ln_body; /* Scrap pointing to the line. Line ends in EOL. */ ulong ln_global; /* Global line number of this line. */ ulong ln_local; /* Local line number of this line. */ } ln_t; /* The global line list is simply a list of lines of the following type. */ typedef p_ls_t p_lnls_t; /******************************************************************************/ /* The following enumerated type identifies a font. */ #define FT_NORM 1 #define FT_TITL 2 #define FT_STIT 3 /* The following enumerated type identifies a horizontal alignment. */ #define LR_LEFT 1 #define LR_RIGH 2 #define LR_CENT 3 /* We want to pack a font and an alignment into the tk_gen byte of the token */ /* record (we could create a new field, but as none of the other token kinds */ /* require an extra field, we choose to pack instead. The formula is this: */ /* Packed byte=LRFT_PACK*FONT+ALIGNMENT. */ #define LRFT_PACK 10 /******************************************************************************/ /* The following enumerated type identifies the kind of a token. */ #define TK_TEXT 1 /* Text segment. */ #define TK_NSEC 2 /* @A..New section. */ #define TK_MDEF 3 /* @$ Macro definition. */ #define TK_FDEF 4 /* @F File definition. */ #define TK_ONAM 5 /* @< Open name. */ #define TK_CNAM 6 /* @> Close name. */ #define TK_ODEF 7 /* @{ Open definition. */ #define TK_CDEF 8 /* @} Close definition. */ #define TK_OPAR 9 /* @( Open parameter list. */ #define TK_CPAR 10 /* @) Close parameter list. */ #define TK_COMA 11 /* @, Comma. */ #define TK_QUOT 12 /* @" Quote. */ #define TK_PARM 13 /* @1 Parameter. */ #define TK_ZERO 14 /* @Z Zero calls allowed. */ #define TK_MANY 15 /* @M Many calls allowed. */ #define TK_LIBR 16 /* @L Library macro. */ #define TK_NAME 17 /* @# Self contained name. */ #define TK_EMPH 18 /* @/ Emphasize text. */ #define TK_NPAG 19 /* @t..Newpage. */ #define TK_TOCS 20 /* @t..Table of contents. */ #define TK_SKIP 21 /* @t..Vertical skip. */ #define TK_TITL 22 /* @t..Title text. */ #define TK_EOF 23 /* End of file. */ typedef ubyte tk_k_t; /* The following structure conveys all the information about a single token. */ /* As well as the kind of token, the parser needs to know where the token is */ /* in the input file and what the text of the token is if it is a text token. */ /* Some other tokens have a numeric attribute associated with them and the */ /* tk_gen field provides a place for this. The attributes are: */ /* TK_PARM - The number of the parameter [1,9]. */ /* TK_NAME - The number of the character forming the name [0,255]. */ /* TK_NSEC - The level of the section [0,5]. 0=@*, 1=@A, 2=@B,..,5=@E. */ /* TK_SKIP - Number of millimetres to skip vertically [0,255]. */ /* TK_TITL - Font and alignment packed into byte as specified earlier. */ /* tk_sc is the text to be set as a title. */ typedef struct { tk_k_t tk_kind; /* Kind of this token. */ ps_t tk_ps; /* Position of the first character of this token. */ sc_t tk_sc; /* Scrap constituting token. */ ubyte tk_gen; /* General token attribute. */ } tk_t; typedef p_ls_t p_tkls_t; /* A list of tokens. */ /******************************************************************************/ typedef p_ls_t p_scls_t; /* List of scraps. */ typedef p_ls_t p_scll_t; /* List of list of scraps =TEXT. */ typedef p_ls_t p_ells_t; /* List of pointers to elements = EXPRESSION. */ typedef p_ls_t p_elll_t; /* List of list of pointers to elements. */ typedef p_ls_t p_ell3_t; /* List of list of list of pointers to elements. */ /******************************************************************************/ /* This structure's signature is BP for Body Part. FunnelWeb macros can */ /* be defined in a series of "+=" definitions scattered through the input */ /* file. The definition of the macro is the concatenation of all the parts. */ /* The contributory part of a part consists of a single expression. */ /* Throughout the document, body parts (definition parts) are numbered */ /* sequentially by a sequence number. */ typedef struct { p_ells_t bp_ex; /* Expression that is logically appended to definition. */ ulong bp_seq; /* Sequence number of body part. */ ps_t bp_ps; /* Position at which the definition appears. */ } bp_t; typedef bp_t *p_bp_t; /* A list of body parts constitutes the full body of a macro. */ typedef p_ls_t p_bpls_t; /******************************************************************************/ /* The following structure summarizes a macro CALL. Each macro table entry */ /* contains a field ma_calls which contains a list of these structures. The */ /* list is used to generate diagnostics (e.g. if a call has the wrong number */ /* of parameters) and also to give cross reference information in the typeset */ /* documentation. */ typedef struct { ulong mc_seq; /* Sequence number of body part containing call. */ ps_t mc_ps; /* Position at which the call occurred. */ ulong mc_npar; /* Number of parameters in call. */ } mc_t; typedef mc_t *p_mc_t; /* A list of calls summarizes the entire usage of a macro in a document. */ typedef p_ls_t p_mcls_t; /******************************************************************************/ /* This structure stores the definition of a single macro. The first field */ /* md_isdef indicates whether a definition for this macro has so far been */ /* seen. If it has, md_isdef=TRUE and the remaining fields are well defined. */ /* This definition is for a particular library level [0,5] only. */ typedef struct { bool md_isdef; /* TRUE iff the macro is defined. */ ps_t md_ps; /* isdef=> Position of first definition part. */ ubyte md_npar; /* isdef=> Number of params specified in defn. */ bool md_isadd; /* isdef=> TRUE iff additively defined. */ bool md_iszer; /* isdef=> TRUE iff zero calls allowed. */ bool md_isman; /* isdef=> TRUE iff many calls allowed. */ bool md_isfil; /* isdef=> TRUE iff macro is bound to an outp file. */ p_bpls_t md_body; /* isdef=> Body of the macro (list of parts). */ } md_t; typedef md_t *p_md_t; /******************************************************************************/ /* Each macro can have definitions at library levels [0,5]. */ #define MAXLIBLEV 5 /* The following structure contains the full information about a macro. */ typedef struct { name_t ma_name; /* Name of the macro. */ p_mcls_t ma_calls; /* List of calls of this macro in the document. */ md_t ma_defn[MAXLIBLEV+1]; /* Definitions of this macro. */ ubyte ma_minlev; /* Minimum level seen or MAXLIBLEV+1 if no def. */ p_ell3_t ma_actn; /* Used by tangle. List of actual parameter lists. */ uword ma_level; /* Used by analyser. Depth of deepest call. */ } ma_t; /* A pointer to the comprehensive macro structure defined above is the way */ /* that FunnelWeb refers to macros internally. */ typedef ma_t *p_ma_t; /******************************************************************************/ /* An expression consists of a sequence of ELEMENTS each of which can */ /* be one of three kinds: */ /* */ /* 1. A block of text. */ /* 2. An invocation of another macro. */ /* 3. A parameter of the current macro. */ /* */ /* The following enumerated type identifies one of these three alternatives. */ #define EL_TEXT 1 #define EL_INVC 2 #define EL_PARM 3 typedef ubyte el_k_t; /* The following rather messy structure contains information about a single */ /* element. As mentioned above, an element can be one of three kinds and the */ /* following structure should, strictly speaking, be defined as a C union so */ /* as to emphasize the mutually exclusive nature of most of its fields. */ /* At one stage this structure did contain a union, however, it introduced */ /* more mess than it brought clarity (because of the extra two subnames) and */ /* was eventually dropped. */ /* A few fields deserve some explanation: */ /* el_pretx and el_postx hold the exact whitespace appearing between */ /* actual parameters in a macro call. This enables the call to be */ /* formatted properly in the typeset output. */ /* el_which is part of the macro parameter element (e.g. @1) and points to */ /* the macro within which the @1 appears. Strictly speaking this should */ /* not be necessary, but it is convenient for the tangler to have this */ /* information when it is half way through expanding an expression. */ typedef struct { el_k_t el_kind; /* Indicates what kind of element structure holds. */ p_scls_t el_text; /* EL_TEXT => List of scraps forming a text chunk. */ p_ma_t el_p_mac; /* EL_INVC => Pointer to macro being invoked. */ p_elll_t el_parls; /* EL_INVC => List of actual parameters. */ p_scll_t el_pretx; /* EL_INVC => Text before each parameter. */ p_scll_t el_postx; /* EL_INVC => Text after each parameter. */ p_ma_t el_which; /* EL_PARM => Macro in which this element appears. */ ubyte el_parno; /* EL_PARM => Parameter number of this actual param. */ } el_t; typedef el_t *p_el_t; /******************************************************************************/ /* A document component (represented by the DC_ data structures (see below) */ /* can be one of three things: a lump of text, a typesetter-generic */ /* typesetting directive, or a macro definition. The second of these consists */ /* of a whole collection of typesetting commands and so rather than */ /* cluttering up the dc_ record, they have been separated out here. */ #define TY_NSEC 1 /* New section. */ #define TY_OLIT 2 /* Open literal. */ #define TY_CLIT 3 /* Close literal. */ #define TY_OEMP 4 /* Open emphasise. */ #define TY_CEMP 5 /* Close emphasise. */ #define TY_NPAG 6 /* New page. */ #define TY_TOCS 7 /* Table of contents. */ #define TY_SKIP 8 /* Skip vertical. */ #define TY_TITL 9 /* Title. */ typedef ubyte ty_k_t; typedef struct { ty_k_t ty_kind; /* Kind of this typesetting directive. */ sn_t ty_sn; /* TY_NSEC=> Hierarchical section number. */ bool ty_isnam; /* TY_NSEC=> TRUE iff the section is named. */ p_name_t ty_pname; /* TY_NSEC=> ty_isnam=> Name of section. */ uword ty_mm; /* TY_SKIP=> Millimetres to skip. */ ubyte ty_font; /* TY_TITL=> Font in which to write title. */ ubyte ty_align; /* TY_TITL=> Alignment with which to write title. */ sc_t ty_sc; /* TY_TITL=> Scrap that is title text. */ } ty_t; /* NOTE: A union in the above structure would improve memory consumption. */ typedef ty_t *p_ty_t; /******************************************************************************/ /* The document list contains a representation of the input document in the */ /* form in which it was fed to FunnelWeb. This structured representation of */ /* the input is used by the weaver to generate the typeset output. */ /* Here, a document is represented by a list of DOCUMENT COMPONENTs (DC) each */ /* of which contains information about a major chunk of the document. The */ /* following enumerated type dc_k_t (document component kind type) is used to */ /* indicate which kind of component each list element contains. */ #define DC_TEXT 1 /* Text component consists of a block of text. */ #define DC_TYPE 2 /* Typesettting component affecting document typesetting. */ #define DC_MACR 3 /* A MACRo definition. */ typedef ubyte dc_k_t; /* The following structure stores a single document component. Like the el_t */ /* type, the dc_t type should really be a union type, but a union construct */ /* has been avoided to make the naming simpler. */ typedef struct { ps_t dc_ps; /* Position of this component. */ dc_k_t dc_kind; /* Kind of this component. */ p_scls_t dc_text; /* DC_TEXT=> Text segment constituting this compnt. */ p_ty_t dc_pty; /* DC_TYPE=> Typesetting object record. */ p_ma_t dc_p_ma; /* DC_MACR=> Pointer to the macro defined. */ ubyte dc_mlev; /* DC_MACR=> Level of this macro definition. */ ulong dc_part; /* DC_MACR=> Part number of this part of macro defn. */ } dc_t; /* NOTE: A union in the above structure would improve memory consumption. */ typedef dc_t *p_dc_t; /* A list of document components constitutes the global document list */ /* declared later. */ typedef p_ls_t p_dcls_t; /******************************************************************************/ /* This enumerated type identifies a typesetter. */ /* TR_NONE - No specific typesetter specified. */ /* TR_TEX - The TeX typesetter. */ #define TR_NONE 1 #define TR_TEX 2 #define TR_HTML 3 /* Add more typesetters here later. */ typedef ubyte tr_k_t; /******************************************************************************/ /* */ /* VARIABLES */ /* ========= */ /* This section contains external declarations of the global variables. */ /* The global variables themselves appear in DATA.C. */ /* */ /******************************************************************************/ /* This #ifndef is part of a mechanism that makes the following definitions */ /* visible to other modules declared as "extern", and visible to data.c */ /* declared as ordinary declarations. This prevents inconsistencies. */ #ifndef EXTERN #define EXTERN extern #endif /* This global options variable holds the options that were transmitted to */ /* FunnelWeb proper through the command line. */ EXTERN GLOVAR op_t option; /* The following option variable is set by the scanner and is used by the */ /* tangler. It determines whether the tangler will use natural indenting. */ /* TRUE => Tangler should use space indenting. FALSE=>No indenting. */ EXTERN GLOVAR bool tgindent; /* The following option variable is set by the scanner and is used by the */ /* tangler. It sets a limit on the length of the lines of the product files */ /* generated by tangle. A value of TGMAXINF indicates that no checking need */ /* be performed. */ #define TGMAXINF (ULONG_MAX) EXTERN GLOVAR ulong tglinmax; /* The following variable is written by the scanner and read by weave. It */ /* stores the typesetter format possibly specified by the user in the input. */ EXTERN GLOVAR tr_k_t tr_codes; /* The following five lists and tables constitute the major data structures */ /* that are communicated between the major components of FunnelWeb. */ /* The TOKEN_LIST contains a tokenized representation of the input file. */ /* The LINE_LIST contains a list of the lines of the input file. */ /* The DOCUMENT_LIST contains a structured representation of the input file. */ /* The MACRO_TABLE describes the macros defined in the input file. */ /* The FILE_TABLE identifies macros that are connected to product files. */ /* Created By Used By */ /* ---------- ------- */ EXTERN GLOVAR p_tkls_t token_list; /* Scanner Parser */ EXTERN GLOVAR p_lnls_t line_list; /* Scanner Lister */ EXTERN GLOVAR p_dcls_t document_list; /* Parser Weaver */ EXTERN GLOVAR p_tb_t macro_table; /* Parser Tangler, Weaver */ EXTERN GLOVAR p_tb_t file_table; /* Parser Tangler, Weaver */ /* Three output streams are accessible globally. */ /* The SCREEN FILE is connected to standard output (the user screen). */ /* The JOURNAL FILE logs FunnelWeb command language transactions. */ /* The LISTING FILE is created by an single invocation of FunnelWeb proper. */ EXTERN GLOVAR wf_t f_s; /* Screen file. */ EXTERN GLOVAR wf_t f_j; /* Journal file. */ EXTERN GLOVAR wf_t f_l; /* Listing file. */ /* Many of the FunnelWeb IO functions accept a single string as a parameter. */ /* This means that sprintf and a temporary string must be used in order to */ /* produce parameterized formatted output. Rather than declare temporary */ /* strings in each local function, we declare them globally. */ EXTERN GLOVAR char linet1[10000+PATHNAME_MAX]; /* 15-May-1999 RNW Got a segmentation fault in the scanner under Red Hat */ /* Linux which has FILENAME_MAX==4095. So kicked linet1 size from 2000 to */ /* the current value just to be on the safe side. */ /* HACKATTACK: Eliminate all fixed array bounds from FunnelWeb. */ /* Definitions of Diagnostic Levels */ /* -------------------------------- */ /* A WARNING has no effect except to cause a message to be issued. */ /* An ERROR causes FunnelWeb to abort to the shell at the end of the phase. */ /* Example: An error during scanning means that the FunnelWeb run will */ /* terminate to the shell at the end of the scanning phase. */ /* A SEVERE ERROR causes FunnelWeb to abort to the shell immediately. */ /* A FATAL ERROR causes FunnelWeb to abort to the OS immediately. */ /* The following variables count diagnostics over a single FunnelWeb run. */ EXTERN GLOVAR ulong num_war; /* Number of warnings. */ EXTERN GLOVAR ulong num_err; /* Number of errors. */ EXTERN GLOVAR ulong num_sev; /* Number of severe errors. */ /* The following variables count diagnostics over multiple FunnelWeb runs. */ EXTERN GLOVAR ulong sum_war; /* Number of warnings. */ EXTERN GLOVAR ulong sum_err; /* Number of errors. */ EXTERN GLOVAR ulong sum_sev; /* Number of severe errors. */ EXTERN GLOVAR ulong sum_fat; /* Number of fatal errors. */ /******************************************************************************/ /* For #ifndef preventing multiple inclusion of the body of this header file. */ #endif /******************************************************************************/ /* End of DATA.H */ /******************************************************************************/ setting commands and so rather than */ /* cluttering up the dc_ record, they have been separated out here. */ #define TY_NSEC 1 /* New section. fw_src/source/dump.c 644 0 0 62005 6716661023 7733 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. 09-May-1999 RNW Added code to dump multiple library levels of macros. ##############################################################################*/ /******************************************************************************/ /* DUMP.C */ /******************************************************************************/ #include #include "style.h" #include "as.h" #include "clock.h" #include "data.h" #include "dump.h" #include "misc.h" /******************************************************************************/ #define DUMP_WIDTH (80) /******************************************************************************/ /* The following advance declarations are required because of recursion. */ LOCAL void dm_ex P_((p_wf_t,p_ells_t)); /******************************************************************************/ LOCAL void centerln P_((p_wf_t,uword,int,char *)); LOCAL void centerln(p_wf,width,ch,s) /* Writes string s in a line surrounded by character ch to specified width. */ /* Example: centerln(*,20,'-',"sloth") would write: "------ sloth -------" */ p_wf_t p_wf; uword width; int ch; char *s; { uword sidebar,i; char linet2[100]; /* Warning: linet2 can't be too big, or it will blow the Mac's limited */ /* stack space. Perhaps it should be put in the heap with a static pointer. */ as_cold(width>=5,"centerln: Width is too small."); as_cold(width<=80,"centerln: Width is too large."); as_cold(strlen(s) <= width-4,"centerln: Width is too narrow for string."); /* Construct a sidebar string. */ sidebar=(width-strlen(s)-2)/2; for (i=0;i40 && strlen(linet1)==width-1) { uword len=strlen(linet1); linet1[len]=ch; linet1[len+1]=EOS; } /* Write the result string to the specified stream. */ wf_wl(p_wf,linet1); } /******************************************************************************/ LOCAL char * fontname P_((ubyte)); LOCAL char * fontname(font) /* Given a font number, returns a pointer to a static string containing the */ /* name of the font. */ ubyte font; { switch (font) { case FT_NORM: return "Normal"; case FT_TITL: return "Title"; case FT_STIT: return "Small Title"; default : as_bomb("fontname: Font switch defaulted."); } /* Keep GCC warnings happy. */ as_bomb("fontname: Dropped out of switch."); return "Failure"; } /******************************************************************************/ LOCAL char * alignname P_((ubyte)); LOCAL char * alignname(align) /* Given an alignment number, returns a pointer to a static string containing */ /* the name of the alignment. */ ubyte align; { switch (align) { case LR_LEFT: return "Left"; case LR_RIGH: return "Right"; case LR_CENT: return "Centre"; default : as_bomb("alignname: Alignment switch defaulted."); } /* Keep GCC warnings happy. */ as_bomb("alignnamename: Dropped out of switch."); return "Failure"; } /******************************************************************************/ EXPORT void dm_mem(p_wf,p_mem,length) p_wf_t p_wf; char *p_mem; ulong length; { ubyte_ *p_base = (ubyte_ *) p_mem; long len = length; wf_wl(p_wf,""); wf_wl(p_wf,"MEMORY DUMP OF MAPPED FILE"); wf_wl(p_wf,"=========================="); wf_wl(p_wf,""); wf_wr(p_wf,"+-------------------------------------------------+------------------+\n"); wf_wr(p_wf,"| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF |\n"); wf_wr(p_wf,"+-------------------------------------------------+------------------+\n"); while (len>0) {/* Write a single line of 16 bytes per iteration. */ uword j; wf_wr(p_wf,"| "); for (j=0;j<16;j++) if (j>=len) wf_wr(p_wf," "); else { char s[10]; sprintf(s,"%02X ",(unsigned int) p_base[j]); wf_wr(p_wf,s); } wf_wr(p_wf,"| "); for (j=0;j<16;j++) if (j>=len) wf_chr(p_wf,' '); else { char ch=p_base[j]; /* DON'T use library function "isprint" - it is too loose. */ /* e.g. The vax "isprint" accepts top bit characters. */ if (!isascprn(ch)) ch='.'; wf_chr(p_wf,ch); } wf_wr(p_wf," |\n"); p_base+=16; len-=16; } /* End while */ wf_wr(p_wf,"+-------------------------------------------------+------------------+\n"); wf_wl(p_wf,""); } /******************************************************************************/ LOCAL void dm_byte P_((p_wf_t,ubyte)); LOCAL void dm_byte(p_wf,b) /* Dumps a text representation of the given byte to the specified stream. */ p_wf_t p_wf; ubyte b; { char t[10]; /* DON'T use library function "isprint" - it is too loose. */ /* e.g. The vax "isprint" accepts top bit characters. */ if (isascprn(b)) sprintf(t,"%c",(char) b); else sprintf(t,"<%03u>",(unsigned) b); wf_wr(p_wf,t); } /******************************************************************************/ EXPORT void dm_lnls(p_wf) p_wf_t p_wf; { wf_wl(p_wf,""); centerln(p_wf,DUMP_WIDTH,'=',"Start of LINE LIST DUMP"); wf_wl(p_wf,""); /*12345678901234567890123456789012345678901234567890123456789012345678901234567890*/ wf_wl(p_wf,"Globl Local| Text"); wf_wl(p_wf,"-----------+--------------------------------------------------------------------"); ls_fir(line_list); while (TRUE) { ln_t *p_line; char *p; ls_nxt(line_list,PPV &p_line); if (p_line==NULL) break; sprintf(linet1,"%05lu %05lu| ", (ulong) p_line->ln_global, (ulong) p_line->ln_local); wf_wr(p_wf,linet1); for (p=p_line->ln_body.sc_first; p<=p_line->ln_body.sc_last; p++) dm_byte(p_wf,*((ubyte_ *)p)); wf_wl(p_wf,""); } wf_wl(p_wf,"-----------+--------------------------------------------------------------------"); wf_wl(p_wf,"Globl Local| Text"); wf_wl(p_wf,""); centerln(p_wf,DUMP_WIDTH,'=',"End of LINE LIST DUMP"); wf_wl(p_wf,""); } /******************************************************************************/ LOCAL void dm_sc P_((p_wf_t,p_sc_t)); LOCAL void dm_sc(p_wf,p_sc) /* Dumps the specified scrap to the specified stream. */ p_wf_t p_wf; p_sc_t p_sc; { char *p; as_cold(p_sc->sc_first !=NULL,"dm_sc: NULL ptr1."); as_cold(p_sc->sc_last !=NULL,"dm_sc: NULL ptr2."); if (p_sc->sc_white) wf_wr(p_wf,"Text scrap[White]="); else wf_wr(p_wf,"Text scrap[Grey]="); wf_wr(p_wf,"\""); for (p=p_sc->sc_first; p<=p_sc->sc_last; p++) { dm_byte(p_wf,*((ubyte_ *) p)); if (*p=='\n') wf_wl(p_wf,""); } wf_wl(p_wf,"\""); } /******************************************************************************/ LOCAL void dm_scls P_((p_wf_t,p_scls_t)); LOCAL void dm_scls(p_wf,p_scls) /* Dumps the specified scrap list to the specified stream. */ p_wf_t p_wf; p_scls_t p_scls; { wf_wl(p_wf,""); centerln(p_wf,30,'-',"Start of Text Scrap List"); ls_fir(p_scls); while (TRUE) { p_sc_t p_sc; ls_nxt(p_scls,PPV &p_sc); if (p_sc==NULL) break; dm_sc(p_wf,p_sc); } centerln(p_wf,30,'-',"End of Text Scrap List"); wf_wl(p_wf,""); } /******************************************************************************/ EXPORT void dm_tkls(p_wf) p_wf_t p_wf; { tk_t *token; char *m; ubyte font; ubyte align; wf_wl(p_wf,""); centerln(p_wf,DUMP_WIDTH,'=',"Start of TOKEN LIST DUMP"); wf_wl(p_wf,""); sprintf(linet1,"Summary: There are %lu tokens in the token list.", (ulong) ls_len(token_list)); wf_wl(p_wf,linet1); wf_wl(p_wf,""); wf_wl(p_wf,"Line[Column]: Token Description"); wf_wl(p_wf,"-------------------------------"); wf_wl(p_wf,""); ls_fir(token_list); ls_nxt(token_list,PPV &token); while (token != NULL) { sprintf(linet1,"%04lu[%02lu]: ", (ulong) token->tk_ps.ps_line, (ulong) token->tk_ps.ps_column); wf_wr(p_wf,linet1); switch (token->tk_kind) { case TK_TEXT: m="Text." ; break; case TK_MDEF: m="@$ Macro defn." ; break; case TK_FDEF: m="@F File defn." ; break; case TK_ONAM: m="@< Open name." ; break; case TK_CNAM: m="@> Close name." ; break; case TK_ODEF: m="@{ Open defn." ; break; case TK_CDEF: m="@} Close defn." ; break; case TK_OPAR: m="@( Open param." ; break; case TK_CPAR: m="@} Close param." ; break; case TK_COMA: m="@, Comma." ; break; case TK_QUOT: m="@\" Quote." ; break; case TK_PARM: m="@n Parameter." ; break; case TK_ZERO: m="@Z Zero calls." ; break; case TK_MANY: m="@M Many calls." ; break; case TK_LIBR: m="@L Library." ; break; case TK_NAME: m="@# Name." ; break; case TK_EMPH: m="@/ Emphasise." ; break; case TK_NPAG: m="@t.. Newpage." ; break; case TK_TOCS: m="@t.. TOC." ; break; case TK_SKIP: m="@t.. Vertical skip."; break; case TK_TITL: m="@t.. Title." ; break; case TK_EOF : m="End Of File." ; break; case TK_NSEC: switch (token->tk_gen) { case 0: m="@* New section (Level 0)."; break; case 1: m="@A New section (Level 1)."; break; case 2: m="@B New section (Level 2)."; break; case 3: m="@C New section (Level 3)."; break; case 4: m="@D New section (Level 4)."; break; case 5: m="@E New section (Level 5)."; break; default: as_bomb("dmtkls: Level case defaulted."); } break; default: as_bomb("dmtkls: Token case defaulted."); } wf_wr(p_wf,m); wf_wr(p_wf," "); switch (token->tk_kind) { case TK_PARM: sprintf(linet1,"Parameterno=%u.",(unsigned) token->tk_gen); wf_wl(p_wf,linet1); break; case TK_NAME: wf_wr(p_wf,"Character='"); dm_byte(p_wf,token->tk_gen); wf_wl(p_wf,"'."); break; case TK_TEXT: dm_sc(p_wf,&token->tk_sc); break; case TK_SKIP: sprintf(linet1,"Vertical space skipped=%lumm.", (ulong) token->tk_gen); wf_wl(p_wf,linet1); break; case TK_TITL: font = token->tk_gen / LRFT_PACK; align = token->tk_gen % LRFT_PACK; wf_wr(p_wf,"Font="); wf_wr(p_wf,fontname(font)); wf_wr(p_wf,", Alignment="); wf_wr(p_wf,alignname(align)); wf_wl(p_wf,". Title text follows:"); dm_sc(p_wf,&token->tk_sc); break; default: wf_wl(p_wf,""); break; } ls_nxt(token_list,PPV &token); } /* End of while loop. */ centerln(p_wf,DUMP_WIDTH,'=',"End of TOKEN LIST DUMP"); wf_wl(p_wf,""); } /******************************************************************************/ LOCAL void dm_eltx P_((p_wf_t,p_el_t)); LOCAL void dm_eltx (p_wf,p_el) /* Dumps the specified text element to the specified stream. */ p_wf_t p_wf; p_el_t p_el; { p_sc_t p_sc; wf_wl(p_wf,""); centerln(p_wf,30,'-',"Start Text Element"); ls_fir(p_el->el_text); ls_nxt(p_el->el_text,PPV &p_sc); while (p_sc != NULL) { dm_sc(p_wf,p_sc); ls_nxt(p_el->el_text,PPV &p_sc); } centerln(p_wf,30,'-',"End Text Element"); wf_wl(p_wf,""); } /******************************************************************************/ LOCAL void dm_elin P_((p_wf_t,p_el_t)); LOCAL void dm_elin(p_wf,p_el) /* Dumps the specified invocation element to the specified stream. */ p_wf_t p_wf; p_el_t p_el; { ulong parno; p_ells_t *pp_ex; p_ells_t p_ex; p_elll_t p_elll = p_el->el_parls; wf_wl(p_wf,""); centerln(p_wf,30,'-',"Begin Invocation Element"); sprintf(linet1,"Invocation of macro @<%s@>",&p_el->el_p_mac->ma_name[0]); wf_wl(p_wf,linet1); if (ls_len(p_elll)==0) wf_wl(p_wf,"No actual parameters."); else { sprintf(linet1,"This invocation has %lu actual parameters.", (ulong) ls_len(p_elll)); wf_wl(p_wf,linet1); wf_wl(p_wf, "Actual parameter list follows as a sequence of expressions:"); wf_wl(p_wf,"(Text crud before and after parameter has been omitted)."); parno=1; ls_fir(p_elll); while (TRUE) { ls_nxt(p_elll,PPV &pp_ex); if (pp_ex==NULL) break; p_ex = *pp_ex; sprintf(linet1,"Expression for parameter number %lu:",(ulong) parno); wf_wl(p_wf,linet1); dm_ex(p_wf,p_ex); parno++; } } centerln(p_wf,30,'-',"End Invocation Element"); wf_wl(p_wf,""); } /******************************************************************************/ LOCAL void dm_elpr P_((p_wf_t,p_el_t)); LOCAL void dm_elpr(p_wf,p_el) /* Dumps the specified parameter element to the specified stream. */ p_wf_t p_wf; p_el_t p_el; { wf_wl(p_wf,""); centerln(p_wf,30,'-',"Start Parameter Element"); sprintf(linet1,"Parameter number=%lu.",(ulong) p_el->el_parno); wf_wl(p_wf,linet1); sprintf(linet1,"Parameter is of macro \"%s\".", &p_el->el_which->ma_name[0]); wf_wl(p_wf,linet1); centerln(p_wf,30,'-',"End Parameter Element"); wf_wl(p_wf,""); } /******************************************************************************/ LOCAL void dm_ex(p_wf,p_ex) /* Dumps the specified expression to the specified stream. */ p_wf_t p_wf; p_ells_t p_ex; { p_el_t p_el; wf_wl(p_wf,""); centerln(p_wf,30,'-',"Start of Expression"); ls_fir(p_ex); ls_nxt(p_ex,PPV &p_el); while (p_el != NULL) { switch (p_el->el_kind) { case EL_TEXT: dm_eltx(p_wf,p_el); break; case EL_INVC: dm_elin(p_wf,p_el); break; case EL_PARM: dm_elpr(p_wf,p_el); break; default : as_bomb("dm_ex: Case defaulted."); } ls_nxt(p_ex,PPV &p_el); } centerln(p_wf,30,'-',"End of Expression"); wf_wl(p_wf,""); } /******************************************************************************/ LOCAL void dm_maclv P_((p_wf_t,p_md_t,ulong)); LOCAL void dm_maclv (p_wf ,p_md ,level) /* Dumps all the information on a particular level of a macro. */ p_wf_t p_wf; p_md_t p_md; ulong level; { /* Is the macro level defined? */ if (!p_md->md_isdef) { sprintf(linet1,"Level %u is not defined.",(unsigned) level); wf_wl(p_wf,linet1); return; } wf_wl(p_wf,""); sprintf(linet1,"Level %u is defined as follows.",(unsigned) level); wf_wl(p_wf,linet1); /* Number of parameters the macro has. */ sprintf(linet1,"Parameters : %lu",(ulong) p_md->md_npar); wf_wl(p_wf,linet1); /* Position. */ sprintf(linet1,"Pos(L,C) : (%lu,%lu)",(ulong) p_md->md_ps.ps_line, (ulong) p_md->md_ps.ps_column); wf_wl(p_wf,linet1); /* Is the macro additive? */ if (p_md->md_isadd) wf_wl(p_wf,"Additive? : Yes."); else wf_wl(p_wf,"Additive? : No."); /* Is the macro allowed to be called zero times? */ if (p_md->md_iszer) wf_wl(p_wf,"Zero Calls? : Yes."); else wf_wl(p_wf,"Zero Calls? : No."); /* Is the macro allowed to be called many times? */ if (p_md->md_isman) wf_wl(p_wf,"Many Calls? : Yes."); else wf_wl(p_wf,"Many Calls? : No."); /* Is the macro connected to an product file? */ if (p_md->md_isfil) wf_wl(p_wf,"Output File?: Yes."); else wf_wl(p_wf,"Output File?: No."); /* Dump a list of the body parts of the macro. */ { p_bp_t p_bp; ulong bpnum; ulong bptot = ls_len(p_md->md_body); wf_wl(p_wf,"Macro body :"); wf_wl(p_wf,""); wf_wl(p_wf,"--Start of List of Body Parts--"); sprintf(linet1,"This macro has %lu body part",(ulong) bptot); if (bptot!=1) strcat(linet1,"s"); strcat(linet1,"."); wf_wl(p_wf,linet1); bpnum=1; ls_fir(p_md->md_body); ls_nxt(p_md->md_body,PPV &p_bp); while (p_bp != NULL) { sprintf(linet1, "Body part %lu: Seqnum=%lu, Pos(L,C)=(%lu,%lu), Expression follows:", (ulong) bpnum, (ulong) p_bp->bp_seq, (ulong) p_bp->bp_ps.ps_line, (ulong) p_bp->bp_ps.ps_column); wf_wl(p_wf,linet1); dm_ex(p_wf,p_bp->bp_ex); ls_nxt(p_md->md_body,PPV &p_bp); bpnum++; } wf_wl(p_wf,"---End of List of Body Parts---"); wf_wl(p_wf,""); } } /******************************************************************************/ LOCAL void dm_macro P_((p_wf_t,p_ma_t)); LOCAL void dm_macro(p_wf,p_ma) /* Dump all the information on the specified macro. */ p_wf_t p_wf; p_ma_t p_ma; { wf_wl(p_wf,""); centerln(p_wf,DUMP_WIDTH-20,'-',"Start of Macro Dump"); /* Macro name and minimum level. */ sprintf(linet1,"Macro Name : \"%s\"",p_ma->ma_name); wf_wl(p_wf,linet1); sprintf(linet1,"Macro MinLv : %u",(unsigned) p_ma->ma_minlev); wf_wl(p_wf,linet1); /* Dump a list of all the calls to the macro. */ { p_mc_t p_mc; ulong mcnum; wf_wl(p_wf,"Call list :"); ls_fir(p_ma->ma_calls); ls_nxt(p_ma->ma_calls,PPV &p_mc); mcnum=1; while (p_mc != NULL) { sprintf(linet1, " Call %lu: Parameters=%lu, Sequence num=%lu, Position(L,C)=(%lu,%lu).", (ulong) mcnum, (ulong) p_mc->mc_npar, (ulong) p_mc->mc_seq, (ulong) p_mc->mc_ps.ps_line, (ulong) p_mc->mc_ps.ps_column); wf_wl(p_wf,linet1); ls_nxt(p_ma->ma_calls,PPV &p_mc); mcnum++; } } /* Dump all the levels of macro definition. */ { ubyte level; for (level=0; level<=MAXLIBLEV; level++) dm_maclv(p_wf,&p_ma->ma_defn[level],(ulong) level); } centerln(p_wf,DUMP_WIDTH-20,'-',"End of Macro Dump"); wf_wl(p_wf,""); } /******************************************************************************/ EXPORT void dm_matb P_((p_wf_t)); EXPORT void dm_matb(p_wf) p_wf_t p_wf; { wf_wl(p_wf,""); centerln(p_wf,DUMP_WIDTH,'=',"Start of MACRO TABLE DUMP"); wf_wl(p_wf,""); tb_fir(macro_table); while (TRUE) { name_t name; p_ma_t p_ma; if (!tb_rea(macro_table,PV &name[0],PV &p_ma)) break; dm_macro(p_wf,p_ma); wf_wl(p_wf,""); } wf_wl(p_wf,""); centerln(p_wf,DUMP_WIDTH,'=',"End of MACRO TABLE DUMP"); wf_wl(p_wf,""); } /******************************************************************************/ LOCAL void dm_ty P_((p_wf_t,p_ty_t)); LOCAL void dm_ty(p_wf,p_ty) p_wf_t p_wf; p_ty_t p_ty; { char linet2[200]; char linet3[200]; switch (p_ty->ty_kind) { case TY_NSEC: sn_str(&p_ty->ty_sn,linet2); strcpy(linet3,""); if (p_ty->ty_isnam) strcpy(linet3, (char *) p_ty->ty_pname); sprintf(linet1," Section \"%s\", Section name=\"%s\".",linet2,linet3); wf_wl(p_wf,""); wf_wl(p_wf,linet1); break; case TY_OLIT: wf_wl(p_wf," Open literal." ); break; case TY_CLIT: wf_wl(p_wf," Close literal." ); break; case TY_OEMP: wf_wl(p_wf," Open emphasise." ); break; case TY_CEMP: wf_wl(p_wf," Close emphasise." ); break; case TY_NPAG: wf_wl(p_wf," New page." ); break; case TY_TOCS: wf_wl(p_wf," Table of contents."); break; case TY_SKIP: sprintf(linet1," Vertical skip by %lu mm.",(ulong) p_ty->ty_mm); wf_wl(p_wf,linet1); break; case TY_TITL: wf_wr(p_wf,"Font="); wf_wr(p_wf,fontname(p_ty->ty_font)); wf_wr(p_wf,", Alignment="); wf_wr(p_wf,alignname(p_ty->ty_align)); wf_wl(p_wf,". Title text follows:"); dm_sc(p_wf,&p_ty->ty_sc); break; default: as_bomb("dm_ty: Typesetter directive switch defaulted."); } } /******************************************************************************/ EXPORT void dm_dcls(p_wf) /* Dumps a text representation of the document list to the given stream. */ p_wf_t p_wf; { wf_wl(p_wf,""); centerln(p_wf,DUMP_WIDTH,'=',"Start of DOCUMENT LIST DUMP"); wf_wl(p_wf,""); ls_fir(document_list); while (TRUE) { p_dc_t p_dc; ls_nxt(document_list,PPV &p_dc); if (p_dc == NULL) break; wf_wl(p_wf,""); sprintf(linet1,"Pos(L,C)=(%lu,%lu). ", p_dc->dc_ps.ps_line, p_dc->dc_ps.ps_column); switch (p_dc->dc_kind) { case DC_TEXT: wf_wr(p_wf,"TEXT COMPONENT: "); wf_wl(p_wf,linet1); dm_scls(p_wf,p_dc->dc_text); break; case DC_TYPE: wf_wr(p_wf,"TYPESETTER DIRECTIVE COMPONENT: "); dm_ty(p_wf,p_dc->dc_pty); break; case DC_MACR: wf_wr(p_wf,"MACRO DEFINITION COMPONENT: "); wf_wl(p_wf,linet1); sprintf(linet1,"Part %lu of level %u of macro @<%s@>.", (unsigned) p_dc->dc_part, (unsigned) p_dc->dc_mlev, &p_dc->dc_p_ma->ma_name[0]); wf_wl(p_wf,linet1); break; default: as_bomb("dm_scls: Case defaulted."); } } wf_wl(p_wf,""); centerln(p_wf,DUMP_WIDTH,'=',"End of DOCUMENT LIST DUMP"); wf_wl(p_wf,""); } /******************************************************************************/ LOCAL void tm_for P_((p_wf_t,char *,p_ck_t,p_ck_t)); LOCAL void tm_for(p_wf,s,p_val,p_tot) /* This rather ragged function simplifies the formatting in dm_times. */ p_wf_t p_wf; char *s; p_ck_t p_val; p_ck_t p_tot; { sprintf(linet1,"|%s| %3d%% | %8.2f | %8.2f | %3d%% |", s, (int) ((100.0*ck_cpu(p_val))/ck_cpu(p_tot)), (float) ck_cpu(p_val), (float) ck_real(p_val), (int) ((100.0*ck_real(p_val))/ck_real(p_tot)) ); wf_wl(p_wf,linet1); } /******************************************************************************/ EXPORT void dm_times(p_wf, p_mapp,p_scan,p_pars,p_anal, p_dump,p_lstr,p_tang,p_weav,p_totl) p_wf_t p_wf; p_ck_t p_mapp; p_ck_t p_scan; p_ck_t p_pars; p_ck_t p_anal; p_ck_t p_dump; p_ck_t p_lstr; p_ck_t p_tang; p_ck_t p_weav; p_ck_t p_totl; { float cputot; float realtot; float cpuerr; float realerr; cputot = ck_cpu(p_mapp) + ck_cpu(p_scan) + ck_cpu(p_pars) + ck_cpu(p_anal) + ck_cpu(p_dump) + ck_cpu(p_lstr) + ck_cpu(p_tang) + ck_cpu(p_weav); realtot = ck_real(p_mapp) + ck_real(p_scan) + ck_real(p_pars) + ck_real(p_anal) + ck_real(p_dump) + ck_real(p_lstr) + ck_real(p_tang) + ck_real(p_weav); cpuerr = ck_cpu (p_totl)-cputot; realerr = ck_real(p_totl)-realtot; wf_wl(p_wf,""); wf_wl(p_wf,"Summary of time used by each subsystem of Funnelweb (seconds)."); wf_wl(p_wf,""); wf_wl(p_wf, "+------------+------+----------+----------+------+"); wf_wl(p_wf, "| Subsystem | CPU% | CPU Time | RealTime | RT% |"); wf_wl(p_wf, "+------------+------+----------+----------+------+"); tm_for(p_wf," Mapper ",p_mapp,p_totl); tm_for(p_wf," Scanner ",p_scan,p_totl); tm_for(p_wf," Parser ",p_pars,p_totl); tm_for(p_wf," Analyser ",p_anal,p_totl); tm_for(p_wf," Dumper ",p_dump,p_totl); tm_for(p_wf," Lister ",p_lstr,p_totl); tm_for(p_wf," Tangler ",p_tang,p_totl); tm_for(p_wf," Weaver ",p_weav,p_totl); sprintf(linet1,"|%s| %3d%% | %8.2f | %8.2f | %3d%% |", " Clock Err ", (int) ((100.0*cpuerr )/ck_cpu (p_totl)), (float) cpuerr, (float) realerr, (int) ((100.0*realerr)/ck_real(p_totl)) ); wf_wl(p_wf,linet1); wf_wl(p_wf, "+------------+------+----------+----------+------+"); tm_for(p_wf," Total ",p_totl,p_totl); wf_wl(p_wf, "+------------+------+----------+----------+------+"); wf_wl(p_wf,""); } /******************************************************************************/ /* End of DUMP.C */ /******************************************************************************/ (p_el->el_kind) { case EL_TEXT: dm_eltx(p_wf,p_el); break; case EL_INVC: dm_elin(p_wf,p_el); break; case EL_PARM: dm_elpr(p_wf,p_el); break; default : as_bomb("dm_ex: Case defaulted."); } ls_nxt(p_ex,PPV &p_el); } centerln(p_wf,30,'-',"End of Expression"); wf_wl(p_wf,""); } /******************************************************************************/ LOCAL void dm_maclv P_((p_wf_t,p_md_t,ulong)); LOCAL void dm_maclv (p_wf ,p_md ,level) /* fw_src/source/dump.h 644 0 0 6555 6716661024 7731 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* DUMP.H */ /******************************************************************************/ /* */ /* This package contains functions that dump text representations of */ /* FunnelWeb data structures. Each function accepts a wf stream on which it */ /* writes its text representation. These functions are used in testing and */ /* debugging only and are not used ordinarily in the program. */ /* */ /******************************************************************************/ #include "style.h" #include "clock.h" #include "writfile.h" /******************************************************************************/ EXPORT void dm_mem P_((p_wf_t,char *,ulong)); /* Writes a hex and ascii dump of the specified block of memory to the */ /* specified stream. */ EXPORT void dm_lnls P_((p_wf_t)); /* Dumps a text representation of the global line list to the given stream. */ EXPORT void dm_tkls P_((p_wf_t)); /* Dumps a text representation of the global token list to the given stream. */ EXPORT void dm_matb P_((p_wf_t)); /* Dumps a text representation of the macro table to the given stream. */ EXPORT void dm_dcls P_((p_wf_t)); /* Dumps a text representation of the document list to the given stream. */ EXPORT void dm_times P_((p_wf_t,p_ck_t,p_ck_t,p_ck_t,p_ck_t, p_ck_t,p_ck_t,p_ck_t,p_ck_t,p_ck_t)); /* Dumps a text representation of the execution times to the given stream. */ /******************************************************************************/ /* End of DUMP.H */ /******************************************************************************/ dm_macro(p_wf,p_ma); wf_wl(p_wf,""); } wf_wl(p_wf,""); centerln(p_wf,DUMP_WIDTH,'=',"End of MACRO TABLE DUMP"); wf_wl(p_wf,""); } /**fw_src/source/environ.h 644 0 0 30046 6717377303 10461 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. 15-May-1999 RNW Modified STDC definition for Digital Unix. 15-May-1999 RNW Added support for FreeBSD. ##############################################################################*/ /******************************************************************************/ /* ENVIRON.H */ /******************************************************************************/ /* */ /* WARNING: DO NOT ADD ANY PROGRAM-DEPENDENT DEFINITIONS. */ /* */ /* This header file environ.h contains definitions and objects whose values */ /* depends directly on the compilation and execution environment, but are */ /* otherwise independent of any particular computer program. */ /* */ /* This is one of two machine-dependent, program-independent modules. The */ /* other module is machin (machin.h,machin.c). This "environ" module contains */ /* definitions and objects that are considered essential. The "machin" module */ /* contains less essential definitions. Motivation for the division came from */ /* the fact that style.h (used by almost every module) includes environ.h */ /* (this file), and from the need for the stuff in style.h by some */ /* environment-dependent definitions. */ /* */ /* There seems to be two ways to organize a module such as this one. The */ /* first is to have a different version of this module for each target */ /* environment. The second is to have a single file that uses #defines and */ /* #ifs to select between code for each target environment. I have chosen the */ /* latter method as this allows many different environments to share the same */ /* definitions. */ /* */ /******************************************************************************/ /* Ensure that the body of this header file is included at most once. */ #ifndef DONE_ENVIRON #define DONE_ENVIRON /******************************************************************************/ /* Detecting The Environment */ /* ------------------------- */ #define OS_MAC 0 /* Macintosh */ #define OS_DOS 0 /* MS-DOS */ #define OS_VMS 0 /* OpenVMS */ #define OS_W32 0 /* Win32 */ #define OS_UNX 0 /* Unix */ #define OS_HPU 0 /* HP/UX */ #define OS_OSF 0 /* Digital Unix */ #define OS_SUN 0 /* SunOS/Solaris */ #define OS_IRX 0 /* IRIX */ #define OS_B86 0 /* BSDOS */ #define OS_L86 0 /* Linux */ #define OS_AIX 0 /* AIX */ #define OS_FBD 0 /* FreeBSD */ #ifdef THINK_C #undef OS_MAC #define OS_MAC 1 #undef OS_MAC #define OS_MAC 1 #endif #ifdef __MWERKS__ #undef OS_MAC #define OS_MAC 1 #undef OS_MAC #define OS_MAC 1 #endif #ifdef MSDOS #undef OS_DOS #define OS_DOS 1 #undef OS_DOS #define OS_DOS 1 #endif #ifdef __DOS__ #undef OS_DOS #define OS_DOS 1 #undef OS_DOS #define OS_DOS 1 #endif #ifdef __BORLANDC__ #undef OS_DOS #define OS_DOS 1 #undef OS_DOS #define OS_DOS 1 #endif #ifdef VMS #undef OS_VMS #define OS_VMS 1 #undef OS_VMS #define OS_VMS 1 #endif #ifdef _WIN32 #undef OS_W32 #define OS_W32 1 #undef OS_W32 #define OS_W32 1 #endif #ifdef __hpux #undef OS_UNX #define OS_UNX 1 #undef OS_HPU #define OS_HPU 1 #endif #ifdef __osf__ #undef OS_UNX #define OS_UNX 1 #undef OS_OSF #define OS_OSF 1 #endif #ifdef sun #undef OS_UNX #define OS_UNX 1 #undef OS_SUN #define OS_SUN 1 #endif #ifdef __ultrix #undef OS_UNX #define OS_UNX 1 #undef OS_ULT #define OS_ULT 1 #endif #ifdef __sgi #undef OS_UNX #define OS_UNX 1 #undef OS_IRX #define OS_IRX 1 #endif #ifdef __386BSD__ #undef OS_UNX #define OS_UNX 1 #undef OS_B86 #define OS_B86 1 #endif #ifdef __linux__ #undef OS_UNX #define OS_UNX 1 #undef OS_L86 #define OS_L86 1 #endif #ifdef _AIX #undef OS_UNX #define OS_UNX 1 #undef OS_AIX #define OS_AIX 1 #endif #ifdef __FreeBSD__ #undef OS_UNX #define OS_UNX 1 #undef OS_FBD #define OS_FBD 1 #endif #if (OS_MAC + OS_UNX + OS_VMS + OS_DOS + OS_W32) == 0 #error Error: No operating system class has been selected. #endif #if (OS_MAC + OS_UNX + OS_VMS + OS_DOS + OS_W32) > 1 #error Error: More than one operating system class has been selected. #endif #if OS_UNX #define OS_UNXSUM1 (OS_HPU+OS_OSF+OS_SUN+OS_SOL+OS_ULT) #define OS_UNXSUM2 (OS_IRX+OS_B86+OS_L86+OS_AIX+OS_FBD) #if ((OS_UNXSUM1+OS_UNXSUM2) != 1) #error Error: Exactly one Unix operating system must be chosen. #endif #endif #define BEGIN_OS #define END_OS /******************************************************************************/ /* Establish Presence or Absence of __STDC__ */ /* ----------------------------------------- */ /* The __STDC__ symbol is very useful for determining if the compiler is */ /* ANSI. However, some "nearly ANSI" compilers don't set this symbol, and */ /* experience shows that things turn out better if it is set. */ /* This section decides if __STDC__ should be defined. */ /* The Macintosh THINK C compiler seems to be ANSI standard but, strangely */ /* does not define the standard preprocessor symbol __STDC__ that indicates */ /* this. Instead it defines THINK_C. Here, we execute the link manually. */ /* For more information see the THINK C User's Manual, Chapter 57: "Language */ /* Reference", Section 12.10, p.442. */ #if OS_VMS || OS_OSF #define __STDC__ 1 #endif #ifdef __VISUALC__ #define __STDC__ 1 #endif #ifdef __MWERKS__ #undef __STDC__ #define __STDC__ 1 #endif /******************************************************************************/ /* Switch From Definedness to Boolean Symbols */ /* ------------------------------------------ */ /* Use of the definedness of a preprocessor symbol to detect a condition is */ /* convenient if it is desired that only one condition be tested at a time. */ /* However, if we want to OR conditions, it is more convenient to use defined */ /* symbols that are either 0 or 1. This section contains ifdefs that do this. */ #ifdef __STDC__ #define STDC 1 #else #define STDC 0 #endif /* Note: If THINK_C is predefined, it is predefined to be 1. */ #ifndef THINK_C #define THINK_C 0 #endif /******************************************************************************/ /* Void */ /* ---- */ /* Define void if necessary and define pointer to void. */ /* This idea from the book "Portable C", p.41. */ /* If necessary, add a boolean condition to cover your environment. */ /* Note: The "| OS_SUN" is a last minute desperate hack. */ #if STDC || OS_SUN || OS_AIX #define p_void void * #else typedef int void; #define p_void char * #endif /* The following function is here solely to act as a first tripping point for */ /* environments with no "void" so that the users trying to port this code */ /* will look here first instead of starting to delete voids in the program. */ extern void test_void(); /******************************************************************************/ /* Const */ /* ----- */ /* It's useful to be able to specify that certain objects are constants. */ /* Unfortunately, the "const" construct is only available in ANSI C and so we */ /* have to have a macro so as to cope with non-ANSI compilers. */ /* Note: THINK-C is nearly ANSI, but does not support "const". */ #if STDC & !THINK_C #define CONST const #else #define CONST #endif /******************************************************************************/ /* Prototypes */ /* ---------- */ /* Define a macro to wrap around prototype parameter lists so as to support */ /* compilers with and without prototypes. */ /* This idea came from the book "Portable C", S3.1, p.32. */ #if STDC #define P_(A) A #else #define P_(A) () #endif /******************************************************************************/ /* Structure Assignments */ /* --------------------- */ /* Structure assignments are not supported on some of the older compilers and */ /* so we use a macro to perform such operations. */ /* This idea came from the book "Portable C", S8.2.2, p.184. */ #if STDC #define ASSIGN(a,b) ((a)=(b)) #else #define ASSIGN(a,b) (memcpy((char *)&(a),(char *)&(b),sizeof(a))) #endif /******************************************************************************/ /* VMS EXIT STATUS */ /* --------------- */ /* The VAX C compiler I used doesn't seem to be ANSI. This means that the */ /* exit symbols aren't set up properly. Furthermore, the sensible defaults */ /* in the style.h file don't work for VMS. The upshot is that we have to do */ /* a special case. Note: The top bit set in a VMS exit status means suppress */ /* diagnostic message. Even status means failure. Odd means success. */ #if OS_VMS #undef EXIT_SUCCESS #undef EXIT_FAILURE #define EXIT_SUCCESS 1 #define EXIT_FAILURE (0x10000002) #endif /******************************************************************************/ /* For #ifndef preventing multiple inclusion of the body of this header file. */ #endif /******************************************************************************/ /* End of ENVIRON.H */ /******************************************************************************/ ution environment, but are */ /* otherwise independent of any particular computer program. */ /* */ /* This is one of two machine-dependent, program-independent modules. The */ /* other module is machin (machin.h,machin.c). This "environ" module contains */ /* definitions and objects that are considered essential. The "machin" module */ /* contains less essential definitifw_src/source/help.c 644 0 0 57756 6716661027 7743 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* HELP.C */ /******************************************************************************/ /* */ /* REPRESENTING MESSAGES AS C CODE */ /* =============================== */ /* Experience has shown that it is much more reliable to code text messages */ /* into a program than to expect the program to track down text files */ /* containing the messages at run time. Worthwhile for smallish files (such */ /* as these help messages) at least. For this reason, most the messages in */ /* this module are represented by code (e.g. as in printf statements). */ /* */ /* The only exception is the 18K Gnu license message which is a bit too big */ /* to be done by hand. It has been moved to the help_gnu module. */ /* */ /******************************************************************************/ #include #include "style.h" #include "as.h" #include "help.h" #include "help_gnu.h" #include "misc.h" #include "option.h" /******************************************************************************/ /* This module contains many many output statements that call an output */ /* function. To neaten up all these calls, we define a global variable to */ /* hold a pointer to the function and simple macro to write output using */ /* the function. */ LOCVAR void (*pf) P_((char *)); #define WX(STR) (*pf)(STR) /******************************************************************************/ LOCAL void hel_men P_((void)); LOCAL void hel_men () { WX("\n"); WX("FunnelWeb Help Messages\n"); WX("-----------------------\n"); WX("Introduction - Introduction to FunnelWeb.\n"); WX("DOcumentation - How to obtain FunnelWeb documentation.\n"); WX("Options - Command line options.\n"); WX("DEfoptions - Default command line options.\n"); WX("COMmands - Interactive commands.\n"); WX("COPyright - Copyright notice.\n"); WX("License - The license under which this software is distributed (long).\n"); WX("Nowarranty - Extract from the GNU license concerning lack of warranty.\n"); WX("DIstribution - Extract from the GNU license concerning distribution.\n"); WX("MOdification - Read this message if you intend to modify FunnelWeb.\n"); WX("Versions - A list of existing versions of FunnelWeb.\n"); WX("Acknowledge - Thanks to people who helped with FunnelWeb development.\n"); WX("MEnu - The message you are reading (the default help message).\n"); WX("\n"); WX("To display a message, give its (optionally abbreviated) name in a help command.\n"); WX("To capture a message to a file, add +J to the fw command. Examples:\n"); WX("\n"); WX(" fw +Hintroduction +Jintro.txt -- From the operating system level.\n"); WX(" help introduction -- From FunnelWeb interactive mode.\n"); } /******************************************************************************/ LOCAL void hel_int P_((void)); LOCAL void hel_int () { WX("\n"); WX("FunnelWeb Introduction\n"); WX("----------------------\n"); WX("Welcome to FunnelWeb, a literate-programming macro preprocessor.\n"); WX("\n"); WX("Traditional computer programs are primarily written for computers and consist\n"); WX("of code laced with comments. In contrast, literate programs are primarily\n"); WX("written for humans and consist of comments laced with code. While simple, the\n"); WX("effect of this inversion can change one's whole approach to programming.\n"); WX("The literate programmer focuses on conveying meaning to other intelligent\n"); WX("beings rather than merely convincing the computer to behave in a particular\n"); WX("way. It is the difference between performing and exposing a magic trick.\n"); WX("\n"); WX("FunnelWeb is a production-quality literate-programming tool that emphasises\n"); WX("simplicity and reliability. It provides a macro facility, and assists in the\n"); WX("production of typeset documentation. FunnelWeb is available for most popular\n"); WX("platforms and its highly portable source code in C is freely available under\n"); WX("a GNU license.\n"); WX("\n"); WX("To get started with FunnelWeb, visit these webs:\n"); WX(" http://www.ross.net/funnelweb/\n"); WX(" http://www.ross.net/funnelweb/tutorial/\n"); } /******************************************************************************/ LOCAL void hel_opt P_((void)); LOCAL void hel_opt () { WX("\n"); WX("FunnelWeb Command Line Options\n"); WX("------------------------------\n"); WX("Options are of the form (\"+\" | \"=\" | \"-\") [].\n"); WX("+ turns on an option. - turns it off. = doesn't affect it's onoffedness.\n"); WX("The case (e.g. upper or lower) of does not matter.\n"); WX(" is usually a filename or directory, but sometimes a number.\n"); WX("Convention: f=filename, n=decimal number, h=help message name.\n"); WX("\n"); WX("Example: fw sloth +L +Jaardvark.xxx +W80 -Q =Twalrus.tex\n"); WX("\n"); WX("Action options: (choose at least one when you invoke FunnelWeb from the OS).\n"); WX("If you choose more than one, they will be executed in the order given here.\n"); WX(" +Xf Execute specified Funnelweb script.\n"); WX(" +Ff Process specified input file.\n"); WX(" +Hh Display specified help message.\n"); WX(" +K Invoke FunnelWeb's interative mode.\n"); WX("\n"); WX("Other options:\n"); WX(" +B1 Diagnostic: Dump image of input file to listing file.\n"); WX(" +B2 Diagnostic: Dump scanner's line list to listing file.\n"); WX(" +B3 Diagnostic: Dump scanner's token list to listing file.\n"); WX(" +B4 Diagnostic: Dump parser's macro table to listing file.\n"); WX(" +B5 Diagnostic: Dump parser's document list to listing file.\n"); WX(" +B6 Diagnostic: Dump time breakdown report to listing file.\n"); WX(" +B7 Diagnostic: Suppress non-deterministic output.\n"); WX(" +Cn Number of lines of context around diagnostics in listing file.\n"); WX(" +D Delete each output file identical to its previous version.\n"); WX(" +If Default file specification for include files.\n"); WX(" +Jf Generate journal file. Default file specification.\n"); WX(" +Lf Generate listing file. Default file specification.\n"); WX(" +Of Generate product files. Default file specification.\n"); WX(" +Q Quiet mode. Only really important messages displayed on console.\n"); WX(" +Tf Generate Tex documentation file. Default file specification.\n"); WX(" +Uf Generate HTML documentation file. Default file specification.\n"); WX(" +Sn Send errors to console with specified number of lines of context.\n"); WX(" +Wn Set maximum length of lines in product files.\n"); WX("\n"); WX("If an option appears more than once, the rightmost one dominates.\n"); WX("For default values refer to the \"DEFOPTIONS\" help message.\n"); WX("For more information, refer to the FunnelWeb Reference Manual at:\n"); WX(" http://www.ross.net/funnelweb/reference/\n"); } /******************************************************************************/ LOCAL void hel_dop P_((void)); LOCAL void hel_dop () { op_t defop; WX("\n"); WX("FunnelWeb Default Option Settings\n"); WX("---------------------------------\n"); WX("These are the settings FunnelWeb STARTS UP with.\n"); op_ini(&defop); WX("\n"); op_wri(&defop,pf); WX("\n"); WX("See the OPTIONS help message for a brief description of these options.\n"); WX("For more information, refer to the FunnelWeb Reference Manual at:\n"); WX(" http://www.ross.net/funnelweb/reference/\n"); } /******************************************************************************/ LOCAL void hel_com P_((void)); LOCAL void hel_com () { WX("\n"); WX("FunnelWeb Interactive Commands\n"); WX("------------------------------\n"); WX(" ! - Comment. Ignores the whole line. \n"); WX(" ABSENT fn - Aborts if specified file exists. \n"); WX(" CODIFY ftext fC - Convert text file into C code to write text. \n"); WX(" COMPARE f1 f2 - Aborts if two files are different. \n"); WX(" DEFINE n \"text\" - Defines $n to translate to text. \n"); WX(" DIFF f1 f2 logf [ABORT] - Writes differences between f1 and f2 to logf.\n"); WX(" - Severe if different and ABORT is present. \n"); WX(" DIFFSUMMARY - Summary of differences done since DIFFZERO. \n"); WX(" DIFFZERO - Zeros differences counters. \n"); WX(" ENEO fn - Establish Non Existence Of file. \n"); WX(" EXECUTE fn - Execute commands in specified file. \n"); WX(" EXISTS fn - Aborts if file does not exist. \n"); WX(" FIXEOLS fn [outf] - Fixes up EOL markers in specified file. \n"); WX(" FW options - Invoke FunnelWeb-proper once. \n"); WX(" HELP [name] - Displays specified help message. \n"); WX(" HERE - Terminates effect of SKIPTO command. \n"); WX(" QUIT - Quits FunnelWeb. \n"); WX(" SET options - Sets options. \n"); WX(" SHOW - Displays currently active options. \n"); WX(" SKIPTO - Ignore commands until HERE command. \n"); WX(" STATUS - Write out status and diagnostic counts. \n"); WX(" STATUS [Sn] [En] [Wn] - Aborts if status is not as specified. \n"); WX(" TOLERATE - Don't abort script if next commmand gens err.\n"); WX(" TRACE ON | OFF - Turns command tracing ON or OFF. \n"); WX(" WRITE \"text\" - Writes specified text to screen and journal. \n"); WX(" WRITEU \"text\" - Same as WRITE but underlines text. \n"); WX("\n"); WX("For more information, refer to the FunnelWeb Reference Manual at:\n"); WX(" http://www.ross.net/funnelweb/reference/\n"); WX("\n"); WX("Most of these commands were created to support regression testing and\n"); WX("can be ignored by most users. In fact most users will never need to invoke\n"); WX("FunnelWeb's interactive mode at all. If you are just getting started\n"); WX("with FunnelWeb, it's probably best to run FunnelWeb directly from your\n"); WX("command interface and ignore the +K command line option for now.\n"); } /******************************************************************************/ LOCAL void hel_doc P_((void)); LOCAL void hel_doc () { WX("\n"); WX("FunnelWeb Documentation\n"); WX("-----------------------\n"); WX("The following FunnelWeb documentation is available:\n"); WX("\n"); WX(" http://www.ross.net/funnelweb/ - Main FunnelWeb web.\n"); WX(" http://www.ross.net/funnelweb/reference/ - Reference manual.\n"); WX(" http://www.ross.net/funnelweb/tutorial/ - Tutorial manual.\n"); WX(" http://www.ross.net/funnelweb/developer/ - Developer manual.\n"); } /******************************************************************************/ LOCAL void hel_cop P_((void)); LOCAL void hel_cop () { WX("\n"); WX("FunnelWeb Copyright\n"); WX("-------------------\n"); WX("Copyright (c) Ross N. Williams 1992. All rights reserved.\n"); WX("\n"); WX("However, FunnelWeb has been released by the author and copyright owner Ross\n"); WX("N. Williams (ross@ross.net) under Version 2 of the GNU General Public\n"); WX("License published by the Free Software Foundation. This means that you can\n"); WX("redistribute FunnelWeb and/or modify it under the terms of the license.\n"); WX("\n"); WX("Note: This program is distributed WITHOUT ANY WARRANTY; without even the\n"); WX("implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); WX("\n"); WX("The following help messages provide further information:\n"); WX("\n"); WX(" License - The license under which this software is distributed (long).\n"); WX(" DIstribution - Extract from the GNU license concerning distribution.\n"); WX(" Nowarranty - Extract from the GNU license concerning lack of warranty.\n"); WX(" MOdification - Read this message if you intend to modify FunnelWeb.\n"); WX(" Registration - How to register as an \"official\" FunnelWeb user.\n"); WX("\n"); } /******************************************************************************/ LOCAL void hel_now P_((void)); LOCAL void hel_now () { WX("\n"); WX("FunnelWeb Comes With No Warranty\n"); WX("--------------------------------\n"); WX("Here is an extract from the GNU General Public License Version 2, under which\n"); WX("FunnelWeb is distributed. See help message \"LICENSE\" for the full license.\n"); WX("\n"); WX(" 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\n"); WX(" FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN\n"); WX(" OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\n"); WX(" PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n"); WX(" OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n"); WX(" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\n"); WX(" TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\n"); WX(" PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n"); WX(" REPAIR OR CORRECTION.\n"); WX("\n"); WX(" 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n"); WX(" WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n"); WX(" REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n"); WX(" INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n"); WX(" OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n"); WX(" TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n"); WX(" YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n"); WX(" PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n"); WX(" POSSIBILITY OF SUCH DAMAGES.\n"); } /******************************************************************************/ LOCAL void hel_dis P_((void)); LOCAL void hel_dis () { WX("\n"); WX("FunnelWeb Distribution\n"); WX("----------------------\n"); WX("The following is an extract from the GNU General Public License Version 2,\n"); WX("under which FunnelWeb is distributed.\n"); WX("\n"); WX(" 1. You may copy and distribute verbatim copies of the Program's\n"); WX(" source code as you receive it, in any medium, provided that you\n"); WX(" conspicuously and appropriately publish on each copy an appropriate\n"); WX(" copyright notice and disclaimer of warranty; keep intact all the\n"); WX(" notices that refer to this License and to the absence of any warranty;\n"); WX(" and give any other recipients of the Program a copy of this License\n"); WX(" along with the Program.\n"); WX("\n"); WX(" You may charge a fee for the physical act of transferring a copy, and\n"); WX(" you may at your option offer warranty protection in exchange for a fee.\n"); WX("\n"); WX("The license also allows you other freedoms. For more information refer\n"); WX("to the full text of the license in the help message \"LICENSE\".\n"); } /******************************************************************************/ LOCAL void hel_ack P_((void)); LOCAL void hel_ack () { WX("\n"); WX("FunnelWeb Acknowledgements\n"); WX("--------------------------\n"); WX("The following people assisted with the preparation of FunnelWeb.\n"); WX("\n"); WX("Many thanks go to DAVID HULSE (dave@cs.adelaide.edu.au) who translated the 1986\n"); WX("version of FunnelWeb (V1) written in Ada into a public domain C version (V2).\n"); WX("\n"); WX("Thanks go to SIMON HACKETT (simon@internode.com.au) of Internode Systems\n"); WX("Pty Ltd for the use of his Sun, Mac, and PC, for assistance in porting\n"); WX("FunnelWeb to the Sun and PC, and for helpful discussions.\n"); WX("\n"); WX("Thanks go to JEREMY BEGG (jeremy@vsm.com.au) of VSM Software Services\n"); WX("for the use of his VAX, and for assistance with the VMS-specific code.\n"); WX("\n"); WX("Ross Williams (ross@ross.net), 12 May 1992.\n"); } /******************************************************************************/ LOCAL void hel_ver P_((void)); LOCAL void hel_ver () { WX("\n"); WX("FunnelWeb Versions\n"); WX("------------------\n"); WX("FunnelWeb was created in 1986 and was used extensively by Ross N. Williams\n"); WX("(ross@ross.net) for three years. However, Version 1.0 was written\n"); WX("in Ada and was not very portable (it was fairly VAX/VMS specific). David Hulse\n"); WX("(dave@cs.adelaide.edu.au) took the first step towards a release by translating\n"); WX("the Ada code into C. Ross N. Williams then extensively reworked the C code,\n"); WX("making it robust and portable, adding new features, and polishing it to its\n"); WX("1992 V3.0 release. In 1999 he released V3.2.\n"); WX("\n"); WX("Vers Lang Created Released Author Copyright Licensing \n"); WX("---- ---- ------- -------- -------------- ------------- --------- \n"); WX("V1.0 Ada 1986 Never Ross Williams Ross Williams Exe for Vax. \n"); WX("V2.0 C 1989 Never David Hulse Public domain No restriction.\n"); WX("V3.0 C 1992 May-1992 Ross Williams Ross Williams GNU release. \n"); WX("V3.1 C 1993 Never Ross Williams Ross Williams Not released. \n"); WX("V3.2 C 1999 May-1999 Ross Williams Ross Williams GNU release. \n"); WX("\n"); WX("This is FunnelWeb Version 3.2."); WX("For more information on versions, refer to the FunnelWeb Reference Manual at:\n"); WX(" http://www.ross.net/funnelweb/reference/\n"); } /******************************************************************************/ LOCAL void hel_mod P_((void)); LOCAL void hel_mod () { WX("\n"); WX("FunnelWeb Modifications\n"); WX("-----------------------\n"); WX("FunnelWeb is distributed under a GNU license, and you are free to modify the\n"); WX("source code and distribute modified copies (see the help message LICENSE).\n"); WX("However, there are good reasons why you should be careful about this:\n"); WX("\n"); WX(" 1) If you distribute modified versions of FunnelWeb, you run the risk of\n"); WX(" creating a version that will diverge from the \"official\" version of\n"); WX(" FunnelWeb which I intend to maintain.\n"); WX("\n"); WX(" 2) If you release a version of FunnelWeb with a changed input language,\n"); WX(" users of your modified version will create source files that will no\n"); WX(" longer work on other versions of FunnelWeb. This will destroy\n"); WX(" interoperability.\n"); WX("\n"); WX("For more information on these issues, see the FunnelWeb Developer Manual at:\n"); WX(" http://www.ross.net/funnelweb/developer/\n"); WX("\n"); WX("Ross Williams (ross@ross.net), 8 May 1999.\n"); } /******************************************************************************/ LOCAL bool prefeq P_((char *,char *)); LOCAL bool prefeq (p_pref,p_target) /* Returns TRUE iff string p_pref is a case insensitive prefix of p_target. */ char *p_pref; char *p_target; { char *p,*q; if (strlen(p_pref) > strlen(p_target)) return FALSE; p=p_pref; q=p_target; while (*p != EOS) { if (toupper(*p) != toupper(*q)) return FALSE; p++; q++; } return TRUE; } /******************************************************************************/ EXPORT uword hel_num (p_name) char *p_name; { uword matches = 0; uword messnum; /* We want to be fairly lenient on the user here as the user is trying to */ /* obtain help and will probably get annoyed and give up if it doesn't work, */ /* so we perform case insensitive prefix matching. However, we don't want */ /* to match if the user inputs a prefix that matches two message names. This */ /* means we can't just return when we find a match; we have to see if there */ /* are any others as well. */ if (prefeq(p_name,"MENU" )) {messnum=HL_MEN; matches++;} if (prefeq(p_name,"INTRODUCTION" )) {messnum=HL_INT; matches++;} if (prefeq(p_name,"OPTIONS" )) {messnum=HL_OPT; matches++;} if (prefeq(p_name,"DEFOPTIONS" )) {messnum=HL_DOP; matches++;} if (prefeq(p_name,"COMMANDS" )) {messnum=HL_COM; matches++;} if (prefeq(p_name,"DOCUMENTATION")) {messnum=HL_DOC; matches++;} if (prefeq(p_name,"LICENSE" )) {messnum=HL_GNU; matches++;} if (prefeq(p_name,"COPYRIGHT" )) {messnum=HL_COP; matches++;} if (prefeq(p_name,"NOWARRANTY" )) {messnum=HL_NOW; matches++;} if (prefeq(p_name,"DISTRIBUTION" )) {messnum=HL_DIS; matches++;} if (prefeq(p_name,"ACKNOWLEDGE" )) {messnum=HL_ACK; matches++;} if (prefeq(p_name,"VERSIONS" )) {messnum=HL_VER; matches++;} if (prefeq(p_name,"MODIFICATION" )) {messnum=HL_MOD; matches++;} if (matches != 1) return HL_ERR; return messnum; } /******************************************************************************/ EXPORT void hel_wri (p_outf,messno) void (*p_outf) P_((char *)); uword messno; { as_cold( 1 <= messno, "hel_wri: Message number is zero."); as_cold(messno <= HL_MAX, "hel_wri: Message number is greater than HL_MAX."); /* Set the global output function pointer. */ pf=p_outf; switch(messno) { case HL_MEN: hel_men(); break; case HL_INT: hel_int(); break; case HL_OPT: hel_opt(); break; case HL_DOP: hel_dop(); break; case HL_COM: hel_com(); break; case HL_DOC: hel_doc(); break; case HL_GNU: hel_gnu(p_outf); break; /* Calling another module. */ case HL_COP: hel_cop(); break; case HL_NOW: hel_now(); break; case HL_DIS: hel_dis(); break; case HL_ACK: hel_ack(); break; case HL_VER: hel_ver(); break; case HL_MOD: hel_mod(); break; default : as_bomb("hel_wri: switch defaulted."); } } /******************************************************************************/ /* End of HELP.C */ /******************************************************************************/ intend to modify Ffw_src/source/help.h 644 0 0 17262 6716661030 7726 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* HELP.H */ /******************************************************************************/ /* */ /* HELP PACKAGE */ /* ============ */ /* As I came closer and closer to completing the release version of */ /* FunnelWeb, I noticed that the online help was a bit of a mess. I had */ /* random commands and command line options here and there to provide bits of */ /* information. After a close look and some thought, I decided to centralize */ /* all of FunnelWeb's help messages into one module, and provide a clean and */ /* consistent interface to the help messages, both in the command line, and */ /* in interactive mode. */ /* */ /* The result is that all of the help messages have been moved to */ /* this module. Each help message has a name consisting of a string. One */ /* particular message has the name "MENU" and is the root help message (the */ /* "menu message"). It contains a list of all the help messages available and */ /* their names. */ /* */ /* The command line connects to help by providing a single command line */ /* option called +Hx which has the effect of displaying the help message */ /* called x. The default is -Hmenu. The "-" means that help is not invoked by */ /* default, but that if the user specifies +H, the menu message will be */ /* printed. If the user specifies (say) +Hsloth, message SLOTH will be */ /* displayed. The menu message is printed if the user invokes FunnelWeb with */ /* no actions. The +H option is classified as an action option. */ /* */ /* Interactive mode connects to help through the HELP command. In the spirit */ /* of the command line interface, if no argument is given, the menu message */ /* is displayed. If an argument is given, the specified message is written */ /* out. */ /* */ /* This module contributes two things to this process: */ /* 1) Provides a mapping from message names to messages. */ /* 2) Acts as a repository for the messages themselves. */ /* */ /******************************************************************************/ /* Ensure that the body of this header file is included at most once. */ #ifndef DONE_HELP #define DONE_HELP /******************************************************************************/ #include "style.h" /******************************************************************************/ /* Place a bound on help name length, and define an array type to hold them. */ #define HL_NMLEN 20 typedef char hn_t[HL_NMLEN+1]; /******************************************************************************/ /* Each of the messages has a unique symbol and number. The reason for */ /* defining these symbols instead of just using the message names in the code */ /* is that doing it this way allows us to change the exact message names */ /* without having to track down all their occurences in the code, or getting */ /* nasty surprises later down the track at run time (the compiler will tell */ /* you in a call containing HL_SLT that the symbol doesn't exist, but it */ /* won't complain about a string argument that just happens not to be the */ /* name of a message anymore). */ /* HL_ERR is the non-existent message. */ #define HL_ERR 0 /* HL_MEN - Help messages. */ /* HL_INT - Introduction to FunnelWeb. */ /* HL_OPT - Command line options. */ /* HL_DOP - Option defaults. */ /* HL_COM - Interactive commands. */ /* HL_DOC - Documentation. */ /* HL_LIC - The GNU License. */ /* HL_COP - Copyright notice. */ /* HL_NOW - No Warranty notice. */ /* HL_DIS - Distribution notice. */ /* HL_ACK - Acknowledgements. */ /* HL_VER - Versions. */ /* HL_MOD - Modifications. */ #define HL_MEN 1 #define HL_INT 2 #define HL_OPT 3 #define HL_DOP 4 #define HL_COM 5 #define HL_DOC 6 #define HL_GNU 7 #define HL_COP 8 #define HL_NOW 9 #define HL_DIS 10 #define HL_ACK 11 #define HL_VER 12 #define HL_MOD 13 /* The following symbol does not represent a message. It is the number of */ /* messages. This is useful for range checking and possibly in for loops. */ #define HL_MAX 13 /******************************************************************************/ EXPORT uword hel_num P_((char *)); /* Accepts a character string that is supposed to be the name of a message */ /* and returns the number of the message, or HL_ERR if the string does not */ /* correspond to any defined message. A match will occur if the argument */ /* string is the same (with case independent matching) as the prefix (of */ /* corresponding length) of exactly one message name. */ EXPORT void hel_wri P_((void (*)(char *),uword)); /* Accepts a message number and writes the message using the function */ /* provided in the first argument. Bombs the program if the message number in */ /* the second argument is not in the range [1,HL_MAX]. */ /******************************************************************************/ /* For #ifndef preventing multiple inclusion of the body of this header file. */ #endif /******************************************************************************/ /* End of HELP.H */ /******************************************************************************/ OP; matches++;} if (prefeq(p_name,"COMMANDS" )) {messnum=HL_COM; matches++;} if (prefeq(p_name,"DOCUMENTATION")) {messnum=HL_DOC; matches++;} if (prefeq(p_name,"LICENSE" )) {messnum=HL_GNU; matches++;} if (prefeq(p_name,"COPYRIGHT" )) {messnum=HL_COP; matches++;} if (prefeq(p_name,"NOWARRANTY" )) {messnum=HL_NOW; fw_src/source/help_gnu.c 644 0 0 11542 6716661031 10566 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* HELP_GNU.C */ /******************************************************************************/ /* */ /* REPRESENTING MESSAGES AS C CODE */ /* =============================== */ /* Experience has shown that it is much more reliable to code text messages */ /* into a program than to expect the program to track down text files */ /* containing the messages at run time. Worthwhile for smallish files (such */ /* as these help messages) at least. For this reason, all the messages in */ /* this module are represented by code (e.g. as in printf statements). */ /* */ /* There is no difficulty turning a short message into code; simply place it */ /* in output statements. However, large messages (e.g. the GNU license) are */ /* more tedious, and also present more of a problem if it is necessary to */ /* change them substantially at a later date. This problem has been solved in */ /* FunnelWeb by writing a small program that reads a text file and writes out */ /* C code that writes the text file. The files involved are: */ /* */ /* help_gnu.mes - The original message. */ /* help_gnu.c - C code to write out the original message. */ /* */ /* To turn help_gnu.mes into help_gnu.c, give the following command in */ /* FunnelWeb interactive mode: codify help_gnu.txt help_gnu.c */ /* */ /******************************************************************************/ #include "style.h" #include "help_gnu.h" /******************************************************************************/ /* This module contains many many output statements that call an output */ /* function. To neaten up all these calls, we define a global variable to */ /* hold a pointer to the function and simple macro to write output using */ /* the function. */ LOCVAR void (*pf) P_((char *)); #define WX(STR) (*pf)(STR);(*pf)("\n") #define WY(STR) (*pf)(STR) /******************************************************************************/ EXPORT void hel_gnu (p_outf) void (*p_outf) P_((char *)); { pf=p_outf; WY("\n"); WY("FunnelWeb License\n"); WY("-----------------\n"); WY("FunnelWeb is distributed under the following license.\n"); WY("\n"); WY("----\n"); #include "help_gnu.ctx" WY("----\n"); WY("\n"); WY("If all that scrolled off your screen too quickly, don't worry. You can\n"); WY("capture this message (or any other FunnelWeb output) in a file by\n"); WY("specifying the +J option when you invoke FunnelWeb. For example:\n"); WY("\n"); WY(" fw +hlicense +jresult.txt\n"); WY("\n"); } /******************************************************************************/ /* End of HELP_GNU.C */ /******************************************************************************/ if the user invokes FunnelWeb with */ /* no actions. The +H option is classified as an action option. */ /* fw_src/source/help_gnu.ctx 644 0 0 50341 5211006243 11125 WX(" GNU GENERAL PUBLIC LICENSE"); WX(" Version 2, June 1991"); WX(""); WX(" Copyright (C) 1989, 1991 Free Software Foundation, Inc."); WX(" 675 Mass Ave, Cambridge, MA 02139, USA"); WX(" Everyone is permitted to copy and distribute verbatim copies"); WX(" of this license document, but changing it is not allowed."); WX(""); WX(" Preamble"); WX(""); WX(" The licenses for most software are designed to take away your"); WX("freedom to share and change it. By contrast, the GNU General Public"); WX("License is intended to guarantee your freedom to share and change free"); WX("software--to make sure the software is free for all its users. This"); WX("General Public License applies to most of the Free Software"); WX("Foundation's software and to any other program whose authors commit to"); WX("using it. (Some other Free Software Foundation software is covered by"); WX("the GNU Library General Public License instead.) You can apply it to"); WX("your programs, too."); WX(""); WX(" When we speak of free software, we are referring to freedom, not"); WX("price. Our General Public Licenses are designed to make sure that you"); WX("have the freedom to distribute copies of free software (and charge for"); WX("this service if you wish), that you receive source code or can get it"); WX("if you want it, that you can change the software or use pieces of it"); WX("in new free programs; and that you know you can do these things."); WX(""); WX(" To protect your rights, we need to make restrictions that forbid"); WX("anyone to deny you these rights or to ask you to surrender the rights."); WX("These restrictions translate to certain responsibilities for you if you"); WX("distribute copies of the software, or if you modify it."); WX(""); WX(" For example, if you distribute copies of such a program, whether"); WX("gratis or for a fee, you must give the recipients all the rights that"); WX("you have. You must make sure that they, too, receive or can get the"); WX("source code. And you must show them these terms so they know their"); WX("rights."); WX(""); WX(" We protect your rights with two steps: (1) copyright the software, and"); WX("(2) offer you this license which gives you legal permission to copy,"); WX("distribute and/or modify the software."); WX(""); WX(" Also, for each author's protection and ours, we want to make certain"); WX("that everyone understands that there is no warranty for this free"); WX("software. If the software is modified by someone else and passed on, we"); WX("want its recipients to know that what they have is not the original, so"); WX("that any problems introduced by others will not reflect on the original"); WX("authors' reputations."); WX(""); WX(" Finally, any free program is threatened constantly by software"); WX("patents. We wish to avoid the danger that redistributors of a free"); WX("program will individually obtain patent licenses, in effect making the"); WX("program proprietary. To prevent this, we have made it clear that any"); WX("patent must be licensed for everyone's free use or not licensed at all."); WX(""); WX(" The precise terms and conditions for copying, distribution and"); WX("modification follow."); WX(""); WX(" GNU GENERAL PUBLIC LICENSE"); WX(" TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION"); WX(""); WX(" 0. This License applies to any program or other work which contains"); WX("a notice placed by the copyright holder saying it may be distributed"); WX("under the terms of this General Public License. The \"Program\", below,"); WX("refers to any such program or work, and a \"work based on the Program\""); WX("means either the Program or any derivative work under copyright law:"); WX("that is to say, a work containing the Program or a portion of it,"); WX("either verbatim or with modifications and/or translated into another"); WX("language. (Hereinafter, translation is included without limitation in"); WX("the term \"modification\".) Each licensee is addressed as \"you\"."); WX(""); WX("Activities other than copying, distribution and modification are not"); WX("covered by this License; they are outside its scope. The act of"); WX("running the Program is not restricted, and the output from the Program"); WX("is covered only if its contents constitute a work based on the"); WX("Program (independent of having been made by running the Program)."); WX("Whether that is true depends on what the Program does."); WX(""); WX(" 1. You may copy and distribute verbatim copies of the Program's"); WX("source code as you receive it, in any medium, provided that you"); WX("conspicuously and appropriately publish on each copy an appropriate"); WX("copyright notice and disclaimer of warranty; keep intact all the"); WX("notices that refer to this License and to the absence of any warranty;"); WX("and give any other recipients of the Program a copy of this License"); WX("along with the Program."); WX(""); WX("You may charge a fee for the physical act of transferring a copy, and"); WX("you may at your option offer warranty protection in exchange for a fee."); WX(""); WX(" 2. You may modify your copy or copies of the Program or any portion"); WX("of it, thus forming a work based on the Program, and copy and"); WX("distribute such modifications or work under the terms of Section 1"); WX("above, provided that you also meet all of these conditions:"); WX(""); WX(" a) You must cause the modified files to carry prominent notices"); WX(" stating that you changed the files and the date of any change."); WX(""); WX(" b) You must cause any work that you distribute or publish, that in"); WX(" whole or in part contains or is derived from the Program or any"); WX(" part thereof, to be licensed as a whole at no charge to all third"); WX(" parties under the terms of this License."); WX(""); WX(" c) If the modified program normally reads commands interactively"); WX(" when run, you must cause it, when started running for such"); WX(" interactive use in the most ordinary way, to print or display an"); WX(" announcement including an appropriate copyright notice and a"); WX(" notice that there is no warranty (or else, saying that you provide"); WX(" a warranty) and that users may redistribute the program under"); WX(" these conditions, and telling the user how to view a copy of this"); WX(" License. (Exception: if the Program itself is interactive but"); WX(" does not normally print such an announcement, your work based on"); WX(" the Program is not required to print an announcement.)"); WX(""); WX("These requirements apply to the modified work as a whole. If"); WX("identifiable sections of that work are not derived from the Program,"); WX("and can be reasonably considered independent and separate works in"); WX("themselves, then this License, and its terms, do not apply to those"); WX("sections when you distribute them as separate works. But when you"); WX("distribute the same sections as part of a whole which is a work based"); WX("on the Program, the distribution of the whole must be on the terms of"); WX("this License, whose permissions for other licensees extend to the"); WX("entire whole, and thus to each and every part regardless of who wrote it."); WX(""); WX("Thus, it is not the intent of this section to claim rights or contest"); WX("your rights to work written entirely by you; rather, the intent is to"); WX("exercise the right to control the distribution of derivative or"); WX("collective works based on the Program."); WX(""); WX("In addition, mere aggregation of another work not based on the Program"); WX("with the Program (or with a work based on the Program) on a volume of"); WX("a storage or distribution medium does not bring the other work under"); WX("the scope of this License."); WX(""); WX(" 3. You may copy and distribute the Program (or a work based on it,"); WX("under Section 2) in object code or executable form under the terms of"); WX("Sections 1 and 2 above provided that you also do one of the following:"); WX(""); WX(" a) Accompany it with the complete corresponding machine-readable"); WX(" source code, which must be distributed under the terms of Sections"); WX(" 1 and 2 above on a medium customarily used for software interchange; or,"); WX(""); WX(" b) Accompany it with a written offer, valid for at least three"); WX(" years, to give any third party, for a charge no more than your"); WX(" cost of physically performing source distribution, a complete"); WX(" machine-readable copy of the corresponding source code, to be"); WX(" distributed under the terms of Sections 1 and 2 above on a medium"); WX(" customarily used for software interchange; or,"); WX(""); WX(" c) Accompany it with the information you received as to the offer"); WX(" to distribute corresponding source code. (This alternative is"); WX(" allowed only for noncommercial distribution and only if you"); WX(" received the program in object code or executable form with such"); WX(" an offer, in accord with Subsection b above.)"); WX(""); WX("The source code for a work means the preferred form of the work for"); WX("making modifications to it. For an executable work, complete source"); WX("code means all the source code for all modules it contains, plus any"); WX("associated interface definition files, plus the scripts used to"); WX("control compilation and installation of the executable. However, as a"); WX("special exception, the source code distributed need not include"); WX("anything that is normally distributed (in either source or binary"); WX("form) with the major components (compiler, kernel, and so on) of the"); WX("operating system on which the executable runs, unless that component"); WX("itself accompanies the executable."); WX(""); WX("If distribution of executable or object code is made by offering"); WX("access to copy from a designated place, then offering equivalent"); WX("access to copy the source code from the same place counts as"); WX("distribution of the source code, even though third parties are not"); WX("compelled to copy the source along with the object code."); WX(""); WX(" 4. You may not copy, modify, sublicense, or distribute the Program"); WX("except as expressly provided under this License. Any attempt"); WX("otherwise to copy, modify, sublicense or distribute the Program is"); WX("void, and will automatically terminate your rights under this License."); WX("However, parties who have received copies, or rights, from you under"); WX("this License will not have their licenses terminated so long as such"); WX("parties remain in full compliance."); WX(""); WX(" 5. You are not required to accept this License, since you have not"); WX("signed it. However, nothing else grants you permission to modify or"); WX("distribute the Program or its derivative works. These actions are"); WX("prohibited by law if you do not accept this License. Therefore, by"); WX("modifying or distributing the Program (or any work based on the"); WX("Program), you indicate your acceptance of this License to do so, and"); WX("all its terms and conditions for copying, distributing or modifying"); WX("the Program or works based on it."); WX(""); WX(" 6. Each time you redistribute the Program (or any work based on the"); WX("Program), the recipient automatically receives a license from the"); WX("original licensor to copy, distribute or modify the Program subject to"); WX("these terms and conditions. You may not impose any further"); WX("restrictions on the recipients' exercise of the rights granted herein."); WX("You are not responsible for enforcing compliance by third parties to"); WX("this License."); WX(""); WX(" 7. If, as a consequence of a court judgment or allegation of patent"); WX("infringement or for any other reason (not limited to patent issues),"); WX("conditions are imposed on you (whether by court order, agreement or"); WX("otherwise) that contradict the conditions of this License, they do not"); WX("excuse you from the conditions of this License. If you cannot"); WX("distribute so as to satisfy simultaneously your obligations under this"); WX("License and any other pertinent obligations, then as a consequence you"); WX("may not distribute the Program at all. For example, if a patent"); WX("license would not permit royalty-free redistribution of the Program by"); WX("all those who receive copies directly or indirectly through you, then"); WX("the only way you could satisfy both it and this License would be to"); WX("refrain entirely from distribution of the Program."); WX(""); WX("If any portion of this section is held invalid or unenforceable under"); WX("any particular circumstance, the balance of the section is intended to"); WX("apply and the section as a whole is intended to apply in other"); WX("circumstances."); WX(""); WX("It is not the purpose of this section to induce you to infringe any"); WX("patents or other property right claims or to contest validity of any"); WX("such claims; this section has the sole purpose of protecting the"); WX("integrity of the free software distribution system, which is"); WX("implemented by public license practices. Many people have made"); WX("generous contributions to the wide range of software distributed"); WX("through that system in reliance on consistent application of that"); WX("system; it is up to the author/donor to decide if he or she is willing"); WX("to distribute software through any other system and a licensee cannot"); WX("impose that choice."); WX(""); WX("This section is intended to make thoroughly clear what is believed to"); WX("be a consequence of the rest of this License."); WX(""); WX(" 8. If the distribution and/or use of the Program is restricted in"); WX("certain countries either by patents or by copyrighted interfaces, the"); WX("original copyright holder who places the Program under this License"); WX("may add an explicit geographical distribution limitation excluding"); WX("those countries, so that distribution is permitted only in or among"); WX("countries not thus excluded. In such case, this License incorporates"); WX("the limitation as if written in the body of this License."); WX(""); WX(" 9. The Free Software Foundation may publish revised and/or new versions"); WX("of the General Public License from time to time. Such new versions will"); WX("be similar in spirit to the present version, but may differ in detail to"); WX("address new problems or concerns."); WX(""); WX("Each version is given a distinguishing version number. If the Program"); WX("specifies a version number of this License which applies to it and \"any"); WX("later version\", you have the option of following the terms and conditions"); WX("either of that version or of any later version published by the Free"); WX("Software Foundation. If the Program does not specify a version number of"); WX("this License, you may choose any version ever published by the Free Software"); WX("Foundation."); WX(""); WX(" 10. If you wish to incorporate parts of the Program into other free"); WX("programs whose distribution conditions are different, write to the author"); WX("to ask for permission. For software which is copyrighted by the Free"); WX("Software Foundation, write to the Free Software Foundation; we sometimes"); WX("make exceptions for this. Our decision will be guided by the two goals"); WX("of preserving the free status of all derivatives of our free software and"); WX("of promoting the sharing and reuse of software generally."); WX(""); WX(" NO WARRANTY"); WX(""); WX(" 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY"); WX("FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN"); WX("OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES"); WX("PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED"); WX("OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF"); WX("MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS"); WX("TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE"); WX("PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,"); WX("REPAIR OR CORRECTION."); WX(""); WX(" 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING"); WX("WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR"); WX("REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,"); WX("INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING"); WX("OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED"); WX("TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY"); WX("YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER"); WX("PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE"); WX("POSSIBILITY OF SUCH DAMAGES."); WX(""); WX(" END OF TERMS AND CONDITIONS"); WX(""); WX(" Appendix: How to Apply These Terms to Your New Programs"); WX(""); WX(" If you develop a new program, and you want it to be of the greatest"); WX("possible use to the public, the best way to achieve this is to make it"); WX("free software which everyone can redistribute and change under these terms."); WX(""); WX(" To do so, attach the following notices to the program. It is safest"); WX("to attach them to the start of each source file to most effectively"); WX("convey the exclusion of warranty; and each file should have at least"); WX("the \"copyright\" line and a pointer to where the full notice is found."); WX(""); WX(" "); WX(" Copyright (C) 19yy "); WX(""); WX(" This program is free software; you can redistribute it and/or modify"); WX(" it under the terms of the GNU General Public License as published by"); WX(" the Free Software Foundation; either version 2 of the License, or"); WX(" (at your option) any later version."); WX(""); WX(" This program is distributed in the hope that it will be useful,"); WX(" but WITHOUT ANY WARRANTY; without even the implied warranty of"); WX(" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the"); WX(" GNU General Public License for more details."); WX(""); WX(" You should have received a copy of the GNU General Public License"); WX(" along with this program; if not, write to the Free Software"); WX(" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA."); WX(""); WX("Also add information on how to contact you by electronic and paper mail."); WX(""); WX("If the program is interactive, make it output a short notice like this"); WX("when it starts in an interactive mode:"); WX(""); WX(" Gnomovision version 69, Copyright (C) 19yy name of author"); WX(" Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'."); WX(" This is free software, and you are welcome to redistribute it"); WX(" under certain conditions; type `show c' for details."); WX(""); WX("The hypothetical commands `show w' and `show c' should show the appropriate"); WX("parts of the General Public License. Of course, the commands you use may"); WX("be called something other than `show w' and `show c'; they could even be"); WX("mouse-clicks or menu items--whatever suits your program."); WX(""); WX("You should also get your employer (if you work as a programmer) or your"); WX("school, if any, to sign a \"copyright disclaimer\" for the program, if"); WX("necessary. Here is a sample; alter the names:"); WX(""); WX(" Yoyodyne, Inc., hereby disclaims all copyright interest in the program"); WX(" `Gnomovision' (which makes passes at compilers) written by James Hacker."); WX(""); WX(" , 1 April 1989"); WX(" Ty Coon, President of Vice"); WX(""); WX("This General Public License does not permit incorporating your program into"); WX("proprietary programs. If your program is a subroutine library, you may"); WX("consider it more useful to permit linking proprietary applications with the"); WX("library. If this is what you want to do, use the GNU Library General"); WX("Public License instead of this License."); e, or distribute the Program"); WX("except as expressly provided under this License. Any attempt"); WX("otherwise to copy, modify, sublicense or distribute the Program is"); WX("void, and will automatically terminate your rights under this License."); WX("However, parties who have fw_src/source/help_gnu.h 644 0 0 5122 6716661033 10552 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* HELP_GNU.H */ /******************************************************************************/ /* */ /* This module is used solely by the help module, and is really part of the */ /* help module, but has been separated out because THINK C on the Macintosh */ /* couldn't cope with more than 32K of code in one module. */ /* */ /******************************************************************************/ #include "style.h" /******************************************************************************/ EXPORT void hel_gnu P_((void (*)(char *))); /* Writes out the GNU General Public License Version 2 using the specified */ /* output function. */ /******************************************************************************/ /* End of HELP_GNU.H */ /******************************************************************************/ o make thoroughly clear what is believed to"); WX("be a consequence of the rest of this License."); WX(""); WX(" 8. If the distribution and/or use of the Program is restricted in"); WX("certain countries either by patents or by copyrighted interfaces, the"); WX("original copyright holder who places the Program under this License"); WX("may add an explicit geographical distribution limitation excluding"); WX("those counfw_src/source/help_gnu.txt 644 0 0 43071 5211006245 11152 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ftware interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an execufw_src/source/list.c 644 0 0 24617 6716661034 7752 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* LIST.C */ /******************************************************************************/ #include "style.h" #include "as.h" #include "machin.h" #include "memory.h" /******************************************************************************/ /* In order to catch uninitialized and corrupted lists, the first and last */ /* fields of legitimate list objects contain magic numbers. The following */ /* #defines give the values of these numbers. The first thing that each */ /* function of this package does is to check the two magic number fields of */ /* the list it has just been passed, and bomb the package if the fields have */ /* the wrong values. This technique is likely to pick uninitialized lists, */ /* as well as lists that have been partially overwritten. */ #define MAGIC_HEAD_VALUE (97673812L) #define MAGIC_TAIL_VALUE (49357294L) /******************************************************************************/ typedef struct node_t_ /* Structure used to compose the list proper. */ { struct node_t_ *p_prev; /* Points to adjacent node closer to head. */ struct node_t_ *p_next; /* Points to adjacent node closer to tail. */ p_void p_data; /* Points to data in heap for this element. */ } node_t; typedef node_t *p_node_t; /* Pointer to node type. */ typedef struct /* Main list object containing all the goodies. */ { ulong magic_head; /* Helpful in catching list object corruptions. */ p_node_t p_head; /* Points to the head of the list (or NULL). */ p_node_t p_tail; /* Points to the tail of the list (or NULL). */ p_node_t p_mark; /* Points to the marked element (or NULL). */ size_t data_bytes; /* Number of bytes in this list's data elements. */ ulong length; /* Number of elements in this list. */ ulong magic_tail; /* Helpful in catching list object corruptions. */ } ls_t; typedef ls_t *p_ls_t; /* Main list view type. */ typedef p_void p_lsel_t; /* Escalating pointers to data elements! */ typedef p_lsel_t *pp_lsel_t; /* We need the function prototypes from list.h. The #define ensures that the */ /* abstract exported definition of a list is not visible to us here. */ #define INLISTC #include "list.h" /******************************************************************************/ LOCAL void ls_check P_((p_ls_t)); LOCAL void ls_check(p_ls) /* Accepts a pointer to a list and performs a series of checks to make sure */ /* that the list has not been corrupted in some way. */ /* This function is the sort of function that is normally turned off in */ /* production versions. However, we are too scared to in FunnelWeb because */ /* lists are not typesafe and are used throughout the program. */ p_ls_t p_ls; { as_cold(p_ls!=NULL,"ls_check: List pointer is NULL."); as_cold(p_ls->magic_head==MAGIC_HEAD_VALUE, "ls_check: Magic number at head of record is incorrect."); as_cold(p_ls->magic_tail==MAGIC_TAIL_VALUE, "ls_check: Magic number at tail of record is incorrect."); } /******************************************************************************/ EXPORT p_ls_t ls_cre (data_bytes) size_t data_bytes; { p_ls_t p_ls; p_ls=(p_ls_t) mm_temp(sizeof(ls_t)); p_ls->magic_head = MAGIC_HEAD_VALUE; p_ls->p_head = NULL; p_ls->p_tail = NULL; p_ls->p_mark = NULL; p_ls->data_bytes = data_bytes; p_ls->length = 0; p_ls->magic_tail = MAGIC_TAIL_VALUE; return p_ls; } /******************************************************************************/ EXPORT void ls_add(p_ls,p_lsel) p_ls_t p_ls; p_void p_lsel; { p_node_t p_node; AS_HCODE(ls_check(p_ls);) /* Create the list node and the data node hanging off it. Copy the data in. */ p_node =(p_node_t) mm_temp(sizeof(node_t)); p_node->p_data=(p_void) mm_temp(p_ls->data_bytes); memcpy(p_node->p_data,p_lsel,p_ls->data_bytes); /* Attach the new node to the tail of the list. */ p_node->p_prev=p_ls->p_tail; /* Pointers in the new node itself. */ p_node->p_next=NULL; if (p_ls->p_head == NULL) /* Headside pointer pointing to new node. */ p_ls->p_head=p_node; else p_ls->p_tail->p_next=p_node; p_ls->p_tail=p_node; /* Tailside pointer pointing to new node. */ /* Inc the length. */ p_ls->length++; } /******************************************************************************/ EXPORT void ls_lop(p_ls) p_ls_t p_ls; { /* p_node_t p_targ; ONLY NEEDED IF DEALLOCATING */ AS_HCODE(ls_check(p_ls);) as_cold(p_ls->length>0,"ls_lop: List is empty."); /* Make a note of the node being deleted. */ /* p_targ=p_ls->p_tail; ONLY NEEDED IF DEALLOCATED. */ /* If the target node was the only node, stitch up the ends of the list. */ if (--p_ls->length==0) { p_ls->p_head=NULL; p_ls->p_tail=NULL; } else { /* Unhook node from tail of list. */ p_ls->p_tail = p_ls->p_tail->p_prev; p_ls->p_tail->p_next = NULL; } /* The following two commented calls show what we WOULD have to do to */ /* deallocate the list node. However, in FunnelWeb, all list items are */ /* allocated under the mm package watermark system using mm_temp calls so */ /* there is no need to free up the memory here. */ /* DEALLOCATE(PV p_targ->p_data); */ /* DEALLOCATE(PV p_targ); */ } /******************************************************************************/ EXPORT ulong ls_len(p_ls) p_ls_t p_ls; { AS_HCODE(ls_check(p_ls);) return p_ls->length; } /******************************************************************************/ EXPORT void ls_fir(p_ls) p_ls_t p_ls; { ls_check(p_ls); p_ls->p_mark=p_ls->p_head; } /******************************************************************************/ EXPORT void ls_nxt(p_ls,pp_lsel) p_ls_t p_ls; pp_lsel_t pp_lsel; { AS_HCODE(ls_check(p_ls);) if (p_ls->p_mark==NULL) {*pp_lsel=NULL; return;} *pp_lsel=p_ls->p_mark->p_data; p_ls->p_mark=p_ls->p_mark->p_next; } /******************************************************************************/ EXPORT void ls_loo(p_ls,index,pp_lsel) p_ls_t p_ls; ulong index; pp_lsel_t pp_lsel; { p_node_t p; ulong i; AS_HCODE(ls_check(p_ls);) as_cold(index > 0,"ls_loo: Zero index."); as_cold(index <= p_ls->length,"ls_loo: Index is too high."); p=p_ls->p_head; as_cold(p!=NULL,"is_loo: List is empty."); for(i=1;ip_next; as_cold(p!=NULL,"is_loo: Index is too high for this list."); } *pp_lsel=p->p_data; } /******************************************************************************/ EXPORT void ls_tai(p_ls,pp_lsel) p_ls_t p_ls; pp_lsel_t pp_lsel; { AS_HCODE(ls_check(p_ls);) as_cold(p_ls->p_tail!=NULL,"ls_tai: List is empty."); *pp_lsel=p_ls->p_tail->p_data; } /******************************************************************************/ EXPORT void ls_emp(p_ls) p_ls_t p_ls; { AS_HCODE(ls_check(p_ls);) /* The following loop WOULD be required if we had to deallocate the list */ /* elements explicitly. However, as all list elements are allocated using */ /* mm_temp, it is possible to claim them later as a block. So here, we just */ /* let the list items drift off into the sunset. */ /* p_node_t p_curr; */ /* p_curr=p_ls->p_head; */ /* while (p_curr != NULL) */ /* { */ /* p_node_t p_targ=p_curr; */ /* p_curr=p_curr->p_next; */ /* my_free(PV p_targ->p_data); */ /* my_free(PV p_targ); */ /* } */ p_ls->p_head=NULL; p_ls->p_tail=NULL; p_ls->p_mark=NULL; p_ls->length=0; } /******************************************************************************/ EXPORT void ls_des(p_ls) p_ls_t p_ls; { ls_check(p_ls); ls_emp(p_ls); p_ls->magic_head=0; /* Zap the magic numbers in case memory is reused. */ p_ls->magic_tail=0; /* The following call WOULD be required if it wasn't for the MM watermark */ /* system of memory allocation. */ /* my_free(PV p_ls); */ } /******************************************************************************/ EXPORT p_void ls_mar (p_ls) p_ls_t p_ls; { AS_HCODE(ls_check(p_ls);) return PV p_ls->p_mark; } /******************************************************************************/ EXPORT void ls_set(p_ls,p_m) p_ls_t p_ls; p_void p_m; { AS_HCODE(ls_check(p_ls);) p_ls->p_mark=(p_node_t) p_m; } /******************************************************************************/ /* End of LIST.C */ /******************************************************************************/ the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program fw_src/source/list.h 644 0 0 27560 6716661036 7761 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* LIST.H */ /******************************************************************************/ /* */ /* Introduction */ /* ------------ */ /* This list package (list.h and list.c) implements a list abstraction. */ /* */ /* Facts about Lists */ /* ----------------- */ /* - A LIST stores zero or more LIST ELEMENTS. */ /* - The user decides the type of element to be stored in each list. */ /* - Each list stores only one type of list element; lists are homogeneous. */ /* - Lists store copies of elements rather than pointers to elements. */ /* - Each list can hold from zero to about 2^31 elements. */ /* - Each list has a HEAD end and a TAIL end. */ /* - Elements can be appended and deleted only at the tail of the list. */ /* - The elements of a list can be read sequentially from head to tail. */ /* - A MARKER stores the current position in the list for sequential reading. */ /* - Upon list creation, the marker is positioned at the tail of the list. */ /* - In a list of n elements, elements are numbered from 1 to n. */ /* - Element 1 is at the head of the list. Element n is at the tail. */ /* - The identifier "ls" is used as an abbreviation for "list". */ /* - The identifier "el" is used as an abbreviation for "element". */ /* - Longer names are desirable, but shorter ones have been used so as to */ /* enhance the portability of the package. */ /* - IMPORTANT: Lists get all their memory using mm_temp calls. */ /* */ /* How To Use This List Package */ /* ---------------------------- */ /* 1. Include this .H file in your program file. */ /* 2. Identify the type of elements to be placed in the list. */ /* 3. Define a variable of type p_ls as a view to a list. */ /* 4. Use the ls_* functions to perform the desired operations. */ /* Start with a call to ls_cre and (optionally) end with a call to ls_des. */ /* */ /******************************************************************************/ /* Ensure that the body of this header file is included at most once. */ #ifndef DONE_LIST #define DONE_LIST /******************************************************************************/ #include "style.h" /******************************************************************************/ /* Users manipulate lists through pointers to lists (p_ls_t). The following */ /* declaration serves the list user of the package while hiding the */ /* implementation details (which appear in a similar declaration in list.c). */ /* The #ifndef stops list.c from seeing these public declarations. */ #ifndef INLISTC typedef struct {word NEVER_USE_THIS_FIELD_UQJTKC;} ls_yqwx; /* Don't use! */ typedef ls_yqwx *p_ls_t; typedef p_void p_lsel_t; typedef p_lsel_t *pp_lsel_t; #endif /******************************************************************************/ /* */ /* General Notes About These Functions */ /* ----------------------------------- */ /* - All lists and elements are passed by pointer. Whether a parameter is */ /* read or written is determined by it's function's description. */ /* - Each function (except ls_cre) accepts a single pointer to a list and */ /* each function's description is assumed to be referring to the list. */ /* - "Raising an error" means calling the external function "error" to */ /* write out a message and bomb the program. */ /* - You must create a list using ls_cre before performing any operations */ /* upon it. A list function will usually raise an error if it is */ /* handed a pointer that does not point to a properly CREated list. */ /* */ /* WARNING: This package copies values into its internal data structures */ /* (through ls_add), but returns only POINTERS to elements when asked to */ /* retrieve them. These pointers are valid only so long as the element */ /* that they point to remains in the list. If the element is deleted somehow, */ /* the pointer points to garbage and becomes dangerous. */ /* So, if you have been handed a pointer to an element in a list (ls_nxt, */ /* ls_loo), do not subsequently delete the element (ls_lop, ls_emp, ls_des) */ /* and then attempt to access the element through the pointer. */ /* One sure way to avoid the problem is always to use the pointer handed back */ /* by ls_nxt or ls_loo to copy the element immediately. */ /* The Functions */ /* ------------- */ EXPORT p_ls_t ls_cre P_((size_t)); /* CREate. Creates a new list and returns a pointer to the new list. The user */ /* must specify in the parameter the size of elements that are to be stored */ /* in the list. Specify the size of elements in bytes (usually using sizeof). */ /* The sequential reading marker is set to position n+1=1=tail of the list. */ EXPORT void ls_add P_((p_ls_t,p_lsel_t)); /* ADD. Adds a new element onto the tail of the list (at position n+1). */ /* The user must supply in the second parameter a pointer to the element to */ /* be added. ls_add takes a copy of the element (it knows from the earlier */ /* call to ls_cre how many bytes to copy) and stores the copy in its own */ /* internal data structures. */ EXPORT void ls_lop P_((p_ls_t)); /* LOP. Removes (lops) element n from the tail of the list. */ /* Raises an error if the list is empty. */ EXPORT ulong ls_len P_((p_ls_t)); /* LENgth. Returns the number of elements in the list (n). */ EXPORT void ls_fir P_((p_ls_t)); /* FIRst. Sets the sequential reading marker to element 1. */ /* If the list is empty (n=0) the marker is placed at the tail of the list */ /* and subsequent calls to ls_add will leave it there until the next call to */ /* ls_fir. */ EXPORT void ls_nxt P_((p_ls_t,pp_lsel_t)); /* NeXT. Returns the list element under the marker and advances the marker */ /* one position towards the tail of the list. */ /* The method of returning the list element is a little messy. The user */ /* supplies a pointer to a pointer in the second parameter, and the function */ /* writes the address of the element in the list into the pointer. */ /* If the marker is at position n+1 upon entry to ls_nxt, the marker position */ /* doesn't change and NULL is written to the argument pointer. */ EXPORT void ls_loo P_((p_ls_t,ulong,pp_lsel_t)); /* LOOkup. Returns (using the same mechanism as ls_nxt) the k'th element of */ /* the specified list where k is the second (ulong) parameter and the first */ /* element (at the head of the list) is numbered number one (1). */ /* Raises an error if the index k is out of the range [1,n]. */ EXPORT void ls_tai P_((p_ls_t,pp_lsel_t)); /* Lookup TAIl. Returns (using the same mechanism as ls_nxt) the tail element */ /* of the specified list. */ /* Raises an error if the list is empty. */ EXPORT void ls_emp P_((p_ls_t)); /* EMPty. Empties the specified list, deallocating all the space used by the */ /* list elements. Upon completion, the list will be empty and the list marker */ /* will be positioned at the tail of the list. */ EXPORT void ls_des P_((p_ls_t)); /* DEStroy. Destroys a list, destroying all its elements and deallocating all */ /* the memory used by the list. */ /* Marker Functions */ /* ---------------- */ /* The following two functions ls_mar and ls_set were hacked in to this list */ /* package when it was discovered that the tangler sometimes needs to run */ /* more than one context down a list at the same time. The two new functions */ /* allow the list package user to save and restore the current mark. */ /* These functions are not tightly controlled and so care must be taken in */ /* their use. */ EXPORT p_void ls_mar P_((p_ls_t)); /* Returns a representation of the current list marker. */ EXPORT void ls_set P_((p_ls_t,p_void)); /* Sets the position of the marker to an earlier saved position. */ /* Calls to this function should satisfy the following conditions: */ /* 1. The marker argument (p_void) must be the result of an earlier call */ /* to ls_mar with the same list as an argument. */ /* 2. No part of the list should have been modified in the interim. In */ /* particular, this means that no calls to ls_add, ls_lop, ls_emp or */ /* ls_des can be made between linked calls to ls_mar and ls_set. */ /******************************************************************************/ /* For #ifndef preventing multiple inclusion of the body of this header file. */ #endif /******************************************************************************/ /* End of LIST.H */ /******************************************************************************/ abstraction. */ /* */ /* Facts about Lists fw_src/source/lister.c 644 0 0 26542 6717334371 10302 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. 08-May-1999 RNW Increased MAXLINES from one million to one billion. 08-May-1999 RNW Replaced dup function using calls to wf_dup. Fixes bug. 15-May-1999 RNW Fixed bug in add_mess relating to MEMMAXCH. ##############################################################################*/ /******************************************************************************/ /* LISTER.C */ /******************************************************************************/ #include "style.h" #include "as.h" #include "data.h" #include "list.h" #include "lister.h" #include "machin.h" #include "misc.h" #include "table.h" #include "writfile.h" /******************************************************************************/ #define LISTWIDTH 80 /* Nominal width of listing file. Can be wider. */ #define INDENTQ 3 /* Indentation quantum for include files. */ #define MESSMAXCH 500 /* Maximum number of characters in a message. */ #define CTXINF 100 /* Special value that signals infinite context. */ #define MAXLINES 1000000000L /* Maximum number of lines in input file. */ /* Note: Don't set this near 2^31 (see usage). */ /******************************************************************************/ /* The following #defines and typedef define an enumerated type for message */ /* kinds. There are four kinds of message, and we need a type for storing */ /* this information. mess_k_t stands for message_kind_type. */ /* We use #defines instead of enums as enums are not portable enough. */ #define MESS_MES 1 #define MESS_WAR 2 #define MESS_ERR 3 #define MESS_SEV 4 typedef ubyte mess_k_t; /* We wish to store messages in a table with message positions as keys. */ /* However, the table package will not tolerate duplicate keys. To solve this */ /* problem, we create a new type 'unqpos_t' (unique position type) which has */ /* not only a position but a serial number as well. */ typedef struct { ps_t up_pos; ulong up_serial; } unqpos_t; /* The following structure stores a single message. As we are storing COPIES */ /* of the messages, we impose a maximum limit (MESSMAXCH) to their length. */ typedef struct { mess_k_t ms_kind; char ms_text[MESSMAXCH+1]; } mess_t; /******************************************************************************/ LOCVAR p_tb_t p_msgtab; /* The message table storing diagnostics. */ LOCVAR ulong serial_next; /* Serial number for numbering messages. */ /******************************************************************************/ LOCAL int cmpuqpos P_((unqpos_t *,unqpos_t *)); LOCAL int cmpuqpos(p1,p2) /* Compare two unique positions for the table package and returns [-1,0,1]. */ unqpos_t *p1; unqpos_t *p2; { long diff; ubyte i; for (i=1; i<=3; i++) { switch (i) { case 1: diff= p1->up_pos.ps_line - p2->up_pos.ps_line; break; case 2: diff= p1->up_pos.ps_column - p2->up_pos.ps_column; break; case 3: diff= p1->up_serial - p2->up_serial; break; default: as_bomb("cmpuqpos: Case defaulted."); } if (diff<0) return -1; else if (diff>0) return 1; } return 0; } /******************************************************************************/ /* Converts a value of message kind type into a representative string. */ /* This routine unused at present. LOCAL char *mess_let P_((mess_k_t)); LOCAL char *mess_let (mess_k) mess_k_t mess_k; { switch (mess_k) { case MESS_MES : return "M"; case MESS_WAR : return "W"; case MESS_ERR : return "E"; case MESS_SEV : return "S"; default: as_bomb("mess_let: Case defaulted."); } as_bomb("mess_let: Switch dropped out."); return "Failure"; } */ /******************************************************************************/ LOCAL void mess_wri P_((p_wf_t,mess_t *,uword,uword)); LOCAL void mess_wri(p_wf,p_mess,indent,column) /* Writes message p_mess to file p_wf indented by INDENTQ*indent+column. */ p_wf_t p_wf; mess_t *p_mess; uword indent; uword column; { switch (p_mess->ms_kind) { case MESS_MES : wf_wr(p_wf," "); break; case MESS_WAR : wf_wr(p_wf," Warning"); break; case MESS_ERR : wf_wr(p_wf," Error"); break; case MESS_SEV : wf_wr(p_wf," Severe"); break; default: as_bomb("mess_let: Case defaulted. Probably MAXLINES bug again."); } wf_wr(p_wf,"|."); wf_dup(p_wf,'.',(ulong) (indent*INDENTQ)); wf_dup(p_wf,'.',(ulong) (column-1)); wf_wr(p_wf,"^"); wf_wr(p_wf,&p_mess->ms_text[0]); wf_wr(p_wf,"\n"); } /******************************************************************************/ LOCAL void line_wri P_((p_wf_t,ln_t *)); LOCAL void line_wri(p_wf,p_line) /* Writes the given line to the given output stream. */ p_wf_t p_wf; ln_t *p_line; { char buffer[100]; /* The last line of the line list is the EOF marker line and to indicate */ /* that it is not really part of the input file, we omit it's line number. */ if (p_line->ln_global==ls_len(line_list)) /*" 12345 12345| "*/ sprintf(buffer," | "); else sprintf(buffer," %5lu %5lu| ", (unsigned long) p_line->ln_global, (unsigned long) p_line->ln_local); wf_wr(p_wf,buffer); wf_blk(p_wf,p_line->ln_body.sc_first,(size_t) (p_line->ln_body.sc_last-p_line->ln_body.sc_first+1)); } /******************************************************************************/ LOCAL void add_mess P_((ps_t *,mess_k_t,char *)); LOCAL void add_mess(p_pos,messkind,p_string) /* Creates a message record and places the message information in the */ /* argument into the record. Inserts the record into the message table. */ ps_t *p_pos; mess_k_t messkind; char *p_string; { mess_t tempmess; unqpos_t unqpos; ulong len = strlen(p_string); tempmess.ms_kind=messkind; if (len <= MESSMAXCH) strcpy(tempmess.ms_text,p_string); else { memcpy(PV tempmess.ms_text,PV p_string,(size_t) MESSMAXCH); strcpy(&tempmess.ms_text[MESSMAXCH-20],""); /* 20 is safe. */ } ASSIGN(unqpos.up_pos,*p_pos); unqpos.up_serial=serial_next++; tb_ins(p_msgtab,PV &unqpos,PV &tempmess); } /******************************************************************************/ EXPORT void lr_ini P_((void)) { /* Create a brand new empty message table. */ p_msgtab=tb_cre(sizeof(unqpos_t),sizeof(mess_t),(p_kycm_t) cmpuqpos); /* Start the serial numbers at zero again. */ serial_next=0; } /******************************************************************************/ EXPORT void lr_mes(p_pos,s) ps_t *p_pos; char *s; { add_mess(p_pos,MESS_MES,s); } /******************************************************************************/ EXPORT void lr_war(p_pos,s) ps_t *p_pos; char *s; { add_mess(p_pos,MESS_WAR,s); num_war++; } /******************************************************************************/ EXPORT void lr_err(p_pos,s) ps_t *p_pos; char *s; { add_mess(p_pos,MESS_ERR,s); num_err++; } /******************************************************************************/ EXPORT void lr_sev(p_pos,s) ps_t *p_pos; char *s; { add_mess(p_pos,MESS_SEV,s); num_sev++; } /******************************************************************************/ EXPORT void lr_gen(p_wf,ctx) p_wf_t p_wf; uword ctx; { unqpos_t next_pos; /* Position of next message. */ mess_t next_mes; /* Content of next message. */ long prev_no; /* Global line number of previous message. */ long next_no; /* Global line number of next message. */ bool ingap; /* Controls issuance of gap markers in the listing. */ long context=ctx; /* Signed version of the parameter. */ /* A context of CTXINF signals an infinite context. */ if (context==CTXINF) context=MAXLINES; /* Write listing header. */ wf_wr(p_wf,"\nGlobal Local| Input File\n"); wf_dup(p_wf,'-',(ulong) 12); wf_wr(p_wf,"+"); wf_dup(p_wf,'-',(ulong) (LISTWIDTH-13)); wf_wr(p_wf,"\n"); /* Reset the line list and message table for reading. */ ls_fir(line_list); tb_fir(p_msgtab); /* Prime the variables ingap, prev_no, next_no, next_pos, and next_mes. */ ingap=FALSE; prev_no = -(context+1); if (tb_rea(p_msgtab,PV &next_pos,PV &next_mes)) next_no=next_pos.up_pos.ps_line; else next_no=MAXLINES+context+1; while (TRUE) {/* Process a single line per iteration. */ ln_t *p_line; /* Grab the next line from the line list. */ ls_nxt(line_list,PPV &p_line); if (p_line==NULL) break; /* List the line if it is within context range of prev or next message. */ if ((((long) p_line->ln_global) <= prev_no+context) || (((long) p_line->ln_global) >= next_no-context)) {line_wri(p_wf,p_line);ingap=FALSE;} else if (!ingap) {wf_wr(p_wf,".................\n");ingap=TRUE;} /* Issue any messages that are about this line. */ while (next_no == p_line->ln_global) { /* Write the current message. */ mess_wri(p_wf,&next_mes,(uword) 0, (uword) next_pos.up_pos.ps_column); /* Read the next message from the table. */ prev_no=next_no; if (tb_rea(p_msgtab,PV &next_pos,PV &next_mes)) next_no=next_pos.up_pos.ps_line; else next_no=MAXLINES+context+1; } } /* End while */ /* Make sure that we have read to the end of the message table. */ {bool result; result=tb_rea(p_msgtab,PV &next_pos,PV &next_mes); as_cold(!result, "lr_gen: Messages remaining in message table after listing."); } /* Write listing trailer. */ wf_dup(p_wf,'-',(ulong) 12); wf_wr(p_wf,"+"); wf_dup(p_wf,'-',(ulong) (LISTWIDTH-13)); wf_wr(p_wf,"\n"); wf_wl(p_wf,""); } /******************************************************************************/ /* End of LISTER.C */ /******************************************************************************/ dup function using calls to wf_dup. Fixes bug. 15-May-1999 RNW Fixed bug in add_mess relating to MEMMAXCH. ############################################fw_src/source/lister.h 644 0 0 6531 6716661040 10256 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* LISTER.H */ /******************************************************************************/ #include "style.h" #include "data.h" /******************************************************************************/ EXPORT void lr_ini P_((void)); /* Initialize the lister. Calling this function destroys all the lister */ /* package's old internal data structures and sets them to a well-defined */ /* initial state (empty) and prepares the lister for the incoming messages. */ /* This function may be called at any time and many times. */ EXPORT void lr_mes P_((ps_t *,char *)); EXPORT void lr_war P_((ps_t *,char *)); EXPORT void lr_err P_((ps_t *,char *)); EXPORT void lr_sev P_((ps_t *,char *)); /* The functions above allow the user to record four different kinds of */ /* messages and to specify exactly where in the listing each message is to */ /* appear. */ EXPORT void lr_gen P_((p_wf_t,uword)); /* Merges the global structure line_list with the message table stored by the */ /* lister package and writes the resultant listing to the p_wf_t stream. */ /* The second parameter is the number of lines of context around each */ /* diagnostic. The lister does not write the entire input file out. It only */ /* writes input lines near a diagnostic. The context argument specifies the */ /* number of lines that should be written around each diagnostic. */ /* Note: A context of 100 is special and means that no lines should be */ /* omitted in between diagnostics. */ /******************************************************************************/ /* End of LISTER.H */ /******************************************************************************/ *indent+column. */ p_wf_t p_wf; mess_t *p_mess; uword indent; uword column; { switch (p_mess->ms_kind) { case MESS_MES : wf_wr(p_wf," "); brefw_src/source/machin.c 644 0 0 26435 6716661041 10234 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* MACHIN.C */ /******************************************************************************/ /* */ /* WARNING: DO NOT ADD ANY PROGRAM DEPENDENT DEFINITIONS. */ /* */ /* This file contains machine-dependent, program-independent stuff that */ /* implements the functionality promised in MACHIN.H. */ /* */ /* Note: As usual, the full definitions of functions in the .H file are not */ /* repeated here. */ /* */ /******************************************************************************/ #include #include "style.h" #include "as.h" #include "machin.h" /* The Macintosh's doesn't have a command language, and so we have to prompt */ /* for a command line. This requires a special package. */ #if OS_MAC #include #endif /* Under VMS, we need RMS to get at stuff to do with filenames. */ #if OS_VMS #include RMS #endif /******************************************************************************/ /* LOCAL FUNCTIONS */ /******************************************************************************/ LOCAL void mconcat P_((int,char **,char *)); LOCAL void mconcat(argc,argv,result) /* Given argc and argv, as passed to main(), this function appends all the */ /* arguments together (separated by spaces) into the string "result". */ /* This function assists in reconstructing the command line. */ /* This function is actually portable, so you shouldn't have to change it. */ /* Note: "mconcat" stands for Multiple CONCATenation. */ int argc; char **argv; char *result; { uword i; strcpy(&result[0],argv[0]); for (i=1;i 0) strcpy(cur_path,add_path); if (strlen(add_name) > 0) strcpy(cur_name,add_name); if (strlen(add_extn) > 0) strcpy(cur_extn,add_extn); /* Put the fields back together again to yield the final result. */ fn_join(p_cur,cur_path,cur_name,cur_extn); } #endif #if OS_VMS EXPORT void fn_ins(p_cur,p_add) /* This VMS version of fn_ins was written with the assistance of: */ /* Jeremy Begg (jeremy@vsm.com.au) of VSM Software Services. Thanks! */ /* The VMS version is messy because VMS has highly structured filenames and */ /* highly ingrained rituals for manipulating them. */ p_fn_t p_cur; p_fn_t p_add; { struct FAB cur_fab; /* FAB for SYS$PARSE */ struct NAM cur_nam; /* NAM for SYS$PARSE */ fn_t expanded; /* Result of SYS$PARSE */ long rms_status; /* Status of SYS$PARSE */ /* printf("\nTRACE: Call of fn_ins(...).\n"); printf(" Current spec = \"%s\".\n",p_cur); printf(" Add spec = \"%s\".\n",p_add); */ /* Initialize the FAB and NAM block to something sensible. */ cur_fab = cc$rms_fab; cur_nam = cc$rms_nam; /* (fna,fns) is address and size of input file spec in FAB block. */ cur_fab.fab$l_fna = p_add; cur_fab.fab$b_fns = strlen(p_add); /* (dna,dns) is address and size of default file spec in FAB block. */ cur_fab.fab$l_dna = p_cur; cur_fab.fab$b_dns = strlen(p_cur); /* Connect the NAM block to the FAB block. */ cur_fab.fab$l_nam = &cur_nam; /* Point the NAM block's target name fields to the target namechar array. */ cur_nam.nam$l_esa = &expanded; cur_nam.nam$b_ess = PATHNAME_MAX; /* Reserve last char for NULL terminator */ /* PWD => put the password from a DECnet Access Control String in the filespec * SYNCHK => check syntax only, don't search for the file on disk */ cur_nam.nam$b_nop = NAM$M_PWD + NAM$M_SYNCHK; /* Perform the parse. */ rms_status = sys$parse(&cur_fab); if (rms_status & 1) { expanded[cur_nam.nam$b_esl]=EOS; /* Terminate VMS string. */ strcpy(p_cur,expanded); } else { printf("Note: RMS parse failed. Could be a syntax error, could be a bug!\n"); } /* TRACE printf(" Result spec = \"%s\".",p_cur); */ } #endif /******************************************************************************/ EXPORT void getcline(argc,argv,p_comline) /* Given, argc and argv, writes a command line string in p_comline. */ /* See machin.h for a thorough definition of this function. */ int argc; char **argv; char *p_comline; { int argc2; char **argv2; #if OS_MAC /* On the Macintosh there is no command language and therefore no command */ /* line. Therefore we cannot trust the argc and argv handed to us by main() */ /* and have to obtain a command line from other sources. */ /* The "ccommand" function comes from of the THINK C libraries. */ argc2=ccommand(&argv2); #endif /* The other systems work like Unix. */ #if OS_UNX | OS_VMS | OS_DOS | OS_W32 argc2=argc; argv2=argv; #endif /* The command line is currently in pieces. Reassemble it. That's all! */ mconcat(argc2,argv2,p_comline); } /******************************************************************************/ EXPORT float tim_real() { STAVAR bool init=FALSE; STAVAR time_t base; /* The first time this routine is called, we establish a base real time */ /* from which real time differences are calculated. There are two reasons */ /* for doing this. The first is that difftime seems to be the only way to */ /* get ANSI C to hand over a calibrated arithmetic type holding the real */ /* time. The second is that we don't want to have to deal with large */ /* absolute times anyway. */ if (!init) { /* Returns -1 if the time is not available (ANSI 7.12.2.4). */ base=time(NULL); init=TRUE; } /* Return the elapsed time since the base time. */ /* Sun does not have difftime. */ #if OS_SUN return 0.0; #else if (base == -1) return 0.0; else return (float) difftime(time(NULL),base); #endif /* The timing functions are only used to generate performance statistics and */ /* are not critical to FunnelWeb. There is not much harm in returning 0.0. */ } /******************************************************************************/ EXPORT float tim_cpu() { clock_t t=clock(); /* Make sure that we have a definition for CLOCKS_PER_SEC. */ #ifndef CLOCKS_PER_SEC #ifdef CLK_TCK #define CLOCKS_PER_SEC CLK_TCK #else /* Assume one million ticks per second. */ #define CLOCKS_PER_SEC (1000000L) #endif #endif /* The clock() function returns -1 if the CPU time is not available. */ /* Otherwise it returns the number of "clocks" since power-up. */ if (t == -1) return 0.0; else return ((float) t) / ((float) CLOCKS_PER_SEC); } /******************************************************************************/ /* End of MACHIN.C */ /******************************************************************************/ ##############################################*/ /******************************************************************************/ /* MACHIN.C */ /*************fw_src/source/machin.h 644 0 0 30371 6717404147 10236 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. 15-May-1999 RNW Modified ALIGN_POWER to cope with OSF. 15-May-1999 RNW Removed bogus SUN definitions. ##############################################################################*/ /******************************************************************************/ /* MACHIN.H */ /******************************************************************************/ /* */ /* WARNING: DO NOT ADD ANY PROGRAM DEPENDENT DEFINITIONS. */ /* */ /* This module (machin.h and machin.c) contains definitions and objects */ /* whose values depends directly on the compilation and execution */ /* environment, but are otherwise independent from any particular computer */ /* program. */ /* */ /* The only difference between the purpose of this module and the "environ" */ /* module is that the "environ" module contains the "essentials" whereas this */ /* module contains extra machine specific definitions and objects that will */ /* not be required by most user modules. */ /* */ /******************************************************************************/ /* Ensure that the body of this header file is included at most once. */ #ifndef DONE_FWMACHIN #define DONE_FWMACHIN /******************************************************************************/ #include #include "style.h" /******************************************************************************/ /* Machine Alignment Constraints */ /* ----------------------------- */ /* Some machines require that objects of particular lengths be aligned in */ /* memory. For example, the 68000 will trap any attempt to access a word */ /* (16 bits or an int in THINK C) at an odd address. It is important that C */ /* programs that deal with memory at a low level be aware of such */ /* constraints. As the constraints are always at a power of two, we defined */ /* ALIGN_POWER to be the minimum power of two at which it is both safe and */ /* efficient to operate. */ BEGIN_OS #if OS_VMS || OS_DOS || OS_W32 || OS_MAC #define ALIGN_POWER 1L #endif #if OS_UNX #if OS_OSF #define ALIGN_POWER 3L #else #define ALIGN_POWER 2L #endif #endif END_OS /******************************************************************************/ /* Filenames */ /* --------- */ /* The length and structure of filenames varies from machine to machine. The */ /* differences addressed here are: */ /* 1) The character used to separate directory specs from filenames. */ /* 2) The maximum length of a filename. */ /* FN_DELIM must contain the character that separates directory specs from */ /* filenames. Notice that in the VMS case, it is "]", not "." */ #if OS_MAC #define FN_DELIM ':' #endif #if OS_UNX #define FN_DELIM '/' #endif #if OS_VMS #define FN_DELIM ']' #endif #if OS_DOS | OS_W32 #define FN_DELIM '\\' #endif /* FILENAME_MAX should be defined in stdio.h (ANSI S7.9.1), but isn't always. */ /* On most systems, FILENAME_MAX is the maximum length of a pathname. */ /* However, on other systems, it means the maximum of just the filename part */ /* of the pathname. So we have to do some fudging. */ #ifndef FILENAME_MAX #define PATHNAME_MAX 300 #else #if OS_VMS || OS_HPU #define PATHNAME_MAX 300 #else #define PATHNAME_MAX (FILENAME_MAX) #endif #endif /* Now we can use the constant to define a filename type. */ /* Note: For a while I defined "typedef fn_t *p_fn_t". However, this is a */ /* pointer to an array rather than (char *) and it caused no end of problems. */ typedef char fn_t[PATHNAME_MAX+1]; typedef char *p_fn_t; /******************************************************************************/ /* Command Lines */ /* ------------- */ /* The maximum length of command line varies from machine to machine and we */ /* define symbols to reflect this. The reason why we don't just set this to a */ /* high value and forget about it is that FunnelWeb sometimes places */ /* command line variables on the stack, and some machines (e.g. MAC under */ /* THINK-C don't provide much stack space. So we have to minimize this */ /* variable on those machines. */ /* We choose a small maximum command line on the Macintosh so as to avoid */ /* chewing up stack space when command lines have to be pushed. */ #if OS_MAC #define COMLINE_MAX 300 #endif /* On the Sun, 1024 is a normal command line and 2048 is safe. */ #if OS_UNX #define COMLINE_MAX 2048 #endif /* On the VMS, 1024 is usually adequate. */ #if OS_VMS #define COMLINE_MAX 1024 #endif /* On a PC, we assume this is enough. */ #if OS_DOS | OS_W32 #define COMLINE_MAX 300 #endif /* Make sure that the value is not too low. */ /* The value 300 is guaranteed by the command interpreter. */ #if COMLINE_MAX < 300 #error COMLINE_MAX must be at least 300. #endif /* Now define a type for command lines. */ /* Note: For a while I defined "typedef cl_t *p_cl_t". However, this is a */ /* pointer to an array rather than (char *) and it caused no end of problems. */ typedef char cl_t[COMLINE_MAX+1]; typedef char *p_cl_t; /******************************************************************************/ /* Line Termination */ /* ---------------- */ /* FunnelWeb has special-case code to make reading input files faster on */ /* machines where the format of text files corresponds to the internal C */ /* text stream model. The UNIX_EOL #define should be activated if and only */ /* the host environment has text files consisting of a stream of bytes with */ /* a single LF (ASCII,decimal-10,hex-0A) character being used to terminate */ /* each line, and no special character to indicate end of file. */ /* This is the same format as is used in the Unix operating system. */ /* If you are in doubt about this, play it safe and define your environment */ /* to be non-Unix, as non-Unix will work on ALL systems (including Unix). */ #if !OS_UNX /* These systems do NOT use Unix EOLs. */ #define UNIX_EOL 0 #else /* This should really be 1 on a SUN, but I haven't got around to debugging */ /* FunnelWeb with UNIX_EOL==1. */ #define UNIX_EOL 0 #endif /******************************************************************************/ EXPORT void fn_ins P_((p_fn_t,char *)); /* - The name stands for FileName INSert. */ /* - The first argument must be a pointer to an object of type fn_t */ /* (containing an ordinary C character string). */ /* - The second argument must be a pointer to an ordinary C character string. */ /* - Both arguments must contain a full, partial, or empty filename spec. */ /* - We will refer to the arguments as f1 and f2. */ /* - If there is a syntax error in either spec, fn_ins does nothing. */ /* - Otherwise, it: */ /* 1. Analyses the two filename specifications into filename field . */ /* 2. Replaces each field in f1 by the corresponding field in f2, but */ /* only if the corresponding field in f2 is non-empty. */ /* 3. Optionally [concession to VMS] it may then replace blank fields */ /* in the resulting file spec in f1 by fields from the current */ /* global "default" directory spec. */ /* The structure and fields of filenames will vary from machine to machine */ /* and so this is not important. However, every implementation must structure */ /* the filename so that it will at least RECOGNISE a file extension */ /* (e.g. ".lis") field. */ /******************************************************************************/ EXPORT void getcline P_((int,char **,char *)); /* Operating system environments vary a lot in the way in which their command */ /* language interfaces are set up. The approach taken in FunnelWeb is to */ /* define a "standard" Unix-like command line syntax and then insist that */ /* other environments deliver such a command line as a single string. */ /* This function getcline must extract such a standard command line from its */ /* environment and copy it as a single string of not more than COMLINE_MAX */ /* characters into its third argument. A description of the "standard" */ /* command line can be found in the options package. */ /* The first argument is given to getcline and is argc from main(). */ /* The second argument is given to getcline and is argv from main(). */ /* These two arguments are given in case getcline needs them to assemble the */ /* command line (as opposed to calling e.g. VMS CLI routines). */ /* The third argument is the string into which the result should be placed. */ /******************************************************************************/ EXPORT float tim_real P_((void)); /* Returns the number of seconds between the present and an unspecified, but */ /* statically fixed time in the past. */ /* Returns 0.0 if this information is unavailable */ EXPORT float tim_cpu P_((void)); /* Returns the number of CPU seconds consumed between the present and an */ /* unspecified, but statically fixed time in the past. */ /* Returns 0.0 if this information is unavailable */ /******************************************************************************/ /* For #ifndef preventing multiple inclusion of the body of this header file. */ #endif /******************************************************************************/ /* End of MACHIN.H */ /******************************************************************************/ */ /* The only difference between the purpose of this module and the "environ" */ /* module is that the "environ" module contains the "essentials" whereas this */ /* module contains extra machine spfw_src/source/main.c 644 0 0 11714 6716661043 7715 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. 08-May-1999 RNW Added code to set creator/type of output files on Mac. ##############################################################################*/ /******************************************************************************/ /* MAIN.C */ /******************************************************************************/ #include "style.h" #include "as.h" #include "command.h" #include "data.h" #include "machin.h" #include "memory.h" /* Allows us to set the creator and type of output files on Macintosh. */ #if OS_MAC extern long _ftype; extern long _fcreator; #endif /******************************************************************************/ /* The following variables should really be local to main. However, some */ /* compilers have a problem with this and so it has been declared here. */ LOCVAR char *p_comline; LOCVAR ulong sum_all; /******************************************************************************/ LOCAL void minimain P_((int,char **)); LOCAL void minimain(argc,argv) /* Some compilers generate buggy code for main() and so this minimain */ /* function has been created to take the heat off main(). */ int argc; char **argv; { /* 08-May-1999 RNW: On the Macintosh, it's convenient if FunnelWeb output */ /* files can be clicked on to invoke a text editor. This can be done by */ /* setting the creator and type of output files. CodeWarrior makes this */ /* very easy. All we have to do is set some global variables and from */ /* that point on, all output files will have the specified creator/type. */ /* I originally set the creator to TeachText (ttxt), but soon discovered */ /* that TeachText can't open files greater than 32K. I looked around for */ /* another text application that Apple provides as standard, but couldn't */ /* find one. So I chose BBEdit, whose creator is "R*ch". */ #if OS_MAC _fcreator = 'R*ch'; _ftype = 'TEXT'; #endif /* The principal concern of this main() function is to execute FunnelWeb and */ /* to ensure that the correct return status is returned to the OS. So it */ /* seems appropriate to zero all the global diagnostic counters here. */ sum_fat=sum_sev=sum_err=sum_war=0; /* Some compilers place a low limit on the total amount of statics. So we */ /* have to allocate space for a command line. */ p_comline=(char *) mm_perm((size_t) COMLINE_MAX+1); /* Obtaining the command line is highly machine specific and so it has been */ /* delegated to a function in the non-portable "machin". Just in case argc */ /* and argv are to be used, we hand them in too. The result of all this is a */ /* standard FunnelWeb command line string in the variable 'comline'. */ getcline(argc,argv,p_comline); /* Execute the command line. */ command(p_comline); /* Exit to the operating system with an appropriate status code. */ sum_all=sum_war+sum_err+sum_sev+sum_fat; if (sum_all>0) exit(EXIT_FAILURE); else exit(EXIT_SUCCESS); } /******************************************************************************/ int main(argc,argv) int argc; char *argv[]; { /* We don't put anything into the function main() because some compilers */ /* generate incorrect code for main, especially with local variables. */ minimain(argc,argv); /* Keep GCC warnings happy. */ as_bomb("Main program dropped through."); return 0; } /******************************************************************************/ /* End of MAIN.C */ /******************************************************************************/ e, and no special character to indicate end of file.fw_src/source/mapper.c 644 0 0 41633 6716661044 10261 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. 08-May-1999 RNW Eliminated the 64K restriction for MS-DOS. ##############################################################################*/ /******************************************************************************/ /* MAPPER.C */ /******************************************************************************/ #include #include "style.h" #include "as.h" #include "machin.h" #include "mapper.h" #include "memory.h" /******************************************************************************/ /* When we allocate a block of memory for a mapped file, we have to allocate */ /* a little more than the official length of the file. Here are some reasons: */ /* */ /* - We may wish to append an EOF character later on in the program. */ /* - fgets, when requested to fetch n characters, fetches n characters and */ /* then puts an EOS on the end of them. */ /* - It is conceivable that fgets will insert a "\n" at the end of the */ /* block if it doesn't see a "\n" just before the end of file. */ /* */ /* For all these reasons, we allocate a little more memory than we need. How */ /* much more is determined by BLK_FUDGE which is set to be on the safe side. */ #define BLK_FUDGE (20) /* The following fudge is useful for avoiding the limits of types. */ #define LIM_FUDGE (10) /* On PCs, size_t is 16 bits and malloc cannot allocate contiguous chunks of */ /* memory of more than about 64K. This really stuffs up FunnelWeb's capacity */ /* map in files of length greater than 64K. I didn't think of this problem */ /* when I designed FunnelWeb because I was thinking of the VOLUME of memory */ /* available nowadays, rather than its organization on small computers. */ /* Anyway, this problem should really be fixed by allowing files to be read */ /* in in segments. Perhaps the mapper should hand over a linked list of */ /* chunks rather than a single chunk. Unfortunately, I don't have the time to */ /* do this now, so users of the PC version of FunnelWeb will have to be */ /* content with an (approx) 64K limit to input files. This isn't as bad as it */ /* sounds, as large input files can be split using the include facility. */ /* 63K is chosen instead of 64K so as to be paranoid. */ #define PCFILEMX (63L*1024L) /******************************************************************************/ /* */ /* Error Strings */ /* ------------- */ /* Routines in this package return pointers to error strings. These pointers */ /* are subsequently bandied about by other packages. Therefore, they must be */ /* pointers to constant strings. The trick of returning a pointer to a static */ /* character array containing a specific sprintf message will backfire here */ /* if there is an error opening more than one input file. Using mm_* to */ /* create space for each error string would work though. */ /* STOP PRESS: Now that the lister copies error messages, there may no longer */ /* be a problem here. */ /* */ /******************************************************************************/ /* Finding The Length of a File */ /* ---------------------------- */ /* We have to be able to find out the length of a file before reading it in */ /* because, in this version of FunnelWeb, the entire file must be read into */ /* one contiguous block of memory. */ /* */ /* As it turns out, finding the length of a file in portable C turns out to */ /* be a very hard problem. Here are some possible solutions: */ /* */ /* 1. Read the entire file in and see how long it is. */ /* 2. Use fseek to move to the end of the file and then use ftell. */ /* 3. Use the Unix 'stat' call. */ /* */ /* Of these, only the first is portable. The second alternative is */ /* non-portable because some environments do not support the SEEK_END symbol */ /* required to perform a seek to the end of file. */ /* Alternatives to needing the length are as follows: */ /* */ /* 4. Read the file/allocate memory in 64K blocks. */ /* 5. Read the file in 64K blocks and then copy them to a contiguous one. */ /* */ /* Perhaps options 4 or 5 could be implemented later. However, right now I */ /* haven't got the time to do anything except strive for portability, so */ /* option 1 it is. */ LOCAL char *file_len P_((char *,ulong *)); LOCAL char *file_len (p_name,p_length) /* Given a filename (in 'p_name'), returns the length of the binary image of */ /* the file in *p_length. Returns NULL upon success or a pointer to a string */ /* describing an error upon failure. The length is measured in bytes. */ char *p_name; ulong *p_length; { FILE *infile; STAVAR char *p_buf = NULL; /* The length of the buffer handed to fgets is non-critical. However, it */ /* mustn't be bigger than 15 bits, as we are passing it as an int to fgets. */ #define LENBUFLEN (1024L) #if LENBUFLEN > 30000L #error "mapper.c: LENBUFLEN must be less than 15 bits." #endif /* Allocate the buffer if it has not already been allocated. */ if (p_buf == NULL) p_buf=mm_perm((size_t) LENBUFLEN); /* Open for TEXT reading. Earlier, I tried this using a binary read, but */ /* I had problems with this on the VAX (I forget what the problems were) and */ /* so I have switched back to a text read which is slower, but more reliable.*/ infile=fopen(p_name,"r"); if (infile == FOPEN_F) return "Error fopen()ing input file (to determine its length)."; /* Start with a zero length. */ *p_length=0; /* Read the file as text and count the number of bytes it contains. */ while (!feof(infile)) { /* Set the buffer to the empty string so it is valid even if fgets fails. */ p_buf[0]=EOS; /* Read in a whole lot of bytes. */ fgets(p_buf,LENBUFLEN,infile); /* If there is an error, abort. */ if (ferror(infile)) { fclose(infile); return "Error fgets()ing input file (as part of determining its length)."; } /* Count the bytes that we have got. If EOF occurred above AND no bytes */ /* were read, the EOS we planted earlier saves us. */ (*p_length)+=strlen(p_buf); } if (fclose(infile) == FCLOSE_F) return "Error fclose()ing input file (as part of determining its length)."; return NULL; } /******************************************************************************/ #if (OS_DOS || OS_W32) && UNIX_EOL #error Attempt to use unix_map function on a PC! #endif #if UNIX_EOL LOCAL char *unix_map P_((char *,char **,ulong *)); LOCAL char *unix_map(p_name,pp_mem,p_length) /* If we know that the enclosing environment represents text files in UNIX */ /* form, then there is no need to process the file on the way in. All we need */ /* to do is map it directly into memory. This will be very fast. */ char *p_name; char **pp_mem; ulong *p_length; { ulong file_length; /* Number of bytes in the target input file. */ char *p_err; /* Temporary to store pointer to error message. */ FILE *infile; /* The file variable for the input file we are reading. */ ulong num_bytes; /* Number of bytes actually read in (may be different). */ char *p_bytes; /* Pointer to the memory block where all the action is. */ /* Obtain the length of the file we are about to map in. */ p_err=file_len(p_name,&file_length); if (p_err != NULL) return p_err; /* Allocate memory to hold the mapped file. */ /* Note: The memory allocation package bombs if there is no more memory. */ p_bytes=(char *) mm_temp((size_t) file_length+BLK_FUDGE); /* Open the file in BINARY mode. */ infile=fopen(p_name,"rb"); if (infile==FOPEN_F) return "Error fopen()ing the input file (binary open)."; /* Read in the file and complain if we haven't read in enough bytes. */ num_bytes=fread(p_bytes,(size_t) 1L,(size_t) file_length,infile); if (num_bytes != file_length) return "Error fread()ing the input file."; if (fclose(infile) == FCLOSE_F) return "Error fclose()ing the input file."; /* Success. We got through the IO calls. Now fill in the blanks and go home. */ *pp_mem =p_bytes; *p_length =num_bytes; return NULL; } #endif /******************************************************************************/ #if !UNIX_EOL LOCAL char *stan_map P_((char *,char **,ulong *)); LOCAL char *stan_map(p_name,pp_mem,p_length) /* Maps in a file using refined text stream IO calls. */ char *p_name; char **pp_mem; ulong *p_length; { ulong file_length; /* Number of bytes in the target input file. */ char *p_err; /* Temporary to store pointer to error message. */ FILE *infile; /* The file variable for the input file we are reading. */ ulong num_bytes; /* Number of bytes actually read in (may be different). */ char *p_bytes; /* Pointer to the memory block where all the action is. */ char *p_curr; /* Pointer to current position in memory block. */ long bytes_left; /* Number of bytes still left to read. */ /* Obtain the length of the file we are about to map in. */ p_err=file_len(p_name,&file_length); if (p_err != NULL) return p_err; /* Complain on the PC if the file is too big to fit in one 64K segment. */ /* 08-May-1999 RNW I commented out this restriction as DOS extenders have */ /* made this restriction obsolete. */ /* #if OS_DOS if (file_length+BLK_FUDGE > PCFILEMX) return "Error: Input file too big for PC FunnelWeb. Split using include files."; #endif */ /* TRACE printf("MAPPER: LENGTH OF INPUT FILE=%lu\n",file_length); */ /* Allocate memory to hold the mapped file. */ /* Note: The memory allocation package bombs if there is no more memory. */ /* Note: As Unix stream format (the format to which we are converting) uses */ /* just one byte to mark the end of file, it seems highly unlikely */ /* that the file read in will be longer than the binary image. */ p_bytes=(char *) mm_temp((size_t) file_length+BLK_FUDGE); /* If the file is of zero length, we already know its contents! */ /* This is probably not strictly necessary, but why pressure the code below? */ if (file_length==0) { *pp_mem = p_bytes; *p_length = 0; return NULL; } /* Open the file afresh in TEXT mode for portable reading. */ infile=fopen(p_name,"r"); if (infile==FOPEN_F) return "Error fopen()ing input file (for reading)."; /* Read in as much of the file as we can without actually overflowing the */ /* buffer. If the file finished before the buffer, things have probably gone */ /* OK. If the buffer finishes before the file, we have a problem. */ /* Note: bytes_left = file_length+1 because in the following loop, we might */ /* read exactly up to the EOF and then be unable to actually trigger the EOF */ /* condition without another read. So we add one on to allow this extra read */ /* to take place. I don't know if this is necessary, but I certainly can't */ /* find anything in all my C books that will tell me. Anyway, it doesn't */ /* matter because we fudged in a few extra bytes earlier. */ p_curr = p_bytes; /* p_curr runs through the memory. */ bytes_left = file_length+1; /* Bytes left in memory allocated to hold file. */ while (!feof(infile)) { int bytes_try; int bytes_read; /* Try to read as much as we possibly can, but not more than the integer */ /* limit (which can be as low as 15 bits). */ bytes_try = bytes_left >= ((ulong) (INT_MAX-LIM_FUDGE)) ? (int) INT_MAX-LIM_FUDGE : (int) bytes_left; /* Plan an EOS to cover the EOF case. */ *p_curr=EOS; /* Attempt to read bytes_try bytes. +1 is because fgets reads n-1 bytes. */ fgets(p_curr,bytes_try+1,infile); if (ferror(infile)) { fclose(infile); return "Error fgets()ing the input file."; } /* fgets doesn't return a length so we have to hobble behind with strlen. */ /* It's still probably better than using lots of fgetc calls. */ /* If we hit EOF and no bytes were read, the EOS we planted saves us. */ bytes_read = strlen(p_curr); p_curr += bytes_read; bytes_left -= bytes_read; /* If we have run out of bytes in our allocated memory zone, then the */ /* file is longer than the length reported earlier. This is a bad thing. */ as_cold(bytes_left >=0, "stan_map: Text representation was longer than binary rep."); } num_bytes=(file_length+1)-bytes_left; /* See earlier to undserstand +1. */ /* Note: We can't get fussy here and check the read in length with the */ /* official length, as the read-in length is the text representation which */ /* is allowed to be shorter than the physical (binary) length of the file. */ if (fclose(infile) == FCLOSE_F) return "Error fclose()ing input file."; /* Success. We got through the IO calls. Now fill in the blanks and go home. */ *pp_mem = p_bytes; *p_length = num_bytes; return NULL; } #endif /******************************************************************************/ EXPORT char *map_file(p_name,pp_mem,p_length) char *p_name; char **pp_mem; ulong *p_length; { /* We choose one of two mapper routines depending on where the operating */ /* system represents text files using EOL (\n) as end of line markers. */ /* The UNIX_EOL symbol is defined in the machin.h file. */ /* Note: I thought of using sprintf to test to see what "\n" translated into */ /* so I wouldn't need the UNIXEOL symbol. However, unlike printf (which it */ /* is supposed to be like), sprintf does not translate "\n" into its outside */ /* form. The only other alternative is writing a short text file and reading */ /* it back in binary - an action that would probably take longer than */ /* reading the original file to be read using fgetc()! */ #if UNIX_EOL return unix_map(p_name,pp_mem,p_length); #else return stan_map(p_name,pp_mem,p_length); #endif } /******************************************************************************/ /* End of MAPPER.C */ /******************************************************************************/ name (in 'p_name'), returns the length of the binary image of */ /* the file in *p_length. Returns Nfw_src/source/mapper.h 644 0 0 6725 6716661045 10252 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* MAPPER.H */ /******************************************************************************/ /* */ /* The mapper is the first of FunnelWeb's four front end processors: (mapper, */ /* scanner, parser, analyser). The sole task of the mapper is, given the */ /* name of a file, to create an image of that file in memory. This approach */ /* is not wasteful of memory at all because FunnelWeb requires random access */ /* to each input file at all times anyway so it can scramble the text around. */ /* */ /******************************************************************************/ #include "style.h" /******************************************************************************/ EXPORT char *map_file P_((char *,char **,ulong *)); /* Allocates a block of memory and places a Unix text stream representation */ /* (with EOL marking end of line and no character marking end of file) of the */ /* file 'p_name' in the block of memory. Returns a pointer to the address and */ /* len of the file in the mem block in the parameters (pp_mem and p_length). */ /* Returns NULL upon success or a pointer to an error message string upon */ /* failure. Note: Parameters are: p_name, pp_mem, p_length. */ /* Note: Allocates enough memory so that there is guaranteed to be at least */ /* two extra bytes of spare memory at the end of the mapped file. The */ /* scanner uses this space to put EOL and EOF characters. */ /* Note: The mapper grabs its memory using mm_temp, so it can be recycled */ /* as part of a call to mm_zapt. */ /******************************************************************************/ /* End of MAPPER.H */ /******************************************************************************/ ; ulong *p_length; { ulong file_length; fw_src/source/memory.c 644 0 0 37422 6716661047 10311 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* MEMORY.C */ /******************************************************************************/ /* */ /* Implementation Overview */ /* ----------------------- */ /* One of the tasks of this Memory Management (MM) package is to keep track */ /* of the memory that it has allocated so that it can all be deallocated */ /* later, in one go. To do this, the package keeps a linked list whose */ /* elements describe the blocks allocated. Two linked lists are kept, one for */ /* temporary blocks and one for permanent blocks. Only the list for the */ /* temporary blocks is used for deallocation. Permanent blocks are arranged */ /* in a list so that the code for temporary blocks is also applicable. */ /* */ /* In order to avoid many calls to malloc() for small blocks of memory */ /* (legend has it that some implementations of malloc() are very slow in this */ /* case), the MM package keeps a spare temporary and permanent block of */ /* length MM_BLOCK from which it allocates small blocks. Small is defined as */ /* <=MM_BLOCK/16. A separate malloc call is made for "Large" blocks greater */ /* than MM_BLOCK bytes. "Large" blocks less than MM_BLOCK bytes may or may */ /* not be allocated from a buffer block, depending on how much space is */ /* available. See the code for the full details. */ /* */ /******************************************************************************/ #include "style.h" #include "as.h" #include "machin.h" #include "memory.h" /******************************************************************************/ /* The environ.h file contains a definition for ALIGN_POWER which is the */ /* exponent of the power of two corresponding to the machine's alignment */ /* requirements. The following two constants convert that constant to more */ /* useful forms. These definitions should never need to be changed. */ #define ALIGN_SIZE (1L<> 4) /* Magic numbers help us to detect corruptions. */ #define MAGIC_HEAD (83716343L) #define MAGIC_TAIL (11172363L) /* Set MEMTRACE to TRUE to trace all memory operations. */ #define MEMTRACE FALSE /* Set MEMSTATS to TRUE to see memory usage stats. */ #define MEMSTATS FALSE /******************************************************************************/ /* The following structures define a type for the linked lists that keep */ /* track of the allocated blocks. */ typedef struct mm_t_ { ulong mm_mhead; /* Magic number protecting beginning of record. */ ubyte_ *mm_pblok; /* Pointer to the allocated block. */ ubyte_ *mm_pfree; /* Pointer to next free byte in block (ALIGNED). */ ulong mm_nfree; /* Number of unused bytes available in the block. */ struct mm_t_ *mm_pnext; /* Pointer to the header for the next block. */ ulong mm_mtail; /* Magic number protecting end of record. */ } mm_t; typedef mm_t *p_mm_t; /* Handy to have a pointer type too. */ /* The following two local variables point to the head of the temporary and */ /* permanent block lists. The first block in each list is that list's buffer. */ LOCVAR p_mm_t p_perm = NULL; LOCVAR p_mm_t p_temp = NULL; #if MEMSTATS /* The following counts stats for temporary memory blocks. */ #define MAXDIFSIZ 100 LOCVAR ulong numsiz = 0; LOCVAR ulong thesiz[MAXDIFSIZ]; LOCVAR ulong numblk[MAXDIFSIZ]; LOCVAR ulong tot_perm = 0; #endif /******************************************************************************/ LOCAL void mm_check P_((p_mm_t)); LOCAL void mm_check(p_mm) /* Checks the magic numbers in the specified block header object. */ p_mm_t p_mm; { as_cold(p_mm!=NULL,"mm_check: Null pointer."); as_cold(p_mm->mm_mhead==MAGIC_HEAD,"mm_check: Corrupted header."); as_cold(p_mm->mm_mtail==MAGIC_TAIL,"mm_check: Corrupted trailer."); } /******************************************************************************/ #if MEMSTATS LOCAL void reg_blk P_((ulong)); LOCAL void reg_blk (siz) /* Registers the allocation of a temporary memory block for the stats. */ ulong siz; { ulong i; for (i=0; imm_pfree) & ALIGN_MASK; /* Return if the block is already aligned. */ if (bump==0) return; /* Otherwise work out how many bytes we have to consume to become realigned. */ consume=ALIGN_SIZE-bump; /* If there are not enough bytes left in the block to allow the free pointer */ /* to be aligned, then simply set the available bytes to zero and return. It */ /* doesn't matter if we don't achieve alignment in this case as if */ /* mm_nfree==0, nothing can ever be allocated at the misaligned address. */ if (consume>p_mm->mm_nfree) {p_mm->mm_nfree=0; return;} /* Consume the bytes required to align the free pointer. */ p_mm->mm_pfree += consume; p_mm->mm_nfree -= consume; /* Check that we have properly aligned the free pointer. */ as_cold((((ulong) p_mm->mm_pfree) & ALIGN_MASK)==0, "mm_align: Failed to align."); } /******************************************************************************/ LOCAL p_mm_t mm_newblk P_((size_t)); LOCAL p_mm_t mm_newblk(blk_len) /* Creates a new block containing (after alignment) at least blk_len bytes. */ /* Returns a pointer to the header for the block. */ size_t blk_len; { p_mm_t p_mm; ubyte_ *p_bl; /* Allocate the header and the block itself. Because we are guaranteeing */ /* that the resultant block will have at least blk_len bytes free, we have */ /* to take into account alignment and add in ALIGN_SIZE when requesting mem. */ p_mm=(p_mm_t ) malloc((size_t) sizeof(mm_t)); p_bl=(ubyte_ *) malloc((size_t) (blk_len+ALIGN_SIZE)); if (p_mm==NULL || p_bl==NULL) { fprintf(stderr,"mm_newblk: Out of memory!\n"); fprintf(stderr,"FunnelWeb doesn't cope well when it runs out of memory.\n"); fprintf(stderr,"It falls in a heap just as it is about to now.\n"); as_bomb("Stand by for an ungraceful termination!"); } /* Fill in the fields of the block header. */ p_mm->mm_mhead = MAGIC_HEAD; p_mm->mm_pblok = p_bl; p_mm->mm_pfree = p_bl; p_mm->mm_nfree = blk_len+ALIGN_SIZE; p_mm->mm_pnext = NULL; p_mm->mm_mtail = MAGIC_TAIL; /* Align the free pointer in the header block. */ mm_align(p_mm); /* Return a pointer to the header block we created. */ return p_mm; } /******************************************************************************/ LOCAL p_void mm_alloc P_((p_mm_t *,size_t)); LOCAL p_void mm_alloc(pp_mm,bytes) /* 'pp_mm' must be a pointer to either p_perm or p_temp. */ /* 'bytes' is the number of bytes required. */ /* Allocates the required memory and returns an aligned pointer to it. */ /* Bombs the program if the memory is not available. */ p_mm_t *pp_mm; size_t bytes; { p_mm_t p_from; /* Pointer to header for block from which we finally alloc.*/ ubyte_ *p_result; /* The result pointer returned to the caller. */ /* If the list is empty, create a "buffer block" and put it in the list. */ if (*pp_mm==NULL) *pp_mm=mm_newblk((size_t) MM_BLOCK); /* If there is room in the current buffer block, we can allocate directly. */ /* Note that we may be allocating a "big" block here, but as long as it fits */ /* into the free space of the current buffer block, we don't care. */ if ((*pp_mm)->mm_nfree >= bytes) {p_from = *pp_mm; goto dole_out;} /* At this point we know that there is not enough space in the current */ /* buffer block. This could mean that we have an extra big allocation on our */ /* hands in which case, we should malloc up a block specially for this */ /* request. It could also mean that we are running out of space in our */ /* buffer block in which case a new one must be allocated. */ if (bytes >= MM_BIG) { /* If the request is BIG, allocate a special block for it and insert the */ /* block in the block list just after the buffer block, leaving the */ /* buffer block the first in the block list. */ p_mm_t p_tmp=mm_newblk(bytes); p_tmp->mm_pnext=(*pp_mm)->mm_pnext; (*pp_mm)->mm_pnext=p_tmp; p_from=p_tmp; } else { /* If the request is not big, our buffer block is probably too empty and */ /* so it is time to create a new one. Allocate a new buffer block and */ /* make it the new head of this block list. Note that by giving up on the */ /* previous buffer, we waste at most 1/16 of the block we are giving up */ /* on. This cost is reasonable in exchange for all the speed this gives. */ p_mm_t p_tmp=mm_newblk((size_t) MM_BLOCK); p_tmp->mm_pnext=(*pp_mm); (*pp_mm)=p_tmp; p_from=p_tmp; } dole_out: /* Jump here to dole out 'bytes' bytes from block 'p_from'. */ p_result=p_from->mm_pfree; p_from->mm_pfree += bytes; p_from->mm_nfree -= bytes; mm_align(p_from); /* Ensure that the pointer being returned is properly aligned. */ as_cold((((ulong) p_result) & ALIGN_MASK)==0, "mm_alloc: Result is misaligned."); /* Return the result. */ return (p_void) p_result; } /******************************************************************************/ EXPORT p_void mm_perm(bytes) size_t bytes; { #if MEMTRACE printf("TRACE: mm_perm: Allocating %lu bytes of permanent memory.\n", (ulong) bytes); #endif #if MEMSTATS tot_perm += bytes; #endif return mm_alloc(&p_perm,bytes); } /******************************************************************************/ EXPORT p_void mm_temp(bytes) size_t bytes; { #if MEMTRACE printf("TRACE: mm_temp: Allocating %lu bytes of temporary memory.\n", (ulong) bytes); #endif #if MEMSTATS reg_blk(bytes); #endif return mm_alloc(&p_temp,bytes); } /******************************************************************************/ EXPORT void mm_zapt() /* This function frees all the memory blocks recorded in the temporary */ /* memory list. We choose to free them rather than merely re-using them */ /* directly because they may not all be the same size, and we want to give */ /* the built-in memory manager a chance to smooth out the heap. */ { #if MEMTRACE printf("TRACE: mm_zapt: Attempting to release all temporary memory.\n"); #endif while (p_temp != NULL) { p_mm_t p_mm=p_temp; mm_check(p_temp); #if MEMTRACE printf("TRACE: mm_zapt: Deallocating a big chunk of temporary memory.\n"); #endif free(p_temp->mm_pblok); p_temp=p_temp->mm_pnext; free(p_mm); } #if MEMSTATS numsiz=0; #endif } /******************************************************************************/ EXPORT void mm_repo() { #if MEMSTATS ulong i; ulong sum = 0; printf("Temporary Memory Block Summary\n"); printf("------------------------------\n"); for (i=0; i #include "style.h" #include "as.h" #include "data.h" #include "memory.h" #include "misc.h" #include "writfile.h" /******************************************************************************/ EXPORT void wr_s (s) char *s; {wf_wr(&f_s,s);} EXPORT void wr_j (s) char *s; {wf_wr(&f_j,s);} EXPORT void wr_l (s) char *s; {wf_wr(&f_l,s);} EXPORT void wl_s (s) char *s; {wf_wr(&f_s,s); wf_wr(&f_s,"\n");} EXPORT void wl_j (s) char *s; {wf_wr(&f_j,s); wf_wr(&f_j,"\n");} EXPORT void wl_l (s) char *s; {wf_wr(&f_l,s); wf_wr(&f_l,"\n");} EXPORT void wr_sj (s) char *s; {wr_s(s); wr_j(s);} EXPORT void wl_sj (s) char *s; {wl_s(s); wl_j(s);} EXPORT void wr_sjl(s) char *s; {wr_s(s); wr_j(s); wr_l(s);} EXPORT void wl_sjl(s) char *s; {wl_s(s); wl_j(s); wl_l(s);} /******************************************************************************/ EXPORT char *chabbrev(ch) int ch; { switch (ch) { case 0: return "NUL"; case 1: return "SOH"; case 2: return "STX"; case 3: return "ETX"; case 4: return "EOT"; case 5: return "ENQ"; case 6: return "ACK"; case 7: return "BEL"; case 8: return "BS"; case 9: return "HT"; case 10: return "LF"; case 11: return "VT"; case 12: return "FF"; case 13: return "CR"; case 14: return "SO"; case 15: return "SI"; case 16: return "DLE"; case 17: return "DC1"; case 18: return "DC2"; case 19: return "DC3"; case 20: return "DC4"; case 21: return "NAK"; case 22: return "SYN"; case 23: return "ETB"; case 24: return "CAN"; case 25: return "EM"; case 26: return "SUB"; case 27: return "ESC"; case 28: return "FS"; case 29: return "GS"; case 30: return "RS"; case 31: return "US"; case 127:return "DEL"; default: return ""; } } /******************************************************************************/ EXPORT sign signof(n) long n; { if (n<0) return -1; if (n>0) return 1; return 0; } /******************************************************************************/ EXPORT char * eq_files(name1,name2,p_result) char *name1; char *name2; bool *p_result; { FILE *file1; FILE *file2; /* The following three lines define two comparison buffers. The next part of */ /* the two files being compared are read into these buffers and compared. */ /* Using the buffers allows bulk reads, which speeds things up considerably. */ #define CMPBUFSIZ 16384 STAVAR ubyte_ *buf1 = NULL; STAVAR ubyte_ *buf2 = NULL; /* Set the default result to be FALSE (no match). */ *p_result=FALSE; /* Allocate the comparison buffers if they are not already allocated. */ if (buf1 == NULL) { buf1=(ubyte_ *) mm_perm((size_t) CMPBUFSIZ); buf2=(ubyte_ *) mm_perm((size_t) CMPBUFSIZ); } /* Open, for binary reading, the two files to be compared. */ file1=fopen(name1,"rb"); if (file1 == FOPEN_F) return "Error opening the first file."; file2=fopen(name2,"rb"); if (file2 == FOPEN_F) {fclose(file1);return "Error opening the second file.";} while (TRUE) { /* Compare a chunk. */ size_t len1; size_t len2; /* Read a chunk from each file. */ len1=fread(buf1,(size_t) 1,(size_t) CMPBUFSIZ,file1); len2=fread(buf2,(size_t) 1,(size_t) CMPBUFSIZ,file2); if (ferror(file1)) return "Compare: Error reading the first file."; if (ferror(file2)) return "Compare: Error reading the second file."; /* Compare the two chunks. */ if (len1 != len2) break; if (len1 == 0) {*p_result=TRUE; break;} if (memcmp(buf1,buf2,(size_t) len1) != 0) break; } if (fclose(file1) == FCLOSE_F) {*p_result=FALSE; return "Error closing the first file.";} if (fclose(file2) == FCLOSE_F) {*p_result=FALSE; return "Error closing the second file.";} /* If we have reached this point, we can be sure that no errors occurred. */ return NULL; } /******************************************************************************/ EXPORT bool fexists(fn) char *fn; { FILE *file; bool success; file=fopen(fn,"rb"); if (file==NULL) return FALSE; success= (fclose(file) != FCLOSE_F); as_cold(success, "fexists: Error closing file whose existence is being tested!"); return TRUE; } /******************************************************************************/ EXPORT char *fn_temp() { STAVAR uword filnum=1; STAVAR fn_t fn; do { sprintf(fn,"fwtf%04lu.tmp",(ulong) filnum); filnum++; } while (fexists(fn)); return fn; } /******************************************************************************/ EXPORT void strupper(s) char *s; { while (*s != EOS) { *s=toupper(*s); s++; } } /******************************************************************************/ EXPORT void fnident(fn,ident) char *fn; char *ident; { char *p = fn; char *x = fn; char *q = ident; /* Set x to point to the first character of the identifier. */ while (*p != EOS) if (*p++ == FN_DELIM) x = p; /* Copy characters until we hit the end of the identifier. */ while ((*x != EOS) && (*x != '.')) *q++ = *x++; *q = EOS; } /******************************************************************************/ EXPORT bool maisdef (p_ma) p_ma_t p_ma; { as_cold(p_ma->ma_minlev <= MAXLIBLEV + 1,"maisdef: Bad ma_minlev value."); return (p_ma->ma_minlev < (MAXLIBLEV + 1)); } /******************************************************************************/ /* End of MISC.C */ /******************************************************************************/ handed over to */ /* this package which provides services that satisfy the conditions outlined */ /* above. */ /* */ /******************************************************************************/ /* Ensufw_src/source/misc.h 644 0 0 14575 6716661052 7741 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. 08-May-1999 RNW Added function fn_ident. 09-May-1999 RNW Added function maisdef. ##############################################################################*/ /******************************************************************************/ /* MISC.H */ /******************************************************************************/ /* */ /* This package contains a ragbag of FunnelWeb-specific functions that didn't */ /* seem to have a home anywhere else. */ /* */ /******************************************************************************/ #include "style.h" #include "data.h" /******************************************************************************/ /* The following functions each write a string to one or more output streams. */ /* The code is as follows: */ /* wr - means write the string only. */ /* wl - means write the string followed by a '\n'. */ /* s - The f_s output stream (the console/screen). */ /* j - The f_j output stream (the journal file). */ /* l - The f_l output stream (the listing file). */ /* These functions are hard wired to the f_s, f_j, and f_l global variables. */ EXPORT void wr_s P_((char *)); EXPORT void wr_j P_((char *)); EXPORT void wr_l P_((char *)); EXPORT void wl_s P_((char *)); EXPORT void wl_j P_((char *)); EXPORT void wl_l P_((char *)); EXPORT void wr_sj P_((char *)); EXPORT void wl_sj P_((char *)); EXPORT void wr_sjl P_((char *)); EXPORT void wl_sjl P_((char *)); /******************************************************************************/ EXPORT char *chabbrev P_((int)); /* If the argument is non-printable in the range [0,127], returns a pointer */ /* to a constant string containing the mnemonic abbreviation for the */ /* character (e.g. 10="LF"). Otherwise returns the empty string. */ /******************************************************************************/ EXPORT sign signof P_((long)); /* Returns -1 if its argument is negative. */ /* Returns 0 if its argument is zero. */ /* Returns 1 if its argument is positive. */ /******************************************************************************/ EXPORT char * eq_files P_((char *,char *,bool *)); /* Performs an exact binary comparison of the files named name1 and name2. */ /* If there is no error during the comparison, returns NULL and the boolean */ /* parameter carries the result of the comparison with TRUE=>Files identical. */ /* If there is an error during the comparison, the boolean parameter is set */ /* to FALSE and the function returns a pointer to a string describing the */ /* error in terms of "the first file" and "the second file". */ /******************************************************************************/ EXPORT bool fexists P_((char *)); /* Returns TRUE iff a file of the name given in the parameter exists. */ /* (Does this by attempting to open the file. If it succeeds, it closes it */ /* again). */ /******************************************************************************/ EXPORT char *fn_temp P_((void)); /* Creates a filename (not containing a directory component) for which there */ /* is no corresponding file in the current directory. */ /* Returns a pointer to a static array containing the filename. */ /* Each time this function is called, the new filename overwrites the old. */ /* This function was created after it was discovered that, on some systems, */ /* the standard library function "tmpnam" returns the name of a file in the */ /* /tmp partition. This would not be a problem were it not for the fact that */ /* generally, files cannot be renamed across partitions! */ /******************************************************************************/ EXPORT void strupper P_((char *)); /* Converts all lower case letters in the argument string to upper case. */ /******************************************************************************/ EXPORT void fnident P_((char *,char *)); /* First argument must be a pathname of no more than PATHNAME_MAX chars. */ /* Second argument must be string buffer of PATHNAME_MAX+1 chars. */ /* Writes the filename identifier of the first string to the buffer. */ /******************************************************************************/ EXPORT bool maisdef P_((p_ma_t)); /* Returns TRUE iff its argument macro is defined. */ /******************************************************************************/ /* End of MISC.H */ /******************************************************************************/ ed. */ file1=fopen(name1,"rb"); if (file1 == FOPEN_F) return "Error opening the first file."; file2=fopen(name2,"rb"); if (fw_src/source/option.c 644 0 0 40466 6716661053 10310 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. 08-May-1999 RNW Added +u option for HTML documentation. ##############################################################################*/ /******************************************************************************/ /* OPTION.C */ /******************************************************************************/ #include #include "style.h" #include "as.h" #include "data.h" #include "machin.h" #include "misc.h" #include "option.h" /******************************************************************************/ LOCAL void wl_caret P_((ulong,void (*)(char *))); LOCAL void wl_caret(n,p_outf) /* Writes a caret at position n of an otherwise blank line. */ ulong n; void (*p_outf) P_((char *)); { as_cold(n<1000,"wl_caret: Argument is out of range."); while (--n > 0) (*p_outf)(" "); (*p_outf)("^\n"); } /******************************************************************************/ EXPORT void op_ini(p_op) p_op_t p_op; { p_op->op_f_b=FALSE; strcpy(&p_op->op_f_s[0],""); p_op->op_j_b=FALSE; strcpy(&p_op->op_j_s[0],""); strcpy(&p_op->op_i_s[0],""); p_op->op_o_b=TRUE; strcpy(&p_op->op_o_s[0],""); p_op->op_t_b=FALSE; strcpy(&p_op->op_t_s[0],""); p_op->op_u_b=FALSE; strcpy(&p_op->op_u_s[0],""); p_op->op_l_b=TRUE; strcpy(&p_op->op_l_s[0],""); p_op->op_d_b=FALSE; p_op->op_c_i=2; p_op->op_q_b=FALSE; p_op->op_s_b=FALSE; p_op->op_s_i=1; p_op->op_w_b=FALSE; p_op->op_w_i=80; p_op->op_x_b=FALSE; strcpy(&p_op->op_x_s[0],""); p_op->op_k_b=FALSE; p_op->op_b1_b=FALSE; p_op->op_b2_b=FALSE; p_op->op_b3_b=FALSE; p_op->op_b4_b=FALSE; p_op->op_b5_b=FALSE; p_op->op_b6_b=FALSE; p_op->op_b7_b=FALSE; p_op->op_h_b=FALSE; strcpy(&p_op->op_h_s[0],"menu"); } /******************************************************************************/ EXPORT bool op_add(p_op,p_cl,p_outf) p_op_t p_op; p_cl_t p_cl; void (*p_outf) P_((char *)); { op_t op_save; /* Saves *p_op so it can be restored later. */ char *comline = (char *) p_cl; /* Pointer to the command line to be parsed. */ char *p; /* Handy parsing pointer. */ bool seen_error = FALSE; /* TRUE iff one or more errors seen. */ #define ECHO_CL {if (!seen_error)\ {(*p_outf)(comline);(*p_outf)("\n"); seen_error=TRUE;}} /* Save the parameter option structure so that we can restore it */ /* if an error occurs later on. */ ASSIGN(op_save,*p_op); /* Check to make sure that the command line is not too long. */ /* This error should really never occur. */ p=comline; while (*p++ != EOS) if ((p-comline) > COMLINE_MAX) { (*p_outf)("FunnelWeb command line syntax error.\n"); (*p_outf)("The entire command line is too long.\n"); sprintf(linet1,"The maximum command line length is %u characters.\n", (unsigned) COMLINE_MAX); (*p_outf)(linet1); goto failure; } /* Check that the command line contains only printables. */ p=comline; while (*p != EOS) { if (!isascprn(*p)) { (*p_outf)("FunnelWeb command line syntax error.\n"); (*p_outf)("Command line contains one or more non-printables.\n"); sprintf(linet1,"The first is at column %u.\n",(unsigned) (1+p-comline)); (*p_outf)(linet1); goto failure; } p++; } /* Now parse each option. */ p=comline; while (TRUE) {/* This loop processes one command line parameter (option) per iteration. */ char *p_startopt; /* Points to the start of the parameter. */ bool opsign; /* The sign of the current option (+=TRUE). */ bool opsign_active; /* TRUE => (+ or -). FALSE => (=). */ char letter; /* Letter of current option. */ cl_t cl_temp; /* Parameter string of the current option. */ fn_t fn_temp; /* Parameter string of the current option. */ int i; /* Handy int used to feed sscanf. */ /* Skip first parameter or rest of previous parameter after syntax error. */ while ((*p!=' ') && (*p!=EOS)) p++; /* Skip blanks between parameters. */ while (*p==' ') p++; /* At this point we are either at the start of a parameter or at EOS. */ /* Finish if we are at the EOS. */ if (*p==EOS) break; /* p now points to the next parameter (option). Make a note of its start. */ p_startopt=p; /* This switch statement parses the sign and letter characters. */ switch (*p) { case '-': opsign=FALSE; opsign_active=TRUE; p++; goto parse_letter; case '+': opsign=TRUE; opsign_active=TRUE; p++; goto parse_letter; case '=': opsign_active=FALSE; p++; goto parse_letter; parse_letter: /* We have seen a sign. There should be a following letter. */ letter = *p; if (!isalpha(letter)) { ECHO_CL; wl_caret(p-comline,p_outf); (*p_outf)("FunnelWeb command line syntax error.\n"); (*p_outf)("Option letter expected here.\n"); continue; /* Skip to the next parameter. */ } p++; break; default: /* If no sign the option is a NAME option and defaults to +F. */ opsign=TRUE; opsign_active=TRUE; letter='F'; break; } /* End switch */ /* Assert: p points to the parameter string of the option. */ /* Copy the parameter string into the holding variable cl_temp. */ {char *q; q = &cl_temp[0]; while ((*p!=EOS) && (*p!=' ')) *q++ = *p++; *q=EOS; } /* As COMLINE_MAX can be greater than PATHNAME_MAX, we have to be careful */ /* that the user is not about to blow our filename buffer. */ if (strlen(cl_temp) > PATHNAME_MAX) { ECHO_CL; wl_caret(p_startopt-comline,p_outf); (*p_outf)("FunnelWeb command line syntax error.\n"); (*p_outf)("Option parameter string is too long.\n"); sprintf(linet1,"The maximum option parameter length is %u characters.\n", (unsigned) PATHNAME_MAX); (*p_outf)(linet1); continue; /* Skip to next parameter. */ } /* Now that we know that the parameter is not too big, we can copy it */ /* into a temporary variable of filename type. */ strcpy(&fn_temp[0],&cl_temp[0]); /* At this point p points to the character following the option that */ /* we have just scanned. This is either a blank or an EOS. */ /* The current option is held in (opsign,opsign_active,letter,fn_temp). */ /* Now we apply the option to the option record. */ switch (toupper(letter)) { case 'F': if (opsign_active) p_op->op_f_b=opsign; strcpy(&p_op->op_f_s[0],&fn_temp[0]); break; case 'J': if (opsign_active) p_op->op_j_b=opsign; strcpy(&p_op->op_j_s[0],&fn_temp[0]); break; case 'I': strcpy(&p_op->op_i_s[0],&fn_temp[0]); break; case 'O': if (opsign_active) p_op->op_o_b=opsign; strcpy(&p_op->op_o_s[0],&fn_temp[0]); break; case 'T': if (opsign_active) p_op->op_t_b=opsign; strcpy(&p_op->op_t_s[0],&fn_temp[0]); break; case 'U': if (opsign_active) p_op->op_u_b=opsign; strcpy(&p_op->op_u_s[0],&fn_temp[0]); break; case 'L': if (opsign_active) p_op->op_l_b=opsign; strcpy(&p_op->op_l_s[0],&fn_temp[0]); break; case 'D': if (opsign_active) p_op->op_d_b=opsign; if (strlen(fn_temp)>0) { ECHO_CL; wl_caret(3+p_startopt-comline,p_outf); (*p_outf)("FunnelWeb command line syntax error.\n"); (*p_outf)("The D option does not take an argument.\n"); } break; case 'C': if ((sscanf(&fn_temp[0],"%d",&i) != 1) || (i<0) || (100op_c_i=i; break; case 'Q': if (opsign_active) p_op->op_q_b=opsign; if (strlen(fn_temp)>0) { ECHO_CL; wl_caret(3+p_startopt-comline,p_outf); (*p_outf)("FunnelWeb command line syntax error.\n"); (*p_outf)("The Q option does not take an argument.\n"); } break; case 'S': if (opsign_active) p_op->op_s_b=opsign; if (strlen(fn_temp)==0) break; if ((sscanf(&fn_temp[0],"%d",&i) != 1) || (i<0) || (100op_s_i=i; break; case 'W': if (opsign_active) p_op->op_w_b=opsign; if (strlen(fn_temp)==0) break; if ((sscanf(&fn_temp[0],"%d",&i) != 1) || (i<0) || (1000op_w_i=i; break; case 'X': if (opsign_active) p_op->op_x_b=opsign; strcpy(&p_op->op_x_s[0],&fn_temp[0]); break; case 'K': if (opsign_active) p_op->op_k_b=opsign; if (strlen(fn_temp)>0) { ECHO_CL; wl_caret(3+p_startopt-comline,p_outf); (*p_outf)("FunnelWeb command line syntax error.\n"); (*p_outf)("The K option does not take an argument.\n"); } break; case 'H': if (opsign_active) p_op->op_h_b=opsign; if (strlen(&fn_temp[0])>0) if (strlen(&fn_temp[0]) > HL_NMLEN) { ECHO_CL; wl_caret(3+p_startopt-comline,p_outf); (*p_outf)("FunnelWeb command line syntax error.\n"); (*p_outf)("The H option string argument is too long.\n"); (*p_outf)("Try +Hmenu for a list of help message names.\n"); } else if (hel_num(&fn_temp[0]) == HL_ERR) { ECHO_CL; wl_caret(3+p_startopt-comline,p_outf); (*p_outf)("FunnelWeb command line syntax error.\n"); (*p_outf)("Unrecognised message name in argument to H option.\n"); (*p_outf)("Try +Hmenu for a list of help message names.\n"); } else strcpy(&p_op->op_h_s[0],&fn_temp[0]); break; case 'B': { uword i; if (strlen(fn_temp)==0) { ECHO_CL; wl_caret(3+p_startopt-comline,p_outf); (*p_outf)("FunnelWeb command line syntax error.\n"); (*p_outf)("The B option must be followed by one or more digits.\n"); (*p_outf)("The digits must be in the range 1..7.\n"); break; } for (i=0;i'7') { ECHO_CL; wl_caret(2+p_startopt-comline+(1+i),p_outf); (*p_outf)("FunnelWeb command line syntax error.\n"); (*p_outf)("Error: Characters in B argument must be '1'..'7'.\n"); goto endbop; } if (opsign_active) for (i=0;iop_b1_b=opsign; break; case '2': p_op->op_b2_b=opsign; break; case '3': p_op->op_b3_b=opsign; break; case '4': p_op->op_b4_b=opsign; break; case '5': p_op->op_b5_b=opsign; break; case '6': p_op->op_b6_b=opsign; break; case '7': p_op->op_b7_b=opsign; break; default: as_bomb("op_add: b option case defaulted."); } endbop: break; } default: ECHO_CL; wl_caret(2+p_startopt-comline,p_outf); (*p_outf)("FunnelWeb command line syntax error.\n"); (*p_outf)("Error: Unknown option letter.\n"); (*p_outf)("Legal option letters are FIOTLCSWPXZ.\n"); (*p_outf)("(Note: But P is not yet implemented!)\n"); break; } } /* End while. */ if (seen_error) goto failure; return TRUE; failure: ASSIGN(*p_op,op_save); return FALSE; } /******************************************************************************/ EXPORT void op_wri(p_op,p_outf) p_op_t p_op; void (*p_outf) P_((char *)); { #define STC(BOOLV) ((BOOLV)?'+':'-') sprintf(linet1," %cB1 %cB2 %cB3 %cB4 %cB5 %cB6 %cB7\n", STC(p_op->op_b1_b), STC(p_op->op_b2_b), STC(p_op->op_b3_b), STC(p_op->op_b4_b), STC(p_op->op_b5_b), STC(p_op->op_b6_b), STC(p_op->op_b7_b));(*p_outf)(linet1); sprintf(linet1," +C%u\n" , (unsigned) p_op->op_c_i );(*p_outf)(linet1); sprintf(linet1," %cD\n" , STC(p_op->op_d_b) );(*p_outf)(linet1); sprintf(linet1," %cF%s\n", STC(p_op->op_f_b), p_op->op_f_s );(*p_outf)(linet1); sprintf(linet1," %cH%s\n", STC(p_op->op_h_b), p_op->op_h_s );(*p_outf)(linet1); sprintf(linet1," +I%s\n" , p_op->op_i_s );(*p_outf)(linet1); sprintf(linet1," %cJ%s\n", STC(p_op->op_j_b), p_op->op_j_s );(*p_outf)(linet1); sprintf(linet1," %cK\n" , STC(p_op->op_k_b) );(*p_outf)(linet1); sprintf(linet1," %cL%s\n", STC(p_op->op_l_b), p_op->op_l_s );(*p_outf)(linet1); sprintf(linet1," %cO%s\n", STC(p_op->op_o_b), p_op->op_o_s );(*p_outf)(linet1); sprintf(linet1," %cQ\n" , STC(p_op->op_q_b) );(*p_outf)(linet1); sprintf(linet1," %cS%u\n", STC(p_op->op_s_b), (unsigned) p_op->op_s_i );(*p_outf)(linet1); sprintf(linet1," %cT%s\n", STC(p_op->op_t_b), p_op->op_t_s );(*p_outf)(linet1); sprintf(linet1," %cU%s\n", STC(p_op->op_u_b), p_op->op_u_s );(*p_outf)(linet1); sprintf(linet1," %cW%u\n", STC(p_op->op_w_b), (unsigned) p_op->op_w_i );(*p_outf)(linet1); sprintf(linet1," %cX%s\n", STC(p_op->op_x_b), p_op->op_x_s );(*p_outf)(linet1); } /******************************************************************************/ /* End of OPTION.C */ /******************************************************************************/ l_caret(p-comline,p_outf); (*p_outf)("FunnelWeb command line syntax error.\n"); (*p_outf)("Option letter expected here.\n"); continue; /* Skip to the next parametefw_src/source/option.h 644 0 0 17240 6716661054 10310 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* OPTION.H */ /******************************************************************************/ /* Ensure that the body of this header file is included at most once. */ #ifndef DONE_OPTION #define DONE_OPTION /******************************************************************************/ #include "style.h" #include "machin.h" #include "help.h" /******************************************************************************/ /* THE B7 OPTION */ /* ------------- */ /* When FunnelWeb was first ported to different machines and the regression */ /* testing was activated, a most irritating occurance was the failure of the */ /* results of tests on different machines to compare, because of minor */ /* differences in implementation. For example, error messages that contained */ /* file names would differ because the directory name on different machines */ /* was different. Another example was error messages that quoted */ /* implementation limits. This problem was solved by creating the B7 option */ /* which instructs FunnelWeb to suppress all output that is */ /* non-deterministic, machine specific, or which in any other way would cause */ /* an unncessary failure of the test suite. */ /* The following symbol provides a simple replacement for filenames in error */ /* messages. */ #define SUPPNAME "<>" #define SUPPVAL "<>" /******************************************************************************/ /* The following structure stores all the information that can be */ /* communicated in one or more command lines. An important aspect of the */ /* structure is that it is totally self contained; it does not contain any */ /* pointers to outside structures such as command lines. */ /* The rather strange field names are explained as follows: */ /* 1) Local names must be distinct to 8 characters (for portability). */ /* 2) All structure field names should be unique (for portability). */ /* Some of the older compilers use a single field structure name space. */ /* 3) The op_ is used as a prefix for entities in this whole package. */ /* 4) The next letter is the option letter itself. It is not intended that */ /* the command line option names be tightly bound to the internal */ /* identifier names -- the command line names are just convenient. */ /* 5) The next letter gives the type: [B]oolean, [S]tring, [I]nteger. */ typedef struct { bool op_f_b; /* The input file. */ fn_t op_f_s; bool op_j_b; /* The journal file. */ fn_t op_j_s; fn_t op_i_s; /* Include file (default). */ bool op_o_b; /* Product files (default). */ fn_t op_o_s; bool op_t_b; /* Tex file (default). */ fn_t op_t_s; bool op_u_b; /* HTML file (default). */ fn_t op_u_s; bool op_l_b; /* Listing file (default). */ fn_t op_l_s; bool op_d_b; /* Delete output files that have not changed? */ uword op_c_i; /* Lines of error context in listing file. */ bool op_q_b; /* Quiet mode. Console chatter suppressed if turned on. */ bool op_s_b; /* Send errors to the screen with specified context. */ uword op_s_i; bool op_w_b; /* Set maximum line length of product files. */ uword op_w_i; bool op_x_b; /* Execute specified file in FunnelWeb shell. */ fn_t op_x_s; bool op_k_b; /* Interactive (keyboard) mode. */ /* Dump flags: */ bool op_b1_b; /* Dump input file image. */ bool op_b2_b; /* Dump line list. */ bool op_b3_b; /* Dump token list. */ bool op_b4_b; /* Dump macro table. */ bool op_b5_b; /* Dump document list. */ bool op_b6_b; /* Dump time summary. */ bool op_b7_b; /* Don't write anything non-deterministic or machine */ /* specific. This option is designed to assist in */ /* regression testing. */ bool op_h_b; /* Help messages. */ hn_t op_h_s; } op_t; typedef op_t *p_op_t; /******************************************************************************/ EXPORT void op_ini P_((p_op_t)); /* Initializes the specified options structure with default values. */ /* This includes ALL the fields of the structure. If, for example, the */ /* default value of op_l_b is FALSE, op_l_s will be set to the empty string. */ EXPORT bool op_add P_((p_op_t,p_cl_t,void (*)(char *))); /* Parses the specified command line and places the information given in the */ /* command line into specific fields of the options structure. The options */ /* structure should be entirely defined upon entry, as this parsing function */ /* only ADDS information present in the command line. Call op_ini if you */ /* don't want to initialize all the fields manually. */ /* The comline string should start with the leading command (e.g. "fw"). */ /* However, he leading command is ignored. */ /* Returns FALSE: One or more syntax errors have been detected. One or error */ /* messages have been written using the funtion argument. */ /* *p_op unchanged. */ /* Returns TRUE : No syntax errors. Comline information placed in *p_op. */ EXPORT void op_wri P_((p_op_t,void (*)(char *))); /* Writes a text representation of the specified options record using the */ /* function argument. */ /******************************************************************************/ /* For #ifndef preventing multiple inclusion of the body of this header file. */ #endif /******************************************************************************/ /* End of OPTION.H */ /******************************************************************************/ op_b7_b));(*p_outf)(linet1); sprintf(linet1," +C%u\n" , (unsigned) p_op->op_c_i );(*p_outf)(linet1); sprintf(linet1," %cD\n" , STC(p_op->op_d_b) );(*p_outf)(linet1); sprintf(linet1," %cF%s\n", STC(p_op->op_f_b), p_op->op_f_s );(*p_outf)(linet1); sprintf(linet1," %cH%s\n", STC(p_op->ofw_src/source/parser.c 644 0 0 142466 6717361735 10324 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. 11-Apr-1999 RNW pr_plist: Added "No closing @)..." error message. 09-May-1999 RNW Added support for library macros. ##############################################################################*/ /******************************************************************************/ /* PARSER.C */ /******************************************************************************/ #include #include "style.h" #include "as.h" #include "data.h" #include "lister.h" #include "machin.h" #include "mapper.h" #include "memory.h" #include "misc.h" #include "parser.h" #include "section.h" #include "table.h" /******************************************************************************/ #define DUMMYINT 0 /* It doesn't matter what this value is!!! */ #define TKPS &(p_tk->tk_ps) /* A commonly used construct. */ /******************************************************************************/ /* The following variables look after sections. */ LOCVAR sn_t last_sn; /* Hierarchical section number of last section. */ LOCVAR ps_t pssection; /* Position of last section. */ LOCVAR p_dc_t p_secdc; /* Pointer to current section document component. */ LOCVAR tk_t *p_tk; /* Pointer to the current token (a structure). */ LOCVAR ulong sequence; /* Current macro sequence number. */ LOCVAR jmp_buf jmp_pos; /* Setjmp() position of main parsing loop. */ LOCVAR p_ma_t glo_p_ma; /* Macro being defined. */ LOCVAR ubyte glo_mdlv; /* Library level of macro being defined. */ LOCVAR p_md_t glo_p_md; /* Current definition part of macro being defined. */ /******************************************************************************/ /* Comparison Functions */ /******************************************************************************/ LOCAL sign cm_name P_((name_t *,name_t *)); LOCAL sign cm_name(name1,name2) /* Compares two names and returns: */ /* -1 if name1 < name2 */ /* 0 if name1 = name2 */ /* 1 if name1 > name2 */ /* Provides a full ordering on the set of names. */ name_t *name1; name_t *name2; { return signof(strcmp(&(*name1)[0],&(*name2)[0])); } /******************************************************************************/ LOCAL sign eq_txst P_((p_scls_t,char *)); LOCAL sign eq_txst(p_scls,p_str) /* The first argument is a list of text scraps. */ /* The second argument is an ordinary string. */ /* Returns TRUE iff the two are identical. Otherwise FALSE. */ p_scls_t p_scls; char *p_str; { /* To compare the scrap list with the string, we run through the scrap list */ /* comparing the bytes its scraps yield progressively with the string. */ /* The two scanning groups are (p_scls,p_sc,p_ch) and p_str. */ sc_t *p_sc; ls_fir(p_scls); ls_nxt(p_scls,PPV &p_sc); while (p_sc!=NULL) { /* The loop body compares a single scrap pointed to by p_sc. */ char *p_ch; for (p_ch=p_sc->sc_first; p_ch<=p_sc->sc_last; p_ch++) { if (*p_str==EOS || *p_str != *p_ch) return FALSE; p_str++; } ls_nxt(p_scls,PPV &p_sc); } return *p_str==EOS; } /******************************************************************************/ /* Parsing Primitives */ /******************************************************************************/ /* The following functions provide the basic parsing primitives used by the */ /* main parsing routines. */ /******************************************************************************/ LOCAL void next_tk P_((bool)); LOCAL void next_tk(iseoferr) /* This function reads the next token from the token list and places a */ /* pointer to the token (structure) in the global variable "token". */ /* The "iseoferr" determines whether a fuss should be made if the next token */ /* fetched is TK_EOF. If iseoferr==TRUE and the next token is TK_EOF, next_tk */ /* jumps to the main parsing loop. */ bool iseoferr; { ls_nxt(token_list,PPV &p_tk); as_cold(p_tk!=NULL,"next_tk: Attempted to read next token at EOF."); if (iseoferr && p_tk->tk_kind==TK_EOF) { lr_err(TKPS,"Ouch! High velocity encounter with end of file."); lr_mes(TKPS,"FunnelWeb expected something else when it hit the EOF."); longjmp(jmp_pos,DUMMYINT); /* Jump up to the main parsing loop. */ } } /******************************************************************************/ LOCAL void recover P_((void)); LOCAL void recover() /* Parsing functions call this function at points where a syntax error has */ /* has occurred that it is unlikely that the particular parsing function will */ /* be able to recover from on its own. In these situations, the parser */ /* resorts to a course grained syntactic error-recovery implemented by this */ /* function. The goal of the error recovery system is to skip tokens until */ /* the next major outer-level-syntax structure is encountered. These are: */ /* - A new section (@A etc.). */ /* - A macro definition (@$ or @O). */ /* - End of file. */ /* Once one of these three is found, "recover" raises the syntax exception */ /* which sends control to the main parsing loop which is the correct place */ /* to deal with a new, major syntactic construct. */ { lr_mes(TKPS,"Skipping after error to the next major construct..."); /* Skip to one of TK_NSEC,... */ while (TRUE) { tk_k_t k = p_tk->tk_kind; if (k==TK_NSEC || k==TK_MDEF || k==TK_FDEF || k==TK_EOF) break; next_tk(FALSE); } /* Keep the user informed. */ lr_mes(TKPS,"...skipped to here after the error."); /* Jump up to the main parsing loop. */ longjmp(jmp_pos,DUMMYINT); } /******************************************************************************/ LOCAL void genexerr P_((tk_k_t)); LOCAL void genexerr(tk_kind) /* Genexerr stands for GENerate EXpecting ERRor. */ /* Given a token kind, genexerr issues an error saying that the specified */ /* kind of token was expected. It then invokes recover() for error recovery. */ tk_k_t tk_kind; { switch (tk_kind) { /* Note: Not all token kinds are listed here. Only those token kinds that */ /* are passed to pr_token and check_tk by the main parsing routines are */ /* included here. There are some tokens that one never expects! */ case TK_NSEC: lr_err(TKPS,"Expecting '@*'."); break; case TK_ONAM: lr_err(TKPS,"Expecting '@<'."); break; case TK_ODEF: lr_err(TKPS,"Expecting '@{'."); break; case TK_CDEF: lr_err(TKPS,"Expecting '@}'."); break; case TK_EMPH: lr_err(TKPS,"Expecting '@/'."); break; case TK_CPAR: lr_err(TKPS,"Expecting '@)'."); break; case TK_QUOT: lr_err(TKPS,"Expecting '@\"'."); break; case TK_PARM: lr_err(TKPS,"Expecting one of [@1..@9]." ); break; case TK_TEXT: lr_err(TKPS,"Expecting a text character."); break; default: as_bomb("genexerr: Case defaulted."); } recover(); } /******************************************************************************/ LOCAL void pr_token P_((tk_k_t)); LOCAL void pr_token(tk_kind) /* Parses a single token of the specified kind. */ /* If the token is of the specified kind, gets the next token. */ /* If the token is not of the specified kind, generates an "expecting" error. */ tk_k_t tk_kind; { if (p_tk->tk_kind != tk_kind) genexerr(tk_kind); next_tk(TRUE); } /******************************************************************************/ LOCAL void check_tk P_((tk_k_t)); LOCAL void check_tk(tk_kind) /* Same as pr_token, but only checks that the token is OK. Does not move on. */ tk_k_t tk_kind; { if (p_tk->tk_kind != tk_kind) genexerr(tk_kind); } /******************************************************************************/ LOCAL void ass_tk P_((tk_k_t)); LOCAL void ass_tk(tk_kind) /* Aborts the program if the current token is not of the specified kind. */ /* This function is intended to perform internal consistency checks, and */ /* should not be considered to be part of the parsing operation. */ tk_k_t tk_kind; { as_cold(p_tk->tk_kind==tk_kind,"Parser.ass_tk: Incorrect token."); } /******************************************************************************/ LOCAL void ass_tks P_((tk_k_t,tk_k_t)); LOCAL void ass_tks(tk_kind1,tk_kind2) /* Same as ass_tk except it allows a choice of two token kinds. */ tk_k_t tk_kind1; tk_k_t tk_kind2; { as_cold((p_tk->tk_kind == tk_kind1) || (p_tk->tk_kind == tk_kind2), "Parser.ass_tks: Token is neither of two allowables."); } /******************************************************************************/ /* Main Parsing Functions */ /******************************************************************************/ /* The parse expression procedure is the only procedure for which a forward */ /* declaration is required. This is a product of the recursive definition of */ /* a FunnelWeb expression. */ LOCAL void pr_exp P_((p_ells_t *)); /******************************************************************************/ LOCAL void pr_text P_((p_scls_t *,bool *)); LOCAL void pr_text(pp_scls,p_white) /* This function parses a sequence of zero or more text tokens (until it runs */ /* into a non-text token) and constructs a list of scraps containing the text */ /* pointed to by the tokens. In addition the function writes TRUE to its */ /* second argument iff all of the text scraps are whitespace. */ p_scls_t *pp_scls; bool *p_white; { *pp_scls=ls_cre(sizeof(sc_t)); *p_white=TRUE; while (p_tk->tk_kind==TK_TEXT) { *p_white = *p_white && p_tk->tk_sc.sc_white; ls_add(*pp_scls,PV &p_tk->tk_sc); next_tk(FALSE); } } /******************************************************************************/ LOCAL void pr_white P_((p_scls_t *)); LOCAL void pr_white(pp_scls) /* Same as pr_text, but generates an error if the text is non-white. */ p_scls_t *pp_scls; { bool iswhite; ps_t ps; ASSIGN(ps,p_tk->tk_ps); pr_text(pp_scls,&iswhite); if (!iswhite) lr_err(&ps,"Expecting whitespace text."); } /******************************************************************************/ LOCAL void pr_name P_((char *)); LOCAL void pr_name(p_name) /* Parses a single FunnelWeb name (e.g. "@" and "@#K"). */ char *p_name; /* Really should be of type p_name_t but this caused trouble. */ { uword namelen = 0; /* Deal with the special case of a token name. */ if (p_tk->tk_kind==TK_NAME) { p_name[0]=p_tk->tk_gen; p_name[1]=EOS; next_tk(TRUE); return; } ass_tk(TK_ONAM); next_tk(TRUE); while (TRUE) switch (p_tk->tk_kind) { case TK_TEXT: { /* Copy the text token to the name array, checking all the time. */ char *p; for (p=p_tk->tk_sc.sc_first; p<=p_tk->tk_sc.sc_last; p++) { if (*p==EOL) { lr_err(TKPS,"Names cannot cross lines."); recover(); } namelen++; if (namelen>MACN_MAX) { lr_err(TKPS,"Name is too long."); sprintf(linet1, "The maximum length of a legal name is %lu characters.", (unsigned long) MACN_MAX); lr_mes(TKPS,linet1); recover(); } p_name[namelen-1] = *p; } next_tk(TRUE); break; } case TK_CNAM: /* We finish successfully if we hit a close name token "@>". */ p_name[namelen]=EOS; next_tk(TRUE); return; default: lr_err(TKPS,"Illegal character or symbol in name."); recover(); } /* End switch */ } /******************************************************************************/ LOCAL void pr_dctxt P_((void)); LOCAL void pr_dctxt() /* Parse a major text chunk. */ { dc_t dc; bool dummybool; ps_t pstext; ass_tk(TK_TEXT); ASSIGN(pstext,p_tk->tk_ps); pr_text(&dc.dc_text,&dummybool); ASSIGN(dc.dc_ps,pstext); dc.dc_kind=DC_TEXT; ls_add(document_list,PV &dc); } /******************************************************************************/ LOCAL void sendtype P_((ty_k_t)); LOCAL void sendtype(ty_kind) /* Send a document component of kind typesetter directive with no attributes. */ ty_k_t ty_kind; { dc_t dc; ASSIGN(dc.dc_ps,p_tk->tk_ps); dc.dc_kind = DC_TYPE; dc.dc_pty = (p_ty_t) mm_temp(sizeof(ty_t)); dc.dc_pty->ty_kind = ty_kind; ls_add(document_list,PV &dc); } /******************************************************************************/ LOCAL void pr_lit P_((void)); LOCAL void pr_lit() /* Parse a string delimited by literal typeset directives e.g. @{sloth@}. */ { /* Check and get past opening directive. */ ass_tk(TK_ODEF); sendtype(TY_OLIT); /* Move past the opening directive and parse the sandwich text. */ next_tk(TRUE); if (p_tk->tk_kind!=TK_TEXT) { lr_err(TKPS,"Text expected after open literal token \"@{\"."); if (p_tk->tk_kind==TK_CDEF) lr_mes(TKPS,"Sorry, empty literal strings are not allowed."); recover(); } pr_dctxt(); /* Check and parse the closing directive. */ pr_token(TK_CDEF); sendtype(TY_CLIT); } /******************************************************************************/ LOCAL void pr_emp P_((void)); LOCAL void pr_emp() /* Parse a string delimited by emphasis typeset directives e.g. @/sloth@/. */ { /* Check and get past opening directive. */ ass_tk(TK_EMPH); sendtype(TY_OEMP); /* Move past the opening directive and parse the sandwich text. */ next_tk(TRUE); if (p_tk->tk_kind!=TK_TEXT) { lr_err(TKPS,"Text expected after open emphasise token \"@/\"."); if (p_tk->tk_kind==TK_EMPH) lr_mes(TKPS,"Sorry, empty emphasised strings are not allowed."); recover(); } pr_dctxt(); /* Check and parse the closing directive. */ pr_token(TK_EMPH); sendtype(TY_CEMP); } /******************************************************************************/ LOCAL void pr_npag P_((void)); LOCAL void pr_npag() /* Parse a newpage token. */ { ass_tk(TK_NPAG); sendtype(TY_NPAG); pr_token(TK_NPAG); } /******************************************************************************/ LOCAL void pr_tocs P_((void)); LOCAL void pr_tocs() /* Parse a table of contents token. */ { ass_tk(TK_TOCS); sendtype(TY_TOCS); pr_token(TK_TOCS); } /******************************************************************************/ LOCAL void pr_skip P_((void)); LOCAL void pr_skip() /* Parse a skip token. */ { dc_t dc; ass_tk(TK_SKIP); ASSIGN(dc.dc_ps,p_tk->tk_ps); dc.dc_kind = DC_TYPE; dc.dc_pty = (p_ty_t) mm_temp(sizeof(ty_t)); dc.dc_pty->ty_kind = TY_SKIP; dc.dc_pty->ty_mm = p_tk->tk_gen; ls_add(document_list,PV &dc); pr_token(TK_SKIP); } /******************************************************************************/ LOCAL void pr_titl P_((void)); LOCAL void pr_titl() /* Parse a title token. Bascially moving bones from one grave to another. */ { dc_t dc; ass_tk(TK_TITL); ASSIGN(dc.dc_ps,p_tk->tk_ps); dc.dc_kind = DC_TYPE; dc.dc_pty = (p_ty_t) mm_temp(sizeof(ty_t)); dc.dc_pty->ty_kind = TY_TITL; dc.dc_pty->ty_font = p_tk->tk_gen / LRFT_PACK; dc.dc_pty->ty_align = p_tk->tk_gen % LRFT_PACK; ASSIGN(dc.dc_pty->ty_sc,p_tk->tk_sc); ls_add(document_list,PV &dc); pr_token(TK_TITL); } /******************************************************************************/ LOCAL void pr_sec P_((void)); LOCAL void pr_sec() /* Parse a new section marker ("@A.. and @*") and its optional name. */ { ps_t secps; /* Position of this new section. */ ubyte level; /* Level number of new section. */ bool has_name; /* Set to TRUE iff the section has a name. */ name_t name; /* Name of the section (if it has a name). */ /* If called, a new section marker must have been seen. */ ass_tk(TK_NSEC); /* Grab a copy of the position of the start of the section. */ ASSIGN(secps,p_tk->tk_ps); /* Grab the level number of the section marker. Move to the next token. */ level=p_tk->tk_gen; next_tk(TRUE); /* Check for a discontinuity in level. */ if (level>sn_lev(&last_sn)+1) { if (sn_lev(&last_sn)==0) lr_err(&secps,"The first section in a document must be an @A section."); else { sprintf(linet1,"The next section (at line %lu) is too deep.", (unsigned long) secps.ps_line); lr_mes(&pssection,linet1); lr_err(&secps,"This section is more than one level deeper than the last"); sprintf(linet1,"section (at line %lu). Example: @B followed by @D is not allowed.", (unsigned long) pssection.ps_line); lr_mes(&secps,linet1); } /* At this point we know that the section structure of the document is */ /* faulty and that the weaver will never be invoked. As such the */ /* principal concern becomes that of error recovery. The best we can do */ /* there is to set to the specified level regardless of how silly it is. */ /* This ensures that we generate section errors only relative to the */ /* previous section. Thus, we avoid cascades of errors, if, for example */ /* the user mistypes an @A at the beginning of a FunnelWeb document. */ /* Once an error has occurred we don't care about the actual numbers. */ sn_set(&last_sn,level); } /* Actually increment the section number at the specified level. */ sn_inc(&last_sn,level); /* Record the position. */ ASSIGN(pssection,secps); /* Parse optional name (e.g. "@"). */ if (p_tk->tk_kind==TK_ONAM || p_tk->tk_kind==TK_NAME) { pr_name(name); has_name=TRUE; } else { strcpy(name,"No name given"); has_name=FALSE; } /* Place all the information we have into a document component structure */ /* and add it to the document list. */ { dc_t dc; ASSIGN(dc.dc_ps,secps); dc.dc_kind = DC_TYPE; dc.dc_pty = (p_ty_t) mm_temp(sizeof(ty_t)); dc.dc_pty->ty_kind = TY_NSEC; ASSIGN(dc.dc_pty->ty_sn,last_sn); dc.dc_pty->ty_isnam = has_name; dc.dc_pty->ty_pname = (p_name_t) mm_temp(sizeof(name_t)); strcpy((string) dc.dc_pty->ty_pname,&name[0]); ls_add(document_list,PV &dc); ls_tai(document_list,PPV &p_secdc); } } /******************************************************************************/ LOCAL void rem_name P_((char *)); LOCAL void rem_name(p_name) /* rem_name stands for REMember NAME. rem_name accepts a pointer to a name. */ /* It looks up the name in the global macro table, and if the name is in the */ /* table performs no action. If the name isn't in the table, it creates a new */ /* entry for the name, filling the entry's fields with "blank" values. */ /* The rem_name function should not be seen as recording the definition of a */ /* macro. This is handled by the md_isdef field. Instead the rem_name macro */ /* should be viewed as just creating the space in the table for the info. */ char * p_name; /* Really should be of type p_name_t but this caused trouble. */ { if (!tb_itb(macro_table,PV p_name)) { ubyte i; p_ma_t p_macro=(p_ma_t) mm_temp(sizeof(ma_t)); strcpy(&p_macro->ma_name[0],&p_name[0]); p_macro->ma_calls = ls_cre(sizeof(mc_t)); for (i=0; i<=MAXLIBLEV; i++) p_macro->ma_defn[i].md_isdef = FALSE; p_macro->ma_minlev = MAXLIBLEV+1; p_macro->ma_actn = ls_cre(sizeof(p_elll_t)); tb_ins(macro_table,PV p_name,PV &p_macro); } } /******************************************************************************/ LOCAL void chk_whex P_((p_ps_t,p_ells_t,p_scls_t *)); LOCAL void chk_whex(p_ps,p_ex,pp_white) /* This function should really be a subfunction of pr_plist. However, C */ /* doesn't allow nested functions so we have to put it here. This function is */ /* called after pr_plist has just parsed an opening expression followed by */ /* @". This means that the expression should consist of whitespace crud. Our */ /* mission here is to check that it really does contain only whitespace crud */ /* and return a text list containing the crud. If, on the other hand, it */ /* contains meatier items, we have to call recover(). */ p_ps_t p_ps; /* Position of the start of the expression. */ p_ells_t p_ex; /* The expression that we have to check out. */ p_scls_t *pp_white; /* The place to put the resultant whitespace list. */ { p_el_t p_el; /* If the expression is empty, we can return an empty list. */ if (ls_len(p_ex)==0) { *pp_white=ls_cre(sizeof(sc_t)); return; } /* If there is more than one element, there is ...trouble. */ if (ls_len(p_ex) > 1) goto trouble; /* Extract the first element of the list. */ ls_fir(p_ex); ls_nxt(p_ex,PPV &p_el); /* If it's not text, there is ...trouble. */ if (p_el->el_kind != EL_TEXT) goto trouble; /* If the text isn't lilly white, there is ...trouble. */ { p_scls_t p_scls = p_el->el_text; p_sc_t p_sc; ls_fir(p_scls); while (TRUE) { ls_nxt(p_scls,PPV &p_sc); if (p_sc==NULL) break; if (!p_sc->sc_white) goto trouble; } /* If we got this far, we know that the expression contains a single */ /* element and that that element is a text list and that that text */ /* list consists entirely of whitespace. We can now return it. */ *pp_white=p_scls; return; } /* We COULD start dissecting the expression and issuing detailed specific */ /* error messages. However, the general approach is cleaner and so a general */ /* error message is used. */ trouble: lr_err( p_ps,"Everything from here..."); lr_mes(TKPS,"...to here should be whitespace."); lr_mes(TKPS,"Use of @\" to delimit macro parameters is optional, but"); lr_mes(TKPS,"if they are used, any surrounding text must be white."); recover(); } /******************************************************************************/ LOCAL void pr_plist P_((p_elll_t *, p_scll_t *, p_scll_t *)); LOCAL void pr_plist(pp_plist,p_before,p_after) /* This function parses an optional parameter list. If the current token is */ /* not TK_OPAR, then it is assumed that no list is present and no tokens are */ /* consumed and empty lists are returned. */ /* The three lists returned are: */ /* A list of parameters each being a pointer to a list of elements. */ /* A list of whitespace blocks being the space before each parameter. */ /* A list of whitespace blocks being the space after each parameter. */ /* The last parameter glo_p_ma should be supplied by the caller and should */ /* contain a pointer to the macro currently being parsed. */ p_elll_t *pp_plist; p_scll_t *p_before; p_scll_t *p_after; { ps_t open_ps; /* Position of start of parameter list. */ /* Initialize all the result lists to empty. */ *pp_plist = ls_cre(sizeof(p_ells_t)); *p_before = ls_cre(sizeof(p_scls_t)); *p_after = ls_cre(sizeof(p_scls_t)); /* The parameter list is optional. If it isn't there we assume a null one. */ if (p_tk->tk_kind!=TK_OPAR) return; /* We need to remember the position of the open parameter list token so that */ /* if the list isn't closed, we can attach an error to this opening token. */ ASSIGN(open_ps,p_tk->tk_ps); next_tk(TRUE); /* Now parse the parameter list, one parameter during each iteration. */ while (TRUE) { ps_t exp_ps; p_ells_t p_ex; p_scls_t p_white; /* Things get a little tricky here because the double quotes around */ /* parameters are optional (per parameter). Thus the following calls are */ /* all legal (and functionally identical): */ /* @@( @"walrus@" @, @"aardvark@" @) */ /* @@(walrus@, @"aardvark@" @) */ /* @@(walrus@,aardvark@) */ /* Note the position of the start of this parameter slot. */ ASSIGN(exp_ps,p_tk->tk_ps); /* Because we face either crud text or an expression, we parse an exp. */ pr_exp(&p_ex); /* Now take a look at the next token. If it is @" we know that we have */ /* been parsing whitespace crud. If it is @, or @) we know that we have */ /* been parsing the parameter expression itself. */ if (p_tk->tk_kind==TK_COMA || p_tk->tk_kind==TK_CPAR) { p_scls_t p_scls = ls_cre(sizeof(sc_t)); ls_add(*p_before,PV &p_scls); /* Add empty whitespace to crud list. */ ls_add(*pp_plist,PV &p_ex); /* Add expression to parameter list. */ ls_add(*p_after ,PV &p_scls); /* Add empty whitespace to crud list. */ } else if (p_tk->tk_kind==TK_QUOT) { /* After parsing the expression we hit a @". This means that the */ /* expression just parsed SHOULD turn out to contain a single */ /* element consisting of a white space text list. */ chk_whex(&exp_ps,p_ex,&p_white); ls_add(*p_before,PV &p_white); /* Get past the quote. */ next_tk(TRUE); /* Parse the expression and add it to the parameter list. */ pr_exp(&p_ex); ls_add(*pp_plist,PV &p_ex); /* Parse the quote to move onto the whitespace. */ pr_token(TK_QUOT); /* Parse the whitespace after the parameter. */ {p_scls_t p_white; pr_white(&p_white); ls_add(*p_after,PV &p_white);} } else { lr_err(TKPS,"Expecting @\" or @, or @)."); /* Experience has shown that with input files containing very */ /* long macros, it's very difficult, given the above error */ /* message, to determine which macro call has the unclosed */ /* parameter list. So, the following error identifies the macro. */ lr_err(&open_ps,"This parameter list contains a syntax error."); recover(); } /* The parameter list can now end (TK_CPAR) or continue (TK_COMA). */ if (p_tk->tk_kind==TK_COMA) next_tk(TRUE); else if (p_tk->tk_kind==TK_CPAR) {next_tk(TRUE);return;} else { lr_err(TKPS,"Expecting @, or @)."); /* Experience has shown that with input files containing very */ /* long macros, it's very difficult, given the above error */ /* message, to determine which macro call has the unclosed */ /* parameter list. So, the following error identifies the macro. */ lr_err(&open_ps,"This parameter list contains a syntax error."); recover(); } } /* End while */ } /******************************************************************************/ LOCAL void pr_invelt P_((p_el_t)); LOCAL void pr_invelt(p_el) /* Parses an "invocation element" which is just FunnelWebSpeak for "macro */ /* call". Upon entry the current token must be TK_ONAM or TK_NAME which */ /* presumably is the start of a macro call. Returns a pointer to an element */ /* object describing the call. Does some other macro table stuff too. */ p_el_t p_el; { name_t name; /* Name of the macro being invoked. */ ps_t mc_ps; /* Position of the start of the macro invocation. */ mc_t mc; /* Macro call object that describes the invocation. */ p_ma_t p_callee; /* Pointer to the macro object of the target macro. */ p_elll_t parlist; /* The parameter list of the invocation. */ p_scll_t before; /* Whitespace before each parameter in the param list. */ p_scll_t after; /* Whitespace after each parameter in the param list. */ /* We shouldn't have been called unless we have seen the start of a name. */ ass_tks(TK_ONAM,TK_NAME); /* Note the position of the start of the invocation. */ mc_ps=p_tk->tk_ps; /* Parse the invocation (name and optional parameter list). */ pr_name(name); pr_plist(&parlist,&before,&after); /* Ensure that there is an entry for this macro name in the macro table. */ rem_name(name); /* Construct a macro call object describing the call and add it to the */ /* callee macro's call list. */ /* Note: The +1 in sequence+1 is because the sequence number is incremented */ /* at the end of each macro definition and we are only halfway here. */ mc.mc_seq = sequence+1; mc.mc_ps = mc_ps; mc.mc_npar = ls_len(parlist); tb_loo(macro_table,PV name,PV &p_callee); ls_add(p_callee->ma_calls,PV &mc); /* Write an invocation element describing the call to the parameter. */ p_el->el_kind = EL_INVC; p_el->el_p_mac = p_callee; p_el->el_parls = parlist; p_el->el_pretx = before; p_el->el_postx = after; } /******************************************************************************/ LOCAL void pr_txtelt P_((p_el_t)); LOCAL void pr_txtelt(p_el) /* Parses a text element. Upon entry, the current token must be of type */ /* TK_TEXT. Writes a text element into its parameter. */ p_el_t p_el; { p_scls_t p_scls; bool dummy; ass_tk(TK_TEXT); pr_text(&p_scls,&dummy); p_el->el_kind = EL_TEXT; p_el->el_text = p_scls; } /******************************************************************************/ LOCAL void pr_parelt P_((p_el_t)); LOCAL void pr_parelt(p_el) /* Parses a parameter element (e.g. @5). Writes the resultant parameter */ /* element object to the first parameter. The second parameter should be */ /* supplied by the caller and should be a pointer to the macro being parsed. */ p_el_t p_el; { /* We have to be sitting on a parameter token. */ ass_tk(TK_PARM); /* Complain if the parameter does not exist. */ if (p_tk->tk_gen > glo_p_md->md_npar) { sprintf(linet1,"Macro being defined has only %lu parameter%s.", (unsigned long) glo_p_md->md_npar, glo_p_md->md_npar==1 ? "" : "s"); lr_err(TKPS,linet1); } /* Write a parameter element to the function parameter. */ p_el->el_kind = EL_PARM; p_el->el_parno = p_tk->tk_gen; p_el->el_which = glo_p_ma; /* Move on to the token following the parameter token. */ next_tk(TRUE); } /******************************************************************************/ LOCAL void pr_exp(p_ex) /* Parses an expression and writes an expression list to the first parameter. */ /* The second parameter should be supplied by the user and should be a */ /* pointer to the macro currently being parsed. */ p_ells_t *p_ex; { p_ells_t ex = ls_cre(sizeof(el_t)); while (TRUE) { el_t el; switch (p_tk->tk_kind) { case TK_TEXT: pr_txtelt(&el); break; case TK_NAME: case TK_ONAM: pr_invelt(&el); break; case TK_PARM: pr_parelt(&el); break; default : *p_ex=ex; return; } ls_add(ex,PV &el); } } /******************************************************************************/ LOCAL void pr_formal P_((uword *,p_ps_t)); LOCAL void pr_formal(p_numpar,p_ps) /* A FunnelWeb formal parameter list looks something like this: "@(@5@)". */ /* This function parses a parameter list if present and returns the number of */ /* parameters in the formal parameter list. The function also returns the */ /* position the parameter list. */ uword *p_numpar; p_ps_t p_ps; { /* If the parameter list is absent, we default to having zero parameters and */ /* making the position of the parameter list the position of the next token. */ *p_numpar = 0; *p_ps = p_tk->tk_ps; /* Parse the parameter list only if one is present. */ if (p_tk->tk_kind==TK_OPAR) { /* Move to the parameter token and get its number and position. */ next_tk(TRUE); check_tk(TK_PARM); *p_numpar=p_tk->tk_gen; *p_ps=p_tk->tk_ps; /* Parse the end of the formal parameter list. */ next_tk(TRUE); pr_token(TK_CPAR); } } /******************************************************************************/ LOCAL void pr_number P_((bool *,bool *)); LOCAL void pr_number(p_iszer,p_isman) /* Parses optional @Z@M after parameter list. */ bool *p_iszer; bool *p_isman; { *p_iszer=FALSE; *p_isman=FALSE; /* The following parse allows zero, one or both of @Z@M, but in order. */ /* Grab an @Z if it is there. */ if (p_tk->tk_kind==TK_ZERO) { next_tk(TRUE); *p_iszer=TRUE; } /* Grab an @M too if it is there. */ if (p_tk->tk_kind==TK_MANY) { next_tk(TRUE); *p_isman=TRUE; } } /******************************************************************************/ LOCAL void pr_level P_((ubyte *,p_ps_t)); LOCAL void pr_level (p_level,p_ps) /* Parses zero or more @L in macro definition. */ ubyte *p_level; p_ps_t p_ps; { ulong level = 0; /* Grab a copy of the position of the first @L (even if it is not there). */ ASSIGN(*p_ps,p_tk->tk_ps); while (p_tk->tk_kind == TK_LIBR) { next_tk(TRUE); level++; } if (level > MAXLIBLEV) { sprintf(linet1,"You cannot specify more than %lu @L library markers.", (ulong) MAXLIBLEV); lr_err(&p_tk->tk_ps,linet1); recover(); } *p_level = (ubyte) level; as_cold(*p_level <= MAXLIBLEV,"pr_level: Bad output level."); } /******************************************************************************/ LOCAL void pr_equals P_((bool *,p_ps_t)); LOCAL void pr_equals(isadd,p_ps) /* Parses optional "==" or "+=". Sets *isadd==TRUE iff "+=" parsed else FALSE.*/ /* Sets *p_ps to the position of the equals. */ bool *isadd; p_ps_t p_ps; { p_scls_t p_scls; bool dummy; /* Grab a copy of the position of the equals (even if it is not there) . */ ASSIGN(*p_ps,p_tk->tk_ps); /* If the equals isn't there, we default to FALSE. */ *isadd=FALSE; if (p_tk->tk_kind!=TK_TEXT) return; /* Parse text tokens producing a text list. */ pr_text(&p_scls,&dummy); /* Compare the text list with the assignment constant strings. */ if (eq_txst(p_scls,"==")) {*isadd=FALSE; ls_des(p_scls); return;} if (eq_txst(p_scls,"+=")) {*isadd=TRUE; ls_des(p_scls); return;} lr_err(p_ps,"Expecting \"==@{\" or \"+=@{\" or just \"@{\"."); lr_mes(p_ps,"(or @Z or @M or @L if they have not already appeared)."); lr_mes(p_ps,"Note: FunnelWeb is intolerant of spaces at this point."); ls_des(p_scls); recover(); } /******************************************************************************/ LOCAL bool checkdef P_((bool,ulong,bool,bool,bool, p_ps_t,p_ps_t,p_ps_t,p_ps_t,p_ps_t)); LOCAL bool checkdef (is_file,numpar,iszer,isman,isadd, p_psnam,p_psfor,p_pseql,p_psnum,p_pslib) /* This function performs all sorts of checks on a macro definition. */ /* If there is anything wrong, it generates and error and calls recover(). */ /* This would be best as a local function but because C doesn't have local */ /* functions we have to use millions of parameters instead. */ bool is_file; ulong numpar; bool iszer; bool isman; bool isadd; p_ps_t p_psnam; p_ps_t p_psfor; p_ps_t p_pseql; p_ps_t p_psnum; p_ps_t p_pslib; { bool semerr = FALSE; /* CHECK INTERNAL INCONSISTENCIES */ /* ------------------------------ */ /* Complain if a file macro has a parameter list. */ if (is_file && numpar>0) { lr_err(p_psfor,"Macros attached to output files cannot be parameterized."); lr_mes(p_psfor,"Reason: No actual parameters would be available during"); lr_mes(p_psfor," output file generation."); semerr=TRUE; } /* Complain if a file macro is declared additive. */ if (is_file && isadd) { lr_err(p_pseql,"Macros attached to output files cannot be additive."); lr_mes(p_pseql,"Reason: Preventing this makes it easy to find output"); lr_mes(p_pseql,"file macros later, because there will be exactly one"); lr_mes(p_pseql,"@O declaration in the input file for each output file."); lr_mes(p_pseql,"To do what you are trying to do, just create an additive"); lr_mes(p_pseql,"bridging macro, like this:"); lr_mes(p_pseql," @O@@{@@}"); lr_mes(p_pseql," @$@+=@{void stringhack()...@}"); lr_mes(p_pseql," @$@+=@{main()...@}"); semerr=TRUE; } /* Complain if a file macro has a name that is too long. */ if (is_file && strlen(&glo_p_ma->ma_name[0])>PATHNAME_MAX) { lr_err(p_psnam, "File macro's name is longer than the maximum permissible filename length."); sprintf(linet1,"Maximum filename length is %lu characters.", (unsigned long) PATHNAME_MAX); lr_mes(p_psnam,linet1); semerr=TRUE; } /* Complain if a file macro has "zero" or "many" attributes. */ if (is_file && (iszer || isman)) { lr_err(p_psnum,"Macros attached to output files cannot have @Z or @M."); lr_mes(p_psnum,"Reason: They are always called once to generate their"); lr_mes(p_psnum,"output file and they cannot be called from other macros."); lr_mes(p_psnum,"Hence they are always called exactly once and so there"); lr_mes(p_psnum,"can be no need for @Z or @M in their declarations."); semerr=TRUE; } /* Complain if a file macro has a library attribute. */ if (is_file && (glo_mdlv != 0)) { lr_err(p_pslib,"Macros attached to output files cannot be library (@L) macros."); lr_mes(p_pslib,"Reason: It's important to be able to quickly determine what"); lr_mes(p_pslib,"output files a FunnelWeb file will produce, and that task is."); lr_mes(p_pslib,"made much more difficult if some file macros are overruling"); lr_mes(p_pslib,"others. To do what you are trying to do, just create a bridge"); lr_mes(p_pslib,"macro, like this:"); lr_mes(p_pslib," @O@@{@@}"); lr_mes(p_pslib," @$@@L@{void stringhack1()...@}"); lr_mes(p_pslib," ..."); lr_mes(p_pslib," @$@@{void stringhack2()...@}"); semerr=TRUE; } /* COMPARE WITH EARLIER DEFINITIONS */ /* -------------------------------- */ /* Don't do this section if no previous definition exists. */ if (!glo_p_md->md_isdef) goto finish; /* Assert: An earlier definition of this macro exists. */ /* Old definition is a full definition, not admitting partial ones now. */ if (!glo_p_md->md_isadd) { if (isadd) { sprintf(linet1,"A full definition of this macro appears at line %lu.", (ulong) glo_p_md->md_ps.ps_line); lr_err(p_psnam,linet1); lr_mes(p_psnam,"Full and additive definitions of the same macro cannot coexist."); } else { sprintf(linet1,"This macro is already fully defined (at line %lu).", (ulong) glo_p_md->md_ps.ps_line); lr_err(p_psnam,linet1); } semerr=TRUE; } /* Old definition is partial but new definition is full. */ if (glo_p_md->md_isadd && !isadd) { sprintf(linet1,"An additive definition of this macro appears at line %lu.", (ulong) glo_p_md->md_ps.ps_line); lr_err(p_psnam,linet1); lr_mes(p_psnam,"Full and additive definitions of the same macro cannot coexist."); semerr=TRUE; } /* Make sure that non-first body parts of additive macros do not have params.*/ if (isadd && (numpar>0)) { lr_err(p_psfor,"The formal parameter list of an additive macro"); lr_mes(p_psfor,"must be placed only in the first definition part."); sprintf(linet1,"The first part of this macro appears at line %lu.", (ulong) glo_p_md->md_ps.ps_line); lr_mes(p_psfor,linet1); semerr=TRUE; } /* Complain if number attributes are being attached to an additive. */ if (isadd && (iszer || isman)) { lr_err(p_psnum,"@Z and @M modifiers for additive macros must"); lr_mes(p_psnum,"be placed only in the first definition part."); sprintf(linet1,"The first part of this macro appears at line %lu.", (ulong) glo_p_md->md_ps.ps_line); lr_mes(p_psnum,linet1); semerr=TRUE; } finish: if (semerr) { lr_mes(p_psnam,"Macro definition ignored."); recover(); } return TRUE; } /******************************************************************************/ LOCAL void pr_macro P_((void)); LOCAL void pr_macro() /* This function parses a single macro definition. Upon entry, the current */ /* token must be either TK_MDEF or TK_FDEF. */ { ps_t ps_mac; /* Position of start of the macro definition. */ bool is_file; /* TRUE iff definition starts with @O instead of @$. */ name_t name; /* The macro name appearing in this definition. */ ps_t ps_name; /* Position of the macro name. */ ps_t ps_form; /* Position of the formal parameter list. */ ps_t ps_equal; /* Position of the equals. */ ps_t ps_num; /* Position of number attributes. */ ps_t ps_lib; /* Position of library attribute. */ uword numpar; /* Number of parameters in formal parameter list. */ bool iszer; /* TRUE iff macro is allowed to be called zero times. */ bool isman; /* TRUE iff macro is allowed to be called more than once. */ bool isadd; /* TRUE iff equals parsed here is "+=" not "==". */ p_ells_t ex; /* Expression constituting this macro body part. */ bool hasname; /* TRUE iff current section already has a name. */ /* We should not have got in here without seeing a definition token. */ ass_tks(TK_MDEF,TK_FDEF); /* Grab a copy of the position of the start of the macro. */ ASSIGN(ps_mac,p_tk->tk_ps); /* If we have seen a macro definition token then it means that the user is */ /* TRYING to define a macro. The macro may or may not provoke errors. In */ /* either case though we do not want to hassle the user with errors about */ /* nameless sections not containing macros if it is obvious that an attempt */ /* to define a macro has been made. So here we set the name flag after */ /* having a look at it so we can use its value later. */ if (sn_lev(&last_sn)>0) { as_cold(p_secdc->dc_kind==DC_TYPE,"pr_macro: section processing error (1)."); as_cold(p_secdc->dc_pty->ty_kind==TY_NSEC,"pr_macro: section processing error (2)."); hasname=p_secdc->dc_pty->ty_isnam; p_secdc->dc_pty->ty_isnam=TRUE; } /* Record whether the macro is attached to an product file. */ is_file= (p_tk->tk_kind==TK_FDEF); /* Parse the macro name. Record its position. Ensure that there is an entry */ /* in the macro table for this macro name (i.e. create one if not there). */ next_tk(TRUE); if (p_tk->tk_kind!=TK_ONAM && p_tk->tk_kind!=TK_NAME) { lr_err(TKPS,"Macro name expected (@<...@> or @#c)."); recover(); } ps_name=p_tk->tk_ps; pr_name (name); rem_name(name); tb_loo(macro_table,PV name,PV &glo_p_ma); /* Parse the optional formal parameter list and the equals. */ /* Extract positioning and other information. */ pr_formal(&numpar,&ps_form ); ASSIGN(ps_num,p_tk->tk_ps); pr_number(&iszer, &isman); pr_level(&glo_mdlv,&ps_lib); pr_equals(&isadd ,&ps_equal); /* Define a pointer to the definition record for this level. */ glo_p_md = &glo_p_ma->ma_defn[glo_mdlv]; /* Perform semantic checks on whether this definition is valid. */ checkdef(is_file,numpar,iszer,isman,isadd, &ps_name,&ps_form,&ps_equal,&ps_num,&ps_lib); /* Update the minimum level. */ if (glo_mdlv < glo_p_ma->ma_minlev) glo_p_ma->ma_minlev = glo_mdlv; /* If we have got this far, we know that we have parsed a valid macro */ /* definition except possibly for the actual expression body. */ /* If this is the first definition of this macro, establish its definition. */ if (!glo_p_md->md_isdef) { glo_p_md->md_isdef = TRUE; ASSIGN(glo_p_md->md_ps,ps_mac); glo_p_md->md_npar = numpar; glo_p_md->md_isadd = isadd; glo_p_md->md_iszer = iszer; glo_p_md->md_isman = isman; glo_p_md->md_isfil = is_file; glo_p_md->md_body = ls_cre(sizeof(bp_t)); if (is_file) tb_ins(file_table,PV name,PV &glo_p_ma); } /* Parse the body of this macro definition. */ pr_token(TK_ODEF); pr_exp(&ex); pr_token(TK_CDEF); /* We are now clear to execute the effects of the macro on our tables. */ /* First we bump up the sequence number. */ sequence++; { /* Construct a body part object containing the information in this */ /* definition and append it to the list of body parts in the macro record. */ bp_t bp; bp.bp_ex = ex; bp.bp_seq = sequence; bp.bp_ps = ps_name; ls_add(glo_p_md->md_body,PV &bp); } { /* Construct a document component object for this definition and append it */ /* to the global document component list. */ dc_t dc; ASSIGN(dc.dc_ps,ps_mac); dc.dc_kind = DC_MACR; dc.dc_p_ma = glo_p_ma; dc.dc_mlev = glo_mdlv; dc.dc_part = ls_len(glo_p_md->md_body); ls_add(document_list,PV &dc); } /* Sections without names inherit the name of their first macro. */ if (sn_lev(&last_sn)>0 && !hasname) strcpy((string) p_secdc->dc_pty->ty_pname,&name[0]); } /******************************************************************************/ EXPORT void parser() /* This is the main parser function. This function contains parser */ /* initialization as well as the main parsing loop to which control is */ /* returned (by recover()) when an error occurs. */ { /* Create the lists and tables generated by the parser. */ macro_table = tb_cre (sizeof(name_t),sizeof(p_ma_t),(p_kycm_t) cm_name); file_table = tb_cre (sizeof(name_t),sizeof(p_ma_t),(p_kycm_t) cm_name); document_list= ls_cre (sizeof(dc_t)); /* Initialize the section number counter. */ sequence = 0; sn_ini(&last_sn); p_secdc = NULL; /* Prime the scanning of the token list. */ ls_fir(token_list); next_tk(FALSE); /* This is where we longjmp back to after hitting a nasty syntax error. */ /* We don't actually have to test dummyint, as our control state is no */ /* different after a syntax error has occurred. Example: We try to parse */ /* a macro but there is a syntax error. So we skip to the start of the */ /* next macro and then longjmp back to here ready to parse the next */ /* macro. Thus, there is no need to a fork test. */ (void) setjmp(jmp_pos); /* This is the main parser loop which parses major syntactic chunks. */ while (p_tk->tk_kind != TK_EOF) switch (p_tk->tk_kind) { case TK_NSEC: pr_sec (); break; case TK_TEXT: pr_dctxt(); break; case TK_MDEF: pr_macro(); break; case TK_FDEF: pr_macro(); break; case TK_ODEF: pr_lit (); break; case TK_EMPH: pr_emp (); break; case TK_NPAG: pr_npag (); break; case TK_TOCS: pr_tocs (); break; case TK_SKIP: pr_skip (); break; case TK_TITL: pr_titl (); break; default: lr_err(TKPS,"The parser was at the top level and was expecting"); lr_mes(TKPS,"one of: {Directive, Text, Macro definition, EOF}."); next_tk(FALSE); break; } } /******************************************************************************/ /* End of PARSER.C */ /******************************************************************************/ "output files a FunnelWeb file will produce, and that task is."); lr_mes(p_pslib,"made much more difficult if some file macros are overruling"); lr_mes(p_pslib,"others. To do what you are tryingfw_src/source/parser.h 644 0 0 6174 6716661057 10263 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* PARSER.H */ /******************************************************************************/ /* */ /* The FunnelWeb parser parses the tokens in the global token list and */ /* constructs a macro table and a document list. These two data structures */ /* give structured views of the input document which are used later by tangle */ /* and weave. If the parser detects any errors it sends them to the lister */ /* package. If any errors have occurred, the output of the parser should not */ /* be used. */ /* */ /* IN : token_list - List of tokens to be parsed. */ /* OUT: macro_table - Table of macros parsed. */ /* file_table - Table indicating which macros are attached to files. */ /* document_list - List giving a structured view of the document. */ /* Also sends diagnostic messages to the lister. */ /* */ /******************************************************************************/ #include "style.h" /******************************************************************************/ EXPORT void parser P_((void)); /******************************************************************************/ /* End of PARSER.H */ /******************************************************************************/ TRUE iff equals parsed here is "+=" not "==". */ p_ells_t ex; /* Expression constituting this macro body part. */ bool hasname; /* TRUE iff current section already has a name. */ /* We should not have got in here without seeing a definition token. */ ass_tks(TK_MDEF,TK_FDEF); /* Grab a copy of the position of the start of the macro. */ ASfw_src/source/scanner.c 644 0 0 211470 6716661060 10442 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. 08-May-1999 RNW scan_file: Added include file name in two error messages. 09-May-1999 RNW Added scanning of @L token (TK_LIBR). ##############################################################################*/ /******************************************************************************/ /* SCANNER.C */ /******************************************************************************/ /* */ /* Introduction */ /* ------------ */ /* The FunnelWeb scanner is a little messy because it deals with two */ /* structures at the same time while attempting to be efficient. On the one */ /* hand it is busy constructing the line list. This means that it has to keep */ /* an eye out for end of line characters ('\n'=EOL) so that it can add a line */ /* record whenever it sees one. On the other hand, it has to scan the input */ /* file into a token stream consisting of text tokens and special tokens */ /* which usually have no regard for end of lines. It is tempting to divide */ /* these two functions up (into perhaps a LINER and a TOKENIZER). However, */ /* the presence of the include file facility would make this messy. Also, the */ /* tokenizer has to count end of line markers so that it can generate */ /* correctly positioned diagnostics. */ /* */ /* The long and short of it all is that the best way to do the scanning seems */ /* to be to run a liner and a tokenizer as parallel layers. The liner */ /* extracts characters from the input file and hands them to the tokenizer. */ /* It also keeps an eye out for newline characters, sending a line record off */ /* whenever it sees one, and counting lines. The tokenizer receives the */ /* characters from the liner and performs the tokenize operation. */ /* */ /* Notes */ /* ----- */ /* - Currently FunnelWeb recognises only two characters as whitespace. */ /* These are ' ' and EOL. */ /* */ /******************************************************************************/ #include #include #include "style.h" #include "as.h" #include "clock.h" #include "data.h" #include "dump.h" #include "list.h" #include "lister.h" #include "machin.h" #include "mapper.h" #include "memory.h" #include "misc.h" #include "option.h" #include "scanner.h" /******************************************************************************/ /* The "special" character is the character that is used to introduce a */ /* "special sequence". FunnelWeb allows the user to change this character so */ /* as to cater for documents where the "default" character is common. This */ /* definition defines what the default character is. */ #define CH_DSPE ('@') /* FunnelWeb allows include files which are handled by the scanner by placing */ /* recursive calls to scan_file. A maximum is placed on the level of nested */ /* includes. This acts as a good sanity check as well as catching recursive */ /* include files which are never a sensible construct in FunnelWeb as */ /* FunnelWeb does not provide any conditional construct. */ #define MAX_INCL (10) /* FunnelWeb is very conservative about what characters it will allow in its */ /* input and output files. Currently the only characters allowed are */ /* printables and end of lines. When FunnelWeb does spot an illegal character */ /* it needs to be able to draw the user's attention to the character. The */ /* best way to do this is to point to it in the listing file. However, if the */ /* character is banned, it cannot appear in the listing file! The problem is */ /* solved by having the scanner replace all illegal characters in each mapped */ /* file by the following character. This eliminates further problems. */ #define CENSORCH ('?') /* Following the Unix convention, mapped in files are not terminated with an */ /* end-of-file character. However, the presence of such a character at the */ /* end of the mapped file simplifies scanning and so we add one. This */ /* definition defines what the character is to be. It doesn't matter what the */ /* character is, so long as it cannot legally appear in the file. A control */ /* character is a good choice as these are filtered out by the liner (see */ /* above). */ /* We undef EOF (from ) because it is too dangerously close to EOFCH.*/ /* (EOF wasn't redefined as that might confuse readers used to . */ /* However, we still use EOF as an acronym for End Of File. */ #define EOFCH (26) #undef EOF /* Tokens have a field for a general attribute which has meaning for some */ /* token kinds. For other kinds, it has no meaning. This constant is used to */ /* indicate a "don't care" value. */ #define DONTCARE 0 /* A nominal maximum value for the maximum length of an input line. */ #define INMAXINF (ULONG_MAX) /******************************************************************************/ /* The following type is used in the suite of pragma routines for parsing. */ typedef struct { ps_t pt_ps; /* Position of the start of this argument. */ char *pt_pstr; /* Pointer to a string containing the argument. */ char *pt_pinl; /* Pointer to first byte of the argument in commndline. */ } pt_t; typedef pt_t *p_pt_t; /******************************************************************************/ /* Variables Instantiated Over The Entire Scan */ /* ------------------------------------------- */ LOCVAR p_ck_t p_mapp; /* Pointer to mapper's clock. */ LOCVAR p_ck_t p_scan; /* Pointer to scanner's clock. */ LOCVAR ulong globalno; /* Global line number of line being scanned. */ LOCVAR ulong inclevel; /* Include level of current file. Top file is zero. */ LOCVAR bool seenind; /* TRUE iff we have seen an indentation pragma. */ LOCVAR ps_t ps_ind; /* seenind==TRUE => ps_ind is position of pragma. */ LOCVAR bool seentyp; /* TRUE iff we have seen a typesetter pragma. */ LOCVAR ps_t ps_typ; /* seentyp==TRUE => ps_typ is position of pragma. */ LOCVAR bool seenlimo; /* TRUE iff we have seen an out lin len limit pragma. */ LOCVAR ps_t ps_limo; /* seenlimo==TRUE => ps_limo is position of pragma. */ /* Variables Instantiated Over The Current File */ /* -------------------------------------------- */ LOCVAR ulong inln_max; /* Maximum permitted length of an input line. */ LOCVAR char specialch; /* Current special (escape) character. */ LOCVAR char *p_eof; /* Pointer to EOFCH byte at the end of current file. */ LOCVAR ulong localno; /* Local line number of line being scanned. */ /* Variables Instantiated Over The Current Line */ /* -------------------------------------------- */ LOCVAR char *p_sol; /* Pointer to Start (first char) Of current Line. */ LOCVAR char *p_ch; /* Pointer to current character in current line. */ LOCVAR char ch; /* *p_ch. */ /******************************************************************************/ /* Line Processing Layer */ /******************************************************************************/ /* */ /* This mini-section contains the two routines (prepline and NEXTCH) that */ /* take care of the line based-scanning and feed characters to the */ /* token-based scanner routines which have the top level of control. */ /* After mapping in a file to be read, place a call to prepline passing the */ /* address of the first byte of the mapped file as an argument. At that */ /* point the current position will be the first byte on the first line and */ /* the "variables instantiated over the current line" will be well defined. */ /* Calls to NEXTCH then move the position through the mapped file one byte at */ /* a time, stopping at the end of file at which point calls will not move the */ /* marker which will point to the EOF character. */ /* */ /******************************************************************************/ LOCAL void prepline P_((char *)); LOCAL void prepline(p_line) /* This function should be called at the end of each line to prepare the next */ /* line for scanning. The user of the liner mini-package should place a */ /* single call to this function at the start of scanning a mapped file. */ /* The user should then place calls to NEXTCH (which calls prepline when */ /* necessary). */ /* This function serves two purposes: */ /* 1. It looks at the next line and converts all non-printables into */ /* CENSORCH and issues errors for each non-printable. */ /* 2. It initializes the line scanning variables for the next line. */ /* The argument is a pointer to the first byte of the next line. */ char *p_line; { char *p; /* Scans through the line and winds up sitting on the EOL. */ /* Test to see if the "line" we have been given is the end of file marker. */ /* We have to be careful here because the byte we are using to mark the end */ /* of file could appear as an illegal unprintable. This is the reason for */ /* the test p_line==p_eof. */ if (*p_line==EOFCH && p_line==p_eof) { /* The line we have to process is in fact the end of file marker. */ p_sol = p_line; p_ch = p_line; ch = EOFCH; return; } /* At this point we know that we are faced with a run of bytes terminated by */ /* an EOL character (we know this cos we put an EOL before EOF earlier on). */ /* We know that we have a line, so we can now bump up the line counters. */ globalno++; localno++; /* Run through the line checking for non-printables and issuing errors. */ p = p_line; while (*p != EOL) { /* The following test tests to see if the character is a printable in */ /* seven bit ascii. FunnelWeb is not currently designed to work with */ /* any character set other than seven-bit ascii and so we flag and */ /* convert all out-of-range characters here before they are exposed to */ /* the rest of the scanner code which assumes that each line that it is */ /* handed consists entirely of printables except for the EOL char on the */ /* end and possibly an EOF char at the "Start" of a line. */ /* In particular, the NEXTCH macro will fail on machines with siged */ /* chars if non-printables are not removed. It goes into an infinite */ /* loop. */ /* Note: I don't use library function "isprint" here because on the vax */ /* it's definition is too loose (seems to accept characters with the top */ /* bit set as printable). */ if (!isascprn(*p)) /* If not a printable character. */ { ps_t ps; char c = *p; ubyte_ uc = *((ubyte_ *) p); ps.ps_line = globalno; ps.ps_column = p-p_line+1; if (strlen(chabbrev(c))==0) sprintf(linet1, "Non printable character (Sym=, Dec=%03u, Hex=%02X, Oct=%03o).", (unsigned) uc,(unsigned) uc,(unsigned) uc); else sprintf(linet1, "Non printable character (Sym=%s, Dec=%03u, Hex=%02X, Oct=%03o).", chabbrev(c),(unsigned) uc,(unsigned) uc,(unsigned) uc); lr_err(&ps,linet1); *p=CENSORCH; } p++; } /* Assert: p_line points to the start of the current line. */ /* Assert: p points to the EOL at the end of the current line. */ /* Check that the line is not too long. */ if ((p-p_line)>inln_max) { ps_t ps; ps.ps_line = globalno; ps.ps_column = inln_max+1; lr_err(&ps,"Input line is too long (this character is the first offender)."); sprintf(linet1,"Currently, the maximum allowable input line length is %lu.", (unsigned long) inln_max); lr_mes(&ps,linet1); lr_mes(&ps,"Note: You can change this using a pragma directive (@p)."); } /* Now check for trailing spaces. */ if ((p != p_line) && (*(p-1) == ' ')) { ps_t ps; ps.ps_line = globalno; ps.ps_column = p-p_line; lr_war(&ps,"Line has trailing spaces up to and including this space."); } /* Construct a line record and append the record to the line list. */ /* Note that the line scrap encompasses the trailing EOL. */ { ln_t line; line.ln_global = globalno; line.ln_local = localno; line.ln_body.sc_first = p_line; line.ln_body.sc_last = p; /* Note: We do not set sc_white as it is not used in lines. */ ls_add(line_list,PV &line); } /* Finally, set the line scanning variables to the start of the line. */ /* We can't do this earlier in case the start of the line was a */ /* non-printable and got substituted (ch might pick it up). */ p_sol = p_line; p_ch = p_line; ch = *p_line; } /* End of prepline. */ /* NEXTCH can be called continuously after an initializing call to prepline. */ /* After a call to NEXTCH, p_sol, p_ch, ch are all well-defined. p_sol points */ /* to the start of the current line, p_ch points to the current character, */ /* and ch contains *p_ch. NEXTCH can be called repeatedly forever. When it */ /* hits the EOF character, it sticks on it and returns it forever. */ /* Note: The "ch<' '" is an optimized form of "(ch==EOL)||(ch=EOFCH)". Speed */ /* is very important here as this macro is called in scanning tightloops. */ /* This line of code is a little tricky so read it carefully. */ /* WARNING: The ch<' ' will cause an infinite loop if a character appears */ /* that satisfies this condition without being EOF or EOL (e.g. a control */ /* char (meant to be filtered out earlier) or a top-bit-set character on */ /* machines with signed character type. */ #define NEXTCH {if (ch<' ') {if (ch==EOL) prepline(p_ch+1);} else ch= *++p_ch;} /******************************************************************************/ /* Scanner Support Routines */ /******************************************************************************/ LOCAL ps_t *psofch P_((void)); LOCAL ps_t *psofch() /* Returns a pointer to an internal static ps structure holding the line and */ /* column number of the current character ch. */ { STAVAR ps_t chps; chps.ps_line = globalno; chps.ps_column = p_ch-p_sol+1; return &chps; } /******************************************************************************/ LOCAL void grabchps P_((p_ps_t)); LOCAL void grabchps(p_ps) /* Writes the position of the current ch into the argument position struct. */ p_ps_t p_ps; { p_ps->ps_line = globalno; p_ps->ps_column = p_ch-p_sol+1; } /******************************************************************************/ LOCAL void sendspec P_((p_ps_t,tk_k_t,ubyte)); LOCAL void sendspec(p_tkps,tk_kind,tk_gen) /* Appends a non-text token of kind tk_kind to the end of the token list. */ /* p_ps is a pointer to a position structure giving the position of the */ /* first character of the token. tk_gen is the general token attribute. */ p_ps_t p_tkps; tk_k_t tk_kind; ubyte tk_gen; { tk_t token; token.tk_kind = tk_kind; ASSIGN(token.tk_ps,*p_tkps); token.tk_sc.sc_first = NULL; token.tk_sc.sc_last = NULL; token.tk_sc.sc_white = TRUE; token.tk_gen = tk_gen; ls_add(token_list,PV &token); } /******************************************************************************/ LOCAL void sendtext P_((p_ps_t,char *,char *,bool)); LOCAL void sendtext(p_tkps,p_first,p_last,is_white) /* Appends a text token to the end of the token list. */ /* IN: p_ps is a pointer to a position structure giving the position of the */ /* first character of the token. */ /* IN: p_first and p_last point to the first and last byte of the text scrap. */ /* IN: is_white should be set to TRUE iff scrap is entirely whitespace. */ p_ps_t p_tkps; char *p_first; char *p_last; bool is_white; { tk_t token; /* Empty text scraps should never be generated. */ as_cold(p_first<=p_last,"sendtext: Text scrap bounds are bad."); /* If ch=EOL then we should be scanning more text, not shipping it! */ as_cold(ch!=EOL,"senttext: Shipping text while still more to scan."); /* Send the text token. */ token.tk_kind = TK_TEXT; ASSIGN(token.tk_ps,*p_tkps); token.tk_sc.sc_first = p_first; token.tk_sc.sc_last = p_last; token.tk_sc.sc_white = is_white; token.tk_gen = DONTCARE; ls_add(token_list,PV &token); } /******************************************************************************/ LOCAL void add_eof P_((void)); LOCAL void add_eof() /* This function adds terminators to the line and token list. */ /* 1. It adds a TK_EOF token to the end of the token list. */ /* 2. It adds a visible line to the end of the line list. */ /* This assists the parser by allowing it to point diagnostic messages to a */ /* visible EOF marker rather than pointing vaguely to the end of the last */ /* line of the input file which (by the way) may not even exist! */ { STAVAR char *eofstr = "\n"; ln_t line; ps_t ps; /* When the liner mini package encounters an end of file marker, it stops */ /* dead on the marker and returns EOFCH forever. scan_file() eventually gets */ /* the message and drops out. However, in all of this, the line numbers are */ /* not incremented to indicate that we have moved to an EOF line. This is */ /* intended, as we do not want EOFs to appear in the listing for include */ /* files; only at the end of the main input file. Thus, here we effectively */ /* perform the liner function of moving from the last line of the input file */ /* to the imaginary line containing the EOF marker. This is done by */ /* incrementing the line numbers. Note that the fact that these line number */ /* variables are incorrect from the point of detection of the final EOF to */ /* here doesn't matter as no tokens or diagnostics are ever added after an */ /* EOF is detected. */ globalno++; localno++; /* Add a line to represent the EOF marker. */ line.ln_global = globalno; line.ln_local = localno; line.ln_body.sc_first = eofstr; line.ln_body.sc_last = eofstr+strlen(eofstr)-1; /* Note: We do not set sc_white as it is not used in lines. */ ls_add(line_list,PV &line); /* Add a TK_EOF token to the end of the token list. */ ps.ps_line = globalno; ps.ps_column = 1; sendspec(&ps,TK_EOF,DONTCARE); } /******************************************************************************/ /* The Scanner Proper */ /******************************************************************************/ LOCAL void skiptoeol P_((void)); LOCAL void skiptoeol() { while (ch != EOL) NEXTCH; } /******************************************************************************/ /* The incl_fil function calls this, so we have to declare it in advance. */ LOCAL void scan_file P_((char *)); LOCAL void incl_fil P_((p_ps_t)); LOCAL void incl_fil(p_ps) /* Upon entry, the current character is the "i" of an "@i" sequence. Our task */ /* is first to see if the sequence occurred at the start of a line (the only */ /* point at which it is legal) and issue an error if it isn't. If it is legal,*/ /* we have to read in the specified file and scan that. The included file */ /* replaces exactly the line starting with the "@i" command and we return */ /* to the "calling" file with the current position being the EOL character of */ /* the include line. */ p_ps_t p_ps; { /* Complain if the include directive was not at the start of a line. */ if (p_ch-1 != p_sol) { lr_err(p_ps,"Include sequence must be at the beginning of a line."); lr_mes(p_ps,"Include ignored."); skiptoeol(); return; } /* The include command should be followed by a blank. Get the next char. */ NEXTCH; /* Complain if the next character is not a blank. */ if (ch != ' ') { ps_t ps; ASSIGN(ps,*p_ps); ps.ps_column+=2; lr_err(&ps,"Include sequence (@i) must be followed by a blank."); lr_mes(&ps,"Example include: @i macros.fwi"); lr_mes(&ps,"Include ignored."); skiptoeol(); return; } /* Complain if the include level is too high. */ if (inclevel == MAX_INCL) { lr_err(p_ps,"This include file is nested too deeply. It's probably recursive."); sprintf(linet1,"The maximum level of nested includes is %u.", (unsigned) MAX_INCL); lr_mes(p_ps,linet1); lr_mes(p_ps,"Include ignored."); skiptoeol(); return; } {/* This construct does the work of the include. */ /* Warning: The following variables MUST be declared automatic. */ char *p_filename; char *p_tempname; ulong length; char *p; ulong xinln_max; char xspecial; char *xp_eof; ulong xlocalno; char *xp_sol; char *xp_ch; char xch; /* We save stack space by sticking this filename in the heap. */ p_filename=mm_temp((size_t) PATHNAME_MAX+1+10); /* 10 is for paranoia. */ p_tempname=mm_temp((size_t) PATHNAME_MAX+1+10); /* 10 is for paranoia. */ /* The rest of the line is supposed to hold a filename. Copy it. */ NEXTCH; p=p_tempname; length=0; while (ch!=EOL) { if (++length > PATHNAME_MAX) { lr_err(p_ps, "This include command's file specification is too long."); if (option.op_b7_b) sprintf(linet1,"The maximum file name length is %s characters.", SUPPVAL); else sprintf(linet1,"The maximum file name length is %u characters.", (unsigned) PATHNAME_MAX); lr_mes(p_ps,linet1); lr_mes(p_ps,"Include ignored."); skiptoeol(); return; } *p++=ch; NEXTCH; } *p=EOS; /* Note: Current position is now on the EOL at the end of the @i line. */ /* Complain if the user has not specified a filename. */ if (strlen(p_tempname) ==0) { lr_err(psofch(),"Expecting the name of a file to include."); return; } /* Perform the necessary filename inheritance. */ strcpy(p_filename,""); fn_ins(p_filename,option.op_f_s); fn_ins(p_filename,".fwi"); fn_ins(p_filename,option.op_i_s); fn_ins(p_filename,p_tempname); /* Include the included file by calling scan_file recursively. */ /* Save and restore all variables in instantiation scope. */ xinln_max = inln_max; xspecial = specialch; xp_eof = p_eof; xlocalno = localno; xp_sol = p_sol; xp_ch = p_ch; xch = ch; inclevel++; scan_file(p_filename); inclevel--; ch = xch; p_ch = xp_ch; p_sol = xp_sol; localno = xlocalno; p_eof = xp_eof; specialch = xspecial; inln_max = xinln_max; } } /******************************************************************************/ LOCAL void do_ascii P_((p_ps_t)); LOCAL void do_ascii(p_psspec) /* Upon entry, the current character is the '^' of a @^ sequence. The task is */ /* to parse the following ascii code and generate a text token. */ p_ps_t p_psspec; { ubyte base; /* Base of the number we are scanning. */ ubyte digits; /* Number of digits expected. */ uword val; /* Value of target character. */ ubyte i; /* Looping variable. */ STAVAR char alphab[256]; /* Static alphabet array to which to point scraps. */ STAVAR bool init=FALSE; /* Tells if alphab has been initialized. */ /* Establish an array containing the ascii character set. Later on we can */ /* point the sc_first and sc_last pointers to particular characters. */ if (!init) {uword i; for (i=0;i<256;i++) alphab[i]=(char) i; init=TRUE;} /* Make sure that the base character is legal. */ NEXTCH; switch(toupper(ch)) { case 'B': base= 2; digits=8; break; case 'O': case 'Q': base= 8; digits=3; break; case 'D': base=10; digits=3; break; case 'H': case 'X': base=16; digits=2; break; default : lr_err(psofch(),"Expecting one of 'B', 'Q', 'D', 'H'."); lr_mes(psofch(),"(For Binary, Octal, Decimal, and Hexadecimal)."); base=10; goto trouble; } /* Parse opening parenthesis. */ NEXTCH; if (ch!='(') {lr_err(psofch(),"Expecting '('.");goto trouble;} val=0; for (i=0;i=base) {lr_err(psofch(),"Illegal digit."); goto trouble;} val = base*val + d; } /* Parse closing parenthesis. */ NEXTCH; if (ch!=')') {lr_err(psofch(),"Expecting ')'.");goto trouble;} /* Make sure that the number is not too big (this is possible in decimal). */ if (val>255) { lr_err(psofch(),"Character number is too large."); lr_mes(psofch(),"Character number must be in the range [0,255] (decimal)."); goto trouble; } /* Success! Now we can parcel it up into a scrap! */ sendtext(p_psspec,&alphab[val],&alphab[val],ch==' ' || ch==EOL); return; trouble: /* Jump here after a specific diagnostic to give the user a reminder of */ /* how to specify an ascii character constant. */ switch (base) { case 2: lr_mes(psofch(), "A binary character representation takes the form \"@^B(dddddddd)\"."); lr_mes(psofch(), "(exactly 8 digits) where each digit d is either 0 or 1."); break; case 8: lr_mes(psofch(), "An octal character representation takes the form \"@^Q(ddd)\" (or \"@^O(ddd)\")."); lr_mes(psofch(), "(exactly 3 digits) where each digit d is in the range 0..7."); break; case 10: lr_mes(psofch(), "A decimal character representation takes the form \"@^D(ddd)\"."); lr_mes(psofch(), "(exactly 3 digits) where each digit d is in the range 0..9."); break; case 16: lr_mes(psofch(), "A hexadecimal character representation takes the form \"@^X(dd)\" (or \"@^H(dd)\")."); lr_mes(psofch(), "(exactly 2 digits) where each digit d is in the range 0..9,A..F."); break; default: as_bomb("do_ascii: trouble base switch defaulted."); } } /******************************************************************************/ LOCAL void do_name P_((p_ps_t)); LOCAL void do_name (p_psspec) /* Upon entry, the current character is the # of a @#. The task is to parse */ /* it and transmit a name token. */ p_ps_t p_psspec; { as_cold(ch=='#',"do_name: character is wrong."); NEXTCH; if ((ch==EOL) || (ch==' ')) {lr_err(psofch(),"Expecting a printable character."); return;} /* Transmit a name token. */ sendspec(p_psspec,TK_NAME,(ubyte) ch); } /******************************************************************************/ LOCAL void do_pgind P_((uword,p_pt_t)); LOCAL void do_pgind(numarg,arg) /* Parse an indentation pragma. */ uword numarg; p_pt_t arg; { bool pragind; ps_t psprag; /* Make sure that there are exactly three arguments. */ if (numarg != 3) /* "indentation" "none|blank". */ { lr_err(&arg[0].pt_ps, "This indentation pragma has the wrong number of arguments."); goto help; } /* Make sure that the second argument is an "=". */ if (0 != strcmp(arg[2].pt_pstr,"=")) { lr_err(&arg[2].pt_ps,"Expecting \"=\"."); goto help; } /* Check the third argument. */ if (strcmp(arg[3].pt_pstr,"none" )==0) pragind=FALSE; else if (strcmp(arg[3].pt_pstr,"blank")==0) pragind=TRUE; else { lr_err(&arg[3].pt_ps,"Expecting either \"none\" or \"blank\"."); goto help; } /* Construct a shorthand for the start of the pragma. */ ASSIGN(psprag,arg[0].pt_ps); /* Make sure that the pragma does not contradict an earlier pragma. */ if (seenind && (tgindent!=pragind)) { sprintf(linet1,"This pragma is opposed by the pragma at line %lu.", (unsigned long) psprag.ps_line); lr_mes(&ps_ind,linet1); sprintf(linet1,"This pragma opposes the pragma at line %lu.", (unsigned long) ps_ind.ps_line); lr_err(&psprag,linet1); lr_mes(&psprag,"You can have as many indentation pragmas as you like,"); lr_mes(&psprag,"but they all have to be the same!"); lr_mes(&psprag,"Pragma ignored."); return; } /* Success: Record the pragma information. */ seenind = TRUE; /* Record that we have seen a pragma. */ tgindent = pragind; /* Record what the pragma said. */ ASSIGN(ps_ind,psprag); /* Record where the pragma was. */ return; help: lr_mes(&arg[0].pt_ps, "The correct format is: \"@p indentation = none|blank\"."); lr_mes(&arg[0].pt_ps,"Pragma ignored."); return; } /******************************************************************************/ LOCAL void do_pginl P_((uword,p_pt_t)); LOCAL void do_pginl(numarg,arg) /* Parse a maximum input line length pragma. */ uword numarg; p_pt_t arg; { char *numstr; uword spn; /* Make sure that there are exactly three arguments. */ if (numarg != 3) /* "max..length = ". */ { lr_err(&arg[0].pt_ps,"This pragma has the wrong number of arguments."); goto help; } /* Make sure that the second argument is "=". */ if (0 != strcmp(arg[2].pt_pstr,"=")) {lr_err(&arg[2].pt_ps,"Expecting \"=\"."); goto help;} /* Set up an abbreviation. */ numstr=arg[3].pt_pstr; /* See if the value is "infinity". */ if (strcmp(numstr,"infinity")==0) {inln_max=INMAXINF; return;} /* Calculate length of longest prefix containing all decimal digits. */ /* Check that there are no illegal digits. */ spn=strspn(numstr,"0123456789"); if (spn != strlen(numstr)) { ps_t ps; ASSIGN(ps,arg[3].pt_ps); ps.ps_column+=spn; lr_err(&ps,"Illegal digit. Value must consist entirely of decimal digits."); lr_mes(&ps,"You can also use the value \"infinity\"."); lr_mes(&ps,"Pragma ignored."); return; } /* Check that the number is not too long. */ if (strlen(numstr)>8) { lr_err(&arg[3].pt_ps,"Too many digits. The maximum is eight."); lr_mes(&arg[3].pt_ps,"Pragma ignored."); return; } /* Convert the argument into an integer. */ { ulong val; int result; /* Note: Should really be %lu, but the Vax doesn't know about the %u */ /* in sscanf and so we make do with %ld. */ result=sscanf(numstr,"%ld",&val); as_cold(result==1,"do_pginl:sscanf failed."); inln_max=val; } return; help: lr_mes(&arg[0].pt_ps, "The correct format is: \"@p maximum_input_line_length = |infinity\"."); lr_mes(&arg[0].pt_ps,"Pragma ignored."); return; } /******************************************************************************/ LOCAL void do_pgotl P_((uword,p_pt_t)); LOCAL void do_pgotl(numarg,arg) /* Parse a maximum product file line length pragma. */ uword numarg; p_pt_t arg; { char *numstr; uword spn; ulong val; ps_t psprag; /* Set up an abbreviation. */ ASSIGN(psprag,arg[0].pt_ps); /* Make sure that there are exactly three arguments. */ if (numarg != 3) /* "max..length" "=" "value". */ { lr_err(&arg[0].pt_ps,"This pragma has the wrong number of arguments."); goto help; } /* Make sure that the second argument is an "=". */ if (0 != strcmp(arg[2].pt_pstr,"=")) {lr_err(&arg[2].pt_ps,"Expecting \"=\"."); goto help;} /* Set up an abbreviation. */ numstr=arg[3].pt_pstr; /* See if the value is "infinity". */ if (strcmp(numstr,"infinity")==0) {val=TGMAXINF; goto gotvalue;} /* Calculate length of longest prefix containing all decimal digits. */ /* Check that there are no illegal digits. */ spn=strspn(numstr,"0123456789"); if (spn != strlen(numstr)) { ps_t ps; ASSIGN(ps,arg[3].pt_ps); ps.ps_column+=spn; lr_err(&ps,"Illegal digit. Value must consist entirely of decimal digits."); lr_mes(&ps,"You can also use the value \"infinity\"."); lr_mes(&ps,"Pragma ignored."); return; } /* Check that the number is not too long. */ if (strlen(numstr)>8) { lr_err(&arg[3].pt_ps,"Too many digits. The maximum is eight."); lr_mes(&arg[3].pt_ps,"Pragma ignored."); return; } /* Convert the argument into an integer. */ { int result=sscanf(numstr,"%ld",&val); as_cold(result==1,"do_pgotl:sscanf failed."); } gotvalue: /* Make sure that the pragma does not contradict an earlier pragma. */ if (seenlimo && (tglinmax!=val)) { sprintf(linet1,"This pragma is opposed by the pragma at line %lu.", (unsigned long) psprag.ps_line); lr_mes(&ps_limo,linet1); sprintf(linet1,"This pragma opposes the pragma at line %lu.", (unsigned long) ps_limo.ps_line); lr_err(&psprag,linet1); lr_mes(&psprag,"You can have as many output line length pragmas"); lr_mes(&psprag,"as you like, but they all have to be the same!"); lr_mes(&psprag,"Pragma ignored."); return; } /* If we got this far then the pragma is just the same as an earlier one. */ /* We don't want to set the pragma position to the later pragma so we */ /* return now. */ if (seenlimo) return; /* Success. Set the variables. */ tglinmax=val; seenlimo=TRUE; ASSIGN(ps_limo,psprag); return; help: lr_mes(&arg[0].pt_ps, "The correct format is: \"@p maximum_output_line_length = |infinity\"."); lr_mes(&arg[0].pt_ps,"Pragma ignored."); return; } /******************************************************************************/ LOCAL void do_pgnpg P_((uword,p_pt_t)); LOCAL void do_pgnpg(numarg,arg) /* Parse a newpage typesetter directive. */ uword numarg; p_pt_t arg; { /* Make sure that there is exactly one argument. */ if (numarg > 1) /* "new_page" */ { lr_err(&arg[2].pt_ps,"The new_page directive does not take arguments."); lr_mes(&arg[2].pt_ps,"Directive ignored."); return; } sendspec(&arg[0].pt_ps,TK_NPAG,DONTCARE); } /******************************************************************************/ LOCAL void do_pgtoc P_((uword,p_pt_t)); LOCAL void do_pgtoc(numarg,arg) /* Parse a table of contents typesetter directive. */ uword numarg; /* Number of arguments to table of contents directive. */ p_pt_t arg; /* Array describing arguments. */ { /* Make sure that there is exactly one argument. */ if (numarg > 1) /* "table_of_contents" */ { lr_err(&arg[2].pt_ps, "The table_of_contents directive does not take arguments."); lr_mes(&arg[2].pt_ps,"Directive ignored."); return; } sendspec(&arg[0].pt_ps,TK_TOCS,DONTCARE); } /******************************************************************************/ LOCAL void do_pgvsk P_((uword,p_pt_t)); LOCAL void do_pgvsk(numarg,arg) /* Parse a vskip typesetter directive. */ uword numarg; /* Number of arguments to indentation directive. */ p_pt_t arg; /* Array describing arguments. */ { char *numstr; uword spn; /* Make sure that there are exactly three arguments. */ if (numarg != 3) /* "vskip" n "mm". */ { lr_err(&arg[0].pt_ps,"This directive has the wrong number of arguments."); goto help; } /* Make sure that the third argument is "mm". */ if (0 != strcmp(arg[3].pt_pstr,"mm")) {lr_err(&arg[3].pt_ps,"Expecting \"mm\"."); goto help;} /* Set up an abbreviation. */ numstr=arg[2].pt_pstr; /* Calculate length of longest prefix containing all decimal digits. */ /* Check that there are no illegal digits. */ spn=strspn(numstr,"0123456789"); if (spn != strlen(numstr)) { ps_t ps; ASSIGN(ps,arg[2].pt_ps); ps.ps_column+=spn; lr_err(&ps,"Illegal digit."); lr_mes(&ps,"Value must consist entirely of decimal digits."); lr_mes(&ps,"Directive ignored."); return; } /* Check that the number is not too long. */ if (strlen(numstr)>3) { lr_err(&arg[2].pt_ps,"Too many digits. The maximum is three."); lr_mes(&arg[2].pt_ps,"Directive ignored."); return; } /* Convert the argument into an integer. */ { ulong val; int result; result=sscanf(numstr,"%ld",&val); as_cold(result==1,"do_pginl:sscanf failed."); if (val>255) { lr_err(&arg[2].pt_ps,"Value too large. Maximum is 255."); lr_mes(&arg[2].pt_ps,"Directive ignored."); return; } sendspec(&arg[0].pt_ps,TK_SKIP,(ubyte) val); } return; help: lr_mes(&arg[0].pt_ps,"The correct format is: \"@t vskip mm\"."); lr_mes(&arg[0].pt_ps,"Directive ignored."); return; } /******************************************************************************/ LOCAL void do_pgtit P_((uword,p_pt_t)); LOCAL void do_pgtit(numarg,arg) /* Parse a title typesetter directive. */ uword numarg; /* Number of arguments to title directive. */ p_pt_t arg; /* Array describing arguments. */ { uword align; uword font; char *p_sot,*p_eot; /* Make sure that there are at least three arguments. */ if (numarg < 4) /* "title ". */ {lr_err(&arg[0].pt_ps,"This directive has too few arguments."); goto help;} /* Check the font argument. */ if (strcmp(arg[2].pt_pstr,"normalfont" )==0) font=FT_NORM; else if (strcmp(arg[2].pt_pstr,"titlefont" )==0) font=FT_TITL; else if (strcmp(arg[2].pt_pstr,"smalltitlefont")==0) font=FT_STIT; else { lr_err(&arg[2].pt_ps, "Expecting one of {titlefont,smalltitlefont,normalfont}."); lr_mes(&arg[2].pt_ps,"Directive ignored."); return; } /* Check the alignment argument. */ if (strcmp(arg[3].pt_pstr,"left" )==0) align=LR_LEFT; else if (strcmp(arg[3].pt_pstr,"right" )==0) align=LR_RIGH; else if (strcmp(arg[3].pt_pstr,"centre")==0) align=LR_CENT; else { lr_err(&arg[3].pt_ps,"Expecting one of {left,right,centre}."); if (strcmp(arg[3].pt_pstr,"center")==0) { lr_mes(&arg[3].pt_ps,"Note: Centre is spelt centRE, not centER."); lr_mes(&arg[3].pt_ps," This is my revenge for years of getting error messages"); lr_mes(&arg[3].pt_ps," from TeX whenever I accidentally wrote \\centreline - Ross Williams."); } lr_mes(&arg[3].pt_ps,"Directive ignored."); return; } /* Now make sure that the remainder of the line is delimited by quotes. */ p_sot=arg[4].pt_pinl; p_eot=p_sot+strlen(p_sot)-1; if (*p_sot!='"' || *p_eot!='"' || p_sot==p_eot) { lr_err(&arg[4].pt_ps,"Text argument must be delimited by double quotes."); lr_mes(&arg[4].pt_ps,"Directive ignored."); return; } p_sot++; p_eot--; /* Ship out a token whose fields are all fully laden. */ { tk_t token; token.tk_kind = TK_TITL; ASSIGN(token.tk_ps,arg[0].pt_ps); token.tk_sc.sc_first = p_sol+ (3+(p_sot-arg[1].pt_pinl)); token.tk_sc.sc_last = p_sol+ (3+(p_eot-arg[1].pt_pinl)); token.tk_sc.sc_white = FALSE; token.tk_gen = LRFT_PACK*font+align; ls_add(token_list,PV &token); } return; help: lr_mes(&arg[0].pt_ps, "The correct format is: \"@t title \"."); lr_mes(&arg[0].pt_ps, " where = titlefont | smalltitlefont | normalfont."); lr_mes(&arg[0].pt_ps, " and = left | centre | right."); lr_mes(&arg[0].pt_ps, " and = text delimited by double quotes."); lr_mes(&arg[0].pt_ps,"Directive ignored."); return; } /******************************************************************************/ LOCAL void do_pgtyp P_((uword,p_pt_t)); LOCAL void do_pgtyp(numarg,arg) /* Parse a typesetter pragma. */ uword numarg; p_pt_t arg; { tr_k_t pragtyp; ps_t psprag; /* Make sure that there are exactly three arguments. */ if (numarg != 3) /* "typesetter" "=" "name". */ { lr_err(&arg[0].pt_ps, "This typesetter pragma has the wrong number of arguments."); goto help; } /* Make sure that the second argument is "=". */ if (0 != strcmp(arg[2].pt_pstr,"=")) { lr_err(&arg[2].pt_ps,"Expecting \"=\"."); goto help; } /* Check the third argument. */ if (strcmp(arg[3].pt_pstr,"none")==0) pragtyp=TR_NONE; else if (strcmp(arg[3].pt_pstr,"tex" )==0) pragtyp=TR_TEX; else if (strcmp(arg[3].pt_pstr,"html")==0) pragtyp=TR_HTML; else { lr_err(&arg[3].pt_ps,"Expecting one of [none,tex,html]."); goto help; } /* Construct a shorthand for the start of the pragma. */ ASSIGN(psprag,arg[0].pt_ps); /* Make sure that the pragma does not contradict an earlier pragma. */ if (seentyp && (tr_codes != pragtyp)) { sprintf(linet1,"This pragma is opposed by the pragma at line %lu.", (unsigned long) psprag.ps_line); lr_mes(&ps_typ,linet1); sprintf(linet1,"This pragma opposes the pragma at line %lu.", (unsigned long) ps_typ.ps_line); lr_err(&psprag,linet1); lr_mes(&psprag,"You can have as many typesetter pragmas as you like,"); lr_mes(&psprag,"but they all have to be the same!"); lr_mes(&psprag,"Pragma ignored."); return; } /* Success: Record the pragma information. */ seentyp = TRUE; /* Record that we have seen a pragma. */ tr_codes = pragtyp; /* Record what the pragma said. */ ASSIGN(ps_typ,psprag); /* Record where the pragma was. */ return; help: lr_mes(&arg[0].pt_ps, "The correct format is: \"@p typesetter = none|tex|html\"."); lr_mes(&arg[0].pt_ps,"Pragma ignored."); return; } /******************************************************************************/ LOCAL void do_pragma P_((p_ps_t,bool)); LOCAL void do_pragma(p_ps,is_typ) /* Upon entry, the current character is: */ /* is_typ=FALSE => The P of a @p. */ /* is_typ=TRUE => The T of a @t. */ /* This function processes these contructs. */ p_ps_t p_ps; bool is_typ; { #define MAXPARG 10 /* Maximum recorded arguments to a pragma. */ #define PRAGMA_MAX 100 /* Maximum length of a pragma. */ char praglin[PRAGMA_MAX+1]; /* Array to hold pragma as a complete line. */ char pragstr[PRAGMA_MAX+1]; /* Array to hold pragma as strings. */ pt_t pragarg[MAXPARG+1]; /* Array of pragma arguments. */ uword length; /* Helps prevent scanning overrun. */ char *p,*q; /* Temporary. */ uword numarg,na; /* Number of arguments seen so far. */ /* Complain if the pragma directive is not at the start of a line. */ if (p_ch-1 != p_sol) { if (is_typ) { lr_err(p_ps,"Typesetter directive @t must be at the start of a line."); lr_mes(p_ps,"The rest of this line will be ignored."); } else { lr_err(p_ps,"Pragma sequence @p must be at the start of a line."); lr_mes(p_ps,"The rest of this line will be ignored."); } skiptoeol(); goto help; } /* The include command should be followed by a blank. Get the next char. */ NEXTCH; /* Complain if the next character is not a blank. */ if (ch != ' ') { /* Note: If we position this error correctly, it gets put after the */ /* help message! */ if (is_typ) lr_err(p_ps,"Typesetter directive @t must be followed by a blank."); else lr_err(p_ps,"Pragma sequence @p must be followed by a blank."); skiptoeol(); goto help; } /* Copy the rest of the line to the pragma arrays. */ NEXTCH; p = &praglin[0]; q = &pragstr[0]; length=0; while (ch!=EOL) { if (++length > PRAGMA_MAX-3) /* 3 is for "@p " or "@t " */ { if (is_typ) { lr_err(p_ps,"This typestter directive line is too long."); sprintf(linet1,"The maximum typesetter directive line length is %u characters.", (unsigned) PRAGMA_MAX); lr_mes(p_ps,linet1); } else { lr_err(p_ps,"This pragma line is too long."); sprintf(linet1,"The maximum pragma line length is %u characters.", (unsigned) PRAGMA_MAX); lr_mes(p_ps,linet1); } skiptoeol(); goto help; } *p++=ch; *q++=ch; NEXTCH; } *p=EOS; *q=EOS; /* Note: Current position is now on the EOL at the end of the @p line. */ /* That is the way we want to leave it for the scanspec() routine. */ /* So far we have copied the body of the pragma line into two arrays. The */ /* next lump of code parses that line into a sequence of non-blank arguments.*/ /* The result is an array of pt_t objects each of which contains the */ /* position of each argument, a pointer to the first character of each */ /* argument in praglin, and also a pointer to a string containing the arg. */ /* The string resides in the array pragstr which is the same as praglin */ /* except that some blanks have been replaced by EOSs so as to allow us to */ /* point into it to form strings. All this probably seems rather overdone */ /* for the analysis of a "simple" pragma, but I have found that pulling the */ /* different kinds of pragma lines apart separately is very messy. Far */ /* better to suffer here in what is at least reasonably neat code than */ /* later in the specific pragma routines. */ numarg=0; p= &praglin[0]; q= &pragstr[0]; while (TRUE) { /* Skip whitespace between arguments. */ while (*p==' ') {p++;q++;} /* Exit if we have hit the end of the line. */ if ((numarg==MAXPARG) || (*p==EOS)) break; /* We have found another argument! */ numarg++; /* Record the argument. */ ASSIGN(pragarg[numarg].pt_ps,*p_ps); pragarg[numarg].pt_ps.ps_column=4+(p-praglin); pragarg[numarg].pt_pinl=p; pragarg[numarg].pt_pstr=q; /* Skip to the end of the argument. */ while (*p!=' ' && *p!=EOS) {p++;q++;} /* Drop a null in the string array to complete string rep of argument. */ *q=EOS; } /* At this point numarg is MIN(arguments,MAXPARG), and pragargs contains an */ /* entry for each of the numarg arguments. */ /* It is handy to have the position of the pragma itself handy. */ ASSIGN(pragarg[0].pt_ps,*p_ps); /* CHECK: Make sure that the line and string arrays square up. */ { uword i; for (i=1;i<=numarg;i++) { uword j; uword t=strlen(pragarg[i].pt_pstr); for (j=0;j "); lr_mes(p_ps," @t vskip mm"); lr_mes(p_ps,"The blanks between arguments are important."); lr_mes(p_ps,"Typesetter directive ignored."); } else { lr_err(p_ps,"Unrecognised pragma. Possible legal pragmas are:"); lr_mes(p_ps," @p indentation = none | blank"); lr_mes(p_ps," @p maximum_input_line_length = |infinity"); lr_mes(p_ps," @p maximum_output_line_length = |infinity"); lr_mes(p_ps," @p typesetter = none | tex"); lr_mes(p_ps,"The blanks between arguments are important."); lr_mes(p_ps,"Pragma ignored."); } } /******************************************************************************/ LOCAL void chksol P_((void)); LOCAL void chksol() /* This function is called when the current character is the character after */ /* an @. The function checks to see if the @ was at the start of a line and */ /* issues a error message if it isn't. */ { ps_t ps; grabchps(&ps); if (ps.ps_column != 2) { ps.ps_column--; sprintf(linet1,"@%c is legal only at the start of a line.",ch); lr_err(&ps,linet1); } } /******************************************************************************/ LOCAL void scanspec P_((void)); LOCAL void scanspec() /* Upon entry the current character is the special character (usually '@'). */ /* The task is to scan the special sequence. Upon exit, the current character */ /* is the character following the special sequence. */ { ps_t ps_spec; /* Position of start of special sequence. */ /* Make a note of where the special sequence starts. */ grabchps(&ps_spec); /* Move onto the character following the special (escape) character. */ NEXTCH; /* Now react to the character. In most cases, the special sequence is simply */ /* a marker in the input and we can simply transmit it. The nasty special */ /* case sequences are left until the end of the switch statement. */ /* Purists will complain about how all the case options are hardwired and */ /* say that symbols should have been used. They once were, but were taken */ /* out when it was discovered that the symbols had cryptic names (because of */ /* the portability eight-character rule) and were only used here anyway. */ switch (toupper(ch)) { case '<': sendspec(&ps_spec,TK_ONAM,DONTCARE); break; case '>': sendspec(&ps_spec,TK_CNAM,DONTCARE); break; case '{': sendspec(&ps_spec,TK_ODEF,DONTCARE); break; case '}': sendspec(&ps_spec,TK_CDEF,DONTCARE); break; case '(': sendspec(&ps_spec,TK_OPAR,DONTCARE); break; case ')': sendspec(&ps_spec,TK_CPAR,DONTCARE); break; case ',': sendspec(&ps_spec,TK_COMA,DONTCARE); break; case '"': sendspec(&ps_spec,TK_QUOT,DONTCARE); break; case '/': sendspec(&ps_spec,TK_EMPH,DONTCARE); break; case 'A': sendspec(&ps_spec,TK_NSEC,1); chksol(); break; case 'B': sendspec(&ps_spec,TK_NSEC,2); chksol(); break; case 'C': sendspec(&ps_spec,TK_NSEC,3); chksol(); break; case 'D': sendspec(&ps_spec,TK_NSEC,4); chksol(); break; case 'E': sendspec(&ps_spec,TK_NSEC,5); chksol(); break; case '1': sendspec(&ps_spec,TK_PARM,1); break; case '2': sendspec(&ps_spec,TK_PARM,2); break; case '3': sendspec(&ps_spec,TK_PARM,3); break; case '4': sendspec(&ps_spec,TK_PARM,4); break; case '5': sendspec(&ps_spec,TK_PARM,5); break; case '6': sendspec(&ps_spec,TK_PARM,6); break; case '7': sendspec(&ps_spec,TK_PARM,7); break; case '8': sendspec(&ps_spec,TK_PARM,8); break; case '9': sendspec(&ps_spec,TK_PARM,9); break; case 'M': sendspec(&ps_spec,TK_MANY,DONTCARE); break; case 'Z': sendspec(&ps_spec,TK_ZERO,DONTCARE); break; case 'L': sendspec(&ps_spec,TK_LIBR,DONTCARE); break; case 'O': sendspec(&ps_spec,TK_FDEF,DONTCARE); chksol(); break; case '$': sendspec(&ps_spec,TK_MDEF,DONTCARE); chksol(); break; case EOL: lr_err(&ps_spec," is not a legal special sequence."); break; case ' ': lr_err(&ps_spec," is not a legal special sequence."); break; case '@': /* @ instructs FunnelWeb to replace the special construct with the */ /* special character. Luckily one appears just before the @ !! */ /* Note: FALSE is OK because space is not a legal specialch. */ sendtext(&ps_spec,p_ch-1,p_ch-1,FALSE); break; case '-': /* - instructs FunnelWeb to suppress the following end of line. */ if (*(p_ch+1) == EOL) NEXTCH else lr_err(&ps_spec, "Suppress EOL sequence is legal only at the end of a line."); break; case '+': /* + instructs FunnelWeb to insert an EOL. We can't look to the end of */ /* the previous line to find an EOL as this might be the first line. */ /* Running ahead to the end of the line is expensive, and having the */ /* liner mini-package maintain a variable for it would be extra */ /* housekeeping. Instead of all this, we just point to a static. */ {STAVAR char stateol = EOL; sendtext(&ps_spec,&stateol,&stateol,TRUE);} break; case '=': /* = instructs FunnelWeb to change the special character to the */ /* character following the = sequence. */ NEXTCH; if (ch == ' ') { lr_err(&ps_spec,"You cannot set the special character to !"); lr_mes(&ps_spec,"Special sequence ignored."); } else if (ch == EOL) { lr_err(&ps_spec, "You cannot set the special character to !"); lr_mes(&ps_spec,"Special sequence ignored."); } else specialch=ch; break; case '!': /* ! instructs FunnelWeb to ignore the rest of the line (a comment). */ skiptoeol(); break; case 'I': /* i instructs FunnelWeb to include a file. */ incl_fil(&ps_spec); break; case '^': /* ^ instructs FunnelWeb to insert a specific ascii character. */ do_ascii(&ps_spec); break; case '#': /* # instructs FunnelWeb to transmit a two character name "#c". */ do_name(&ps_spec); break; case 'P': /* P is used as a miscellaneous PRAGMA. */ do_pragma(&ps_spec,FALSE); break; case 'T': /* T introduces a one-line typesetting directive. */ do_pragma(&ps_spec,TRUE); break; default: lr_err(&ps_spec,"Unknown special sequence."); break; } /* The switch statment absorbs the special sequence and its effects. */ /* This NEXTCH places us on the character following the special sequence. */ NEXTCH; } /******************************************************************************/ LOCAL void scantext P_((void)); LOCAL void scantext() /* Upon entry, we know that the current character is not EOF and that it is */ /* not the special character. Our task is to parse as much text as we can and */ /* ship it off as a text token. The scanner will probably spend most of its */ /* time in the loops in this function so it is important that they be */ /* efficient. That is why two loops are used to deal with detecting */ /* whitespace rather than a flag. */ /* Upon return, the current character is the character following the text */ /* sequence. This is guaranteed to be the special character or an EOF. */ { ps_t ps_start; /* Position of first character of text sequence. */ char *p_first = p_ch; /* Pointer to first character of text sequence. */ /* Grab a copy of the position of this token. */ grabchps(&ps_start); /* Scan whitespace. */ while (ch==' ' || ch==EOL) NEXTCH; /* If we hit something that ends a text token */ /* then we can transmit a white text token. */ if (ch==specialch || ch==EOFCH) {sendtext(&ps_start,p_first,p_ch-1,TRUE); return;} /* Otherwise we have some more (non-white) text to scan. */ /* We can then send a non-white text token. */ while (ch!=specialch && ch!=EOFCH) NEXTCH; sendtext(&ps_start,p_first,p_ch-1,FALSE); } /******************************************************************************/ LOCAL void scan_file(p_fname) /* This function scans a single file. It's argument is the name of the file */ /* to be scanned. scan_file calls the mapper to map in the file and then */ /* scans the text of the mapped file using the liner mini-package. The result */ /* of the scan is additions to the line and token list, and diagnostics sent */ /* to the lister package. If an include directive is encountered, this */ /* function is called recursively. */ char *p_fname; { char *p_mapped; /* Pointer to the mapped file. */ ulong length; /* Number of bytes in the mapped file. */ char *errstr; /* Error string returned by mapper. */ bool addedeol; /* Did we have to add an EOL to the end of the last line? */ /* Check to see if the file exists. */ if (!fexists(p_fname)) { if (inclevel==0) { /* Failure to find the main file is a severe error. */ if (option.op_b7_b) sprintf(linet1,"S: Error opening input file \"%s\".",SUPPNAME); else sprintf(linet1,"S: Error opening input file \"%s\".",p_fname); wl_l(linet1); /* Although strictly speaking we should suppress this error from the */ /* screen stream unless option.op_s_b is set, absence of an input file */ /* is such an important error, that we write it out anyway. */ /* if (option.op_s_b) */ wl_sj(linet1); num_sev++; return; } else { /* Failure to find an include file is an ordinary error. */ ps_t ps; ps.ps_line = globalno; ps.ps_column = 4; lr_err(&ps,"Error opening include file."); if (option.op_b7_b) sprintf(linet1, "The include file's expanded name was \"%s\".",SUPPNAME); else sprintf(linet1, "The include file's expanded name was \"%s\".",p_fname); lr_mes(&ps,linet1); return; } } /* Map the specified file into memory. We need to change from the scanner */ /* clock to the mapper clock to keep the time accounting correct here. */ ck_stop(p_scan); ck_start(p_mapp); errstr=map_file(p_fname,&p_mapped,&length); ck_stop(p_mapp); ck_start(p_scan); /* Abort if the mapping was not possible. */ if (errstr != NULL) if (inclevel==0) { /* Failure to map the main file is a severe error. */ if (option.op_b7_b) sprintf(linet1,"S: Error reading input file \"%s\".",SUPPNAME); else sprintf(linet1,"S: Error reading input file \"%s\".",p_fname); wl_l(linet1); if (option.op_s_b) wl_sj(linet1); wl_l(errstr); if (option.op_s_b) wl_sj(errstr); num_sev++; return; } else { /* Failure to find an include file is an ordinary error. */ ps_t ps; ps.ps_line = globalno; ps.ps_column = 4; lr_err(&ps,"Error reading include file."); lr_mes(&ps,errstr); if (option.op_b7_b) sprintf(linet1,"The include file's expanded name was \"%s\".", SUPPNAME); else sprintf(linet1,"The include file's expanded name was \"%s\".", p_fname); lr_mes(&ps,linet1); return; } /* Dump the mapped file if requested. */ if (option.op_b1_b) { if (option.op_b7_b) sprintf(linet1,"Dump of mapped file \"%s\".",SUPPNAME); else sprintf(linet1,"Dump of mapped file \"%s\".",p_fname); wl_l(linet1); dm_mem(&f_l,p_mapped,length); } /* If the file is absolutely empty, we have to warn the user. Also, this is */ /* a special case we can do without, and so we return here if file is empty. */ if (length==0) { ps_t ps; /* The empty file could be the main file or an include file. */ /* If the empty file is the main file, we want the diagnostic to point to */ /* the EOF marker which will appear as line 1. */ /* If the empty file is an include file, we wish to point the diagnostic */ /* to the line containing the include command. This is globalno. */ /* In both cases, we want the diagnostic to point to column 1. */ ps.ps_column=1; if (inclevel==0) { ps.ps_line=1; lr_war(&ps,"Input file is empty (not a byte in syte)!"); } else { /* 08-May-1999 RNW Include file name added. */ /* See 8 May note at the end of the function. */ ps.ps_line=globalno; if (option.op_b7_b) sprintf(linet1,"Include file \"%s\" is empty (not a byte in syte)!",SUPPNAME); else sprintf(linet1,"Include file \"%s\" is empty (not a byte in syte)!",p_fname); lr_war(&ps,linet1); } return; } /* Scanning is considerably simplified if we can guarantee that we will not */ /* run into an EOF without first hitting an EOL. The following code takes */ /* care of this by tacking one on the end if necessary and also adds an */ /* EOF character on the end, which also simplifies the scanning. We can get */ /* away with all this because the mapper purposefully leaves at least two */ /* bytes free for us at the end of the mapped file. */ addedeol=FALSE; if (p_mapped[length-1] != EOL) {p_mapped[length++]=EOL; addedeol=TRUE;} p_mapped[length]=EOFCH; /* Initialize the variables "instantiated over a single file". */ inln_max = 80; specialch = CH_DSPE; localno = 0; p_eof = &p_mapped[length]; /* Crank up the line subscanner system with a call to prepline. */ /* Then enter the main scanning loop. */ /* All input consists of alternating special and text sequences */ /* terminated by EOF. */ prepline(p_mapped); while (ch!=EOFCH) if (ch==specialch) scanspec(); else scantext(); /* Now that we are at the end of the scanned file and the scanning markers */ /* are all sitting on the end of the file, it is a good time to issue */ /* diagnostics about problems at the end of the file. */ if (addedeol) { ps_t ps; /* We want the diagnostic to point to the EOF line. Hence "global+1". */ ps.ps_line = globalno+1; ps.ps_column = 1; if (inclevel==0) lr_war(&ps,"The last line of the input file was terminated by EOF."); else { /* 08-May-1999 RNW FunnelWeb 3.0 didn't give the name of the included */ /* file when saying that an included file was not properly terminated. */ /* This caused significant confusion when there was a list of */ /* inclusions, as FunnelWeb's error was seemingly pointing to the NEXT */ /* inclusion! So I've added code to include the filename in the error */ /* message so as to eliminate the possibility of such confusion. */ if (option.op_b7_b) sprintf(linet1,"The last line of the include file \"%s\" was terminated by EOF.",SUPPNAME); else sprintf(linet1,"The last line of the include file \"%s\" was terminated by EOF.",p_fname); lr_war(&ps,linet1); } lr_mes(&ps,"An EOL was inserted at the end of the last line."); } } /******************************************************************************/ EXPORT void scanner(p_amapp,p_ascan) /* This is the scanner's main routine and the only exported function. */ p_ck_t p_amapp; /* Mapper's clock (stopped). */ p_ck_t p_ascan; /* Scanner's clock (running). */ { /* Copy the arguments into globals where we can get at them. */ p_mapp=p_amapp; p_scan=p_ascan; /* Apart from diagnostic messages sent to the lister, the only output of */ /* the scanner is two global lists holding a list of lines and a list of */ /* tokens. The scanner creates these lists simultaneously. */ /* We have to initialize them here before we get into 'scan_file' which */ /* calls itself recursively if an include file command is encountered. */ line_list =ls_cre(sizeof(ln_t)); token_list=ls_cre(sizeof(tk_t)); /* Initialize all the variables instantiated throughout the entire scan. */ globalno = 0; inclevel = 0; seenind = FALSE; seentyp = FALSE; seenlimo = FALSE; /* We also have to initialize localno in case the input file is empty and */ /* it never gets initialized before being sucked into being used as the */ /* local number for the end of file marker. */ localno=0; /* Initialize the global indentation flag to the default value. */ tgindent=TRUE; /* Initialize the global product line length limit to the default value. */ tglinmax=80; /* Initialize the global typesetter flag to the default value. */ tr_codes=TR_NONE; /* Scan the top level file whose name is obtained from the command line. */ as_cold(option.op_f_b,"scanner: -F!!!!"); /* Work out what the input file name should be. */ { fn_t fname; strcpy(fname,""); /* Start with an empty string. */ fn_ins(fname,".fw"); fn_ins(fname,option.op_f_s); scan_file(fname); } /* The scan_file function scans the main input file and all of its included */ /* files, but it does not append a TK_EOF token to the end. This call does */ /* this and also adds a line to the line list for EOF. */ add_eof(); } /******************************************************************************/ /* End of SCANNER.C */ /******************************************************************************/ it a white text token. */ if (ch==specialch || ch==EOFCH) {sendtext(&ps_start,p_first,p_ch-1,TRUE); return;} /* Otherwise we have some more (non-white) text to scan. */ /* We can then send afw_src/source/scanner.h 644 0 0 6232 6716661061 10406 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* SCANNER.H */ /******************************************************************************/ /* */ /* This package contains the scanner. When called (though the only exported */ /* routine below), the scanner maps in the file whose filename is given in */ /* the global option.op_f_s variable. The scanner scans the file, mapping in */ /* any included files, and builds two lists in the global list variables */ /* 'line_list' and 'token_list'. The line list contains a list of the lines */ /* of the input. The token list contains a tokenized form of the input, which */ /* is used by the parser. The scanner also sends diagnostics to the lister */ /* package which has the effect of possibly incrementing the global error */ /* counters num_*. See data.h for more information on data structures. */ /* */ /******************************************************************************/ #include "style.h" #include "clock.h" /******************************************************************************/ EXPORT void scanner P_((p_ck_t,p_ck_t)); /* The arguments are first a mapper clock, and second a scanner clock. The */ /* scanner should turn off the scanner clock and turn on the mapper clock */ /* when calling the mapper. */ /******************************************************************************/ /* End of SCANNER.H */ /******************************************************************************/ e sprintf(linet1,"Dump of mapped file \"%s\".",p_fname); wl_l(linet1); dm_mem(&f_l,p_mapped,length); } /* If the file is absolutely empty, we have to warn the user. Also, this is */ /* a special case we can do without, and so we return here if file is empty. */ if (length==0) { ps_t ps; /* The empty file could be the main fw_src/source/section.c 644 0 0 10360 6716661063 10433 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* SECTION.C */ /******************************************************************************/ #include "style.h" #include "as.h" #include "section.h" /******************************************************************************/ #define MAGIC (89201129L) /* Magic number detects uninitialized sections. */ #define SECMAX (30000L) /* Maximum value of a single level's section num. */ /******************************************************************************/ LOCAL void sn_chk P_((p_sn_t)); LOCAL void sn_chk(p_sn) /* Checks that the given section object has a legal internal state. */ p_sn_t p_sn; { ubyte i; as_cold(p_sn->sn_magic==MAGIC,"sn_chk: Section has bad magic number."); as_cold(p_sn->sn_lev<=SECLEV_MAX, "sn_chk: Section has bad level number."); for (i=1;i<=p_sn->sn_lev;i++) as_cold(p_sn->sn_num[i]>0, "sn_chk: Section has zero hierarchical number."); } /******************************************************************************/ EXPORT void sn_ini(p_sn) p_sn_t p_sn; { p_sn->sn_magic = MAGIC; p_sn->sn_lev = 0; } /******************************************************************************/ EXPORT void sn_set(p_sn,level) p_sn_t p_sn; ubyte level; { ubyte i; sn_chk(p_sn); as_cold(level>0 && level<=SECLEV_MAX, "sn_set: Specified level is too high."); p_sn->sn_lev=level; for(i=1;i<=level;i++) p_sn->sn_num[i]=1; } /******************************************************************************/ EXPORT void sn_inc (p_sn,lev) p_sn_t p_sn; ubyte lev; { sn_chk(p_sn); /* Check the parameter level. */ as_cold(1<=lev && lev<=SECLEV_MAX,"sn_inc: Bad level number specified."); /* Check that we are not skipping a hierarchical level. */ as_cold(lev<=p_sn->sn_lev+1,"sn_inc: Discountinuous level increment."); /* Actually increment the section. */ if (lev==p_sn->sn_lev+1) p_sn->sn_num[lev]=0; p_sn->sn_lev=lev; p_sn->sn_num[lev]++; /* Check that the section number hasn't got too big. */ as_cold(p_sn->sn_num[lev]<=SECMAX,"sn_inc: Section number is too large."); } /******************************************************************************/ EXPORT ubyte sn_lev(p_sn) p_sn_t p_sn; { sn_chk(p_sn); return p_sn->sn_lev; } /******************************************************************************/ EXPORT void sn_str(p_sn,s) p_sn_t p_sn; char *s; { char t[20]; ubyte i; sn_chk(p_sn); s[0]=EOS; for (i=1;i<=p_sn->sn_lev;i++) { if (i>1) strcat(s,"."); sprintf(t,"%u",(unsigned) p_sn->sn_num[i]); strcat(s,t); } } /******************************************************************************/ /* End of SECTION.C */ /******************************************************************************/ bal indentation flag to the default value. */ tgindent=TRUE; /* Initialize the global product line length limit to the default value. */ tglinmax=80; /* Initialize the global typesetter flag to the default value. */ tr_codes=TR_NONE; /* Scan the top level file whfw_src/source/section.h 644 0 0 13240 6716661063 10440 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* SECTION.H */ /******************************************************************************/ /* */ /* This package provides a very simple, very small abstraction for a section */ /* number. A section number is a hierarchical group of numbers such as is */ /* used to number the sections in documents. For example: 4.5.1.3 is a */ /* section number. This package provides an abstraction for these numbers */ /* that assists in their incrementing at different levels and in writing them */ /* out. The package also checks for hierarchical inconsistencies. */ /* */ /******************************************************************************/ /* Ensure that the body of this header file is included at most once. */ #ifndef DONE_SECTION #define DONE_SECTION /******************************************************************************/ #include "style.h" /******************************************************************************/ /* The following constant defines the maximum number of levels that a */ /* FunnelWeb document can have. @A corresponds to level 1. */ #define SECLEV_MAX 5 /* The following constant defines the maximum length of a string representing */ /* a section. This is calculated as the maximum number of levels multiplied */ /* by 1 (for the separating dots) plus a safe size for a decimal number. */ #define SECSTR_MAX (SECLEV_MAX*(1+10)) /* The following structure stores a single section number. The sc_level */ /* field is the level of this field and is in the range [1,SECLEV_MAX]. The */ /* sc_num field is defined only for elements [1,level] and contains the */ /* hierarchy number at each level. */ /* Example: For SECLEVMAX=4 and "3.4.1", level=3 and num=[?,3,4,1,?]. */ /* Note: The first question mark is for element zero which is always unknown. */ typedef struct { ulong sn_magic; /* Used to detect uninitialized sn objects. */ ubyte_ sn_lev; /* Level number of section. */ uword_ sn_num[SECLEV_MAX+1]; /* Hierarchical level numbers. */ } sn_t; typedef sn_t *p_sn_t; /******************************************************************************/ EXPORT void sn_ini P_((p_sn_t)); /* Initializes the specified section object to the empty section at level 0. */ /* All sections must be initialized before any other operations are performed.*/ EXPORT void sn_set P_((p_sn_t,ubyte)); /* Sets the specified section to 1.1.1.1.1.1... at the given level. */ /* Example: sn_set(p_sn,3) yields a section set to 1.1.1. */ /* Raises an error if the specified level is out of range. */ EXPORT void sn_inc P_((p_sn_t,ubyte)); /* Increments the number of the specified section object at the specified */ /* level. This also has the effect of setting all lower levels to 0. For */ /* example, 3.4.5.1 followed by sn_inc(&sn,2) would become 3.5. */ /* Raises an error if the level is two or more lower than the current level */ /* Example: You can't increment 2.4.1 at level 5. */ /* Raises an error if the specified level is out of range. */ /* Raises an error if a number at any level becomes too large (>60000). */ EXPORT ubyte sn_lev P_((p_sn_t)); /* Returns the level number of the specified section. */ EXPORT void sn_str P_((p_sn_t,char *)); /* Writes a textual representation of the specified section into the given */ /* string. The string must be able to hold at least SECSTRMAX characters. */ /******************************************************************************/ /* For #ifndef preventing multiple inclusion of the body of this header file. */ #endif /******************************************************************************/ /* End of SECTION.H */ /******************************************************************************/ Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of thfw_src/source/style.h 644 0 0 32771 6717367612 10152 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. 15-May-1999 RNW Modified definition of ulong to cater for IRIX. ##############################################################################*/ /******************************************************************************/ /* STYLE.H */ /******************************************************************************/ /* */ /* WARNING: DO NOT ADD ANY MACHINE OR PROGRAM DEPENDENT DEFINITIONS. */ /* */ /* This style.h file contains program-independent, machine-independent */ /* definitions that assist C programming in general. Nothing in this file */ /* should require modification if this file is moved to a new machine or used */ /* in a new computer program. However, it may use abstracted second-order */ /* definitions from the machine-dependent, program independent module */ /* "environ". */ /* */ /******************************************************************************/ /* Ensure that the body of this header file is included at most once. */ #ifndef DONE_STYLE #define DONE_STYLE /******************************************************************************/ /* System File Inclusions */ /* ---------------------- */ /* In order to support a readable programming style, symbols such as TRUE and */ /* NULL are essential. However, environments differ as to whether and where */ /* these symbols are defined. This can lead to multiple definition errors */ /* where (say) this style.h file is included in a .C file before . */ /* I did a quick survey of all the .C FunnelWeb modules and found the */ /* following: */ /* */ /* Total files = 54 */ /* Number .C files = 22 */ /* Number .H files = 32 */ /* Used = 19 */ /* Used = 16 */ /* Used = 12 */ /* Used = 6 */ /* Used = 4 */ /* Used = 2 */ /* Used = 1 */ /* */ /* Most of these inclusions were in the .C files. */ /* It therefore seemed sensible to include some very commonly used system */ /* header files here and header files that cause problems if not included */ /* before style.h (). */ #include #include #include #include /******************************************************************************/ /* Although this file is machine independent, it still needs some generic */ /* definitions whose values vary from machine to machine (see above). */ #include "environ.h" /******************************************************************************/ /* The following types provide a clear and consistent collection of names for */ /* C's arithmetic types. Each name describes only the portable range that the */ /* underlying type supports. As in C, there are no guarantees about the */ /* MAXIMUM size of each underlying type and these types can provide no */ /* guarantees either. In the normal case, they translate to the most speed */ /* efficient type that will support the specified range. However, to support */ /* the situations where space efficiency is required, types ending in */ /* underscores have been defined that strive to conserve memory. */ /* Note: The signedness of a type does not change when an _ is added. */ /* */ /* The following terminology may be a touch vaxcentric, but it works for me. */ /* A BYTE is an 8 bit quantity. */ /* A WORD is a 16 bit quantity. */ /* A LONG is a 32 bit quantity. */ typedef unsigned ubyte ; /* Unsigned, [0,255]. */ typedef unsigned char ubyte_ ; /* Unsigned, [0,255]. Space first. */ typedef int word ; /* Signed , [-32767,+32767]. */ typedef short word_ ; /* Signed , [-32767,+32767]. Space first. */ typedef unsigned uword ; /* Unsigned, [0,65535]. */ typedef unsigned short uword_ ; /* Unsigned, [0,+65535]. Space first. */ /* Some (but not all) IRIX header files already typedef ulong so we have to */ /* create a form of definition for this symbol that won't collide. */ #if OS_IRX || OS_L86 || OS_AIX #define ulong unsigned long #else typedef unsigned long ulong ; /* Unsigned, [0,(2^32)-1]. */ #endif #if OS_OSF typedef unsigned ulong_ ; /* Unsigned, [0,(2^32)-1]. Space first. */ #else typedef unsigned long ulong_ ; /* Unsigned, [0,(2^32)-1]. Space first. */ #endif typedef unsigned bool ; /* Unsigned, [0,1]. */ typedef unsigned char bool_ ; /* Unsigned, [0,1]. Space first. */ typedef int sign ; /* Signed , [-1,0,1]. */ /******************************************************************************/ /* C overloads the attribute keyword "static" horribly giving it meaning on */ /* both the scoping and lifetime dimensions. This section gives definitions */ /* that clarify its use. If these macros are used, there should be no need */ /* for the keyword "static" in programs using this style file. */ /* The following macros assist in making the scope of functions clearer. In */ /* deciding on the names of these macros, I chose from the following lists: */ /* file scope: PRIVATE, LOCAL, HIDDEN. */ /* program scope: EXPORT, PUBLIC, GLOBAL. */ /* In the end I chose LOCAL and EXPORT. Note: I didn't want to allow more */ /* than one form as that would have created too much confusion. */ #define LOCAL static #define EXPORT /* It is desirable to use separate keywords for variables. This makes it */ /* easier to search for them without stopping at every function. There are */ /* four classes of variable that we wish to tag, along the two dimensions */ /* scope:(local,global) and lifetime:(permanent,temporary). In C, all */ /* variables declared outside of functions have permanent lifetime and so */ /* the following two names (which should be used only to tag variables not */ /* declared within a function) have been designed to emphasise the scope */ /* dimension which is the principal concern for these variables. */ #define LOCVAR static #define GLOVAR /* Variables local to functions always have local scope and so the dimension */ /* to emphasise is the lifetime. Automatic variables are the most common in */ /* C and it would be messy to declare them all using a keyword. Far better */ /* just to tag static local variables, emphasising their lifetime (STAtic). */ #define STAVAR static /******************************************************************************/ /* The following definitions are useful for dealing with void. */ /* The typedefed definition "p_void" should always be used instead of */ /* "void *" so as to improve portability. */ /* The definition of "void" and "p_void" come from environ.h */ typedef p_void *p_p_void; #define PV (p_void) #define PPV (p_p_void) /******************************************************************************/ /* The following symbols are more mnemonic than character escape sequences. */ #define EOS '\0' #define EOL '\n' /******************************************************************************/ /* The ANSI library functions use many different techniques for returning */ /* status information. For example, fopen returns NULL upon failure, but */ /* fclose returns EOF upon failure. The result is that it is hard to */ /* proofread calls to these routines without constantly referring to the */ /* library manual. To avoid this problem, we define symbols with helpful */ /* names for the different values returned. This makes the code obvious. */ /* 07-Feb-1992: During porting I ran into a problem here with FPUTS_S. I had */ /* defined it to be zero, as stated in the THINK C V4 ANSI library guide. */ /* However, it turned out that fputs() returns EOF (-1) on failure and the */ /* value that it returns on success is non negative! (See ANSI (7.9.7.4)). */ /* Caught by an overspecification by the THINK C people! The lesson is that */ /* it is very important to make sure that each function's status check symbol */ /* is defined on the "right" side (success or failure) - that is, the side */ /* for which a single value for that status is guaranteed portably. */ /* The following values have all been checked for this. */ /* Note: _F=Failure, _S=Success, _FE=Failure or End of File. */ #define FOPEN_F (NULL) #define FSEEK_S (0) #define FTELL_F (-1L) #define FGETC_FE (EOF) #define FGETS_FE (NULL) #define FPUTC_F (EOF) #define FPUTS_F (EOF) #define FFLUSH_S (0) #define FCLOSE_F (EOF) #define REMOVE_S (0) #define RENAME_S (0) #define MALLOC_F (NULL) /******************************************************************************/ /* The following macro functions are handy. However, be sure not to hand them */ /* an argument with a non-idempotent side effect!!! (e.g. MAX(a++,b)). */ #define MIN(A,B) ((A)<(B) ? (A) : (B)) #define MAX(A,B) ((A)>(B) ? (A) : (B)) /******************************************************************************/ /* Some environments don't define some stuff we need so we do it here. */ /* Cautiously! */ #ifndef FALSE #define FALSE (0) #endif #ifndef TRUE #define TRUE (1) #endif #ifndef EXIT_FAILURE #define EXIT_FAILURE (-1) #endif #ifndef EXIT_SUCCESS #define EXIT_SUCCESS (0) #endif /******************************************************************************/ /* The standard library macro/function "isprint" can be too loose in some */ /* circumstances on some machines and it is convenient to define a macro */ /* that provides a more strict 7-bit ASCII definition of "printable". */ #define isascprn(ch) ((' '<=ch) && (ch<='~')) /******************************************************************************/ /* Some compilers (GCC at least) complain about characters as a type in a */ /* function argument. The following typedef is a quick hack that lets me say */ /* that I really wanted the function argument to be a character, while */ /* actually supplying an integer. */ typedef int intchar; typedef char * string; /******************************************************************************/ /* For #ifndef preventing multiple inclusion of the body of this header file. */ #endif /******************************************************************************/ /* End of STYLE.H */ /******************************************************************************/ * Nufw_src/source/table.c 644 0 0 37003 6716661066 10064 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* TABLE.C */ /******************************************************************************/ /* */ /* Notes */ /* ----- */ /* - There are few comments at the start of each function. As definitions */ /* appear in the .H file, and it is dangerous to duplicate definitions, I */ /* have simply omitted them here. */ /* */ /* About The Cache */ /* --------------- */ /* A typical usage sequence for tables is for the user to first call tb_itb */ /* to see if a key is in the table and then call either tb_loo or tb_ins */ /* to lookup the value or to add a new (key,value) pair to the table. */ /* In order to avoid performing TWO searches down the binary tree in such */ /* cases, a CACHE is maintained in the table data structure between calls. */ /* */ /* ca_valid stores whether the cache contents are valid. If TRUE then: */ /* ca_p_key points to a key. */ /* ca_p_node points to the node in the tree containing the key, or contains */ /* NULL if no such node exists. */ /* ca_p_parent points to the node in the tree that is the parent of the node */ /* ca_p_node in the tree, or (if ca_p_node==NULL) WOULD BE the parent if a */ /* node containing the key were inserted in the tree. If the tree is */ /* currently empty, ca_p_parent will be NULL. */ /* */ /******************************************************************************/ #include "style.h" #include "as.h" #include "machin.h" #include "memory.h" /******************************************************************************/ /* In order to catch uninitialized and corrupted tables, the first and last */ /* fields of legitimate table objects contain magic numbers. The following */ /* #defines give the values of these numbers. The first thing that each */ /* function of this package does is to check the two magic number fields of */ /* the table it has just been passed, and bomb the package if the fields have */ /* the wrong values. This technique is likely to pick uninitialized tables, */ /* as well as tables that have been partially overwritten. */ #define MAGIC_HEAD_VALUE (53456839L) #define MAGIC_TAIL_VALUE (28434290L) /* Comparing keys is messy and so we define a macro to help us out. */ #define key_compare(a,b) ((*(p_tb->p_kycm))((a),(b))) /******************************************************************************/ /* The functions of the table abstraction pass keys and values exclusively */ /* using pointers. These two definitions define types for these pointers. */ /* Although the two types are both 'p_void', the different types are useful */ /* to indicate what is expected in each position of the parameter lists. */ typedef p_void p_tbky_t; typedef p_void p_tbvl_t; /* Define a type for a function to compare two keys. Such functions are */ /* needed to organize the storage of (key,value) pairs inside the table. */ /* Given the arguments are (a,b), the function should return: */ /* -1 if ab */ /* The user must create such a function and hand it to the 'tb_create' */ /* function when creating new a new table. */ typedef sign (*p_kycm_t) P_((p_tbky_t,p_tbky_t)); /* The (key,value) pairs in the table are stored in a binary tree. The tree */ /* is ordered by the key ordering function passed in at table creation. */ typedef struct node_t_ { struct node_t_ *p_left; struct node_t_ *p_right; struct node_t_ *p_parent; p_tbky_t p_key; p_tbvl_t p_value; } node_t; typedef node_t *p_node_t; /* The type tb_t (table type) defines the root table data record. This */ /* record stores attributes of the table along with the main binary tree of */ /* (key,value) pairs. */ typedef struct { ulong magic_head; /* Magic number to allow corruption checks. */ size_t key_bytes; /* Number of bytes in a key. */ size_t value_bytes; /* Number of bytes in a value. */ p_kycm_t p_kycm; /* Pointer to function to compare keys. */ p_node_t tree; /* Ptr to root of (key,value) binary tree. */ ulong num_keys; /* Number of (k,v) pairs in the table. */ bool ca_valid; /* Cache: TRUE iff cache contents are valid. */ p_tbky_t ca_p_key; /* Cache: Key value cache contents refer to. */ p_node_t ca_p_node; /* Cache: Pointer to node in binary tree. */ p_node_t ca_p_parent; /* Cache: Pointer to parent of ca_p_node. */ p_node_t p_read_next; /* Pointer to next node to be read. */ ulong magic_tail; /* Magic number to allow corruption checks. */ } tb_t; typedef tb_t *p_tb_t; /* Pointer to main table record. */ /* Defining INTABLEC hides the abstract definition. */ #define INTABLEC #include "table.h" /******************************************************************************/ /* PRIVATE FUNCTIONS */ /******************************************************************************/ LOCAL p_node_t new_node P_((p_tb_t,p_tbky_t,p_tbvl_t)); LOCAL p_node_t new_node(p_tb,p_tbky,p_tbvl) /* Creates a new tree node and returns a pointer to it. */ /* p_tb is the table for which the new node is to be created. */ /* p_tbky and p_tbvl point to the key and value to go in the new node. */ /* Assumes that a tb_check(p_tb) has already been performed by the caller. */ p_tb_t p_tb; p_tbky_t p_tbky; p_tbvl_t p_tbvl; { p_node_t p_node; p_node=(p_node_t) mm_temp(sizeof(node_t)); p_node->p_left = NULL; p_node->p_right = NULL; p_node->p_parent = NULL; p_node->p_key = mm_temp(p_tb->key_bytes ); p_node->p_value = mm_temp(p_tb->value_bytes); memcpy(p_node->p_key ,p_tbky,p_tb->key_bytes ); memcpy(p_node->p_value,p_tbvl,p_tb->value_bytes); return p_node; } /******************************************************************************/ LOCAL void tb_check P_((p_tb_t)); LOCAL void tb_check(p_tb) /* Accepts a pointer to a table and performs a series of checks to make sure */ /* that the table has not been corrupted in some way. */ p_tb_t p_tb; { as_cold(p_tb!=NULL,"tb_check: Table pointer is NULL."); as_cold(p_tb->magic_head==MAGIC_HEAD_VALUE, "tb_check: Magic number at head of record is incorrect."); as_cold(p_tb->magic_tail==MAGIC_TAIL_VALUE, "tb_check: Magic number at tail of record is incorrect."); } /******************************************************************************/ LOCAL p_node_t min_leaf P_((p_node_t)); LOCAL p_node_t min_leaf(p_node) /* Returns a pointer to the node that is leftmost (has the smallest value */ /* according to the ordering function) in the specified node's subtree. */ p_node_t p_node; { if (p_node==NULL) return NULL; while (p_node->p_left != NULL) p_node=p_node->p_left; return p_node; } /******************************************************************************/ LOCAL p_node_t next_node P_((p_node_t)); LOCAL p_node_t next_node(p_node) /* Give a pointer to a node in the binary tree, returns a pointer to the next */ /* node (in sequence defined by the order function) or NULL if the given node */ /* is the last node in the ordered sequence. */ p_node_t p_node; { /* If there is a right subtree, we need the minimum node of that subtree. */ if (p_node->p_right != NULL) return min_leaf(p_node->p_right); /* Otherwise go up as far as possible through right arcs. */ while (p_node->p_parent!=NULL && p_node->p_parent->p_right==p_node) p_node=p_node->p_parent; return p_node->p_parent; } /******************************************************************************/ LOCAL void tb_search P_((p_tb_t,p_tbky_t)); LOCAL void tb_search(p_tb,p_tbky) /* Calling this function with a particular key value results in the cache */ /* becoming valid and containing the specified key. */ p_tb_t p_tb; p_tbky_t p_tbky; { p_node_t p,p_parent; tb_check(p_tb); /* Return if the cache is already up to date. */ if (p_tb->ca_valid) if (key_compare(p_tbky,p_tb->ca_p_key) == 0) return; p_parent=NULL; p=p_tb->tree; while (p != NULL) switch(key_compare(p_tbky,p->p_key)) { case -1: p_parent=p; p=p->p_left; break; case 1: p_parent=p; p=p->p_right; break; case 0: goto found; default: as_bomb("tb_search: Key comparison function returned bad value."); } found: p_tb->ca_valid = TRUE; memcpy(p_tb->ca_p_key,p_tbky,p_tb->key_bytes); p_tb->ca_p_node = p; p_tb->ca_p_parent = p_parent; } /******************************************************************************/ LOCAL void des_tree P_((p_node_t)); LOCAL void des_tree(p_root) p_node_t p_root; { if (p_root==NULL) return; des_tree(p_root->p_left); des_tree(p_root->p_right); /* This is what we would need if it wasn't for the MM watermark system. */ /* DEALLOCATE(PV p_root); */ } /******************************************************************************/ /* EXPORTED FUNCTIONS */ /******************************************************************************/ EXPORT p_tb_t tb_cre(key_bytes,value_bytes,p_kycm) size_t key_bytes; size_t value_bytes; p_kycm_t p_kycm; { p_tb_t p_tb; p_tb = (p_tb_t) mm_temp(sizeof(tb_t)); p_tb->magic_head = MAGIC_HEAD_VALUE; p_tb->key_bytes = key_bytes; p_tb->value_bytes = value_bytes; p_tb->p_kycm = p_kycm; p_tb->tree = NULL; p_tb->num_keys = 0; p_tb->ca_valid = FALSE; p_tb->ca_p_key = (p_tbky_t) mm_temp(key_bytes); p_tb->ca_p_node = NULL; /* This initialization not strictly necessary. */ p_tb->ca_p_parent = NULL; /* This initialization not strictly necessary. */ p_tb->p_read_next = NULL; p_tb->magic_tail = MAGIC_TAIL_VALUE; return p_tb; } /******************************************************************************/ EXPORT bool tb_itb(p_tb,p_tbky) p_tb_t p_tb; p_tbky_t p_tbky; { tb_check(p_tb); tb_search(p_tb,p_tbky); return p_tb->ca_p_node != NULL; } /******************************************************************************/ EXPORT void tb_loo(p_tb,p_tbky,p_tbvl) p_tb_t p_tb; p_tbky_t p_tbky; p_tbvl_t p_tbvl; { tb_check(p_tb); tb_search(p_tb,p_tbky); as_cold(p_tb->ca_p_node!=NULL,"tb_loo: Requested key is absent."); memcpy(p_tbvl,p_tb->ca_p_node->p_value,p_tb->value_bytes); } /******************************************************************************/ EXPORT void tb_ins(p_tb,p_tbky,p_tbvl) p_tb_t p_tb; p_tbky_t p_tbky; p_tbvl_t p_tbvl; { p_node_t p_new; tb_check(p_tb); /* Validate the cache. Note: tb_search does it's own cache check. */ tb_search(p_tb,p_tbky); /* Ensure that the table does not already contain the key. */ as_cold(p_tb->ca_p_node==NULL,"tb_ins: Key is already present in the p_tb."); /* Create the new node. */ p_new=new_node(p_tb,p_tbky,p_tbvl); /* Insert the new node into the tree. */ if (p_tb->ca_p_parent==NULL) p_tb->tree=p_new; else switch(key_compare(p_tbky,p_tb->ca_p_parent->p_key)) { case -1: p_tb->ca_p_parent->p_left =p_new; break; case 1: p_tb->ca_p_parent->p_right=p_new; break; default: as_bomb("tb_ins: Key comparison function is inconsistent."); } p_new->p_parent=p_tb->ca_p_parent; /* Need to fiddle cache to make it correct, and inc num_keys. */ p_tb->ca_p_node=p_new; p_tb->num_keys++; } /******************************************************************************/ EXPORT ulong tb_len(p_tb) p_tb_t p_tb; { tb_check(p_tb); return p_tb->num_keys; } /******************************************************************************/ EXPORT void tb_fir(p_tb) p_tb_t p_tb; { tb_check(p_tb); p_tb->p_read_next=min_leaf(p_tb->tree); } /******************************************************************************/ EXPORT bool tb_rea(p_tb,p_tbky,p_tbvl) p_tb_t p_tb; p_tbky_t p_tbky; p_tbvl_t p_tbvl; { tb_check(p_tb); if (p_tb->p_read_next == NULL) return FALSE; memcpy(p_tbky,p_tb->p_read_next->p_key ,p_tb->key_bytes ); memcpy(p_tbvl,p_tb->p_read_next->p_value,p_tb->value_bytes); p_tb->p_read_next=next_node(p_tb->p_read_next); return TRUE; } /******************************************************************************/ #if FALSE EXPORT void tb_des(p_tb) p_tb_t p_tb; { /* This routine now unused because of the watermark system. */ return; /* tb_check(p_tb); */ /* Zap the magic numbers in case the memory is re-used in same alignment. */ /* p_tb->magic_head=0; */ /* p_tb->magic_tail=0; */ /* This is what we would need if it wasn't for the MM watermark system. */ /* des_tree(p_tb->tree); */ /* Zap the binary tree. */ /* DEALLOCATE(PV p_tb); */ /* Zap the node itself. */ } #endif /******************************************************************************/ /* TABLE.C */ /******************************************************************************/ */ typedef sign (*p_kycm_t) P_((p_tbky_t,p_tbky_t)); /* The (key,value) pairs in the table are stored in a binary tree. The tree */ /* is ordered by the key ordering function passed in at table creation. */ typedef struct node_t_ { struct node_t_ *p_left; struct node_t_ *p_right; struct node_t_ *p_parent; p_tbky_t p_key; p_tbvl_t p_value; } node_t; typedef node_t *p_node_t; /* The type tb_t (table type) defines the root tablefw_src/source/table.h 644 0 0 24774 6716661067 10105 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* TABLE.H */ /******************************************************************************/ /* */ /* Introduction */ /* ------------ */ /* This table package (table.h and table.c) implements a table abstraction. */ /* */ /* Facts about Tables */ /* ------------------ */ /* - A TABLE stores zero or more (KEY,VALUE) PAIRS. */ /* - The user decides the types of keys and values and provides a */ /* COMPARISON FUNCTION providing a complete ordering of the set of keys. */ /* - The comparison function must be consistent between calls. */ /* - Tables store pairs in key order. */ /* - A table cannot store more than one pair with the same key. */ /* - Pairs can be added, but not deleted. */ /* - A table can return the value corresponding to a given key. */ /* - The pairs in a table can be read sequentially in key order. At all */ /* times, the table has an imaginary MARKER positioned on one of its pairs */ /* (or after the last pair). You can move the marker to the first pair and */ /* you can move the marker to the next pair, reading the pair as you go. */ /* Upon table creation, a table's marker is at the end-of-table position. */ /* - If you try to perform an illegal operation on a table, the table package */ /* will call "error" to write out an error message and bomb the program. */ /* - Tables store copies of (key,value) pairs. They do not hold pointers to */ /* outside data (unless your keys or values are pointers themselves). */ /* - If the keys are pointers themselves and point to other data which is */ /* used by the comparison function, then that data must not be modified */ /* in a way that will change the order of pairs in the table. */ /* - A table can hold from zero to about 2^31 pairs. */ /* - The identifier "tb" is used as an abbreviation for "table". */ /* - The identifier "ky" is used as an abbreviation for "key". */ /* - The identifier "vl" is used as an abbreviation for "value". */ /* - The author would like to use longer names, but has chosen to use the */ /* abbreviations so as to enhance the portability of the code. */ /* - IMPORTANT: Tables get all their memory using mm_temp calls. */ /* */ /* How To Use This Table Package */ /* ----------------------------- */ /* 1. Include this .H file in your program file. */ /* 2. Identify the key and value types that you are going to use. */ /* 3. Define a function (having two parameters being pointers to keys) */ /* that compares two keys and returns [-1,0,1] accordingly. */ /* 4. Define a variable of type p_tb as a view to a table. */ /* 5. Use the tb_* functions to perform the desired operations. */ /* Start with a call to tb_cre and (optionally) end with a call to tb_des. */ /* */ /******************************************************************************/ /* Ensure that the body of this header file is included at most once. */ #ifndef DONE_TABLE #define DONE_TABLE /******************************************************************************/ #include #include "style.h" /******************************************************************************/ /* Hide the exported abstract definition of a table from the table.c package. */ /* Table.c defines INTABLEC so as to prevent itself from seeing the following */ /* definitions. It defines its own more concrete definitions. */ #ifndef INTABLEC /* The functions of the table abstraction pass keys and values exclusively */ /* using pointers. These two definitions define types for these pointers. */ /* Although the two types are both 'p_void', the different types are useful */ /* to indicate what is expected in each position of the parameter lists. */ typedef p_void p_tbky_t; typedef p_void p_tbvl_t; /* Define a type for a function to compare two keys. Such functions are */ /* needed to organize the storage of (key,value) pairs inside the table. */ /* Given the arguments are (a,b), the function should return: */ /* -1 if ab */ /* The user must create such a function and hand it to the 'tb_create' */ /* function when creating new a new table. */ typedef sign (*p_kycm_t) P_((p_tbky_t,p_tbky_t)); /* Users manipulate tables through pointers to tables. Here the actual table */ /* internals are hidden from the user. */ typedef struct {word NEVER_USE_THIS_FIELD_UQJTKC;} tb_t; typedef tb_t *p_tb_t; #endif /******************************************************************************/ /* General Notes About These Functions */ /* ----------------------------------- */ /* - All tables, keys, and values are passed by pointer. Whether a parameter */ /* is read or written is determined by it's functions description. */ /* - Each function (except tb_cre) accepts a single pointer to a table and */ /* each function's description is assumed to be referring to the table. */ /* - "Raising an error" means calling the external function "error" to */ /* write out a message and bomb the program. */ /* - You must create a table using tb_cre before performing any operations */ /* upon it. The table operations will usually raise an error if they are */ /* handed a pointer that does not point to a properly CREated table. */ /* The Functions */ /* ------------- */ EXPORT p_tb_t tb_cre P_((size_t,size_t,p_kycm_t)); /* CREate. This function creates a new table and returns a pointer to the */ /* table. The user must supply 1) the size in bytes of keys, 2) the size in */ /* bytes of values, 3) a pointer to a function that compares two keys. */ EXPORT bool tb_itb P_((p_tb_t,p_tbky_t)); /* InTaBle. Returns TRUE iff the given key is in the table. */ EXPORT void tb_loo P_((p_tb_t,p_tbky_t,p_tbvl_t)); /* LOOkup. Feed this function a table and a key and it will return (in the */ /* p_tbvl_t parameter) the value corresponding to the key. The function */ /* raises an error if the table does not contain the key. */ EXPORT void tb_ins P_((p_tb_t,p_tbky_t,p_tbvl_t)); /* INSert. Inserts the (key,value) pair into the table. Raises an error if */ /* the key is already in the table. */ EXPORT ulong tb_len P_((p_tb_t)); /* LENgth. Returns the number of pairs in the table. */ EXPORT void tb_fir P_((p_tb_t)); /* FIRst. Set's the table's marker to the first pair in the table (or the end */ /* of table position if the table is empty. */ EXPORT bool tb_rea P_((p_tb_t,p_tbky_t,p_tbvl_t)); /* REAd. Returns in (p_tbky_t,p_tbvl_t) the (key,value) pair corresponding to */ /* the marker and them moves the marker onto the next pair. */ /* Returns TRUE => Returned a pair. */ /* Returns FALSE => Did not return a pair. No more pairs left. */ /* of key) to be read from the table. Returns TRUE if it returns a pair */ /* This function will not raise an error if it is called more than once with */ /* the marker at the end of the table (it just keeps returning FALSE). */ #if FALSE void tb_des P_((p_tb_t)); /* DEStroy. Destroys a table, deallocating all its memory. */ #endif /******************************************************************************/ /* For #ifndef preventing multiple inclusion of the body of this header file. */ #endif /******************************************************************************/ /* End of TABLE.H */ /******************************************************************************/ ram fw_src/source/tangle.c 644 0 0 44562 6716661070 10252 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. 09-May-1999 RNW Modified to expand lowest defined library level defn. ##############################################################################*/ /******************************************************************************/ /* TANGLE.C */ /******************************************************************************/ /* Note: In this module, "ex_" at the start of a function name means "expand" */ /* rather than the standard meaning of "ex" of "expression. */ /******************************************************************************/ #include "style.h" #include "as.h" #include "data.h" #include "lister.h" #include "memory.h" #include "misc.h" #include "table.h" #include "tangle.h" #include "writfile.h" /******************************************************************************/ /* The following variable keeps track of the output line number. This is */ /* needed to report lines that are too long. */ LOCVAR ulong lineno; /* Last line for which error message was generated. */ LOCVAR ulong errlin; /* Number of too-long lines seen so far in this file. */ LOCVAR ulong numlong; /* Number of long line error messages we can tolerate per product file. */ #define LONGMESS 5 /* Note: An indentation of n means n blanks before current material. */ /* tgindent is a global variable set by the scanner. It is TRUE if blank */ /* indenting is required and FALSE if no indenting is required. */ LOCVAR ulong ind_base; /* Base indenting level of macro being expanded. */ LOCVAR ulong ind_curr; /* Current indenting position. */ LOCVAR char *fn_targ; /* Name of current (target) product file. */ LOCVAR wf_t f_o; /* Current product file. */ /******************************************************************************/ /* The expression expansion function has to have a forward declaration. */ LOCAL void ex_ex P_((p_ells_t)); /******************************************************************************/ LOCAL void eolblank P_((ulong)); LOCAL void eolblank(n) /* Writes an EOL followed by n blanks to the product file. Efficiently! */ ulong n; { /* The whole aim of this routine is to write blanks EFFICIENTLY. In */ /* particular avoiding any per-char procedure call overhead (e.g. calls to */ /* wf_chr). The best way to avoid this is to create a static array of blanks */ /* and write out large blocks of blanks all at once. */ #define BLANKLEN 100 /* Number of BLANKS in blank array. */ STAVAR bool notinit=TRUE; /* Has blank array been initialized? */ STAVAR char blanks[1+BLANKLEN]; /* EOL followed by BLANKLEN blanks. */ /* Set up the blank array. This only ever done once because of the static */ /* boolean. Note that use of an initialized static here does not make the */ /* code non-reentrant, as the state does not change after initialization. */ if (notinit) {blanks[0]=EOL; memset(blanks+1,' ',(size_t) BLANKLEN); notinit=FALSE;} /* The most common case will be a small indentation. Do this case fast. */ if (n<=BLANKLEN) wf_blk(&f_o,&blanks[0],(size_t) n+1); else { /* We now know that n>=BLANKLEN. Write out a long line with \n at front. */ wf_blk(&f_o,&blanks[0],BLANKLEN+1); n-=BLANKLEN; /* Now get into large scale blank production! */ while (n>0) { ulong len=MIN(n,BLANKLEN); wf_blk(&f_o,&blanks[1],(size_t) len); n-=len; } } } /******************************************************************************/ #define SENDLINE {wl_l(linet1); if (option.op_s_b) wl_sj(linet1);} LOCAL void ex_sc P_((p_sc_t)); LOCAL void ex_sc(p_sc) /* This function writes the specified scrap to the product file. It also */ /* performs two other tasks: */ /* If tgindent==TRUE, inserts indentation at the start of each line. */ /* If tglinmax>0, checks for product file lines longer than tglinmax. */ /* Note: The speed of this routine is fairly critical. */ p_sc_t p_sc; { /* Output of a scrap is straightforward if we are not inserting indentation */ /* or watching for lines that are too long. If neither of these tasks have */ /* to be performed, we can bang the scrap out directly with a wf_blk. */ if (!tgindent && tglinmax==TGMAXINF) { wf_blk(&f_o, p_sc->sc_first, (size_t) (p_sc->sc_last-p_sc->sc_first+1)); return; } /* Otherwise it gets rather messy. Basically, we have to watch for end of */ /* lines and perform special actions there. */ /* ind_curr is the number of characters already written to the current line. */ { char *p = p_sc->sc_first; char *p_post = p_sc->sc_last+1; while (TRUE) { char *p_sot = p; /* SOT=Start of Text. */ /* Scan scrap until we hit either its end or an EOL. */ while (p!=p_post && *p!=EOL) p++; /* Assert: p==p_post || (p_sot<=pp_sot) {wf_blk(&f_o,p_sot,(size_t) (p-p_sot));ind_curr+=p-p_sot;} /* Check that what we have written so far is not too long. */ /* Performing this check here rather than with the EOL processing */ /* means that we will detect overlong final non-EOL terminated lines. */ /* Use of errlin suppresses multiple errors on the same line. */ /* Note: We assume that TGMAXINF is very large. */ if (ind_curr>tglinmax && lineno!=errlin) { numlong++; if (numlong <= LONGMESS) { if (option.op_b7_b) sprintf(linet1, "E: Product file line is too long (line %lu of \"%s\").", (ulong) lineno,SUPPNAME); else sprintf(linet1, "E: Product file line is too long (line %lu of \"%s\").", (ulong) lineno,fn_targ); SENDLINE; if (numlong==1) { sprintf(linet1," Product file line length limit is %lu characters.", (ulong) tglinmax); SENDLINE; sprintf(linet1," Note: You can change the limit by specifying."); SENDLINE; sprintf(linet1," @p maximum_output_line_length = "); SENDLINE; sprintf(linet1," somewhere in the input file."); SENDLINE; } errlin=lineno; num_err++; } if (numlong == LONGMESS+1) { sprintf(linet1, "Further line-too-long warnings for file \"%s\" have been suppressed.", fn_targ); SENDLINE; } } /* Exit if we hit the end of the scrap. */ if (p==p_post) break; /* Move past the EOL and bump up the line counter. */ p++; lineno++; /* Output an EOL with indentation if desired. */ if (tgindent) eolblank(ind_base); else wf_chr(&f_o,EOL); ind_curr=ind_base; } } } /******************************************************************************/ LOCAL void ex_eltx P_((p_el_t)); LOCAL void ex_eltx(p_el) /* Writes the given text element to the product file. */ p_el_t p_el; { p_sc_t p_sc; /* Make sure that we have actually been handed a text element. */ as_cold(p_el->el_kind==EL_TEXT,"ex_eltx: Not a text element!"); /* Write all the scraps in the text list to the product file. */ ls_fir(p_el->el_text); while (TRUE) { ls_nxt(p_el->el_text,PPV &p_sc); if (p_sc==NULL) break; ex_sc(p_sc); } } /******************************************************************************/ LOCAL void ex_elpr P_((p_el_t)); LOCAL void ex_elpr(p_el) /* Write the expansion of the given parameter element to the product file. */ p_el_t p_el; { p_ell3_t actn = p_el->el_which->ma_actn; p_elll_t *pp_parls; p_ells_t *pp_exp; ulong ind_save; /* Make sure that we have been handed a parameter element. */ as_cold(p_el->el_kind==EL_PARM,"ex_elpr: Not a parameter element!"); /* Save the current indentation base and set it to the current level. */ ind_save=ind_base; ind_base=ind_curr; /* Get a pointer to the most recent parameter list of the target macro. */ ls_loo(actn,ls_len(actn),PPV &pp_parls); /* Get the expression corresponding to the el_parno'th parameter. */ ls_loo(*pp_parls,p_el->el_parno,PPV &pp_exp); /* Expand that expression. */ ex_ex(*pp_exp); /* Restore the indentation base. */ ind_base=ind_save; } /******************************************************************************/ LOCAL void ex_elin P_((p_el_t)); LOCAL void ex_elin(p_el) /* Expand invocation element. */ p_el_t p_el; { p_ma_t p_ma; p_bp_t p_bp; ulong ind_save; p_void p_mark; p_md_t p_md; /* Make sure that we have been handed an invocation element. */ as_cold(p_el->el_kind==EL_INVC,"ex_elin: Not an invocation element!"); /* Save the current indentation base and set it to the current level. */ ind_save=ind_base; ind_base=ind_curr; /* Grab a pointer to the macro being invoked. */ p_ma = p_el->el_p_mac; as_cold(maisdef(p_ma),"ex_elin: Macro is undefined!"); p_md = &p_ma->ma_defn[p_ma->ma_minlev]; /* Push the actual parameter list onto the invoked macro's activation list. */ ls_add(p_ma->ma_actn,PV &p_el->el_parls); /* Expand each body part expression. */ ls_fir(p_md->md_body); while (TRUE) { ls_nxt(p_md->md_body,PPV &p_bp); if (p_bp==NULL) break; p_mark=ls_mar(p_md->md_body); /* Protect againt recursion. */ ex_ex(p_bp->bp_ex); ls_set(p_md->md_body,p_mark); } /* Pop the activated macro's parameter list. */ ls_lop(p_ma->ma_actn); /* Restore the indentation base. */ ind_base=ind_save; } /******************************************************************************/ LOCAL void ex_ex(p_exp) /* Expand the specified expression. */ p_ells_t p_exp; { p_void p_mark; /* We need to save the current position in the expression list in case we */ /* are being recursively invoked (e.g. in @@(@"@@(@"sloth@"@)@"@). */ ls_fir(p_exp); while (TRUE) { p_el_t p_el; ls_nxt(p_exp,PPV &p_el); if (p_el==NULL) break; p_mark=ls_mar(p_exp); switch (p_el->el_kind) { case EL_TEXT: ex_eltx(p_el); break; case EL_INVC: ex_elin(p_el); break; case EL_PARM: ex_elpr(p_el); break; default : as_bomb("ex_ex: Case defaulted."); } ls_set(p_exp,p_mark); } } /******************************************************************************/ LOCAL void ex_file P_((p_ma_t)); LOCAL void ex_file(p_ma) /* This function accepts a pointer to a macro. It creates a product file */ /* with the same name as the macro (inheriting any filename parts given in */ /* the command line) and expands the macro, writing the expansion to the */ /* product file. */ p_ma_t p_ma; { fn_t fn_tmp; /* Name of temporary file. */ bool renfil; /* Do we wish to rename product file? */ bool istarg; /* Does a target file already exist? */ /* Writing product files differs to the other output files. With non */ /* critical files such as the listing file that are really just logs, */ /* generation of half a listing file is acceptable if not desirable. However */ /* in the case of product files, it is very bad to generate half a product */ /* file; far better to generate none at all. For this reason, and also */ /* because of the presence of the D option (which prohibits the writing */ /* of product files identical to existing files (to prevent MAKE */ /* propagations)) it is best to write a temporary file and then rename it. */ /* Construct the target file name. */ strcpy(fn_targ,""); /* Start with an empty name. */ fn_ins(fn_targ,&option.op_o_s[0]); fn_ins(fn_targ,&p_ma->ma_name[0]); /* The temporary file has to inherit too, because the output directory may */ /* not be the default directory and some computers can't rename across */ /* directories (and we have to rename it later). */ strcpy(fn_tmp,fn_targ); fn_ins(fn_tmp,fn_temp()); /* Expand the macro to the temporary file. */ wf_ini(&f_o,TRUE); wf_ope(&f_o,fn_tmp); if (wf_err(&f_o)) { sprintf(linet1,"Error creating temporary product file \"%s\".",&fn_tmp[0]); wl_sjl(linet1); (void) remove(fn_tmp); goto severe; } /* Now expand the target macro into the file. */ { el_t el; el.el_kind = EL_INVC; el.el_p_mac = p_ma; el.el_parls = ls_cre(sizeof(p_ells_t)); /* Note: We don't set el_pretx and el_postx as they are not used here. */ ind_base = 0; ind_curr = 0; lineno = 1; errlin = 0; numlong = 0; ex_elin(&el); } /* Make sure that there weren't any errors writing to the product file. */ if (wf_err(&f_o)) { sprintf(linet1,"S: Error writing to temporary product file \"%s\".",&fn_tmp[0]); wl_sjl(linet1); (void) remove(fn_tmp); goto severe; } /* Close the product file. */ wf_clo(&f_o); if (wf_err(&f_o)) { sprintf(linet1,"S: Error closing temporary product file \"%s\".",&fn_tmp[0]); wl_sjl(linet1); (void) remove(fn_tmp); goto severe; } /* The rest of the code in this function copes with the renaming. */ /* By default, we wish to rename the temporary file. */ renfil=TRUE; /* Deal with any existing file of the target name. */ istarg=fexists(fn_targ); if (istarg && option.op_d_b) { /* A target already exists, and the D option is on. If the target is */ /* identical to the temporary, we can simply delete the temporary! */ char *errstr; bool same; errstr=eq_files(fn_tmp,fn_targ,&same); if (errstr != NULL) { wl_sjl("S: Error comparing temporary file with previous product file."); wl_sjl("(A comparison was attempted because the D option was turned on.)"); wl_sjl("Error from comparison routine was as follows (first=temp):"); wr_sjl(" ");wl_sjl(errstr); sprintf(linet1,"Temporary file name was \"%s\".",&fn_tmp[0]); wl_sjl(linet1); sprintf(linet1,"Product file name was \"%s\".",fn_targ); wl_sjl(linet1); wl_sjl("FunnelWeb will leave both files intact so you can look at them."); goto severe; } /* If the two files are the same, we can simply delete the temporary. */ if (same) { int status; status=remove(fn_tmp); if (status != REMOVE_S) { sprintf(linet1,"S: Error deleting (under +D option) temporary file \"%s\".",&fn_tmp[0]); wl_sjl(linet1); goto severe; } sprintf(linet1,"Deleted identical product file \"%s\".",fn_targ); wl_sjl(linet1); renfil=FALSE; } } if (renfil) { int status; /* We need to delete any existing file of the target name. */ if (istarg) { status=remove(fn_targ); if (status != REMOVE_S) { sprintf(linet1,"S: Error deleting existing product file \"%s\".",fn_targ); wl_sjl(linet1); goto severe; } } /* Rename the temporary file to the product file. */ status=rename(fn_tmp,fn_targ); if (status != RENAME_S) { wl_sjl("S: Error renaming temporary product file to product file."); sprintf(linet1,"Temporary file name was \"%s\".",&fn_tmp[0]); wl_sjl(linet1); sprintf(linet1,"Product file name was \"%s\".",fn_targ); wl_sjl(linet1); wl_sjl("FunnelWeb will leave both files intact so you can look at them."); goto severe; } } /* Tell everyone that we have written a product file. */ /* Note that we use the macro name. The full name is usually too messy. */ sprintf(linet1,"Tangle: Completed %s.",&p_ma->ma_name[0]); wl_sjl(linet1); return; /* Jump here is a nasty file error occurs. */ severe: sprintf(linet1,"A problem occurred during the generation of product file \"%s\".",&fn_targ[0]); wl_sjl(linet1); wl_sjl("S: Aborting..."); num_sev++; return; } /******************************************************************************/ EXPORT void tangle() { name_t dummyname; p_ma_t p_ma; /* Possibly decrease tglinmax if W option is turned on. */ if (option.op_w_b) tglinmax=MIN(tglinmax,option.op_w_i); /* Some compilers do not allow much space for statics so we allocate fn_targ */ /* dynamically to save static space. */ fn_targ=(char *) mm_temp(sizeof(fn_t)); /* Generate each file contained in the file table. */ tb_fir(file_table); while (num_sev==0 && tb_rea(file_table,PV dummyname,PV &p_ma)) ex_file(p_ma); } /******************************************************************************/ /* End of TANGLE.C */ /******************************************************************************/ th indentation if desired. */ if (tgindent) eolblank(ind_base); else wf_chr(&f_o,EOL); ind_curr=ind_base; }fw_src/source/tangle.h 644 0 0 4560 6716661072 10233 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* TANGLE.H */ /******************************************************************************/ /* */ /* This package exports a single function "tangle" that generates all the */ /* product files for FunnelWeb. */ /* */ /******************************************************************************/ #include "style.h" /******************************************************************************/ EXPORT void tangle P_((void)); /* Generate product files. */ /******************************************************************************/ /* End of TANGLE.H */ /******************************************************************************/ urrent position in the expression list in case we */ /* are being recursively invoked (e.g. in @@(@"@@(@"sloth@"@)@"@). */ ls_firfw_src/source/texhead.c 644 0 0 12247 6716661072 10417 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* TEXHEAD.C */ /******************************************************************************/ /* */ /* TEX HEADER PACKAGE */ /* ================== */ /* This package contains a single function that writes the TeX header */ /* (containing all the Weave macros) to the specified stream. The package */ /* consists of: */ /* */ /* texhead.tex - The header file ("source code" for texhead.ctx). */ /* texhead.ctx - Automatically generated C code based on texhead.tex. */ /* texhead.h - Exported header file containing function definition. */ /* texhead.c - Contains the function body and the codified header file. */ /* */ /* WARNING: THE ONLY FILE THAT SHOULD EVER BE MODIFIED BY HAND IS TEXHEAD.TEX.*/ /* From this can be generated a new version of texhead.ctx. Here's how: */ /* 1. Edit texhead.tex as desired. */ /* 2. Fire up the FunnelWeb shell and give the command: */ /* codify texhead.tex texhead.ctx */ /* */ /******************************************************************************/ #include "style.h" #include "texhead.h" #include "writfile.h" /******************************************************************************/ EXPORT void tex_head(p_wf) p_wf_t p_wf; /* Writes the FunnelWeb TeX header block to the argument stream. */ { /*############################################################################# IMPORTANT COPYRIGHT NOTICE -------------------------- The set of FunnelWeb TeX definitions, embodied in C code in the file included by the #include directive below, is a public domain work. Notwithstanding the fact that the public domain set of FunnelWeb TeX definitions is represented in the form of strings in C code #included by the FunnelWeb literate-programming preprocessor program released under GNU General Public License Version 2, the set of TeX definitions themselves do not fall under GNU license. Instead, the set of FunnelWeb TeX definitions is classified as a public domain work that is distributed with FunnelWeb as a "separate work". The set of definitions is included as strings in the FunnelWeb code for the sole reason that this organization avoids FunnelWeb having to locate the file at run time. Thus, when FunnelWeb writes the set of TeX definitions to a .TeX output file, it is not generating a work based on itself, but is merely copying a public domain file (which it happened to represent in the form of code rather than data) into the output file. The motivation for rigorously clarifying the status of the set of FunnelWeb TeX definitions is that it will appear in TeX output files generated by FunnelWeb, and I do not want any output files generated by FunnelWeb to be under any copyright restrictions. -- Ross N. Williams, 5:42pm 07-May-1992, Adelaide, Australia. #############################################################################*/ #define WX(STR) wf_wl(p_wf,STR) #include "texhead.ctx" } /******************************************************************************/ /* End of TEXHEAD.C */ /******************************************************************************/ name. The full name is usually too messy. */ sprintf(linet1,"Tangle: Completed %s.",&p_ma->ma_name[0]); wl_sjl(linet1); return; /* Jump here is a nasty file error occurs. */ severe: sprintf(linet1,"A problem occurred during the generation of product file \"%s\".",&fn_targ[0]); wl_sjl(linet1); wl_sjl("S: Aborting..."); num_sev++; refw_src/source/texhead.ctx 644 0 0 37207 6715672655 11006 WX("%===================== Start of FunnelWeb TeX Definitions ======================"); WX(""); WX(""); WX("% Version"); WX("% -------"); WX("% This is FunnelWeb TeX Macro Library Version 1.0."); WX(""); WX(""); WX("% Copyright"); WX("% ---------"); WX("% This set of FunnelWeb TeX definitions was written by Ross Williams and was"); WX("% originally Copyright (C) 1992 Ross N. Williams. However, I, Ross Williams,"); WX("% hereby forego any claim to Copyright in this set of FunnelWeb TeX definitions"); WX("% and hereby authorize that the set of TeX definitions pass into the public"); WX("% domain. -- Ross N. Williams, 3:41pm 07-May-1992, Adelaide, Australia."); WX(""); WX(""); WX("% Modification"); WX("% ------------"); WX("% Please record all modifications to these TeX definitions here. Unless"); WX("% otherwise specified, all modified definitions fall in the public domain too."); WX("%"); WX("% Programmers:"); WX("% RNW Ross N. Williams ross@ross.net"); WX("%"); WX("% Changes:"); WX("% 07-May-1992 RNW Prepared this work for public domain release."); WX("% 10-May-1999 RNW Added \\fwlib macro."); WX(""); WX(""); WX("% General Comments"); WX("% ----------------"); WX("% This set of TeX definitions exists for two reasons:"); WX("%"); WX("% 1. To shorten and neaten the FunnelWeb TeX output."); WX("% 2. To allow users to fiddle with the output format in their input files"); WX("% (by inserting redefining \"\\def\"s) without having to resort to"); WX("% modifying the FunnelWeb code."); WX("%"); WX("% The user is warned that these definitions may be changed from time to time"); WX("% (but probably not much). The user should not be too sneaky. In particular,"); WX("% users wishing to redefine some of these macros should do so in an explicitly"); WX("% defined section at the top of their input file. This will mean that in the"); WX("% event of problems, that section can simply be deleted or commented out to"); WX("% allow the document to at least be typeset in the default format. Users should"); WX("% limit themselves to redefining these macros in such a section and should"); WX("% refrain from using the macros throughout their documents."); WX(""); WX(""); WX("% Environment Parameters"); WX("% ----------------------"); WX("% \\tolerance tells TeX how tolerant it should be about making bad line and"); WX("% page breaks. Here we set it to it's maximum, as"); WX("% 1) Computer programs are likely to cause lots of bad breaks."); WX("% 2) In most cases the user would probably rather get the TeX file through"); WX("% TeX without any errors than fiddle with spacings for perfection."); WX("\\tolerance=10000"); WX(""); WX("% I don't like indentation as it makes the page look more busy. Instead,"); WX("% paragraphs are separated by a little space (see next)."); WX("\\parindent=0pt"); WX(""); WX("% In many cases, users will produce documents with long runs of paragraphs."); WX("% In order to space out these paragraphs, it is convenient to maintain a"); WX("% prevailing non-zero \\parskip (end-of-paragaph skip). The only trouble is"); WX("% that the skip becomes a problem in macro definitions which require no skip"); WX("% and so we have to turn the skip on and off. The following two macros"); WX("% simplify this process."); WX("\\def\\fwparskipon{\\parskip=\\medskipamount}"); WX("\\def\\fwparskipoff{\\parskip=0pt}"); WX("\\fwparskipon"); WX(""); WX("% Setting raggedbottom allows TeX to leave a bit of space at the bottom of the"); WX("% page in order to better vertically align the rest of the page (e.g. skips"); WX("% won't stretch as much). It also means that headings are less likely to be"); WX("% isolated at the bottom of the page without any following text."); WX("\\raggedbottom"); WX(""); WX(""); WX("% Fonts"); WX("% -----"); WX("% Most of the typeset output is set in 10pt roman and 10pt tt font."); WX("% The major extra font needs spring from titles and headings."); WX("% For portability's sake we use only the following fonts:"); WX("% cmr10"); WX("% cmbx10"); WX("% cmtt10"); WX("% and some enlargements of them. These fonts are all \"standard\" fonts"); WX("% in Plain TeX. See The TeXbook p.350."); WX("\\font\\fwfontnote=cmr7"); WX(""); WX("\\font\\fwfontnorm=cmr10"); WX("\\font\\fwfontnorma=cmr10 scaled \\magstep1"); WX("\\font\\fwfontnormb=cmr10 scaled \\magstep2"); WX(""); WX("\\font\\fwfontbold=cmbx10"); WX("\\font\\fwfontbolda=cmbx10 scaled \\magstep1"); WX("\\font\\fwfontboldb=cmbx10 scaled \\magstep2"); WX("\\font\\fwfontboldc=cmbx10 scaled \\magstep3"); WX("\\font\\fwfontboldd=cmbx10 scaled \\magstep4"); WX(""); WX(""); WX("% Macros for Stylistic Details"); WX("% ----------------------------"); WX("% This section contains all the fiddly little macros for setting the details"); WX("% of each macro definition."); WX(""); WX("% Macro definitions are sandwiched by calls to these macros which can be used"); WX("% to sort out the spacing before and after the macro definition."); WX("\\def\\fwbeginmacro{\\fwparskipoff\\bigskip}"); WX("\\def\\fwendmacro{\\fwparskipon\\par}"); WX(""); WX("% These macros deal with the macro name and definition line."); WX("\\def\\fwmacroname#1#2{{\\sl #1\\/}$\\lbrack$#2$\\rbrack$}"); WX("\\def\\fwfilename#1#2{{\\bf #1}$\\lbrack$#2$\\rbrack$}"); WX("\\def\\fwzero#1{{\\bf Z}}"); WX("\\def\\fwmany#1{{\\bf M}}"); WX("\\def\\fwlib#1{{\\bf L}}"); WX("\\def\\fwequals{ $\\equiv$}"); WX("\\def\\fwplusequals{ $+\\equiv$}"); WX(""); WX("% Now for the actual body of the definition. It looks nice to have the tt"); WX("% code indented a little. Again, we use macros instead of writing direct TeX,"); WX("% so as to allow the user to fiddle this stuff to taste without having to"); WX("% modify the FunnelWeb C code."); WX("\\def\\fwodef{\\parindent=15pt\\vskip0pt$\\lbrace$\\parindent=20pt}"); WX("\\def\\fwcdef{$\\rbrace$\\vskip0pt\\parindent=0pt}"); WX("\\def\\fwoquote{`}"); WX("\\def\\fwcquote{'}"); WX("\\def\\fwoparen{$($}"); WX("\\def\\fwcomma{$,$}"); WX("\\def\\fwcparen{$)$}"); WX("\\def\\fwparam#1{$\\diamond #1$}"); WX("\\def\\fwparams#1{$(\\diamond #1)$}"); WX(""); WX("% These macros deal with the notes that are appended at the end of each"); WX("% macro definition. Note that even though \\fwisafile,\\fwusedin, and \\fwseealso"); WX("% have the same definition, they are given different names so as to allow the"); WX("% user to redefine these macros to typeset each kind of information differently"); WX("% if desired."); WX("\\def\\fwbeginmacronotes{\\begingroup\\baselineskip=9pt\\smallskip}"); WX("\\def\\fwnote#1{{\\fwfontnote #1}\\par}"); WX("\\def\\fwisafile#1{\\fwnote{#1}}"); WX("\\def\\fwusedin#1{\\fwnote{#1}}"); WX("\\def\\fwseealso#1{\\fwnote{#1}}"); WX("\\def\\fwendmacronotes{\\endgroup}"); WX(""); WX(""); WX("% Macros to Typeset Program Code Verbatim"); WX("% ---------------------------------------"); WX("% This is by far the hairiest and most difficult part of the typesetting task"); WX("% because we have to turn off most of TeX's natural instincts in order to"); WX("% typeset the program text exactly as it appears in the input file."); WX("% Two macros are defined to pull this off: \\fwbtx and \\fwverbatimgobble."); WX("% Their code was inspired by the following sections of \"The TeXbook\":"); WX("% Appendix D: Dirty Tricks, 3.Verbatim listing, p.380-382."); WX("% Appendix E: Example Formats, p.421."); WX("% The \\fwbtx[ (for \"FunnelWeb Begin TeXt\") macro does most of the hard work."); WX("% The liberal use of \"%\" is because I don't understand TeX well enough to"); WX("% understand when an end of line will cause trouble, and I am playing it safe."); WX(""); WX("% Before defining the main \\fwbtx macro, we have to stash away some definitions"); WX("% in the hidden part of TeX's environment. Let's hope that these \"hidden\""); WX("% definitions don't affect anything except what is desired to be affected."); WX(""); WX("% The tt font in which we wish to set the text has two Latin lurking ligatures!"); WX("% These are ?` and !`. To disable them, we define the left quote when ACTIVE"); WX("% to be defined in such a way as to prevent ligatures. The main TeX text will"); WX("% normally not be exposed to this definition because normally the leftquote"); WX("% character is not active. The \\fwbtx macro temporarily makes the left quote"); WX("% character active thus activating the deactivation of left quote ligatures."); WX("% See The TeXbook p.381."); WX("{\\catcode`\\`=\\active \\gdef`{\\relax\\lq}}"); WX(""); WX("% TeX is fairly carefree about spaces and so we have to make it more serious."); WX("% To do so we pull the same trick as above, setting up a definition for active"); WX("% space, but only making space active during the span of the verbatim text."); WX("% In Plain TeX the active space is defined to be simply a space, but here we"); WX("% define it to be a control space. This ensures that the space cannot"); WX("% be gobbled up by one of TeX's mysterious mechanisms when activated."); WX("% See The TeXbook, p.381 and p.352."); WX("{\\obeyspaces\\global\\let =\\ }"); WX(""); WX("% Here is the main \\fwbtx verbatim text macro."); WX("% Note: The order in which all these pieces of business have to be done is"); WX("% still a partial mystery to me. Don't fiddle with this stuff unless you"); WX("% think you know what you are doing."); WX("\\def\\fwbtx[{%"); WX("%"); WX("% The funnies involved in getting verbatim output are safely housed inside"); WX("% this \\begingroup, and the \\endgroup in \\fwverbatimgobble. Groups are used"); WX("% instead of curly braces because we have to be able to signal the end of"); WX("% this macro with a curly brace."); WX("\\begingroup%"); WX("%"); WX("% \\pars at the end of empty lines in the verbatim text won't come out normally"); WX("% because TeX is in vertical mode and they get gobbled up. To prevent this,"); WX("% we force \\par to exit vertical mode first. See The TeXbook p.381."); WX("\\def\\par{\\leavevmode\\endgraf}%"); WX("%"); WX("% Activate the leftquote character so as to avoid ligatures (see above)."); WX("\\catcode`\\`=\\active%"); WX("%"); WX("% The \\obeylines macro simply defines end of line (^M) to be \\par. This ensures"); WX("% that TeX will treat each verbatim line as a new paragraph."); WX("\\obeylines%"); WX("%"); WX("% To get verbatim output, we have to desex all the special characters. This"); WX("% is explained in detail in The TeXbook p.380."); WX("\\def\\do##1{\\catcode`##1=12 }\\dospecials%"); WX("%"); WX("% Activate the space character so as to make TeX treat blanks seriously."); WX("% This activation invokes an eralier definition (see above)."); WX("\\obeyspaces"); WX("%"); WX("% Interparagraph skips do not help the cause."); WX("% Note: We have to preserve the indentation though, as the code is actually"); WX("% indented in the final output. See \\fwodef in an earlier section."); WX("\\parskip=0pt%"); WX("%"); WX("% We typeset the verbatim text in tt font (courier on the Macintosh) for a"); WX("% number of reasons:"); WX("% - tt font has the same horizontal spacing for each character."); WX("% - tt font covers the ASCII character set."); WX("% - tt font doesn't have many surprises (e.g. ligatures)."); WX("% - tt font looks much what you might see on a computer terminal screen."); WX("\\tt%"); WX("%"); WX("% Having set up an environment for verbatim, we are ready to use it."); WX("% By invoking \\fwverbatimgobble, this \\fwbtx macro gobbles up text verbatim (as"); WX("% part of the parameter of \\fwverbatimgobble) until it sees the termination"); WX("% string \"]fwetx=\" (the \"=\" was thrown in to add obscurity as this sequence"); WX("% must never occur in the verbatim text)."); WX("\\fwverbatimgobble}"); WX(""); WX("% The \\fwverbatimgobble macro exists to allow \\fwbtx to bracket verbatim text."); WX("\\def\\fwverbatimgobble#1]fwetx={#1\\endgroup}"); WX(""); WX(""); WX("% Table of Contents"); WX("% -----------------"); WX("% The five levels of table of contents that FunnelWeb supports are identified"); WX("% by the five letters [A..E]. These are used throughout the following macros."); WX(""); WX("% The following macros are utilities to the TOC macros to follow."); WX("\\def\\fwrule{\\medskip\\hrule\\medskip}"); WX("\\def\\fwqh{\\hskip1.5em\\relax}"); WX("\\def\\fwbeforesec{\\penalty-200\\bigskip\\medskip\\par}"); WX(""); WX("% The following macros are used to typeset the table of contents."); WX("\\def\\fwtocstart#1{\\fwrule\\leftline{\\fwfontbolda Table of Contents}\\fwrule}"); WX("\\def\\fwtoca#1#2{\\leftline{{\\bf #1 #2}}}"); WX("\\def\\fwtocb#1#2{\\leftline{\\fwqh #1 #2}}"); WX("\\def\\fwtocc#1#2{\\leftline{\\fwqh\\fwqh #1 #2}}"); WX("\\def\\fwtocd#1#2{\\leftline{\\fwqh\\fwqh\\fwqh #1 #2}}"); WX("\\def\\fwtoce#1#2{\\leftline{\\fwqh\\fwqh\\fwqh\\fwqh #1 #2}}"); WX("\\def\\fwtocfinish#1{\\fwrule}"); WX(""); WX("% The following \"library\" macros define five different strengths of headings"); WX("% which can be used later in the section macros."); WX("\\def\\fwliba#1#2{\\vfill\\eject{\\fwfontboldc #1 #2}\\penalty200\\smallskip}"); WX("\\def\\fwlibb#1#2{\\fwbeforesec{\\fwfontboldb #1 #2}\\penalty200\\smallskip}"); WX("\\def\\fwlibc#1#2{\\fwbeforesec{\\fwfontnormb #1 #2}\\penalty200\\smallskip}"); WX("\\def\\fwlibd#1#2{\\fwbeforesec{\\bf #1 #2}\\penalty200}"); WX("\\def\\fwlibe#1#2{\\fwbeforesec{\\bf #1 #2}}"); WX(""); WX("% Here are the macros that actually typeset the section headings throughout"); WX("% the document. The fwlib system has been employed so as to easily allow the"); WX("% user to redefine the strengths of headings to taste. For example, the"); WX("% user could insert in the input document a similar set of definitions to these"); WX("% but with the b..e headings set to \\fwlibc. This would tone down the output."); WX("\\def\\fwseca#1#2{\\fwliba{#1}{#2}}"); WX("\\def\\fwsecb#1#2{\\fwlibb{#1}{#2}}"); WX("\\def\\fwsecc#1#2{\\fwlibc{#1}{#2}}"); WX("\\def\\fwsecd#1#2{\\fwlibd{#1}{#2}}"); WX("\\def\\fwsece#1#2{\\fwlibe{#1}{#2}}"); WX(""); WX(""); WX("% Support for Explicit Typesetting"); WX("% --------------------------------"); WX("% FunnelWeb supports pragmas and other constructs that allow"); WX("% typesetter-independent typesetting commands to be given. The"); WX("% following macros support these features."); WX(""); WX("% The in-text literal @{sloth@} and emphasise @[walrus@] features."); WX("\\def\\fwlit#1{{\\tt #1}}"); WX("\\def\\fwemp#1{{\\it #1}}"); WX(""); WX("% The \"@p new_page\" pragma."); WX("\\def\\fwnewpage{\\vfill\\eject}"); WX(""); WX("% The \"@p vskip Nmm\" pragma."); WX("\\def\\fwvskip#1{\\null\\vskip #1mm}"); WX(""); WX("% The \"@p title \" pragma."); WX("\\def\\fwfontnormal#1{{\\fwfontnorm {#1}}}"); WX("\\def\\fwfonttitle#1{{\\fwfontboldd {#1}}}"); WX("\\def\\fwfontsmalltitle#1{{\\fwfontboldb {#1}}}"); WX("\\def\\fwleftline#1{\\leftline{#1}}"); WX("\\def\\fwcenterline#1{\\centerline{#1}}"); WX("\\def\\fwrightline#1{\\rightline{#1}}"); WX(""); WX(""); WX("% Support for Old FunnelWeb"); WX("% -------------------------"); WX("% The following macros were used extensively in the first version of"); WX("% FunnelWeb and are retained so that these older input files will still"); WX("% typeset cleanly."); WX("\\def\\p#1{{\\tt #1}} % P for Program text."); WX("\\def\\flagpage#1#2{"); WX(" \\null"); WX(" \\vfill"); WX(" \\centerline{\\fwfontboldd #1}"); WX(" \\vskip 1cm"); WX(" \\centerline{\\fwfontboldd #2}"); WX(" \\vfill"); WX(" \\null"); WX(" \\vfill"); WX("}"); WX(""); WX("%====================== End of FunnelWeb TeX Definitions ======================="); irect TeX,"); WX("% so as to allow the user to fiddle this stuff to taste without having to"); WX("% modify the FunnelWeb C code."); WX("\\def\\fwodef{\\parindent=15pt\\vskip0pt$\\lbrace$\\parindent=20pt}"); WX("\\def\\fwcdef{$\\rbrace$\\vskip0pt\\parindent=0pt}"); WX("\\def\\fwoquote{`}"); WX("\\def\\fwcquote{'}"); WX("\\def\\fwoparen{$($}"); WX("\\def\\fwcomma{$,$}fw_src/source/texhead.h 644 0 0 15630 6716661074 10425 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. ##############################################################################*/ /******************************************************************************/ /* TEXHEAD.H */ /******************************************************************************/ /* */ /* TEX HEADER PACKAGE */ /* ================== */ /* This package contains a single function that writes the TeX header */ /* (containing all the Weave macros) to the specified stream. The package */ /* consists of: */ /* */ /* texhead.tex - The header file ("source code" for texhead.ctx). */ /* texhead.ctx - C code automatically generated by texhead.tex. */ /* texhead.h - This file, containing a function definition. */ /* texhead.c - Contains a function body. */ /* */ /* The first version of FunnelWeb (1986) generated TeX output files that used */ /* a collection of macros to neaten and simplify the bulk of the TeX output */ /* file. For example, the macro \fwbtx provided a simple way to specify */ /* verbatim text. This system worked extremely well, the only inconvenience */ /* being that each FunnelWeb TeX output file had to "\input" the TeX header */ /* file containing all the macros. At the time, this seemed a sensible */ /* factorization of the macros, and, within the limited environment in which */ /* FunnelWeb was operating, worked well. */ /* */ /* In NEW, IMPROVED FunnelWeb, "\input"ing the header file has the potential */ /* to cause lots of problems, the major ones being: */ /* */ /* - The header file would have to be installed as part of the FunnelWeb */ /* system. Currently this means that it would be the ONLY other file */ /* necessary apart from the FunnelWeb executable. It would be far more */ /* desirable to avoid having to install the header file. */ /* */ /* - The header file would have to be referred to somehow by the TeX file. */ /* As it makes sense to have only one copy of the header file on a machine, */ /* TeX files would have to refer to that copy. This would require one of a */ /* number of messy machine-specific mechanisms such as (VMS) logical name */ /* translation or environment variable translation. */ /* */ /* - TeX files could not be easily moved to other machines (particularly */ /* those not running FunnelWeb themselves) without also sending the header */ /* file. */ /* */ /* - If FunnelWeb and the header file were ever jointly modified, the dynamic */ /* binding of old TeX files would mean that they may no longer be printable.*/ /* */ /* For all these reasons, the decision was made to write the library of TeX */ /* macros at the start of each TeX output file, thus making each TeX output */ /* file entirely self-contained. To do this, the header file had to be */ /* converted into a sequence of C output statments. To this end, a new */ /* FunnelWeb shell command CODIFY was added that performs this transformation.*/ /* CODIFY could have been a separate utility program, but if it was, it might */ /* somehow be separated from the rest of FunnelWeb during distribution. By */ /* building CODIFY into FunnelWeb itself, this possibility is eliminated. */ /* */ /* This package encapsulates the automatically generated C code. This header */ /* file defines a function that writes it to a specified stream. The package */ /* body texhead.c contains the body of the function which consists mainly of */ /* a #include of the automatically generated C code in texhead.ctx. */ /* */ /******************************************************************************/ /* Ensure that the body of this header file is included at most once. */ #ifndef DONE_TEXH #define DONE_TEXH /******************************************************************************/ #include "style.h" #include "writfile.h" /******************************************************************************/ EXPORT void tex_head P_((p_wf_t)); /* Writes the FunnelWeb TeX header block to the argument stream. */ /******************************************************************************/ /* For #ifndef preventing multiple inclusion of the body of this header file. */ #endif /******************************************************************************/ /* End of TEXHEAD.H */ /******************************************************************************/ are the macros that actually typeset the section headings throughout"); WX("% the document. The fwlib fw_src/source/texhead.tex 644 0 0 31453 6715672434 11000 %===================== Start of FunnelWeb TeX Definitions ====================== % Version % ------- % This is FunnelWeb TeX Macro Library Version 1.0. % Copyright % --------- % This set of FunnelWeb TeX definitions was written by Ross Williams and was % originally Copyright (C) 1992 Ross N. Williams. However, I, Ross Williams, % hereby forego any claim to Copyright in this set of FunnelWeb TeX definitions % and hereby authorize that the set of TeX definitions pass into the public % domain. -- Ross N. Williams, 3:41pm 07-May-1992, Adelaide, Australia. % Modification % ------------ % Please record all modifications to these TeX definitions here. Unless % otherwise specified, all modified definitions fall in the public domain too. % % Programmers: % RNW Ross N. Williams ross@ross.net % % Changes: % 07-May-1992 RNW Prepared this work for public domain release. % 10-May-1999 RNW Added \fwlib macro. % General Comments % ---------------- % This set of TeX definitions exists for two reasons: % % 1. To shorten and neaten the FunnelWeb TeX output. % 2. To allow users to fiddle with the output format in their input files % (by inserting redefining "\def"s) without having to resort to % modifying the FunnelWeb code. % % The user is warned that these definitions may be changed from time to time % (but probably not much). The user should not be too sneaky. In particular, % users wishing to redefine some of these macros should do so in an explicitly % defined section at the top of their input file. This will mean that in the % event of problems, that section can simply be deleted or commented out to % allow the document to at least be typeset in the default format. Users should % limit themselves to redefining these macros in such a section and should % refrain from using the macros throughout their documents. % Environment Parameters % ---------------------- % \tolerance tells TeX how tolerant it should be about making bad line and % page breaks. Here we set it to it's maximum, as % 1) Computer programs are likely to cause lots of bad breaks. % 2) In most cases the user would probably rather get the TeX file through % TeX without any errors than fiddle with spacings for perfection. \tolerance=10000 % I don't like indentation as it makes the page look more busy. Instead, % paragraphs are separated by a little space (see next). \parindent=0pt % In many cases, users will produce documents with long runs of paragraphs. % In order to space out these paragraphs, it is convenient to maintain a % prevailing non-zero \parskip (end-of-paragaph skip). The only trouble is % that the skip becomes a problem in macro definitions which require no skip % and so we have to turn the skip on and off. The following two macros % simplify this process. \def\fwparskipon{\parskip=\medskipamount} \def\fwparskipoff{\parskip=0pt} \fwparskipon % Setting raggedbottom allows TeX to leave a bit of space at the bottom of the % page in order to better vertically align the rest of the page (e.g. skips % won't stretch as much). It also means that headings are less likely to be % isolated at the bottom of the page without any following text. \raggedbottom % Fonts % ----- % Most of the typeset output is set in 10pt roman and 10pt tt font. % The major extra font needs spring from titles and headings. % For portability's sake we use only the following fonts: % cmr10 % cmbx10 % cmtt10 % and some enlargements of them. These fonts are all "standard" fonts % in Plain TeX. See The TeXbook p.350. \font\fwfontnote=cmr7 \font\fwfontnorm=cmr10 \font\fwfontnorma=cmr10 scaled \magstep1 \font\fwfontnormb=cmr10 scaled \magstep2 \font\fwfontbold=cmbx10 \font\fwfontbolda=cmbx10 scaled \magstep1 \font\fwfontboldb=cmbx10 scaled \magstep2 \font\fwfontboldc=cmbx10 scaled \magstep3 \font\fwfontboldd=cmbx10 scaled \magstep4 % Macros for Stylistic Details % ---------------------------- % This section contains all the fiddly little macros for setting the details % of each macro definition. % Macro definitions are sandwiched by calls to these macros which can be used % to sort out the spacing before and after the macro definition. \def\fwbeginmacro{\fwparskipoff\bigskip} \def\fwendmacro{\fwparskipon\par} % These macros deal with the macro name and definition line. \def\fwmacroname#1#2{{\sl #1\/}$\lbrack$#2$\rbrack$} \def\fwfilename#1#2{{\bf #1}$\lbrack$#2$\rbrack$} \def\fwzero#1{{\bf Z}} \def\fwmany#1{{\bf M}} \def\fwlib#1{{\bf L}} \def\fwequals{ $\equiv$} \def\fwplusequals{ $+\equiv$} % Now for the actual body of the definition. It looks nice to have the tt % code indented a little. Again, we use macros instead of writing direct TeX, % so as to allow the user to fiddle this stuff to taste without having to % modify the FunnelWeb C code. \def\fwodef{\parindent=15pt\vskip0pt$\lbrace$\parindent=20pt} \def\fwcdef{$\rbrace$\vskip0pt\parindent=0pt} \def\fwoquote{`} \def\fwcquote{'} \def\fwoparen{$($} \def\fwcomma{$,$} \def\fwcparen{$)$} \def\fwparam#1{$\diamond #1$} \def\fwparams#1{$(\diamond #1)$} % These macros deal with the notes that are appended at the end of each % macro definition. Note that even though \fwisafile,\fwusedin, and \fwseealso % have the same definition, they are given different names so as to allow the % user to redefine these macros to typeset each kind of information differently % if desired. \def\fwbeginmacronotes{\begingroup\baselineskip=9pt\smallskip} \def\fwnote#1{{\fwfontnote #1}\par} \def\fwisafile#1{\fwnote{#1}} \def\fwusedin#1{\fwnote{#1}} \def\fwseealso#1{\fwnote{#1}} \def\fwendmacronotes{\endgroup} % Macros to Typeset Program Code Verbatim % --------------------------------------- % This is by far the hairiest and most difficult part of the typesetting task % because we have to turn off most of TeX's natural instincts in order to % typeset the program text exactly as it appears in the input file. % Two macros are defined to pull this off: \fwbtx and \fwverbatimgobble. % Their code was inspired by the following sections of "The TeXbook": % Appendix D: Dirty Tricks, 3.Verbatim listing, p.380-382. % Appendix E: Example Formats, p.421. % The \fwbtx[ (for "FunnelWeb Begin TeXt") macro does most of the hard work. % The liberal use of "%" is because I don't understand TeX well enough to % understand when an end of line will cause trouble, and I am playing it safe. % Before defining the main \fwbtx macro, we have to stash away some definitions % in the hidden part of TeX's environment. Let's hope that these "hidden" % definitions don't affect anything except what is desired to be affected. % The tt font in which we wish to set the text has two Latin lurking ligatures! % These are ?` and !`. To disable them, we define the left quote when ACTIVE % to be defined in such a way as to prevent ligatures. The main TeX text will % normally not be exposed to this definition because normally the leftquote % character is not active. The \fwbtx macro temporarily makes the left quote % character active thus activating the deactivation of left quote ligatures. % See The TeXbook p.381. {\catcode`\`=\active \gdef`{\relax\lq}} % TeX is fairly carefree about spaces and so we have to make it more serious. % To do so we pull the same trick as above, setting up a definition for active % space, but only making space active during the span of the verbatim text. % In Plain TeX the active space is defined to be simply a space, but here we % define it to be a control space. This ensures that the space cannot % be gobbled up by one of TeX's mysterious mechanisms when activated. % See The TeXbook, p.381 and p.352. {\obeyspaces\global\let =\ } % Here is the main \fwbtx verbatim text macro. % Note: The order in which all these pieces of business have to be done is % still a partial mystery to me. Don't fiddle with this stuff unless you % think you know what you are doing. \def\fwbtx[{% % % The funnies involved in getting verbatim output are safely housed inside % this \begingroup, and the \endgroup in \fwverbatimgobble. Groups are used % instead of curly braces because we have to be able to signal the end of % this macro with a curly brace. \begingroup% % % \pars at the end of empty lines in the verbatim text won't come out normally % because TeX is in vertical mode and they get gobbled up. To prevent this, % we force \par to exit vertical mode first. See The TeXbook p.381. \def\par{\leavevmode\endgraf}% % % Activate the leftquote character so as to avoid ligatures (see above). \catcode`\`=\active% % % The \obeylines macro simply defines end of line (^M) to be \par. This ensures % that TeX will treat each verbatim line as a new paragraph. \obeylines% % % To get verbatim output, we have to desex all the special characters. This % is explained in detail in The TeXbook p.380. \def\do##1{\catcode`##1=12 }\dospecials% % % Activate the space character so as to make TeX treat blanks seriously. % This activation invokes an eralier definition (see above). \obeyspaces % % Interparagraph skips do not help the cause. % Note: We have to preserve the indentation though, as the code is actually % indented in the final output. See \fwodef in an earlier section. \parskip=0pt% % % We typeset the verbatim text in tt font (courier on the Macintosh) for a % number of reasons: % - tt font has the same horizontal spacing for each character. % - tt font covers the ASCII character set. % - tt font doesn't have many surprises (e.g. ligatures). % - tt font looks much what you might see on a computer terminal screen. \tt% % % Having set up an environment for verbatim, we are ready to use it. % By invoking \fwverbatimgobble, this \fwbtx macro gobbles up text verbatim (as % part of the parameter of \fwverbatimgobble) until it sees the termination % string "]fwetx=" (the "=" was thrown in to add obscurity as this sequence % must never occur in the verbatim text). \fwverbatimgobble} % The \fwverbatimgobble macro exists to allow \fwbtx to bracket verbatim text. \def\fwverbatimgobble#1]fwetx={#1\endgroup} % Table of Contents % ----------------- % The five levels of table of contents that FunnelWeb supports are identified % by the five letters [A..E]. These are used throughout the following macros. % The following macros are utilities to the TOC macros to follow. \def\fwrule{\medskip\hrule\medskip} \def\fwqh{\hskip1.5em\relax} \def\fwbeforesec{\penalty-200\bigskip\medskip\par} % The following macros are used to typeset the table of contents. \def\fwtocstart#1{\fwrule\leftline{\fwfontbolda Table of Contents}\fwrule} \def\fwtoca#1#2{\leftline{{\bf #1 #2}}} \def\fwtocb#1#2{\leftline{\fwqh #1 #2}} \def\fwtocc#1#2{\leftline{\fwqh\fwqh #1 #2}} \def\fwtocd#1#2{\leftline{\fwqh\fwqh\fwqh #1 #2}} \def\fwtoce#1#2{\leftline{\fwqh\fwqh\fwqh\fwqh #1 #2}} \def\fwtocfinish#1{\fwrule} % The following "library" macros define five different strengths of headings % which can be used later in the section macros. \def\fwliba#1#2{\vfill\eject{\fwfontboldc #1 #2}\penalty200\smallskip} \def\fwlibb#1#2{\fwbeforesec{\fwfontboldb #1 #2}\penalty200\smallskip} \def\fwlibc#1#2{\fwbeforesec{\fwfontnormb #1 #2}\penalty200\smallskip} \def\fwlibd#1#2{\fwbeforesec{\bf #1 #2}\penalty200} \def\fwlibe#1#2{\fwbeforesec{\bf #1 #2}} % Here are the macros that actually typeset the section headings throughout % the document. The fwlib system has been employed so as to easily allow the % user to redefine the strengths of headings to taste. For example, the % user could insert in the input document a similar set of definitions to these % but with the b..e headings set to \fwlibc. This would tone down the output. \def\fwseca#1#2{\fwliba{#1}{#2}} \def\fwsecb#1#2{\fwlibb{#1}{#2}} \def\fwsecc#1#2{\fwlibc{#1}{#2}} \def\fwsecd#1#2{\fwlibd{#1}{#2}} \def\fwsece#1#2{\fwlibe{#1}{#2}} % Support for Explicit Typesetting % -------------------------------- % FunnelWeb supports pragmas and other constructs that allow % typesetter-independent typesetting commands to be given. The % following macros support these features. % The in-text literal @{sloth@} and emphasise @[walrus@] features. \def\fwlit#1{{\tt #1}} \def\fwemp#1{{\it #1}} % The "@p new_page" pragma. \def\fwnewpage{\vfill\eject} % The "@p vskip Nmm" pragma. \def\fwvskip#1{\null\vskip #1mm} % The "@p title " pragma. \def\fwfontnormal#1{{\fwfontnorm {#1}}} \def\fwfonttitle#1{{\fwfontboldd {#1}}} \def\fwfontsmalltitle#1{{\fwfontboldb {#1}}} \def\fwleftline#1{\leftline{#1}} \def\fwcenterline#1{\centerline{#1}} \def\fwrightline#1{\rightline{#1}} % Support for Old FunnelWeb % ------------------------- % The following macros were used extensively in the first version of % FunnelWeb and are retained so that these older input files will still % typeset cleanly. \def\p#1{{\tt #1}} % P for Program text. \def\flagpage#1#2{ \null \vfill \centerline{\fwfontboldd #1} \vskip 1cm \centerline{\fwfontboldd #2} \vfill \null \vfill } %====================== End of FunnelWeb TeX Definitions ======================= unt} \def\fwparskipoff{\parskip=0pt} \fwparskipon % Setting raggedbottom allows TeX to leave a bit of space at the bottom of the % page in order to better vertically align the rest of the page (e.g. skips % won'tfw_src/source/weaveh.c 644 0 0 103354 6716661075 10277 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. 12-Apr-1999 RNW Copied weave module and created this HTML version. 08-May-1999 RNW Consolidated the weave TeX/HTML package split. 08-May-1999 RNW Added a typesetter check. 09-May-1999 RNW Added support for library macros. ##############################################################################*/ /******************************************************************************/ /* WEAVEH.C */ /******************************************************************************/ #include #include "style.h" #include "as.h" #include "data.h" #include "lister.h" #include "machin.h" #include "misc.h" #include "option.h" #include "table.h" #include "texhead.h" #include "weaveh.h" /* IMPORTANT WARNING: The Macintosh THINK C compiler sets up strings that */ /* start with \p or \P as PASCAL strings rather than C strings. So be very */ /* careful not to start any strings with \p or \P. */ /******************************************************************************/ LOCVAR wf_t f_t; /* Variable representing documentation file. */ LOCVAR bool literal; /* True if we are inside a literal @{. */ LOCVAR bool in_col; /* True if we are in an HTML table text column. */ LOCVAR bool seen_eol; /* TRUE if we've just seen an EOL. */ /******************************************************************************/ LOCAL void wv_ex P_((p_ells_t)); /******************************************************************************/ LOCAL char * fn_nodir P_((char *)); LOCAL char * fn_nodir (p) /* Given a pointer to a string, returns a pointer to the character just past */ /* the last occurrance of FN_DELIM, or a pointer to the start of the string */ /* if it does not occur. In other words, given a filename, return a pointer */ /* to the start of the name field. */ char *p; { char *q = strrchr(p,FN_DELIM); if (q==NULL) return p; else return q+1; } /******************************************************************************/ LOCAL void wf_dec P_((p_wf_t,ulong)); LOCAL void wf_dec(p_wf,n) /* Writes the unsigned number n to the specified output stream as a decimal. */ /* This function has been named wf_dec so that it can be moved to the wf */ /* package if it turns out to be popular. */ p_wf_t p_wf; ulong n; { char t[20]; sprintf(t,"%lu",n); wf_wr(p_wf,t); } /******************************************************************************/ LOCAL void col_on P_((void)); LOCAL void col_on() /* Opens an HTML column if one isn't active. */ { if (!in_col) { wf_wl(&f_t,"

"); in_col=TRUE; } } /******************************************************************************/ LOCAL void col_off P_((void)); LOCAL void col_off() /* Closes an HTML column if one is active. */ { if (in_col) { wf_wl(&f_t,"
"); in_col=FALSE; } } /******************************************************************************/ LOCAL void nspace P_((int)); LOCAL void nspace(n) /* Writes N non-destructible spaces. */ int n; { int i; for (i=0; idc_kind==DC_TEXT,"dc_is_white: Not text."); ls_fir(p_dc->dc_text); while (TRUE) { p_sc_t p_sc; ls_nxt(p_dc->dc_text,PPV &p_sc); if (p_sc==NULL) break; if (!p_sc->sc_white) return FALSE; } return TRUE; } /******************************************************************************/ #define EOL_BR_NO FALSE #define EOL_BR_YES TRUE LOCAL void wv_ugch P_((int,bool)); LOCAL void wv_ugch(ch,eolbr) /* WeaVe UGly CHaracter. */ /* This function accepts a single character and writes out the HTML code that */ /* will make the character appear just as itself in the text. */ /* The term "ugly" is used to describe potentially harmful text/characters. */ int ch; bool eolbr; { /* End of lines are the only non-printable allowed. */ if (ch==EOL) { if (eolbr) wf_wr(&f_t,"
"); wf_chr(&f_t,EOL); return; } /* All other non-printables result in a bullet. In the absence of bugs, the */ /* only way a non-printable can get to us here is as a result of the user */ /* explicitly inserting one using the scanner's @^ control sequence. */ if (!isascprn(ch)) { wf_wr(&f_t,"•"); return; } /* If it IS printable, then print it ... carefully! */ switch (ch) { case ' ': if (eolbr) wf_wr(&f_t," "); else wf_wr(&f_t," "); break; case '&': wf_wr(&f_t,"&"); break; case '<': wf_wr(&f_t,"<"); break; case '>': wf_wr(&f_t,">"); break; default: wf_chr(&f_t,ch); break; } } /******************************************************************************/ LOCAL void wv_ugstr P_((char *,bool)); LOCAL void wv_ugstr(s,eolbr) /* Writes out a potentially ugly string. */ char *s; bool eolbr; { while (*s != EOS) wv_ugch(*s++,eolbr); } /******************************************************************************/ LOCAL void wv_ugsc P_((p_sc_t,bool)); LOCAL void wv_ugsc(p_sc,eolbr) /* Writes out a potentially ugly text scrap. */ p_sc_t p_sc; bool eolbr; { char *p = p_sc->sc_first; char *p_last = p_sc->sc_last; while (p<=p_last) { char ch = *p++; if ((ch == EOL) && seen_eol && (!eolbr)) wf_wr(&f_t,"\n

"); else wv_ugch(ch,eolbr); seen_eol = (ch == EOL); } } /******************************************************************************/ LOCAL void wv_ugscls P_((p_scls_t,bool)); LOCAL void wv_ugscls(p_scls,eolbr) /* This function writes the specified text list to the output stream. It */ /* writes it cleaning up all ugly characters. */ p_scls_t p_scls; bool eolbr; { seen_eol = FALSE; ls_fir(p_scls); while (TRUE) { p_sc_t p_sc; ls_nxt(p_scls,PPV &p_sc); if (p_sc==NULL) break; wv_ugsc(p_sc,eolbr); } } /******************************************************************************/ LOCAL void wv_secnn P_((p_ty_t)); LOCAL void wv_secnn(p_ty) /* Write out the section number and name. */ p_ty_t p_ty; { sn_str(&p_ty->ty_sn,linet1); wf_wr(&f_t,linet1); wf_wr(&f_t,". "); wv_ugstr((string) p_ty->ty_pname,EOL_BR_NO); } /******************************************************************************/ LOCAL void wv_echo P_((p_scls_t)); LOCAL void wv_echo(p_scls) /* This function writes the specified text list to the output stream. It */ /* writes it just as it is, with no modifications whatsoever. */ p_scls_t p_scls; { ls_fir(p_scls); while (TRUE) { p_sc_t p_sc; ls_nxt(p_scls,PPV &p_sc); if (p_sc==NULL) break; wf_blk(&f_t,p_sc->sc_first,(size_t) (p_sc->sc_last-p_sc->sc_first+1)); } } /******************************************************************************/ LOCAL void wv_verb P_((p_scls_t)); LOCAL void wv_verb(p_scls) /* Writes a text list verbatim, but brackets it with sequences that instruct */ /* the typesetter not to interpret the text in any special way. */ p_scls_t p_scls; { if (ls_len(p_scls) > 0) { wf_wr(&f_t,""); wv_ugscls(p_scls,EOL_BR_YES); wf_wl(&f_t,""); } } /******************************************************************************/ LOCAL void wv_head P_((void)); LOCAL void wv_head() { wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); { fn_t title; fnident(option.op_f_s,title); wf_wr(&f_t,"Package "); wf_wr(&f_t,title); wf_wl(&f_t,""); } wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); } /******************************************************************************/ LOCAL void wv_tail P_((void)); LOCAL void wv_tail() { wf_wl(&f_t,"

"); wf_wl(&f_t,"


"); wf_wl(&f_t,"
End Of File
"); wf_wl(&f_t,"
"); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,""); } /******************************************************************************/ LOCAL void wv_nsec P_((p_ty_t)); LOCAL void wv_nsec(p_ty) /* Weaves the start of a new section. */ p_ty_t p_ty; { as_cold(p_ty->ty_kind==TY_NSEC,"wv_nsec: Not a section!"); switch (sn_lev(&p_ty->ty_sn)) { case 1: wf_wr(&f_t,"


"); break; case 2: wf_wr(&f_t,"


"); break; case 3: wf_wr(&f_t,"


"); break; case 4: wf_wr(&f_t,"


"); break; case 5: wf_wr(&f_t,"


"); break; default: as_bomb("wv_nsec:case defaulted."); } wf_wr(&f_t,"ty_sn,linet1); wf_wr(&f_t,linet1); wf_wl(&f_t,"\">"); /* Work out what kind of section macro should be used. */ switch (sn_lev(&p_ty->ty_sn)) { case 1: wf_wr(&f_t,"

"); wv_secnn(p_ty); wf_wl(&f_t,"

"); break; case 2: wf_wr(&f_t,"

"); wv_secnn(p_ty); wf_wl(&f_t,"

"); break; case 3: wf_wr(&f_t,"

"); wv_secnn(p_ty); wf_wl(&f_t,"

"); break; case 4: wf_wr(&f_t,"

"); wv_secnn(p_ty); wf_wl(&f_t,"

"); break; case 5: wf_wr(&f_t,"
"); wv_secnn(p_ty); wf_wl(&f_t,"
"); break; default: as_bomb("wv_nsec:case defaulted."); } } /******************************************************************************/ LOCAL void wv_olit P_((p_ty_t)); LOCAL void wv_olit(p_ty) p_ty_t p_ty; { as_cold(p_ty->ty_kind==TY_OLIT,"wv_olit: Not an open literal!"); wf_wr(&f_t,""); literal=TRUE; } /******************************************************************************/ LOCAL void wv_clit P_((p_ty_t)); LOCAL void wv_clit(p_ty) p_ty_t p_ty; { as_cold(p_ty->ty_kind==TY_CLIT,"wv_clit: Not a close literal!"); wf_wr(&f_t,""); literal=FALSE; } /******************************************************************************/ LOCAL void wv_oemp P_((p_ty_t)); LOCAL void wv_oemp(p_ty) p_ty_t p_ty; { as_cold(p_ty->ty_kind==TY_OEMP,"wv_oemp: Not an open emphasize!"); wf_wr(&f_t,""); } /******************************************************************************/ LOCAL void wv_cemp P_((p_ty_t)); LOCAL void wv_cemp(p_ty) p_ty_t p_ty; { as_cold(p_ty->ty_kind==TY_CEMP,"wv_cemp: Not a close emphasize!"); wf_wr(&f_t,""); } /******************************************************************************/ LOCAL void wv_npag P_((p_ty_t)); LOCAL void wv_npag(p_ty) p_ty_t p_ty; { as_cold(p_ty->ty_kind==TY_NPAG,"wv_npag: Not a new page!"); wf_wl(&f_t,""); wf_wl(&f_t,"


"); wf_wl(&f_t,""); } /******************************************************************************/ LOCAL void wv_tocs P_((p_ty_t)); LOCAL void wv_tocs(p_ty) /* Writes a table of contents to the weave output file. */ p_ty_t p_ty; { /* We need to save the document list position as the rest of the weaver is */ /* in the process of traversing it!!! */ p_void p_mark = ls_mar(document_list); as_cold(p_ty->ty_kind==TY_TOCS,"wv_tocs: Not a table of contents!"); wf_wl(&f_t,""); ls_fir(document_list); while (TRUE) { p_dc_t p_dc; ls_nxt(document_list,PPV &p_dc); if (p_dc == NULL) break; if (p_dc->dc_kind==DC_TYPE && p_dc->dc_pty->ty_kind==TY_NSEC) { switch(sn_lev(&p_dc->dc_pty->ty_sn)) { case 1: break; case 2: nspace(5); break; case 3: nspace(15); break; case 4: nspace(20); break; case 5: nspace(25); break; default: as_bomb("wv_toc: switch defaulted."); } wf_wr(&f_t,"dc_pty->ty_sn,linet1); wf_wr(&f_t,linet1); wf_wr(&f_t,"\">"); wv_secnn(p_dc->dc_pty); wf_wl(&f_t,"
"); } } wf_wl(&f_t,""); /* Restore the document list position. */ ls_set(document_list,p_mark); } /******************************************************************************/ LOCAL void wv_skip P_((p_ty_t)); LOCAL void wv_skip(p_ty) /* Writes a vertical space to the output file. */ p_ty_t p_ty; { int i; as_cold(p_ty->ty_kind==TY_SKIP,"wv_skip: Not a skip directive!"); for (i=0; ity_mm/10; i++) wf_wl(&f_t,"
\n"); } /******************************************************************************/ LOCAL void wv_titl P_((p_ty_t)); LOCAL void wv_titl(p_ty) /* Writes a title line to the output file. */ p_ty_t p_ty; { as_cold(p_ty->ty_kind==TY_TITL,"wv_titl: Not a title!"); wf_wl(&f_t,"
"); wf_wr(&f_t,"
ty_align) { case LR_LEFT: wf_wr(&f_t,"ALIGN=left"); break; case LR_RIGH: wf_wr(&f_t,"ALIGN=right"); break; case LR_CENT: wf_wr(&f_t,"ALIGN=center"); break; default: as_bomb("wv_title: Alignment switch defaulted."); } wf_wr(&f_t,">"); switch(p_ty->ty_font) { case FT_NORM: wf_wr(&f_t,""); break; case FT_TITL: wf_wr(&f_t,""); break; case FT_STIT: wf_wr(&f_t,""); break; default: as_bomb("wv_title: Font switch defaulted."); } wv_ugsc(&p_ty->ty_sc,EOL_BR_NO); wf_wl(&f_t,"
"); wf_wl(&f_t,"

"); } /******************************************************************************/ LOCAL void wv_dcty P_((p_dc_t)); LOCAL void wv_dcty(p_dc) /* Weaves a document typesetter element. */ p_dc_t p_dc; { p_ty_t p_ty = p_dc->dc_pty; as_cold(p_dc->dc_kind==DC_TYPE,"wv_dcty: Not a typesetter component!"); switch (p_ty->ty_kind) { case TY_NSEC: col_off(); wv_nsec(p_ty); break; case TY_OLIT: col_on(); wv_olit(p_ty); break; case TY_CLIT: col_on(); wv_clit(p_ty); break; case TY_OEMP: col_on(); wv_oemp(p_ty); break; case TY_CEMP: col_on(); wv_cemp(p_ty); break; case TY_NPAG: col_off(); wv_npag(p_ty); break; case TY_TOCS: col_off(); wv_tocs(p_ty); break; case TY_SKIP: col_off(); wv_skip(p_ty); break; case TY_TITL: col_off(); wv_titl(p_ty); break; default : as_bomb("wv_dcty: Switch defaulted."); } } /******************************************************************************/ LOCAL void wv_dctx P_((p_dc_t)); LOCAL void wv_dctx(p_dc) /* Write out a document text item. */ p_dc_t p_dc; { as_cold(p_dc->dc_kind==DC_TEXT,"wv_dctx: Not text."); if (literal || tr_codes==TR_NONE) wv_ugscls(p_dc->dc_text,EOL_BR_NO); else wv_echo(p_dc->dc_text); } /******************************************************************************/ LOCAL void wv_eltx P_((p_el_t)); LOCAL void wv_eltx(p_el) /* Weaves a text element. */ p_el_t p_el; { as_cold(p_el->el_kind==EL_TEXT,"wv_eltx: Not text."); wv_verb(p_el->el_text); } /******************************************************************************/ LOCAL void wv_elin P_((p_el_t)); LOCAL void wv_elin(p_el) /* Weaves a invocation element. */ p_el_t p_el; { p_bp_t p_bp; p_ma_t p_ma = p_el->el_p_mac; p_md_t p_md = &p_ma->ma_defn[p_ma->ma_minlev]; as_cold(p_el->el_kind==EL_INVC,"wv_elin: Not an invocation."); /* Write out the macro call proper. */ ls_loo(p_md->md_body,1L,PPV &p_bp); wf_wr(&f_t,"bp_seq); wf_wr(&f_t,"\">"); wv_ugstr(p_ma->ma_name,EOL_BR_NO); wf_wr(&f_t,""); /* Write out the actual parameter list, if any. */ if (ls_len(p_el->el_parls) > 0) { ulong parnum; wf_wr(&f_t,"("); ls_fir(p_el->el_parls); /* List of actual parameter expressions. */ ls_fir(p_el->el_pretx); /* List of crud before each expression. */ ls_fir(p_el->el_postx); /* List of crud after each expression. */ parnum=1; while (TRUE) { p_ells_t *pp_exp; p_scls_t *pp_scls1; p_scls_t *pp_scls2; ls_nxt(p_el->el_parls,PPV &pp_exp); ls_nxt(p_el->el_pretx,PPV &pp_scls1); ls_nxt(p_el->el_postx,PPV &pp_scls2); if (pp_exp==NULL) break; if (parnum++ > 1) wf_wr(&f_t,","); wv_verb(*pp_scls1); wf_wr(&f_t,"\""); wv_ex(*pp_exp); wf_wr(&f_t,"\""); wv_verb(*pp_scls2); } wf_wr(&f_t,")"); } } /******************************************************************************/ LOCAL void wv_elpr P_((p_el_t)); LOCAL void wv_elpr(p_el) /* Weaves a parameter element. */ p_el_t p_el; { as_cold(p_el->el_kind==EL_PARM,"wv_elpr: Not a parameter."); wf_wr (&f_t,""); wf_dec(&f_t,(ulong) p_el->el_parno); wf_wr (&f_t,""); } /******************************************************************************/ LOCAL void wv_ex(p_exp) /* Weaves a expression. */ p_ells_t p_exp; { ls_fir(p_exp); while (TRUE) { p_el_t p_el; ls_nxt(p_exp,PPV &p_el); if (p_el==NULL) break; switch (p_el->el_kind) { case EL_TEXT: wv_eltx(p_el); break; case EL_INVC: wv_elin(p_el); break; case EL_PARM: wv_elpr(p_el); break; default: as_bomb("wv_ex: Case defaulted."); } } } /******************************************************************************/ LOCAL void wv_usage P_((p_ma_t,ulong)); LOCAL void wv_usage(p_ma,level) /* Weaves a list of all the sections in which the specified macro is used. */ p_ma_t p_ma; ulong level; { p_md_t p_md = &p_ma->ma_defn[level]; ulong no_calls = ls_len(p_ma->ma_calls); ulong callno; /* If it is a file macro then it is not allowed to be called. */ if (p_md->md_isfil) { wf_wl(&f_t,"This macro is attached to an output file."); return; } if (p_ma->ma_minlev < level) { p_bp_t p_bp; p_md_t p_md2 = &p_ma->ma_defn[p_ma->ma_minlev]; ls_loo(p_md2->md_body,1L,PPV &p_bp); wf_wl(&f_t,"This library macro was overruled by definition "); wf_wr(&f_t,"bp_seq); wf_wr(&f_t,"\">"); wf_dec(&f_t,(ulong) p_bp->bp_seq); wf_wl(&f_t," and is not active."); return; } if (no_calls==0) { wf_wl(&f_t,"This macro is NEVER invoked."); return; } wf_wr(&f_t,"This macro is invoked in definition"); if (no_calls>1) wf_chr(&f_t,'s'); wf_chr(&f_t,' '); ls_fir(p_ma->ma_calls); for (callno=1;callno<=no_calls;callno++) { p_mc_t p_mc; ls_nxt(p_ma->ma_calls,PPV &p_mc); as_cold(p_mc!=NULL,"wv_usage: Awk!"); wf_wr(&f_t,"mc_seq); wf_wr(&f_t,"\">"); wf_dec(&f_t,(ulong) p_mc->mc_seq); wf_wr(&f_t,""); if (callno < no_calls-1) wf_wr(&f_t,", "); else if (callno==no_calls-1) wf_wr(&f_t," and "); } wf_wl(&f_t,".
"); } /******************************************************************************/ LOCAL void wv_defin P_((p_ma_t,ulong)); LOCAL void wv_defin(p_ma,level) /* Just after each macro body part definition comes a note listing the */ /* containing the macro's body parts. This function weaves that list. */ p_ma_t p_ma; ulong level; { p_md_t p_md = &p_ma->ma_defn[level]; ulong no_parts = ls_len(p_md->md_body); ulong partno; /* If it's not an additive macro, we don't write anything. */ if (!p_md->md_isadd) return; wf_wr(&f_t,"This macro is defined in definitions "); ls_fir(p_md->md_body); for (partno=1;partno<=no_parts;partno++) { p_bp_t p_bp; ls_nxt(p_md->md_body,PPV &p_bp); as_cold(p_bp!=NULL,"wv_defin: Awk!"); wf_wr(&f_t,"bp_seq); wf_wr(&f_t,"\">"); wf_dec(&f_t,(ulong) p_bp->bp_seq); wf_wr(&f_t,""); if (partno
"); } /******************************************************************************/ LOCAL bool wv_fcall P_((p_ma_t)); LOCAL bool wv_fcall(p_ma) /* If the argument macro is called one or more times, writes out the first */ /* part of an anchor tag and returns TRUE. Otherwise writes nothing and */ /* returns FALSE. */ p_ma_t p_ma; { ulong no_calls = ls_len(p_ma->ma_calls); p_mc_t p_mc; if (no_calls==0) return FALSE; wf_wr(&f_t,"ma_calls); ls_nxt(p_ma->ma_calls,PPV &p_mc); as_cold(p_mc!=NULL,"wv_fcall: Awk!"); wf_dec(&f_t,(ulong) p_mc->mc_seq); wf_wr(&f_t,"\">"); return TRUE; } /******************************************************************************/ LOCAL void wv_dcma P_((p_dc_t)); LOCAL void wv_dcma(p_dc) /* Weaves a macro definition. */ p_dc_t p_dc; { p_bp_t p_bp; p_ma_t p_ma = p_dc->dc_p_ma; ulong level = p_dc->dc_mlev; p_md_t p_md = &p_ma->ma_defn[level]; /* Get a pointer to the body part. */ ls_loo(p_md->md_body,p_dc->dc_part,PPV &p_bp); /* Macro definition (except for content) is in red. */ wf_wl(&f_t,""); wf_wr(&f_t,"

bp_seq); wf_wr(&f_t,"\">"); /* Write out the macro's number. */ if (p_md->md_isfil) wf_wr(&f_t,""); wf_dec(&f_t,(ulong) p_bp->bp_seq); wf_wr(&f_t,". "); if (p_md->md_isfil) wf_wr(&f_t,"File: "); /* Write out the macro's name. If it is called, */ /* hyperlink it to the macro of its first call. */ { bool called = wv_fcall(p_ma); wv_ugstr(p_ma->ma_name,EOL_BR_NO); if (called) wf_wr(&f_t,""); } /* Write the formal parameter list. */ if (p_md->md_npar>0) { wf_wr(&f_t,"("); wf_dec(&f_t,(ulong) p_md->md_npar); wf_wr(&f_t,")"); } /* Zero and many options are indicated by bold letters. */ if ((p_md->md_iszer) || (p_md->md_isman) || (level > 0)) { ulong i; wf_wr(&f_t,"["); if (p_md->md_iszer) wf_wr(&f_t,"Z"); if (p_md->md_isman) wf_wr(&f_t,"M"); for (i=0; i]"); } /* Write the "equals". */ if (p_md->md_isadd) wf_wr(&f_t,"+="); else wf_wr(&f_t,"="); /* The opening brace. */ wf_wr(&f_t,"{"); /* Write out the macro in blue. */ wf_wr(&f_t,""); wv_ex(p_bp->bp_ex); wf_wr(&f_t,""); /* The closing brace. */ wf_wl(&f_t,"}
"); /* End of grey. Back to documentation colour. */ wf_wl(&f_t,"
"); /* After the macro definition, write out notes on the macro. */ wv_defin(p_ma,level); /* A list of the macro's body parts. */ wv_usage(p_ma,level); /* A list of where the macro is used. */ } /******************************************************************************/ LOCAL void wv_dc P_((p_dc_t)); LOCAL void wv_dc(p_dc) /* Weaves a document component (p_dc). */ p_dc_t p_dc; { switch (p_dc->dc_kind) { case DC_TEXT: if (!dc_is_white(p_dc)) { col_on(); wv_dctx(p_dc); } break; case DC_TYPE: wv_dcty(p_dc); break; case DC_MACR: col_off(); wv_dcma(p_dc); break; default : as_bomb("wv_dc: Case defaulted."); } } /******************************************************************************/ LOCAL void wv_docnt P_((void)); LOCAL void wv_docnt() /* Weaves the entire document. This functions and most functions above assume */ /* that the output stream f_t is prepared for writing. */ { /* Write the typeset header. */ wv_head(); ls_fir(document_list); literal=FALSE; in_col=FALSE; while (TRUE) { p_dc_t p_dc; ls_nxt(document_list,PPV &p_dc); if (p_dc == NULL) break; wv_dc(p_dc); } /* Make sure the column is off before finishing. */ col_off(); /* Write the typeset trailer. */ wv_tail(); } /******************************************************************************/ EXPORT void weaveh() /* Writes out the documentation file. */ { fn_t fn_tmp; /* Name of temporary file. */ fn_t fn_targ; /* Name of documentation file. */ bool renfil; /* Do we wish to rename output file? */ bool istarg; /* Does a target file already exist? */ /* Writing the documentation file differs from some other output files. With */ /* non critical files such as the listing file that are really just logs, */ /* generation of half a listing file is acceptable if not desirable. However */ /* in the case of the documentation file, it is very bad to generate half an */ /* output file; far better to generate none at all. For this reason, and */ /* also because of the presence of the D option (which prevents the writing */ /* of output files identical to existing files (to prevent MAKE */ /* propagations)) it is best to write a temporary file and then rename it. */ /* We shouldn't be here if the U option is off! */ as_cold(option.op_u_b,"weave: option.op_u_b==FALSE!"); /* Work out what the typeset file's name should be. */ strcpy(fn_targ,""); /* Start with an empty string. */ fn_ins(fn_targ,option.op_f_s); fn_ins(fn_targ,".html"); fn_ins(fn_targ,option.op_u_s); /* The temporary file has to inherit too, because the output directory may */ /* not be the default directory and some computers can't rename across */ /* directories (and we have to rename it later). */ strcpy(fn_tmp,fn_targ); fn_ins(fn_tmp,fn_temp()); /* Complain if the FunnelWeb file doesn't have typesetter = none or html. */ if ((tr_codes != TR_NONE) && (tr_codes != TR_HTML)) { sprintf(linet1,"Error generating HTML documentation file \"%s\".",&fn_targ[0]); wl_sjl(linet1); wl_sjl("To generate a HTML documentation file, the FunnelWeb input file"); wl_sjl("must either be typesetter-independent (the default) or HTML-dependent."); wl_sjl("However, this input file declares itself dependent on a non-HTML typesetter."); wl_sjl("See the \"@p typesetter\" pragma in the input file for more information."); goto severe; } /* Expand the macro to the temporary file. */ wf_ini(&f_t,TRUE); wf_ope(&f_t,fn_tmp); if (wf_err(&f_t)) { sprintf(linet1,"Error creating temporary HTML documentation file \"%s\".",&fn_tmp[0]); wl_sjl(linet1); (void) remove(fn_tmp); goto severe; } wv_docnt(); /* Make sure that there weren't any errors writing to the temporary file. */ if (wf_err(&f_t)) { sprintf(linet1,"Error writing to temporary HTML documentation file \"%s\".",&fn_tmp[0]); wl_sjl(linet1); (void) remove(fn_tmp); goto severe; } /* Close the temporary file. */ wf_clo(&f_t); if (wf_err(&f_t)) { sprintf(linet1,"Error closing temporary HTML documentation file \"%s\".",&fn_tmp[0]); wl_sjl(linet1); remove(fn_tmp); goto severe; } /* The rest of the code in this function copes with the renaming. */ /* By default, we wish to rename the temporary file. */ renfil=TRUE; /* Deal with any existing file of the target name. */ istarg=fexists(fn_targ); if (istarg && option.op_d_b) { /* A target already exists, and the D option is on. If the target is */ /* identical to the temporary, we can simply delete the temporary! */ char *errstr; bool same; errstr=eq_files(fn_tmp,fn_targ,&same); if (errstr != NULL) { wl_sjl("Error comparing temporary HTML file with previous HTML documentation file."); wl_sjl("(A comparison was attempted because the D option was turned on.)"); wl_sjl("Error from comparison routine was as follows (first=temp):"); wr_sjl(" ");wl_sjl(errstr); sprintf(linet1,"Temporary file name was \"%s\".",&fn_tmp[0]); wl_sjl(linet1); sprintf(linet1,"Output file name was \"%s\".",&fn_targ[0]); wl_sjl(linet1); wl_sjl("FunnelWeb will leave both files intact so you can look at them."); goto severe; } /* If the two files are the same, we can simply delete the temporary. */ if (same) { int status; status=remove(fn_tmp); if (status != REMOVE_S) { sprintf(linet1,"Error deleting (under +D option) temporary file \"%s\".",&fn_tmp[0]); wl_sjl(linet1); goto severe; } sprintf(linet1,"Deleted identical HTML documentation file \"%s\".",&fn_targ[0]); wl_sjl(linet1); renfil=FALSE; } } if (renfil) { int status; /* We need to delete any existing file of the target name. */ if (istarg) { status=remove(fn_targ); if (status != REMOVE_S) { sprintf(linet1,"Error deleting existing HTML documentation file \"%s\".",&fn_targ[0]); wl_sjl(linet1); goto severe; } } /* Rename the temporary file to the output file. */ status=rename(fn_tmp,fn_targ); if (status != RENAME_S) { wl_sjl("Error renaming temporary HTML documentation file to documentation file."); sprintf(linet1,"Temporary file name was \"%s\".",&fn_tmp[0]); wl_sjl(linet1); sprintf(linet1,"Output file name was \"%s\".",&fn_targ[0]); wl_sjl(linet1); wl_sjl("FunnelWeb will leave both files intact so you can look at them."); goto severe; } } /* Tell everyone that we have written an output file. */ sprintf(linet1,"Weave : Completed %s.",fn_nodir(&fn_targ[0])); wl_s(linet1); if (option.op_b7_b) sprintf(linet1,"Weave: Completed %s.",SUPPNAME); wl_j(linet1); wl_l(linet1); return; /* Jump here is a nasty file error occurs. */ severe: sprintf(linet1,"A problem occurred during the generation of HTML documentation file \"%s\".",&fn_targ[0]); wl_sjl(linet1); wl_sjl("S: Aborting..."); num_sev++; return; } /******************************************************************************/ &f_t,", "); else if (partno==no_parts-1) wf_wr(&f_t," and "); } wf_wl(&f_t,".

"); } /******************************************************************************/ LOCAL bool wv_fcall P_((p_ma_t)); LOCAL bool wv_fcall(p_ma) /* If the argufw_src/source/weaveh.h 644 0 0 4620 6716661077 10242 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. 08-May-1999 RNW Split weave.h into weaveh.h and weavet.h ##############################################################################*/ /******************************************************************************/ /* WEAVEH.H */ /******************************************************************************/ /* */ /* This package exports a single function "weaveh" that generates the */ /* HTML documentation file. */ /* */ /******************************************************************************/ #include "style.h" /******************************************************************************/ EXPORT void weaveh P_((void)); /******************************************************************************/ /* End of WEAVEH.H */ /******************************************************************************/ : wv_dcty(p_dc); break; case DC_MACR: col_off(); wv_dcma(p_dc); break; default : as_bomb(fw_src/source/weavet.c 644 0 0 76755 6716661077 10313 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. 08-May-1999 RNW Renamed from weave.c to weavet.c 08-May-1999 RNW Modified diagnostic messages to mention "TeX". 08-May-1999 RNW Added typesetter check. 09-May-1999 RNW Added support for library macros. ##############################################################################*/ /******************************************************************************/ /* WEAVE.C */ /******************************************************************************/ #include #include "style.h" #include "as.h" #include "data.h" #include "lister.h" #include "machin.h" #include "misc.h" #include "table.h" #include "texhead.h" #include "weavet.h" /* IMPORTANT WARNING: The Macintosh THINK C compiler sets up strings that */ /* start with \p or \P as PASCAL strings rather than C strings. So be very */ /* careful not to start any strings with \p or \P. */ /******************************************************************************/ LOCVAR wf_t f_t; /* Variable representing documentation file. */ LOCVAR bool literal; /* True if we are inside a literal @{. */ /******************************************************************************/ LOCAL void wv_ex P_((p_ells_t)); /******************************************************************************/ LOCAL char * fn_nodir P_((char *)); LOCAL char * fn_nodir (p) /* Given a pointer to a string, returns a pointer to the character just past */ /* the last occurrance of FN_DELIM, or a pointer to the start of the string */ /* if it does not occur. In other words, given a filename, return a pointer */ /* to the start of the name field. */ char *p; { char *q = strrchr(p,FN_DELIM); if (q==NULL) return p; else return q+1; } /******************************************************************************/ LOCAL void wf_dec P_((p_wf_t,ulong)); LOCAL void wf_dec(p_wf,n) /* Writes the unsigned number n to the specified output stream as a decimal. */ /* This function has been named wf_dec so that it can be moved to the wf */ /* package if it turns out to be popular. */ p_wf_t p_wf; ulong n; { char t[20]; sprintf(t,"%lu",n); wf_wr(p_wf,t); } /******************************************************************************/ LOCAL void wv_ugch P_((int)); LOCAL void wv_ugch(ch) /* WeaVe UGly CHaracter. */ /* Sometimes it is necessary to output text without causing the typesetting */ /* program (TeX) to interpret it as control sequences and generate errors. */ /* There are two ways of doing this. First, we can get the typesetter to do */ /* the work by making it less sensitive. This has been done with the */ /* typesetting of the main macro text. The other approach is to convert each */ /* offending character into the typesetter control sequence that will simply */ /* output the character. For example, in TeX, "$" becomes "\$". This function */ /* accepts a single character and writes out its safe equivalent. */ /* The term "ugly" is used to describe potentially harmful text/characters. */ int ch; { /* End of lines are the only non-printable allowed. */ if (ch==EOL) {wf_chr(&f_t,EOL); return;} /* All other non-printables result in a bullet. In the absence of bugs, the */ /* only way a non-printable can get to us here is as a result of the user */ /* explicitly inserting one using the scanner's @^ control sequence. */ if (!isascprn(ch)) { wf_wr(&f_t,"$\\bullet$"); return; } /* If it IS printable, then print it ... carefully! */ switch (ch) { /* Go through the printables in ASCII order. */ /* ' ': is an ordinary character. */ /* '!': is an ordinary character. */ case '\"': wf_wr(&f_t,"\\char`\\\""); break; case '#': wf_wr(&f_t,"\\#"); break; case '$': wf_wr(&f_t,"\\$"); break; /* Note: The string "\\%" triggers a unknown sequence "\%" in GNUC. */ case '%': wf_chr(&f_t,'\\'); wf_chr(&f_t,'%'); break; case '&': wf_wr(&f_t,"\\&"); break; /* ''': is an ordinary character. */ /* '(': is an ordinary character. */ /* ')': is an ordinary character. */ /* '*': is an ordinary character. */ /* '+': is an ordinary character. */ /* ',': is an ordinary character. */ /* '-': is an ordinary character. */ /* '.': is an ordinary character. */ /* '/': is an ordinary character. */ /* '0-9': are ordinary characters.*/ /* ':': is an ordinary character. */ /* ';': is an ordinary character. */ /* Note: Some \chars work well in roman. Others don't. */ case '<': if (literal) wf_wr(&f_t,"\\char`\\<"); else wf_wr(&f_t,"$<$"); break; /* '=': is an ordinary character. */ case '>': if (literal) wf_wr(&f_t,"\\char`\\>"); else wf_wr(&f_t,"$>$"); break; /* '?': is an ordinary character. */ /* '@': is an ordinary character. */ /* 'A-Z': are ordinary characters.*/ /* '[': is an ordinary character. */ case '\\': if (literal) wf_wr(&f_t,"\\char`\\\\"); else wf_wr(&f_t,"$\\backslash$"); break; /* ']': is an ordinary character. */ case '^': wf_wr(&f_t,"\\char`\\^"); break; case '_': wf_wr(&f_t,"\\_"); break; /* '`': is an ordinary character. */ /* 'a-z': are ordinary characters.*/ case '{': if (literal) wf_wr(&f_t,"\\char`\\{"); else wf_wr(&f_t,"$\\{$"); break; case '|': if (literal) wf_wr(&f_t,"\\char`\\|"); else wf_wr(&f_t,"$|$"); break; case '}': if (literal) wf_wr(&f_t,"\\char`\\}"); else wf_wr(&f_t,"$\\}$"); break; case '~': wf_wr(&f_t,"\\char`\\~"); break; default: wf_chr(&f_t,ch); break; } } /******************************************************************************/ LOCAL void wv_ugstr P_((char *)); LOCAL void wv_ugstr(s) /* Writes out a potentially ugly string. */ char *s; { while (*s != EOS) wv_ugch(*s++); } /******************************************************************************/ LOCAL void wv_ugsc P_((p_sc_t)); LOCAL void wv_ugsc(p_sc) /* Writes out a potentially ugly text scrap. */ p_sc_t p_sc; { char *p = p_sc->sc_first; char *p_last = p_sc->sc_last; while (p<=p_last) wv_ugch(*p++); } /******************************************************************************/ LOCAL void wv_ugscls P_((p_scls_t)); LOCAL void wv_ugscls(p_scls) /* This function writes the specified text list to the output stream. It */ /* writes it cleaning up all ugly characters. */ p_scls_t p_scls; { ls_fir(p_scls); while (TRUE) { p_sc_t p_sc; ls_nxt(p_scls,PPV &p_sc); if (p_sc==NULL) break; wv_ugsc(p_sc); } } /******************************************************************************/ LOCAL void wv_manm P_((p_ma_t,ulong)); LOCAL void wv_manm(p_ma,part) /* This function writes the specified macro name and number. */ /* The part number is the part to write out. */ p_ma_t p_ma; ulong part; { p_bp_t p_bp; p_md_t p_md = &p_ma->ma_defn[p_ma->ma_minlev]; if (p_md->md_isfil) wf_wr(&f_t,"\\fwfilename{"); else wf_wr(&f_t,"\\fwmacroname{"); wv_ugstr(p_ma->ma_name); wf_wr(&f_t,"}{"); ls_loo(p_md->md_body,part,PPV &p_bp); wf_dec(&f_t,(ulong) p_bp->bp_seq); wf_wr(&f_t,"}"); } /******************************************************************************/ LOCAL void wv_secnn P_((p_ty_t)); LOCAL void wv_secnn(p_ty) /* Write out the section number and name, each in curly braces. */ p_ty_t p_ty; { /* Write as arguments the section number and name. */ wf_chr(&f_t,'{'); sn_str(&p_ty->ty_sn,linet1); wf_wr(&f_t,linet1); wf_wr(&f_t,"}{"); wv_ugstr((string) p_ty->ty_pname); wf_chr(&f_t,'}'); } /******************************************************************************/ LOCAL void wv_echo P_((p_scls_t)); LOCAL void wv_echo(p_scls) /* This function writes the specified text list to the output stream. It */ /* writes it just as it is, with no modifications whatsoever. */ p_scls_t p_scls; { ls_fir(p_scls); while (TRUE) { p_sc_t p_sc; ls_nxt(p_scls,PPV &p_sc); if (p_sc==NULL) break; wf_blk(&f_t,p_sc->sc_first,(size_t) (p_sc->sc_last-p_sc->sc_first+1)); } } /******************************************************************************/ LOCAL void wv_verb P_((p_scls_t)); LOCAL void wv_verb(p_scls) /* Writes a text list verbetim, but brackets it with sequences that instruct */ /* the typesetter not to interpret the text in any special way. */ p_scls_t p_scls; { if (ls_len(p_scls) > 0) { wf_wr(&f_t,"\\fwbtx["); wv_echo(p_scls); wf_wl(&f_t,"]fwetx=%"); } } /******************************************************************************/ LOCAL void wv_head P_((void)); LOCAL void wv_head() { wf_wl(&f_t,""); wf_wl(&f_t,"%*******************************************************************************"); wf_wl(&f_t,"%* START OF AUTOMATICALLY GENERATED TEX FILE *"); wf_wl(&f_t,"%*******************************************************************************"); wf_wl(&f_t,"%* *"); wf_wl(&f_t,"%* This TeX file was automatically generated by the FunnelWeb preprocessor. *"); wf_wl(&f_t,"%* You can typeset this file to produce printed documentation by running it *"); wf_wl(&f_t,"%* through the TeX typesetter using a command such as: *"); wf_wl(&f_t,"%* tex thisfilename *"); wf_wl(&f_t,"%* The resultant file thisfilename.dvi can be printed using a command such as: *"); wf_wl(&f_t,"%* lpr -Plaser -d thisfilename.dvi *"); wf_wl(&f_t,"%* *"); wf_wl(&f_t,"%* FunnelWeb is a preprocessor that allows programmers to weave programs and *"); wf_wl(&f_t,"%* their documentation together in a single document. The FunnelWeb program *"); wf_wl(&f_t,"%* analyses such documents producing both program files and typeset *"); wf_wl(&f_t,"%* documentation such as this TeX file. *"); wf_wl(&f_t,"%* FunnelWeb was created by Ross N. Williams. *"); wf_wl(&f_t,"%* *"); wf_wl(&f_t,"%* For more information on FunnelWeb see http://www.ross.net/funnelweb/ *"); wf_wl(&f_t,"%* *"); wf_wl(&f_t,"%*******************************************************************************"); wf_wl(&f_t,""); wf_wl(&f_t,""); } /******************************************************************************/ LOCAL void wv_tail P_((void)); LOCAL void wv_tail() { wf_wl(&f_t,""); wf_wl(&f_t,""); wf_wl(&f_t,"%*******************************************************************************"); wf_wl(&f_t,"%* END OF AUTOMATICALLY GENERATED TEX FILE *"); wf_wl(&f_t,"%*******************************************************************************"); wf_wl(&f_t,""); } /******************************************************************************/ LOCAL void wv_nsec P_((p_ty_t)); LOCAL void wv_nsec(p_ty) /* Weaves the start of a new section. */ p_ty_t p_ty; { as_cold(p_ty->ty_kind==TY_NSEC,"wv_nsec: Not a section!"); /* Work out what kind of section macro should be used. */ switch (sn_lev(&p_ty->ty_sn)) { case 1: wf_wr(&f_t,"\\fwseca"); break; case 2: wf_wr(&f_t,"\\fwsecb"); break; case 3: wf_wr(&f_t,"\\fwsecc"); break; case 4: wf_wr(&f_t,"\\fwsecd"); break; case 5: wf_wr(&f_t,"\\fwsece"); break; default: as_bomb("wv_nsec:case defaulted."); } /* Write out the section number and name. */ wv_secnn(p_ty); } /******************************************************************************/ LOCAL void wv_olit P_((p_ty_t)); LOCAL void wv_olit(p_ty) p_ty_t p_ty; { as_cold(p_ty->ty_kind==TY_OLIT,"wv_olit: Not an open literal!"); wf_wr(&f_t,"\\fwlit{"); literal=TRUE; } /******************************************************************************/ LOCAL void wv_clit P_((p_ty_t)); LOCAL void wv_clit(p_ty) p_ty_t p_ty; { as_cold(p_ty->ty_kind==TY_CLIT,"wv_clit: Not a close literal!"); wf_wr(&f_t,"}"); literal=FALSE; } /******************************************************************************/ LOCAL void wv_oemp P_((p_ty_t)); LOCAL void wv_oemp(p_ty) p_ty_t p_ty; { as_cold(p_ty->ty_kind==TY_OEMP,"wv_oemp: Not an open emphasize!"); wf_wr(&f_t,"\\fwemp{"); } /******************************************************************************/ LOCAL void wv_cemp P_((p_ty_t)); LOCAL void wv_cemp(p_ty) p_ty_t p_ty; { as_cold(p_ty->ty_kind==TY_CEMP,"wv_cemp: Not a close emphasize!"); wf_wr(&f_t,"}"); } /******************************************************************************/ LOCAL void wv_npag P_((p_ty_t)); LOCAL void wv_npag(p_ty) p_ty_t p_ty; { as_cold(p_ty->ty_kind==TY_NPAG,"wv_npag: Not a new page!"); wf_wl(&f_t,""); wf_wl(&f_t,"\\fwnewpage"); wf_wl(&f_t,""); } /******************************************************************************/ LOCAL void wv_tocs P_((p_ty_t)); LOCAL void wv_tocs(p_ty) /* Writes a table of contents to the weave output file. */ p_ty_t p_ty; { /* We need to save the document list position as the rest of the weaver is */ /* in the process of traversing it!!! */ p_void p_mark = ls_mar(document_list); as_cold(p_ty->ty_kind==TY_TOCS,"wv_tocs: Not a table of contents!"); wf_wl(&f_t,""); wf_wl(&f_t,"\\fwtocstart{}"); ls_fir(document_list); while (TRUE) { p_dc_t p_dc; ls_nxt(document_list,PPV &p_dc); if (p_dc == NULL) break; if (p_dc->dc_kind==DC_TYPE && p_dc->dc_pty->ty_kind==TY_NSEC) { switch(sn_lev(&p_dc->dc_pty->ty_sn)) { case 1: wf_wr(&f_t,"\\fwtoca"); break; case 2: wf_wr(&f_t,"\\fwtocb"); break; case 3: wf_wr(&f_t,"\\fwtocc"); break; case 4: wf_wr(&f_t,"\\fwtocd"); break; case 5: wf_wr(&f_t,"\\fwtoce"); break; default: as_bomb("wv_toc: switch defaulted."); } wv_secnn(p_dc->dc_pty); wf_wl(&f_t,""); } } wf_wl(&f_t,"\\fwtocfinish{}"); wf_wl(&f_t,""); /* Restore the document list position. */ ls_set(document_list,p_mark); } /******************************************************************************/ LOCAL void wv_skip P_((p_ty_t)); LOCAL void wv_skip(p_ty) /* Writes a vertical space to the output file. */ p_ty_t p_ty; { as_cold(p_ty->ty_kind==TY_SKIP,"wv_skip: Not a skip directive!"); sprintf(linet1,"\\fwvskip{%lu}",(ulong) p_ty->ty_mm); wf_wl(&f_t,linet1); } /******************************************************************************/ LOCAL void wv_titl P_((p_ty_t)); LOCAL void wv_titl(p_ty) /* Writes a title line to the output file. */ p_ty_t p_ty; { as_cold(p_ty->ty_kind==TY_TITL,"wv_titl: Not a title!"); switch(p_ty->ty_align) { case LR_LEFT: wf_wr(&f_t,"\\fwleftline{"); break; case LR_RIGH: wf_wr(&f_t,"\\fwrightline{"); break; case LR_CENT: wf_wr(&f_t,"\\fwcenterline{"); break; default: as_bomb("wv_title: Alignment switch defaulted."); } switch(p_ty->ty_font) { case FT_NORM: wf_wr(&f_t,"\\fwfontnormal{"); break; case FT_TITL: wf_wr(&f_t,"\\fwfonttitle{"); break; case FT_STIT: wf_wr(&f_t,"\\fwfontsmalltitle{"); break; default: as_bomb("wv_title: Font switch defaulted."); } wv_ugsc(&p_ty->ty_sc); wf_wl(&f_t,"}}"); } /******************************************************************************/ LOCAL void wv_dcty P_((p_dc_t)); LOCAL void wv_dcty(p_dc) /* Weaves a document typesetter element. */ p_dc_t p_dc; { p_ty_t p_ty = p_dc->dc_pty; as_cold(p_dc->dc_kind==DC_TYPE,"wv_dcty: Not a typesetter component!"); switch (p_ty->ty_kind) { case TY_NSEC: wv_nsec(p_ty); break; case TY_OLIT: wv_olit(p_ty); break; case TY_CLIT: wv_clit(p_ty); break; case TY_OEMP: wv_oemp(p_ty); break; case TY_CEMP: wv_cemp(p_ty); break; case TY_NPAG: wv_npag(p_ty); break; case TY_TOCS: wv_tocs(p_ty); break; case TY_SKIP: wv_skip(p_ty); break; case TY_TITL: wv_titl(p_ty); break; default : as_bomb("wv_dcty: Switch defaulted."); } } /******************************************************************************/ LOCAL void wv_dctx P_((p_dc_t)); LOCAL void wv_dctx(p_dc) /* Write out a document text item. */ p_dc_t p_dc; { as_cold(p_dc->dc_kind==DC_TEXT,"wv_dctx: Not text."); if (literal || tr_codes==TR_NONE) wv_ugscls(p_dc->dc_text); else wv_echo(p_dc->dc_text); } /******************************************************************************/ LOCAL void wv_eltx P_((p_el_t)); LOCAL void wv_eltx(p_el) /* Weaves a text element. */ p_el_t p_el; { as_cold(p_el->el_kind==EL_TEXT,"wv_eltx: Not text."); wv_verb(p_el->el_text); } /******************************************************************************/ LOCAL void wv_elin P_((p_el_t)); LOCAL void wv_elin(p_el) /* Weaves a invocation element. */ p_el_t p_el; { as_cold(p_el->el_kind==EL_INVC,"wv_elin: Not an invocation."); /* Write out the macro call proper. */ wv_manm(p_el->el_p_mac,1L); /* Write out the actual parameter list, if any. */ if (ls_len(p_el->el_parls) > 0) { ulong parnum; wf_wr(&f_t,"\\fwoparen "); ls_fir(p_el->el_parls); /* List of actual parameter expressions. */ ls_fir(p_el->el_pretx); /* List of crud before each expression. */ ls_fir(p_el->el_postx); /* List of crud after each expression. */ parnum=1; while (TRUE) { p_ells_t *pp_exp; p_scls_t *pp_scls1; p_scls_t *pp_scls2; ls_nxt(p_el->el_parls,PPV &pp_exp); ls_nxt(p_el->el_pretx,PPV &pp_scls1); ls_nxt(p_el->el_postx,PPV &pp_scls2); if (pp_exp==NULL) break; if (parnum++>1) wf_wr(&f_t,"\\fwcomma "); wv_verb(*pp_scls1); wf_wr(&f_t,"\\fwoquote"); wv_ex(*pp_exp); wf_wr(&f_t,"\\fwcquote"); wv_verb(*pp_scls2); } wf_wr(&f_t,"\\fwcparen "); } } /******************************************************************************/ LOCAL void wv_elpr P_((p_el_t)); LOCAL void wv_elpr(p_el) /* Weaves a parameter element. */ p_el_t p_el; { as_cold(p_el->el_kind==EL_PARM,"wv_elpr: Not a parameter."); wf_wr (&f_t,"\\fwparam{"); wf_dec(&f_t,(ulong) p_el->el_parno); wf_wr (&f_t,"}"); } /******************************************************************************/ LOCAL void wv_ex(p_exp) /* Weaves a expression. */ p_ells_t p_exp; { ls_fir(p_exp); while (TRUE) { p_el_t p_el; ls_nxt(p_exp,PPV &p_el); if (p_el==NULL) break; switch (p_el->el_kind) { case EL_TEXT: wv_eltx(p_el); break; case EL_INVC: wv_elin(p_el); break; case EL_PARM: wv_elpr(p_el); break; default: as_bomb("wv_ex: Case defaulted."); } } } /******************************************************************************/ LOCAL void wv_usage P_((p_ma_t,ulong)); LOCAL void wv_usage(p_ma,level) /* Weaves a list of all the sections in which the specified macro is used. */ p_ma_t p_ma; ulong level; { p_md_t p_md = &p_ma->ma_defn[p_ma->ma_minlev]; ulong no_calls = ls_len(p_ma->ma_calls); ulong callno; /* If it is a file macro then it is not allowed to be called. */ if (p_md->md_isfil) { wf_wl(&f_t,"\\fwisafile{This macro is attached to an output file.}"); return; } if (p_ma->ma_minlev < level) { p_bp_t p_bp; p_md_t p_md2 = &p_ma->ma_defn[p_ma->ma_minlev]; ls_loo(p_md2->md_body,1L,PPV &p_bp); wf_wl(&f_t,"\\fwusedin{This library macro was overruled by definition "); wf_dec(&f_t,(ulong) p_bp->bp_seq); wf_wl(&f_t," and is not active.}"); return; } if (no_calls==0) { wf_wl(&f_t,"\\fwusedin{This macro is NEVER invoked.}"); return; } wf_wr(&f_t,"\\fwusedin{This macro is invoked in definition"); if (no_calls>1) wf_chr(&f_t,'s'); wf_chr(&f_t,' '); ls_fir(p_ma->ma_calls); for (callno=1;callno<=no_calls;callno++) { p_mc_t p_mc; ls_nxt(p_ma->ma_calls,PPV &p_mc); as_cold(p_mc!=NULL,"wv_usage: Awk!"); wf_dec(&f_t,(ulong) p_mc->mc_seq); if (callno < no_calls-1) wf_wr(&f_t,", "); else if (callno==no_calls-1) wf_wr(&f_t," and "); } wf_wl(&f_t,".}"); } /******************************************************************************/ LOCAL void wv_defin P_((p_ma_t,ulong)); LOCAL void wv_defin(p_ma,level) /* Just after each macro body part definition comes a note listing the */ /* containing the macro's body parts. This function weaves that list. */ p_ma_t p_ma; ulong level; { p_md_t p_md = &p_ma->ma_defn[level]; ulong no_parts = ls_len(p_md->md_body); ulong partno; /* If it's not an additive macro, we don't write anything. */ if (!p_md->md_isadd) return; wf_wr(&f_t,"\\fwseealso{This macro is defined in definitions "); ls_fir(p_md->md_body); for (partno=1;partno<=no_parts;partno++) { p_bp_t p_bp; ls_nxt(p_md->md_body,PPV &p_bp); as_cold(p_bp!=NULL,"wv_defin: Awk!"); wf_dec(&f_t,(ulong) p_bp->bp_seq); if (partnodc_p_ma; ulong level = p_dc->dc_mlev; p_md_t p_md = &p_ma->ma_defn[level]; /* Macro calls sandwich the definition itsef. */ wf_wl(&f_t,"\\fwbeginmacro"); /* Write out the macro's name. */ wv_manm(p_ma,p_dc->dc_part); /* Write the formal parameter list. */ if (p_md->md_npar>0) { wf_wr(&f_t,"\\fwparams{"); wf_dec(&f_t,(ulong) p_md->md_npar); wf_wr(&f_t,"}"); } /* Zero and many options are indicated by bold letters. */ { ulong i; if (p_md->md_iszer) wf_wr(&f_t,"\\fwzero{}"); if (p_md->md_isman) wf_wr(&f_t,"\\fwmany{}"); for (i=0; imd_isadd) wf_wr(&f_t,"\\fwplusequals "); else wf_wr(&f_t,"\\fwequals "); /* Write out this particular body part. */ ls_loo(p_md->md_body,p_dc->dc_part,PPV &p_bp); wf_wr(&f_t,"\\fwodef "); wv_ex(p_bp->bp_ex); wf_wl(&f_t,"\\fwcdef "); /* After the macro definition, write out notes on the macro. */ wf_wl(&f_t,"\\fwbeginmacronotes"); wv_defin(p_dc->dc_p_ma,level); /* A list of the macro's body parts. */ wv_usage(p_dc->dc_p_ma,level); /* A list of where the macro is used. */ wf_wl(&f_t,"\\fwendmacronotes"); /* The macro definition is sandwiched by macro calls. */ wf_wl(&f_t,"\\fwendmacro"); } /******************************************************************************/ LOCAL void wv_dc P_((p_dc_t)); LOCAL void wv_dc(p_dc) /* Weaves a document component (p_dc). */ p_dc_t p_dc; { switch (p_dc->dc_kind) { case DC_TEXT: wv_dctx(p_dc); break; case DC_TYPE: wv_dcty(p_dc); break; case DC_MACR: wv_dcma(p_dc); break; default : as_bomb("wv_dc: Case defaulted."); } } /******************************************************************************/ LOCAL void wv_docnt P_((void)); LOCAL void wv_docnt() /* Weaves the entire document. This functions and most functions above assume */ /* that the output stream f_t is prepared for writing. */ { /* Write the typeset header. */ wv_head(); /* Writes the library macros. */ tex_head(&f_t); ls_fir(document_list); literal=FALSE; while (TRUE) { p_dc_t p_dc; ls_nxt(document_list,PPV &p_dc); if (p_dc == NULL) break; wv_dc(p_dc); } wf_wl(&f_t,"\\bye"); /* Write the typeset trailer. */ wv_tail(); } /******************************************************************************/ EXPORT void weavet() /* Writes out the documentation file. */ { fn_t fn_tmp; /* Name of temporary file. */ fn_t fn_targ; /* Name of documentation file. */ bool renfil; /* Do we wish to rename output file? */ bool istarg; /* Does a target file already exist? */ /* Writing the documentation file differs from some other output files. With */ /* non critical files such as the listing file that are really just logs, */ /* generation of half a listing file is acceptable if not desirable. However */ /* in the case of the documentation file, it is very bad to generate half an */ /* output file; far better to generate none at all. For this reason, and */ /* also because of the presence of the D option (which prevents the writing */ /* of output files identical to existing files (to prevent MAKE */ /* propagations)) it is best to write a temporary file and then rename it. */ /* We shouldn't be here if the weave option is off! */ as_cold(option.op_t_b,"weave: option.op_t_b==FALSE!"); /* Work out what the typeset file's name should be. */ strcpy(fn_targ,""); /* Start with an empty string. */ fn_ins(fn_targ,option.op_f_s); fn_ins(fn_targ,".tex"); fn_ins(fn_targ,option.op_t_s); /* The temporary file has to inherit too, because the output directory may */ /* not be the default directory and some computers can't rename across */ /* directories (and we have to rename it later). */ strcpy(fn_tmp,fn_targ); fn_ins(fn_tmp,fn_temp()); /* Complain if the FunnelWeb file doesn't have typesetter = none or tex. */ if ((tr_codes != TR_NONE) && (tr_codes != TR_TEX)) { sprintf(linet1,"Error generating TeX documentation file \"%s\".",&fn_targ[0]); wl_sjl(linet1); wl_sjl("To generate a TeX documentation file, the FunnelWeb input file"); wl_sjl("must either be typesetter-independent (the default) or TeX-dependent."); wl_sjl("However, this input file declares itself dependent on a non-TeX typesetter."); wl_sjl("See the \"@p typesetter\" pragma in the input file for more information."); goto severe; } /* Expand the macro to the temporary file. */ wf_ini(&f_t,TRUE); wf_ope(&f_t,fn_tmp); if (wf_err(&f_t)) { sprintf(linet1,"Error creating temporary TeX documentation file \"%s\".",&fn_tmp[0]); wl_sjl(linet1); (void) remove(fn_tmp); goto severe; } wv_docnt(); /* Make sure that there weren't any errors writing to the temporary file. */ if (wf_err(&f_t)) { sprintf(linet1,"Error writing to temporary TeX documentation file \"%s\".",&fn_tmp[0]); wl_sjl(linet1); (void) remove(fn_tmp); goto severe; } /* Close the temporary file. */ wf_clo(&f_t); if (wf_err(&f_t)) { sprintf(linet1,"Error closing temporary TeX documentation file \"%s\".",&fn_tmp[0]); wl_sjl(linet1); remove(fn_tmp); goto severe; } /* The rest of the code in this function copes with the renaming. */ /* By default, we wish to rename the temporary file. */ renfil=TRUE; /* Deal with any existing file of the target name. */ istarg=fexists(fn_targ); if (istarg && option.op_d_b) { /* A target already exists, and the D option is on. If the target is */ /* identical to the temporary, we can simply delete the temporary! */ char *errstr; bool same; errstr=eq_files(fn_tmp,fn_targ,&same); if (errstr != NULL) { wl_sjl("Error comparing temporary TeX file with previous documentation file."); wl_sjl("(A comparison was attempted because the D option was turned on.)"); wl_sjl("Error from comparison routine was as follows (first=temp):"); wr_sjl(" ");wl_sjl(errstr); sprintf(linet1,"Temporary file name was \"%s\".",&fn_tmp[0]); wl_sjl(linet1); sprintf(linet1,"Output file name was \"%s\".",&fn_targ[0]); wl_sjl(linet1); wl_sjl("FunnelWeb will leave both files intact so you can look at them."); goto severe; } /* If the two files are the same, we can simply delete the temporary. */ if (same) { int status; status=remove(fn_tmp); if (status != REMOVE_S) { sprintf(linet1,"Error deleting (under +D option) temporary file \"%s\".",&fn_tmp[0]); wl_sjl(linet1); goto severe; } sprintf(linet1,"Deleted identical TeX documentation file \"%s\".",&fn_targ[0]); wl_sjl(linet1); renfil=FALSE; } } if (renfil) { int status; /* We need to delete any existing file of the target name. */ if (istarg) { status=remove(fn_targ); if (status != REMOVE_S) { sprintf(linet1,"Error deleting existing TeX documentation file \"%s\".",&fn_targ[0]); wl_sjl(linet1); goto severe; } } /* Rename the temporary file to the output file. */ status=rename(fn_tmp,fn_targ); if (status != RENAME_S) { wl_sjl("Error renaming temporary TeX documentation file to documentation file."); sprintf(linet1,"Temporary file name was \"%s\".",&fn_tmp[0]); wl_sjl(linet1); sprintf(linet1,"Output file name was \"%s\".",&fn_targ[0]); wl_sjl(linet1); wl_sjl("FunnelWeb will leave both files intact so you can look at them."); goto severe; } } /* Tell everyone that we have written an output file. */ sprintf(linet1,"Weave : Completed %s.",fn_nodir(&fn_targ[0])); wl_s(linet1); if (option.op_b7_b) sprintf(linet1,"Weave: Completed %s.",SUPPNAME); wl_j(linet1); wl_l(linet1); return; /* Jump here is a nasty file error occurs. */ severe: sprintf(linet1,"A problem occurred during the generation of TeX documentation file \"%s\".",&fn_targ[0]); wl_sjl(linet1); wl_sjl("S: Aborting..."); num_sev++; return; } /******************************************************************************/ usedin{This macro ifw_src/source/weavet.h 644 0 0 4620 6716661101 10242 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. 08-May-1999 RNW Split weave.h into weaveh.h and weavet.h ##############################################################################*/ /******************************************************************************/ /* WEAVET.H */ /******************************************************************************/ /* */ /* This package exports a single function "weavet" that generates the TeX */ /* documentation file. */ /* */ /******************************************************************************/ #include "style.h" /******************************************************************************/ EXPORT void weavet P_((void)); /******************************************************************************/ /* End of WEAVET.H */ /******************************************************************************/ f_t,"\\fwendmacro"); } /******************************************************************************/ LOCAL fw_src/source/writfile.c 644 0 0 25014 6716661102 10610 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. 08-May-1999 RNW Added function wf_dup. ##############################################################################*/ /******************************************************************************/ /* WRITFILE.C */ /******************************************************************************/ /* */ /* Implementation Notes */ /* -------------------- */ /* The .H file gives most of the details of what this package does. Here we */ /* just give some notes on how it is implemented. */ /* */ /* MAGIC NUMBERS: These are placed at the head and tail of wf_t records so as */ /* to assist in the detection of uninitialized or corrupted variables. */ /* */ /* TEXT VS BINARY: A big problem arises in choosing whether to write binary */ /* or text files. Binary files are far faster because they allow us to write */ /* out large slabs of text using fwrite. The only catch is that they do not */ /* translate EOL characters in the end of line representation of the host */ /* environment. Text files, on the other hand are slower (because we have */ /* only fputc and fputs) but do provide the translation. The solution we */ /* adopt is to use binary if the host environment's representation for end of */ /* file is EOL (='\n'), but text otherwise. We can determine this by testing */ /* the symbol UNIX_EOL defined in machin.h. If binary output is chosen, */ /* only fwrite is called as we don't know if fwrite and fputc calls can be */ /* mixed (it would seem not). */ /* Note: We could test the preprocessor symbol in each function. However, */ /* the wf_att function introduces a problem as we may be attaching to a text */ /* file in a UNIX_EOL environment (e.g. stdout). So we make the text/binary */ /* attribute and attribute of each file, rather than the environment which we */ /* use only to direct us in how to create and tag (as binary or text) a file. */ /* */ /******************************************************************************/ #include "style.h" #include "as.h" #include "machin.h" #include "writfile.h" /******************************************************************************/ #define MGC_HEAD (4837295L) #define MGC_TAIL (1213839L) /* Set the following to TRUE to bomb the package upon the first error. */ /* This is a good idea during debugging if no output appears. */ #define BOMB_ON_ERROR FALSE /******************************************************************************/ LOCAL void wf_check P_((p_wf_t)); LOCAL void wf_check(p_wf) p_wf_t p_wf; { as_cold(p_wf!=NULL,"wf_check: p_wf==NULL."); as_cold(p_wf->wf_mhead==MGC_HEAD, "wf_check: Magic header field has non-magic value."); as_cold(p_wf->wf_mtail==MGC_TAIL, "wf_check: Magic trailer field has non-magic value."); as_cold(p_wf->wf_isope || p_wf->wf_pfile==NULL, "wf_check: WF is closed but wf_pfile!=NULL."); } /******************************************************************************/ LOCAL void wf_errlg P_((p_wf_t, char *)); LOCAL void wf_errlg(p_wf,mess) /* This function is called whenever an error occurs on a stream. The main */ /* responsibility of this function is to set the error flag in the stream. */ /* However, it can do other stuff too such as log the error to the screen. */ p_wf_t p_wf; char *mess; { p_wf->wf_iserr=TRUE; #if BOMB_ON_ERROR if (p_wf->wf_pfile == stdout) fprintf(stderr,"The output file error occurred on STANDARD OUTPUT.\n"); else fprintf(stderr,"The output file error occurred on an ordinary file.\n"); as_bomb(mess); #endif } /******************************************************************************/ EXPORT void wf_ini(p_wf,normal) p_wf_t p_wf; bool normal; { p_wf->wf_mhead = MGC_HEAD; p_wf->wf_iserr = !normal; p_wf->wf_isope = FALSE; p_wf->wf_istxt = FALSE; p_wf->wf_pfile = NULL; p_wf->wf_mtail = MGC_TAIL; } /******************************************************************************/ EXPORT void wf_att(p_wf,wf_pfile) p_wf_t p_wf; FILE *wf_pfile; { wf_check(p_wf); if (p_wf->wf_iserr) return; as_cold(!p_wf->wf_isope,"wf_att: WF is already open."); p_wf->wf_pfile = wf_pfile; p_wf->wf_isope = TRUE; p_wf->wf_istxt = TRUE; /* Play it safe with files we didn't open. */ wf_check(p_wf); } /******************************************************************************/ EXPORT void wf_ope(p_wf,p_name) p_wf_t p_wf; char *p_name; { FILE *result; wf_check(p_wf); if (p_wf->wf_iserr) return; as_cold(!p_wf->wf_isope,"wf_ope: WF is already open."); /* Whether we open the file as text or binary depends on whether EOL maps */ /* to an end of line in the current environment. */ #if UNIX_EOL result=fopen(p_name,"wb"); p_wf->wf_istxt=FALSE; #else result=fopen(p_name,"w"); p_wf->wf_istxt=TRUE; #endif if (result == FOPEN_F) { /* TRACE printf("Output file in error is \"%s\".\n",p_name); */ wf_errlg(p_wf,"wf_ope: Error opening output file."); } else {p_wf->wf_isope=TRUE; p_wf->wf_pfile=result;} wf_check(p_wf); } /******************************************************************************/ EXPORT void wf_chr(p_wf,ch) p_wf_t p_wf; intchar ch; { wf_check(p_wf); if ( p_wf->wf_iserr) return; as_cold(p_wf->wf_isope,"wf_chr: WF is closed."); if (p_wf->wf_istxt) { if (fputc((int) ch,p_wf->wf_pfile) == FPUTC_F) wf_errlg(p_wf,"wf_chr: Error fputc()ing to output file."); } else { if (fwrite(&ch,(size_t) 1,(size_t) 1,p_wf->wf_pfile) != 1) wf_errlg(p_wf,"wf_chr: Error fwrite()ing to output file."); } wf_check(p_wf); } /******************************************************************************/ EXPORT void wf_wr(p_wf,p_str) p_wf_t p_wf; char *p_str; { wf_check(p_wf); if ( p_wf->wf_iserr) return; as_cold(p_wf->wf_isope,"wf_wr: WF is closed."); if (p_wf->wf_istxt) { if (fputs(p_str,p_wf->wf_pfile) == FPUTS_F) wf_errlg(p_wf,"wf_wr: Error fputs()ing to output file."); } else { size_t len = strlen(p_str); if (fwrite(p_str,(size_t) 1,(size_t) len,p_wf->wf_pfile) != len) wf_errlg(p_wf,"wf_wr: Error fwrite()ing to output file."); } wf_check(p_wf); } /******************************************************************************/ EXPORT void wf_blk(p_wf,p_blk,blk_len) p_wf_t p_wf; char *p_blk; size_t blk_len; { wf_check(p_wf); if ( p_wf->wf_iserr) return; as_cold(p_wf->wf_isope,"wf_blk: WF is closed."); if (p_wf->wf_istxt) { /* Amazingly, fputc seems to be the only way to write out a block of */ /* bytes with end of line translation. Shocking, but true. */ /* See Section B1.4 (p.246-247) of Kernighan and Ritchie. */ /* Note: We can't use fputs because that requires a terminating nul. */ char *p; char *p_post = p_blk+blk_len; for (p=p_blk; pwf_pfile) == FPUTC_F) { wf_errlg(p_wf,"wf_blk: Error fputc()ing to output file."); break; } } else if (fwrite(p_blk,(size_t) 1,(size_t) blk_len,p_wf->wf_pfile) != blk_len) wf_errlg(p_wf,"wf_blk: Error fwrite()ing to output file."); wf_check(p_wf); } /******************************************************************************/ EXPORT void wf_wl(p_wf,p_str) p_wf_t p_wf; char *p_str; { wf_wr(p_wf,p_str); wf_chr(p_wf,'\n'); } /******************************************************************************/ EXPORT void wf_dup (p_wf,ch,count) p_wf_t p_wf; intchar ch; ulong count; { /* 08-May-1999 RNW: This function is used by the lister. */ /* It needs to run reasonably fast, so I've coded it using blocks. */ #define DUPBUFLEN 200 STAVAR char buffer[DUPBUFLEN+1]; ulong rem = count; as_cold(ch != EOS,"wf_dup: NUL arg."); while (rem > 0) { ulong t = rem; if (t > DUPBUFLEN) t=DUPBUFLEN; memset(buffer,ch,(size_t) t); buffer[t]=EOS; wf_wr(p_wf,buffer); rem -= t; } } /******************************************************************************/ EXPORT void wf_clo(p_wf) p_wf_t p_wf; { wf_check(p_wf); if ( p_wf->wf_iserr) return; as_cold(p_wf->wf_isope,"wf_clo: WF is not open."); if (fflush(p_wf->wf_pfile) != FFLUSH_S) wf_errlg(p_wf,"wf_clo: Error fflush()ing output file."); if (fclose(p_wf->wf_pfile) == FCLOSE_F) wf_errlg(p_wf,"wf_clo: Error fclose()ing output file."); p_wf->wf_isope=FALSE; p_wf->wf_pfile=NULL; wf_check(p_wf); } /******************************************************************************/ EXPORT bool wf_err(p_wf) p_wf_t p_wf; { wf_check(p_wf); return p_wf->wf_iserr; } /******************************************************************************/ /* End of WRITFILE.C */ /******************************************************************************/ ed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of thfw_src/source/writfile.h 644 0 0 26354 6716661103 10626 /*############################################################################## FUNNNELWEB COPYRIGHT ==================== FunnelWeb is a literate-programming macro preprocessor. The FunnelWeb web is at http://www.ross.net/funnelweb/ Copyright (c) Ross N. Williams 1992. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of Version 2 of the GNU General Public License as published by the Free Software Foundation (http://www.gnu.org/). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See Version 2 of the GNU General Public License for more details. You should have received a copy of Version 2 of the GNU General Public License along with this program. If not, you can obtain a copy as follows: ftp://prep.ai.mit.edu/pub/gnu/COPYING-2.0 or write to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Section 2a of the license requires that all changes to this file be recorded prominently in this file. Please record all changes here. Programmers: RNW Ross N. Williams (ross@ross.net) Changes: 07-May-1992 RNW Program prepared for release under GNU GPL V2. 08-May-1999 RNW Added function wr_dup. ##############################################################################*/ /******************************************************************************/ /* WRITFILE.H */ /******************************************************************************/ /* */ /* Introduction */ /* ------------ */ /* This package performs all of FunnelWeb's file output. */ /* FunnelWeb performs lots of output to lots of different files: */ /* */ /* - Standard output (to write to the screen). */ /* - The journal file. */ /* - The listing file. */ /* - The tangle output files. */ /* - The weave output file. */ /* */ /* Error Detection */ /* --------------- */ /* As we are serious about detecting errors, every call to every IO function */ /* must have its status checked. Unfortunately this makes everything very */ /* messy. Having to check result statuses and react to them can be very */ /* awkward in deeply nested pieces of code, particularly as C does not have */ /* exceptions. As a result, the policy adopted in FunnelWeb is to RECORD when */ /* an error occurs on an output stream and silently shut down that stream. */ /* Then later, at a convenient time, the error status of the stream can be */ /* checked, and an error message issued. */ /* */ /* The C libraries make an effort to be helpful here by providing the ferror */ /* function. However, it is not useful here for two reasons: */ /* */ /* 1. Some calls (e.g. fwrite) are not listed as setting the error status. */ /* 2. It is not guaranteed that IO calls to a stream with error status */ /* will not cause a crash. */ /* 3. Even if ferror were used, it may not be supported by older compilers.*/ /* */ /* This package was created to take care of the vexing problems of IO errors */ /* in output streams. It is a layer above the ANSI file library that provides */ /* the elementary calls for writing. It differs in that if an error occurs, */ /* the package records that fact and simply ignores all further operations */ /* on the file. At any time, it is possible to find out whether a file is in */ /* normal mode or error mode. All this means that a piece of code can use */ /* this package to create and write to a file without worrying about errors. */ /* Then later, when the dust settles, the package can check the status of */ /* the file, and take appropriate action if an error has been detected. */ /* */ /* Text vs Binary */ /* -------------- */ /* This package translates all '\n' (contained in the data it has been given */ /* to write) into the appropriate environment specific representation. */ /* */ /* Facts About WF Objects */ /* ---------------------- */ /* - A WF object is either in NORMAL or ERROR mode. */ /* - A WF object in NORMAL mode is also either in OPEN or CLOSED mode. */ /* - The term "raise an error" means bomb the program with a message. */ /* - The comments attached to the functions given below are meant to be read */ /* sequentially with each action or check being performed before the next. */ /* - This package can not guarantee to detect uninitialized WF objects. The */ /* reason is that policing is performed using magic number mechanism and it */ /* is possible that a piece of random memory may contain just the right */ /* numbers to fool the package. */ /* */ /******************************************************************************/ /* Ensure that the body of this header file is included at most once. */ #ifndef DONE_WRITFILE #define DONE_WRITFILE /******************************************************************************/ #include "style.h" /******************************************************************************/ /* We really don't want to show all the guts of this record here, but as */ /* users of the package have to be able to declare objects of this type and */ /* make them the right size, it seems as if we have no choice. */ typedef struct { ulong wf_mhead; /* Helps detect uninitialized and corrupted records. */ bool wf_iserr; /* TRUE=>ERROR, FALSE=>NORMAL. */ bool wf_isope; /* TRUE=>OPEN, FALSE=>CLOSED. */ bool wf_istxt; /* TRUE=>TEXT, FALSE=>BINARY. */ FILE *wf_pfile; /* Pointer to the file object. */ ulong wf_mtail; /* Helps detect uninitialized and corrupted records. */ } wf_t; typedef wf_t *p_wf_t; /******************************************************************************/ EXPORT void wf_ini P_((p_wf_t,bool)); /* Initializes a WF to a well defined state in accordance with the boolean. */ /* FALSE => State=(ERROR). */ /* TRUE => State=(NORMAL,CLOSED). */ /* wf_ini must be applied to a WF before any other operation. */ /* It can be re-applied repeatedly. */ EXPORT void wf_att P_((p_wf_t,FILE *)); /* If WF is uninitialized, raises an error (probably). */ /* If WF is in ERROR mode, returns with no effect. */ /* If WF is OPEN, raises an error. */ /* Attaches an already opened output file to the specified FW object. */ /* Changes the WF to the OPEN state. */ /* The memory that the second parameter points to must be stable. */ EXPORT void wf_ope P_((p_wf_t,char *)); /* If WF is uninitialized, raises an error (probably). */ /* If WF is in ERROR mode, returns with no effect. */ /* If WF is OPEN, raises an error. */ /* Creates an output file of the specified name and prepares it for writing. */ /* Changes the WF to the OPEN state. */ /* Sets the WF to the ERROR state if the file cannot be opened for writing. */ EXPORT void wf_chr P_((p_wf_t,intchar)); /* If WF is uninitialized, raises an error (probably). */ /* If WF is in ERROR mode, returns with no effect. */ /* If WF is CLOSED, raises an error. */ /* Writes the specified character to the output file associated with WF. */ /* Sets WF to the ERROR state if an error occurs during the write. */ EXPORT void wf_wr P_((p_wf_t,char *)); /* Same as wf_chr except that it writes an entire string. */ EXPORT void wf_wl P_((p_wf_t,char *)); /* Same as wf_wr except that appends a '\n'. */ EXPORT void wf_blk P_((p_wf_t,char *,size_t)); /* Same as wf_wr but writes a block of bytes whose address is given by the */ /* second parameter and whose length (in bytes) is given by the third */ /* parameter. */ EXPORT void wf_dup P_((p_wf_t,intchar,ulong)); /* Same as wf_wr but writes specified number of copies of specified char. */ /* The character must not be a NUL. */ EXPORT void wf_clo P_((p_wf_t)); /* If WF is uninitialized, raises an error (probably). */ /* If WF is in ERROR mode, returns with no effect. */ /* If WF is CLOSED, raises an error. */ /* Flushes and closes the output file attached to WF. */ /* Sets WF to the CLOSED state. */ /* Sets WF to the ERROR state if an error occurs during the close. */ EXPORT bool wf_err P_((p_wf_t)); /* If WF is uninitialized, raises an error (probably). */ /* Returns TRUE iff WF is in the ERROR state, otherwise FALSE. */ /* This function can be called at any time so long as the WF is initialized. */ /******************************************************************************/ /* For #ifndef preventing multiple inclusion of the body of this header file. */ #endif /******************************************************************************/ /* End of WRITFILE.H */ /******************************************************************************/ der GNU GPL V2. 08-May-1999 RNW Added function wr_dup. ##############################################################################*/ /******************************************************************************/ /* WRITFILE.H fw_src/tests/ 755 0 0 0 6717354027 6445 5fw_src/tests/an01.fw 644 0 0 43 6717353731 7500 AN01: Test with no macros at all. */ /* Error Detection */ /* --------------- */ /* As we are serious about detecting errors, every call to every IO function */ /* must have its status checked. Unfortunately this makes everything very */ /* messy. Having to check result statuses and react to them can be very */ /* awkward in deeply nested pieces of code, partfw_src/tests/an02.fw 644 0 0 101 6717353731 7514 AN02: Test with one macro but no output file. @$@@Z@{@} s: */ /* */ /* 1. Some calls (e.g. fwrite) are not listed as setting the error status. */ /* 2. It is not guaranteed that IO calls to a stream with error status */ /* will not cause a crash. */ /* 3. Even if ferror were used, it may not be supported by older compilers.*/ /* fw_src/tests/an03.fw 644 0 0 1763 6717353732 7555 AN03: Test semantics checking of macros. First define some macros to call. @$@@Z@M@{@} @$@@(@1@)@Z@M@{@} @$@@(@2@)@Z@M@{@} 1. Test call to undefined macro. @$@@Z==@{@@} 2. Test calls with wrong number of parameters. @$@@Z==@{ @ @@(@) @@(@,@) @ @@(@) @@(Walrus@,@) @@(Sloth@) @} 3. Test call to file macro. @O@@{@} @$@@Z@{@@} 4. Test macro never used and has Z. @$@@Z@{@} 5. Test macro often used and has M. @$@@M@{@} @$@@Z@{@@@} 6. Test macro never used and no Z @$@@{@} 7. Test multiply used and no M. @$@@{@} @$@@Z@{@@@} 8. Test directly recursive macro. @$@@{@@} 9. Test indirectly recursive macro. @$@@M@{@@} @$@@{@@} 10. Test callers of recursive macros. @$@@Z@{@@} - A WF objectfw_src/tests/an04.fw 644 0 0 506 6717353733 7531 AN04: Test document list checks. 1. Test for sections with no names. @A@ @$@@Z@{@} @A@ @A @$@@Z@{@} @A This section has no name and no macro to inherit one from. is included at most once. */ #ifndef DONE_WRITFILE #define DONE_WRITFILE /******************************************************************************/ #include "style.h" /fw_src/tests/an05.fw 644 0 0 404 6717353734 7530 AN05: Test analysis of library macros. 1. Ensure that zero call detection works on library macros. @$@@L@{@} 2. Ensure that multiple call detection works on library macros. @$@@L@{@} @$@@Z@{@@@} End of tests. Helps detect uninitialized and corrupted records. */ } wf_t; typedef wf_t *p_wf_t; /******************************************************************************/ EXPORT void wf_ini P_((p_wf_t,bool)); /* Initializes a WF to a well defined stafw_src/tests/ex01.fw 644 0 0 105 6717353766 7545 EX01: A simple hello world program. @O@@{Hello World@+@} EN, raises an error. */ /* Attaches an already opened output file to the specified FW object. */ /* Changes the WF to the OPEN state. */ /* The memory that the second parameter points to must be stable. */ EXPORT void wf_ope P_((p_wf_t,char *)); /* If WF is uninitialized, raises an error (probably). */ /* If WF isfw_src/tests/ex02.fw 644 0 0 251 6717353767 7551 EX02: An example that demonstrates the use of simple macros. @O@@{@@+@} @$@==@{Hello@} @$@==@{World@} @$@==@{@ @@} Writes the specified character to the output file associated with WF. */ /* Sets WF to the ERROR state if an error occurs during the write. */ EXPORT void wf_wr P_((p_wf_t,char *)); /* Same as wf_chr except that it writes an entire string. */ EXPORT void wf_wl P_((p_wf_t,char *)); /* Same as wf_wr excepfw_src/tests/ex03.fw 644 0 0 741 6717353770 7550 EX03: An example containing errors to do with the number of times that macros are called. @O@==@{@- @ @ @

@} @$@
==@{@- main() { doit(); } @} @$@==@{@- void doit() { int i; for (i=0;i<10;i++) { @ @ } }@} @$@==@{@- printf("Hello World!"); printf("\n");@} @$@==@{scanf@} @$@==@{@- #include #include @} */ /* Sets WF to the ERROR sfw_src/tests/ex04.fw 644 0 0 661 6717353771 7553 EX04: The same as EX03, but with the errors fixed. @O@==@{@- @ @ @
@} @$@
==@{@- main() { doit(); } @} @$@==@{@- void doit() { int i; for (i=0;i<10;i++) { @ @ } }@} @$@@M==@{@- printf("Hello World!"); printf("\n");@} @$@@Z==@{scanf@} @$@==@{@- #include #include @} **************************/ /* WRITFILE.H fw_src/tests/ex05.fw 644 0 0 2161 6717353771 7571 EX05: An example in which Pascal program text is rearranged to form an ADT. This example demonstrates the use of additive macros. @!****************************** @O@==@{@- program adt(input,output); @ @ @ begin startproc; end. @} @!****************************** @$@+=@{@- type buffer_type = record length : integer; buf : array[1..100] of char; end; @} @$@+=@{@- bigbuf : buffer_type; @} @$@+=@{@- procedure buf_init (var b : buffer_type ) {Body of buf_init} procedure buf_add (var b : buffer_type; ch : char) {Body of buf_add} procedure buf_get (var b : buffer_type; var ch : char) {Body of buf_get} @} @!****************************** @$@+=@{@- type complex_type = record r,i : real; end; @} @$@+=@{@- procedure cm_set (var c: complex_type; a,b: real) {Body of cm_set} procedure cm_add (a,b: complex_type; var c: complex_type) {Body of cm_add} {Other procedures and functions} @} @!****************************** {...more pieces of program...} @!****************************** 0 0 101 6717353731 7514 fw_src/tests/ex06.fw 644 0 0 2367 6717353772 7603 EX06: An example in which Pascal program text is rearranged to form an ADT. This example achieves what EX05 does, but without additive macros. @!****************************** @O@==@{@- program adt(input,output); @ @ @ begin startproc; end. @} @$@==@{@- @ @ @} @$@==@{@- @ @} @$@==@{@- @ @ @} @!****************************** @$@==@{@- type buffer_type = record length : integer; buf : array[1..100] of char; end; @} @$@==@{@- bigbuf : buffer_type; @} @$@==@{@- procedure buf_init(var b : buffer_type) {Body of buf_init} procedure buf_add(var b : buffer_type; ch : char) {Body of buf_add} procedure buf_get(var b : buffer_type; var ch : char) {Body of buf_get} @} @!****************************** @$@==@{@- type complex_type = record r,i : real; end; @} @$@+=@{@- procedure cm_set(var c: complex_type; a,b : real) {Body of cm_set} procedure cm_add(a,b : complex_type; var c: complex_type) {Body of cm_add} {Other procedures and functions} @} @@Z@{@@@} 8. Test directly recursive macro. @$@@{@@} 9. Test indirectly recursive macro. @$@@M@{@@} @$@@{@@} 10. Test callers of recursive macros. @$@@Z@{@@} - A WF objectfw_src/tests/ex07.fw 644 0 0 1316 6717353774 7577 EX07: This example demonstrates the use of macro parameters. @O@==@{@@+@} @$@@(@3@)@M==@{@- @1 while (@2) { @3 } @} @$@==@{ @! First form of actual parameters without whitespace and double quotes. @@(x=1;@,x<=10@,printf("X=%u\n",x);@) @! Second form of actual parameters. The double quotes allow non-active @! whitespace that helps to lay out the actual parameters neatly. @! This call is functionally identical to the one above. @@( @"x:=1;@" @, @"x<=10@" @, @"printf("X=%u\n",x);@" @) @! The two forms can be mixed in a single call. @@(x=1;@,x<=10@, @"printf("X=%u\n",x);@" @) @} fw_src/tests/ex08.fw 644 0 0 2466 6717353775 7610 EX08: This example demonstrates the use of parameterized macros. @O@==@{@- The Twelve Bugs of Christmas ---------------------------- @@(@"first@" @,@<1@>@) @@(@"second@" @,@<2@>@) @@(@"third@" @,@<3@>@) @@(@"fourth@" @,@<4@>@) @@(@"fifth@" @,@<5@>@) @@(@"sixth@" @,@<6@>@) @@(@"seventh@" @,@<7@>@) @@(@"eighth@" @,@<8@>@) @@(@"ninth@" @,@<9@>@) @@(@"tenth@" @,@@) @@(@"eleventh@" @,@@) @@(@"twelfth@" @,@@) This song appeared in the internet newsgroup rec.humor.funny on 24-Dec-1991. It was contributed by Pat Scannell (scannell@@darkstar.ma30.bull.com). @} @$@@(@2@)@M==@{@- For the @1 bug of Christmas, my manager said to me @2 @} @$@<1@>@M==@{See if they can do it again.@} @$@<2@>@M==@{Ask them how they did it and@+@<1@>@} @$@<3@>@M==@{Try to reproduce it@+@<2@>@} @$@<4@>@M==@{Run with the debugger@+@<3@>@} @$@<5@>@M==@{Ask for a dump@+@<4@>@} @$@<6@>@M==@{Reinstall the software@+@<5@>@} @$@<7@>@M==@{Say they need an upgrade@+@<6@>@} @$@<8@>@M==@{Find a way around it@+@<7@>@} @$@<9@>@M==@{Blame it on the hardware@+@<8@>@} @$@@M==@{Change the documentation@+@<9@>@} @$@@M==@{Say it's not supported@+@@} @$@@M==@{Tell them it's a feature@+@@} fw_src/tests/ex09.fw 644 0 0 322 6717353776 7557 EX09: This example demonstrates the use of include files. @O@==@{ I like to go shooting, it's a whole lot of fun, @i ex09a.fwi Cos they know my camera isn't loaded with lead. - RNW, 04-Jan-1991. @} fw_src/tests/ex09a.fwi 644 0 0 125 6717353633 10062 'Cos I shoot with a camera instead of a gun. The animals flock to be petted and fed, 644 0 0 661 6717353771 7553 fw_src/tests/ex10.fw 644 0 0 226 6717353777 7553 EX10: This example demonstrates the level at which include files are included. @O@==@{@- @i ex10a This is the text of the sloth macro. @} 7571 fw_src/tests/ex10a.fwi 644 0 0 40 6717353633 10026 @ @} @$@==@{@- ) {Body of buf_init} procedure buf_add (var b : buffer_type; ch : char) {Body of buf_add} procedure buf_get (var b : buffer_type; var ch : char) {Body of buf_get} @} @!****************************** @$@+=@{@- type complex_type = record r,i : real; end; @} @$@+=@{@- procedure cm_set (var c: complex_type; a,b: real) {Body of cm_set} procedure cm_add (a,b: complex_type; var c: complex_type) {Body of cm_add} {Other procedures and ffw_src/tests/ex11.fw 644 0 0 1231 6717354000 7545 EX11: This example shows how FunnelWeb typesets macros, typesetter commands and free text. You are reading some free text before the macro. Free text can consist of any text (not containing the FunnelWeb special character) including typesetter commands such as $, %, #, and \TeX{} which will be typeset to appear exactly as they do in the input file! Look out! Here comes a macro! @O@==@{@- This text is part of a macro definition. @} This is free text following the macro. This sentence contains two @{inline@} typesetter @/directives@/. Now here is a non-inline typesetting directive. @t new_page This sentence will appear on the next page. ***************************** @O@==@{@- program adt(input,output); @ @ @ begin startproc; end. @} @$@==@{@- @ @ @} @$@==@{@- @ @} @$@==@{@- @ @ @} @!****************************** @$@==@{dummy text@} @A@ @B@ @C@ @C@ @B@ @C@ @C@ @C This heading hasn't been given an explicit name, but will inherit the name \p{Save the rest of the world} from the macro definition below. @$@@Z==@{...@} - A WF objectfw_src/tests/ex13.fw 644 0 0 2412 6717354004 7555 EX13: This example is used to generate typeset documentation which is discussed in the tutorial in the FunnelWeb user's manual. @A@ @t table_of_contents @A@ The following macro contain comments that provide moral support in the output code. @$@@M==@{ -- Shift to the left! -- Shift to the right! -- Pop up, push down! -- Byte! Byte! Byte! -- (From "The New Hacker's Dictionary"). @} The next macro is similar but is distributed throughout the program. @$@+=@{@+-- Pointer to the left@+@} @A@ @B@ @$@+=@{-- Pointer to the right@+@} @$@@Z==@{type stack = record ... end;@} @B@ @$@+=@{-- Hack that code@+@} @$@@Z==@{@- procedure push(var b:stack; v:value); @ {...}@} @B@ @$@+=@{-- Tight! Tight! Tight!@+@} @$@@Z==@{@- procedure pop(var b:stack); @ {...}@} @B@ @$@+=@{-- (RNW, 04-Jan-1991).@+@} @$@@Z==@{@- procedure rough(var b:stack); @ {...}@} @O@==@{dummy@+@} fw_src/tests/ex14.fw 644 0 0 445 6717354006 7544 EX14: This example demonstrates the literal and emphasis typesetting constructs. The following procedure @{put_sloth@} writes the @{sloth@} variable to the output file. Note: @/The output file must be opened for writing at this point or the program will crash!@/ @O@==@{dummy@+@} =@{See if they can do it again.@} @$@<2@>@M==@{Ask them how they did it and@+@<1@>@} @$@<3@>@M==@{Try to reproduce it@+@<2@>@} @$@<4@>@M==@{Run with the debugger@+@<3@>@} @$@<5@>@M==@{Ask for a dump@+@<4@>@} @$@<6@>@M==fw_src/tests/ex15.fw 644 0 0 1011 6717354010 7546 EX15: This example demonstrates some of FunnelWeb's generic typesetting constructs. @t vskip 40 mm @t title titlefont centre "Hairy Wombat" @t title titlefont centre "Simulation" @t vskip 10 mm @t title smalltitlefont centre "A Program in Six Parts" @t title smalltitlefont centre "Simulating the Life of Some Hairy Wombats" @t vskip 20 mm @t title normalfont left "By Zqitzypbuswapzra Ypongtatoslrtzz" @t new_page @t table_of_contents @t new_page @A@
@A@
@O@==@{Dummy@+@} s example demonstrates the use of include files. @O@==@{ I like to go shooting, it's a whole lot of fun, @i ex09a.fwi Cos they know my camera isn't loaded with lead. - RNW, 04-Jan-1991. @} fw_src/tests/ex16.fw 644 0 0 4146 6717354012 7565 @!---------------------------------------! @! Start of FunnelWeb Example .fw File ! @!---------------------------------------! @t vskip 40 mm @t title titlefont centre "Powers:" @t title titlefont centre "An Example of" @t title titlefont centre "A Short" @t title titlefont centre "FunnelWeb .fw File" @t vskip 10 mm @t title smalltitlefont centre "by Ross Williams" @t title smalltitlefont centre "26 January 1992" @t vskip 20 mm @t table_of_contents @A@ This program writes out each of the first @{p@} powers of the first @{n@} integers. These constant parameters are located here so that they are easy to change. @$@==@{@- n : constant natural := 10; -- How many numbers? (Ans: [1,n]). p : constant natural := 5; -- How many powers? (Ans: [1,p]).@} @B Here is the outline of the program. This FunnelWeb file generates a single Ada output file called @{Power.ada@}. The main program consists of a loop that iterates once for each number to be written out. @O@==@{@- @ procedure example is @ begin -- example for i in 1..n loop @ end loop; end example; @} @B In this section, we pull in the packages that this program needs to run. In fact, all we need is the IO package so that we can write out the results. To use the IO package, we first of all need to haul it in (@{with text_io@}) and then we need to make all its identifiers visible at the top level (@{use text_io@}). @$@==@{with text_io; use text_io;@} @B Here is the bit that writes out the first @{p@} powers of @{i@}. The power values are calculated incrementally in @{ip@} to avoid the use of the exponentiation operator. @$@==@{@- declare ip : natural := 1; begin for power in 1..p loop ip:=ip*i; put(natural'image(ip) & " "); end loop; new_line; end;@} @!---------------------------------------! @! End of FunnelWeb Example .fw File ! @!---------------------------------------! e; ch : char) {Body of buf_add} procedure buf_get (var b : buffer_type; var ch : char) {Body of buf_get} @} @!****************************** @$@+=@{@- type complex_type = record r,i : real; end; @} @$@+=@{@- procedure cm_set (var c: complex_type; a,b: real) {Body of cm_set} procedure cm_add (a,b: complex_type; var c: complex_type) {Body of cm_add} {Other procedures and ffw_src/tests/generate.fw 644 0 0 4220 6717353632 10574 Generate.Web ============ Some of the FunnelWeb tests require input files that contain control characters, improperly terminated lines, and other special constructs designed to test FunnelWeb's capacity to deal with anything that could arise in an input text file. Unfortunately, by their very nature, these constructs tend to be vulnerable to file transfer programs and other utilities (e.g. FIXEOLS!) that take it upon themselves to "fix up" various problems with text files. The solution adopted here is to totally avoid the problem by using FunnelWeb itself to generate these awkward test files. The following output file macro definitions achieve this. This FunnelWeb file should be fed into FunnelWeb before testing begins. @!------------------------------------------------------------------------------ @O@==@{@- SC06: Test FunnelWeb on a file whose last line is not terminated properly with an end of line marker. Here is the improper termination!---->@} @!------------------------------------------------------------------------------ @O@==@{@- SC08: Detection of trailing spaces. This line has zero trailing spaces | This line has one trailing space | @+@- This line has two trailing spaces | @+@- This line has three trailing spaces | @+@- @} @!------------------------------------------------------------------------------ @O@==@{@- SC09: Detection of control characters. SC09.1 Test that control characters are detected and replaced by "?". SC09.2 Test non printable that has a mnemonic. There is a tab between these two bars |@^D(009)| which should come out as "?". The above error message should contain the mnemonic "HT". SC09.3 Test non printable that has no mnemonic. There is a non-mnemonic control character between these bars |@^D(234)|. @} @!------------------------------------------------------------------------------ @O@==@{@- This is the include file for test SC13e. The test is to see how FunnelWeb copes with an include file that has an improperly terminated last line. Here is the improper termination!---->@} @!------------------------------------------------------------------------------ 004 7555 fw_src/tests/hi01.fw 644 0 0 443 6717354014 7521 HI01: This example demonstrates a problem with managing end of line markers. @O@==@{ while the_walrus_is_sleepy do begin writeln('zzzzzzz'); @ writeln('Umpharumpha...'); end; @} @$@==@{ wake_up_the_walrus(the_walrus); @} r@>+=@{-- Hack that code@+@} @$@@Z==@{@- procedure push(var b:stack; v:value); @ {...}@} @B@ @$@+=@{-- Tight! Tight! Tight!@+@} @$@@Zfw_src/tests/hi02.fw 644 0 0 1432 6717354015 7542 HI02: This example shows how FunnelWeb's macro facility can be used to fudge conditionals. @O@==@{ @ @} @A@ The following macro determines whether debug code will be included in the program. All lines of debug code commence with a call to this macro and so we can turn all that code on or off here by defining this macro to be either empty or the single-line comment symbol (\p{--}). Note the use of a quick macro name. @$@#D@M==@{@} @! Turns the debug code ON. @! Use this definition to turn the debug code OFF: @$@#D==@{--@} @$@==@{@- while sloth=walrus!!!!!!!"); @#D assert(timer=timermax!!!"); inc(sloth); end loop@} {dummy@+@} =@{See if they can do it again.@} @$@<2@>@M==@{Ask them how they did it and@+@<1@>@} @$@<3@>@M==@{Try to reproduce it@+@<2@>@} @$@<4@>@M==@{Run with the debugger@+@<3@>@} @$@<5@>@M==@{Ask for a dump@+@<4@>@} @$@<6@>@M==fw_src/tests/hi03.fw 644 0 0 1413 6717354016 7543 HI03: This example shows how FunnelWeb's macro facility can be used to fudge conditionals. This method is different to HI02. @O@==@{ @ @} @A@ The following macro determines whether debug code will be included in the program. All debug code is wrapped by a call to this macro and so we can turn all the debug code on or off here by defining this macro to be either empty or its parameter. @$@#D@(@1@)@M==@{@1@} @! Turns the debug code ON. @! Use this definition to turn the debug code OFF: @$@#D@(@1@)==@{@} @$@==@{@- while sloth=walrus!!!!!!!"); assert(timer=timermax!!!");@) inc(sloth); end loop@} fw_src/tests/hi04.fw 644 0 0 1465 6717354020 7546 HI04: This example shows how FunnelWeb's macro facility can be used to fudge a multi-way conditional. @O@==@{@
@} @A This module contains non-portable code that must execute on Hewlett Packard, Sun, and DEC workstations. The following FunnelWeb macro is defined to choose between these three. The first parameter is the HP code, the second is the Sun code, and the third is the DEC code. Whichever parameter constitutes the body of this macro determines which machine the code is being targetted for. @$@@(@3@)@M==@{@1@} @! Configure for HP. @$@
==@{@- ------- @@( @"get_command_line(comline)@" @, @! HP. @"scan_command_line(128,comline);@" @, @! Sun. @"dcl_get_command_line(comline,256);@" @) @! DEC. ------- @} B Here is the outline of the program. This FunnelWeb file generates a single Ada output file called @{Power.ada@}. The main program consists of a loop that iterates once for each number to be writtefw_src/tests/hi05.fw 644 0 0 1031 6717354021 7535 HI05: This example shows how FunnelWeb can be used to dissect a file. @O@==@{@- Unreadable Postscript code @ Unreadable Postscript code @ Unreadable Postscript code @} @A This routine looks as if it does this, but really is does that, blah, blah blah. @$@==@{@- /print { push pop pop push turn around and jump up and down and print it} def @} @A This routine zaps the... @$@==@{@- /zap { push pop pop push turn around and jump up and down and print it} def @} of FunnelWeb Example .fw File ! @!---------------------------------------! e; ch : char) {Body of buf_add} procedure buf_get (var b : buffer_type; var ch : char) {Body of buf_get} @} @!****************************** @$@+=@{@- type complex_type = record r,i : real; end; @} @$@+=@{@- procedure cm_set (var c: complex_type; a,b: real) {Body of cm_set} procedure cm_add (a,b: complex_type; var c: complex_type) {Body of cm_add} {Other procedures and ffw_src/tests/hi06.fw 644 0 0 1065 6717354022 7546 HI06: This example shows how FunnelWeb can be used to allow compile time information sharing between two cooperating programs written in different programming languages. @A The following macro contains the temporary file name used to allow the two shellscripts to transfer each file to be printed. @$@@M==@{printme.txt@} @A Here are the scripts for the local VMS node and the remote UNIX node. @O@==@{@- DCL commands copy @ unixnode:: DCL commands @} @O@==@{@- unix commands print @ unix commands @} o generate these awkward test files. The following output file macro definitions achieve this. This FunnelWeb file should be fed into FunnelWeb before testing begins. @!------------------------------------------------------------------------------ @O@==@{@- SC06: Test FunnelWeb on a file whose last line is not terminated properly with an end of line marker. Here is the improper termination!---->@} @!-----------------------------------------fw_src/tests/hi07.fw 644 0 0 707 6717354023 7532 HI07: This example demonstrates how FunnelWeb can be used to allow text sharing between documents. @O@==@{@@+@} @O@==@{@@+@} @$@+=@{@@} @$@+=@{@@} @$@@M==@{First lump of text shared by both documents.@+@} @$@+=@{Text for first document@+@} @$@+=@{Text for second document@+@} @$@+=@{@@} @$@+=@{@@} @$@@M==@{Second lump of text shared by both documents.@+@} lWeb copes with an include file that has an improperly tefw_src/tests/hi08.fw 644 0 0 1445 6717354024 7554 HI08: This example shows how parameterized macros can be used to choose between alternative texts. @! Set the definition of @#D to @! @1 to create the shareholders report. @! @2 to create the customers report. @$@#D@(@2@)@M==@{@1@} @O@==@{@- 1992 ANNUAL REPORT TO @#D@(Shareholders@,Customers@) ======================@#D@(============@,=========@) This has been a very good year for The Very Big Corporation of America. With your help, we have been able to successfully @#D@(@"screw the customers for every cent they have@"@, @"knock the shareholders into submission to bring you lower prices@"@). With gross earnings approaching six trillion dollars, we have been able to @#D@(@"increase dividends@"@, @"lower prices@"@). We expect to have an even better year next year. @} >+=@{-- Hack that code@+@} @$@@Z==@{@- procedure push(var b:stack; v:value); @ {...}@} @B@ @$@+=@{-- Tight! Tight! Tight!@+@} @$@@Zfw_src/tests/hi09.fw 644 0 0 5465 6717354026 7565 HI09: This example demonstrates how FunnelWeb can be used to create generics in languages that do not already provide them. @! We have to set the output line length limit up to cater for Barry Dwyer's @! rather horizontal coding style. @p maximum_output_line_length = 100 @O@==@{ @@(NaryTree@,NaryTreeSet@) @} @$@@(@2@)==@{@- @! @1 is the base type, @2 is the set type. [inherit ('@1'), environment ('@2')] module @2; type @2 = ^@2Record; @2Record = record Member: @1; Next: @2; end; procedure Null@2 (var Result: @2); begin new (Result); Result^.Member := (- MaxInt)::@1; Result^.Next := nil end; function IsNull@2 (S: @2): boolean; begin IsNull@2 := S^.Member::integer = - MaxInt end; procedure ForEach@1 (S: @2; procedure DoIt (i: @1)); var ThisS, NextS: @2; begin ThisS := S; while ThisS^.Member::integer <> - MaxInt do begin NextS := ThisS^.Next; DoIt (ThisS^.Member); ThisS := NextS end; end; function First@1 (S: @2): @1; begin First@1 := S^.Member end; function Is@1InSet (i: @1; S: @2): boolean; procedure TestEquals (j: @1); begin if Equal@1 (i, j) then Is@1InSet := true; end; begin Is@1InSet := false; ForEach@1 (S, TestEquals); end; function Includes@2 (S1, S2: @2): boolean; var Result: boolean; procedure TestIfInS1 (i: @1); begin if Result then if not Is@1InSet (i, S1) then Result := false; end; begin Result := true; ForEach@1 (S2, TestIfInS1); Includes@2 := Result end; function Disjoint@2s (S1, S2: @2): boolean; var Result: boolean; procedure TestIfInS1 (i: @1); begin if Result then if Is@1InSet (i, S1) then Result := false; end; begin Result := true; ForEach@1 (S2, TestIfInS1); Disjoint@2s := Result end; function Equal@2 (S1, S2: @2): boolean; begin Equal@2 := Includes@2 (S1, S2) and Includes@2 (S2, S1); end; procedure Insert@1 (i: @1; var S: @2); var This, Pred, Succ: @2; begin if not Is@1InSet (i, S) then begin Pred := nil; Succ := S; while Succ^.Member::integer > i::integer do begin Pred := Succ; Succ := Succ^.Next end; if Succ^.Member::integer < i::integer then begin new (This); This^.Next := Succ; This^.Member := i; if Pred <> nil then Pred^.Next := This else S := This; end; end; end; procedure Insert@1s (S1: @2; var S2: @2); var This, Pred, Succ: @2; procedure Add@1 (i: @1); begin Insert@1 (i, S2) end; begin ForEach@1 (S1, Add@1); end; procedure Remove@1 (i: @1; var S: @2); var Pred, This: @2; begin Pred := nil; This := S; while not Equal@1 (This^.Member, i) do begin Pred := This; This := This^.Next end; if Pred <> nil then Pred^.Next := This^.Next else S := This^.Next; Dispose (This); end; procedure Dispose@2 (var S: @2); var Old: @2; begin while S <> nil do begin Old := S; S := S^.Next; Dispose (Old) end; end; end. @} fw_src/tests/hi10.fw 644 0 0 5113 6717354027 7544 HI10: This example gives examples of heavily and lightly documented pieces of code. @O@==@{ @ @ @} @A@ This section contains a solution to a problem outlined in section 16.3 of the book @/The Science of Programming@/ by David Gries[Gries81]. @B Given a sorted array @{b[1..N]@} of integers, we wish to determine the @/length@/ of the longest run of identically valued elements in the array. This problem is defined by the following precondition and postcondition. @$@==@{/* Pre: sorted(b). */@} @$@==@{@- /* Post: sorted(b) and p is the length of the longest run in b[1..N]. */@} @B We approach a solution to the problem by deciding to try the approach of scanning through the array one element at a time maintaining a useful invariant through each iteration. A loop variable array index @{i@} is created for this purpose. The bound function is @{N-i@}. Here is the invariant. @$@==@{@- /* Invariant: sorted(b) and 1<=i<=N and */ /* p is len of longest run in b[1..i]. */@} @B Establishing the invariant above in the initial, degenerate case is easy. @$@==@{i=1; p=1;@} @B At this stage, we have the following loop structure. Note that when both the invariant and @{i == N@} are true, the postcondition holds and the loop can terminate. @$@==@{@- @ @ while (i != N) { @ @ } @ @} @B Now there remains only the loop body whose sole task is to increase @{i@} (and so decrease the value of the bound function) while maintaining the invariant. If @{p@} is the length of the longest run seen so far (i.e. in b[1..i]), then, because the array is sorted, the extension of our array range to @{b[1..i+1]@} can only result in an increase in @{p@} if the new element terminates a run of length @{p+1@}. The increase can be at most 1. Because the array is sorted, we need only compare the endpoints of this possible run to see if it exists. This is performed as shown below. @$@==@{i++; if (b[i] != b[i-p]) p++;@} @A The following function compares two C~strings and returns TRUE iff they are identical. @$@==@{@- bool comp(p,q) char *p,*q; { while (TRUE) { if (*p != *q ) return FALSE; if (*p == '\0') return TRUE; p++; q++; } } @} formation sharing between two cooperating programs written in different programming languages. @A The following macro contains the temporary file name used to allow the two shellscripts to transfer each file to be printed. @$@@M==@{printme.txt@} @A Here are the scripts for the local VMS node and the remote UNIX node. @O@==@{@- DCL commands copy @ unixnode:: DCL commands @} @O@==@{@fw_src/tests/pr01.fw 644 0 0 1206 6717353702 7563 PR01: Test the inline typesetting features. 1. First we test the legal use of the @{literal@} construct. 2.Test @{@} (illegal). @A@ 3. Test the construct @{across more than one line@}. 4. Now we test the construct with non-text following it. @{@@} @A@ @{ @> @} @A@ 5. Test the legal use of the @/emphasis@/ construct. 6.Test @/@/ (illegal). @A@ 7. Test the construct @/across more than one line@/. 8. Now we test the construct with non-text following it. @/@@/ @A@ @/ @< @/ hi07b.out@>==@{@@+@} @$@+=@{@@} @$@+=@{@@} @$@@M==@{First lump of text shared by both documents.@+@} @$@+=@{Text for first document@+@} @$@+=@{Text for second document@+@} @$@+=@{@@} @$@+=@{@@} @$@@M==@{Second lump of text shared by both documents.@+@} lWeb copes with an include file that has an improperly tefw_src/tests/pr02.fw 644 0 0 445 6717353703 7551 PR02: Test the parsing of typesetter directives. 1. Test parsing of new page directive. @t new_page 2. Test parsing of table of contents directive. @t table_of_contents 3. Test parsing of vskip directive. @t vskip 32 mm 4. Test parsing of title directive. @t title titlefont left "Sloth" eholders@,Customers@) ======================@#D@(============@,=========@) This has been a very good year for The Very Big Corporation of America. With your help, we have been able to successfully @#D@(@"screw the custofw_src/tests/pr03.fw 644 0 0 1043 6717353704 7566 PR03: Test the parsing and semantics of sections. 4. Test first section of document is not A. @B@ 1. Test section with no name. @A This section has no name. @$@@{Walrus@} 2. Test section with a name @A@ 3. Test the entire hierarchy. @A@ @B@ @C@ @D@ @E@ 5. Test detection of discontinuity in levels. @A@ @C@ @E@ @A@ @B@ @D@ FunnelWeb can be used to create generics in languages that do not already provide them. @! We have to set the output line length limit up to cater for Barry Dwyer's @! rather horizontal coding style. @p maximum_output_line_length = 100 @O@==@{ @@(NaryTree@,NaryTreeSet@) @} @$@@(@2@)==@{@- @! @1 is the base type, @2 is the set type. [inherit ('@1'), environment ('@2')] module @2; type @2 = ^@2Record; @2fw_src/tests/pr04.fw 644 0 0 2127 6717353706 7575 PR04: Test the definition of ordinary macros. 1. Test an ordinary macro definition. @$@@{The text of ordinary@} 2. Test an ordinary definition using a quickname. @$@#|@{The text of ordinary@} 3. Test a name that includes EOL. @$@@{And people who cross lions tend to get eaten.@} @A@ 4. Test the minimum length name (the empty name). @$@<@>@{The empty macro name is quite legal in FunnelWeb.@} 5. Test a name at the maximum name length limit (80). ONly the second of the two macros should generate an error. @p maximum_input_line_length = 100 @$@<12345678901234567890123456789012345678901234567890123456789012345678901234567890@>@{@} @$@<123456789012345678901234567890123456789012345678901234567890123456789012345678901@>@{@} @A@ 6. Test names with all legal characters. There should be no errors. @$@< !"#$%'()*+,-./0123456789:;<=>?@>@{@} @$@@{@} @$@@{@} 7. Test a name that has inserted text sequences. @$@<@^D(065)@@@>==@{@} < i::integer then begin new (This); This^.Next := Succ; This^.Member := i; if Pred <> nil then Pred^.Next := This else S := This; end; end; end; procedure Insert@1s (S1: @2; var S2: @2); var This, Pred, Succ: @2; procedure Add@1 (i: @1); begin Insert@1 (i, S2) end; begin ForEach@1 (S1, Add@1); end; procedure Remove@1 (i: @1; var S: @2); var Pred, This: @2; begin Pred := nil; This := S; whfw_src/tests/pr05.fw 644 0 0 1745 6717353710 7576 PR05: Test the parsing of formal parameter lists. First trip the parser so we don't get past the parser. @> 1. Test macro definition with no formal parameters. @$@@{Slothtext@} 2. Test macro definition with one formal parameter. @$@@(@1@)@{Slothtext@} 3. Test macro definition with many formal parameters. @$@@(@2@)@{Slothtext@} @$@@(@3@)@{Slothtext@} @$@@(@4@)@{Slothtext@} @$@@(@5@)@{Slothtext@} @$@@(@6@)@{Slothtext@} @$@@(@7@)@{Slothtext@} @$@@(@8@)@{Slothtext@} @$@@(@9@)@{Slothtext@} 4. Test with syntax errors in the parameter list. @$@@(@+@9@)@{Slothtext@} @A@ @$@@9@)@{Slothtext@} @A@ @$@@(9@)@{Slothtext@} @A@ @$@@9@)@{Slothtext@} @A@ @$@@(@9@)@)@{Slothtext@} @A@ the longest run of identicafw_src/tests/pr06.fw 644 0 0 1565 6717353712 7601 PR06: Test the parsing on invocation number constraints. Trip the parser so we don't get past it. @> 1. Test with no zero and no many. @$@@{No zero and no many in this macro@} 2. Test with a zero. @$@@Z@{Can be called from 0 to 1 times.@} 3. Test with a many. @$@@M@{Can be called from 1 to infinity times.@} 4. Test with a zero and a many. @$@@Z@M@{Can be called from 0 to infinity times.@} 5. Test with a zero and a many but out of order (should give error). @$@@M@Z@{Oops.@} @A@ 6. Test with syntactic errors. @$@ @M @Z @{Oops.@} @A@ @$@@Z@Z@{Oops.@} @A@ @$@@{Oops.@} @A@ @$@Z@{Oops.@} @A@ @$@@ZM@{Oops.@} @A@ the length of the longest run seen so far (i.e. in b[1..i]), then, because the array is sorted, the extension of our array range to @{b[1.fw_src/tests/pr07.fw 644 0 0 1556 6717353714 7604 PR07: Test the parsing of == and += in macro definitions. Trip the parser so we don't get any further. @> 1. Test with no equals. @$@@{No equals in this macro definition.@} 2. Test with ==. @$@==@{No equals in this macro definition.@} 3. Test with +=. @$@+=@{No equals in this macro definition.@} 4. Test with syntax errors. @$@++@{No equals in this macro definition.@} @A@ @$@@+=@{No equals in this macro definition.@} @A@ @$@+==+@{No equals in this macro definition.@} @A@ @$@=+@{No equals in this macro definition.@} @A@ @$@@=@=@{No equals in this macro definition.@} @A@ @$@@+@=@{No equals in this macro definition.@} @A@ fw_src/tests/pr08.fw 644 0 0 5427 6717353716 7610 PR08: Test semantic checking of macro definitions. Trip parser to be sure that we won't get any output files! @> 1. File macro has parameters. Error. @O@@(@3@)@{Walrus@} @A@ 2. File macro is additive. Error. @O@+=@{Walrus@} @A@ 3. File macro has too long a name. The test name has 1200 characters. Err. Note: This test can't test the error message if the maximum length of a macro name is less than the maximum length of a file name as the name error is caught first. @p maximum_input_line_length = infinity @O@<123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890@>@{@} @A@ 4. File macro has zero or many attributes. Error. @O@@Z@{Walrus@} @A@ @O@@M@{Walrus@} @A@ @O@@Z@M@{Walrus@} @A@ 5. Previous definition is full, current is additive. @$@==@{Sloth@} @$@+=@{Aardvark@} @A@ 6. Previous definition is additive, current is full. @$@+=@{Sloth@} @$@==@{Aardvark@} @A@ 7. Non-first body part of partial has parameter. @$@@(@3@)+=@{Turkey@} @$@@(@3@)+=@{Turkey@} @A@ 8. Zero or many attributes on non-first body part of additive. @$@@Z@M+=@{Turkey@} @$@@Z@M+=@{Turkey@} @A@ 9. Check that non-existent formal parameters are caught. @$@@Z@{Sloth@1Walrus@} @A@ @$@@(@1@)@Z@{Sloth@2Walrus@} @A@ @$@@(@7@)@Z@{Sloth@8Walrus@} @A@ @O@==@{ @@(NaryTree@,NaryTreeSet@) @} @$@@(@2@)==@{@- @! @1 is the base type, @2 is the set type. [inherit ('@1'), environment ('@2')] module @2; type @2 = ^@2Record; @2fw_src/tests/pr09.fw 644 0 0 3776 6717353721 7612 PR09: Test calls and actual parameter lists. First trip up the parser so we don't get any further. @> Now define some macros to call. No error. @$@@{@} @$@@(@1@)@{@} @$@@(@2@)@{@} @$@@(@3@)@{@} @$@@(@9@)@{@} @$@#"@{@} The following test calls should NOT generate any errors. @$@==@{ 1. Test macro call with no parameter list. @ 2. Test macro call with quick name. @#" 3. Test macro call with one parameter. @@(Toucan@) 4. Test macro call with many parameters. @@(Toucan@,Teapot@) @@(Toucan@,Teapot@,Walrus@) @@(Toucan@,Teapot@,Walrus@, Toucan@,Teapot@,Walrus@, Toucan@,Teapot@,Walrus@) 5. Test macro calls with double quotes on parameters. @@( @"Toucan@"@) @@(@"Toucan@" @, @"Teapot@"@) @@(@"Toucan@" @, @"Teapot@" @, @"Walrus@" @) @@( @"Toucan@" @, @"Teapot@" @, @"Walrus@" @, @"Toucan@" @, @"Teapot@" @, @"Walrus@" @, @"Toucan@" @, @"Teapot@" @, @"Walrus@" @) 7. Test macro calls with mixed double quotes on parameters. @@(@"Toucan@" @,Teapot@) @@(@"Toucan@" @, @"Teapot@" @,Walrus@) @@( @"Toucan@" @, @"Teapot@" @, Walrus @, @"Toucan@" @, Teapot @, @"Walrus@" @, @"Toucan@" @, @"Teapot@" @, @"Walrus@" @) @} @! End of macro definition enclosing all these legal tests. 8. Test macro calls with a variety of syntax errors in parameter list. @$@@{ @@( @} @A@ @$@@{ @@) @} @A@ @$@@{ @@(@"Toucan@) @} @A@ @$@@{ @@(@"Toucan@"@"Sloth@"@) @} @A@ @$@@{ @@(@"Toucan@"Teapot@) @} @A@ @$@@{ @@(@"Toucan@"Teapot @} @A@ @$@@{ @@(@"Toucan@"Teapot @@(Toucan@, @"Teapot@,Walrus @} @A@ fw_src/tests/pr10.fw 644 0 0 1064 6717353724 7571 PR10: Test syntactic error recovery. 1. Test recovery at top parsing level. @< @A@ 2. Test recovery inside macro definition. @$@@>==@{ Walrus@} @$@==@{ @ 3. Test recovery inside actual parameter list in macro definition. @$@==@{ @@(@"aardvark@> @} @A@ 4. Test EOF in the middle of a complicated construct. The following makes the end of the file looked chopped off, but it is actually intentional. @$@==@{ @@(@"aardva 644 0 0 1565 6717353712 7601 fw_src/tests/pr11.fw 644 0 0 2673 6717353726 7603 PR11: Test parsing of library macros. 1. Ensure that 0..5 Ls are OK, but six or seven is an error. @$@@Z@{@} @$@@Z@L@{@} @$@@Z@L@L@{@} @$@@Z@L@L@L@{@} @$@@Z@L@L@L@L@{@} @$@@Z@L@L@L@L@L@{@} @$@@Z@L@L@L@L@L@L@{@} @$@@Z@L@L@L@L@L@L@L@{@} 2. Ensure that output macros can't also be library macros. @O@@L@{@} 3. Ensure that you cannot define two macros with both the same name and level. Ensure that this works for all levels. @$@@Z@{@} @$@@Z@{@} @$@@Z@L@{@} @$@@Z@L@{@} @$@@Z@L@L@{@} @$@@Z@L@L@{@} @$@@Z@L@L@L@{@} @$@@Z@L@L@L@{@} @$@@Z@L@L@L@L@{@} @$@@Z@L@L@L@L@{@} @$@@Z@L@L@L@L@L@{@} @$@@Z@L@L@L@L@L@{@} 4. Ensure that six identical levels can simultaneously exist. @$@@Z@{@} @$@@Z@L@{@} @$@@Z@L@L@{@} @$@@Z@L@L@L@{@} @$@@Z@L@L@L@L@{@} @$@@Z@L@L@L@L@L@{@} 5. Ensure that different levels can have different modifiers. @$@@Z@M@{@} @$@@Z@L@{@} 6. Ensure that different levels can have different parameter lists. @$@@(@3@)@Z@{@} @$@@(@1@)@Z@L@{@} 7. Ensure that different levels can have differently additive. @$@@Z==@{@} @$@@Z@L+=@{@} End of library construct parser tests. covery point@> @$@@+=@{No equals in this macro definition.@fw_src/tests/sc01_note.fw 644 0 0 172 5141356607 10552 SC01: The first test tests what happens when FunnelWeb cannot find the specified input file. And so the file cannot exist! 5427 6717353716 7610 fw_src/tests/sc02.fw 644 0 0 0 6717353634 7463 fw_src/tests/sc03.fw 644 0 0 1 6717353635 7466 4567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234fw_src/tests/sc04.fw 644 0 0 2 6717353636 7471 ion is full, current is additive. @$@==@{Sloth@} @$@+=@{Aardvark@} @A@ 6. Previous definition is additive, current is full. @$@+=@{Sloth@} @$@==@{Aardvark@} @A@ 7. Non-first body part of partial has parameter. @$@@(@3@)+=@{Turkey@} @$@@(@3@)+=@{Turkey@} @A@ 8. Zero or many attributes on non-first body part of additive. @$@@Z@M+=@{Turkey@} @$@@Z@M+=@{fw_src/tests/sc05.fw 644 0 0 103 6717353637 7535 SC05: This input file contains a single line containing this text! 644 0 0 3776 6717353721 7612 fw_src/tests/sc06.fw 644 0 0 215 6717353640 7534 SC06: Test FunnelWeb on a file whose last line is not terminated properly with an end of line marker. Here is the improper termination!----> Toucan@,Teapot@,Walrus@, Toucan@,Teapot@,Walrus@) 5. Test macro calls with double quotes on parameters. @@( @"Toucan@"@) @@(@"Toucan@" @, @"Teapot@"@) @@(@"Toucan@" @, @"Teapot@" @, @"Walrus@" @) @@( @"Toucan@" @, @"Teapot@" @, @"Walrus@" @, @"Toucan@" @, @"Teapot@" @, @"Walrus@" @, fw_src/tests/sc07.fw 644 0 0 1704 6717353640 7561 SC07: Processing of long lines. SC07.1: Detection of a line longer than the default limit. The default limit is 80 characters so we will test on either side of that: 1 2 3 4 5 6 7 8 12345678901234567890123456789012345678901234567890123456789012345678901234567890 The above should not trigger a "line too long error". But this line should!------ SC07.3: Test the limit set at infinity. @p maximum_input_line_length = infinity 1 2 3 4 5 6 7 8 12345678901234567890123456789012345678901234567890123456789012345678901234567890 The above should not trigger a "line too long error". Nor should this one!------- SC07.3: Test the limit set lower. @p maximum_input_line_length = 50 1 2 3 4 5 12345678901234567890123456789012345678901234567890 No error for the above but this line will!--------- fw_src/tests/sc08.fw 644 0 0 303 6717353641 7535 SC08: Detection of trailing spaces. This line has zero trailing spaces | This line has one trailing space | This line has two trailing spaces | This line has three trailing spaces | fw_src/tests/sc09.fw 644 0 0 624 6717353632 7544 SC09: Detection of control characters. SC09.1 Test that control characters are detected and replaced by "?". SC09.2 Test non printable that has a mnemonic. There is a tab between these two bars | | which should come out as "?". The above error message should contain the mnemonic "HT". SC09.3 Test non printable that has no mnemonic. There is a non-mnemonic control character between these bars |ê|. @} 3. Ensure that you cannot define two macros with both the same name and level. Ensure that this works fofw_src/tests/sc10.fw 644 0 0 7756 6717353643 7573 Scanner Test: Special Sequence Recognition ========================================== This test tests to see that FunnelWeb is recognising the full set of special sequences. Turn Off the Parser ------------------- First we cause a deliberate scanner error so as to prevent the parser from generating lots of errors over the syntactic rubbish presented here. @ List of All Possible Special Sequences -------------------------------------- The following is a list of the default special character followed by each of the ASCII printables. 000 to 031 are unprintable control characters. 032 @ - ILLEGAL. (Note: Hyphen is needed to avoid trailing blanks error.) 033 @! - Comment. 034 @" - Parameter delimeter. 035 @#X - Short name sequence. @$ 036 - Define macro. Has to be at start of line. 037 @% - ILLEGAL. 038 @& - ILLEGAL. 039 @' - ILLEGAL. 040 @( - Open parameter list. 041 @) - Close parameter list. 042 @* - Old fashioned section marker (has to be at start of a line.). 043 @+ - Insert newline. 044 @, - Parameter separator. 045 @- - Ignore end of line marker (has to be at end of line). 046 @. - ILLEGAL. 047 @/ - Emphasised text. 048 @0 - ILLEGAL. 049 @1 - Formal parameter 1. 050 @2 - Formal parameter 2. 051 @3 - Formal parameter 3. 052 @4 - Formal parameter 4. 053 @5 - Formal parameter 5. 054 @6 - Formal parameter 6. 055 @7 - Formal parameter 7. 056 @8 - Formal parameter 8. 057 @9 - Formal parameter 9. 058 @: - ILLEGAL. 059 @; - ILLEGAL. 060 @< - Open macro name. 061 @=@ - Set special character. 062 @> - Close macro name. 063 @? - ILLEGAL. 064 @@ - Insert special character into text. @A 065 - New section (level 1). Must be at start of a line. @B 066 - New section (level 2). Must be at start of a line. @C 067 - New section (level 3). Must be at start of a line. @D 068 - New section (level 4). Must be at start of a line. @E 069 - New section (level 5). Must be at start of a line. 070 @F - ILLEGAL. 071 @G - ILLEGAL. 072 @H - ILLEGAL. 073 @I - Include file. Will provoke an error here though. 074 @J - ILLEGAL. 075 @K - ILLEGAL. 076 @L - Library macro tag. 077 @M - Tags macro as being allowed to be called many times. 078 @N - ILLEGAL. @O 079 - New macro attached to output file. Has to be at start of line. 080 @P - Pragma. Will cause error here though. 081 @Q - ILLEGAL. 082 @R - ILLEGAL. 083 @S - ILLEGAL. 084 @T - Typesetter directive. Will cause an error here though. 085 @U - ILLEGAL. 086 @V - ILLEGAL. 087 @W - ILLEGAL. 088 @X - ILLEGAL. 089 @Y - ILLEGAL. 090 @Z - Tags macro as being allowed to be called zero times. 091 @[ - ILLEGAL. 092 @\ - ILLEGAL. 093 @] - ILLEGAL. 094 @^D(065) - Insert control character into text 095 @_ - ILLEGAL. 096 @` - ILLEGAL. @a 097 - New section (level 1). Must be at start of a line. @b 098 - New section (level 1). Must be at start of a line. @c 099 - New section (level 1). Must be at start of a line. @d 100 - New section (level 1). Must be at start of a line. @e 101 - New section (level 1). Must be at start of a line. 102 @f - ILLEGAL. 103 @g - ILLEGAL. 104 @h - ILLEGAL. 105 @i - Include file. Will provoke an error here though. 106 @j - ILLEGAL. 107 @k - ILLEGAL. 108 @l - Library macro tag. 109 @m - Tags macro as being allowed to be called many times. 110 @n - ILLEGAL. @O 111 - New macro attached to output file. Has to be at start of line. 112 @p - Pragma. Will cause error here though. 113 @q - ILLEGAL. 114 @r - ILLEGAL. 115 @s - ILLEGAL. 116 @t - Typesetter directive. Will cause an error here though. 117 @u - ILLEGAL. 118 @v - ILLEGAL. 119 @w - ILLEGAL. 120 @x - ILLEGAL. 121 @y - ILLEGAL. 122 @z - Tags macro as being allowed to be called zero times. 123 @{ - Open macro body. 124 @| - ILLEGAL. 125 @} - Close macro body. 126 @~ - ILLEGAL. 127 to 255 are not standard printable ASCII characters. Elephant@>@Z@M+=@{fw_src/tests/sc11.fw 644 0 0 22254 6717353647 7606 SC11: Syntax of the include pragma. 1. Test include pragma not at start of line. @i 2. Test ATi not followed by a blank. @ix 3. Test include filename is too long. The maximum on the Macintosh is 255 but some Unix systems have a maximum of 4095 so we have to make the line that long to do this test. The actual length used is 4400 in the filename itself. 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 @i 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 4. Include pragma has an empty filename. Note: Because the ATi has to be followed by a blank, we have to incur a trailing blank error here in order to provoke the error we really want to see. @i @u - ILLEGAL. 118 @v - ILLEGAL. 119 @w - ILLEGAL. 120 @x - ILLEGAL. 121 @y - ILLEGAL. 122 @z - Tags macro as being allowed to be called zero times. 123 @{ - Open macro body. 124 @| - ILLEGAL. 125 @} - Close macro body. 126 @~ - ILLEGAL. 127 to 255 are not standard printable ASCII characters. Elephant@>@Z@M+=@{fw_src/tests/sc12.fw 644 0 0 261 6717353653 7536 SC12: Include file cannot be found. Test person: DONT create sc12a.inc. It is not supposed to exist! The following include should yield a "file not found error." @i sc12a.inc ximum on the Macintosh is 255 but some Unix systems have a maximum of 4095 so we have to make the line that long to do this test. The actual length used is 4400 in the filename itself. 1 2 3 4 5 6 7 8 9 0 1 2 3 fw_src/tests/sc13.fw 644 0 0 1175 6717353654 7565 SC13: Various kinds of include file. 1. Include file is empty. Before include @i sc13a After include 2. Include file contains a single blank line. Before include @i sc13b After include 3. Include file contains two blank lines. Before include @i sc13c After include 4. Include file contains a single line with text on it. Before include @i sc13d After include 5. Include file's last line is not properly terminated. Before include @i sc13e After include 6. Include file is ordinary. Before include @i sc13f After include 7. Test upper case I and file extension inheritance. Before include @I sc13f After include End of test File. 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 fw_src/tests/sc13a.fwi 644 0 0 0 6717353633 7776 fw_src/tests/sc13b.fwi 644 0 0 1 6717353633 10000 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 fw_src/tests/sc13c.fwi 644 0 0 2 6717353633 10002 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3fw_src/tests/sc13d.fwi 644 0 0 112 6717353633 10045 This is the include file for test SC13d. Just a file containing one line. 345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890fw_src/tests/sc13e.fwi 644 0 0 271 6717353633 10054 This is the include file for test SC13e. The test is to see how FunnelWeb copes with an include file that has an improperly terminated last line. Here is the improper termination!---->890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234fw_src/tests/sc13f.fwi 644 0 0 154 6717353633 10055 This is the include file for tests SC13.6 and SC13.7. There are only two lines, and this is the second one. 56789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678fw_src/tests/sc14.fw 644 0 0 252 6717353656 7543 SC14: Test that the maximum number of levels of include file is 10. This is most easily done with a recursive inclusion. Before the include @i sc14.fw After the include 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012fw_src/tests/sc15.fw 644 0 0 1753 6717353660 7566 SC15: Test that certain attributes are saved across inclusions. 1. Maximum input line length. 2. Special character. 3. Local line number. To test this, we first set the first two attributes away from the default. This will enable us to be sure that when they are restored that they are being restored to their former values and not just set to the default. @=* *! Change the special character. *p maximum_input_line_length = 75 Before include. *i sc15a After include. If the maximum input line length has been correctly restored then the second of the following two lines should give an error, but not the first. 123456789012345678901234567890123456789012345678901234567890123456789012345 1234567890123456789012345678901234567890123456789012345678901234567890123456 If the special character has been preserved, then the following should generate an error. * - This should generate an error if all is well. Preservation of the local line number can be checked by looking at the listing file. fw_src/tests/sc15a.fwi 644 0 0 1715 6717353633 10076 This is the include file for test SC15. The SC15 test checks to make sure that FunnelWeb is saving and restoring three scanning attributes across include files. We also want to make sure that the scanner is initializing these attributes correctly within the include file. SC15.4: Make sure that the special character is AT at the start of include files. @ - This should yield an error. SC15.5 Ensure that the maximum input line length is 80 at the start of an include file. If all is well, only the second of the following two lines will provoke a "line too long" error. 12345678901234567890123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890123456789012345678901 Now that we have checked the default attributes on entering an include file, we want to stuff them up so as to make sure that the attributes prevailing when the include was hit are restored. @p maximum_input_line_length = 65 @=+ Include file is ordinary. Before include @i sc13f fw_src/tests/sc16.fw 644 0 0 2147 6717353662 7567 SC16: Test ^ sequence. 1. Test that all base characters work (in both cases). These should provoke no errors. @^B(00000000) @^b(00000000) @^O(000) @^o(000) @^Q(000) @^q(000) @^D(000) @^d(000) @^H(00) @^h(00) @^X(00) @^x(00) 2. Test that some other base characters generate an error. @^u(0) @^y @^# @^( 3. Test that an error is generated if parenthesis is missing. @^D34) 4. Test legal digits in each base. @^B(00001111) @^O(012) @^O(034) @^O(056) @^O(077) @^D(012) @^D(034) @^D(056) @^D(078) @^D(099) @^H(01) @^H(23) @^H(45) @^H(67) @^H(89) @^H(AB) @^X(CD) @^X(EF) @^x(af) 5. Test illegal digits in each base. @^B(00000002) @^O(008) @^D(00A) @^H(0G) 6. Test what happens if there are the wrong number of digits (too few, too many). @^B(1) @^O(1) @^D(1) @^H(1) @^B(000000001) @^O(0004) @^D(0001) @^H(005) 7. Test that an error is generated for a missing closing parenthesis. @^B(00000000 @^D(045( 8. Test what happens in number is out of the range [0,255]. @^D(255) @^D(256) @^D(999) 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 fw_src/tests/sc17.fw 644 0 0 1244 6717353664 7567 SC17: Test #. First we trip up the scanner so no further passes take place. @ 1. Test with all possible printable characters. @#! @#" @## @#$ @#% @#& @#' @#( @#) @#* @#+ @#, @#- @#. @#/ @#0 @#1 @#2 @#3 @#4 @#5 @#6 @#7 @#8 @#9 @#: @#; @#< @#= @#> @#? @#@ @#A @#B @#C @#D @#E @#F @#G @#H @#I @#J @#K @#L @#M @#N @#O @#P @#Q @#R @#S @#T @#U @#V @#W @#X @#Y @#Z @#[ @#\ @#] @#^ @#_ @#` @#a @#b @#c @#d @#e @#f @#g @#h @#i @#j @#k @#l @#m @#n @#o @#p @#q @#r @#s @#t @#u @#v @#w @#x @#y @#z @#{ @#| @#} @#~ 2. Test that # is flagged as an error. @# @! Should be flagged as an error. 3. Test that #EOL is flagged as an error. @# fw_src/tests/sc18.fw 644 0 0 1250 6717353665 7566 SC18: Test #= First we trip up the scanner so no further passes take place. @ 1. Test with all possible printable characters. @=! !=" "=# #=$ $=% %=& &=' '=( (=) )=* *=+ +=, ,=- -=. .=/ /=0 0=1 1=2 2=3 3=4 4=5 5=6 6=7 7=8 8=9 9=: :=; ;=< <== ==> >=? ?=@ @=A A=B B=C C=D D=E E=F F=G G=H H=I I=J J=K K=L L=M M=N N=O O=P P=Q Q=R R=S S=T T=U U=V V=W W=X X=Y Y=Z Z=[ [=\ \=] ]=^ ^=_ _=` `=a a=b b=c c=d d=e e=f f=g g=h h=i i=j j=k k=l l=m m=n n=o o=p p=q q=r r=s s=t t=u u=v v=w w=x x=y y=z z={ {=| |=} }=~ ~=@ 2. Test that = is flagged as an error. @= @! Should be flagged as an error. 3. Test that =EOL is flagged as an error. @= termination!---->890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234fw_src/tests/sc19.fw 644 0 0 330 6717353667 7547 SC19: Test - 1. Test that error is flagged if sequence is not at the end of a line. This is a line containing @- the end of line suppressor. 2. Test the sequence followed by trailing blanks. @- 34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678fw_src/tests/sc20.fw 644 0 0 404 6717353667 7541 SC20: Test @! 1. Test at the start of a line. @! This is a comment and we can stick any sort of rubbish in it. @! @# @i @^ds;af;lsdmf;land other @ rubbish. 2. Test halfway through a line. This is a line @! whose second half never sees the daylight. @i @< 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012fw_src/tests/sc21.fw 644 0 0 2057 6717353670 7562 SC21: Test generic syntax checking of pragmas and typesetter directives. 1. Test pragma not at the start of line. @p @t 2. Test character following p is not a blank. @px @tx @p @t 3. Test pragma line is too long (limit is 100) 1 2 3 4 5 6 7 8 9 1 @p 4567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 @p 45678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901 @t 4567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 @t 45678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901 4. Test various different pragma lines. @p $#%@ 2525 sloth @t $#%@ 2525 sloth 5. Test pragma with no arguments. (Will get a trailing blanks error.). @p @t 6. Test pragma with too many arguments. @p a b c d e f g h i j k l m n o p q r s t u v w x y z @t a b c d e f g h i j k l m n o p q r s t u v w x y z 644 0 0 1715 6717353633 10076 fw_src/tests/sc22.fw 644 0 0 1076 6717353672 7565 SC22: Test syntax checking of input line length pragma. 1. Test not three arguments. @p maximum_input_line_length @p maximum_input_line_length = @p maximum_input_line_length = xxx yyy 2. Test second argument not "=". @p maximum_input_line_length x sloth 3. Test value of infinity. @p maximum_input_line_length = infinity 4. Test non-decimal digit in number. @p maximum_input_line_length = 2ef 5. Test number is more than eight digits long. @p maximum_input_line_length = 123456789 6. Test number is exactly eight digits long. @p maximum_input_line_length = 12345678 644 0 0 2147 6717353662 7567 fw_src/tests/sc23.fw 644 0 0 1304 6717353672 7560 SC23: Test syntax checking of output line length pragma. 1. Test not three arguments. @p maximum_output_line_length @p maximum_output_line_length = @p maximum_output_line_length = xxx yyy 2. Test second argument not "=". @p maximum_output_line_length x sloth 3. Test value of infinity. @p maximum_output_line_length = infinity 4. Test non-decimal digit in number. @p maximum_output_line_length = 2ef 5. Test number is more than eight digits long. @p maximum_output_line_length = 123456789 6. Test number is exactly eight digits long. 7. Test pragma opposing earlier pragma. @p maximum_output_line_length = 12345678 8. Test pragma not opposing earlier pragma. @p maximum_output_line_length = infinity 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 fw_src/tests/sc24.fw 644 0 0 735 6717353673 7551 SC23: Test syntax checking of indentation pragma. 1. Test not three arguments. @p indentation @p indentation = @p indentation = xxx yyy 2. Test second argument not "=". @p indentation x sloth 3. Test third argument is not legal. @p indentation = sloth 4. Test third argument is none. @p indentation = none 5. Test third argument is blank. 6. Test pragma opposes earlier pragma. @p indentation = blank 7. Test pragma does not oppose earlier pragma. @p indentation = none u @#v @#w @#x @#y @#z @#{ @#| @#} @fw_src/tests/sc25.fw 644 0 0 306 6717353675 7546 SC25: Test syntax checking of new page typesetter directive. 1. Make sure that a legal new page directive is OK. @t new_page 2. Check that it doesn't stand for any nonsense. @t new_page nonsense fw_src/tests/sc26.fw 644 0 0 350 6717353676 7547 SC26: Test syntax checking of table of contents typesetting pragma. 1. Make sure that a legal table of contents directive is OK. @t table_of_contents 2. Check that it doesn't stand for any nonsense. @t table_of_contents nonsense 5678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234fw_src/tests/sc27.fw 644 0 0 563 6717353677 7557 SC27: Test syntax checking of vskip typesetting directive. 1. Test not exactly three arguments (includes vskip). @t vskip @t vskip one @t vskip one two three four 2. Test third argument not "mm". @t vskip 32 xx 3. Test second argument has bad digit. @t vskip 3f mm 4. Test number has more than three digits @t vskip 4355 mm 5. Test a legal one too. @t vskip 20 mm 890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678fw_src/tests/sc28.fw 644 0 0 2101 6717353677 7566 SC28: Test syntax checking of title typesetting directive. 1. Test less than four arguments (includes title). Note: The title command pulls a hack treating the rest of the line after two arguments as the string. So it can't detect an EXCESS of arguments! @t title @t title two @t title two three 2. Test out bad font. @t title slothfont left "Sloth" 3. Test out bad alignment. @t title titlefont westward "Sloth" 4. Test out funny strings. @t title titlefont left " @t title titlefont left "" @! Note: The following, believe it or not, is actually LEGAL! @t title titlefont left "sloth"sloth" 5. Test out all combinations of font and alignment. @t title titlefont left "Sloth" @t title titlefont centre "Sloth" @t title titlefont right "Sloth" @t title smalltitlefont left "Sloth" @t title smalltitlefont centre "Sloth" @t title smalltitlefont right "Sloth" @t title normalfont left "Sloth" @t title normalfont centre "Sloth" @t title normalfont right "Sloth" 6. Test misspelling of centre (Ross's revenge). @t title normalfont center "Sloth" ctives. 1. Test pragma not at the start of line. @p @t 2. Test character following p is not a blank. @px @tx @p @t 3. Test pragma line is too long (limit is 100) 1 2 3 4 5 6 7 8 9 1 @p 4567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 @p 45678901234567890123456789012345678901234567890123456789012345fw_src/tests/sc29.fw 644 0 0 720 6717353701 7540 SC29: Test syntax checking of typesetter pragma. 1. Test not three arguments. @p typesetter @p typesetter = @p typesetter = xxx yyy 2. Test second argument not "=". @p typesetter x sloth 3. Test third argument is not legal. @p typesetter = sloth 4. Test third argument is none. @p typesetter = none 5. Test third argument is tex. 6. Test pragma opposes earlier pragma. @p typesetter = tex 7. Test pragma does not oppose earlier pragma. @p typesetter = none fw_src/tests/tg01.fw 644 0 0 357 6717353735 7550 TG01: Test basic output file mechanism and filename inheritance. The file written will be directory:tg01.out @O@<.out@>==@{@- Patterson's prayer: "There is nothing I would rather be, than chairman of the ABC." - Les Patterson @} e_length x sloth 3. Test value of infinity. @p maximum_input_line_length = infinity 4. Test non-decimal digit in number. @p maximum_input_line_length = 2ef 5. Test number is more than eight digits long. @p maximum_input_line_length = 123456789 6. Test number is exactlyfw_src/tests/tg02.fw 644 0 0 2332 6717353736 7565 TG02: Test expansions with no indentation. @p indentation = none @O@@{@- @ @ @} @!****************************************************************************** @A@ @$@@{@- The other day upon the stair, @ I think he's from the CIA.@} @$@@{@- I met a man who wasn't there. @@} @$@@{He wasn't there @ today,@} @$@@{again@} @!****************************************************************************** @A@ @$@@{@- In the output begin0 should be at the left margin, then begin1 to begin wayout should be indented by three spaces. Then the "It's scary" should be positioned over the "a" ofd margin. The rest should be at the left margin. begin0 @ end0@} @$@@{@- begin1 @ end1@} @$@@{@- begin2 @ end2@} @$@@{@- begin3 @ end3@} @$@@{@- begin4 @ end4@} @$@@{@- begin wayout----------V @ end wayout----------^@} @$@@{@- It's scary out here So far from the left margin.@} @!****************************************************************************** 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 fw_src/tests/tg03.fw 644 0 0 2075 6717353737 7573 TG03: Test expansions with indentation. @p indentation = blank @O@@{@- @ @ @} @!****************************************************************************** @A@ @$@@{@- The other day upon the stair, @ I think he's from the CIA.@} @$@@{@- I met a man who wasn't there. @@} @$@@{He wasn't there @ today,@} @$@@{again@} @!****************************************************************************** @A@ @$@@{@- The following nest of begin and ends should be indented in a nest. begin0 @ end0@} @$@@{@- begin1 @ end1@} @$@@{@- begin2 @ end2@} @$@@{@- begin3 @ end3@} @$@@{@- begin4 @ end4@} @$@@{@- begin wayout----------V @ end wayout----------^@} @$@@{@- It's scary out here So far from the left margin.@} @!****************************************************************************** 1. Make sure that a legal new page directive is OK. @t new_page 2. Check that it doesn't stand for any nonsense. @t new_page nonsense fw_src/tests/tg04.fw 644 0 0 1226 6717353740 7563 TG04: Test macro expansions. @$@@{Teapot@} @$@@(@1@)@M@{Left @1 Right@} @$@@(@2@)@M@{Left @1 Middle @2 Right@} @$@@(@1@)@M@{[@1]@} @O@@{ 1. Test macro call with no parameters. "Teapot" = "@" 2. Test macro call with one parameter. "Left Testing Right" = "@@(@"Testing@"@)" 3. Test macro call with many parameters. "Left x Middle y Right" = "@@(x@,y@)" 4. Test macro call as a parameter of another macro call. "Left Ostrich Middle Left Wombat Right Right" = "@@(Ostrich@,@@(Wombat@)@)" 5. Test expression recursive macro call. "[X[[Walrus]]Y]" = "@@(X@@(@@(Walrus@)@)Y@)" @} 7557 fw_src/tests/tg05.fw 644 0 0 477 6717353741 7554 TG05: Checking of the output line length. @$@@M@{1234567890@} @O@@{@- We test the default limit of 80 characters. Only the second of the following two lines should provoke an error. @@@@@@@@ @@@@@@@@1 @} fw_src/tests/tg06.fw 644 0 0 625 6717353742 7551 TG06: Test the setting of the line length limit. @p maximum_output_line_length = 60 @O@@{@- We test the user-set limit of 60 characters. Only the third of the following three lines should provoke an error. 1 2 3 4 5 6 123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901 @} loth" @t title normalfont centre "Sloth" @t title normalfont right "Sloth" 6. Test misspelling offw_src/tests/tg07.fw 644 0 0 501 6717353743 7544 TG07: Checking the setting of the maximum line length to infinity. @p maximum_output_line_length = infinity @$@@M@{1234567890123456789012345678901234567890@} @O@@{@- The following long line should not blow the line length limit. @@@@@@@@@@@@@@ @} fw_src/tests/tg08.fw 644 0 0 356 6717353744 7556 TG08: Test include files and output generation. @O@@{@- @ @ @} @$@@{@- Now might I drink hot jolt cola @i tg08a Its contours moulded for my hand? Come, let me clutch thee!@} fw_src/tests/tg08a.fwi 644 0 0 173 6717353633 10062 And create hacks in C That would not bear witness of the Sun.@} @$@@{@- Is this a mouse I see before me? 2332 6717353736 7565 fw_src/tests/tg09.fw 644 0 0 1306 6717353745 7574 TG09: Test some special sequences. 1. ^ 2. - 3. ! @O@@{@- @! This line and the next line should not come out in the output file. @! This line is a comment line. A Megastar's Mantras -------------------- (Things that Mean a Lot to Me) @^D(065) is for Austr@- alia The land I adore; It's so spot@- less and clean You can eat off the floor. @^X(42) is for Boomerang, Which our qua@- int Abos launch In the hope it will bring back A roast quok@- ka's haunch. @^B(01000011) is for Culture Which blossoms unch@- ecked, You can't move in my homeland for Beckett and Brecht. ...more... - Dame Edna Everage, "Neglected Poems and Other Creatures" by Barry Humphries, 1991. @} ******************* 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 fw_src/tests/tg10.fw 644 0 0 1513 6717353746 7565 TG10: Test tangling of library macros. @O@@{@- @ @ @ @ @} 1. Ensure that the lowest level dominates. @$@@{Sloth level zero (correct) @} @$@@L@{Sloth level one@} @$@@L@L@{Sloth level two@} @$@@L@L@L@{Sloth level three@} @$@@L@L@L@L@{Sloth level four@} @$@@L@L@L@L@L@{Sloth level five@} @$@@L@L@L@{Walrus level three (correct)@} @$@@L@L@L@L@L@{Walrus level five@} @$@@L@L@{Emu level two (correct)@} @$@@L@L@L@{Emu level three@} 2. Ensure += is working properly. @$@@L+=@{First aardvark level one text (correct)@+@} @$@@L@L+=@{Second aardvark level two text@} @$@@L+=@{First aardvark level one text (correct)@+@} @$@@L@L+=@{Second aardvark level two text@} End of tests. E@>@{@- begin wayout----------V @ end wayout----------^@} @$@@{@- It's scary out here So far from the left margin.@} @!******************fw_src/tests/wv01.fw 644 0 0 225 6717353747 7567 WV01: Test basic typeset file output mechanism. @A@ @O@@{@- Some text for no particular reason. @} 7563 fw_src/tests/wv02.fw 644 0 0 1233 6717353752 7604 WV05: Test typesetting features. @O@@{ @} 1. Test all five levels of headings with explicit titles. @A@ @B@ @C@ @D@ @E@ 2. Test all five levels of headings with implicit titles. @A @$@@Z@{Sloth@} @B @$@@Z@{Walrus@} @C @$@@Z@{Aardvark@} @D @$@@Z@{Teapot@} @E @$@@Z@{Emu@} 3. Test the table of contents directive. @t table_of_contents 4. Test the newpage directive. @t new_page 5. Test the vskip directive. @t vskip 50 mm 6. Test the title directive. @t title titlefont centre "This is a test Title" fw_src/tests/wv03.fw 644 0 0 2321 6717353754 7606 WV03: Test the typesetting of various kinds of macros. First create an output file to keep the analyser happy. @O@@{@} 1. Test macro never used. @$@@Z@{@} 2. Test a macro used once. @$@@{@} 3. Test a macro used twice. @$@@M@{@} 4. Test a macro used three times. @$@@M@{@} 5. Test a macro used five times. @$@@M@{@} Here is the macro that does all the calling for the above. @$@@Z@{@- @ @ @ @ @} @$@@Z@{@- @ @ @ @} @$@@Z@{@- @ @ @} @$@@Z@{@- @ @} @$@@Z@{@- @ @} 6. Test a macro with two body parts. @$@@Z+=@{Sloth@} @$@+=@{Walrus@} 7. Test a macro with three body parts. @$@@Z+=@{Sloth@} @$@+=@{Walrus@} @$@+=@{Aardvaark@} 8. Test a macro with five body parts. @$@@Z+=@{Sloth@} @$@+=@{Walrus@} @$@+=@{@@} @$@+=@{Aardvaark@} @$@+=@{@@} fw_src/tests/wv04.fw 644 0 0 1071 6717353756 7612 WV04: Test ugly string processing. @! We need this to keep the analyser happy. @O@@{@} 1. Test ugly string in section name. @A@< !"#$%'()*+,-./0123456789:;<=>?@> @A@ @A@ 2. Test ugly string in macro name. @$@< !"#$%'()*+,-./0123456789:;<=>?@>@Z@{@} @$@@Z@{@} @$@@Z@{@} 3. Test ugly string in literal section. @{ !"#$%'()*+,-./0123456789:;<=>?@} @{ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`@} @{abcdefghijklmnopqrstuvwxyz{|}~@} .out@>@{@- @ @ @} @$@@{@- Now might I drink hot jolt cola @i tg08a Its contours moulded for my hand? Come, let me clutch thee!@} fw_src/tests/wv05.fw 644 0 0 2324 6717353760 7610 WV05: Test processing of ugly strings as ordinary and protected text with no typesetter set. @! We need this to keep the analyser happy. @O@@{@} A paragraph in ordinary mode. 33 con!text 34 con"text 35 con#text 36 con$text 37 con%text 38 con&text 39 con'text 40 con(text 41 con)text 42 con*text 43 con+text 44 con,text 45 con-text 46 con.text 47 con/text 48-57 con0123456789text 58 con:text 59 con;text 60 context 63 con?text 64 con@@text 65-90 conABCDEFGHIJKLMNOPQRSTUVWXYZtext 91 con[text 92 con\text 93 con]text 94 con^text 95 con_text 96 con`text 97-122 conabcdefghijklmnopqrstuvwxyztext 123 con{text 124 con|text 125 con}text 126 con~text Now again, but this time inside protective braces. @{ 33 con!text 34 con"text 35 con#text 36 con$text 37 con%text 38 con&text 39 con'text 40 con(text 41 con)text 42 con*text 43 con+text 44 con,text 45 con-text 46 con.text 47 con/text 48-57 con0123456789text 58 con:text 59 con;text 60 context 63 con?text 64 con@@text 65-90 conABCDEFGHIJKLMNOPQRSTUVWXYZtext 91 con[text 92 con\text 93 con]text 94 con^text 95 con_text 96 con`text 97-122 conabcdefghijklmnopqrstuvwxyztext 123 con{text 124 con|text 125 con}text 126 con~text @} Mantras -------------------- (Things that Mean a Lot to Me) @^D(065) is for Austr@- alia The land I adore; It's so spot@- less and clean You can eat off the floor. @^X(42) is for Boomerang, Which our qua@- int Abos launch In the hope it will bring back A roast quok@- ka's haunch. @^B(01000011) ifw_src/tests/wv06.fw 644 0 0 2350 6717353762 7612 WV06: Test processing of ugly strings as ordinary and protected text with typesetter = tex. @p typesetter = tex @! We need this to keep the analyser happy. @O@@{@} A paragraph in ordinary mode. 33 con!text 34 con"text 35 con#text 36 con$text 37 con%text 38 con&text 39 con'text 40 con(text 41 con)text 42 con*text 43 con+text 44 con,text 45 con-text 46 con.text 47 con/text 48-57 con0123456789text 58 con:text 59 con;text 60 context 63 con?text 64 con@@text 65-90 conABCDEFGHIJKLMNOPQRSTUVWXYZtext 91 con[text 92 con\text 93 con]text 94 con^text 95 con_text 96 con`text 97-122 conabcdefghijklmnopqrstuvwxyztext 123 con{text 124 con|text 125 con}text 126 con~text Now again, but this time inside protective braces. @{ 33 con!text 34 con"text 35 con#text 36 con$text 37 con%text 38 con&text 39 con'text 40 con(text 41 con)text 42 con*text 43 con+text 44 con,text 45 con-text 46 con.text 47 con/text 48-57 con0123456789text 58 con:text 59 con;text 60 context 63 con?text 64 con@@text 65-90 conABCDEFGHIJKLMNOPQRSTUVWXYZtext 91 con[text 92 con\text 93 con]text 94 con^text 95 con_text 96 con`text 97-122 conabcdefghijklmnopqrstuvwxyztext 123 con{text 124 con|text 125 con}text 126 con~text @} level one text (correct)@+@} @$@@L@L+=@{Second aardvark level two text@} End of tests. E@>@{@- begin wayout----------V @ end wayout----------^@} @$@@{@- It's scary out here So far from the left margin.@} @!******************fw_src/tests/wv07.fw 644 0 0 2153 6717353763 7615 WV07: Test the typesetting of library macros. @A@<1. Test an ordinary library macro.@> @$@@Z@L@{I am the sloth@} @A@<2. Test a library macro with two body parts.@> @$@@Z@L+=@{Sloth@} @$@@L+=@{Walrus@} @A@<3. Test a library macro with three body parts.@> @$@@Z@L+=@{Sloth@} @$@@L+=@{Walrus@} @$@@L+=@{Aardvaark@} @A@<4. Test a library macro with five body parts.@> @$@@Z@L+=@{Sloth@} @$@@L+=@{Walrus@} @$@@L+=@{@@} @$@@L+=@{Aardvaark@} @$@@L+=@{@@} @A@<5. Test a library macro that is overruled.@> @$@@Z@L@{Walrus library@} @$@@Z@{Walrus main@} @A@<6. Test interlaced and overruled.@> @$@@Z@L+=@{First aardvark level one text (correct)@+@} @$@@L@L+=@{Second aardvark level two text@} @$@@L+=@{First aardvark level one text (correct)@+@} @$@@L@L+=@{Second aardvark level two text@} @O@@{@@} End of tests. tles. @A@ @B@ @C@ @D@ @E@ 2. Test all five levels of headings with implicit titles. @A @$@@Z@{Sloth@} @B @$@@Z@{Walrus@} @C @$@@Z@{Aardvark@} @D @$@@Z@{Teapot@} @E @$@@Z@{Emu@} 3. Test the table of contents directive. @t table_of_contents 4. Test the neWV03: Test the typesetting of various kinds of macros. First create an output file to keep the analyser happy. @O@@{@} 1. Test macro never used. @$@@Z@{@} 2. Test a macro used once. @$@@{@} 3. Test a macro used twice. @$@@M@{@} 4. Test a macro used three times. @$@@M@{@} 5. Test a macro used five times. @$@@M@{@} Here is the macro that does all the calling for the above. @$@@Z@{@- @ @ @