commit 1a496ecc361afab8b529f331bee4e7f76372ce0b Author: Lassi Kortela Date: Fri May 19 11:11:48 2023 +0300 Add contents of ffigen.tar.gz diff --git a/CPYRIGHT b/CPYRIGHT new file mode 100644 index 0000000..54961d3 --- /dev/null +++ b/CPYRIGHT @@ -0,0 +1,52 @@ +The authors of this software are Christopher W. Fraser and +David R. Hanson. + +Copyright (c) 1991,1992,1993,1994,1995 by AT&T, Christopher W. Fraser, +and David R. Hanson. All Rights Reserved. + +Permission to use, copy, modify, and distribute this software for any +purpose, subject to the provisions described below, without fee is +hereby granted, provided that this entire notice is included in all +copies of any software that is or includes a copy or modification of +this software and in all copies of the supporting documentation for +such software. + +THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED +WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR AT&T MAKE ANY +REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY +OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + + +lcc is not public-domain software, shareware, and it is not protected +by a `copyleft' agreement, like the code from the Free Software +Foundation. + +lcc is available free for your personal research and instructional use +under the `fair use' provisions of the copyright law. You may, +however, redistribute the lcc in whole or in part provided you +acknowledge its source and include this COPYRIGHT file. + +You may not sell lcc or any product derived from it in which it is a +significant part of the value of the product. Using the lcc front end +to build a C syntax checker is an example of this kind of product. + +You may use parts of lcc in products as long as you charge for only +those components that are entirely your own and you acknowledge the use +of lcc clearly in all product documentation and distribution media. You +must state clearly that your product uses or is based on parts of lcc +and that lcc is available free of charge. You must also request that +bug reports on your product be reported to you. Using the lcc front +end to build a C compiler for the Motorola 88000 chip and charging for +and distributing only the 88000 code generator is an example of this +kind of product. + +Using parts of lcc in other products is more problematic. For example, +using parts of lcc in a C++ compiler could save substantial time and +effort and therefore contribute significantly to the profitability of +the product. This kind of use, or any use where others stand to make a +profit from what is primarily our work, is subject to negotiation. + + +Chris Fraser / cwf@research.att.com +David Hanson / drh@cs.princeton.edu +Fri Jun 17 11:57:07 EDT 1994 diff --git a/chez.ps b/chez.ps new file mode 100644 index 0000000..aa2eebb --- /dev/null +++ b/chez.ps @@ -0,0 +1,2550 @@ +%!PS-Adobe-2.0 +%%Creator: dvips 5.55 Copyright 1986, 1994 Radical Eye Software +%%Title: chez.dvi +%%CreationDate: Wed Feb 7 11:03:42 1996 +%%Pages: 18 +%%PageOrder: Ascend +%%BoundingBox: 0 0 612 792 +%%EndComments +%DVIPSCommandLine: dvips chez.dvi +%DVIPSParameters: dpi=300, comments removed +%DVIPSSource: TeX output 1996.02.07:1103 +%%BeginProcSet: tex.pro +/TeXDict 250 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N +/X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72 +mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1} +ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale +isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div +hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul +TR[matrix currentmatrix{dup dup round sub abs 0.00001 lt{round}if} +forall round exch round exch]setmatrix}N /@landscape{/isls true N}B +/@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B +/FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{ +/nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N +string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N +end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{ +/sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0] +N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data dup +length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{ +128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub +get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data +dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N +/rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup +/base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx +0 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff +setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff +.1 sub]{ch-image}imagemask restore}B /D{/cc X dup type /stringtype ne{]} +if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup +length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{ +cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin +0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul +add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore showpage +userdict /eop-hook known{eop-hook}if}N /@start{userdict /start-hook +known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X +/IE 256 array N 0 1 255{IE S 1 string dup 0 3 index put cvn put}for +65781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N /RMat[1 0 0 -1 0 +0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley X /rulex X V}B /V +{}B /RV statusdict begin /product where{pop product dup length 7 ge{0 7 +getinterval dup(Display)eq exch 0 4 getinterval(NeXT)eq or}{pop false} +ifelse}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale rulex ruley false +RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR rulex ruley scale 1 1 +false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave newpath transform +round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg +rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail +{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M} +B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3 M}B /k{ +4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{ +p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p +a}B /bos{/SS save N}B /eos{SS restore}B end +%%EndProcSet +TeXDict begin 40258431 52099146 1000 300 300 +(/nfs/research/paraducks3/lth/ffi/lcc/chez.dvi) @start +/Fa 1 16 df<03C00FF01FF83FFC7FFE7FFEFFFFFFFFFFFFFFFF7FFE7FFE3FFC1FF80FF0 +03C010107E9115>15 D E /Fb 32 122 df45 +D<78FCFCFCFC7806067D850D>I<00600001E0000FE000FFE000F3E00003E00003E00003 +E00003E00003E00003E00003E00003E00003E00003E00003E00003E00003E00003E00003 +E00003E00003E00003E00003E00003E0007FFF807FFF80111B7D9A18>49 +D<07F8001FFE00383F80780FC0FC07C0FC07E0FC03E0FC03E07803E00007E00007C00007 +C0000F80001F00001E0000380000700000E0000180600300600600600800E01FFFC03FFF +C07FFFC0FFFFC0FFFFC0131B7E9A18>I<03F8001FFE003C1F003C0F807C07C07E07C07C +07C03807C0000F80000F80001E00003C0003F800001E00000F800007C00007C00007E030 +07E07807E0FC07E0FC07E0FC07C0780F80781F001FFE0007F800131B7E9A18>I<000180 +000380000780000F80001F80003F80006F8000CF80008F80018F80030F80060F800C0F80 +180F80300F80600F80C00F80FFFFF8FFFFF8000F80000F80000F80000F80000F80000F80 +01FFF801FFF8151B7F9A18>I<00038000000380000007C0000007C0000007C000000FE0 +00000FE000001FF000001BF000001BF0000031F8000031F8000061FC000060FC0000E0FE +0000C07E0000C07E0001803F0001FFFF0003FFFF8003001F8003001F8006000FC006000F +C00E000FE00C0007E0FFC07FFEFFC07FFE1F1C7E9B24>65 D<001FE02000FFF8E003F80F +E007C003E00F8001E01F0000E03E0000E03E0000607E0000607C000060FC000000FC0000 +00FC000000FC000000FC000000FC000000FC000000FC0000007C0000607E0000603E0000 +603E0000C01F0000C00F80018007C0030003F80E0000FFFC00001FE0001B1C7D9B22>67 +D77 D<003FE00001F07C0003C01E000F800F801F0007C01E0003C03E0003E07E0003 +F07C0001F07C0001F0FC0001F8FC0001F8FC0001F8FC0001F8FC0001F8FC0001F8FC0001 +F8FC0001F87C0001F07E0003F07E0003F03E0003E03F0007E01F0007C00F800F8003C01E +0001F07C00003FE0001D1C7D9B24>79 DI<07F8201FFEE03C07 +E07801E07000E0F000E0F00060F00060F80000FE0000FFE0007FFE003FFF003FFF800FFF +C007FFE0007FE00003F00001F00000F0C000F0C000F0C000E0E000E0F001C0FC03C0EFFF +0083FC00141C7D9B1B>83 D86 D<0FF8001C1E003E0F803E07803E07C01C07C00007 +C0007FC007E7C01F07C03C07C07C07C0F807C0F807C0F807C0780BC03E13F80FE1F81512 +7F9117>97 D<03FC000E0E001C1F003C1F00781F00780E00F80000F80000F80000F80000 +F80000F800007800007801803C01801C03000E0E0003F80011127E9115>99 +D<000FF0000FF00001F00001F00001F00001F00001F00001F00001F00001F00001F001F9 +F00F07F01C03F03C01F07801F07801F0F801F0F801F0F801F0F801F0F801F0F801F07801 +F07801F03C01F01C03F00F0FFE03F9FE171D7E9C1B>I<01FC000F07001C03803C01C078 +01C07801E0F801E0F801E0FFFFE0F80000F80000F800007800007C00603C00601E00C00F +038001FC0013127F9116>I<007F0001E38003C7C00787C00F87C00F83800F80000F8000 +0F80000F80000F8000FFF800FFF8000F80000F80000F80000F80000F80000F80000F8000 +0F80000F80000F80000F80000F80000F80000F80007FF8007FF800121D809C0F>I<03F8 +F00E0F381E0F381C07303C07803C07803C07803C07801C07001E0F000E0E001BF8001000 +001800001800001FFF001FFFC00FFFE01FFFF07801F8F00078F00078F000787000707800 +F01E03C007FF00151B7F9118>II< +1E003F003F003F003F001E00000000000000000000000000FF00FF001F001F001F001F00 +1F001F001F001F001F001F001F001F001F001F00FFE0FFE00B1E7F9D0E>I108 DII<01FC000F07801C01C03C01E07800F07800F0F800F8F800F8F800F8F800F8F800 +F8F800F87800F07800F03C01E01E03C00F078001FC0015127F9118>II114 +D<1FD830786018E018E018F000FF807FE07FF01FF807FC007CC01CC01CE01CE018F830CF +C00E127E9113>I<0300030003000300070007000F000F003FFCFFFC1F001F001F001F00 +1F001F001F001F001F001F0C1F0C1F0C1F0C0F08079803F00E1A7F9913>III121 D E /Fc +1 59 df<60F0F06004047D830A>58 D E /Fd 1 52 df<00080000001C00000036000000 +63000000C180000180C00003006000060030000C00180018000C003000060060000300C0 +000180C0000180600003003000060018000C000C00180006003000030060000180C00000 +C180000063000000360000001C000000080000191A7D991F>51 D +E /Fe 72 126 df<60F0F0F0F0F0F0F0F0F0F0F0F0F0600000000060F0F0600417789614 +>33 DI<071C0007 +1C00071C00071C00071C007FFF00FFFF80FFFF800E38000E38000E38000E38000E38000E +38000E3800FFFF80FFFF807FFF001C70001C70001C70001C70001C700011177F9614>I< +0700000F800018C00038E00038E00038E00038C00039CF80398F801F1C001E1C001E3800 +1E38001E38003F7000677000E3F000E3E000E1E380E1E38073F3803F3F001E1E0011177F +9614>38 D<60F0F878181818303060C080050C789614>I<00C001C0030006000C001C00 +38003000700070006000E000E000E000E000E000E000E000600070007000300038001C00 +0C000600030001C000C00A1D7A9914>I<8000C0006000300018001C000E000600070007 +000300038003800380038003800380038003000700070006000E001C00180030006000C0 +008000091D7C9914>I<038003800380638CF39EFFFE3FF80FE00FE03FF8FFFEF39E638C +0380038003800F107E9214>I<01C00001C00001C00001C00001C00001C00001C000FFFF +80FFFF80FFFF8001C00001C00001C00001C00001C00001C00001C00011117F9314>I<70 +F8FCFC7C0C1830E0C0060A798414>II<70F8F8F870050579 +8414>I<0006000E000E001C001C003800380070007000E000E001C001C0038003800380 +070007000E000E001C001C003800380070007000E000E000C0000F1D7E9914>I<07C00F +E01C7038383018701C701CE00EE00EE00EE00EE00EE00EE00EE00EE00E701C701C383838 +381C700FE007C00F177E9614>I<0300030007000F003F00F70047000700070007000700 +07000700070007000700070007000700070007007FF07FF00C177C9614>I<0FC01FF038 +38701CE00EE00EE00E400E000E001C001C00380030007000E001C0030006000C00180E30 +0E7FFE7FFE0F177E9614>I<0FC01FF03838701C701C201C001C001C0038007007E007F0 +0038001C000E000E400EE00EE00E701C78383FF00FC00F177E9614>I<00780000F80001 +B80001B8000338000338000638000E38000C38001C3800383800303800703800E03800FF +FF80FFFF8000380000380000380000380000380001FF0001FF0011177F9614>I<3FFC7F +FC700070007000700070007000700077C07FF07838201C000C000E000E400EE00EE01C60 +1C78783FF00FC00F177E9614>I<01F007F80E1C1C1C381C300070007000E000E7C0EFF0 +F838F01CF00CE00EE00E600E700E700C381C1C380FF007C00F177E9614>I<0FE03FF878 +3C701CE00EE00EE00EE00E701C1EF003801FF03838701CE00EE00EE00EE00EF01E701C38 +381FF007C00F177E9614>56 D<70F8F8F87000000000000070F8F8F8700510798F14>58 +D<70F8F8F87000000000000060F0F8F878183070E0800515798F14>I<000E003E007C00 +F003E007C01F003E00F800F000F8003E001F0007C003E000F0007C003E000E0F137E9414 +>II<40 +00E000F8007C001E000F8007C001F000F8003E001E003E00F801F007C00F801E007C00F8 +00E00040000F157E9514>I<1FE03FF8701CE00EE00E400E003C007000E001C003800380 +038003800300000000000000000003000780078003000F177E9614>I<01E007F00E3818 +1C38FC71FC739E739EE70EE70EE70EE70EE70EE70EE70E739C739C71F838F018060E1E07 +F801F00F177E9614>I<01C00003E00003E0000360000360000770000770000770000770 +000630000E38000E38000E38000E38000E38001FFC001FFC001C1C001C1C003C1E00380E +00FE3F80FE3F8011177F9614>II<03C60FFE1C +3E181E381E700E700E600EE000E000E000E000E000E000E000600E700E700E380C181C1C +380FF003C00F177E9614>I70 +D72 D<1FF07FFC783C701CE00EE00EE00EE00EE00EE00EE00EE00EE00EE00EE00E +E00EE00EE00EE00E701C783C7FFC1FF00F177E9614>79 DI<0FCC1FFC307C603CE01CE01CE01CE00070007E003FE00FF001F8001C001E00 +0E600EE00EE00EF01CF838FFF0C7E00F177E9614>83 D<7FFF80FFFF80E1C380E1C380E1 +C380E1C38001C00001C00001C00001C00001C00001C00001C00001C00001C00001C00001 +C00001C00001C00001C00001C0000FF8000FF80011177F9614>III<7E +3E007E3E001C38001E38000E78000F700007F00007E00003E00003C00001C00003C00003 +E00003E0000770000770000E78000E38001C3C001C1C003C1E00FE3F80FE3F8011177F96 +14>88 D91 +DII95 +D<0818306060C0C0C0F0F87830050C799914>I<1FC0007FF000707800201800001C0000 +1C0007FC001FFC003C1C00701C00E01C00E01C00E01C00707C003FFF800F8F8011107E8F +14>II<03F80FFC1C1C380870006000E000E000E000E00060007000380E1C1E0F +FC03F00F107E8F14>I<007E00007E00000E00000E00000E00000E00000E0007CE000FFE +001C3E00301E00700E00E00E00E00E00E00E00E00E00E00E00E00E00700E00301E00383E +001FEFC007CFC012177F9614>I<07E00FF01C38301C700CE00EE00EFFFEFFFEE0006000 +7000380E1C1E0FFC03F00F107E8F14>I<007C00FE01CE03840380038003807FFEFFFE03 +80038003800380038003800380038003800380038003807FFC7FFC0F177F9614>I<07CF +001FFF80383B80301800701C00701C00701C003018003838003FF00037C0007000007000 +003FF8001FFC003FFE00700F00E00380E00380E00380E003807007003C1E001FFC0007F0 +0011197F8F14>II<030007800780030000000000000000007F807F8003800380 +0380038003800380038003800380038003800380FFFCFFFC0E187D9714>I107 +DI +II<07C01FF03C78701C701CE00EE00EE00E +E00EE00EE00E701C783C3C781FF007C00F107E8F14>II<03CE000FFE00 +1C3E00301E00700E00E00E00E00E00E00E00E00E00E00E00E00E00700E00301E001C3E00 +0FEE0007CE00000E00000E00000E00000E00000E00000E00007FC0007FC012187F8F14> +II<0FD83FF86038C038C038F0007F803FF0 +07F8001C6006E006F006F81CFFF8CFE00F107E8F14>I<030007000700070007007FFCFF +FC07000700070007000700070007000700070E070E070E070C03FC00F00F157F9414>I< +FC3F00FC3F001C07001C07001C07001C07001C07001C07001C07001C07001C07001C0700 +1C07001C1F000FFFE003E7E01310808F14>III<7E3F007E3F001E38000E7800077000 +07E00003E00001C00003C00003E0000770000E78000E38001C1C00FE3F80FE3F8011107F +8F14>II<3FFF7FFF700E701C7038007000E001C0038007000E001C0738 +077007FFFFFFFF10107F8F14>I<003E00FE01E003800380038003800380038003800380 +038003807F00FE007F00038003800380038003800380038003800380038001E000FE003E +0F1D7E9914>I<7800FE000F00038003800380038003800380038003800380038001FC00 +FE01FC03800380038003800380038003800380038003800F00FE0078000F1D7E9914> +125 D E /Ff 40 123 df<00FC000182000703000607000E02000E00000E00000E00000E +00000E0000FFFF000E07000E07000E07000E07000E07000E07000E07000E07000E07000E +07000E07000E07000E07000E07007F0FE0131A809915>12 D<60F0F07010101020204080 +040B7D830B>44 DI<60F0F06004047D830B>I<07801860303030 +3060186018E01CE01CE01CE01CE01CE01CE01CE01CE01CE01CE01CE01C60186018703830 +30186007800E187E9713>48 D<03000700FF000700070007000700070007000700070007 +0007000700070007000700070007000700070007000700FFF00C187D9713>I<0F801060 +20304038803CC01CE01C401C003C003800380070006000C0018001000200040408041004 +30083FF87FF8FFF80E187E9713>I<0F8010E02070607870382038007800700070006000 +C00F8000E000700038003C003CE03CE03CC03C4038407030E00F800E187E9713>I<0030 +0030007000F000F001700370027004700C7008701070307020704070C070FFFF00700070 +007000700070007007FF10187F9713>I<30183FF03FE03FC02000200020002000200027 +C03860203000380018001C001C401CE01CE01C80184038403030E00F800E187E9713>I< +01E006100C1818383038300070006000E000E7C0E860F030F018E018E01CE01CE01C601C +601C701830183030186007C00E187E9713>I<40007FFE7FFC7FFC400880108010802000 +4000400080018001800100030003000300030007000700070007000700070002000F197E +9813>I<078018603030201860186018601870103C303E600F8007C019F030F86038401C +C00CC00CC00CC00C6008201018600FC00E187E9713>I<07801860303070306018E018E0 +18E01CE01CE01C601C603C303C185C0F9C001C00180018003870307060604021801F000E +187E9713>I<60F0F060000000000000000060F0F06004107D8F0B>I<003F0201C0C60300 +2E0E001E1C000E1C0006380006780002700002700002F00000F00000F00000F00000F000 +00F000007000027000027800023800041C00041C00080E000803003001C0C0003F00171A +7E991C>67 D70 D73 D<3F8070C070E020700070007007F01C7030707070E070E071E071E0F1 +71FB1E3C10107E8F13>97 DI<07F80C1C381C30087000E0 +00E000E000E000E000E0007000300438080C1807E00E107F8F11>I<007E00000E00000E +00000E00000E00000E00000E00000E00000E00000E0003CE000C3E00380E00300E00700E +00E00E00E00E00E00E00E00E00E00E00E00E00600E00700E00381E001C2E0007CFC0121A +7F9915>I<07C01C3030187018600CE00CFFFCE000E000E000E0006000300438080C1807 +E00E107F8F11>I<01F0031807380E100E000E000E000E000E000E00FFC00E000E000E00 +0E000E000E000E000E000E000E000E000E000E000E007FE00D1A80990C>I<0FCE187330 +307038703870387038303018602FC02000600070003FF03FFC1FFE600FC003C003C003C0 +036006381C07E010187F8F13>II<18003C003C00180000 +0000000000000000000000FC001C001C001C001C001C001C001C001C001C001C001C001C +001C001C00FF80091A80990A>I107 +DIII<07E01C38300C700E6006E007E007E007E007E007E0076006700E381C1C38 +07E010107F8F13>II114 D<1F2060E04020C020C020F0007F003FC01FE0 +00F080708030C030C020F0408F800C107F8F0F>I<0400040004000C000C001C003C00FF +C01C001C001C001C001C001C001C001C001C201C201C201C201C200E4003800B177F960F +>III121 D<7FF86070407040E041C041C00380070007000E081C081C083810 +70107030FFF00D107F8F11>I E /Fg 3 106 df17 +D<00800180030003000300060006000C000C000C00180018001800300030006000600060 +00C000C000600060006000300030001800180018000C000C000C00060006000300030003 +000180008009267D9B0F>104 DI E /Fh +21 120 df45 D<60F0F0600404798312>I<001800380038 +0070007000E000E001C001C001C003800380070007000E000E001C001C001C0038003800 +70007000E000E000C0000D1A7E9612>I<0F803FC070E0E070E038E03840380038003000 +7000E000C00180030006000C00183830387FF87FF80D147E9312>50 +D<0FE03FF07838701C201C001C0038007807E007F00038001C000E000E400EE00EE01C78 +383FF00FC00F147F9312>I98 D<07F01FF8383870106000E000 +E000E000E0006000703838381FF007E00D0E7E8D12>I<00F800F8003800380038003807 +B81FF8387870386038E038E038E038E0386038707838781FFE0FBE0F147F9312>I<0780 +1FE0387070706038E038FFF8FFF8E0006000703838381FF007C00D0E7E8D12>I<0F9E1F +FF38E7707070707070707038E03FC03F8070003FE03FF83FFC701EE00EE00EE00E600C78 +3C1FF00FE010167F8D12>103 DI<06000F000F000600000000 +000000FF00FF000700070007000700070007000700070007000700FFF0FFF00C157D9412 +>I108 D110 D<0F803FE038E07070E038E038E038E038E038F078 +707038E03FE00F800D0E7E8D12>II114 +D<1FF03FF06070C070E0007F003FE00FF000786018E018F030FFE0DFC00D0E7E8D12>I< +06000E000E000E007FF8FFF80E000E000E000E000E000E000E000E380E380E3807F003C0 +0D127F9112>II119 D E /Fi 5 54 df<0C003C00CC000C000C000C000C000C000C000C000C00 +0C000C000C000C00FF8009107E8F0F>49 D<1F00618040C08060C0600060006000C00180 +030006000C00102020207FC0FFC00B107F8F0F>I<1F00218060C060C000C0008001800F +00008000400060C060C060804060801F000B107F8F0F>I<0300030007000F000B001300 +330023004300C300FFE003000300030003001FE00B107F8F0F>I<20803F002C00200020 +0020002F0030802040006000600060C06080C061801F000B107F8F0F>I +E /Fj 64 123 df<00FC000782000E07001C07001C02001C00001C00001C00001C0000FF +FF001C07001C07001C07001C07001C07001C07001C07001C07001C07001C07001C07001C +0700FF1FE01317809614>12 D<60C0F1E0F1E070E01020102020402040408040800B0A7F +9612>34 D<01C0000320000610000E10000E10000E10000E20000E40000E80000780FE07 +00380700200B802013804031C04061E08060E100E07100E03A00E01C02700E0238370C0F +C1F817177F961B>38 D<60F0F070101020204040040A7D960A>I<0102040C1818303070 +606060E0E0E0E0E0E0E0E0E0E060606070303018180C04020108227D980E>I<80402030 +18180C0C0E060606070707070707070707070606060E0C0C18183020408008227E980E> +I<60F0F070101020204040040A7D830A>44 DI<60F0F0600404 +7D830A>I<07C018303018701C600C600CE00EE00EE00EE00EE00EE00EE00EE00EE00E60 +0C600C701C30181C7007C00F157F9412>48 D<03000700FF000700070007000700070007 +00070007000700070007000700070007000700070007007FF00C157E9412>I<0F8030E0 +40708030C038E0384038003800700070006000C00180030006000C08080810183FF07FF0 +FFF00D157E9412>I<0FE030306018701C701C001C00180038006007E000300018000C00 +0E000EE00EE00EC00C401830300FE00F157F9412>I<00300030007000F001F001700270 +047008701870107020704070C070FFFE0070007000700070007003FE0F157F9412>I<20 +303FE03FC0240020002000200020002F8030E020700030003800384038E038E038803040 +6020C01F000D157E9412>I<01F00608080C181C301C70006000E000E3E0EC30F018F00C +E00EE00EE00E600E600E300C3018183007C00F157F9412>I<40007FFE7FFC7FF8C00880 +1080200040008000800100010003000200060006000E000E000E000E000E0004000F167E +9512>I<07E018302018600C600C700C78183E101F600FC00FF018F8607C601EC00EC006 +C006C004600C38300FE00F157F9412>I<07C0183030186018E00CE00CE00EE00EE00E60 +1E301E186E0F8E000E000C001C70187018603020C01F800F157F9412>I<60F0F0600000 +0000000060F0F07010102020404004147D8D0A>59 D<001000003800003800003800005C +00005C00005C00008E00008E00008E0001070001070003078002038002038007FFC00401 +C00401C00800E00800E01800E03800F0FE03FE17177F961A>65 DI<00FC100383 +300E00B01C0070380030300030700010600010E00010E00000E00000E00000E00000E000 +00E000106000107000103000203800201C00400E008003830000FC0014177E9619>IIII73 +D75 D77 +DI<00FC000303000E01C01C00E0380070300030700038600018E0001CE0001CE0 +001CE0001CE0001CE0001CE0001C7000387000383000303800701C00E00E01C003030000 +FC0016177E961B>II82 D<0FC4302C601C400CC004C004C004E0007000 +7F003FE00FF801FC001C000E0006800680068006C004E008D81087E00F177E9614>I<7F +FFF860381840380840380880380480380480380400380000380000380000380000380000 +380000380000380000380000380000380000380000380000380000380007FFC016177F96 +19>II87 D<204020404080408081008100E1C0 +F1E0F1E060C00B0A7B9612>92 D<1FC0386038301038003803F81E3830387038E039E039 +E07970FF1F1E100E7F8D12>97 DI<07F01838303870106000E000E000E000E000 +600070083008183007C00D0E7F8D10>I<007E00000E00000E00000E00000E00000E0000 +0E00000E00000E0007CE001C3E00300E00700E00600E00E00E00E00E00E00E00E00E0060 +0E00700E00301E00182E0007CFC012177F9614>I<0FC0186030307038E018FFF8E000E0 +00E000600070083010183007C00D0E7F8D10>I<03E006700E701C201C001C001C001C00 +1C00FF801C001C001C001C001C001C001C001C001C001C001C001C00FF800C1780960B> +I<0F9E18E33060707070707070306018C02F80200060003FE03FF83FFC600EC006C006C0 +06600C38380FE010157F8D12>II<183C3C1800000000007C1C1C1C1C1C1C1C1C +1C1C1C1CFF081780960A>I<0300078007800300000000000000000000001F8003800380 +03800380038003800380038003800380038003800380038003804380E300E7007C00091D +82960B>IIIII<07C018303018 +600C600CE00EE00EE00EE00EE00E701C3018183007C00F0E7F8D12>II<07C2001C2600381E00700E00 +600E00E00E00E00E00E00E00E00E00600E00700E00301E001C2E0007CE00000E00000E00 +000E00000E00000E00007FC012147F8D13>II<1F4060C0C040C040E000FF007F801FC001E0 +80608060C060E0C09F000B0E7F8D0E>I<080008000800180018003800FF803800380038 +00380038003800380038403840384038401C800F000A147F930E>IIIIIII E +/Fk 1 4 df<0C000C008C40EDC07F800C007F80EDC08C400C000C000A0B7D8B10>3 +D E /Fl 39 122 df<000FF000007FFC0001F80E0003E01F0007C03F000F803F000F803F +000F801E000F800C000F8000000F8000000F8000000F800000FFFFFF00FFFFFF000F801F +000F801F000F801F000F801F000F801F000F801F000F801F000F801F000F801F000F801F +000F801F000F801F000F801F000F801F000F801F000F801F000F801F000F801F007FF0FF +E07FF0FFE01B237FA21F>12 D<387CFEFEFE7C3807077C8610>46 +D<00180000780001F800FFF800FFF80001F80001F80001F80001F80001F80001F80001F8 +0001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F8 +0001F80001F80001F80001F80001F80001F8007FFFE07FFFE013207C9F1C>49 +D<03FC000FFF003C1FC07007E07C07F0FE03F0FE03F8FE03F8FE01F87C01F83803F80003 +F80003F00003F00007E00007C0000F80001F00003E0000380000700000E01801C0180380 +180700180E00380FFFF01FFFF03FFFF07FFFF0FFFFF0FFFFF015207D9F1C>I<00FE0007 +FFC00F07E01E03F03F03F03F81F83F81F83F81F81F03F81F03F00003F00003E00007C000 +1F8001FE0001FF000007C00001F00001F80000FC0000FC3C00FE7E00FEFF00FEFF00FEFF +00FEFF00FC7E01FC7801F81E07F00FFFC001FE0017207E9F1C>I<0000E00001E00003E0 +0003E00007E0000FE0001FE0001FE00037E00077E000E7E001C7E00187E00307E00707E0 +0E07E00C07E01807E03807E07007E0E007E0FFFFFEFFFFFE0007E00007E00007E00007E0 +0007E00007E00007E000FFFE00FFFE17207E9F1C>I<1000201E01E01FFFC01FFF801FFF +001FFE001FF8001BC00018000018000018000018000019FC001FFF001E0FC01807E01803 +E00003F00003F00003F80003F83803F87C03F8FE03F8FE03F8FC03F0FC03F07007E03007 +C01C1F800FFF0003F80015207D9F1C>I<001F8000FFE003F07007C0F00F01F81F01F83E +01F83E01F87E00F07C00007C0000FC0800FC7FC0FCFFE0FD80F0FF00F8FE007CFE007CFC +007EFC007EFC007EFC007E7C007E7C007E7C007E3C007C3E007C1E00F80F00F00783E003 +FFC000FF0017207E9F1C>I<6000007800007FFFFE7FFFFE7FFFFC7FFFF87FFFF87FFFF0 +E00060E000C0C00180C00300C00300000600000C00001C00001800003800007800007800 +00F00000F00000F00001F00001F00001F00003F00003F00003F00003F00003F00003F000 +03F00001E00017227DA11C>I<00FE0003FFC00703E00E00F01C00F01C00783C00783E00 +783F00783F80783FE0F01FF9E01FFFC00FFF8007FFC003FFE007FFF01E7FF83C1FFC7807 +FC7801FEF000FEF0003EF0001EF0001EF0001CF8001C7800383C00381F01F00FFFC001FF +0017207E9F1C>I69 DI<0003FE0040001FFFC0C0007F00F1C001F8003FC003F0000FC007C00007 +C00FC00003C01F800003C03F000001C03F000001C07F000000C07E000000C07E000000C0 +FE00000000FE00000000FE00000000FE00000000FE00000000FE00000000FE00000000FE +000FFFFC7E000FFFFC7F00001FC07F00001FC03F00001FC03F00001FC01F80001FC00FC0 +001FC007E0001FC003F0001FC001FC003FC0007F80E7C0001FFFC3C00003FF00C026227D +A12C>I77 +DI<0007 +FC0000003FFF800000FC07E00003F001F80007E000FC000FC0007E001F80003F001F8000 +3F003F00001F803F00001F807F00001FC07E00000FC07E00000FC0FE00000FE0FE00000F +E0FE00000FE0FE00000FE0FE00000FE0FE00000FE0FE00000FE0FE00000FE0FE00000FE0 +7E00000FC07F00001FC07F00001FC03F00001F803F80003F801F80003F000FC0007E0007 +E000FC0003F001F80000FC07E000003FFF80000007FC000023227DA12A>II<01FC0407FF8C +1F03FC3C007C7C003C78001C78001CF8000CF8000CFC000CFC0000FF0000FFE0007FFF00 +7FFFC03FFFF01FFFF80FFFFC03FFFE003FFE0003FF00007F00003F00003FC0001FC0001F +C0001FE0001EE0001EF0003CFC003CFF00F8C7FFE080FF8018227DA11F>83 +D<7FFFFFFF807FFFFFFF807E03F80F807803F807807003F803806003F80180E003F801C0 +E003F801C0C003F800C0C003F800C0C003F800C0C003F800C00003F800000003F8000000 +03F800000003F800000003F800000003F800000003F800000003F800000003F800000003 +F800000003F800000003F800000003F800000003F800000003F800000003F800000003F8 +00000003F800000003F800000003F8000003FFFFF80003FFFFF80022227EA127>I86 +D<07FC001FFF803F07C03F03E03F01E03F01F01E01F00001F00001F0003FF003FDF01FC1 +F03F01F07E01F0FC01F0FC01F0FC01F0FC01F07E02F07E0CF81FF87F07E03F18167E951B +>97 DI<00FF8007FFE00F83F01F03F03E03F07E03F07C01E07C0000FC0000FC0000 +FC0000FC0000FC0000FC00007C00007E00007E00003E00301F00600FC0E007FF8000FE00 +14167E9519>I<0001FE000001FE0000003E0000003E0000003E0000003E0000003E0000 +003E0000003E0000003E0000003E0000003E0000003E0001FC3E0007FFBE000F81FE001F +007E003E003E007E003E007C003E00FC003E00FC003E00FC003E00FC003E00FC003E00FC +003E00FC003E00FC003E007C003E007C003E003E007E001E00FE000F83BE0007FF3FC001 +FC3FC01A237EA21F>I<00FE0007FF800F87C01E01E03E01F07C00F07C00F8FC00F8FC00 +F8FFFFF8FFFFF8FC0000FC0000FC00007C00007C00007E00003E00181F00300FC07003FF +C000FF0015167E951A>I<003F8000FFC001E3E003C7E007C7E00F87E00F83C00F80000F +80000F80000F80000F80000F8000FFFC00FFFC000F80000F80000F80000F80000F80000F +80000F80000F80000F80000F80000F80000F80000F80000F80000F80000F80000F80000F +80007FF8007FF80013237FA211>I104 D<1C003E007F007F007F003E001C000000 +000000000000000000000000FF00FF001F001F001F001F001F001F001F001F001F001F00 +1F001F001F001F001F001F001F001F00FFE0FFE00B247EA310>I108 +DII<00FE0007FFC00F83E01E00F03E00F87C00 +7C7C007C7C007CFC007EFC007EFC007EFC007EFC007EFC007EFC007E7C007C7C007C3E00 +F81F01F00F83E007FFC000FE0017167E951C>II114 D<0FF3003FFF00781F00600700E00300E00300F00300FC +00007FE0007FF8003FFE000FFF0001FF00000F80C00780C00380E00380E00380F00700FC +0E00EFFC00C7F00011167E9516>I<018000018000018000018000038000038000078000 +0780000F80003F8000FFFF00FFFF000F80000F80000F80000F80000F80000F80000F8000 +0F80000F80000F80000F80000F81800F81800F81800F81800F81800F830007C30003FE00 +00F80011207F9F16>III121 D E /Fm 5 54 df<0C001C00EC000C000C000C000C000C00 +0C000C000C000C000C000C000C000C000C000C00FFC00A137D9211>49 +D<1F0060C06060F070F030603000700070006000C001C00180020004000810101020207F +E0FFE00C137E9211>I<0FC030707038703870380038003000E00FC0007000380018001C +601CF01CF018E03860701FC00E137F9211>I<006000E000E00160026006600C60086010 +6020606060C060FFFC0060006000600060006003FC0E137F9211>I<60607FC07F804400 +4000400040004F0070C040E0006000700070E070E070E06040E021C01F000C137E9211> +I E /Fn 53 123 df<0387000387000387000387000387000387007FFFC0FFFFE0FFFFE0 +070E00070E00070E000E1C000E1C000E1C000E1C00FFFFE0FFFFE07FFFC01C38001C3800 +1C38001C38001C38001C380013197F9816>35 D<00E001E0038007000E001C001C003800 +3800700070007000E000E000E000E000E000E000E000E000E00070007000700038003800 +1C001C000E000700038001E000E00B217A9C16>40 DI<01C00001C00001C00001C00071 +C700F9CF807FFF001FFC0007F00007F0001FFC007FFF00F9CF8071C70001C00001C00001 +C00001C00011127E9516>I<387C7E7E3E0E1E1C78F060070B798416>44 +DI<70F8F8F8700505788416>I<0001800003800003 +80000700000700000E00000E00001C00001C0000380000380000700000700000E00000E0 +0001C00001C0000380000380000700000700000E00000E00001C00001C00003800003800 +00700000700000E00000E00000C0000011207E9C16>I<03E0000FF8001FFC001E3C0038 +0E00780F00700700700700E00380E00380E00380E00380E00380E00380E00380E00380F0 +0780700700700700780F003C1E001E3C001FFC000FF80003E00011197E9816>I<018003 +80038007800F807F80FF8073800380038003800380038003800380038003800380038003 +80038003807FF87FFC7FF80E197C9816>I<07E0001FF8003FFC00783E00E00700F00780 +F00380600380000380000380000700000700000E00001C0000380000700000E00001C000 +0380000F00001E03803803807FFF80FFFF807FFF8011197E9816>I<07E0001FF8003FFC +00781E00780700300700000700000700000E00003E0007FC0007F00007FC00001E000007 +00000300000380000380600380F00380E00700781E003FFC001FF80007E00011197E9816 +>I<007C0000FC0000DC0001DC00039C00039C00071C000F1C000E1C001E1C003C1C0038 +1C00781C00F01C00FFFFE0FFFFE0FFFFE0001C00001C00001C00001C00001C0001FFC001 +FFC001FFC013197F9816>I<70F8F8F870000000000000000070F8F8F8700512789116> +58 D<7FFF00FFFF80FFFF80000000000000000000000000000000FFFF80FFFF807FFF00 +110B7E9116>61 D<0FE03FF87FFCF01EF00EF00E601E003C007800F001C0038003800380 +038003800300000000000000000003000780078003000F197D9816>63 +D<00F80003FC0007FE000F07001C3F80387F8078FF8071C3C071C3C0E381C0E381C0E381 +C0E381C0E381C0E381C0E381C071C38071C38078FF00387E001C3C000F03C007FFC003FF +0000FC0012197E9816>I<00E00001F00001F00001B00001B00003B80003B80003B80003 +1800071C00071C00071C00071C00071C000E0E000E0E000FFE000FFE001FFF001C07001C +07001C07007F1FC0FF1FE07F1FC013197F9816>I<7FF800FFFE007FFF001C0F001C0780 +1C03C01C01C01C01C01C01E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E0 +1C01C01C01C01C03C01C07801C0F807FFF00FFFE007FF8001319809816>68 +D<7FFFC0FFFFC07FFFC01C01C01C01C01C01C01C01C01C00001C00001C1C001C1C001FFC +001FFC001FFC001C1C001C1C001C00001C00E01C00E01C00E01C00E01C00E07FFFE0FFFF +E07FFFE013197F9816>II<7FE000FFF8007FFC001C1E001C0F00 +1C07001C07001C07001C07001C0F001C1E001FFC001FF8001FFC001C1C001C0E001C0E00 +1C0E001C0E001C0E201C0E701C0E707F07E0FF87E07F03C014197F9816>82 +D<07E3001FFF003FFF00781F00F00700E00700E00700E00000F000007800003F80001FF0 +0007FC0000FE00000F00000700000380000380600380E00380E00700F80F00FFFE00FFFC +00C7F00011197E9816>I86 D<7F1F807F3F807F1F800E1E000E1C +00073C0007380003B80003F00001F00001E00000E00001E00001F00003F00003B80007B8 +00071C00071C000E0E000E0E001C07007F1FC0FF1FE07F1FC013197F9816>88 +DI91 D93 D95 +D<1FE0003FF0007FF800783C00300E00000E00000E0003FE001FFE003E0E00700E00E00E +00E00E00E00E00783E007FFFE03FE7E00F83E013127E9116>97 D<7E0000FE00007E0000 +0E00000E00000E00000E00000E3E000EFF000FFF800F83C00F00E00E00E00E00700E0070 +0E00700E00700E00700E00700E00E00F01E00F83C00FFF800EFF00063C001419809816> +I<03F80FFC1FFE3C1E780C7000E000E000E000E000E000F000700778073E0E1FFC0FF803 +F010127D9116>I<003F00007F00003F0000070000070000070000070003C7000FF7001F +FF003C1F00780F00700700E00700E00700E00700E00700E00700E00700700F00700F003C +1F001FFFE00FE7F007C7E014197F9816>I<03E00FF81FFC3C1E780E7007E007FFFFFFFF +FFFFE000E000700778073C0F1FFE0FFC03F010127D9116>I<001F00007F8000FF8001E7 +8001C30001C00001C0007FFF00FFFF00FFFF0001C00001C00001C00001C00001C00001C0 +0001C00001C00001C00001C00001C00001C0003FFE007FFF003FFE0011197F9816>I<03 +E3C007F7E00FFFE01C1CC0380E00380E00380E00380E00380E001C1C000FF8001FF0001B +E0003800001800001FFC001FFF003FFF807803C0E000E0E000E0E000E0E000E07001C07C +07C03FFF800FFE0003F800131C7F9116>I<7E0000FE00007E00000E00000E00000E0000 +0E00000E3C000EFE000FFF000F87800F03800E03800E03800E03800E03800E03800E0380 +0E03800E03800E03800E03807FC7F0FFE7F87FC7F01519809816>I<018003C003C00180 +00000000000000007FC07FC07FC001C001C001C001C001C001C001C001C001C001C001C0 +01C07FFFFFFF7FFF101A7D9916>I<7E0000FE00007E00000E00000E00000E00000E0000 +0E7FE00E7FE00E7FE00E0F000E1E000E3C000E78000EF0000FF0000FF8000FBC000F1E00 +0E0E000E07000E07807F87F0FFCFF07F87F01419809816>107 D +II<7E3C00FEFE007FFF000F +87800F03800E03800E03800E03800E03800E03800E03800E03800E03800E03800E03807F +C7F0FFE7F87FC7F01512809116>I<03E0000FF8001FFC003C1E00780F00700700E00380 +E00380E00380E00380E00380F00780700700780F003C1E001FFC000FF80003E00011127E +9116>I<7E3E00FEFF007FFF800F83C00F00E00E00E00E00700E00700E00700E00700E00 +700E00700E00E00F01E00F83C00FFF800EFF000E3C000E00000E00000E00000E00000E00 +000E00007FC000FFE0007FC000141B809116>I114 D<0FEC3FFC7FFCF03CE01CE01C70007F801FF007F8003C600EE0 +0EF00EF81EFFFCFFF8C7E00F127D9116>I<0300000700000700000700000700007FFF00 +FFFF00FFFF00070000070000070000070000070000070000070000070100070380070380 +07038007870003FE0001FC0000F80011177F9616>I<7E1F80FE3F807E1F800E03800E03 +800E03800E03800E03800E03800E03800E03800E03800E03800E03800E0F800FFFF007FB +F803E3F01512809116>I<7F1FC0FF1FE07F1FC01C07001E0F000E0E000E0E000E0E0007 +1C00071C00071C00071C0003B80003B80003B80001F00001F00000E00013127F9116>I< +FF1FE0FFBFE0FF1FE038038038038038038038038038E38019F30019F30019B3001DB700 +1DB7001DB7001DB7000F1E000F1E000F1E0013127F9116>I<7F1FC07F3FC07F1FC00F1C +00073C0003B80003F00001F00000E00001E00001F00003B800073C00071C000E0E007F1F +C0FF3FE07F1FC013127F9116>I<7F1FC0FF9FE07F1FC01C07000E07000E0E000E0E0007 +0E00071C00071C00039C00039C0003980001B80001B80000F00000F00000F00000E00000 +E00000E00001C00079C0007BC0007F80003F00003C0000131B7F9116>I<3FFFC07FFFC0 +7FFFC0700780700F00701E00003C0000780001F00003E0000780000F00001E01C03C01C0 +7801C0FFFFC0FFFFC0FFFFC012127F9116>I E /Fo 1 98 df<00200000700000700000 +700000B80000B80000B800011C00011C00011C00020E00020E0004070004070007FF0008 +03800803800803801801C03803C0FE0FF815157F9419>97 D E /Fp +27 120 df<183C3C3C0404080810204080060C779C0D>39 D<1838783808081010204040 +80050C7D830D>44 D<01FFFFE0003C00E000380060003800400038004000380040007000 +4000700040007020400070200000E0400000E0400000E0C00000FFC00001C0800001C080 +0001C0800001C0800003810100038001000380020003800200070004000700040007000C +00070018000E007800FFFFF0001B1C7D9B1C>69 D<01FFFFC0003C01C0003800C0003800 +8000380080003800800070008000700080007020800070200000E0400000E0400000E0C0 +0000FFC00001C0800001C0800001C0800001C08000038100000380000003800000038000 +00070000000700000007000000070000000F000000FFF000001A1C7D9B1B>I<0003F020 +001E0C60003002E000E003C001C001C0038001C0070000C00E0000801E0000801C000080 +3C0000803C000000780000007800000078000000F0000000F0000000F001FFC0F0001E00 +F0001C00F0001C00F0001C00F0001C00700038007000380038003800180078000C009000 +0707100001F800001B1E7A9C20>I<01FFC0003C00003800003800003800003800007000 +00700000700000700000E00000E00000E00000E00001C00001C00001C00001C000038000 +0380000380000380000700000700000700000700000F0000FFE000121C7E9B10>73 +D<01FE0007F8003E000780002E000F00002E001700002E001700002E002700004E002E00 +004E004E00004E004E00004E008E00008E011C00008E011C00008E021C00008E021C0001 +070438000107043800010708380001071038000207107000020720700002072070000207 +407000040740E000040780E000040700E0000C0700E0001C0601E000FF861FFC00251C7D +9B25>77 D<01FC03FE001C0070003C0060002E0040002E0040002E004000470080004700 +8000470080004380800083810000838100008181000081C1000101C2000101C2000100E2 +000100E2000200E4000200740002007400020074000400380004003800040038000C0018 +001C001000FF8010001F1C7D9B1F>I<0007F000001C1C0000700E0000E0070001C00380 +03800380070003800E0003C01E0003C01C0003C03C0003C03C0003C0780003C0780003C0 +780003C0F0000780F0000780F0000780F0000F00F0000F00F0000E00F0001E00F0003C00 +70003800700070007800E0003801C0001C0380000E0E000003F800001A1E7A9C20>I<7F +F0FF800F001C000E0018000E0010000E0010000E0010001C0020001C0020001C0020001C +0020003800400038004000380040003800400070008000700080007000800070008000E0 +010000E0010000E0010000E0020000E0020000E0040000E0040000600800003030000010 +4000000F800000191D779B1F>85 D<03CC063C0C3C181C3838303870387038E070E070E0 +70E070E0E2C0E2C0E261E462643C380F127B9115>97 D<01F007080C08181C3838300070 +007000E000E000E000E000E000E008E010602030C01F000E127B9113>99 +D<001F80000380000380000700000700000700000700000E00000E00000E00000E0003DC +00063C000C3C00181C00383800303800703800703800E07000E07000E07000E07000E0E2 +00C0E200C0E20061E4006264003C3800111D7B9C15>I<01E007100C1018083810701070 +607F80E000E000E000E000E000E0086010602030C01F000D127B9113>I<0003C0000670 +000C70001C60001C00001C0000380000380000380000380000380003FF80007000007000 +00700000700000700000E00000E00000E00000E00000E00001C00001C00001C00001C000 +01C000038000038000038000030000030000070000C60000E60000CC0000780000142581 +9C0D>I<01800380010000000000000000000000000000001C002600470047008E008E00 +0E001C001C001C0038003800710071007100720072003C00091C7C9B0D>105 +D<1F800380038007000700070007000E000E000E000E001C001C001C001C003800380038 +0038007000700070007000E400E400E400E40068003800091D7C9C0B>108 +D<3C1E0780266318C04683A0E04703C0E08E0380E08E0380E00E0380E00E0380E01C0701 +C01C0701C01C0701C01C070380380E0388380E0388380E0708380E0710701C0320300C01 +C01D127C9122>I<3C3C002646004687004707008E07008E07000E07000E07001C0E001C +0E001C0E001C1C00381C40381C40383840383880701900300E0012127C9117>I<01E007 +180C0C180C380C300E700E700EE01CE01CE01CE018E038E030E06060C031801E000F127B +9115>I<07870004D98008E0C008E0C011C0E011C0E001C0E001C0E00381C00381C00381 +C00381800703800703000707000706000E8C000E70000E00000E00001C00001C00001C00 +001C00003C0000FF8000131A7F9115>I<3C3C26C2468747078E068E000E000E001C001C +001C001C0038003800380038007000300010127C9112>114 D<01F006080C080C1C1818 +1C001F001FC00FF007F0007800386030E030C030806060C01F000E127D9111>I<00C001 +C001C001C00380038003800380FFE00700070007000E000E000E000E001C001C001C001C +00384038403840388019000E000B1A7D990E>I<1E0300270700470700470700870E0087 +0E000E0E000E0E001C1C001C1C001C1C001C1C003838803838801838801839001C590007 +8E0011127C9116>I<1E06270E470E4706870287020E020E021C041C041C041C08180838 +08181018200C4007800F127C9113>I<1E01832703874703874703838707018707010E07 +010E07011C0E021C0E021C0E021C0E04180C04181C04181C081C1C100C263007C3C01812 +7C911C>I E /Fq 75 124 df<007E1F0001C1B1800303E3C00703C3C00E03C1800E01C0 +000E01C0000E01C0000E01C0000E01C0000E01C000FFFFFC000E01C0000E01C0000E01C0 +000E01C0000E01C0000E01C0000E01C0000E01C0000E01C0000E01C0000E01C0000E01C0 +000E01C0000E01C0000E01C0000E01C0007F87FC001A1D809C18>11 +D<007E0001C1800301800703C00E03C00E01800E00000E00000E00000E00000E0000FFFF +C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01 +C00E01C00E01C00E01C00E01C07F87F8151D809C17>I<007FC001C1C00303C00703C00E +01C00E01C00E01C00E01C00E01C00E01C00E01C0FFFFC00E01C00E01C00E01C00E01C00E +01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C07F +CFF8151D809C17>I<003F07E00001C09C18000380F018000701F03C000E01E03C000E00 +E018000E00E000000E00E000000E00E000000E00E000000E00E00000FFFFFFFC000E00E0 +1C000E00E01C000E00E01C000E00E01C000E00E01C000E00E01C000E00E01C000E00E01C +000E00E01C000E00E01C000E00E01C000E00E01C000E00E01C000E00E01C000E00E01C00 +0E00E01C007FC7FCFF80211D809C23>I<6060F0F0F8F868680808080808081010101020 +20404080800D0C7F9C15>34 D<00E0000001900000030800000308000007080000070800 +0007080000070800000710000007100000072000000740000003C03FE003800F00038006 +000380040005C0040009C0080010E0100030E010006070200060702000E0384000E03C40 +00E01C8000E00F0020E0070020700780403009C0401830E18007C03E001B1F7E9D20>38 +D<60F0F8680808081010204080050C7C9C0C>I<004000800100020006000C000C001800 +1800300030007000600060006000E000E000E000E000E000E000E000E000E000E000E000 +E000600060006000700030003000180018000C000C00060002000100008000400A2A7D9E +10>I<800040002000100018000C000C000600060003000300038001800180018001C001 +C001C001C001C001C001C001C001C001C001C001C0018001800180038003000300060006 +000C000C00180010002000400080000A2A7E9E10>I<60F0F0701010101020204080040C +7C830C>44 DI<60F0F06004047C830C>I<000100030006000600 +06000C000C000C0018001800180030003000300060006000C000C000C001800180018003 +0003000300060006000C000C000C00180018001800300030003000600060006000C000C0 +0010297E9E15>I<03C00C301818300C300C700E60066006E007E007E007E007E007E007 +E007E007E007E007E007E007E00760066006700E300C300C18180C3007E0101D7E9B15> +I<030007003F00C700070007000700070007000700070007000700070007000700070007 +00070007000700070007000700070007000F80FFF80D1C7C9B15>I<07C01830201C400C +400EF00FF80FF807F8077007000F000E000E001C001C00380070006000C0018003000601 +0C01180110023FFE7FFEFFFE101C7E9B15>I<07E01830201C201C781E780E781E381E00 +1C001C00180030006007E00030001C001C000E000F000F700FF80FF80FF80FF00E401C20 +1C183007E0101D7E9B15>I<000C00000C00001C00003C00003C00005C0000DC00009C00 +011C00031C00021C00041C000C1C00081C00101C00301C00201C00401C00C01C00FFFFC0 +001C00001C00001C00001C00001C00001C00001C0001FFC0121C7F9B15>I<300C3FF83F +F03FC020002000200020002000200023E024302818301C200E000E000F000F000F600FF0 +0FF00FF00F800E401E401C2038187007C0101D7E9B15>I<00F0030C06040C0E181E301E +300C700070006000E3E0E430E818F00CF00EE006E007E007E007E007E007600760077006 +300E300C18180C3003E0101D7E9B15>I<4000007FFF807FFF007FFF0040020080040080 +040080080000100000100000200000600000400000C00000C00001C00001800001800003 +8000038000038000038000078000078000078000078000078000078000030000111D7E9B +15>I<03E00C301008200C20066006600660067006780C3E083FB01FE007F007F818FC30 +7E601E600FC007C003C003C003C00360026004300C1C1007E0101D7E9B15>I<03C00C30 +1818300C700C600EE006E006E007E007E007E007E0076007700F300F18170C2707C70006 +0006000E300C780C78187010203030C00F80101D7E9B15>I<60F0F06000000000000000 +00000060F0F06004127C910C>I<60F0F0600000000000000000000060F0F07010101010 +20204080041A7C910C>I<0FE03038401CE00EF00EF00EF00E000C001C0030006000C000 +8001800100010001000100010001000000000000000000000003000780078003000F1D7E +9C14>63 D<000600000006000000060000000F0000000F0000000F000000178000001780 +00001780000023C0000023C0000023C0000041E0000041E0000041E0000080F0000080F0 +000180F8000100780001FFF80003007C0002003C0002003C0006003E0004001E0004001E +000C001F001E001F00FF80FFF01C1D7F9C1F>65 DI<001F808000E0618001801980070007800E0003801C0003801C00018038000180 +780000807800008070000080F0000000F0000000F0000000F0000000F0000000F0000000 +F0000000F0000000700000807800008078000080380000801C0001001C0001000E000200 +070004000180080000E03000001FC000191E7E9C1E>IIII< +001F808000E0618001801980070007800E0003801C0003801C0001803800018078000080 +7800008070000080F0000000F0000000F0000000F0000000F0000000F0000000F000FFF0 +F0000F80700007807800078078000780380007801C0007801C0007800E00078007000B80 +0180118000E06080001F80001C1E7E9C21>III75 +DIII<003F +800000E0E0000380380007001C000E000E001C0007003C00078038000380780003C07800 +03C0700001C0F00001E0F00001E0F00001E0F00001E0F00001E0F00001E0F00001E0F000 +01E0700001C0780003C0780003C0380003803C0007801C0007000E000E0007001C000380 +380000E0E000003F80001B1E7E9C20>II< +FFFF00000F01E0000F0078000F003C000F001C000F001E000F001E000F001E000F001E00 +0F001C000F003C000F0078000F01E0000FFF00000F03C0000F00E0000F00F0000F007800 +0F0078000F0078000F0078000F0078000F0078000F0078100F0078100F0038100F003C20 +FFF01C20000007C01C1D7E9B1F>82 D<07E0801C1980300580700380600180E00180E000 +80E00080E00080F00000F800007C00007FC0003FF8001FFE0007FF0000FF80000F800007 +C00003C00001C08001C08001C08001C0C00180C00180E00300D00200CC0C0083F800121E +7E9C17>I<7FFFFFC0700F01C0600F00C0400F0040400F0040C00F0020800F0020800F00 +20800F0020000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F00 +00000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F00 +00001F800003FFFC001B1C7F9B1E>II87 D<7FF0FFC00FC03E000780180003C0180003E0100001E0200001F0600000F04000 +00788000007D8000003D0000001E0000001F0000000F0000000F8000000F80000013C000 +0023E0000021E0000041F00000C0F8000080780001007C0003003C0002001E0006001F00 +1F003F80FFC0FFF01C1C7F9B1F>I<08081010202040404040808080808080B0B0F8F878 +7830300D0C7A9C15>92 D<1FC000307000783800781C00301C00001C00001C0001FC000F +1C00381C00701C00601C00E01C40E01C40E01C40603C40304E801F870012127E9115>97 +DI<07E00C301878307870306000E0 +00E000E000E000E000E00060007004300418080C3007C00E127E9112>I<003F00000700 +00070000070000070000070000070000070000070000070000070003E7000C1700180F00 +300700700700600700E00700E00700E00700E00700E00700E00700600700700700300700 +180F000C370007C7E0131D7E9C17>I<03E00C301818300C700E6006E006FFFEE000E000 +E000E00060007002300218040C1803E00F127F9112>I<00F8018C071E061E0E0C0E000E +000E000E000E000E00FFE00E000E000E000E000E000E000E000E000E000E000E000E000E +000E000E000E007FE00F1D809C0D>I<00038003C4C00C38C01C3880181800381C00381C +00381C00381C001818001C38000C300013C0001000003000001800001FF8001FFF001FFF +803003806001C0C000C0C000C0C000C06001803003001C0E0007F800121C7F9215>II<18003C003C00180000000000000000 +00000000000000FC001C001C001C001C001C001C001C001C001C001C001C001C001C001C +001C001C00FF80091D7F9C0C>I<00C001E001E000C00000000000000000000000000000 +0FE000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E0 +00E000E000E060E0F0C0F1C061803E000B25839C0D>IIIII<03F0000E1C00180600300300700380600180E001 +C0E001C0E001C0E001C0E001C0E001C06001807003803003001806000E1C0003F0001212 +7F9115>II<03C1000C3300180B00300F00700700700700 +E00700E00700E00700E00700E00700E00700600700700700300F00180F000C370007C700 +000700000700000700000700000700000700000700003FE0131A7E9116>II<1F9030704030C010C010E010F8007F803FE00FF000F880388018C018C018E010D060 +8FC00D127F9110>I<04000400040004000C000C001C003C00FFE01C001C001C001C001C +001C001C001C001C001C101C101C101C101C100C100E2003C00C1A7F9910>IIII<7F8FF00F03800F030007020003840001C80001 +D80000F00000700000780000F800009C00010E00020E000607000403801E07C0FF0FF815 +12809116>II<7FFC70386038407040F040E041C003C003 +8007000F040E041C043C0C380870087038FFF80E127F9112>II +E /Fr 41 123 df<0001FF0000001FFFC000007F80F00000FC00F80001F801F80003F803 +FC0007F003FC0007F003FC0007F003FC0007F001F80007F000F00007F000000007F00000 +0007F000000007F0000000FFFFFFFC00FFFFFFFC00FFFFFFFC0007F001FC0007F001FC00 +07F001FC0007F001FC0007F001FC0007F001FC0007F001FC0007F001FC0007F001FC0007 +F001FC0007F001FC0007F001FC0007F001FC0007F001FC0007F001FC0007F001FC0007F0 +01FC0007F001FC0007F001FC0007F001FC0007F001FC007FFF1FFFC07FFF1FFFC07FFF1F +FFC0222A7FA926>12 D45 +D<000E00001E00007E0007FE00FFFE00FFFE00F8FE0000FE0000FE0000FE0000FE0000FE +0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE +0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE +007FFFFE7FFFFE7FFFFE17277BA622>49 D<00FF800003FFF0000FFFFC001F03FE003800 +FF007C007F80FE003FC0FF003FC0FF003FE0FF001FE0FF001FE07E001FE03C003FE00000 +3FE000003FC000003FC000007F8000007F000000FE000000FC000001F8000003F0000003 +E00000078000000F0000001E0000003C00E0007000E000E000E001C001C0038001C00700 +01C00FFFFFC01FFFFFC03FFFFFC07FFFFFC0FFFFFF80FFFFFF80FFFFFF801B277DA622> +I<007F800003FFF00007FFFC000F81FE001F00FF003F80FF003F807F803F807F803F807F +801F807F800F007F800000FF000000FF000000FE000001FC000001F8000007F00000FFC0 +0000FFF0000001FC0000007E0000007F0000007F8000003FC000003FC000003FE000003F +E03C003FE07E003FE0FF003FE0FF003FE0FF003FC0FF007FC07E007F807C007F003F01FE +001FFFFC0007FFF00000FF80001B277DA622>I<00000E0000001E0000003E0000007E00 +0000FE000000FE000001FE000003FE0000077E00000E7E00000E7E00001C7E0000387E00 +00707E0000E07E0000E07E0001C07E0003807E0007007E000E007E000E007E001C007E00 +38007E0070007E00E0007E00FFFFFFF8FFFFFFF8FFFFFFF80000FE000000FE000000FE00 +0000FE000000FE000000FE000000FE000000FE00007FFFF8007FFFF8007FFFF81D277EA6 +22>I<0C0003000F803F000FFFFE000FFFFC000FFFF8000FFFF0000FFFE0000FFFC0000F +FE00000E0000000E0000000E0000000E0000000E0000000E0000000E7FC0000FFFF8000F +80FC000E003E000C003F0000001F8000001FC000001FC000001FE000001FE018001FE07C +001FE0FE001FE0FE001FE0FE001FE0FE001FC0FC001FC078003F8078003F803C007F001F +01FE000FFFF80003FFF00000FF80001B277DA622>I<0007F000003FFC0000FFFE0001FC +0F0003F01F8007E03F800FC03F801FC03F801F803F803F801F003F8000007F0000007F00 +00007F000000FF000000FF0FC000FF3FF800FF707C00FFC03E00FFC03F00FF801F80FF80 +1FC0FF001FC0FF001FE0FF001FE0FF001FE07F001FE07F001FE07F001FE07F001FE03F00 +1FE03F001FC01F801FC01F803F800FC03F0007E07E0003FFFC0000FFF000003FC0001B27 +7DA622>I<380000003E0000003FFFFFF03FFFFFF03FFFFFF07FFFFFE07FFFFFC07FFFFF +807FFFFF0070000E0070000E0070001C00E0003800E0007000E000E0000000E0000001C0 +00000380000007800000078000000F0000000F0000001F0000001F0000003F0000003E00 +00003E0000007E0000007E0000007E0000007E000000FE000000FE000000FE000000FE00 +0000FE000000FE000000FE000000FE0000007C0000003800001C297CA822>I66 +D<00003FF001800003FFFE0380000FFFFF8780003FF007DF8000FF8001FF8001FE00007F +8003FC00003F8007F000001F800FF000000F801FE0000007801FE0000007803FC0000007 +803FC0000003807FC0000003807F80000003807F8000000000FF8000000000FF80000000 +00FF8000000000FF8000000000FF8000000000FF8000000000FF8000000000FF80000000 +00FF80000000007F80000000007F80000000007FC0000003803FC0000003803FC0000003 +801FE0000003801FE0000007000FF00000070007F000000E0003FC00001E0001FE00003C +0000FF8000F800003FF007E000000FFFFFC0000003FFFF000000003FF8000029297CA832 +>II70 +D73 D<0000FFE000000007FFFC0000 +003FC07F8000007F001FC00001FC0007F00003F80003F80007F00001FC000FF00001FE00 +1FE00000FF001FE00000FF003FC000007F803FC000007F807FC000007FC07F8000003FC0 +7F8000003FC07F8000003FC0FF8000003FE0FF8000003FE0FF8000003FE0FF8000003FE0 +FF8000003FE0FF8000003FE0FF8000003FE0FF8000003FE0FF8000003FE0FF8000003FE0 +7F8000003FC07FC000007FC07FC000007FC03FC000007F803FC000007F801FE00000FF00 +1FE00000FF000FF00001FE0007F00001FC0003F80003F80001FC0007F00000FF001FE000 +003FC07F8000000FFFFE00000000FFE000002B297CA834>79 DI<007F806003FFF0E007FFF9E00F80 +7FE01F001FE03E0007E07C0003E07C0001E0FC0001E0FC0001E0FC0000E0FE0000E0FE00 +00E0FF000000FFC000007FFE00007FFFE0003FFFFC001FFFFE000FFFFF8007FFFFC003FF +FFE000FFFFE00007FFF000007FF000000FF8000007F8000003F8600001F8E00001F8E000 +01F8E00001F8F00001F0F00001F0F80003F0FC0003E0FF0007C0FFE01F80F3FFFF00E0FF +FE00C01FF0001D297CA826>83 D85 D87 +D<01FF800007FFF0000F81F8001FC07E001FC07E001FC03F000F803F8007003F8000003F +8000003F8000003F80000FFF8000FFFF8007FC3F800FE03F803F803F803F003F807F003F +80FE003F80FE003F80FE003F80FE003F807E007F807F00DF803F839FFC0FFF0FFC01FC03 +FC1E1B7E9A21>97 DI<001FF80000FFFE0003F01F0007E03F800FC03F801F803F803F80 +1F007F800E007F0000007F000000FF000000FF000000FF000000FF000000FF000000FF00 +0000FF0000007F0000007F0000007F8000003F8001C01F8001C00FC0038007E0070003F0 +1E0000FFFC00001FE0001A1B7E9A1F>I<00003FF80000003FF80000003FF800000003F8 +00000003F800000003F800000003F800000003F800000003F800000003F800000003F800 +000003F800000003F800000003F800000003F800001FE3F80000FFFBF80003F03FF80007 +E00FF8000FC007F8001F8003F8003F8003F8007F0003F8007F0003F8007F0003F800FF00 +03F800FF0003F800FF0003F800FF0003F800FF0003F800FF0003F800FF0003F8007F0003 +F8007F0003F8007F0003F8003F8003F8001F8003F8000F8007F80007C00FF80003F03BFF +8000FFF3FF80003FC3FF80212A7EA926>I<003FE00001FFF80003F07E0007C01F000F80 +1F801F800F803F800FC07F000FC07F0007C07F0007E0FF0007E0FF0007E0FFFFFFE0FFFF +FFE0FF000000FF000000FF0000007F0000007F0000007F0000003F8000E01F8000E00FC0 +01C007E0038003F81F0000FFFE00001FF0001B1B7E9A20>I<0007F0003FFC00FE3E01F8 +7F03F87F03F07F07F07F07F03E07F00007F00007F00007F00007F00007F00007F000FFFF +C0FFFFC0FFFFC007F00007F00007F00007F00007F00007F00007F00007F00007F00007F0 +0007F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F0007FFF +807FFF807FFF80182A7EA915>I104 D<07000F801FC03FE03FE03FE01FC00F80070000 +00000000000000000000000000FFE0FFE0FFE00FE00FE00FE00FE00FE00FE00FE00FE00F +E00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE0FFFEFFFEFFFE0F2B7DAA14 +>I107 +DII< +FFC07F0000FFC1FFC000FFC787E0000FCE03F0000FD803F0000FD803F8000FF003F8000F +F003F8000FE003F8000FE003F8000FE003F8000FE003F8000FE003F8000FE003F8000FE0 +03F8000FE003F8000FE003F8000FE003F8000FE003F8000FE003F8000FE003F8000FE003 +F8000FE003F8000FE003F800FFFE3FFF80FFFE3FFF80FFFE3FFF80211B7D9A26>I<003F +E00001FFFC0003F07E000FC01F801F800FC03F800FE03F0007E07F0007F07F0007F07F00 +07F0FF0007F8FF0007F8FF0007F8FF0007F8FF0007F8FF0007F8FF0007F8FF0007F87F00 +07F07F0007F03F800FE03F800FE01F800FC00FC01F8007F07F0001FFFC00003FE0001D1B +7E9A22>II114 D<03FE300FFFF01E03F03800F0700070F00070F00070F80070FC0000 +FFE0007FFE007FFF803FFFE01FFFF007FFF800FFF80003FC0000FC60007CE0003CF0003C +F00038F80038FC0070FF01E0F7FFC0C1FF00161B7E9A1B>I<0070000070000070000070 +0000F00000F00000F00001F00003F00003F00007F0001FFFF0FFFFF0FFFFF007F00007F0 +0007F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F0 +3807F03807F03807F03807F03807F03803F03803F87001F86000FFC0001F8015267FA51B +>II< +FFFE03FF80FFFE03FF80FFFE03FF8007F000700007F000700007F800F00003F800E00003 +FC01E00001FC01C00001FC01C00000FE03800000FE038000007F070000007F070000007F +8F0000003F8E0000003FDE0000001FDC0000001FDC0000000FF80000000FF80000000FF8 +00000007F000000007F000000003E000000003E000000001C00000211B7F9A24>I120 +DI<3FFFFF803FFFFF803F007F003C +00FE003801FE007803FC007803F8007007F800700FF000700FE000001FC000003FC00000 +7F8000007F000000FF000001FE038001FC038003F8038007F803800FF007800FE007801F +E007003FC00F003F801F007F007F00FFFFFF00FFFFFF00191B7E9A1F>I +E /Fs 18 118 df<7FFFC0FFFFE0FFFFE07FFFC013047D901A>45 +D<3078FCFC7830060676851A>I<003E0001FF8003FFC007C1E00F00E01E0F703C3FF038 +7FF07070F870E07870E078E1C038E1C038E1C038E1C038E1C038E1C038E1C038E1C03870 +E07070E0707070E0387FE03C3FC01E0F000F003807C0F803FFF001FFE0003F00151E7E9D +1A>64 D<1FF0003FFC007FFE00780F00300700000380000380007F8007FF801FFF803F83 +80780380700380E00380E00380E00380700780780F803FFFFC1FFDFC07F0FC16157D941A +>97 D<00FF8003FFC00FFFE01F01E03C00C0780000700000700000E00000E00000E00000 +E00000E000007000007000007800703C00701F01F00FFFE003FFC000FE0014157D941A> +99 D<001FC0001FC0001FC00001C00001C00001C00001C00001C00001C001F1C007FDC0 +0FFFC01E0FC03C07C07803C07001C0E001C0E001C0E001C0E001C0E001C0E001C0E001C0 +7003C07003C03807C03E0FC01FFFFC07FDFC01F1FC161E7E9D1A>I<01F80007FF000FFF +801E07C03C01C07800E07000E0E00070E00070FFFFF0FFFFF0FFFFF0E000007000007000 +007800703C00701F01F00FFFE003FFC000FE0014157D941A>I<0007E0001FF0003FF800 +787800F03000E00000E00000E00000E0007FFFF0FFFFF0FFFFF000E00000E00000E00000 +E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E0003F +FF807FFFC03FFF80151E7F9D1A>I<01F87C07FFFE0FFFFE1E078C1C03803801C03801C0 +3801C03801C03801C01C03801E07801FFF001FFE0039F8003800003800001C00001FFF80 +1FFFE03FFFF878007C70001CE0000EE0000EE0000EE0000E70001C78003C3E00F81FFFF0 +07FFC001FF0017217F941A>II<00C00001E00001E00000C0000000000000000000000000000000000000007FE0007F +E0007FE00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000 +E00000E00000E00000E00000E0007FFF80FFFFC07FFF80121F7C9E1A>I108 D110 D<01F00007FC001FFF003E0F803C0780 +7803C07001C0E000E0E000E0E000E0E000E0E000E0E000E0F001E07001C07803C03C0780 +3E0F801FFF0007FC0001F00013157D941A>I<7F83F0FF8FF87FBFFC03FC3C03F01803E0 +0003C00003C0000380000380000380000380000380000380000380000380000380000380 +007FFF00FFFF007FFF0016157E941A>114 D<07FB801FFF807FFF80780780E00380E003 +80E003807800007FC0003FFC0007FE00003F800007806001C0E001C0E001C0F003C0FC07 +80FFFF00EFFE00E3F80012157C941A>I<00C00001C00001C00001C00001C00001C00001 +C0007FFFE0FFFFE0FFFFE001C00001C00001C00001C00001C00001C00001C00001C00001 +C00001C00001C07001C07001C07001C07000E0E000FFE0007FC0001F00141C7F9B1A>I< +FE0FE0FE0FE0FE0FE00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E0 +0E00E00E00E00E00E00E00E00E01E00F03E007FFFE03FFFE00FCFE17157F941A>I +E /Ft 20 122 df<70F8FCFC7404040404080810102040060F7C840E>44 +D<008003800F80F380038003800380038003800380038003800380038003800380038003 +80038003800380038003800380038003800380038003800380038007C0FFFE0F217CA018 +>49 D<007E0001C1000300800601C00E03C01C03C0180180380000380000780000700000 +700000F0F800F30C00F40600F40300F80380F801C0F001C0F001E0F001E0F001E0F001E0 +F001E07001E07001E07001E03801C03801C01803801C03000C0600070C0001F00013227E +A018>54 D<4000006000007FFFE07FFFC07FFFC0400080C0010080010080020080020000 +040000080000080000100000300000200000600000600000600000E00000C00000C00001 +C00001C00001C00001C00003C00003C00003C00003C00003C00003C00003C00003C00001 +800013237DA118>I<01F000060C000C0600180700380380700380700380F001C0F001C0 +F001C0F001E0F001E0F001E0F001E0F001E07001E07003E03803E01805E00C05E00619E0 +03E1E00001C00001C00001C0000380000380300300780700780600700C00201800103000 +0FC00013227EA018>57 D70 D72 D76 D<7FFFFFF87807807860078018400780084007800840078008C0 +07800C800780048007800480078004800780040007800000078000000780000007800000 +078000000780000007800000078000000780000007800000078000000780000007800000 +07800000078000000780000007800000078000000780000007800000078000000FC00003 +FFFF001E227EA123>84 D<0FE0001838003C0C003C0E0018070000070000070000070000 +FF0007C7001E07003C0700780700700700F00708F00708F00708F00F087817083C23900F +C1E015157E9418>97 D<0E0000FE00001E00000E00000E00000E00000E00000E00000E00 +000E00000E00000E00000E00000E00000E1F000E61C00E80600F00300E00380E003C0E00 +1C0E001E0E001E0E001E0E001E0E001E0E001E0E001E0E001C0E003C0E00380F00700C80 +600C41C0083F0017237FA21B>I<01FC000707000C03801C01C03801C07801E07000E0F0 +00E0FFFFE0F00000F00000F00000F00000F000007000007800203800201C00400E008007 +030000FC0013157F9416>101 D<0E0000FE00001E00000E00000E00000E00000E00000E +00000E00000E00000E00000E00000E00000E00000E1F800E60C00E80E00F00700F00700E +00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E +00700E00700E0070FFE7FF18237FA21B>104 D<0E1FC07F00FE60E183801E807201C00F +003C00E00F003C00E00E003800E00E003800E00E003800E00E003800E00E003800E00E00 +3800E00E003800E00E003800E00E003800E00E003800E00E003800E00E003800E00E0038 +00E00E003800E00E003800E0FFE3FF8FFE27157F942A>109 D<0E1F80FE60C01E80E00F +00700F00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E +00700E00700E00700E00700E0070FFE7FF18157F941B>I<01FC000707000C01801800C0 +3800E0700070700070F00078F00078F00078F00078F00078F00078F000787000707800F0 +3800E01C01C00E038007070001FC0015157F9418>I<0E3CFE461E8F0F0F0F060F000E00 +0E000E000E000E000E000E000E000E000E000E000E000E000F00FFF010157F9413>114 +D<0F8830786018C018C008C008E008F0007F803FE00FF001F8003C801C800C800CC00CC0 +08E018D0308FC00E157E9413>I<0E0070FE07F01E00F00E00700E00700E00700E00700E +00700E00700E00700E00700E00700E00700E00700E00700E00700E00F00E00F006017003 +827800FC7F18157F941B>117 D121 D E /Fu 1 4 df<00C00000C00000C00000C00000C000C0C0C0F0C3C038 +C7000EDC0003F00000C00003F0000EDC0038C700F0C3C0C0C0C000C00000C00000C00000 +C00000C00012157D9619>3 D E /Fv 25 123 df +45 D<0C0003000F801E000FFFFC000FFFF8000FFFE00008FF0000080000000800000008 +000000080000000800000008000000080000000800000008000000080000000800000008 +000000081FC00008607000098018000A001C000C000E0008000700000007800000078000 +0003C0000003C0000003C0000003E0000003E0000003E0000003E0780003E0F80003E0F8 +0003E0F80003E0F00003C0C00007C0400007804000078020000F0030000F0018001E000E +003C000780F00001FFE000007F00001B307DAE21>53 D66 D<00003FE0010001FFF8030007 +F01E03001F800307003E000087007800004F00F000002F01E000001F03C000000F078000 +000F0F800000070F000000071F000000031E000000033E000000033C000000017C000000 +017C000000017C000000017800000000F800000000F800000000F800000000F800000000 +F800000000F800000000F800000000F800000000F800000000F800000000F80000000078 +000000007C000000007C000000017C000000013C000000013E000000011E000000011F00 +0000020F000000020F80000006078000000403C000000801E000000800F0000010007800 +0020003E0000C0001F8003800007F00F000001FFFC0000003FE00028337CB130>I69 +D +I<00001FE000800000FFFC01800007F00F0180000F80018380003E0000C3800078000027 +8000F00000178001E000000F8003C000000F800780000007800780000003800F00000003 +801F00000001801E00000001803E00000001803C00000001803C00000000807C00000000 +807C0000000080780000000000F80000000000F80000000000F80000000000F800000000 +00F80000000000F80000000000F80000000000F80000000000F80000000000F800000000 +00F800000FFFFC7800000FFFFC7C0000001FC07C0000000F803C0000000F803C0000000F +803E0000000F801E0000000F801F0000000F800F0000000F80078000000F8007C000000F +8003C000000F8001E000000F8000F000001780007C00001780003E00006380000F8000C3 +800007F00781800000FFFE008000001FF000002E337CB134>I73 +D78 D<007F802001FFE02007C078600F001C601E0006E03C +0003E0380001E0780000E0700000E070000060F0000060F0000060F0000020F0000020F0 +000020F8000020F80000007C0000007E0000003F0000003FC000001FF800000FFF800007 +FFF80003FFFC0000FFFF00000FFF800000FFC000001FE0000007E0000003F0000001F000 +0000F0000000F8000000F88000007880000078800000788000007880000078C0000078C0 +000070E00000F0E00000E0F00000E0F80001C0EC000380C7000700C1F01E00807FFC0080 +0FF0001D337CB125>83 D86 +D<00FE00000303C0000C00E00010007000100038003C003C003E001C003E001E003E001E +0008001E0000001E0000001E0000001E00000FFE0000FC1E0003E01E000F801E001F001E +003E001E003C001E007C001E00F8001E04F8001E04F8001E04F8003E04F8003E0478003E +047C005E043E008F080F0307F003FC03E01E1F7D9E21>97 D<003F8000E0600380180700 +040F00041E001E1C003E3C003E7C003E7C0008780000F80000F80000F80000F80000F800 +00F80000F80000F80000F800007800007C00007C00003C00011E00011E00020F00020700 +0403801800E060003F80181F7D9E1D>99 D<000001E000003FE000003FE0000003E00000 +01E0000001E0000001E0000001E0000001E0000001E0000001E0000001E0000001E00000 +01E0000001E0000001E0000001E0000001E0000001E0001F81E000F061E001C019E00780 +05E00F0003E00E0003E01E0001E03C0001E03C0001E07C0001E0780001E0F80001E0F800 +01E0F80001E0F80001E0F80001E0F80001E0F80001E0F80001E0F80001E0780001E07800 +01E03C0001E03C0001E01C0001E01E0003E00E0005E0070009E0038011F000E061FF003F +81FF20327DB125>I<003F800000E0E0000380380007003C000E001E001E001E001C000F +003C000F007C000F0078000F8078000780F8000780F8000780FFFFFF80F8000000F80000 +00F8000000F8000000F8000000F8000000780000007C0000003C0000003C0000801E0000 +800E0001000F0002000780020001C00C0000F03000001FC000191F7E9E1D>I<0007E000 +1C1000383800707C00E07C01E07C01C03803C00003C00003C00003C00003C00003C00003 +C00003C00003C00003C00003C00003C000FFFFC0FFFFC003C00003C00003C00003C00003 +C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003 +C00003C00003C00003C00003C00003C00003C00003C00003C00003C00007E0007FFF007F +FF0016327FB114>I<0780000000FF80000000FF800000000F8000000007800000000780 +000000078000000007800000000780000000078000000007800000000780000000078000 +00000780000000078000000007800000000780000000078000000007800000000780FE00 +000783078000078C03C000079001E00007A001E00007A000F00007C000F00007C000F000 +078000F000078000F000078000F000078000F000078000F000078000F000078000F00007 +8000F000078000F000078000F000078000F000078000F000078000F000078000F0000780 +00F000078000F000078000F000078000F000078000F000078000F0000FC001F800FFFC1F +FF80FFFC1FFF8021327EB125>104 D<0F001F801F801F801F800F000000000000000000 +00000000000000000000000000000780FF80FF800F800780078007800780078007800780 +078007800780078007800780078007800780078007800780078007800780078007800FC0 +FFF8FFF80D307EAF12>I<07800000FF800000FF8000000F800000078000000780000007 +800000078000000780000007800000078000000780000007800000078000000780000007 +80000007800000078000000780000007801FFC07801FFC078007E0078007800780060007 +80040007800800078010000780600007808000078100000783800007878000078FC00007 +93C00007A1E00007C1F0000780F0000780780007807C0007803C0007803E0007801F0007 +800F0007800F80078007C0078003C0078003E00FC007F8FFFC0FFFFFFC0FFF20327EB123 +>107 D<0780FE001FC000FF83078060F000FF8C03C18078000F9001E2003C0007A001E4 +003C0007A000F4001E0007C000F8001E0007C000F8001E00078000F0001E00078000F000 +1E00078000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E +00078000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E00 +078000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E0007 +8000F0001E00078000F0001E00078000F0001E000FC001F8003F00FFFC1FFF83FFF0FFFC +1FFF83FFF0341F7E9E38>109 D<0780FE0000FF83078000FF8C03C0000F9001E00007A0 +01E00007A000F00007C000F00007C000F000078000F000078000F000078000F000078000 +F000078000F000078000F000078000F000078000F000078000F000078000F000078000F0 +00078000F000078000F000078000F000078000F000078000F000078000F000078000F000 +078000F000078000F0000FC001F800FFFC1FFF80FFFC1FFF80211F7E9E25>I<001FC000 +00F0780001C01C00070007000F0007801E0003C01C0001C03C0001E03C0001E0780000F0 +780000F0780000F0F80000F8F80000F8F80000F8F80000F8F80000F8F80000F8F80000F8 +F80000F8780000F07C0001F03C0001E03C0001E01E0003C01E0003C00F00078007800F00 +01C01C0000F07800001FC0001D1F7E9E21>I<0783E0FF8C18FF907C0F907C07A07C07C0 +3807C00007C00007C0000780000780000780000780000780000780000780000780000780 +000780000780000780000780000780000780000780000780000780000780000FC000FFFE +00FFFE00161F7E9E19>114 D<01FC100E03301800F0300070600030E00030E00010E000 +10E00010F00010F800007E00003FF0001FFF000FFFC003FFE0003FF00001F80000F88000 +3C80003C80001CC0001CC0001CE0001CE00018F00038F00030CC0060C301C080FE00161F +7E9E1A>I<3FFFFF3E001E38001E30003C2000782000786000F04001E04001E04003C040 +0780000780000F00001E00001E00003C0000780000780000F00101E00101E00103C00107 +80010780030F00021E00021E00063C000678000E78007EFFFFFE181F7E9E1D>122 +D E end +%%EndProlog +%%BeginSetup +%%Feature: *Resolution 300dpi +TeXDict begin + +%%EndSetup +%%Page: 1 1 +1 0 bop 309 219 a Fv(FFIGEN)22 b(Bac)n(k-end)f(for)g(Chez)h(Sc)n(heme)f +(V)-6 b(ersion)21 b(5)1641 193 y Fu(\003)749 340 y Ft(Lars)c(Thomas)f +(Hansen)744 398 y Fs(lth@cs.uore)o(gon)o(.e)o(du)795 +496 y Ft(F)l(ebruary)g(7,)g(1996)0 674 y Fr(1)69 b(In)n(tro)r(duction)0 +765 y Fq(This)15 b(do)q(cumen)o(t)g(describ)q(es)j(the)e(FFIGEN)f(bac)o +(k-end)h(for)f(Chez)i(Sc)o(heme)e(v)o(ersion)g(5.)23 +b(The)16 b(exp)q(osition)f(is)g(pro)o(vided)g(in)0 815 +y(the)f(hop)q(e)h(that)f(it)f(will)g(mak)o(e)f(it)i(reasonably)f(clear) +i(ho)o(w)e(bac)o(k-ends)i(for)e(FFIGEN)h(are)h(constructed;)g(man)o(y)d +(bac)o(k-ends)0 865 y(will)g(probably)i(ha)o(v)o(e)f(a)h(structure)i +(similar)11 b(to)j(that)g(of)f(the)i(presen)o(t)g(program.)62 +915 y(If)f(y)o(ou)f(ha)o(v)o(en't)h(read)g(the)g Fp(FFIGEN)i(Manifesto) +f(and)g(Overview)p Fq(,)e(no)o(w)g(is)h(a)g(go)q(o)q(d)f(time)g(to)g +(do)h(so.)62 965 y(If)21 b(y)o(ou)f(ha)o(v)o(en't)g(read)h(the)g +Fp(FFIGEN)h(User's)e(Manual,)j Fq(whic)o(h)e(do)q(cumen)o(ts)f(the)h +(target-indep)q(enden)o(t)i(co)q(de)e(for)0 1014 y(FFIGEN)14 +b(bac)o(k-ends)h(and)e(the)i(format)d(for)h(the)i(in)o(termediate)e(co) +q(de,)h(no)o(w)g(is)f(a)h(go)q(o)q(d)g(time)e(to)i(do)f(so.)62 +1064 y(This)j(do)q(cumen)o(t)g(is)g(organized)g(in)f(the)i(follo)o +(wing)c(manner.)24 b(Section)16 b(2)g(do)q(cumen)o(ts)g(the)h(o)o(v)o +(erall)e(structure)j(of)d(the)0 1114 y(translation)d(for)f(Chez)j(Sc)o +(heme.)j(Section)c(3)f(presen)o(ts)i(the)f(p)q(olicy)e(c)o(hoices)i +(made)e(for)h(data)g(t)o(yp)q(es)h(and)g(most)e(of)g(the)i(co)q(de)0 +1164 y(implemen)o(ting)c(the)k(p)q(olicy;)e(section)i(4)f(presen)o(ts)i +(sev)o(eral)f(utilit)o(y)e(pro)q(cedures)k(used)e(b)o(y)f(the)h(implem) +o(en)o(tation.)i(Section)d(5)0 1214 y(discusses)h(some)c(of)h(the)i +(implem)o(en)o(tation)c(c)o(hoices,)j(particularly)f(in)g(terms)h(of)f +(p)q(erformance,)g(and)h(section)g(6)g(summarizes)0 1263 +y(future)j(w)o(ork)g(on)g(the)g(Chez)h(Sc)o(heme)f(bac)o(k-end.)k +(Section)c(7)g(presen)o(ts)i(the)e(implemen)o(tation)d(of)i(the)i(supp) +q(ort)f(libraries.)62 1313 y(This)g(do)q(cumen)o(t)f(is)h(also)g(the)g +(program:)i(the)f(L)810 1308 y Fo(a)829 1313 y Fq(T)852 +1326 y(E)875 1313 y(X)f(source)i(for)d(the)i(do)q(cumen)o(t,)e(the)h +(Sc)o(heme)g(source)h(co)q(de)g(for)e(the)0 1363 y(program,)k(and)g +(the)h(standard)g(library)f(sources)j(ha)o(v)o(e)d(b)q(een)i(deriv)o +(ed)f(from)e(the)i(same)f(\014le)h(using)f(the)i Fn(nuweb)d +Fq(system)0 1413 y(for)e(literate)g(programming.)464 +1398 y Fm(1)500 1413 y Fq(The)g(do)q(cumen)o(t)g(presen)o(ts)j(the)d +(program)f(in)h(an)g(order)h(whic)o(h)f(I)g(b)q(eliev)o(e)h(is)f +(conduciv)o(e)h(to)0 1463 y(understanding)h(its)g(w)o(orkings.)23 +b(Here's)17 b(ho)o(w)e(y)o(ou)g(read)i(it:)k(eac)o(h)16 +b(snipp)q(et)h(of)e(co)q(de)h(\(called)g(a)f Fp(macr)n(o)j +Fq(or)e Fp(scr)n(ap)s Fq(\))f(has)h(a)0 1513 y(title)f(whic)o(h)f +(includes)h(the)h(page)f(n)o(um)o(b)q(er)f(on)g(whic)o(h)h(the)g(scrap) +h(is)f(de\014ned)h(and)e(a)h(letter)g(follo)o(wing)e(the)i(page)g(n)o +(um)o(b)q(er)0 1562 y(whic)o(h)f(sho)o(ws)g(the)h(relativ)o(e)e(place)i +(on)e(that)h(page)g(where)h(y)o(ou)f(can)g(\014nd)g(the)h(scrap)g +(\(for)e(example,)g(9a)g(is)h(the)g(\014rst)h(scrap)0 +1612 y(on)e(page)g(9)g(and)h(6c)f(is)g(the)h(third)f(scrap)i(on)e(page) +g(6\).)18 b(Scraps)c(reference)i(other)e(scraps;)g(these)h(references)h +(are)d(the)h(titles,)0 1662 y(so)g(an)o(y)f(cross-reference)k +(immediately)10 b(giv)o(es)k(y)o(ou)f(the)i(page)e(n)o(um)o(b)q(er)g +(of)g(the)i(referenced)h(co)q(de.)j(In)13 b(addition,)g(an)g(index)0 +1712 y(of)g(global)g(iden)o(ti\014ers)h(can)g(b)q(e)h(found)e(in)h(the) +g(app)q(endix.)0 1849 y Fr(2)69 b(Ov)n(erall)21 b(Structure)0 +1940 y Fq(The)16 b(FFIGEN)g(bac)o(k-end)g(for)g(an)o(y)f(FFI)h +(consists)h(of)e(t)o(w)o(o)h(parts:)22 b(a)16 b(target-indep)q(enden)o +(t)h(part)f(whic)o(h)g(reads)h(the)f(out-)0 1990 y(put)i(of)f(the)h +(fron)o(t)f(end)i(in)o(to)e(global)f(in-memo)o(ry)f(data)i(structures,) +k(and)d(a)f(target-dep)q(enden)o(t)j(part)d(whic)o(h)h(do)q(es)g(the)0 +2040 y(actual)e(translation.)23 b(The)16 b(target-dep)q(enden)o(t)j +(part)d(is)f(implemen)o(ted)f(b)o(y)i(t)o(w)o(o)f(pro)q(cedures,)k +Fn(select-function)o(s)13 b Fq(and)0 2089 y Fn(generate-translat)o(ion) +p Fq(.)0 2206 y Fl(2.1)56 b(The)18 b Fs(select-fun)o(cti)o(on)o(s)e +Fl(pro)r(cedure)0 2282 y Fq(The)h(pro)q(cedure)h Fn(select-functions)13 +b Fq(is)j(called)g(during)g(initial)e(pro)q(cessing)j(to)g(mark)d(as)j +(selected)h(those)f(pro)q(cedures)0 2332 y(whic)o(h)c(are)h(in)o +(teresting)f(for)g(the)h(translation.)j(This)c(mak)o(es)f(it)h(p)q +(ossible)g(to)g(exclude)h(some)e(functions)h(from)f(the)h(transla-)0 +2382 y(tion.)20 b(F)m(or)15 b(example,)e(if)h(y)o(ou)g(are)i +(translating)e(the)h(in)o(terface)h(to)e(a)h(library)f(whose)h(header)h +(\014le)f(includes)g Fn(stdio.h)p Fq(,)e(y)o(ou)0 2432 +y(ma)o(y)f(wish)j(to)f(exclude)h(all)e(function)h(protot)o(yp)q(es)i +(included)e(from)f(the)i(latter)f(\014le.)20 b(Since)15 +b(eac)o(h)g(function)f(record)h(in)f(the)p 0 2466 780 +2 v 46 2493 a Fk(\003)64 2505 y Fj(This)f(w)o(ork)g(has)f(b)q(een)g +(supp)q(orted)e(b)o(y)j(ARP)m(A)h(under)e(U.S.)h(Arm)o(y)f(gran)o(t)g +(No.)h(D)o(ABT63-94-C-0029,)f(\\Programm)o(ing)e(En)o(vironmen)o(t)o +(s,)0 2544 y(Compiler)g(T)m(ec)o(hnology)f(and)i(Run)o(time)e(Systems)h +(for)h(Ob)r(ject)g(Orien)o(ted)f(P)o(arallel)g(Pro)q(cessing".)46 +2572 y Fi(1)64 2584 y Fh(nuweb)g Fj(w)o(as)i(implemen)o(ted)d(b)o(y)i +(Preston)g(Briggs)g(of)g(Rice)h(Univ)o(ersit)o(y;)e(y)o(ou)h(ma)o(y)g +(retriev)o(e)f(it)i(b)o(y)f(anon)o(ymous)e(ftp)i(from)g +Fh(cs.rice.edu)e Fj(in)0 2623 y(the)i(directory)e Fh(/public/pr)o(es)o +(ton)o Fj(.)965 2828 y Fq(1)p eop +%%Page: 2 2 +2 1 bop 0 45 a Fq(in)o(termediate)15 b(form)f(has)i(a)f(\014eld)h +(naming)d(the)j(\014le)g(the)g(record)h(came)e(from,)f(y)o(ou)h(can)h +(easily)f(exclude)i(functions)f(from)0 95 y Fn(stdio.h)p +Fq(.)62 145 y(The)h(implem)o(en)o(tation)c(of)i Fn(select-functions)e +Fq(for)i(Chez)i(Sc)o(heme)f(simply)d(marks)i(all)g(functions)h(as)f +(selected,)j(b)o(y)0 195 y(turning)c(on)f(the)i(\\referenced")h(bit)d +(in)h(the)g(record.)0 276 y Fg(h)p Ff(the)f(select-functions)i(in)o +(terface)f(pro)q(cedure)h Fj(2a)p Fg(i)9 b(\021)104 322 +y Fe(\(define)17 b(\(select-f)o(un)o(cti)o(ons)o(\))143 +368 y(\(do)h(\(\(functions)e(functions)g(\(cdr)i(functions\))o(\)\))221 +414 y(\(\(null?)f(functions\)\))182 459 y(\(reference)o(d!)f(\(car)i +(functions\))o(\)\)\))104 505 y Fd(3)0 552 y Fj(Macro)11 +b(referenced)d(in)k(scrap)e(2d.)0 661 y Fl(2.2)56 b(The)18 +b Fs(generate-t)o(ran)o(sl)o(ati)o(on)d Fl(pro)r(cedure)0 +738 y Fq(The)i(pro)q(cedure)i Fn(generate-translatio)o(n)14 +b Fq(is)j(called)f(when)i(the)f(target-indep)q(enden)o(t)i(part)e(is)g +(done)g(pro)q(cessing)h(the)0 788 y(data,)f(and)f(it)h(m)o(ust)f +(implemen)o(t)e(all)h(asp)q(ects)k(of)d(the)i(target-dep)q(enden)o(t)h +(translation.)26 b(It)17 b(tak)o(es)g(no)g(argumen)o(ts.)26 +b(My)0 837 y(v)o(ersion)14 b(sets)h(up)f(the)h(output)f(\014les,)f +(initializes)g(the)i(\014les,)e(calls)h(the)g(generating)h(functions,)e +(and)h(cleans)g(up.)0 919 y Fg(h)p Ff(the)f(generate-translation)j(in)o +(terface)e(pro)q(cedure)g Fj(2b)p Fg(i)c(\021)104 965 +y Fe(\(define)17 b(\(generate)o(-t)o(ran)o(sla)o(ti)o(on\))143 +1011 y Fg(h)p Ff(initiali)q(ze)f(output)e(\014les)g Fj(3b,)c +Fc(:)c(:)g(:)17 b Fg(i)143 1057 y(h)p Ff(generate)d(co)q(de)f(for)g +(all)h(constructs)g Fj(2c)p Fg(i)143 1102 y(h)p Ff(\014nalize)h(output) +f(\014les)g Fj(4b)p Fg(i)143 1148 y Fe(#t\))104 1194 +y Fd(3)0 1240 y Fj(Macro)d(referenced)d(in)k(scrap)e(2d.)0 +1344 y Fn(generate-translat)o(ion)k Fq(calls)i(on)g(sp)q(ecialized)i +(pro)q(cedures)h(to)e(generate)h(co)q(de)f(for)f(the)i(v)n(arious)e(in) +o(termediate)g(lan-)0 1394 y(guage)e(records:)0 1475 +y Fg(h)p Ff(generate)g(co)q(de)f(for)g(all)h(constructs)g +Fj(2c)p Fg(i)c(\021)104 1522 y Fe(\(dump-str)o(uct)o(s\))104 +1567 y(\(dump-uni)o(ons)o(\))104 1613 y(\(dump-fun)o(cti)o(on)o(s\))104 +1658 y(\(dump-var)o(iab)o(le)o(s\))104 1704 y(\(dump-enu)o(ms\))104 +1750 y(\(dump-mac)o(ros)o(\))104 1795 y Fd(3)0 1842 y +Fj(Macro)h(referenced)d(in)k(scrap)e(2b.)0 1951 y Fl(2.3)56 +b(Structure)18 b(of)g(the)h(Sc)n(heme)e(source)h(\014le)0 +2028 y Fq(The)c(\014nal)g(\014le)f(is)h(called)g Fn(chez.sch)e +Fq(and)i(is)f(laid)g(out)h(in)f(the)i(follo)o(wing)c(w)o(a)o(y:)0 +2105 y Fe("chez.sch")e Fj(2d)i Fg(\021)104 2151 y(h)p +Ff(bac)o(k-end)j(global)h(v)n(ariables)g Fj(3a)p Fg(i)104 +2197 y(h)p Ff(the)e(select-functions)i(in)o(terface)f(pro)q(cedure)g +Fj(2a)p Fg(i)104 2242 y(h)p Ff(the)f(generate-translation)j(in)o +(terface)e(pro)q(cedure)g Fj(2b)p Fg(i)104 2288 y(h)p +Ff(Chez)f(FFI)g(names)g(for)g(primitiv)o(e)i(t)o(yp)q(es)f +Fj(4c)p Fg(i)104 2334 y(h)p Ff(dump)g(structs)f(and)h(unions)g +Fj(5,)e Fc(:)5 b(:)h(:)17 b Fg(i)104 2379 y(h)p Ff(dump)d(global)h(v)n +(ariable)g(accessors)f Fj(10b)p Fg(i)104 2425 y(h)p Ff(dump)g(function) +g(de\014nitions)i Fj(11,)11 b Fc(:)5 b(:)h(:)17 b Fg(i)104 +2471 y(h)p Ff(dump)d(en)o(um)f(de\014nitions)j Fj(13a)p +Fg(i)104 2516 y(h)p Ff(dump)e(macro)f(de\014nitions)j +Fj(13b,)10 b Fc(:)c(:)f(:)18 b Fg(i)104 2562 y(h)p Ff(utilit)o(y)d +(functions)f Fj(14b,)d Fc(:)6 b(:)f(:)18 b Fg(i)104 2608 +y Fd(3)965 2828 y Fq(2)p eop +%%Page: 3 3 +3 2 bop 0 45 a Fl(2.4)56 b(The)18 b(standard)h(library)0 +122 y Fq(T)m(o)14 b(facilitate)g(the)h(translation,)f(a)g(small)f +(standard)i(library)f(has)h(b)q(een)g(created)i(ahead)d(of)h(time)e +(\(see)j(section)g(7)e(for)g(the)0 172 y(implemen)o(tatio)o(n\).)j(The) +e(library)f(implemen)o(ts)e(primitiv)o(e)h(dereferencing)j(functions)e +(and)h(a)f(memory)e(cop)o(y)j(pro)q(cedure.)0 221 y(There)h(is)e(a)g(C) +h(\014le)g(and)f(a)g(Sc)o(heme)h(\014le.)20 b(The)15 +b(C)f(\014le)h(m)o(ust)f(b)q(e)h(compiled)e(and)h(loaded)g(in)o(to)g +(the)h(Sc)o(heme)g(system)f(using)0 271 y(the)i(FFI)f(facilities)f(for) +h(this)g(\(whic)o(h)h(happ)q(en)f(to)g(b)q(e)h(op)q(erating-system)f +(dep)q(enden)o(t)i(in)d(Chez)j(Sc)o(heme\).)k(The)16 +b(Sc)o(heme)0 321 y(FFI)e(co)q(de)h(for)e(the)i(standard)f(library)f(m) +o(ust)g(b)q(e)i(loaded)e(in)o(to)g(the)i(Sc)o(heme)e(system)h(at)g(run) +g(time.)0 458 y Fr(3)69 b(P)n(olicy)22 b(in)g(the)g(Chez)g(Sc)n(heme)f +(Bac)n(k-end)0 549 y Fq(Chez)d(Sc)o(heme)g(v)o(ersion)g(5)f(has)g(a)h +(fairly)e(simple)g(nativ)o(e)h(FFI.)g(It)h(supp)q(orts)h(most)d +(primitiv)o(e)f(C)j(data)f(t)o(yp)q(es)i(for)e(b)q(oth)0 +599 y(parameters)g(and)g(return)h(v)n(alues,)f(and)g(p)q(erforms)f +(data)h(con)o(v)o(ersions)g(on)g(call)f(and)h(return.)28 +b(A)17 b(string)g(is)g(passed)h(as)f(a)0 649 y Fn(char*)c +Fq(to)g(the)i(\014rst)f(c)o(haracter)h(\(in)f(Chez)g(Sc)o(heme,)f +(strings)i(are)f(0-terminated)e(for)i(C)f(compatibilit)o(y\),)e(but)j +(is)f(returned)0 699 y(b)o(y)j(cop)o(ying)g(the)i(data)e(in)o(to)g(a)g +(fresh)i(Sc)o(heme)e(string.)26 b(There)18 b(is)f(no)f(direct)h(supp)q +(ort)h(for)e(the)h Fn(short)f Fq(datat)o(yp)q(e,)h(v)n(ari-)0 +748 y(adic)d(pro)q(cedures,)j(call)d(b)o(y)g(reference,)j(calling)c +(functions)i(through)f(a)g(function)h(p)q(oin)o(ter,)f(struct/union)h +(argumen)o(ts,)f(or)0 798 y(struct/union)19 b(return)g(v)n(alues,)f +(nor)g(is)g(there)h(supp)q(ort)g(for)e(passing)h(general)g(Sc)o(heme)g +(ob)r(jects)h(lik)o(e)e(pairs,)h(arra)o(ys,)h(or)0 848 +y(functions)14 b(to)g(foreign)f(functions.)62 898 y(In)j(this)h +(\(\014rst\))g(v)o(ersion)f(of)f(the)i(translation)e(I)h(ha)o(v)o(e)g +(decided)h(not)f(to)g(implemen)o(t)e(an)o(y)h(mec)o(hanisms)f(for)i +(handling)0 948 y(sp)q(ecial)j(cases)h(lik)o(e)e(the)h +Fn(fgets\(\))e Fq(example)h(outlined)g(in)g(the)i Fp(Manifesto)p +Fq(;)h(that)d(will)g(ha)o(v)o(e)g(to)h(come)f(later.)32 +b(Suc)o(h)19 b(a)0 997 y(mec)o(hanism)11 b(migh)o(t)g(tak)o(e)j(the)f +(form)f(of)h(a)g(\014le)g(con)o(taining)f(rules)i(for)f(ho)o(w)g(to)g +(o)o(v)o(erride)h(certain)g(function)f(signatures,)g(for)0 +1047 y(example.)k(See)e(section)f(6.)0 1164 y Fl(3.1)56 +b(The)18 b(Output)0 1240 y Fq(Tw)o(o)e(output)g(\014les)g(are)h(pro)q +(duced:)24 b(a)16 b(C)g(\014le)g(and)g(a)g(Sc)o(heme)g(\014le.)24 +b(The)17 b(Sc)o(heme)f(\014le)g(will)f(hold)g(the)i(FFI)f(co)q(de)h +(whic)o(h)0 1290 y(in)o(terfaces)f(to)g(the)g(library)e(and)i(its)f +(data)g(t)o(yp)q(es.)24 b(The)16 b(C)f(\014le)h(will)e(hold)g(supp)q +(orting)i(\(\\glue"\))f(co)q(de)h(generated)h(along)0 +1340 y(the)d(w)o(a)o(y:)k(accessors,)d(m)o(utators,)e(and)g(so)h(on.)k +(The)d(need)f(for)g(supp)q(orting)g(co)q(de)h(will)d(b)q(ecome)i(clear) +g(as)g(y)o(ou)f(read.)62 1390 y Fn(c-output)d Fq(and)h +Fn(sch-output)e Fq(are)j(global)d(v)n(ariables)i(whic)o(h)g(hold)g +(output)g(p)q(orts)h(for)f(generated)i(C)e(co)q(de)h(and)f(Sc)o(heme)0 +1439 y(co)q(de,)j(resp)q(ectiv)o(ely)m(.)0 1521 y Fg(h)p +Ff(bac)o(k-end)g(global)h(v)n(ariables)g Fj(3a)p Fg(i)10 +b(\021)104 1567 y Fe(\(define)17 b(c-output)f(#f\))104 +1613 y(\(define)h(sch-outpu)o(t)f(#f\))104 1659 y Fd(3)0 +1705 y Fj(Macro)11 b(referenced)d(in)k(scrap)e(2d.)0 +1809 y Fq(The)16 b(\014les)g(are)f(initialized)f(in)h +Fn(generate-translati)o(on)d Fq(b)o(y)j(computing)f(\014le)h(names)g +(and)g(assigning)g(op)q(ened)h(p)q(orts)g(to)0 1859 y(the)c(global)f(v) +n(ariables;)g(for)g(simplicit)o(y)f(I)h(use)i(\014xed)f(names)f(for)h +(the)g(time)e(b)q(eing.)18 b(The)12 b(use)h(of)e Fn(delete-file)e +Fq(is)j(necessary)0 1908 y(in)h(Chez)i(Sc)o(heme,)e(lest)i(it)e +(complain)f(when)i(op)q(ening)g(an)g(existing)f(\014le)h(for)g(output.) +0 1990 y Fg(h)p Ff(initiali)q(ze)i(output)e(\014les)g +Fj(3b)p Fg(i)9 b(\021)104 2036 y Fe(\(delete-f)o(ile)16 +b("C-OUTPUT)o("\))104 2082 y(\(delete-f)o(ile)g("SCH-OUTP)o(UT")o(\)) +104 2128 y(\(set!)h(c-output)g(\(open-outp)o(ut)o(-fi)o(le)f +("C-OUTPUT")o(\)\))104 2173 y(\(set!)h(sch-output)f(\(open-outp)o(ut-)o +(fi)o(le)g("SCH-OUTPU)o(T"\))o(\))104 2219 y Fd(3)0 2265 +y Fj(Macro)11 b(de\014ned)e(b)o(y)i(scraps)g(3b,)f(4a.)0 +2299 y(Macro)h(referenced)d(in)k(scrap)e(2b.)0 2403 y +Fq(Once)15 b(the)g(\014les)g(are)f(op)q(ened)i(they)e(are)h +(initialized)e(with)h(standard)g(de\014nitions.)19 b(The)c(C)f(\014le)g +Fn(#include)p Fq(s)f(the)i(FFIGEN)0 2453 y(standard)e(library)f(header) +i(and)f(the)h(ANSI)f(C)f(standard)i(library)e(header;)i(there)g(is)f +(nothing)f(to)h(b)q(e)g(done)g(in)g(the)g(Sc)o(heme)0 +2503 y(case.)19 b(W)m(e)13 b(should)g(probably)g(also)g(emit)f(a)i +(line)f(here)i(whic)o(h)e(includes)h(the)g(original)e(header)i(\014le,) +g(but)f(the)i(name)d(of)h(that)0 2552 y(\014le)h(is)g(not)f(curren)o +(tly)i(a)o(v)n(ailable)d(in)h(the)i(in)o(termediate)e(format.)965 +2828 y(3)p eop +%%Page: 4 4 +4 3 bop 0 32 a Fg(h)p Ff(initiali)q(ze)16 b(output)e(\014les)g +Fj(4a)p Fg(i)9 b(\021)104 78 y Fe(\(display)16 b("#include)g +(\\"chez-stdl)o(ib)o(.h\\)o("")g(c-output\))g(\(newline)h(c-output\)) +104 123 y(\(display)f("#include)g(\\"stdlib.h\\)o("")g(c-output\))g +(\(newline)h(c-output\))104 169 y Fd(3)0 216 y Fj(Macro)11 +b(de\014ned)e(b)o(y)i(scraps)g(3b,)f(4a.)0 249 y(Macro)h(referenced)d +(in)k(scrap)e(2b.)0 353 y Fq(When)k(pro)q(cessing)h(is)f(done,)g(the)g +(output)g(\014les)g(m)o(ust)f(b)q(e)i(closed:)0 435 y +Fg(h)p Ff(\014nalize)g(output)f(\014les)g Fj(4b)p Fg(i)c(\021)104 +481 y Fe(\(close-ou)o(tpu)o(t-)o(por)o(t)16 b(c-output\))104 +527 y(\(close-ou)o(tpu)o(t-)o(por)o(t)g(sch-output\))104 +572 y Fd(3)0 619 y Fj(Macro)11 b(referenced)d(in)k(scrap)e(2b.)0 +728 y Fl(3.2)56 b(Names)0 804 y Fq(Since)16 b(Sc)o(heme)g(is)g +(case-insensitiv)o(e)h(and)e(C)h(is)g(not,)g(names)f(whic)o(h)h(do)f +(not)h(clash)g(in)f(C)h(ma)o(y)e(do)i(so)g(in)f(Sc)o(heme.)24 +b(This)0 854 y(can)15 b(b)q(e)h(handled)f(fairly)f(simply)f(b)o(y)h(k)o +(eeping)h(trac)o(k)h(of)e(all)g(generated)i(Sc)o(heme)f(names)g(and)f +(w)o(arning)h(ab)q(out)g(con\015icts.)0 904 y(In)f(this)g(v)o(ersion)g +(I)g(ha)o(v)o(e)f(not)h(implemen)o(ted)e(this,)h(but)h(it)g(will)e(b)q +(e)j(implemen)o(ted)c(in)j(the)g(future.)62 954 y(In)f(general,)f +(parameter)g(names)f(in)h(generated)i(C)e(pro)q(cedures)j(are)e(prep)q +(ended)h(with)e(underscores)j(to)d(prev)o(en)o(t)h(name)0 +1004 y(clashes)g(with)e Fn(typedef)p Fq(s:)16 b(names)10 +b(starting)i(with)f(a)g(single)h(underscore)h(are)f(reserv)o(ed)i(for)d +(libraries)g(and)h(will)e(in)h(principle)0 1053 y(not)g(app)q(ear)h(in) +f(user)h(co)q(de.)18 b(Ho)o(w)o(ev)o(er,)12 b(this)f(sc)o(heme)g(is)g +(not)g(fo)q(olpro)q(of,)f(considering)i(that)f(FFIGEN)g(is)g(used)h(to) +g(translate)0 1103 y(library)h(co)q(de.)19 b(W)m(e)13 +b(migh)o(t)f(need)j(to)f(come)f(up)h(with)f(something)g(b)q(etter.)0 +1219 y Fl(3.3)56 b(Primitiv)n(e)15 b(T)n(yp)r(es)0 1296 +y Fq(The)i(pro)q(cedure)h Fn(chez-type)c Fq(tak)o(es)j(a)e(primitiv)o +(e)f(t)o(yp)q(e)j(structure)h(and)e(returns)i(the)f(name)e(of)g(the)i +(Chez)g(Sc)o(heme)f(pa-)0 1346 y(rameter)e(or)h(return)g(t)o(yp)q(e.)20 +b(Already)14 b(w)o(e)h(ha)o(v)o(e)f(to)g(mak)o(e)f(hard)i(c)o(hoices:) +20 b(what)14 b(do)g(w)o(e)h(do)f(with)g(p)q(oin)o(ters,)g(in)g +(particular)0 1396 y(c)o(haracter)j(p)q(oin)o(ters?)22 +b(In)15 b(the)h(curren)o(t)h(implemen)o(tatio)o(n)c(I)i(let)g(a)g +Fn(char*)f Fq(b)q(e)i(a)f Fn(char*)p Fq(;)f(programs)g(whic)o(h)h(wish) +g(to)g(pass)0 1446 y(strings)f(will)d(ha)o(v)o(e)i(to)g(\014rst)h(cop)o +(y)g(the)f(string)h(data)f(in)o(to)f(an)h(allo)q(cated)g(c)o(haracter)h +(bu\013er)h(and)e(then)h(pass)f(the)h(address)h(of)0 +1495 y(the)f(bu\013er.)20 b(A)13 b(function)h(whic)o(h)g(p)q(erforms)f +(the)i(cop)o(y)f(op)q(eration)f(is)h(part)g(of)f(the)i(standard)f +(library)m(.)62 1545 y(Other)h(decisions)g(I)f(ha)o(v)o(e)f(made)g(are) +i(to)e(represen)o(t)k(p)q(oin)o(ters)d(as)g(unsigned)g(32-bit)f(in)o +(ts)h(\(hence)i(all)c(p)q(oin)o(ters)j(are)f(the)0 1595 +y(same)f(size\),)h(and)f(to)h(represen)o(t)i Fn(char)p +Fq(,)c Fn(signed)21 b(char)p Fq(,)12 b(and)i Fn(unsigned)20 +b(char)13 b Fq(all)f(as)i(the)g(same)f Fn(char)g Fq(FFI)h(t)o(yp)q(e.)k +(If)13 b(the)0 1645 y(t)o(yp)q(e)h(is)g(a)g Fn(short)f +Fq(v)n(arian)o(t,)f(a)h(w)o(arning)h(is)f(generated.)865 +1630 y Fm(2)903 1645 y Fq(En)o(ums)g(are)i(assumed)e(to)h(b)q(e)g +(32-bit)f(in)o(tegers.)0 1727 y Fg(h)p Ff(Chez)g(FFI)g(names)g(for)g +(primitiv)o(e)i(t)o(yp)q(es)f Fj(4c)p Fg(i)c(\021)104 +1773 y Fe(\(define)17 b(\(chez-typ)o(e)f(type\))143 1818 +y(\(case)i(\(record-t)o(ag)e(type\))182 1864 y(\(\(pointer\))g +('unsigned-)o(32)o(\))182 1910 y(\(\(int)i(long)g(enum\))g('integer-)o +(32)o(\))182 1955 y(\(\(unsigned)e(unsigned-l)o(on)o(g\))g('unsigned-)o +(32\))182 2001 y(\(\(char)i(unsigned)o(-ch)o(ar)e(signed-cha)o(r\))g +('char\))182 2047 y(\(\(void\))h('void\))182 2092 y(\(\(double\))f +('double-flo)o(at)o(\))182 2138 y(\(\(float\))h('single-f)o(loa)o(t\)) +182 2184 y(\(\(***inval)o(id*)o(**)o(\))g('***inval)o(id)o(***)o(\))182 +2229 y(\(else)202 2275 y(\(warn)h("Cannot)e(translate)h(this)h(type:)f +(")j(type\))202 2321 y(\(string->)o(sym)o(bo)o(l)d(\(string-a)o(pp)o +(end)f(\(symbol->)o(str)o(in)o(g)h('***inval)o(id)o(:\))810 +2366 y(\(symbol->)o(str)o(in)o(g)g(\(record-t)o(ag)f(type\)\))810 +2412 y("***"\)\)\)\))o(\))104 2458 y Fd(3)0 2504 y Fj(Macro)11 +b(referenced)d(in)k(scrap)e(2d.)p 0 2537 780 2 v 46 2564 +a Fi(2)64 2576 y Fj(Chez)k(Sc)o(heme)e(do)q(es)h(not)h(supp)q(ort)e(a)i +Fh(short)f Fj(FFI)h(t)o(yp)q(e.)23 b(Since)13 b(the)h(ANSI)g(C)h +(standard)d(\(or)i(at)g(least)f(K&R)j(2nd)d(edition\))f(seems)i(to)0 +2615 y(sa)o(y)f(that)g(a)h Fh(short)e Fj(can)i(b)q(e)f(passed)g(to)g(a) +h(function)e(with)h(a)h(protot)o(yp)q(e)d(in)j(scop)q(e)f(without)f(b)q +(eing)h(widened)f(to)i Fh(int)p Fj(,)f(w)o(e)i(can't)d(simply)h(use)0 +2655 y Fh(integer-32)8 b Fj(as)j(the)f(FFI)h(argumen)o(t)d(t)o(yp)q(e)i +(for)h(a)g Fh(short)p Fj(.)i(On)f(man)o(y)d(arc)o(hitectures)f(using)i +(a)h(32-bit)e(in)o(teger)g(w)o(ould)i(w)o(ork)g(b)q(ecause)e(the)h +(APIs)0 2694 y(don't)g(supp)q(ort)g(parameters)e(smaller)i(than)g(32)h +(bits.)k(W)m(e)d(could)e(also)h(ha)o(v)o(e)f(used)g(pro)o(xy)g +(functions;)f(see)i(section)f(3.4.3.)965 2828 y Fq(4)p +eop +%%Page: 5 5 +5 4 bop 0 45 a Fq(The)20 b(sp)q(ecial)g(t)o(yp)q(e)g +Fn(***invalid***)c Fq(and)k(its)f(v)n(arian)o(t)f Fn(***invalid:tag***) +e Fq(are)k(used)g(to)g(signal)e(errors)j(detected)0 95 +y(during)15 b(translation;)h(b)o(y)f(using)g(these)i(t)o(yp)q(es)g(in)e +(the)h(output,)g(no)f(\014le)h(that)f(w)o(as)h(generated)h(with)e +(errors)i(can)f(actually)0 145 y(b)q(e)f(used.)62 195 +y(In)h(addition,)e(w)o(e)i(ha)o(v)o(e)g(to)f(consider)i(ho)o(w)e(to)h +(dereference)i(p)q(oin)o(ters)e(to)g(primitiv)o(e)d(t)o(yp)q(es)k(\(p)q +(oin)o(ters)f(to)g(structured)0 244 y(t)o(yp)q(es)g(are)f(handled)g +(later\).)20 b(F)m(or)15 b(example,)e(if)h(I)h(ha)o(v)o(e)f(an)h +Fn(int*)f Fq(and)g(I)h(w)o(an)o(t)f(to)h(access)h(the)g(in)o(teger)f +(it)f(p)q(oin)o(ts)h(to,)f(ho)o(w)0 294 y(do)g(I)h(do)f(this?)20 +b(F)m(or)14 b(this)h(purp)q(ose,)g(dereferencing)i(functions)d(are)h +(pro)o(vided)g(in)f(the)h(standard)g(library)m(.)j(Eac)o(h)d(function)0 +344 y(tak)o(es)g(a)e(p)q(oin)o(ter)i Fn(p)f Fq(and)g(an)g(o\013set)h +Fn(k)f Fq(and)g(fetc)o(hes)h(the)g(elemen)o(t)f Fn(p[k])p +Fq(.)j(There)f(are)e(also)g(functions)g(whic)o(h)g(store)h(v)n(alues)0 +394 y(through)f(p)q(oin)o(ters)g(to)g(primitiv)o(e)e(t)o(yp)q(es.)19 +b(See)c(section)f(7)g(for)f(the)i(signatures)f(and)g(the)h(actual)e +(implemen)o(tation.)62 444 y(By)j(treating)f(p)q(oin)o(ters)g(to)g(p)q +(oin)o(ters)h(as)f(generic)h(p)q(oin)o(ter)f(t)o(yp)q(es,)h(w)o(e)f +(handle)g(the)h(general)f(case)h(of)f(recursiv)o(e)h(deref-)0 +493 y(erencing.)25 b(Since)17 b(p)q(oin)o(ters)f(and)g(in)o(tegers)h +(are)f(the)h(same)e(size)h(and)g(t)o(yp)q(e)h(c)o(hec)o(king)f(is)g +(lax,)f(w)o(e)h(can)g(use)h(the)g(unsigned)0 543 y(in)o(teger)d(access) +i(functions)e(to)f(follo)o(w)f(p)q(oin)o(ter)i(c)o(hains.)k(F)m(or)c +(example,)e(if)h(w)o(e)h(ha)o(v)o(e)g(an)f Fn(int**)21 +b(p)13 b Fq(and)h(w)o(an)o(t)g(the)g(in)o(teger,)0 593 +y(the)g(co)q(de)h(to)f(access)i(it)d(w)o(ould)g(b)q(e)i(\(in)e(C\))h +Fn(_ref_int\(_ref_uint\()o(p,0\))o(,0\))p Fq(.)0 709 +y Fl(3.4)56 b(Structured)18 b(T)n(yp)r(es)0 786 y Fq(The)f +(translations)f(for)g(structs)i(and)e(unions)g(are)h(similar.)23 +b(I'll)15 b(talk)h(ab)q(out)g(structures,)j(but)d(the)h(discussion)g(p) +q(ertains)0 836 y(to)d(unions)h(as)f(w)o(ell.)20 b(The)15 +b(pro)q(cedures)i Fn(dump-structs)12 b Fq(and)i Fn(dump-unions)e +Fq(are)j(almost)e(iden)o(tical,)g(and)i(call)f(the)h(same)0 +885 y(function)f(to)f(do)h(their)g(w)o(ork:)0 959 y Fg(h)p +Ff(dump)g(structs)f(and)h(unions)h Fj(5)p Fg(i)10 b(\021)104 +1005 y Fe(\(define)17 b(\(dump-str)o(uc)o(ts\))143 1051 +y(\(dump-stru)o(ct)o(/un)o(io)o(n)g(structs)g(struct-n)o(ame)o(s)g +("struct")o(\)\))104 1142 y(\(define)g(\(dump-uni)o(on)o(s\))143 +1188 y(\(dump-stru)o(ct)o(/un)o(io)o(n)g(unions)g(union-nam)o(es)f +("union"\)\))104 1234 y Fd(3)0 1280 y Fj(Macro)11 b(de\014ned)e(b)o(y)i +(scraps)g(5,)g(6ab)q(c,)f(7ab,)g(8ab,)h(9ab)q(c,)f(10a.)0 +1314 y(Macro)h(referenced)d(in)k(scrap)e(2d.)0 1418 y +Fn(struct-names)j Fq(and)i Fn(union-names)e Fq(are)j(pro)q(cedures)i +(whic)o(h)d(return)i(a)e(list)g(of)g(all)f Fn(typedef)p +Fq(s)g(whic)o(h)h(directly)h(name)e(a)0 1467 y(struct)h(or)f(union;)f +(see)i(the)g Fp(FFIGEN)g(User's)f(Manual)g Fq(for)g(a)g(discussion.)62 +1517 y(In)g(the)h(follo)o(wing,)10 b(w)o(e)15 b(will)d(use)j(this)f +(structure)i(as)e(an)f(example:)104 1597 y Fe(struct)k(X)i({)143 +1642 y(int)f(i;)143 1688 y(char)g(c[5];)143 1734 y(union)g({)182 +1779 y(char)g(*s;)182 1825 y(int)h(*q;)143 1871 y(})g(u;)104 +1916 y(};)62 2017 y Fq(Eac)o(h)c(structure)h(in)e(the)g(in)o +(termediate)g(form)e(has)j(a)e(tag)h(\()p Fn(X)g Fq(in)g(the)h +(example\),)d(although)h(some)h(of)f(these)j(tags)e(w)o(ere)0 +2067 y(generated)j(b)o(y)f(the)h(compiler.)23 b(Whether)17 +b(the)f(tag)g(w)o(as)g(programmer-de\014ned)e(or)i(not)g(is)g(imp)q +(ortan)o(t)e(for)i(ho)o(w)f(co)q(de)i(is)0 2117 y(generated)h(\(see)g +(b)q(elo)o(w\),)f(and)f(the)i(pro)q(cedure)g Fn(dump-struct/union)13 +b Fq(tak)o(es)k(it)g(in)o(to)f(accoun)o(t)h(when)g(generating)g(FFI)0 +2166 y(co)q(de)e(for)e(eac)o(h)i(referenced)h(structure.)62 +2216 y(Only)d(structures)j(whic)o(h)d(ha)o(v)o(e)g +(programmer-de\014ned)f(tags)h(ha)o(v)o(e)g(op)q(erations)g(generated)h +(for)f(them)g(with)f(the)i(name)0 2266 y(of)g(the)i(tag.)21 +b(Structures)c(whic)o(h)e(are)g(referred)i(to)e(b)o(y)g(a)f +Fn(typedef)g Fq(m)o(ust)g(b)q(e)i(handled)e(sp)q(ecially)m(.)21 +b(There)16 b(are)g(t)o(w)o(o)e(cases.)0 2316 y(If)i(the)h +Fn(typedef)p Fq('d)d(structure)19 b(also)c(has)i(a)f +(programmer-de\014ned)e(tag,)i(then)h(Sc)o(heme)g(de\014nitions)f(are)g +(emitted)g(whic)o(h)0 2366 y(de\014ne)k(op)q(erations)f(using)f(the)h +Fn(typedef)e Fq(name)h(to)g(b)q(e)h(the)h(same)d(as)i(the)g(op)q +(erations)g(using)f(the)i(structure)g(tag.)32 b(If)0 +2415 y(the)17 b(t)o(yp)q(e)g(do)q(es)h(not)e(ha)o(v)o(e)g(a)h +(programmer-de\014ned)e(tag,)h(then)h(op)q(erations)g(are)g(de\014ned)h +(on)e(the)h(structure)i(using)d(the)0 2465 y Fn(typedef)c +Fq(name)h(only;)g(y)o(ou)g(get)h(names)f(lik)o(e)g Fn(_get_X_i)p +Fq(.)965 2828 y(5)p eop +%%Page: 6 6 +6 5 bop 0 32 a Fg(h)p Ff(dump)14 b(structs)f(and)h(unions)h +Fj(6a)p Fg(i)9 b(\021)104 78 y Fe(\(define)17 b(\(dump-str)o(uc)o(t/u)o +(nio)o(n)f(records)h(typedef-na)o(me-)o(ge)o(tte)o(r)g(qualifie)o(r\)) +143 123 y(\(for-each)163 169 y(\(lambda)g(\(structu)o(re\))202 +215 y(\(if)h(\(reference)o(d?)e(structure\))280 260 y(\(begin)320 +306 y(\(if)i(\(user-defi)o(ne)o(d-t)o(ag)o(?)f(\(tag)h(structure)o +(\)\))398 352 y(\(dump-stru)o(ct)o(/un)o(io)o(n-d)o(ef)e(structure)g +(qualifier)g(\(tag)i(structure\)\))o(\))320 397 y(\(for-eac)o(h)f +(\(lambda)g(\(n\))555 443 y(\(if)h(\(user-defi)o(ned)o(-ta)o(g?)e +(\(tag)i(structure\))o(\))633 489 y(\(generate-)o(ref)o(ere)o(nc)o(e-t) +o(o-)o(str)o(uct)o(ur)o(e)f(structure)f(n)j(qualifier)o(\))633 +534 y(\(dump-stru)o(ct/)o(uni)o(on)o(-de)o(f)d(structure)h("")h +(n\)\)\))516 580 y(\(typedef-)o(na)o(me-)o(ge)o(tte)o(r)f(structur)o +(e\)\))o(\)\)\))163 626 y(records\)\))104 671 y Fd(3)0 +718 y Fj(Macro)11 b(de\014ned)e(b)o(y)i(scraps)g(5,)g(6ab)q(c,)f(7ab,)g +(8ab,)h(9ab)q(c,)f(10a.)0 751 y(Macro)h(referenced)d(in)k(scrap)e(2d.)0 +855 y Fq(The)19 b(pro)q(cedure)h Fn(generate-reference-)o(to-st)o +(ructu)o(re)15 b Fq(tak)o(es)k(a)g(structure)h(whic)o(h)f(has)f(a)g +(cac)o(hed)i(list)e(of)g(de\014ned)0 905 y(constructor,)g(destructor,)g +(accessor,)g(and)e(m)o(utator)f(function,)h(a)g Fn(typedef)p +Fq(-nam)o(e,)e(and)i(a)g(quali\014er)f(\()p Fn(struct)p +Fq(,)h Fn(union)p Fq(,)0 955 y(or)f(the)g(empt)o(y)f(string\))h(and)g +(generates)h(Sc)o(heme)f(de\014nitions)g(whic)o(h)g(use)g(the)h +Fn(typedef)p Fq(-name)c(but)j(whic)o(h)g(refer)h(to)e(the)0 +1005 y(already-de\014ned)19 b(functions)f(using)g(the)h(quali\014ed)f +(name)f(and)h(structure)i(tag.)31 b(F)m(or)18 b(example,)f(if)h(there)h +(is)f(already)g(a)0 1055 y(foreign)d(function)f(called)h +Fn(_get_struct_X_F)d Fq(and)j(the)h Fn(typedef)d Fq(name)h(is)h +Fn(Y)p Fq(,)g(then)g(a)g(v)n(ariable)f(called)h Fn(_get_Y_F)e +Fq(will)0 1104 y(b)q(e)i(b)q(ound)e(to)h(the)h(v)n(alue)e(of)g(the)i +(existing)e(foreign)h(function.)0 1186 y Fg(h)p Ff(dump)g(structs)f +(and)h(unions)h Fj(6b)p Fg(i)9 b(\021)104 1232 y Fe(\(define)17 +b(\(generate)o(-r)o(efe)o(ren)o(ce)o(-to)o(-s)o(tru)o(ct)o(ure)f +(structure)g(typedef-na)o(me)g(qualifier\))143 1278 y(\(for-each)g +(\(lambda)h(\(n\))378 1324 y(\(let)h(\(\(newname)f(\(compute)o(-ne)o +(wna)o(me)f(n)j(typedef-na)o(me)d(\(tag)i(structure\))e(qualifier\))o +(\)\))418 1369 y(\(display)g(`\(define)h(,newname)f(,n\))j(sch-outpu)o +(t\))418 1415 y(\(newline)d(sch-output)o(\)\))o(\))339 +1461 y(\(cached-na)o(mes)g(structure)o(\)\))o(\))104 +1506 y Fd(3)0 1553 y Fj(Macro)11 b(de\014ned)e(b)o(y)i(scraps)g(5,)g +(6ab)q(c,)f(7ab,)g(8ab,)h(9ab)q(c,)f(10a.)0 1586 y(Macro)h(referenced)d +(in)k(scrap)e(2d.)0 1690 y Fq(The)20 b(pro)q(cedure)i +Fn(compute-newname)17 b Fq(tak)o(es)j(an)g(already)g(emitted)f(name)g +(and)g(generates)j(a)e(name)e(whic)o(h)i(uses)h(the)0 +1740 y Fn(typedef)12 b Fq(name.)0 1823 y Fg(h)p Ff(dump)i(structs)f +(and)h(unions)h Fj(6c)p Fg(i)9 b(\021)104 1869 y Fe(\(define)17 +b(\(compute-)o(ne)o(wna)o(me)f(oldname)h(typedef-na)o(me)f(tag)i +(qualifier\))143 1915 y(\(let)g(\(\(q)h(\(string-)o(app)o(end)d +(qualifier)g("_")i(tag\)\)\))182 1960 y(\(let)g(\(\(get)57 +b(\(string-ap)o(pen)o(d)16 b("_get_")h(q\)\))300 2006 +y(\(set)57 b(\(string-ap)o(pen)o(d)16 b("_set_")h(q\)\))300 +2052 y(\(alloc)g(\(string-ap)o(pen)o(d)f("_alloc_")h(q\)\))300 +2097 y(\(free)37 b(\(string-ap)o(pen)o(d)16 b("_free_")h(q\)\)\))221 +2143 y(\(cond)h(\(\(string-p)o(ref)o(ix)o(=?)e(oldname)h(get\))359 +2189 y(\(string-a)o(ppe)o(nd)f("_get_")h(typedef-n)o(ame)f(\(substrin)o +(g)h(oldname)g(\(string-)o(len)o(gt)o(h)g(get\))1281 +2234 y(\(string-l)o(en)o(gth)f(oldname\)\))o(\)\))339 +2280 y(\(\(string-p)o(ref)o(ix)o(=?)g(oldname)h(set\))359 +2326 y(\(string-a)o(ppe)o(nd)f("_set_")h(typedef-n)o(ame)f(\(substrin)o +(g)h(oldname)g(\(string-)o(len)o(gt)o(h)g(set\))1281 +2371 y(\(string-l)o(en)o(gth)f(oldname\)\))o(\)\))339 +2417 y(\(\(string-p)o(ref)o(ix)o(=?)g(oldname)h(alloc\))g(\(string-app) +o(en)o(d)g("_alloc_")f(typedef-n)o(am)o(e\)\))339 2463 +y(\(\(string-p)o(ref)o(ix)o(=?)g(oldname)h(free\))h(\(string-a)o(ppe)o +(nd)e("_free_")h(typedef-)o(nam)o(e\))o(\))339 2508 y(\(else)h(\(error) +f("compute-n)o(ew)o(nam)o(e:)f(can't)i(handle:)f(")i(oldname\)\)\))o +(\)\))o(\))104 2554 y Fd(3)0 2600 y Fj(Macro)11 b(de\014ned)e(b)o(y)i +(scraps)g(5,)g(6ab)q(c,)f(7ab,)g(8ab,)h(9ab)q(c,)f(10a.)0 +2634 y(Macro)h(referenced)d(in)k(scrap)e(2d.)965 2828 +y Fq(6)p eop +%%Page: 7 7 +7 6 bop 0 45 a Fq(The)15 b(pro)q(cedure)h Fn(dump-struct/union-)o(def) +11 b Fq(tak)o(es)k(a)f(structure)j(t)o(yp)q(e,)d(a)g(quali\014er)g(\(a) +g(string,)h(either)g Fn(struct)p Fq(,)e Fn(union)p Fq(,)0 +95 y(or)f(the)g(empt)o(y)f(string\))h(and)g(the)h(C)f(name)e(of)i(the)g +(structure)i(\(its)e(tag)g(or)g Fn(typedef)e Fq(name\),)h(and)h +(generates)h(constructors,)0 145 y(destructors,)j(accessors,)f(and)f(m) +o(utators)f(for)g(the)i(structure.)0 226 y Fg(h)p Ff(dump)f(structs)f +(and)h(unions)h Fj(7a)p Fg(i)9 b(\021)104 273 y Fe(\(define)17 +b(\(dump-str)o(uc)o(t/u)o(nio)o(n-)o(def)f(structure)g(qualifier)g +(name\))143 318 y(\(let*)i(\(\(funcnam)o(e)e(\(if)j(\(string=?)d +(qualifier)g(""\))555 364 y(name)555 410 y(\(string-a)o(ppe)o(nd)g +(qualifier)g("_")j(name\)\)\))280 455 y(\(cast)96 b(\(if)19 +b(\(string=?)d(qualifier)g(""\))555 501 y(name)555 547 +y(\(string-a)o(ppe)o(nd)g(qualifier)g(")j(")h(name\)\)\)\))182 +592 y(\(generate-)o(con)o(st)o(ruc)o(tor)o(-a)o(nd-)o(de)o(str)o(uc)o +(tor)c(structure)g(funcname)h(cast\))182 638 y(\(generate-)o(acc)o(es)o +(sor)o(s-a)o(nd)o(-mu)o(ta)o(tor)o(s)f(structure)h(funcname)f(cast)i +(""\)\)\))104 684 y Fd(3)0 730 y Fj(Macro)11 b(de\014ned)e(b)o(y)i +(scraps)g(5,)g(6ab)q(c,)f(7ab,)g(8ab,)h(9ab)q(c,)f(10a.)0 +764 y(Macro)h(referenced)d(in)k(scrap)e(2d.)0 867 y Fb(3.4.1)48 +b(Constructors)13 b(and)j(destructors)0 944 y Fq(The)h(pro)q(cedure)h +Fn(generate-constructo)o(r-and)o(-dest)o(ructo)o(r)c +Fq(generates)k(constructor)g(and)e(destructor)j(pro)q(cedures)0 +994 y(for)11 b(its)g(argumen)o(t.)16 b(The)11 b(constructor)i(pro)q +(cedure)g(is)e(called)f Fn(_alloc_struct_X)p Fq(.)e(This)j(pro)q +(cedure)i(tak)o(es)e(no)g(parameters)0 1044 y(and)f(allo)q(cates)f +(memory)f(for)h(the)i(giv)o(en)e(t)o(yp)q(e,)i(returning)f(a)g(p)q(oin) +o(ter)g(\(cast)g(to)g(an)g(unsigned)g(in)o(teger\))g(or)g(the)h +(literal)e(in)o(teger)0 1094 y(0)14 b(\(whic)o(h)g(ma)o(y)d(b)q(e)k +(di\013eren)o(t)g(from)d(the)i(n)o(ull)f(p)q(oin)o(ter\).)62 +1143 y(The)i(destructor)h(pro)q(cedure)h(is)d(called)g +Fn(_free_struct_X)p Fq(;)d(it)j(tak)o(es)h(a)f(v)n(alue)f(returned)k +(from)12 b(the)j(constructor)h(and)0 1193 y(frees)k(the)g(allo)q(cated) +e(memory)m(.)31 b(Generating)19 b(a)f(constructor)j(ma)o(y)c(b)q(e)j +(excessiv)o(e;)j(a)18 b(single)h(in)o(terface)h(to)e +Fn(free\(\))g Fq(is)0 1243 y(probably)13 b(enough.)18 +b(The)d(destructors)h(ma)o(y)c(go)h(a)o(w)o(a)o(y)g(in)g(the)i(future.) +62 1293 y(The)i(c)o(hoice)f(of)g(v)n(alue)f(for)h(the)g(n)o(ull)f(p)q +(oin)o(ter)i(w)o(arran)o(ts)f(discussion.)25 b(I)16 b(use)h(the)f(in)o +(teger)h(0)f(to)g(mak)o(e)e(it)i(p)q(ossible)g(to)0 1343 +y(test)e(for)e(a)h(n)o(ull)e(p)q(oin)o(ter)i(b)o(y)g(comparing)e(with)h +(0)h(on)f(the)h(Sc)o(heme)g(side;)g(it)f(is)h(a)g(decision)f(whic)o(h)h +(probably)f(simpli\014es)f(the)0 1392 y(Sc)o(heme)j(co)q(de.)k(Using)c +(an)f(unadulterated)i(n)o(ull)d(p)q(oin)o(ter)i(w)o(ould)f(mak)o(e)f +(comparison)g(with)i(0)f(nonp)q(ortable,)g(since)i(a)e(n)o(ull)0 +1442 y(p)q(oin)o(ter)h(is)g(not)g(guaran)o(teed)g(to)g(b)q(e)g +(all-bits-zero.)62 1492 y(An)k(alternativ)o(e)g(w)o(ould)e(b)q(e)j(to)e +(generate)i(foreign)e(pro)q(cedures)j(whic)o(h)e(return)g(n)o(ull)f(p)q +(oin)o(ters,)i(one)f(pro)q(cedure)h(for)0 1542 y(eac)o(h)14 +b(p)q(oin)o(ter)g(t)o(yp)q(e)h(in)e(the)i(program,)d(and)h(these)j +(return)f(v)n(alues)e(could)h(b)q(e)h(used)f(for)g(p)q(oin)o(ter)g +(comparisons.)1769 1527 y Fm(3)0 1624 y Fg(h)p Ff(dump)g(structs)f(and) +h(unions)h Fj(7b)p Fg(i)9 b(\021)104 1670 y Fe(\(define)17 +b(\(generate)o(-c)o(ons)o(tru)o(ct)o(or-)o(an)o(d-d)o(es)o(tru)o(cto)o +(r)f(structure)h(funcname)f(cast\))143 1715 y(\(function-)o(pa)o(ir)g +(constructo)o(r-t)o(em)o(pla)o(te)437 1761 y(\(vector)h(funcname)g +(cast\))437 1807 y(\(string-ap)o(pen)o(d)f("_alloc_")h(funcname)o(\)) +437 1852 y('\(\(void)g(\(\)\)\))437 1898 y(`\(pointer)f(,\(struct/u)o +(nio)o(n-r)o(ef)g(structure\))o(\)\))143 1944 y(\(function-)o(pa)o(ir)g +(destructor)o(-te)o(mp)o(lat)o(e)437 1989 y(\(vector)h(funcname)g +(cast\))437 2035 y(\(string-ap)o(pen)o(d)f("_free_")h(funcname\))437 +2081 y(`\(\(pointer)f(,\(struct/)o(uni)o(on-)o(re)o(f)h(structure)o +(\)\))o(\))437 2126 y('\(void)h(\(\)\)\))143 2172 y(\(cache-nam)o(e)e +(structure)h(\(string-)o(app)o(en)o(d)g("_alloc_")f(funcname\))o(\))143 +2218 y(\(cache-nam)o(e)g(structure)h(\(string-)o(app)o(en)o(d)g +("_free_")f(funcname\)\))o(\))104 2263 y Fd(3)0 2310 +y Fj(Macro)11 b(de\014ned)e(b)o(y)i(scraps)g(5,)g(6ab)q(c,)f(7ab,)g +(8ab,)h(9ab)q(c,)f(10a.)0 2343 y(Macro)h(referenced)d(in)k(scrap)e(2d.) +0 2447 y Fq(In)19 b(the)h(templates)f(for)g(constructors)i(and)e +(destructors,)k Fn(@0)18 b Fq(is)i(the)g(name)e(of)g(the)i(structure)i +(as)d(w)o(e)g(w)o(an)o(t)g(it)g(to)g(b)q(e)0 2497 y(generated:)h +Fn(struct_X)p Fq(,)12 b Fn(union_X)p Fq(,)g(or)i Fn(X)g +Fq(\(for)g(a)g Fn(typedef)p Fq(\);)e(and)i Fn(@1)g Fq(is)g(the)g(cast)h +(expression)h(for)d(the)i(t)o(yp)q(e:)k Fn(struct)i(X)p +Fq(,)0 2547 y Fn(union)g(X)p Fq(,)13 b(or)h Fn(X)p Fq(.)p +0 2582 780 2 v 46 2608 a Fi(3)64 2620 y Fj(There's)c(one)h(n)o(ull)f(p) +q(oin)o(ter)g(for)h(ev)o(ery)f(p)q(oin)o(ter)g(t)o(yp)q(e.)965 +2828 y Fq(7)p eop +%%Page: 8 8 +8 7 bop 0 32 a Fg(h)p Ff(dump)14 b(structs)f(and)h(unions)h +Fj(8a)p Fg(i)9 b(\021)104 78 y Fe(\(define)17 b(construct)o(or)o(-te)o +(mpl)o(at)o(e)143 123 y("unsigned)f(_alloc_@0\()o(voi)o(d\))g({)202 +169 y(@1)j(*_p)f(=)h(\(@1)g(*\)malloc\()o(siz)o(eo)o(f\(@)o(1\))o(\);)d +(return)i(\(_p)g(==)h(0)g(?)g(0)h(:)f(\(unsigned)o(\)_p)o(\);)163 +215 y(}"\))104 306 y(\(define)e(destructo)o(r-)o(tem)o(pla)o(te)143 +352 y("void)h(_free_@0\()o(un)o(sig)o(ned)e(_p\))i({)h(if)g(\(_p)g(==)g +(0\))f(abort\(\);)f(free\(\(@1)f(*\)_p\);)i(}"\))104 +397 y Fd(3)0 444 y Fj(Macro)11 b(de\014ned)e(b)o(y)i(scraps)g(5,)g(6ab) +q(c,)f(7ab,)g(8ab,)h(9ab)q(c,)f(10a.)0 478 y(Macro)h(referenced)d(in)k +(scrap)e(2d.)0 581 y Fb(3.4.2)48 b(Accessors)15 b(and)g(Mutators)0 +658 y Fq(F)m(or)d(eac)o(h)g(\014eld)g Fn(F)g Fq(of)g(basic)g(or)g(arra) +o(y)g(t)o(yp)q(e)g(there)i(will)c(b)q(e)j(an)f(accessor)i(function)d +Fn(_get_struct_X_F)p Fq(,)e(and)j(for)f(eac)o(h)i(\014eld)0 +708 y(of)h(basic)h(t)o(yp)q(e)g(there)i(will)c(b)q(e)i(a)g(m)o(utator)e +(function)i Fn(_set_struct_X_F)p Fq(.)c(The)k(accessor)i(tak)o(es)e(a)g +(p)q(oin)o(ter)g(and)f(returns)0 758 y(the)g(\014eld)g(v)n(alue;)f(the) +i(m)o(utator)d(tak)o(es)i(a)g(p)q(oin)o(ter)g(and)g(a)f(v)n(alue)h(and) +f(up)q(dates)i(the)g(\014eld.)62 807 y(If)20 b(the)g(structure)i(has)d +(nested)j(structures,)h(functions)d(are)g(generated)h(whic)o(h)e(will)f +(access)k(\014elds)e(in)f(the)h(nested)0 857 y(structures)c(in)c(the)i +(exp)q(ected)h(w)o(a)o(y;)e(the)g(naming)e(sc)o(heme)i(is)g(to)g +(replace)h(the)g(\\.")j(in)c(the)h(C)f(syn)o(tax)g(with)g(an)g +(underscore)0 907 y(\\)p 23 907 13 2 v 15 w(".)k(The)e(generated)g(C)f +(co)q(de)h(for)e(the)i(accessors)h(and)d(m)o(utators)g(will)g(lo)q(ok)f +(lik)o(e)i(this:)104 987 y Fe(int)38 b(_get_stru)o(ct_)o(X_)o(i\(u)o +(nsi)o(gn)o(ed)16 b(_p\))j({)g(return)e(\(\(struct)g(X*\)_p\)->i)o(;)f +(})104 1032 y(void)i(_set_stru)o(ct_)o(X_)o(i\(u)o(nsi)o(gn)o(ed)e(_p,) +j(int)f(_v\))h({)g(\(\(struct)d(X*\)_p\)->i)g(=)k(_v;)e(})104 +1078 y(unsigned)e(_get_struc)o(t_X)o(_u_)o(s\()o(uns)o(ig)o(ned)g(_p\)) +i({)i(return)d(\(unsigned)o(\)\(\()o(st)o(ruc)o(t)g(X*\)_p\)->)o(u.s)o +(;)f(})104 1124 y(void)i(_set_stru)o(ct_)o(X_)o(u_s)o(\(un)o(si)o(gne)o +(d)e(_p,)j(unsigned)d(_v\))j({)g(\(\(struct)e(X*\)_p\)->u)o(.s)f(=)j +(\(char*\)_v;)d(})62 1222 y Fq(Pro)q(cedures)h(are)e(not)g(generated)g +(whic)o(h)g(directly)g(dereference)i(p)q(oin)o(ter)e(\014elds;)g(the)g +(program)e(m)o(ust)g(\014rst)i(fetc)o(h)g(the)0 1272 +y(p)q(oin)o(ter)10 b(\014eld)h(and)f(then)h(dereference)i(it.)k(Arra)o +(ys)10 b(in)g(structures)j(are)e(handled)f(lik)o(e)f(p)q(oin)o(ter)i +(\014elds,)g(so)f Fn(_get_struct_X_c)0 1321 y Fq(will)i(b)q(e)j +(generated)g(and)f(will)e(return)j(a)f(p)q(oin)o(ter)g(to)g(the)g +(\014rst)h(elemen)o(t)e(of)h Fn(c)p Fq(,)f(whic)o(h)g(can)i(then)f(b)q +(e)h(dereferenced.)62 1371 y(The)i(pro)q(cedure)h Fn(generate-access)o +(ors-a)o(nd-mu)o(tator)o(s)13 b Fq(tak)o(es)k(a)e(structure)j(t)o(yp)q +(e,)f(a)f(name)e(to)i(b)q(e)h(used)g(for)e(the)0 1421 +y(function)e(\(initially)d(just)k Fn(struct_X)p Fq(,)d +Fn(union_X)p Fq(,)g(or)i Fn(X)f Fq(for)h(a)g(t)o(yp)q(edef)h(name\),)d +(a)i(cast)h(expression)g(\()p Fn(struct)21 b(X)p Fq(,)12 +b Fn(union)21 b(X)p Fq(,)0 1471 y(or)c(just)h Fn(X)p +Fq(\),)f(and)g(a)g(\014eld)h(selector)h(expression)f(\(initially)e(the) +i(empt)o(y)e(string\).)29 b(As)18 b(the)g(program)e(descends)k(in)o(to) +c(the)0 1521 y(structure)i(the)e(function)g(name)e(and)i(the)g +(selector)h(expression)g(will)e(b)q(e)h(up)q(dated)g(to)g(re\015ect)i +(the)e(\014eld)g(whic)o(h)f(is)h(b)q(eing)0 1571 y(accessed.)k(App)q +(ended)14 b(to)e(the)i(function)e(name)f(will)g(b)q(e)j(an)e +(underscore)j(and)d(the)h(\014eld)g(name,)e(so)i(w)o(e'll)e(see)j +Fn(struct_X_i)0 1620 y Fq(and)i Fn(struct_X_u_s)p Fq(,)d(for)j +(example.)22 b(The)17 b(selector)g(will)d(b)q(e)j(the)f(corresp)q +(onding)h(access)h(expression)f(for)e(C,)h(so)g Fn(i)f +Fq(and)0 1670 y Fn(u.s)p Fq(.)62 1720 y(When)d(generating)g(accessors)j +(and)c(m)o(utators,)g(there)i(are)g(three)g(cases:)18 +b(\014elds)12 b(of)g(some)f(basic)h(t)o(yp)q(e)g(\(primitiv)o(e)e(t)o +(yp)q(es)0 1770 y(and)k(p)q(oin)o(ters\),)g(\014elds)g(of)f(arra)o(y)h +(t)o(yp)q(e,)g(and)g(\014elds)g(of)f(structured)j(t)o(yp)q(e.)0 +1854 y Fg(h)p Ff(dump)e(structs)f(and)h(unions)h Fj(8b)p +Fg(i)9 b(\021)104 1900 y Fe(\(define)17 b(\(generate)o(-a)o(cce)o(sso)o +(rs)o(-an)o(d-)o(mut)o(at)o(ors)f(structure)g(funcname)h(cast)h +(selector\))143 1946 y(\(for-each)163 1991 y(\(lambda)f(\(field\))202 +2037 y(\(let)h(\(\(funcnam)o(e)f(\(string-a)o(pp)o(end)f(funcname)g +("_")j(\(canonica)o(l-n)o(am)o(e)e(\(name)g(field\)\)\)\))320 +2083 y(\(selecto)o(r)g(\(string-a)o(pp)o(end)f(selector)g(\(if)j +(\(string=?)d(selector)h(""\))h("")h("."\))f(\(name)g(field\)\)\))o(\)) +241 2128 y(\(cond)g(\(\(basic-t)o(ype)o(?)e(\(type)i(field\)\))378 +2174 y(\(getset-bas)o(ic)o(-ty)o(pe)e(structure)g(funcname)h(cast)h +(selector)e(field\)\))359 2220 y(\(\(array-t)o(ype)o(?)g(\(type)i +(field\)\))378 2265 y(\(getset-arr)o(ay)o(-ty)o(pe)e(structure)g +(funcname)h(cast)h(selector)e(field\)\))359 2311 y(\(\(structu)o(red)o +(-t)o(ype)o(?)g(\(type)i(field\)\))378 2357 y(\(getset-str)o(uc)o(tur)o +(ed)o(-ty)o(pe)e(structure)g(funcname)h(cast)h(selector)e(field\)\))359 +2402 y(\(else)h(\(error)h('generate)o(-a)o(cce)o(sso)o(rs)o(-an)o(d-)o +(mut)o(ato)o(rs)e("Unknown:)g(")j(field\)\)\)\)\))163 +2448 y(\(fields)e(structur)o(e\)\))o(\))104 2494 y Fd(3)0 +2540 y Fj(Macro)11 b(de\014ned)e(b)o(y)i(scraps)g(5,)g(6ab)q(c,)f(7ab,) +g(8ab,)h(9ab)q(c,)f(10a.)0 2574 y(Macro)h(referenced)d(in)k(scrap)e +(2d.)0 2677 y Fq(The)15 b(use)g(of)f Fn(canonical-name)d +Fq(is)j(imp)q(ortan)o(t.)k(This)c(pro)q(cedure)j(transforms)c(an)h +(iden)o(ti\014er)h(from)e(its)h(C)g(syn)o(tax)h(in)o(to)e(a)965 +2828 y(8)p eop +%%Page: 9 9 +9 8 bop 0 45 a Fq(syn)o(tax)16 b(acceptable)h(to)f(Sc)o(heme)g(b)o(y)g +(transforming)e(the)j(letters)g(to)f(the)h(canonical)e(case)i(of)e(the) +i(represen)o(tation.)26 b(\(F)m(or)0 95 y(example,)12 +b(if)h(the)i(sym)o(b)q(ol)d Fn(a)h Fq(prin)o(ts)h(as)g +Fn(A)g Fq(then)h(the)f(canonical)f(case)i(of)e(the)i(implemen)o(tatio)o +(n)c(is)j(upp)q(er)h(case.\))62 145 y(Fields)f(of)f(basic)h(t)o(yp)q +(es)h(get)f(b)q(oth)g(accessors)i(and)e(m)o(utators.)1045 +130 y Fm(4)0 226 y Fg(h)p Ff(dump)g(structs)f(and)h(unions)h +Fj(9a)p Fg(i)9 b(\021)104 273 y Fe(\(define)17 b(\(getset-b)o(as)o(ic-) +o(typ)o(e)f(struct)i(funcname)e(cast)i(selector)f(field\))143 +318 y(\(let*)h(\(\(typenam)o(e)56 b(\(basic-ty)o(pe)o(-na)o(me)16 +b(\(type)i(field\)\)\))280 364 y(\(fieldtype)36 b(\(c-cast-e)o(xp)o +(res)o(si)o(on)16 b(\(type)i(field\)\)\)\))182 410 y(\(function-)o(pai) +o(r)e(accessor-te)o(mp)o(lat)o(e)476 455 y(\(vector)h(typename)g +(funcname)f(cast)i(selector\))476 501 y(\(string-app)o(en)o(d)f +("_get_")g(funcname)o(\))476 547 y(`\(\(pointer)f(,\(struct/u)o(nio)o +(n-)o(ref)g(struct\)\)\))476 592 y(\(type)i(field\)\))182 +638 y(\(function-)o(pai)o(r)e(mutator-tem)o(pl)o(ate)476 +684 y(\(vector)h(typename)g(funcname)f(cast)i(selector)f(fieldtype\)) +476 729 y(\(string-app)o(en)o(d)g("_set_")g(funcname)o(\))476 +775 y(`\(\(pointer)f(,\(struct/u)o(nio)o(n-)o(ref)g(struct\)\))g +(,\(type)i(field\)\))476 821 y(`\(void)g(\(\)\)\))182 +866 y(\(cache-nam)o(e)f(struct)g(\(string-a)o(ppe)o(nd)f("_get_")h +(funcname\)\))182 912 y(\(cache-nam)o(e)g(struct)g(\(string-a)o(ppe)o +(nd)f("_set_")h(funcname\)\))o(\)\))104 958 y Fd(3)0 +1004 y Fj(Macro)11 b(de\014ned)e(b)o(y)i(scraps)g(5,)g(6ab)q(c,)f(7ab,) +g(8ab,)h(9ab)q(c,)f(10a.)0 1038 y(Macro)h(referenced)d(in)k(scrap)e +(2d.)0 1144 y Fq(In)15 b(the)h(accessor)g(and)f(m)o(utator)f +(templates,)g Fn(@0)g Fq(is)h(the)h(v)n(alue)e(return)i(or)f(parameter) +g(t)o(yp)q(e)g(\(p)q(oin)o(ters)h(are)f(alw)o(a)o(ys)f(\\un-)0 +1194 y(signed"\),)i Fn(@1)g Fq(is)g(the)h(function)f(name,)f +Fn(@2)h Fq(is)g(a)g(cast)h(expression)g(for)f(the)h(structure)h(p)q +(oin)o(ter)e(t)o(yp)q(e,)h Fn(@3)f Fq(is)g(the)h(C)f(\014eld)0 +1243 y(selector)d(expression,)g(and)f Fn(@4)f Fq(is)g(the)i(cast)f +(expression)h(from)d(the)i(parameter)g(t)o(yp)q(e)g(to)g(the)g(\014eld) +g(t)o(yp)q(e)g(\(used)h(in)e(m)o(utators)0 1293 y(only\).)0 +1377 y Fg(h)p Ff(dump)j(structs)f(and)h(unions)h Fj(9b)p +Fg(i)9 b(\021)104 1423 y Fe(\(define)17 b(accessor-)o(te)o(mpl)o(ate) +143 1469 y("@0)h(_get_@1\()f(unsigned)g(_p)h(\))i({)f(return)e +(\(@0\)\(\(@2*\))o(_p)o(\)->)o(@3;)f(}"\))104 1560 y(\(define)h +(mutator-t)o(em)o(pla)o(te)143 1606 y("void)h(_set_@1\()e(unsigned)h +(_p,)h(@0)h(_v)g(\))g({)g(\(\(@2*\)_p\)-)o(>@3)d(=)j(\(@4\)_v;)e(}"\)) +104 1652 y Fd(3)0 1698 y Fj(Macro)11 b(de\014ned)e(b)o(y)i(scraps)g(5,) +g(6ab)q(c,)f(7ab,)g(8ab,)h(9ab)q(c,)f(10a.)0 1732 y(Macro)h(referenced) +d(in)k(scrap)e(2d.)0 1836 y Fq(Arra)o(y)15 b(t)o(yp)q(es)h(are)f(just)g +(lik)o(e)f(basic)h(t)o(yp)q(es,)g(but)g(there)h(is)f(no)f(m)o(utator)g +(b)q(ecause)i(the)g(arra)o(y)e(name)g(is)g Fn(const)p +Fq(.)20 b(The)15 b(name)0 1885 y(of)e(the)i(arra)o(y)e(denotes)j(a)d(p) +q(oin)o(ter)h(to)g(the)g(\014rst)h(elemen)o(t,)e(so)h(that's)g(what)g +(w)o(e)g(return.)0 1967 y Fg(h)p Ff(dump)g(structs)f(and)h(unions)h +Fj(9c)p Fg(i)9 b(\021)104 2013 y Fe(\(define)17 b(\(getset-a)o(rr)o +(ay-)o(typ)o(e)f(structure)g(funcname)h(cast)h(selector)f(field\))143 +2059 y(\(function-)o(pa)o(ir)f(array-acce)o(sso)o(r-)o(tem)o(pl)o(ate) +437 2105 y(\(vector)h(funcname)g(cast)h(selector\))437 +2150 y(\(string-ap)o(pen)o(d)e("_get_")h(funcname\))437 +2196 y(`\(\(pointer)f(,\(struct/)o(uni)o(on-)o(re)o(f)h(structure)o +(\)\))o(\))437 2242 y('\(unsigned)o(\)\))143 2287 y(\(cache-nam)o(e)f +(structure)h(\(string-)o(app)o(en)o(d)g("_get_")g(funcname\))o(\)\))104 +2379 y(\(define)g(array-acc)o(es)o(sor)o(-te)o(mp)o(lat)o(e)143 +2424 y("unsigned)f(_get_@0\()h(unsigned)f(_p)j(\))g({)g(return)f +(\(unsigned)o(\)\(\()o(\(@)o(1*\))o(_p)o(\)->)o(@2\))o(;)e(}"\))104 +2470 y Fd(3)0 2516 y Fj(Macro)11 b(de\014ned)e(b)o(y)i(scraps)g(5,)g +(6ab)q(c,)f(7ab,)g(8ab,)h(9ab)q(c,)f(10a.)0 2550 y(Macro)h(referenced)d +(in)k(scrap)e(2d.)p 0 2583 780 2 v 46 2610 a Fi(4)64 +2622 y Fj(Fields)h(whic)o(h)i(are)f Fh(const)f Fj(should)g(not)h(ha)o +(v)o(e)g(a)g(m)o(utator;)f(when)i(w)o(e)g(get)f(around)f(to)h(implemen) +o(tin)o(g)e(general)h(quali\014ers)f(on)i(t)o(yp)q(es,)g(this)0 +2661 y(m)o(ust)e(b)q(e)h(\014xed.)965 2828 y Fq(9)p eop +%%Page: 10 10 +10 9 bop 0 45 a Fq(Structured)13 b(t)o(yp)q(es)e(are)h(handled)e(b)o(y) +h(adding)f(the)h(\014eld)g(name)f(to)h(the)g(selector)h(and)f +(recurring;)h(w)o(e)f(ignore)g(the)g(distinction)0 95 +y(b)q(et)o(w)o(een)k(struct)h(and)d(union)h(here)h(as)f(it)f(do)q +(esn't)h(matter.)0 169 y Fg(h)p Ff(dump)g(structs)f(and)h(unions)h +Fj(10a)p Fg(i)9 b(\021)104 215 y Fe(\(define)17 b(\(getset-s)o(tr)o +(uct)o(ure)o(d-)o(typ)o(e)f(structure)h(funcname)f(cast)i(selector)f +(field\))143 260 y(\(let)h(\(;\(selecto)o(r)e(\(string-app)o(en)o(d)h +(selector)f(".")j(\(name)e(field\)\)\))261 306 y(;\(funcnam)o(e)f +(\(string-app)o(en)o(d)h(funcname)f("_")j(\(canonica)o(l-)o(nam)o(e)d +(\(name)i(field\)\)\)\))261 352 y(\(struct)56 b(\(if)18 +b(\(eq?)g(\(record-ta)o(g)f(\(type)g(field\)\))g('struct-re)o(f\))535 +397 y(\(lookup)g(\(tag)h(\(type)g(field\)\))f(structs\))535 +443 y(\(lookup)g(\(tag)h(\(type)g(field\)\))f(unions\)\)\))o(\))182 +489 y(\(generate-)o(acc)o(es)o(sor)o(s-a)o(nd)o(-mu)o(ta)o(tor)o(s)f +(struct)i(funcname)e(cast)i(selector\)\)\))104 534 y +Fd(3)0 581 y Fj(Macro)11 b(de\014ned)e(b)o(y)i(scraps)g(5,)g(6ab)q(c,)f +(7ab,)g(8ab,)h(9ab)q(c,)f(10a.)0 614 y(Macro)h(referenced)d(in)k(scrap) +e(2d.)0 718 y Fb(3.4.3)48 b(Structures)13 b(as)j(v)m(alues)0 +795 y Fq(As)h(men)o(tioned)f(ab)q(o)o(v)o(e,)g(there)i(are)f(no)g(pro)o +(visions)f(for)g(using)h(structures)i(or)e(unions)f(as)h(v)n(alues)f +(in)g(the)i(program,)d(not)0 845 y(ev)o(en)f(when)h(they)f(ha)o(v)o(e)f +(the)i(size)f(of)f(a)h(primitiv)o(e)d(t)o(yp)q(e.)19 +b(The)14 b(reason)g(for)f(this)h(is)g(that)f(it)h(is)f(not)h(natural)f +(for)h(Sc)o(heme)f(to)0 895 y(assign)j(ob)r(jects)h(whic)o(h)f(are)h +(larger)f(than)g(a)g(single)g(lo)q(cation)f(\(and)h(sp)q(ecial-casing)g +(small)e(structures)19 b(b)q(ecause)f(the)f(are)0 944 +y(small)10 b(seems)i(silly\).)k(F)m(or)c(example,)f(the)h(follo)o(wing) +e(function)i(tak)o(es)g(a)g(structure)i(v)n(alue)e(as)g(an)g(argumen)o +(t)e(\(b)o(y)i(cop)o(y)m(,)g(that)0 994 y(is,)h(b)o(y)h(assignmen)o +(t\):)104 1076 y Fe(void)k(f\()h(struct)e(X)i(x)g(\))h({)f(...)f(})62 +1174 y Fq(There)c(is)f(no)g(w)o(a)o(y)f(to)h(call)g(this)g(function)f +(directly)i(in)e(the)i(generated)g(FFI)f(for)g(Chez)h(Sc)o(heme.)j(W)m +(e)c(could)g(fudge)g(our)0 1224 y(w)o(a)o(y)g(around)h(it)f(b)o(y)h +(generating)g(a)g(pro)o(xy)f(function)h(whic)o(h)g(acts)g(as)g(a)g(lev) +o(el)f(of)h(indirection:)104 1304 y Fe(void)k(_proxy_f\()e(struct)h(X)j +(*x)e(\))i({)f(f\()g(*x)f(\);)h(})0 1402 y Fq(but)c(I)f(ha)o(v)o(e)h +(not)f(implemen)o(ted)e(this.)20 b(If)15 b(it)f(b)q(ecomes)g(a)h +(problem)e(it)h(needs)i(to)e(b)q(e)i(\014xed.)k(Libraries)15 +b(whic)o(h)f(manipulate)0 1452 y(complex)f(n)o(um)o(b)q(ers)g(represen) +o(ted)k(as)d(structures)i(ma)o(y)c(need)j(it.)62 1502 +y(Another)g(upshot)f(is)g(that)g(there)h(is)f(no)g(w)o(a)o(y)f(to)g +(ask)h(for)g(the)g(\014eld)g Fn(u)g Fq(of)f(the)i(structure)h +(de\014ned)f(earlier.)1732 1487 y Fm(5)0 1618 y Fl(3.5)56 +b(Global)18 b(V)-5 b(ariables)0 1694 y Fq(In)19 b(order)h(to)f +(simplify)e(things,)i(global)f(v)n(ariables)g(are)i(handled)f(b)o(y)g +(generating)g(a)g(single)g(function)g(for)g(eac)o(h)h(global)0 +1744 y(v)n(ariable;)14 b(the)h(function)g(tak)o(es)g(no)g(parameters)g +(and)g(returns)h(the)g(address)g(of)e(the)i(global.)j(T)m(ec)o +(hnically)14 b(the)i(follo)o(wing)0 1794 y(co)q(de)e(should)e(b)q(e)i +(\014nessed)h(for)d(arra)o(ys,)h(since)h(the)f(t)o(yp)q(e)h(of)e(a)h +(global)e(arra)o(y)i(is)f(not)h(a)g(p)q(oin)o(ter)g(to)g(an)f(arra)o(y) +m(,)g(but)h(an)g(arra)o(y)m(,)0 1844 y(or)h(at)g(the)g(v)o(ery)g +(least,)g(a)g(p)q(oin)o(ter)g(to)f(the)i(base)f(t)o(yp)q(e)h(of)e(the)h +(arra)o(y)m(.)0 1926 y Fg(h)p Ff(dump)g(global)h(v)n(ariable)g +(accessors)f Fj(10b)p Fg(i)9 b(\021)104 1972 y Fe(\(define)17 +b(\(dump-var)o(ia)o(ble)o(s\))143 2017 y(\(for-each)f(\(lambda)h(\(v\)) +378 2063 y(\(let)h(\(\(n)h(\(canonica)o(l-n)o(am)o(e)e(\(name)g +(v\)\)\)\))418 2109 y(\(function)o(-p)o(air)f(global-te)o(mpl)o(at)o(e) +712 2154 y(\(vector)h(n)i(\(name)f(v\)\))712 2200 y(\(string-a)o(ppe)o +(nd)e("_glob_")h(n\))712 2246 y('\(\(void)g(\(\)\)\))712 +2291 y(`\(pointer)f(,\(type)h(v\)\)\)\)\))339 2337 y(vars\)\))104 +2428 y(\(define)g(global-te)o(mp)o(lat)o(e)143 2474 y("unsigned)f +(_glob_@0\()g(void)i(\))i({)f(return)e(\(unsigned\))o(&@)o(1;)f(}"\)) +104 2520 y Fd(3)0 2566 y Fj(Macro)11 b(referenced)d(in)k(scrap)e(2d.)p +0 2599 780 2 v 46 2626 a Fi(5)64 2638 y Fj(There)g(is)i(no)f(w)o(a)o(y) +h(to)f(ask)g(for)g(its)g(address,)e(either,)h(but)h(that's)f(easy)h(to) +g(implemen)o(t.)954 2828 y Fq(10)p eop +%%Page: 11 11 +11 10 bop 0 45 a Fl(3.6)56 b(F)-5 b(unctions)0 122 y +Fq(Supp)q(orting)21 b(functions)f(in)h(all)e(their)i(generalit)o(y)f +(is)h(prett)o(y)g(m)o(uc)o(h)f(imp)q(ossible,)g(and)h(I'm)e(not)h +(going)g(to)g(try)m(.)39 b(The)0 172 y(restrictions)15 +b(are:)0 263 y Fb(V)l(ariadic)f(functions)k Fq(are)13 +b(not)g(supp)q(orted.)19 b(Suc)o(h)13 b(supp)q(ort)h(can)e(b)q(e)i +(implemen)o(ted)c(but)j(the)h(resulting)e(co)q(de)i(is)f(target-)104 +313 y(sp)q(eci\014c)k(and)f(probably)g(in)o(v)o(olv)o(es)f(some)g +(assem)o(bly)g(language.)24 b(Some)15 b(C)h(compilers)f(\(lik)o(e)g(W)m +(atcom)f(C\))i(pro)o(vide)104 362 y(library)d(functions)h(whic)o(h)g +(mak)o(es)e(the)j(job)e(m)o(uc)o(h)g(easier,)h(but)g(most)f(don't.)0 +446 y Fb(Old-st)o(yle)g(protot)o(yp)q(es)18 b Fq(\(that)d(is,)f +(declarations)h(of)f(the)h(form)e Fn(char)21 b(*malloc\(\))13 +b Fq(where)i(the)h(n)o(um)o(b)q(er)e(and)g(t)o(yp)q(es)i(of)104 +495 y(the)f(argumen)o(ts)f(are)h(not)f(kno)o(wn\))g(are)h(hard,)f +(since)i(the)f(nativ)o(e)f(Chez)h(FFI)g(requires)h(an)e(exact)h +(argumen)o(t)f(coun)o(t)104 545 y(and)19 b(the)h(t)o(yp)q(e)g(for)f +(eac)o(h)h(argumen)o(t.)33 b(My)19 b(solution)g(is)g(to)g(generate)h(a) +g(w)o(arning)e(for)h(this)g(and)h(translate)f(the)104 +595 y(in)o(terface)14 b(as)g(if)f(it)h(had)f(no)h(argumen)o(ts,)f(whic) +o(h)h(is)f(almost)f(alw)o(a)o(ys)h(wrong.)0 678 y Fb(P)o(arameters)h +(of)h(function)e(t)o(yp)q(e)20 b Fq(w)o(ork)14 b(\014ne,)g(but)g(y)o +(ou)f(can't)h(pass)g(Sc)o(heme)g(pro)q(cedures)i(to)e(a)g(C)f +(function.)0 761 y Fb(Calling)h(through)f(function)g(p)q(oin)o(ters)18 +b Fq(is)13 b(not)f(implemen)o(ted,)e(since)k(it's)e(hard)h(to)f +(express)j(this)d(in)h(the)g(nativ)o(e)f(FFI,)104 811 +y(whic)o(h)h(requires)i(the)f(name)f(of)g(the)h(function)f(in)g(order)i +(to)e(fetc)o(h)h(it)f(from)f(a)h(library)m(.)k(W)m(e)c(can)h(get)g +(around)g(this)f(b)o(y)104 861 y(generating)i(a)g(pro)o(xy)g(function)g +(for)f(eac)o(h)i(function)f(p)q(oin)o(ter)g(t)o(yp)q(e)h(in)f(the)g +(header)i(\014le)e(and)g(calling)e(the)j(function)104 +910 y(through)e(it)f(b)o(y)h(passing)g(it)f(the)i(function)e(p)q(oin)o +(ter)h(and)g(the)h(argumen)o(ts,)d(essen)o(tially)i(a)g(tramp)q(oline.) +0 1002 y Fn(Dump-functions)d Fq(creates)16 b(a)d(Sc)o(heme-side)h(in)o +(terface)h(for)e(eac)o(h)i(referenced)h(function.)0 1085 +y Fg(h)p Ff(dump)e(function)g(de\014nitions)i Fj(11)p +Fg(i)10 b(\021)104 1131 y Fe(\(define)17 b(\(dump-fun)o(ct)o(ion)o(s\)) +143 1177 y(\(for-each)f(\(lambda)h(\(f\))i(\(define-)o(for)o(ei)o(gn)d +(\(name)i(f\))h(\(type)f(f\)\)\))339 1222 y(functions\))o(\))104 +1268 y Fd(3)0 1314 y Fj(Macro)11 b(de\014ned)e(b)o(y)i(scraps)g(11,)f +(12ab.)0 1348 y(Macro)h(referenced)d(in)k(scrap)e(2d.)0 +1452 y Fn(Define-foreign)f Fq(c)o(hec)o(ks)k(that)e(ev)o(ery)i(argumen) +o(t)d(t)o(yp)q(e)j(and)e(return)i(t)o(yp)q(e)f(is)g(v)n(alid)e(and)h +(attempts)h(to)f(giv)o(e)g(a)h(reasonable)0 1502 y(error)j(message)e +(if)g(not;)h(if)f(ev)o(erything)h(is)g(OK)g(then)h(a)e(Sc)o(heme)h +(de\014nition)g(for)f(the)i(foreign)e(function)h(is)f(emitted.:)0 +1589 y Fg(h)p Ff(dump)h(function)g(de\014nitions)i Fj(12a)p +Fg(i)9 b(\021)104 1635 y Fe(\(define)17 b(\(define-f)o(or)o(eig)o(n)g +(name)h(type\))143 1681 y(\(let)g(\(\(argtypes)e(\(arglist)g(type\)\)) +261 1726 y(\(returnty)o(pe)g(\(rett)i(type\)\)\))182 +1772 y(\(let)g(loop)g(\(\(l)h(argtypes\))o(\))221 1818 +y(\(cond)f(\(\(null?)f(l\))i(#t\))339 1863 y(\(\(structur)o(ed-)o(ty)o +(pe?)d(\(car)i(l\)\))359 1909 y(\(warn)f("Cannot)g(pass)h(structured)e +(value)i(of)h(type")476 1954 y(\(rational-t)o(yp)o(ena)o(me)d(\(car)i +(l\)\))476 2000 y("to)h(function")476 2046 y(name\))359 +2091 y(\(set-car!)d(l)j('\(***inval)o(id)o(***)o(\)\))359 +2137 y(\(loop)e(\(cdr)i(l\)\)\))339 2183 y(\(else)359 +2228 y(\(loop)e(\(cdr)i(l\)\)\)\)\))182 2274 y(\(if)g(\(structur)o(ed)o +(-ty)o(pe?)d(returntyp)o(e\))261 2320 y(\(begin)h(\(warn)h("Cannot)f +(receive)f(structured)g(value)i(of)h(type")516 2365 y(\(rational)o(-t)o +(ype)o(na)o(me)d(returntype)o(\))516 2411 y("from)h(function")516 +2457 y(name\))398 2502 y(\(set!)h(returntyp)o(e)e('\(***invali)o(d*)o +(**\))o(\)\))o(\))182 2594 y(\(write)202 2639 y(`\(define)g +(,\(string->s)o(ym)o(bol)g(\(canonica)o(l-n)o(am)o(e)h(name\)\))261 +2685 y(\(foreign-)o(fu)o(nct)o(ion)f(,name)954 2828 y +Fq(11)p eop +%%Page: 12 12 +12 11 bop 614 45 a Fe(,\(chez-ma)o(p-)o(arg)o(s)17 b(argtypes)f(name\)) +614 91 y(,\(chez-ty)o(pe)g(returntype)o(\)\))o(\))202 +136 y(sch-outpu)o(t\))182 182 y(\(newline)h(sch-outpu)o(t\)\))o(\))104 +228 y Fd(3)0 269 y Fj(Macro)11 b(de\014ned)e(b)o(y)i(scraps)g(11,)f +(12ab.)0 303 y(Macro)h(referenced)d(in)k(scrap)e(2d.)0 +387 y Fq(The)15 b(argumen)o(t)f(list)g(m)o(ust)f(b)q(e)j(handled)e +(carefully)g(to)h(deal)f(with)h(functions)f(without)h(protot)o(yp)q(es) +g(and)g(functions)f(with)0 437 y(v)n(ariable-length)f(parameter)g +(lists:)0 512 y Fg(h)p Ff(dump)h(function)g(de\014nitions)i +Fj(12b)p Fg(i)9 b(\021)104 558 y Fe(\(define)17 b(\(chez-map)o(-a)o +(rgs)f(args)i(name\))143 604 y(\(cond)g(\(\(and)f(\(=)i(\(length)e +(args\))h(1\))378 650 y(\(eq?)g(\(caar)g(args\))g('void\)\))280 +695 y('\(\)\))261 741 y(\(\(=)g(\(length)f(args\))h(0\))280 +787 y(\(warn)g("Function)e(without)h(prototype)f(assumed)h(to)i(take)f +(no)h(arguments)o(:")398 832 y(name\))280 878 y('\(\)\))261 +924 y(\(else)280 969 y(\(map)f(\(lambda)f(\(x\))418 1015 +y(\(if)h(\(eq?)g(\(record-ta)o(g)e(x\))j('void\))496 +1061 y(\(begin)e(\(warn)h("Varargs)f(*cannot*)f(be)j(handled)e(for")h +(name\))633 1106 y('***invali)o(d**)o(*\))496 1152 y(\(chez-type)e +(x\)\)\))378 1198 y(args\)\)\)\))104 1243 y Fd(3)0 1290 +y Fj(Macro)11 b(de\014ned)e(b)o(y)i(scraps)g(11,)f(12ab.)0 +1323 y(Macro)h(referenced)d(in)k(scrap)e(2d.)0 1433 y +Fl(3.7)56 b(En)n(ums)0 1509 y Fq(En)o(ums)13 b(are)h(straigh)o(tforw)o +(ard.)k(There)d(is)f(a)f(de\014nition)h(for)f(eac)o(h)i(en)o(um-iden)o +(t:)104 1582 y Fe(enum)j({)h(A=100,)e(B,)i(C)g(};)0 1680 +y Fq(b)q(ecomes)104 1745 y Fe(\(define)e(a)i(100\))104 +1791 y(\(define)e(b)i(101\))104 1837 y(\(define)e(c)i(102\))0 +1935 y Fq(The)14 b(en)o(um's)f(tag,)g(should)h(it)f(ha)o(v)o(e)h(one,)g +(is)f(ignored.)18 b(The)d(co)q(de)f(is)g(straigh)o(tforw)o(ard:)0 +2010 y Fg(h)p Ff(dump)g(en)o(um)f(de\014nitions)j Fj(13a)p +Fg(i)10 b(\021)104 2056 y Fe(\(define)17 b(\(dump-enu)o(ms)o(\))143 +2102 y(\(for-each)f(\(lambda)h(\(x\))378 2148 y(\(display)g(\(instanti) +o(ate)f("\(define)g(@0)j(@1\)")810 2193 y(\(vector)e(\(canonica)o(l-n)o +(am)o(e)g(\(name)g(x\)\))967 2239 y(\(number->)o(str)o(in)o(g)g +(\(value)g(x\)\)\)\))555 2285 y(sch-outpu)o(t\))378 2330 +y(\(newline)g(sch-outpu)o(t\)\))339 2376 y(enum-ident)o(s\)\))104 +2422 y Fd(3)0 2468 y Fj(Macro)11 b(referenced)d(in)k(scrap)e(2d.)0 +2577 y Fl(3.8)56 b(Macros)0 2654 y Fq(Macros)17 b(are)g(hard)g(in)f +(the)i(general)f(case,)g(b)q(ecause)i(the)e(general)g(case)h(is)e(that) +h(the)g(righ)o(t-hand-side)f(names)g(some)g(ar-)0 2704 +y(bitrarily)e(complex)g(C)h(statemen)o(t)g(whic)o(h)g(migh)o(t)d(ev)o +(en)k(dep)q(end)g(on)f(v)n(ariables)g(in)f(some)g(scop)q(e)j(not)e(in)f +(e\013ect)j(when)e(the)954 2828 y(12)p eop +%%Page: 13 13 +13 12 bop 0 45 a Fq(macro)16 b(is)h(de\014ned.)30 b(Handling)16 +b(C)i(macros)e(in)h(their)h(full)e(generalit)o(y)h(is)g(therefore)i +(not)e(an)g(attainable)g(goal)f(for)h(most)0 95 y(targets.)i(Ho)o(w)o +(ev)o(er,)14 b(w)o(e)g(can)g(still)f(do)h(useful)g(things.)62 +145 y(If)f(the)h(left-hand-side)f(is)h(a)f(simple)f(iden)o(ti\014er)h +(\(no)h(parameters\))f(and)g(the)h(righ)o(t-hand-side)f(parses)i(as)e +(a)g(n)o(um)o(b)q(er)g(or)0 195 y(a)h(string,)f(then)i(w)o(e)f(can)g +(emit)e(a)i(simple)e(de\014nition)i(whic)o(h)g(giv)o(es)f(the)i(name)e +(the)h(v)n(alue.)62 244 y(Being)d(more)f(am)o(bitious)e(w)o(e)j(can)g +(tak)o(e)f(eac)o(h)h(macro)f(whic)o(h)g(has)h(parameters)g(and)f(whose) +h(righ)o(t-hand-side)g(is)f(a)g(closed)0 294 y(expression{that)16 +b(is,)e(the)h(macro)e(whic)o(h)i(results)h(from)d(expanding)h(all)f +(applicable)h(macros)g(on)g(the)h(righ)o(t-hand-side)g(of)0 +344 y(the)f(macro)f(has)h(no)g(free)h(v)n(ariables{and)d(con)o(v)o(ert) +j(it)e(to)h(a)g(function.)62 394 y(F)m(or)g(no)o(w,)f(w)o(e)h(handle)g +(the)g(simple)f(case)h(of)g(an)f(in)o(teger)i(righ)o(t-hand-side)e +(only)m(.)0 476 y Fg(h)p Ff(dump)h(macro)f(de\014nitions)j +Fj(13b)p Fg(i)9 b(\021)104 522 y Fe(\(define)17 b(\(dump-mac)o(ro)o +(s\))182 567 y(\(for-each)f(\(lambda)h(\(m\))418 613 +y(\(if)h(\(and)g(\(valid-ide)o(nt)o(?)f(\(name)g(m\)\))594 +659 y(\(valid-num)o(be)o(r?)f(\(value)i(m\)\)\))496 704 +y(\(begin)535 750 y(\(display)f(`\(define)f(,\(canonica)o(l-n)o(ame)g +(\(name)h(m\)\))771 796 y(,\(evaluat)o(e-)o(num)o(be)o(r)g(\(value)g +(m\)\)\))712 841 y(sch-outpu)o(t\))535 887 y(\(newline)g(sch-outpu)o +(t\)\))o(\)\))378 933 y(macros\)\))104 978 y Fd(3)0 1025 +y Fj(Macro)11 b(de\014ned)e(b)o(y)i(scraps)g(13b,)f(14a.)0 +1058 y(Macro)h(referenced)d(in)k(scrap)e(2d.)0 1162 y +Fn(Valid-ident)f Fq(and)i Fn(valid-number)e Fq(c)o(hec)o(k)k(that)e +(their)h(argumen)o(ts)f(are)h(v)n(alid)e(C)h(iden)o(ti\014er)h(and)f(n) +o(um)o(b)q(ers,)g(resp)q(ectiv)o(ely)m(.)0 1244 y Fg(h)p +Ff(dump)j(macro)f(de\014nitions)j Fj(14a)p Fg(i)9 b(\021)104 +1290 y Fe(\(define)17 b(\(valid-id)o(en)o(t?)f(s\))182 +1336 y(\(andmap)h(\(lambda)g(\(c\))378 1381 y(\(or)i(\(char-upp)o(er-)o +(ca)o(se?)d(c\))457 1427 y(\(char-low)o(er-)o(ca)o(se?)g(c\))457 +1473 y(\(char-num)o(eri)o(c?)g(c\))457 1518 y(\(char=?)h(c)i +(#\\_\)\)\))339 1564 y(\(string->l)o(ist)d(s\)\)\))104 +1655 y(\(define)h(\(valid-nu)o(mb)o(er?)f(s\))143 1701 +y(\(let)i(\(\(n)h(\(evaluat)o(e-n)o(umb)o(er)d(s\)\)\))182 +1747 y(n\)\))104 1792 y Fd(3)0 1839 y Fj(Macro)11 b(de\014ned)e(b)o(y)i +(scraps)g(13b,)f(14a.)0 1873 y(Macro)h(referenced)d(in)k(scrap)e(2d.)0 +1989 y Fr(4)69 b(Utilit)n(y)20 b(functions)0 2080 y Fq(The)14 +b(pro)q(cedure)i Fn(function-pair)11 b Fq(generates)16 +b(corresp)q(onding)f(de\014nitions)e(in)h(b)q(oth)g(languages.)0 +2163 y Fg(h)p Ff(utilit)o(y)h(functions)g Fj(14b)p Fg(i)9 +b(\021)104 2209 y Fe(\(define)17 b(\(function)o(-p)o(air)f(c-templat)o +(e)h(template-)o(ar)o(gs)f(scheme-nam)o(e)h(arglist)g(rett\))143 +2255 y(\(display)g(\(instant)o(iat)o(e)g(c-templa)o(te)f(template-a)o +(rgs)o(\))g(c-output\))143 2300 y(\(newline)h(c-output)o(\))143 +2346 y(\(define-fo)o(re)o(ign)f(scheme-na)o(me)182 2392 +y(`\(function)g(,arglist)h(,rett\)\)\))104 2437 y Fd(3)0 +2484 y Fj(Macro)11 b(de\014ned)e(b)o(y)i(scraps)g(14b)q(c,)f(15ab,)g +(16ab.)0 2517 y(Macro)h(referenced)d(in)k(scrap)e(2d.)0 +2621 y Fq(The)k(C)g(t)o(yp)q(e)h(name)d(generated)j(for)f(a)g(giv)o(en) +f(basic)h(t)o(yp)q(e)g(is)g(v)o(ery)g(m)o(uc)o(h)f(a)h(p)q(olicy)f +(issue;)h(here)h(are)f(our)g(enco)q(dings:)954 2828 y(13)p +eop +%%Page: 14 14 +14 13 bop 0 32 a Fg(h)p Ff(utilit)o(y)15 b(functions)g +Fj(14c)p Fg(i)9 b(\021)104 78 y Fe(\(define)17 b(\(basic-ty)o(pe)o(-na) +o(me)f(type\))143 123 y(\(let)i(\(\(probe)f(\(assq)h(\(record-t)o(ag)e +(type\))516 169 y('\(\(char)h(.)i("char"\))555 215 y(\(signed-c)o(har)d +(.)j("signed)e(char"\))555 260 y(\(unsigned)o(-ch)o(ar)f(.)j("unsigned) +d(char"\))555 306 y(\(short)h(.)i("short"\))555 352 y(\(unsigned)o(-sh) +o(or)o(t)e("unsigned)f(short"\))555 397 y(\(int)i(.)h("int"\))555 +443 y(\(enum)f(.)h("int"\))555 489 y(\(unsigned)d(.)j("unsigned")o(\)) +555 534 y(\(long)f(.)h("long"\))555 580 y(\(unsigned)o(-lo)o(ng)d(.)j +("unsigned)d(long"\))555 626 y(\(void)i(.)h("void"\))555 +671 y(\(pointer)d(.)k("unsigned)o("\))555 717 y(\(float)d(.)i +("float"\))555 763 y(\(double)e(.)i("double"\))555 808 +y(\)\)\)\))182 854 y(\(if)g(probe)261 900 y(\(cdr)f(probe\))261 +945 y(\(begin)f(\(warn)h("Unknown)e(type)i(")h(type\))398 +991 y("***invali)o(d*)o(**")o(\)\))o(\)\))104 1037 y +Fd(3)0 1083 y Fj(Macro)11 b(de\014ned)e(b)o(y)i(scraps)g(14b)q(c,)f +(15ab,)g(16ab.)0 1117 y(Macro)h(referenced)d(in)k(scrap)e(2d.)0 +1221 y Fq(The)k(pro)q(cedure)i Fn(c-cast-expression)11 +b Fq(tak)o(es)j(a)g(t)o(yp)q(e)h(and)f(returns)h(a)f(C-syn)o(tax)g +(expression)h(whic)o(h)f(can)g(b)q(e)h(used)g(in)e(a)0 +1270 y(t)o(yp)q(e)i(cast)g(for)f(casting)h(a)f(v)n(alue)g(to)h(the)g +(giv)o(en)f(t)o(yp)q(e.)20 b(It's)15 b(a)f(hard)h(problem)e(and)h(the)i +(co)q(de)f(b)q(elo)o(w)f(do)q(es)i(not)e(do)g(a)h(v)o(ery)0 +1320 y(go)q(o)q(d)e(job;)g(it)h(needs)h(to)f(b)q(e)g(re\014ned)i +(considerably)m(.)h(See)e(e.g.)e(K&R)h(2nd)g(edition)f(section)i(5.12.) +62 1370 y(One)d(issue)h(is)e(what)g(happ)q(ens)h(when)g(w)o(e)g(ha)o(v) +o(e)f(a)g(structured)j(t)o(yp)q(e)e(whic)o(h)f(do)q(es)h(not)f(ha)o(v)o +(e)g(a)h(user-de\014ned)h(tag.)k(There)0 1420 y(will)12 +b(b)q(e)j(exactly)f(one)g Fn(typedef)e Fq(whic)o(h)i(refers)h(to)f(the) +h(structure,)g(and)f(that)g(name)f(should)g(b)q(e)i(used)g(instead.)0 +1503 y Fg(h)p Ff(utilit)o(y)g(functions)g Fj(15a)p Fg(i)9 +b(\021)104 1549 y Fe(\(define)17 b(\(c-cast-e)o(xp)o(res)o(sio)o(n)f +(type\))143 1595 y(\(cond)i(\(\(primiti)o(ve)o(-ty)o(pe?)e(type\))280 +1640 y(\(basic-typ)o(e-n)o(ame)g(type\)\))261 1686 y(\(\(pointer)o(-t)o +(ype)o(?)h(type\))280 1732 y(\(string-ap)o(pen)o(d)g(\(c-cast-)o(exp)o +(re)o(ssi)o(on)f(\(cadr)i(type\)\))f("*"\)\))261 1777 +y(\(\(eq?)g(\(record-tag)f(type\))h('enum-ref\))280 1823 +y(\(basic-typ)o(e-n)o(ame)f('\(int)h(\(\)\)\)\))261 1869 +y(\(\(memq)g(\(record-ta)o(g)f(type\))i('\(struct-r)o(ef)e(union-ref\)) +o(\))280 1914 y(\(let)i(\(\(t)h(\(tag)f(type\)\)\))320 +1960 y(\(if)g(\(user-defi)o(ne)o(d-t)o(ag)o(?)f(t\))398 +2006 y(\(string-ap)o(pe)o(nd)f(\(if)j(\(eq?)f(\(record-t)o(ag)e(type\)) +i('struct-r)o(ef\))771 2051 y("struct)f(")771 2097 y("union)g("\))692 +2143 y(t\))398 2188 y(\(let)h(\(\(names)f(\(if)h(\(eq?)g(\(record-tag)e +(type\))i('struct-)o(ref)o(\))731 2234 y(\(struct-nam)o(es)e(type\))731 +2279 y(\(union-name)o(s)g(type\)\)\)\))437 2325 y(\(if)j(\(=)g +(\(length)d(names\))i(1\))516 2371 y(\(car)g(names\))516 +2416 y(\(error)f("c-cast-e)o(xpr)o(ess)o(io)o(n:)f(bad:)i(")i +(type\)\)\)\))o(\)\))261 2462 y(\(else)280 2508 y(\(warn)e("c-cast-ex)o +(pr)o(ess)o(io)o(n:)e(Too)j(complicat)o(ed)o(:)e(")i(type\))280 +2553 y("unknown"\))o(\)\))104 2599 y Fd(3)0 2646 y Fj(Macro)11 +b(de\014ned)e(b)o(y)i(scraps)g(14b)q(c,)f(15ab,)g(16ab.)0 +2679 y(Macro)h(referenced)d(in)k(scrap)e(2d.)954 2828 +y Fq(14)p eop +%%Page: 15 15 +15 14 bop 0 45 a Fn(String-prefix=?)11 b Fq(tak)o(es)j(a)g(string)g +(and)f(a)h(pre\014x)g(and)g(tests)i(whether)f(the)f(pre\014x)h(matc)o +(hes)e(the)i(string.)0 128 y Fg(h)p Ff(utilit)o(y)g(functions)g +Fj(15b)p Fg(i)9 b(\021)104 174 y Fe(\(define)17 b(\(string-p)o(re)o +(fix)o(=?)f(s)j(prefix\))143 220 y(\(let)f(\(\(limit)f(\(string-le)o +(ng)o(th)f(prefix\)\)\))182 266 y(\(and)i(\(<=)h(limit)e(\(string-len)o +(gt)o(h)g(s\)\))280 311 y(\(let)h(loop)g(\(\(i)h(0\)\))320 +357 y(\(or)f(\(=)h(i)g(limit\))398 402 y(\(and)f(\(char=?)f(\(string-r) +o(ef)f(s)k(i\))e(\(string-ref)e(prefix)h(i\)\))496 448 +y(\(loop)h(\(+)h(i)g(1\)\)\)\)\)\)\)\))104 494 y Fd(3)0 +540 y Fj(Macro)11 b(de\014ned)e(b)o(y)i(scraps)g(14b)q(c,)f(15ab,)g +(16ab.)0 574 y(Macro)h(referenced)d(in)k(scrap)e(2d.)0 +678 y Fn(Rational-typename)g Fq(tak)o(es)15 b(a)e(t)o(yp)q(e;)h(if)g +(the)g(t)o(yp)q(e)h(is)e(a)h Fn(struct-ref)e Fq(or)i +Fn(union-ref)e Fq(and)i(the)g(tag)g(is)g(auto-generated,)0 +727 y(then)h(a)f(t)o(yp)q(e)h(is)g(returned)h(where)f(the)h(tag)e(is)g +(replaced)h(b)o(y)g(the)g(unique)f Fn(typedef)p Fq(-name)e(whic)o(h)i +(uses)i(the)f(structure)i(\(if)0 777 y(one)d(can)g(b)q(e)h(found\).)i +(This)d(pro)q(cedure)i(is)e(useful)g(for)f(giving)g(meaningful)e(error) +k(messages.)0 861 y Fg(h)p Ff(utilit)o(y)g(functions)g +Fj(16a)p Fg(i)9 b(\021)104 908 y Fe(\(define)17 b(\(rational)o(-t)o +(ype)o(nam)o(e)f(type\))143 953 y(\(case)i(\(record-t)o(ag)e(type\))182 +999 y(\(\(struct-r)o(ef\))202 1045 y(\(if)i(\(user-defi)o(ned)o(-ta)o +(g?)e(\(tag)i(type\)\))280 1090 y(type)280 1136 y(\(let)g(\(\(t)h +(\(lookup)e(\(tag)h(type\))f(structs\)\)\))320 1182 y(\(if)h(\(not)g +(t\))398 1227 y(type)398 1273 y(\(list)g('struct-r)o(ef)e(\(tag)i +(t\)\)\)\)\)\))182 1319 y(\(\(union-re)o(f\))202 1364 +y(\(if)g(\(user-defi)o(ned)o(-ta)o(g?)e(\(tag)i(type\)\))280 +1410 y(type)280 1455 y(\(let)g(\(\(t)h(\(lookup)e(\(tag)h(type\))f +(unions\)\)\))320 1501 y(\(if)h(\(not)g(t\))398 1547 +y(type)398 1592 y(\(list)g('union-re)o(f)e(\(tag)i(t\)\)\)\)\)\))182 +1638 y(\(else)g(type\)\)\))104 1684 y Fd(3)0 1730 y Fj(Macro)11 +b(de\014ned)e(b)o(y)i(scraps)g(14b)q(c,)f(15ab,)g(16ab.)0 +1764 y(Macro)h(referenced)d(in)k(scrap)e(2d.)0 1868 y +Fn(Evaluate-number)j Fq(tak)o(es)j(a)f(string)h(and)g(attempts)g(to)f +(parse)i(it)e(as)h(a)g(C)g(n)o(um)o(b)q(er,)f(returning)h(the)g(v)n +(alue)g(if)f(the)h(parse)0 1917 y(w)o(as)e(successful)h(and)f +Fn(#f)g Fq(if)f(not.)18 b(Curren)o(tly)c(only)f(in)o(tegers)i(are)f +(handled)g(reliably)m(.)0 1999 y Fg(h)p Ff(utilit)o(y)h(functions)g +Fj(16b)p Fg(i)9 b(\021)104 2045 y Fe(\(define)17 b(\(evaluate)o(-n)o +(umb)o(er)f(s\))143 2091 y(\(let)i(\(\(k)h(\(string-)o(>li)o(st)d +(s\)\)\))182 2137 y(\(cond)i(\(\(null?)f(k\))i(#f\))300 +2182 y(\(\(not)f(\(char-num)o(er)o(ic?)e(\(car)i(k\)\)\))g(#f\))300 +2228 y(\(\(char=?)e(\(car)j(k\))f(#\\0\))320 2274 y(\(cond)f(\(\(null?) +g(\(cdr)h(k\)\))h(0\))437 2319 y(\(\(or)f(\(char=?)f(\(cadr)h(k\))h +(#\\x\))f(\(char=?)f(\(cadr)g(k\))i(#\\X\)\))457 2365 +y(\(string->)o(num)o(be)o(r)e(\(list->st)o(ri)o(ng)f(\(cddr)i(k\)\))g +(16\)\))437 2411 y(\(else)457 2456 y(\(string->)o(num)o(be)o(r)f(s)i +(8\)\)\)\))300 2502 y(\(else)320 2548 y(\(string-)o(>nu)o(mbe)o(r)d +(s\)\)\)\)\))104 2593 y Fd(3)0 2640 y Fj(Macro)11 b(de\014ned)e(b)o(y)i +(scraps)g(14b)q(c,)f(15ab,)g(16ab.)0 2673 y(Macro)h(referenced)d(in)k +(scrap)e(2d.)954 2828 y Fq(15)p eop +%%Page: 16 16 +16 15 bop 0 45 a Fr(5)69 b(Discussion)0 136 y Fq(Clearly)18 +b(using)g(a)g(function)g(call)f(to)h(access)i(eac)o(h)f(\014eld)f(is)h +(not)f(v)o(ery)g(e\016cien)o(t,)i(compared)d(to)i(C.)e(But)i(if)f(the)h +(foreign)0 186 y(function)c(in)o(terface)i(is)e(reasonably)h(e\016cien) +o(t)g(it)f(shouldn't)g(b)q(e)i(to)q(o)e(bad.)23 b(It's)16 +b(hard)g(to)f(kno)o(w)g(ho)o(w)h(e\016cien)o(t)g(it)f(will)f(b)q(e)0 +236 y(in)f(Chez)i(Sc)o(heme)e(without)h(some)e(b)q(enc)o(hmarking,)g +(but)i(a)g(call-out)e(to)i(a)f(foreign)g(function)h(do)q(es)g(not)g +(need)g(to)g(b)q(e)g(m)o(uc)o(h)0 285 y(more)f(exp)q(ensiv)o(e)i(than)f +(a)f(call)g(to)h(a)g(pro)q(cedure)i(in)d(the)i(same)e(language.)0 +422 y Fr(6)69 b(F)-6 b(uture)23 b(W)-6 b(ork)25 b(on)e(the)g(Chez)e +(Bac)n(k-end)62 513 y Fa(\017)g Fq(Handling)13 b(name)f(clashes,)j(b)q +(oth)f(\014nding)f(them)g(and)h(w)o(orking)f(around)g(them)h(\(if)f +(necessary\).)62 596 y Fa(\017)21 b Fq(Dealing)12 b(with)i +(quali\014ers)g(on)f(t)o(yp)q(es)i(in)f(general;)f(handling)g +Fn(const)g Fq(in)g(particular.)62 678 y Fa(\017)21 b +Fq(Better)15 b(generation)g(of)e(C)h Fn(typedef)e Fq(casts.)62 +760 y Fa(\017)21 b Fq(Prop)q(er)15 b(c)o(hoice)f(of)f(names)h(for)f +(the)i(output)f(\014les.)62 842 y Fa(\017)21 b Fq(Exp)q(erimen)o(t)16 +b(with)h(p)q(olicy)g(c)o(hoices)g(de\014ned)i(in)d(a)h(\014le:)24 +b(for)17 b(example,)f(a)h(\014le)g(could)f(con)o(tain)h(a)g(sp)q +(eci\014cation)h(of)104 892 y(whic)o(h)13 b(protot)o(yp)q(es)i(to)e(o)o +(v)o(erride)h(\(lik)o(e)f(in)g(the)i Fn(fgets)d Fq(example\),)g(whic)o +(h)i(\014le)g(names)e(to)i(include)g(or)f(exclude,)h(ho)o(w)104 +942 y(to)d(name)f(pro)q(cedures)k(on)d(the)h(Sc)o(heme)f(side,)h(and)f +(ho)o(w)g(to)g(compute)g(the)h(referenced)i(or)d(unreferenced)j(sets.)k +(Since)104 992 y(w)o(e)d(are)h(programming)c(in)j(Sc)o(heme)g(here,)h +(these)h(decisions)f(could)f(b)q(e)h(implemen)o(ted)d(as)i(co)q(de)i +(in)e(a)g(\014le)g(whic)o(h)g(is)104 1042 y(loaded)h(at)g(run-time.)24 +b(As)16 b(an)g(example)f(of)h(what)g(has)h(b)q(een)g(though)o(t)f(of)g +(but)g(not)g(implemen)o(ted,)e(read)j(the)g(\014le)104 +1091 y Fn(chez-policy.sch)11 b Fq(in)i(the)h(curren)o(t)i +(distribution.)0 1228 y Fr(7)69 b(Supp)r(ort)24 b(libraries)0 +1319 y Fq(The)14 b(\014le)g Fn(chez-stdlib.h)d Fq(de\014nes)16 +b(the)e(protot)o(yp)q(es)h(for)e(the)i(C-side)f(standard)g(library)f +(pro)q(cedures.)0 1404 y Fe("chez-stdl)o(ib)o(.h")c Fj(17a)i +Fg(\021)104 1450 y Fe(int)18 b(_ref_int\()e(unsigned)h(_p,)h(int)h(_k)g +(\);)104 1495 y(void)f(_set_int\()e(unsigned)h(_p,)h(int)g(_k,)h(int)f +(_v)h(\);)104 1541 y(unsigned)d(_ref_uint\()g(unsigned)h(_p,)h(int)g +(_k)h(\);)104 1587 y(void)f(_set_uint)o(\()f(unsigned)f(_p,)j(int)f +(_k,)g(unsigned)f(_v)i(\);)104 1632 y(char)f(_ref_char)o(\()f(unsigned) +f(_p,)j(int)f(_k)h(\);)104 1678 y(void)f(_set_char)o(\()f(unsigned)f +(_p,)j(int)f(_k,)g(char)h(_v)f(\);)104 1724 y(double)f(_ref_doubl)o +(e\()f(unsigned)h(_p,)h(int)g(_k)h(\);)104 1769 y(void)f(_set_doub)o +(le\()e(unsigned)g(_p,)j(int)f(_k,)h(double)e(_v)i(\);)104 +1815 y(float)e(_ref_float\()f(unsigned)g(_p,)j(int)f(_k)h(\);)104 +1861 y(void)f(_set_floa)o(t\()e(unsigned)h(_p,)h(int)h(_k,)f(float)g +(_v)h(\);)104 1906 y Fd(3)0 1979 y Fq(The)14 b(implemen)o(tation)d(of)i +(the)h(library)g(is)f(in)h Fn(chez-stdlib.c)p Fq(;)c(it's)k(prett)o(y)g +(ob)o(vious.)0 2065 y Fe("chez-stdl)o(ib)o(.c")9 b Fj(17b)i +Fg(\021)104 2110 y Fe(#include)16 b("chez-stdl)o(ib.)o(h")104 +2201 y(int)i(_ref_int\()e(unsigned)h(_p,)h(int)h(_k)g(\))g({)g(return)e +(\(\(int*\)_p\)[)o(_k)o(];)f(})104 2247 y(void)i(_set_int\()e(unsigned) +h(_p,)h(int)g(_k,)h(int)f(_v)h(\))g({)h(\(\(int*\)_p)o(\)[)o(_k])c(=)j +(_v;)g(})104 2338 y(unsigned)d(_ref_uint\()g(unsigned)h(_p,)h(int)g(_k) +h(\))h({)f(return)e(\(\(unsigned)o(*\))o(_p\))o([_k)o(];)f(})104 +2384 y(void)i(_set_uint)o(\()f(unsigned)f(_p,)j(int)f(_k,)g(unsigned)f +(_v)i(\))g({)g(\(\(unsigned)o(*\)_)o(p\)[)o(_k)o(])e(=)i(_v;)f(})104 +2475 y(char)g(_ref_char)o(\()f(unsigned)f(_p,)j(int)f(_k)h(\))g({)g +(return)f(\(\(char*\)_)o(p\))o(p[_)o(k])o(;)f(})104 2521 +y(void)h(_set_char)o(\()f(unsigned)f(_p,)j(int)f(_k,)g(char)h(_v)f(\))i +({)f(\(\(char*\)_)o(p\)[)o(_k)o(])e(=)i(_v;)f(})104 2612 +y(double)f(_ref_doubl)o(e\()f(unsigned)h(_p,)h(int)g(_k)h(\))h({)f +(return)e(\(\(double*\))o(_p)o(\)[_)o(k];)f(})104 2658 +y(void)i(_set_doub)o(le\()e(unsigned)g(_p,)j(int)f(_k,)h(double)e(_v)i +(\))g({)g(\(\(double*\))o(_p\))o([_k)o(])d(=)k(_v;)e(})954 +2828 y Fq(16)p eop +%%Page: 17 17 +17 16 bop 104 45 a Fe(float)17 b(_ref_float\()f(unsigned)g(_p,)j(int)f +(_k)h(\))g({)h(return)d(\(\(float*\))o(_p\))o([_)o(k];)f(})104 +91 y(void)i(_set_floa)o(t\()e(unsigned)h(_p,)h(int)h(_k,)f(float)g(_v)h +(\))g({)g(\(\(float*\)_)o(p\))o([_k)o(])e(=)i(_v;)f(})104 +136 y Fd(3)0 212 y Fq(Finally)m(,)11 b(a)j(Sc)o(heme)g(\014le)g +Fn(chez-stdlib.sch)c Fq(de\014nes)16 b(the)e(foreign)f(function)h(in)o +(terfaces)h(to)f(the)g(standard)g(library:)0 299 y Fe("chez-stdl)o(ib)o +(.sc)o(h")9 b Fj(17c)i Fg(\021)104 346 y Fe(\(define)17 +b(_ref_int)143 391 y(\(foreign-f)o(un)o(cti)o(on)f("_ref_int")g +(\(unsigned)o(-32)g(integer-3)o(2\))g(integer-32)o(\)\))104 +483 y(\(define)h(_set_int)143 528 y(\(foreign-f)o(un)o(cti)o(on)f +("_set_int")g(\(unsigned)o(-32)g(integer-3)o(2)h(integer-)o(32\))f +(void\)\))104 620 y(\(define)h(_ref_uint)143 665 y(\(foreign-f)o(un)o +(cti)o(on)f("_ref_uint)o(")g(\(unsigned-3)o(2)g(integer-32\))g +(integer-3)o(2\)\))104 756 y(\(define)h(_set_uint)143 +802 y(\(foreign-f)o(un)o(cti)o(on)f("_set_uint)o(")g(\(unsigned-3)o(2)g +(integer-32)g(unsigned-3)o(2\))g(void\)\))104 893 y(\(define)h +(_ref_char)143 939 y(\(foreign-f)o(un)o(cti)o(on)f("_ref_char)o(")g +(\(unsigned-3)o(2)g(integer-32\))g(char\)\))104 1030 +y(\(define)h(_set_char)143 1076 y(\(foreign-f)o(un)o(cti)o(on)f +("_set_char)o(")g(\(unsigned-3)o(2)g(integer-32)g(char\))i(void\)\))104 +1167 y(\(define)f(_ref_doub)o(le)143 1213 y(\(foreign-f)o(un)o(cti)o +(on)f("_ref_doub)o(le)o(")h(\(unsigned)o(-3)o(2)g(integer-3)o(2\))f +(double-flo)o(at)o(\)\))104 1304 y(\(define)h(_set_doub)o(le)143 +1350 y(\(foreign-f)o(un)o(cti)o(on)f("_set_doub)o(le)o(")h(\(unsigned)o +(-3)o(2)g(integer-3)o(2)f(double-floa)o(t\))g(void\)\))104 +1441 y(\(define)h(_ref_floa)o(t)143 1487 y(\(foreign-f)o(un)o(cti)o(on) +f("_ref_floa)o(t")g(\(unsigned-)o(32)g(integer-32)o(\))g(single-floa)o +(t\))o(\))104 1578 y(\(define)h(_set_floa)o(t)143 1624 +y(\(foreign-f)o(un)o(cti)o(on)f("_set_floa)o(t")g(\(unsigned-)o(32)g +(integer-32)g(single-fl)o(oat)o(\))g(void\)\))104 1715 +y(\(define)h(_memcpy)143 1761 y(\(let)h(\(\(memcpy-*)o(-*)280 +1807 y(\(foreign-f)o(unc)o(tio)o(n)e("memcpy")h(\(unsigned)o(-32)f +(unsigned-)o(32)g(unsigned-3)o(2\))g(void\)\))261 1852 +y(\(memcpy-s)o(tr)o(ing)o(-st)o(ri)o(ng)280 1898 y(\(foreign-f)o(unc)o +(tio)o(n)g("memcpy")h(\(string)g(string)g(unsigned-3)o(2\))f(void\)\)) +261 1944 y(\(memcpy-s)o(tr)o(ing)o(-*)280 1989 y(\(foreign-f)o(unc)o +(tio)o(n)g("memcpy")h(\(string)g(unsigned-)o(32)f(unsigned-3)o(2\))g +(void\)\))261 2035 y(\(memcpy-*)o(-s)o(tri)o(ng)280 2081 +y(\(foreign-f)o(unc)o(tio)o(n)g("memcpy")h(\(unsigned)o(-32)f(string)h +(unsigned-3)o(2\))f(void\)\)\))182 2126 y(\(lambda)h(\(a)i(b)g(count\)) +221 2172 y(\(cond)f(\(\(string?)e(a\))359 2218 y(\(cond)h(\(\(string?)g +(b\))h(\(memcpy-str)o(in)o(g-s)o(tr)o(ing)e(a)j(b)g(count\)\))476 +2263 y(\(\(integer?)d(b\))j(\(memcpy-st)o(ri)o(ng-)o(*)d(a)k(b)f +(count\)\))476 2309 y(\(else)f(???\)\)\))339 2355 y(\(\(integer?)e(a\)) +359 2400 y(\(cond)h(\(\(string?)g(b\))h(\(memcpy-*-s)o(tr)o(ing)e(a)j +(b)g(count\)\))476 2446 y(\(\(integer?)d(b\))j(\(memcpy-*-)o(*)d(a)k(b) +f(count\)\))476 2492 y(\(else)f(???\)\)\))339 2537 y(\(else)g +(???\)\)\)\)\))104 2583 y Fd(3)954 2828 y Fq(17)p eop +%%Page: 18 18 +18 17 bop 0 45 a Fr(Index)23 b(of)g(Iden)n(ti\014ers)0 +136 y Fq(The)16 b(underlined)g(scrap)g(n)o(um)o(b)q(er)f(sho)o(ws)g +(the)h(de\014ning)g(scrap)g(for)f(the)h(iden)o(ti\014er;)g(all)e(other) +i(scrap)g(n)o(um)o(b)q(ers)f(are)h(uses.)0 186 y(Also)10 +b(note)h(that)f(man)o(y)e(pro)q(cedures)13 b(are)d(not)h(de\014ned)g +(in)f(this)g(\014le)g(but)h(in)e(the)i(target-indep)q(enden)o(t)h(part) +f(of)e(the)i(bac)o(k-end,)0 236 y(in)i(\014le)h Fn(process.sch)p +Fq(.)0 306 y Fe(accessor-t)o(em)o(pla)o(te)o Ff(:)g(9a,)f(9b)p +423 313 41 2 v 1 w(,)f(9c.)0 352 y Fe(array-acce)o(ss)o(or-)o(te)o(mpl) +o(ate)o Ff(:)i(9c)p 479 359 37 2 v(.)0 398 y Fe(basic-type)o(-n)o(ame)o +Ff(:)g(9a,)f(14c)p 384 405 56 2 v(,)g(15a.)0 443 y Fe(c-cast-exp)o(re)o +(ssi)o(on)o Ff(:)h(9a,)f(15a)p 423 450 58 2 v 1 w(.)0 +489 y Fe(c-output)p Ff(:)h(3a)p 185 496 39 2 v(,)f(3b,)f(4ab,)i(14b.)0 +535 y Fe(chez-map-a)o(rg)o(s)p Ff(:)g(12a,)f(12b)p 364 +542 60 2 v 1 w(.)0 580 y Fe(chez-type)p Ff(:)g(4c)p 204 +587 37 2 v 1 w(,)f(12ab.)0 626 y Fe(compute-ne)o(wn)o(ame)o +Ff(:)i(6b,)f(6c)p 386 633 V(.)0 672 y Fe(constructo)o(r-)o(tem)o(pl)o +(ate)o Ff(:)h(7b,)f(8a)p 484 679 39 2 v(.)0 717 y Fe(define-for)o(ei)o +(gn)p Ff(:)g(11,)g(12a)p 364 724 58 2 v 1 w(,)f(14b.)0 +763 y Fe(destructor)o(-t)o(emp)o(la)o(te)p Ff(:)h(7b,)g(8a)p +464 770 39 2 v 1 w(.)0 809 y Fe(dump-enums)o Ff(:)h(2c,)f(13a)p +284 816 58 2 v(.)0 854 y Fe(dump-funct)o(io)o(ns)p Ff(:)g(2c,)g(11)p +362 861 39 2 v(.)0 900 y Fe(dump-macro)o(s)p Ff(:)g(2c,)g(13b)p +303 907 60 2 v 1 w(.)0 945 y Fe(dump-struc)o(t/)o(uni)o(on)o +Ff(:)h(5,)f(6a)p 404 952 39 2 v(,)g(7a.)0 991 y Fe(dump-struc)o(t/)o +(uni)o(on)o(-de)o(f)p Ff(:)h(6a,)e(7a)p 501 998 V 1 w(.)0 +1037 y Fe(dump-struc)o(ts)o Ff(:)i(2c,)f(5)p 323 1044 +20 2 v(.)0 1082 y Fe(dump-union)o(s)p Ff(:)g(2c,)g(5)p +303 1089 V(.)0 1128 y Fe(evaluate-n)o(um)o(ber)o Ff(:)h(13b,)f(14a,)g +(16b)p 486 1135 60 2 v 1 w(.)0 1174 y Fe(function-p)o(ai)o(r)p +Ff(:)h(7b,)f(9ac,)g(10b,)g(14b)p 509 1181 V 1 w(.)0 1219 +y Fe(generate-a)o(cc)o(ess)o(or)o(s-a)o(nd-)o(mu)o(tat)o(or)o(s)p +Ff(:)h(7a,)f(8b)p 698 1226 41 2 v(,)g(10a.)0 1265 y Fe(generate-c)o(on) +o(str)o(uc)o(tor)o(-an)o(d-)o(des)o(tr)o(uct)o(or)o Ff(:)h(7a,)f(7b)p +776 1272 V 1 w(.)0 1311 y Fe(generate-r)o(ef)o(ere)o(nc)o(e-t)o(o-s)o +(tr)o(uct)o(ur)o(e)p Ff(:)h(6a,)f(6b)p 698 1318 V(.)0 +1356 y Fe(generate-t)o(ra)o(nsl)o(at)o(ion)o Ff(:)h(2b)p +420 1363 V 1 w(,)e(2d.)0 1402 y Fe(getset-arr)o(ay)o(-ty)o(pe)o +Ff(:)i(8b,)f(9c)p 425 1409 37 2 v(.)0 1448 y Fe(getset-bas)o(ic)o(-ty)o +(pe)o Ff(:)h(8b,)f(9a)p 425 1455 39 2 v 1 w(.)0 1493 +y Fe(getset-str)o(uc)o(tur)o(ed)o(-ty)o(pe)p Ff(:)g(8b,)g(10a)p +523 1500 58 2 v 1 w(.)0 1539 y Fe(global-tem)o(pl)o(ate)o +Ff(:)h(10b)p 322 1546 60 2 v 1 w(.)0 1585 y Fe(mutator-te)o(mp)o(lat)o +(e)p Ff(:)g(9a,)e(9b)p 403 1592 41 2 v 1 w(.)0 1630 y +Fe(rational-t)o(yp)o(ena)o(me)o Ff(:)i(12a,)f(16a)p 442 +1637 58 2 v 1 w(.)0 1676 y Fe(sch-output)o Ff(:)h(3a)p +224 1683 39 2 v(,)f(3b,)g(4b,)g(6b,)g(12a,)g(13ab.)0 +1722 y Fe(select-fun)o(ct)o(ion)o(s)p Ff(:)h(2a)p 342 +1729 V(,)e(2d.)0 1767 y Fe(string-pre)o(fi)o(x=?)o Ff(:)i(6c,)f(15b)p +382 1774 60 2 v(.)0 1813 y Fe(valid-iden)o(t?)o Ff(:)h(13b,)f(14a)p +346 1820 58 2 v 1 w(.)0 1859 y Fe(valid-numb)o(er)o(?)p +Ff(:)h(13b,)f(14a)p 366 1866 V 1 w(.)954 2828 y Fq(18)p +eop +%%Trailer +end +userdict /end-hook known{end-hook}if +%%EOF diff --git a/chez.sch b/chez.sch new file mode 100644 index 0000000..a39005e --- /dev/null +++ b/chez.sch @@ -0,0 +1,340 @@ +(define c-output #f) +(define sch-output #f) + +(define (select-functions) + (do ((functions functions (cdr functions))) + ((null? functions)) + (referenced! (car functions)))) + +(define (generate-translation) + (delete-file "C-OUTPUT") + (delete-file "SCH-OUTPUT") + (set! c-output (open-output-file "C-OUTPUT")) + (set! sch-output (open-output-file "SCH-OUTPUT")) + (display "#include \"chez-stdlib.h\"" c-output) (newline c-output) + (display "#include \"stdlib.h\"" c-output) (newline c-output) + + (dump-structs) + (dump-unions) + (dump-functions) + (dump-variables) + (dump-enums) + (dump-macros) + + (close-output-port c-output) + (close-output-port sch-output) + + #t) + +(define (chez-type type) + (case (record-tag type) + ((pointer) 'unsigned-32) + ((int long enum) 'integer-32) + ((unsigned unsigned-long) 'unsigned-32) + ((char unsigned-char signed-char) 'char) + ((void) 'void) + ((double) 'double-float) + ((float) 'single-float) + ((***invalid***) '***invalid***) + (else + (warn "Cannot translate this type: " type) + (string->symbol (string-append (symbol->string '***invalid:) + (symbol->string (record-tag type)) + "***"))))) + +(define (dump-structs) + (dump-struct/union structs struct-names "struct")) + +(define (dump-unions) + (dump-struct/union unions union-names "union")) +(define (dump-struct/union records typedef-name-getter qualifier) + (for-each + (lambda (structure) + (if (referenced? structure) + (begin + (if (user-defined-tag? (tag structure)) + (dump-struct/union-def structure qualifier (tag structure))) + (for-each (lambda (n) + (if (user-defined-tag? (tag structure)) + (generate-reference-to-structure structure n qualifier) + (dump-struct/union-def structure "" n))) + (typedef-name-getter structure))))) + records)) +(define (generate-reference-to-structure structure typedef-name qualifier) + (for-each (lambda (n) + (let ((newname (compute-newname n typedef-name (tag structure) qualifier))) + (display `(define ,newname ,n) sch-output) + (newline sch-output))) + (cached-names structure))) +(define (compute-newname oldname typedef-name tag qualifier) + (let ((q (string-append qualifier "_" tag))) + (let ((get (string-append "_get_" q)) + (set (string-append "_set_" q)) + (alloc (string-append "_alloc_" q)) + (free (string-append "_free_" q))) + (cond ((string-prefix=? oldname get) + (string-append "_get_" typedef-name (substring oldname (string-length get) + (string-length oldname)))) + ((string-prefix=? oldname set) + (string-append "_set_" typedef-name (substring oldname (string-length set) + (string-length oldname)))) + ((string-prefix=? oldname alloc) (string-append "_alloc_" typedef-name)) + ((string-prefix=? oldname free) (string-append "_free_" typedef-name)) + (else (error "compute-newname: can't handle: " oldname)))))) +(define (dump-struct/union-def structure qualifier name) + (let* ((funcname (if (string=? qualifier "") + name + (string-append qualifier "_" name))) + (cast (if (string=? qualifier "") + name + (string-append qualifier " " name)))) + (generate-constructor-and-destructor structure funcname cast) + (generate-accessors-and-mutators structure funcname cast ""))) +(define (generate-constructor-and-destructor structure funcname cast) + (function-pair constructor-template + (vector funcname cast) + (string-append "_alloc_" funcname) + '((void ())) + `(pointer ,(struct/union-ref structure))) + (function-pair destructor-template + (vector funcname cast) + (string-append "_free_" funcname) + `((pointer ,(struct/union-ref structure))) + '(void ())) + (cache-name structure (string-append "_alloc_" funcname)) + (cache-name structure (string-append "_free_" funcname))) +(define constructor-template + "unsigned _alloc_@0(void) { + @1 *_p = (@1 *)malloc(sizeof(@1)); return (_p == 0 ? 0 : (unsigned)_p); + }") + +(define destructor-template + "void _free_@0(unsigned _p) { if (_p == 0) abort(); free((@1 *)_p); }") +(define (generate-accessors-and-mutators structure funcname cast selector) + (for-each + (lambda (field) + (let ((funcname (string-append funcname "_" (canonical-name (name field)))) + (selector (string-append selector (if (string=? selector "") "" ".") (name field)))) + (cond ((basic-type? (type field)) + (getset-basic-type structure funcname cast selector field)) + ((array-type? (type field)) + (getset-array-type structure funcname cast selector field)) + ((structured-type? (type field)) + (getset-structured-type structure funcname cast selector field)) + (else (error 'generate-accessors-and-mutators "Unknown: " field))))) + (fields structure))) +(define (getset-basic-type struct funcname cast selector field) + (let* ((typename (basic-type-name (type field))) + (fieldtype (c-cast-expression (type field)))) + (function-pair accessor-template + (vector typename funcname cast selector) + (string-append "_get_" funcname) + `((pointer ,(struct/union-ref struct))) + (type field)) + (function-pair mutator-template + (vector typename funcname cast selector fieldtype) + (string-append "_set_" funcname) + `((pointer ,(struct/union-ref struct)) ,(type field)) + `(void ())) + (cache-name struct (string-append "_get_" funcname)) + (cache-name struct (string-append "_set_" funcname)))) +(define accessor-template + "@0 _get_@1( unsigned _p ) { return (@0)((@2*)_p)->@3; }") + +(define mutator-template + "void _set_@1( unsigned _p, @0 _v ) { ((@2*)_p)->@3 = (@4)_v; }") +(define (getset-array-type structure funcname cast selector field) + (function-pair array-accessor-template + (vector funcname cast selector) + (string-append "_get_" funcname) + `((pointer ,(struct/union-ref structure))) + '(unsigned)) + (cache-name structure (string-append "_get_" funcname))) + +(define array-accessor-template + "unsigned _get_@0( unsigned _p ) { return (unsigned)(((@1*)_p)->@2); }") +(define (getset-structured-type structure funcname cast selector field) + (let (;(selector (string-append selector "." (name field))) + ;(funcname (string-append funcname "_" (canonical-name (name field)))) + (struct (if (eq? (record-tag (type field)) 'struct-ref) + (lookup (tag (type field)) structs) + (lookup (tag (type field)) unions)))) + (generate-accessors-and-mutators struct funcname cast selector))) + +(define (dump-variables) + (for-each (lambda (v) + (let ((n (canonical-name (name v)))) + (function-pair global-template + (vector n (name v)) + (string-append "_glob_" n) + '((void ())) + `(pointer ,(type v))))) + vars)) + +(define global-template + "unsigned _glob_@0( void ) { return (unsigned)&@1; }") + +(define (dump-functions) + (for-each (lambda (f) (define-foreign (name f) (type f))) + functions)) +(define (define-foreign name type) + (let ((argtypes (arglist type)) + (returntype (rett type))) + (let loop ((l argtypes)) + (cond ((null? l) #t) + ((structured-type? (car l)) + (warn "Cannot pass structured value of type" + (rational-typename (car l)) + "to function" + name) + (set-car! l '(***invalid***)) + (loop (cdr l))) + (else + (loop (cdr l))))) + (if (structured-type? returntype) + (begin (warn "Cannot receive structured value of type" + (rational-typename returntype) + "from function" + name) + (set! returntype '(***invalid***)))) + + (write + `(define ,(string->symbol (canonical-name name)) + (foreign-function ,name + ,(chez-map-args argtypes name) + ,(chez-type returntype))) + sch-output) + (newline sch-output))) +(define (chez-map-args args name) + (cond ((and (= (length args) 1) + (eq? (caar args) 'void)) + '()) + ((= (length args) 0) + (warn "Function without prototype assumed to take no arguments:" + name) + '()) + (else + (map (lambda (x) + (if (eq? (record-tag x) 'void) + (begin (warn "Varargs *cannot* be handled for" name) + '***invalid***) + (chez-type x))) + args)))) + +(define (dump-enums) + (for-each (lambda (x) + (display (instantiate "(define @0 @1)" + (vector (canonical-name (name x)) + (number->string (value x)))) + sch-output) + (newline sch-output)) + enum-idents)) + +(define (dump-macros) + (for-each (lambda (m) + (if (and (valid-ident? (name m)) + (valid-number? (value m))) + (begin + (display `(define ,(canonical-name (name m)) + ,(evaluate-number (value m))) + sch-output) + (newline sch-output)))) + macros)) +(define (valid-ident? s) + (andmap (lambda (c) + (or (char-upper-case? c) + (char-lower-case? c) + (char-numeric? c) + (char=? c #\_))) + (string->list s))) + +(define (valid-number? s) + (let ((n (evaluate-number s))) + n)) + +(define (function-pair c-template template-args scheme-name arglist rett) + (display (instantiate c-template template-args) c-output) + (newline c-output) + (define-foreign scheme-name + `(function ,arglist ,rett))) +(define (basic-type-name type) + (let ((probe (assq (record-tag type) + '((char . "char") + (signed-char . "signed char") + (unsigned-char . "unsigned char") + (short . "short") + (unsigned-short "unsigned short") + (int . "int") + (enum . "int") + (unsigned . "unsigned") + (long . "long") + (unsigned-long . "unsigned long") + (void . "void") + (pointer . "unsigned") + (float . "float") + (double . "double") + )))) + (if probe + (cdr probe) + (begin (warn "Unknown type " type) + "***invalid***")))) +(define (c-cast-expression type) + (cond ((primitive-type? type) + (basic-type-name type)) + ((pointer-type? type) + (string-append (c-cast-expression (cadr type)) "*")) + ((eq? (record-tag type) 'enum-ref) + (basic-type-name '(int ()))) + ((memq (record-tag type) '(struct-ref union-ref)) + (let ((t (tag type))) + (if (user-defined-tag? t) + (string-append (if (eq? (record-tag type) 'struct-ref) + "struct " + "union ") + t) + (let ((names (if (eq? (record-tag type) 'struct-ref) + (struct-names type) + (union-names type)))) + (if (= (length names) 1) + (car names) + (error "c-cast-expression: bad: " type)))))) + (else + (warn "c-cast-expression: Too complicated: " type) + "unknown"))) +(define (string-prefix=? s prefix) + (let ((limit (string-length prefix))) + (and (<= limit (string-length s)) + (let loop ((i 0)) + (or (= i limit) + (and (char=? (string-ref s i) (string-ref prefix i)) + (loop (+ i 1)))))))) +(define (rational-typename type) + (case (record-tag type) + ((struct-ref) + (if (user-defined-tag? (tag type)) + type + (let ((t (lookup (tag type) structs))) + (if (not t) + type + (list 'struct-ref (tag t)))))) + ((union-ref) + (if (user-defined-tag? (tag type)) + type + (let ((t (lookup (tag type) unions))) + (if (not t) + type + (list 'union-ref (tag t)))))) + (else type))) +(define (evaluate-number s) + (let ((k (string->list s))) + (cond ((null? k) #f) + ((not (char-numeric? (car k))) #f) + ((char=? (car k) #\0) + (cond ((null? (cdr k)) 0) + ((or (char=? (cadr k) #\x) (char=? (cadr k) #\X)) + (string->number (list->string (cddr k)) 16)) + (else + (string->number s 8)))) + (else + (string->number s))))) + diff --git a/chez.w b/chez.w new file mode 100644 index 0000000..b1eb534 --- /dev/null +++ b/chez.w @@ -0,0 +1,1180 @@ +% -*- scheme -*- +% +% This is a nuweb document. +% nuweb is available by anon. ftp from cs.rice.edu in /public/preston. +% +% Author: Lars Thomas Hansen (lth@cs.uoregon.edu) +% +% Copyright (C) 1996 The University of Oregon. All rights reserved. +% +% This file may be freely redistributed in its entirety with or without +% modification provided that this copyright notice is not removed. It +% may not be sold for profit or incorporated in commercial software +% products without the prior written permission of the copyright holder. + +\documentstyle{article} +\oddsidemargin 0in +\evensidemargin 0in +\textwidth 6.5in +\topmargin -0.5in +\textheight 9in + +\newcommand{\fixme}[1]{{\Large\bf FIXME: #1}} + +\title{FFIGEN Back-end for Chez Scheme Version 5\footnote{This work +has been supported by ARPA under U.S.~Army grant No.~DABT63-94-C-0029, +``Programming Environments, Compiler Technology and Runtime Systems +for Object Oriented Parallel Processing''.}} +\author{Lars Thomas Hansen \\ {\tt lth@@cs.uoregon.edu}} +\date{February 7, 1996} + + +\begin{document} +\maketitle + +\section{Introduction} + +This document describes the FFIGEN back-end for Chez Scheme version 5. +The exposition is provided in the hope that it will make it reasonably +clear how back-ends for FFIGEN are constructed; many back-ends will +probably have a structure similar to that of the present program. + +If you haven't read the {\em FFIGEN Manifesto and Overview}, now is a +good time to do so. + +If you haven't read the {\em FFIGEN User's Manual,\/} which documents +the target-independent code for FFIGEN back-ends and the format for the +intermediate code, now is a good time to do so. + +This document is organized in the following manner. Section +\ref{overall} documents the overall structure of the translation for +Chez Scheme. Section \ref{thecode} presents the policy choices made for +data types and most of the code implementing the policy; section +\ref{utils} presents several utility procedures used by the +implementation. Section \ref{discussion} discusses some of the +implementation choices, particularly in terms of performance, and +section \ref{future} summarizes future work on the Chez Scheme back-end. +Section \ref{stdlib} presents the implementation of the support +libraries. + +This document is also the program: the \LaTeX\ source for the document, +the Scheme source code for the program, and the standard library sources +have been derived from the same file using the \verb|nuweb| system for +literate programming.\footnote{\verb|nuweb| was implemented by Preston +Briggs of Rice University; you may retrieve it by anonymous ftp from +\verb|cs.rice.edu| in the directory \verb|/public/preston|.} The +document presents the program in an order which I believe is conducive +to understanding its workings. Here's how you read it: each snippet of +code (called a {\em macro\/} or {\em scrap\/}) has a title which includes +the page number on which the scrap is defined and a letter following the +page number which shows the relative place on that page where you can +find the scrap (for example, 9a is the first scrap on page 9 and 6c is +the third scrap on page 6). Scraps reference other scraps; these +references are the titles, so any cross-reference immediately gives you +the page number of the referenced code. In addition, an index of global +identifiers can be found in the appendix. + + +\section{Overall Structure} +\label{overall} + +The FFIGEN back-end for any FFI consists of two parts: a +target-independent part which reads the output of the front end into +global in-memory data structures, and a target-dependent part which does +the actual translation. The target-dependent part is implemented by two +procedures, \verb|select-functions| and \verb|generate-translation|. + +\subsection{The {\tt select-functions} procedure} + +The procedure \verb|select-functions| is called during initial +processing to mark as selected those procedures which are interesting +for the translation. This makes it possible to exclude some functions +from the translation. For example, if you are translating the interface +to a library whose header file includes \verb|stdio.h|, you may wish to +exclude all function prototypes included from the latter file. Since +each function record in the intermediate form has a field naming the +file the record came from, you can easily exclude functions from +\verb|stdio.h|. + +The implementation of \verb|select-functions| for Chez Scheme simply +marks all functions as selected, by turning on the ``referenced'' bit +in the record. + +@d the select-functions interface procedure +@{(define (select-functions) + (do ((functions functions (cdr functions))) + ((null? functions)) + (referenced! (car functions)))) +@| select-functions @} + +\subsection{The {\tt generate-translation} procedure} + +The procedure \verb|generate-translation| is called when the +target-independent part is done processing the data, and it must +implement all aspects of the target-dependent translation. It takes no +arguments. My version sets up the output files, initializes the files, +calls the generating functions, and cleans up. + +@d the generate-translation interface procedure +@{(define (generate-translation) + @ + @ + @ + #t) +@| generate-translation @} + +\verb|generate-translation| calls on specialized procedures to +generate code for the various intermediate language records: + +@d generate code for all constructs +@{(dump-structs) +(dump-unions) +(dump-functions) +(dump-variables) +(dump-enums) +(dump-macros) +@} + +\subsection{Structure of the Scheme source file} + +The final file is called \verb|chez.sch| and is laid out in the +following way: + +@o chez.sch +@{@ +@ +@ +@ +@ +@ +@ +@ +@ +@ +@} + +\subsection{The standard library} + +To facilitate the translation, a small standard library has been created +ahead of time (see section \ref{stdlib} for the implementation). The +library implements primitive dereferencing functions and a memory copy +procedure. There is a C file and a Scheme file. The C file must be +compiled and loaded into the Scheme system using the FFI facilities for +this (which happen to be operating-system dependent in Chez Scheme). +The Scheme FFI code for the standard library must be loaded into the +Scheme system at run time. + +\section{Policy in the Chez Scheme Back-end} +\label{thecode} + +Chez Scheme version 5 has a fairly simple native FFI. It supports most +primitive C data types for both parameters and return values, and +performs data conversions on call and return. A string is passed as a +\verb|char*| to the first character (in Chez Scheme, strings are +0-terminated for C compatibility), but is returned by copying the data +into a fresh Scheme string. There is no direct support for the +\verb|short| datatype, variadic procedures, call by reference, calling +functions through a function pointer, struct/union arguments, or +struct/union return values, nor is there support for passing general +Scheme objects like pairs, arrays, or functions to foreign functions. + +In this (first) version of the translation I have decided not to +implement any mechanisms for handling special cases like the +\verb|fgets()| example outlined in the {\em Manifesto}; that will have +to come later. Such a mechanism might take the form of a file +containing rules for how to override certain function signatures, for +example. See section \ref{future}. + +\subsection{The Output} +\label{the-output} + +Two output files are produced: a C file and a Scheme file. The Scheme +file will hold the FFI code which interfaces to the library and its data +types. The C file will hold supporting (``glue'') code generated along +the way: accessors, mutators, and so on. The need for supporting code +will become clear as you read. + +\verb|c-output| and \verb|sch-output| are global variables which hold +output ports for generated C code and Scheme code, respectively. + +@d back-end global variables +@{(define c-output #f) +(define sch-output #f) +@| c-output sch-output @} + +The files are initialized in \verb|generate-translation| by computing +file names and assigning opened ports to the global variables; for +simplicity I use fixed names for the time being. The use of +\verb|delete-file| is necessary in Chez Scheme, lest it complain when +opening an existing file for output. + +@d initialize output files +@{(delete-file "C-OUTPUT") +(delete-file "SCH-OUTPUT") +(set! c-output (open-output-file "C-OUTPUT")) +(set! sch-output (open-output-file "SCH-OUTPUT")) +@} + +Once the files are opened they are initialized with standard +definitions. The C file \verb|#include|s the FFIGEN standard library +header and the ANSI C standard library header; there is nothing to be +done in the Scheme case. We should probably also emit a line here +which includes the original header file, but the name of that file +is not currently available in the intermediate format. + +@d initialize output files +@{(display "#include \"chez-stdlib.h\"" c-output) (newline c-output) +(display "#include \"stdlib.h\"" c-output) (newline c-output) +@} + +When processing is done, the output files must be closed: + +@d finalize output files +@{(close-output-port c-output) +(close-output-port sch-output) +@} + + +\subsection{Names} + +Since Scheme is case-insensitive and C is not, names which do not clash +in C may do so in Scheme. This can be handled fairly simply by keeping +track of all generated Scheme names and warning about conflicts. In +this version I have not implemented this, but it will be implemented +in the future. + +In general, parameter names in generated C procedures are prepended with +underscores to prevent name clashes with \verb|typedef|s: names starting +with a single underscore are reserved for libraries and will in +principle not appear in user code. However, this scheme is not +foolproof, considering that FFIGEN is used to translate library code. +We might need to come up with something better. + +\subsection{Primitive Types} + +The procedure \verb|chez-type| takes a primitive type structure and +returns the name of the Chez Scheme parameter or return type. Already +we have to make hard choices: what do we do with pointers, in particular +character pointers? In the current implementation I let a \verb|char*| +be a \verb|char*|; programs which wish to pass strings will have to +first copy the string data into an allocated character buffer and then +pass the address of the buffer. A function which performs the copy +operation is part of the standard library. + +Other decisions I have made are to represent pointers as unsigned +32-bit ints (hence all pointers are the same size), and to represent +\verb|char|, \verb|signed char|, and \verb|unsigned char| all as the + same \verb|char| FFI +type. If the type is a \verb|short| variant, a warning is generated.% +\footnote{Chez Scheme does not support a \verb|short| FFI type. Since +the ANSI C standard (or at least K\&R 2nd edition) seems to say that +a \verb|short| can be passed to a function with a prototype in scope +without being widened to \verb|int|, we can't simply use \verb|integer-32| +as the FFI argument type for a \verb|short|. On many architectures using +a 32-bit integer would +work because the APIs don't support parameters smaller than 32 bits. We +could also have used proxy functions; see section \ref{struct-vals}.} +Enums are assumed to be 32-bit integers. + +@d Chez FFI names for primitive types +@{(define (chez-type type) + (case (record-tag type) + ((pointer) 'unsigned-32) + ((int long enum) 'integer-32) + ((unsigned unsigned-long) 'unsigned-32) + ((char unsigned-char signed-char) 'char) + ((void) 'void) + ((double) 'double-float) + ((float) 'single-float) + ((***invalid***) '***invalid***) + (else + (warn "Cannot translate this type: " type) + (string->symbol (string-append (symbol->string '***invalid:) + (symbol->string (record-tag type)) + "***"))))) +@| chez-type @} + +The special type \verb|***invalid***| and its variant +\verb|***invalid:tag***| are used to signal errors detected during +translation; by using these types in the output, no file that was +generated with errors can actually be used. + +In addition, we have to consider how to dereference pointers to +primitive types (pointers to structured types are handled later). For +example, if I have an \verb|int*| and I want to access the integer it +points to, how do I do this? For this purpose, dereferencing functions +are provided in the standard library. Each function takes a pointer +\verb|p| and an offset \verb|k| and fetches the element \verb|p[k]|. +There are also functions which store values through pointers to +primitive types. See section \ref{stdlib} for the signatures and the +actual implementation. + +By treating pointers to pointers as generic pointer types, we handle the +general case of recursive dereferencing. Since pointers and integers +are the same size and type checking is lax, we can use the unsigned +integer access functions to follow pointer chains. For example, if we +have an \verb|int** p| and want the integer, the code to access it would +be (in C) \verb|_ref_int(_ref_uint(p,0),0)|. + +\subsection{Structured Types} + +The translations for structs and unions are similar. I'll talk about +structures, but the discussion pertains to unions as well. The +procedures \verb|dump-structs| and \verb|dump-unions| are almost +identical, and call the same function to do their work: + +@d dump structs and unions +@{(define (dump-structs) + (dump-struct/union structs struct-names "struct")) + +(define (dump-unions) + (dump-struct/union unions union-names "union")) +@| dump-structs dump-unions @} + +\verb|struct-names| and \verb|union-names| are procedures which return a +list of all \verb|typedef|s which directly name a struct or union; see +the {\em FFIGEN User's Manual} for a discussion. + +In the following, we will use this structure as an example: + +\begin{flushleft} \small +\begin{minipage}{\linewidth} +\begin{list}{}{} \item +\mbox{}\verb@@struct X {@@\\ +\mbox{}\verb@@ int i;@@\\ +\mbox{}\verb@@ char c[5];@@\\ +\mbox{}\verb@@ union {@@\\ +\mbox{}\verb@@ char *s;@@\\ +\mbox{}\verb@@ int *q;@@\\ +\mbox{}\verb@@ } u;@@\\ +\mbox{}\verb@@};@@\\ +\end{list} +\vspace{-1ex} +\end{minipage}\\[4ex] +\end{flushleft} +\vspace{-3ex} + +Each structure in the intermediate form has a tag (\verb|X| in the +example), although some of these tags were generated by the compiler. +Whether the tag was programmer-defined or not is important for how code +is generated (see below), and the procedure \verb|dump-struct/union| +takes it into account when generating FFI code for each referenced +structure. + +Only structures which have programmer-defined tags have operations +generated for them with the name of the tag. Structures which are +referred to by a \verb|typedef| must be handled specially. There are +two cases. If the \verb|typedef|'d structure also has a +programmer-defined tag, then Scheme definitions are emitted which define +operations using the \verb|typedef| name to be the same as the +operations using the structure tag. If the type does not have a +programmer-defined tag, then operations are defined on the structure +using the \verb|typedef| name only; you get names like \verb|_get_X_i|. + +@d dump structs and unions +@{(define (dump-struct/union records typedef-name-getter qualifier) + (for-each + (lambda (structure) + (if (referenced? structure) + (begin + (if (user-defined-tag? (tag structure)) + (dump-struct/union-def structure qualifier (tag structure))) + (for-each (lambda (n) + (if (user-defined-tag? (tag structure)) + (generate-reference-to-structure structure n qualifier) + (dump-struct/union-def structure "" n))) + (typedef-name-getter structure))))) + records)) +@| dump-struct/union @} + +The procedure \verb|generate-reference-to-structure| takes a structure +which has a cached list of defined constructor, destructor, accessor, +and mutator function, a \verb|typedef|-name, and a qualifier (\verb|struct|, +\verb|union|, or the empty string) and generates Scheme definitions +which use the \verb|typedef|-name but which refer to the already-defined +functions using the qualified name and structure tag. For example, if +there is already a foreign function called \verb|_get_struct_X_F| and +the \verb|typedef| name is \verb|Y|, then a variable called \verb|_get_Y_F| +will be bound to the value of the existing foreign function. + +@d dump structs and unions +@{(define (generate-reference-to-structure structure typedef-name qualifier) + (for-each (lambda (n) + (let ((newname (compute-newname n typedef-name (tag structure) qualifier))) + (display `(define ,newname ,n) sch-output) + (newline sch-output))) + (cached-names structure))) +@| generate-reference-to-structure @} + +The procedure \verb|compute-newname| takes an already emitted name and +generates a name which uses the \verb|typedef| name. + +@d dump structs and unions +@{(define (compute-newname oldname typedef-name tag qualifier) + (let ((q (string-append qualifier "_" tag))) + (let ((get (string-append "_get_" q)) + (set (string-append "_set_" q)) + (alloc (string-append "_alloc_" q)) + (free (string-append "_free_" q))) + (cond ((string-prefix=? oldname get) + (string-append "_get_" typedef-name (substring oldname (string-length get) + (string-length oldname)))) + ((string-prefix=? oldname set) + (string-append "_set_" typedef-name (substring oldname (string-length set) + (string-length oldname)))) + ((string-prefix=? oldname alloc) (string-append "_alloc_" typedef-name)) + ((string-prefix=? oldname free) (string-append "_free_" typedef-name)) + (else (error "compute-newname: can't handle: " oldname)))))) +@| compute-newname @} + +The procedure \verb|dump-struct/union-def| takes a structure type, a +qualifier (a string, either \verb|struct|, \verb|union|, or the empty +string) and the C name of the structure (its tag or \verb|typedef| +name), and generates constructors, destructors, accessors, and mutators +for the structure. + +@d dump structs and unions +@{(define (dump-struct/union-def structure qualifier name) + (let* ((funcname (if (string=? qualifier "") + name + (string-append qualifier "_" name))) + (cast (if (string=? qualifier "") + name + (string-append qualifier " " name)))) + (generate-constructor-and-destructor structure funcname cast) + (generate-accessors-and-mutators structure funcname cast ""))) +@| dump-struct/union-def @} + +\subsubsection{Constructors and destructors} + +The procedure \verb|generate-constructor-and-destructor| generates +constructor and destructor procedures for its argument. The constructor +procedure is called \verb|_alloc_struct_X|. This procedure takes no +parameters and allocates memory for the given type, returning a pointer +(cast to an unsigned integer) or the literal integer 0 (which may be +different from the null pointer). + +The destructor procedure is called \verb|_free_struct_X|; it takes a +value returned from the constructor and frees the allocated memory. +Generating a constructor may be excessive; a single interface to +\verb|free()| is probably enough. The destructors may go away in the +future. + +The choice of value for the null pointer warrants discussion. I use the +integer 0 to make it possible to test for a null pointer by comparing +with 0 on the Scheme side; it is a decision which probably simplifies +the Scheme code. Using an unadulterated null pointer would make +comparison with 0 nonportable, since a null pointer is not guaranteed to +be all-bits-zero. + +An alternative would be to generate foreign procedures which return null +pointers, one procedure for each pointer type in the program, and these +return values could be used for pointer comparisons.\footnote{There's +one null pointer for every pointer type.} + +@d dump structs and unions +@{(define (generate-constructor-and-destructor structure funcname cast) + (function-pair constructor-template + (vector funcname cast) + (string-append "_alloc_" funcname) + '((void ())) + `(pointer ,(struct/union-ref structure))) + (function-pair destructor-template + (vector funcname cast) + (string-append "_free_" funcname) + `((pointer ,(struct/union-ref structure))) + '(void ())) + (cache-name structure (string-append "_alloc_" funcname)) + (cache-name structure (string-append "_free_" funcname))) +@| generate-constructor-and-destructor @} + +In the templates for constructors and destructors, \verb|@@0| is the +name of the structure as we want it to be generated: \verb|struct_X|, +\verb|union_X|, or \verb|X| (for a \verb|typedef|); and \verb|@@1| is the +cast expression for the type: \verb|struct X|, \verb|union X|, or +\verb|X|. + +@d dump structs and unions +@{(define constructor-template + "unsigned _alloc_@@0(void) { + @@1 *_p = (@@1 *)malloc(sizeof(@@1)); return (_p == 0 ? 0 : (unsigned)_p); + }") + +(define destructor-template + "void _free_@@0(unsigned _p) { if (_p == 0) abort(); free((@@1 *)_p); }") +@| constructor-template destructor-template @} + + +\subsubsection{Accessors and Mutators} + +For each field \verb|F| of basic or array type there will be an accessor +function \verb|_get_struct_X_F|, and for each field of basic type there +will be a mutator function \verb|_set_struct_X_F|. The accessor takes a +pointer and returns the field value; the mutator takes a pointer and a +value and updates the field. + +If the structure has nested structures, functions are generated which +will access fields in the nested structures in the expected way; the +naming scheme is to replace the ``.'' in the C syntax with an underscore +``\_''. The generated C code for the accessors and mutators will look +like this: + +\begin{flushleft} \small +\begin{minipage}{\linewidth} +\begin{list}{}{} \item +\mbox{}\verb@@int _get_struct_X_i(unsigned _p) { return ((struct X*)_p)->i; }@@\\ +\mbox{}\verb@@void _set_struct_X_i(unsigned _p, int _v) { ((struct X*)_p)->i = _v; }@@\\ +\mbox{}\verb@@unsigned _get_struct_X_u_s(unsigned _p) { return (unsigned)((struct X*)_p)->u.s; }@@\\ +\mbox{}\verb@@void _set_struct_X_u_s(unsigned _p, unsigned _v) { ((struct X*)_p)->u.s = (char*)_v; }@@\\ +\end{list} +\vspace{-1ex} +\end{minipage}\\[4ex] +\end{flushleft} +\vspace{-3ex} + +Procedures are not generated which directly dereference pointer fields; +the program must first fetch the pointer field and then dereference it. +Arrays in structures are handled like pointer fields, so +\verb|_get_struct_X_c| will be generated and will return a pointer to +the first element of \verb|c|, which can then be dereferenced. + +The procedure \verb|generate-accessors-and-mutators| takes a structure +type, a name to be used for the function (initially just +\verb|struct_X|, \verb|union_X|, or \verb|X| for a typedef name), a cast +expression (\verb|struct X|, \verb|union X|, or just \verb|X|), and a field +selector expression (initially the empty string). As the program +descends into the structure the function name and the selector +expression will be updated to reflect the field which is being accessed. +Appended to the function name will be an underscore and the field name, +so we'll see \verb|struct_X_i| and \verb|struct_X_u_s|, for example. +The selector will be the corresponding access expression for C, so +\verb|i| and \verb|u.s|. + +When generating accessors and mutators, there are three cases: fields of +some basic type (primitive types and pointers), fields of array type, +and fields of structured type. + +@d dump structs and unions +@{(define (generate-accessors-and-mutators structure funcname cast selector) + (for-each + (lambda (field) + (let ((funcname (string-append funcname "_" (canonical-name (name field)))) + (selector (string-append selector (if (string=? selector "") "" ".") (name field)))) + (cond ((basic-type? (type field)) + (getset-basic-type structure funcname cast selector field)) + ((array-type? (type field)) + (getset-array-type structure funcname cast selector field)) + ((structured-type? (type field)) + (getset-structured-type structure funcname cast selector field)) + (else (error 'generate-accessors-and-mutators "Unknown: " field))))) + (fields structure))) +@| generate-accessors-and-mutators @} + +The use of \verb|canonical-name| is important. This procedure +transforms an identifier from its C syntax into a syntax acceptable to +Scheme by transforming the letters to the canonical case of the +representation. (For example, if the symbol \verb|a| prints as \verb|A| +then the canonical case of the implementation is upper case.) + +Fields of basic types get both accessors and mutators.\footnote{Fields +which are \verb|const| should not have a mutator; when we get around to +implementing general qualifiers on types, this must be fixed.} + +@d dump structs and unions +@{(define (getset-basic-type struct funcname cast selector field) + (let* ((typename (basic-type-name (type field))) + (fieldtype (c-cast-expression (type field)))) + (function-pair accessor-template + (vector typename funcname cast selector) + (string-append "_get_" funcname) + `((pointer ,(struct/union-ref struct))) + (type field)) + (function-pair mutator-template + (vector typename funcname cast selector fieldtype) + (string-append "_set_" funcname) + `((pointer ,(struct/union-ref struct)) ,(type field)) + `(void ())) + (cache-name struct (string-append "_get_" funcname)) + (cache-name struct (string-append "_set_" funcname)))) +@| getset-basic-type @} + +In the accessor and mutator templates, \verb|@@0| is the value return or +parameter type (pointers are always ``unsigned''), \verb|@@1| is the +function name, \verb|@@2| is a cast expression for the structure pointer +type, \verb|@@3| is the C field selector expression, and \verb|@@4| is +the cast expression from the parameter type to the field type (used in +mutators only). + +@d dump structs and unions +@{(define accessor-template + "@@0 _get_@@1( unsigned _p ) { return (@@0)((@@2*)_p)->@@3; }") + +(define mutator-template + "void _set_@@1( unsigned _p, @@0 _v ) { ((@@2*)_p)->@@3 = (@@4)_v; }") +@| accessor-template mutator-template @} + +Array types are just like basic types, but there is no mutator because +the array name is \verb|const|. The name of the array denotes a pointer to +the first element, so that's what we return. + +@d dump structs and unions +@{(define (getset-array-type structure funcname cast selector field) + (function-pair array-accessor-template + (vector funcname cast selector) + (string-append "_get_" funcname) + `((pointer ,(struct/union-ref structure))) + '(unsigned)) + (cache-name structure (string-append "_get_" funcname))) + +(define array-accessor-template + "unsigned _get_@@0( unsigned _p ) { return (unsigned)(((@@1*)_p)->@@2); }") +@| getset-array-type array-accessor-template @} + +Structured types are handled by adding the field name to the selector +and recurring; we ignore the distinction between struct and union here +as it doesn't matter. + +@d dump structs and unions +@{(define (getset-structured-type structure funcname cast selector field) + (let (;(selector (string-append selector "." (name field))) + ;(funcname (string-append funcname "_" (canonical-name (name field)))) + (struct (if (eq? (record-tag (type field)) 'struct-ref) + (lookup (tag (type field)) structs) + (lookup (tag (type field)) unions)))) + (generate-accessors-and-mutators struct funcname cast selector))) +@| getset-structured-type @} + +\subsubsection{Structures as values} +\label{struct-vals} + +As mentioned above, there are no provisions for using structures or +unions as values in the program, not even when they have the size of a +primitive type. The reason for this is that it is not natural for +Scheme to assign objects which are larger than a single location (and +special-casing small structures because the are small seems silly). For +example, the following function takes a structure value as an argument +(by copy, that is, by assignment): + +\begin{flushleft} \small +\begin{minipage}{\linewidth} +\begin{list}{}{} \item +\mbox{}\verb@@void f( struct X x ) { ... }@@\\ +\end{list} +\vspace{-1ex} +\end{minipage}\\[4ex] +\end{flushleft} +\vspace{-3ex} + +There is no way to call this function directly in the generated FFI for +Chez Scheme. We could fudge our way around it by generating a proxy +function which acts as a level of indirection: + +\begin{flushleft} \small +\begin{minipage}{\linewidth} +\begin{list}{}{} \item +\mbox{}\verb@@void _proxy_f( struct X *x ) { f( *x ); }@@\\ +\end{list} +\vspace{-1ex} +\end{minipage}\\[4ex] +\end{flushleft} +\vspace{-3ex} + +\noindent but I have not implemented this. If it becomes a problem it +needs to be fixed. Libraries which manipulate complex numbers +represented as structures may need it. + +Another upshot is that there is no way to ask for the field \verb|u| of +the structure defined earlier.\footnote{There is no way to ask for its +address, either, but that's easy to implement.} + +\subsection{Global Variables} + +In order to simplify things, global variables are handled by generating +a single function for each global variable; the function takes no +parameters and returns the address of the global. Technically the +following code should be finessed for arrays, since the type of a global +array is not a pointer to an array, but an array, or at the very least, +a pointer to the base type of the array. + +@d dump global variable accessors +@{(define (dump-variables) + (for-each (lambda (v) + (let ((n (canonical-name (name v)))) + (function-pair global-template + (vector n (name v)) + (string-append "_glob_" n) + '((void ())) + `(pointer ,(type v))))) + vars)) + +(define global-template + "unsigned _glob_@@0( void ) { return (unsigned)&@@1; }") +@| dump-vars global-template @} + + +\subsection{Functions} + +Supporting functions in all their generality is pretty much impossible, +and I'm not going to try. The restrictions are: + +\begin{description} + +\item[Variadic functions] are not supported. Such support can be +implemented but the resulting code is target-specific and probably +involves some assembly language. Some C compilers (like Watcom C) +provide library functions which makes the job much easier, but most +don't. + +\item[Old-style prototypes] (that is, declarations of the form +\verb|char *malloc()| where the number and types of the arguments are +not known) are hard, since the native Chez FFI requires an exact +argument count and the type for each argument. My solution is to +generate a warning for this and translate the interface as if it had no +arguments, which is almost always wrong. + +\item[Parameters of function type] work fine, but you can't pass Scheme +procedures to a C function. + +\item[Calling through function pointers] is not implemented, since it's hard to +express this in the native FFI, which requires the name of the function +in order to fetch it from a library. We can get around this by +generating a proxy function for each function pointer type in the header +file and calling the function through it by passing it the function +pointer and the arguments, essentially a trampoline. + +\end{description} + +\noindent \verb|Dump-functions| creates a Scheme-side interface for each +referenced function. + +@d dump function definitions +@{(define (dump-functions) + (for-each (lambda (f) (define-foreign (name f) (type f))) + functions)) +@| dump-functions @} + +\verb|Define-foreign| checks that every argument type and return type is +valid and attempts to give a reasonable error message if not; if everything +is OK then a Scheme definition for the foreign function is emitted.: + +@D dump function definitions +@{(define (define-foreign name type) + (let ((argtypes (arglist type)) + (returntype (rett type))) + (let loop ((l argtypes)) + (cond ((null? l) #t) + ((structured-type? (car l)) + (warn "Cannot pass structured value of type" + (rational-typename (car l)) + "to function" + name) + (set-car! l '(***invalid***)) + (loop (cdr l))) + (else + (loop (cdr l))))) + (if (structured-type? returntype) + (begin (warn "Cannot receive structured value of type" + (rational-typename returntype) + "from function" + name) + (set! returntype '(***invalid***)))) + + (write + `(define ,(string->symbol (canonical-name name)) + (foreign-function ,name + ,(chez-map-args argtypes name) + ,(chez-type returntype))) + sch-output) + (newline sch-output))) +@| define-foreign @} + +The argument list must be handled carefully to deal with functions +without prototypes and functions with variable-length parameter lists: + +@d dump function definitions +@{(define (chez-map-args args name) + (cond ((and (= (length args) 1) + (eq? (caar args) 'void)) + '()) + ((= (length args) 0) + (warn "Function without prototype assumed to take no arguments:" + name) + '()) + (else + (map (lambda (x) + (if (eq? (record-tag x) 'void) + (begin (warn "Varargs *cannot* be handled for" name) + '***invalid***) + (chez-type x))) + args)))) +@| chez-map-args @} + +\subsection{Enums} + +Enums are straightforward. There is a definition for each enum-ident: + +\begin{flushleft} \small +\begin{minipage}{\linewidth} +\begin{list}{}{} \item +\mbox{}\verb@@enum { A=100, B, C };@@\\ +\end{list} +\vspace{-1ex} +\end{minipage}\\[4ex] +\end{flushleft} +\vspace{-3ex} + +\noindent becomes + +\begin{flushleft} \small +\begin{minipage}{\linewidth} +\begin{list}{}{} \item +\mbox{}\verb@@(define a 100)@@\\ +\mbox{}\verb@@(define b 101)@@\\ +\mbox{}\verb@@(define c 102)@@\\ +\end{list} +\vspace{-1ex} +\end{minipage}\\[4ex] +\end{flushleft} +\vspace{-3ex} + +\noindent The enum's tag, should it have one, is ignored. +The code is straightforward: + +@d dump enum definitions +@{(define (dump-enums) + (for-each (lambda (x) + (display (instantiate "(define @@0 @@1)" + (vector (canonical-name (name x)) + (number->string (value x)))) + sch-output) + (newline sch-output)) + enum-idents)) +@| dump-enums @} + +\subsection{Macros} + +Macros are hard in the general case, because the general case is that +the right-hand-side names some arbitrarily complex C statement which +might even depend on variables in some scope not in effect when the +macro is defined. Handling C macros in their full generality is +therefore not an attainable goal for most targets. However, we +can still do useful things. + +If the left-hand-side is a simple identifier (no parameters) and the +right-hand-side parses as a number or a string, then we can emit a +simple definition which gives the name the value. + +Being more ambitious we can take each macro which has parameters and +whose right-hand-side is a closed expression--that is, the macro which +results from expanding all applicable macros on the right-hand-side of +the macro has no free variables--and convert it to a function. + +For now, we handle the simple case of an integer right-hand-side only. + +@d dump macro definitions +@{(define (dump-macros) + (for-each (lambda (m) + (if (and (valid-ident? (name m)) + (valid-number? (value m))) + (begin + (display `(define ,(canonical-name (name m)) + ,(evaluate-number (value m))) + sch-output) + (newline sch-output)))) + macros)) +@| dump-macros @} + +\verb|Valid-ident| and \verb|valid-number| check that their arguments +are valid C identifier and numbers, respectively. + +@d dump macro definitions +@{(define (valid-ident? s) + (andmap (lambda (c) + (or (char-upper-case? c) + (char-lower-case? c) + (char-numeric? c) + (char=? c #\_))) + (string->list s))) + +(define (valid-number? s) + (let ((n (evaluate-number s))) + n)) +@| valid-ident? valid-number? @} + +\section{Utility functions} +\label{utils} + +The procedure \verb|function-pair| generates corresponding definitions +in both languages. + +@d utility functions +@{(define (function-pair c-template template-args scheme-name arglist rett) + (display (instantiate c-template template-args) c-output) + (newline c-output) + (define-foreign scheme-name + `(function ,arglist ,rett))) +@| function-pair @} + +The C type name generated for a given basic type is very much a policy +issue; here are our encodings: + +@d utility functions +@{(define (basic-type-name type) + (let ((probe (assq (record-tag type) + '((char . "char") + (signed-char . "signed char") + (unsigned-char . "unsigned char") + (short . "short") + (unsigned-short "unsigned short") + (int . "int") + (enum . "int") + (unsigned . "unsigned") + (long . "long") + (unsigned-long . "unsigned long") + (void . "void") + (pointer . "unsigned") + (float . "float") + (double . "double") + )))) + (if probe + (cdr probe) + (begin (warn "Unknown type " type) + "***invalid***")))) +@| basic-type-name @} + +The procedure \verb|c-cast-expression| takes a type and returns a +C-syntax expression which can be used in a type cast for casting a value +to the given type. It's a hard problem and the code below does not do a +very good job; it needs to be refined considerably. See e.g.~K\&R~2nd +edition section 5.12. + +One issue is what happens when we have a structured type which does not +have a user-defined tag. There will be exactly one \verb|typedef| which +refers to the structure, and that name should be used instead. + +@d utility functions +@{(define (c-cast-expression type) + (cond ((primitive-type? type) + (basic-type-name type)) + ((pointer-type? type) + (string-append (c-cast-expression (cadr type)) "*")) + ((eq? (record-tag type) 'enum-ref) + (basic-type-name '(int ()))) + ((memq (record-tag type) '(struct-ref union-ref)) + (let ((t (tag type))) + (if (user-defined-tag? t) + (string-append (if (eq? (record-tag type) 'struct-ref) + "struct " + "union ") + t) + (let ((names (if (eq? (record-tag type) 'struct-ref) + (struct-names type) + (union-names type)))) + (if (= (length names) 1) + (car names) + (error "c-cast-expression: bad: " type)))))) + (else + (warn "c-cast-expression: Too complicated: " type) + "unknown"))) +@| c-cast-expression @} + +\verb|String-prefix=?| takes a string and a prefix and tests whether the +prefix matches the string. + +@d utility functions +@{(define (string-prefix=? s prefix) + (let ((limit (string-length prefix))) + (and (<= limit (string-length s)) + (let loop ((i 0)) + (or (= i limit) + (and (char=? (string-ref s i) (string-ref prefix i)) + (loop (+ i 1)))))))) +@| string-prefix=? @} + +\verb|Rational-typename| takes a type; if the type is a +\verb|struct-ref| or \verb|union-ref| and the tag is auto-generated, +then a type is returned where the tag is replaced by the unique +\verb|typedef|-name which uses the structure (if one can be found). This +procedure is useful for giving meaningful error messages. + +@d utility functions +@{(define (rational-typename type) + (case (record-tag type) + ((struct-ref) + (if (user-defined-tag? (tag type)) + type + (let ((t (lookup (tag type) structs))) + (if (not t) + type + (list 'struct-ref (tag t)))))) + ((union-ref) + (if (user-defined-tag? (tag type)) + type + (let ((t (lookup (tag type) unions))) + (if (not t) + type + (list 'union-ref (tag t)))))) + (else type))) +@| rational-typename @} + +\verb|Evaluate-number| takes a string and attempts to parse it as a C +number, returning the value if the parse was successful and \verb|#f| if +not. Currently only integers are handled reliably. + +@d utility functions +@{(define (evaluate-number s) + (let ((k (string->list s))) + (cond ((null? k) #f) + ((not (char-numeric? (car k))) #f) + ((char=? (car k) #\0) + (cond ((null? (cdr k)) 0) + ((or (char=? (cadr k) #\x) (char=? (cadr k) #\X)) + (string->number (list->string (cddr k)) 16)) + (else + (string->number s 8)))) + (else + (string->number s))))) +@| evaluate-number @} + +\section{Discussion} +\label{discussion} + +Clearly using a function call to access each field is not very +efficient, compared to C. But if the foreign function interface is +reasonably efficient it shouldn't be too bad. It's hard to know how +efficient it will be in Chez Scheme without some benchmarking, but a +call-out to a foreign function does not need to be much more expensive +than a call to a procedure in the same language. + +\section{Future Work on the Chez Back-end} +\label{future} + +\begin{itemize} +\item Handling name clashes, both finding them and working around them +(if necessary). +\item Dealing with qualifiers on types in general; handling \verb|const| in + particular. +\item Better generation of C \verb|typedef| casts. +\item Proper choice of names for the output files. +\item Experiment with policy choices defined in a file: for example, a + file could contain a specification of which prototypes to override + (like in the \verb|fgets| example), which file names to include or + exclude, how to name procedures on the Scheme side, and how to compute + the referenced or unreferenced sets. Since we are programming in + Scheme here, these decisions could be implemented as code in a file + which is loaded at run-time. As an example of what has been thought + of but not implemented, read the file \verb|chez-policy.sch| in the + current distribution. + + +\end{itemize} + +\section{Support libraries} +\label{stdlib} + +The file \verb|chez-stdlib.h| defines the prototypes for the C-side +standard library procedures. + +@O chez-stdlib.h +@{int _ref_int( unsigned _p, int _k ); +void _set_int( unsigned _p, int _k, int _v ); +unsigned _ref_uint( unsigned _p, int _k ); +void _set_uint( unsigned _p, int _k, unsigned _v ); +char _ref_char( unsigned _p, int _k ); +void _set_char( unsigned _p, int _k, char _v ); +double _ref_double( unsigned _p, int _k ); +void _set_double( unsigned _p, int _k, double _v ); +float _ref_float( unsigned _p, int _k ); +void _set_float( unsigned _p, int _k, float _v ); +@} + +The implementation of the library is in \verb|chez-stdlib.c|; it's +pretty obvious. + +@O chez-stdlib.c +@{#include "chez-stdlib.h" + +int _ref_int( unsigned _p, int _k ) { return ((int*)_p)[_k]; } +void _set_int( unsigned _p, int _k, int _v ) { ((int*)_p)[_k] = _v; } + +unsigned _ref_uint( unsigned _p, int _k ) { return ((unsigned*)_p)[_k]; } +void _set_uint( unsigned _p, int _k, unsigned _v ) { ((unsigned*)_p)[_k] = _v; } + +char _ref_char( unsigned _p, int _k ) { return ((char*)_p)p[_k]; } +void _set_char( unsigned _p, int _k, char _v ) { ((char*)_p)[_k] = _v; } + +double _ref_double( unsigned _p, int _k ) { return ((double*)_p)[_k]; } +void _set_double( unsigned _p, int _k, double _v ) { ((double*)_p)[_k] = _v; } + +float _ref_float( unsigned _p, int _k ) { return ((float*)_p)[_k]; } +void _set_float( unsigned _p, int _k, float _v ) { ((float*)_p)[_k] = _v; } +@} + +Finally, a Scheme file \verb|chez-stdlib.sch| defines the foreign function +interfaces to the standard library: + +@O chez-stdlib.sch +@{(define _ref_int + (foreign-function "_ref_int" (unsigned-32 integer-32) integer-32)) + +(define _set_int + (foreign-function "_set_int" (unsigned-32 integer-32 integer-32) void)) + +(define _ref_uint + (foreign-function "_ref_uint" (unsigned-32 integer-32) integer-32)) + +(define _set_uint + (foreign-function "_set_uint" (unsigned-32 integer-32 unsigned-32) void)) + +(define _ref_char + (foreign-function "_ref_char" (unsigned-32 integer-32) char)) + +(define _set_char + (foreign-function "_set_char" (unsigned-32 integer-32 char) void)) + +(define _ref_double + (foreign-function "_ref_double" (unsigned-32 integer-32) double-float)) + +(define _set_double + (foreign-function "_set_double" (unsigned-32 integer-32 double-float) void)) + +(define _ref_float + (foreign-function "_ref_float" (unsigned-32 integer-32) single-float)) + +(define _set_float + (foreign-function "_set_float" (unsigned-32 integer-32 single-float) void)) + +(define _memcpy + (let ((memcpy-*-* + (foreign-function "memcpy" (unsigned-32 unsigned-32 unsigned-32) void)) + (memcpy-string-string + (foreign-function "memcpy" (string string unsigned-32) void)) + (memcpy-string-* + (foreign-function "memcpy" (string unsigned-32 unsigned-32) void)) + (memcpy-*-string + (foreign-function "memcpy" (unsigned-32 string unsigned-32) void))) + (lambda (a b count) + (cond ((string? a) + (cond ((string? b) (memcpy-string-string a b count)) + ((integer? b) (memcpy-string-* a b count)) + (else ???))) + ((integer? a) + (cond ((string? b) (memcpy-*-string a b count)) + ((integer? b) (memcpy-*-* a b count)) + (else ???))) + (else ???))))) +@} + +\pagebreak +\section*{Index of Identifiers} + +The underlined scrap number shows the defining scrap for the identifier; +all other scrap numbers are uses. Also note that many procedures are +not defined in this file but in the target-independent part of the +back-end, in file {\tt process.sch}. + +@u + + +\end{document} + diff --git a/cpp/cpp.c b/cpp/cpp.c new file mode 100644 index 0000000..aa27beb --- /dev/null +++ b/cpp/cpp.c @@ -0,0 +1,322 @@ +#include +#include +#include +#include +#include +#include "cpp.h" + +#define OUTS 16384 +char outbuf[OUTS]; +char *outp = outbuf; +Source *cursource; +int nerrs; +struct token nltoken = { NL, 0, 0, 0, 1, (uchar*)"\n" }; +char *curtime; +int incdepth; +int ifdepth; +int ifsatisfied[NIF]; +int skipping; + +char rcsid[] = "$Revision: 1.5 $ $Date: 1994/12/01 14:48:55 $"; + +int +main(int argc, char **argv) +{ + Tokenrow tr; + time_t t; + char ebuf[BUFSIZ]; + + setbuf(stderr, ebuf); + t = time(NULL); + curtime = ctime(&t); + maketokenrow(3, &tr); + expandlex(); + setup(argc, argv); + fixlex(); + iniths(); + genline(); + process(&tr); + flushout(); + fflush(stderr); + dumpnlist( stdout ); + exit(nerrs > 0); + return 0; +} + +void +process(Tokenrow *trp) +{ + int anymacros = 0; + + for (;;) { + if (trp->tp >= trp->lp) { + trp->tp = trp->lp = trp->bp; + outp = outbuf; + anymacros |= gettokens(trp, 1); + trp->tp = trp->bp; + } + if (trp->tp->type == END) { + if (--incdepth>=0) { + if (cursource->ifdepth) + error(ERROR, + "Unterminated conditional in #include"); + unsetsource(); + cursource->line += cursource->lineinc; + trp->tp = trp->lp; + genline(); + continue; + } + if (ifdepth) + error(ERROR, "Unterminated #if/#ifdef/#ifndef"); + break; + } + if (trp->tp->type==SHARP) { + trp->tp += 1; + control(trp); + } else if (!skipping && anymacros) + expandrow(trp, NULL); + if (skipping) + setempty(trp); + puttokens(trp); + anymacros = 0; + cursource->line += cursource->lineinc; + if (cursource->lineinc>1) { + genline(); + } + } +} + +void +control(Tokenrow *trp) +{ + Nlist *np; + Token *tp; + + tp = trp->tp; + if (tp->type!=NAME) { + if (tp->type==NUMBER) + goto kline; + if (tp->type != NL) + error(ERROR, "Unidentifiable control line"); + return; /* else empty line */ + } + if ((np = lookup(tp, 0))==NULL || (np->flag&ISKW)==0 && !skipping) { + error(WARNING, "Unknown preprocessor control %t", tp); + return; + } + if (skipping) { + switch (np->val) { + case KENDIF: + if (--ifdepthifdepth; + setempty(trp); + return; + + case KIFDEF: + case KIFNDEF: + case KIF: + if (++ifdepth >= NIF) + error(FATAL, "#if too deeply nested"); + ++cursource->ifdepth; + return; + + case KELIF: + case KELSE: + if (ifdepth<=skipping) + break; + return; + + default: + return; + } + } + switch (np->val) { + case KDEFINE: + dodefine(trp); + break; + + case KUNDEF: + tp += 1; + if (tp->type!=NAME || trp->lp - trp->bp != 4) { + error(ERROR, "Syntax error in #undef"); + break; + } + if ((np = lookup(tp, 0)) != NULL) + np->flag &= ~ISDEFINED; + break; + + case KPRAGMA: + return; + + case KIFDEF: + case KIFNDEF: + case KIF: + if (++ifdepth >= NIF) + error(FATAL, "#if too deeply nested"); + ++cursource->ifdepth; + ifsatisfied[ifdepth] = 0; + if (eval(trp, np->val)) + ifsatisfied[ifdepth] = 1; + else + skipping = ifdepth; + break; + + case KELIF: + if (ifdepth==0) { + error(ERROR, "#elif with no #if"); + return; + } + if (ifsatisfied[ifdepth]==2) + error(ERROR, "#elif after #else"); + if (eval(trp, np->val)) { + if (ifsatisfied[ifdepth]) + skipping = ifdepth; + else { + skipping = 0; + ifsatisfied[ifdepth] = 1; + } + } else + skipping = ifdepth; + break; + + case KELSE: + if (ifdepth==0 || cursource->ifdepth==0) { + error(ERROR, "#else with no #if"); + return; + } + if (ifsatisfied[ifdepth]==2) + error(ERROR, "#else after #else"); + if (trp->lp - trp->bp != 3) + error(ERROR, "Syntax error in #else"); + skipping = ifsatisfied[ifdepth]? ifdepth: 0; + ifsatisfied[ifdepth] = 2; + break; + + case KENDIF: + if (ifdepth==0 || cursource->ifdepth==0) { + error(ERROR, "#endif with no #if"); + return; + } + --ifdepth; + --cursource->ifdepth; + if (trp->lp - trp->bp != 3) + error(WARNING, "Syntax error in #endif"); + break; + + case KERROR: + trp->tp = tp+1; + error(WARNING, "#error directive: %r", trp); + break; + + case KLINE: + trp->tp = tp+1; + expandrow(trp, ""); + tp = trp->bp+2; + kline: + if (tp+1>=trp->lp || tp->type!=NUMBER || tp+3lp + || (tp+3==trp->lp && ((tp+1)->type!=STRING)||*(tp+1)->t=='L')){ + error(ERROR, "Syntax error in #line"); + return; + } + cursource->line = atol((char*)tp->t)-1; + if (cursource->line<0 || cursource->line>=32768) + error(WARNING, "#line specifies number out of range"); + tp = tp+1; + if (tp+1lp) + cursource->filename=(char*)newstring(tp->t+1,tp->len-2,0); + return; + + case KDEFINED: + error(ERROR, "Bad syntax for control line"); + break; + + case KINCLUDE: + doinclude(trp); + trp->lp = trp->bp; + return; + + case KEVAL: + eval(trp, np->val); + break; + + default: + error(ERROR, "Preprocessor control `%t' not yet implemented", tp); + break; + } + setempty(trp); + return; +} + +void * +domalloc(int size) +{ + void *p = malloc(size); + + if (p==NULL) + error(FATAL, "Out of memory from malloc"); + return p; +} + +void +dofree(void *p) +{ + free(p); +} + +void +error(enum errtype type, char *string, ...) +{ + va_list ap; + char *cp, *ep; + Token *tp; + Tokenrow *trp; + Source *s; + int i; + + fprintf(stderr, "cpp: "); + for (s=cursource; s; s=s->next) + if (*s->filename) + fprintf(stderr, "%s:%d ", s->filename, s->line); + va_start(ap, string); + for (ep=string; *ep; ep++) { + if (*ep=='%') { + switch (*++ep) { + + case 's': + cp = va_arg(ap, char *); + fprintf(stderr, "%s", cp); + break; + case 'd': + i = va_arg(ap, int); + fprintf(stderr, "%d", i); + break; + case 't': + tp = va_arg(ap, Token *); + fprintf(stderr, "%.*s", tp->len, tp->t); + break; + + case 'r': + trp = va_arg(ap, Tokenrow *); + for (tp=trp->tp; tplp&&tp->type!=NL; tp++) { + if (tp>trp->tp && tp->wslen) + fputc(' ', stderr); + fprintf(stderr, "%.*s", tp->len, tp->t); + } + break; + + default: + fputc(*ep, stderr); + break; + } + } else + fputc(*ep, stderr); + } + va_end(ap); + fputc('\n', stderr); + if (type==FATAL) + exit(1); + if (type!=WARNING) + nerrs = 1; + fflush(stderr); +} diff --git a/cpp/cpp.h b/cpp/cpp.h new file mode 100644 index 0000000..ae949fe --- /dev/null +++ b/cpp/cpp.h @@ -0,0 +1,162 @@ +#define INS 32768 /* input buffer */ +#define OBS 4096 /* outbut buffer */ +#define NARG 32 /* Max number arguments to a macro */ +#define NINCLUDE 32 /* Max number of include directories (-I) */ +#define NIF 32 /* depth of nesting of #if */ +#ifndef EOF +#define EOF (-1) +#endif +#ifndef NULL +#define NULL 0 +#endif + +typedef unsigned char uchar; + +enum toktype { END, UNCLASS, NAME, NUMBER, STRING, CCON, NL, WS, DSHARP, + EQ, NEQ, LEQ, GEQ, LSH, RSH, LAND, LOR, PPLUS, MMINUS, + ARROW, SBRA, SKET, LP, RP, DOT, AND, STAR, PLUS, MINUS, + TILDE, NOT, SLASH, PCT, LT, GT, CIRC, OR, QUEST, + COLON, ASGN, COMMA, SHARP, SEMIC, CBRA, CKET, + ASPLUS, ASMINUS, ASSTAR, ASSLASH, ASPCT, ASCIRC, ASLSH, + ASRSH, ASOR, ASAND, ELLIPS, + DSHARP1, NAME1, DEFINED, UMINUS }; + +enum kwtype { KIF, KIFDEF, KIFNDEF, KELIF, KELSE, KENDIF, KINCLUDE, KDEFINE, + KUNDEF, KLINE, KERROR, KPRAGMA, KDEFINED, + KLINENO, KFILE, KDATE, KTIME, KSTDC, KEVAL }; + +#define ISDEFINED 01 /* has #defined value */ +#define ISKW 02 /* is PP keyword */ +#define ISUNCHANGE 04 /* can't be #defined in PP */ +#define ISMAC 010 /* builtin macro, e.g. __LINE__ */ + +#define EOB 0xFE /* sentinel for end of input buffer */ +#define EOFC 0xFD /* sentinel for end of input file */ +#define XPWS 1 /* token flag: white space to assure token sep. */ + +typedef struct token { + unsigned char type; + unsigned char flag; + unsigned short hideset; + unsigned int wslen; + unsigned int len; + uchar *t; +} Token; + +typedef struct tokenrow { + Token *tp; /* current one to scan */ + Token *bp; /* base (allocated value) */ + Token *lp; /* last+1 token used */ + int max; /* number allocated */ +} Tokenrow; + +typedef struct source { + char *filename; /* name of file of the source */ + int line; /* current line number */ + int lineinc; /* adjustment for \\n lines */ + uchar *inb; /* input buffer */ + uchar *inp; /* input pointer */ + uchar *inl; /* end of input */ + int fd; /* input source */ + int ifdepth; /* conditional nesting in include */ + struct source *next; /* stack for #include */ +} Source; + +typedef struct nlist { + struct nlist *next; + uchar *name; + int len; + Tokenrow *vp; /* value as macro */ + Tokenrow *ap; /* list of argument names, if any */ + char val; /* value as preprocessor name */ + char flag; /* is defined, is pp name */ + Source *source; /* file it comes from */ +} Nlist; + +typedef struct includelist { + char deleted; + char always; + char *file; +} Includelist; + +#define new(t) (t *)domalloc(sizeof(t)) +#define quicklook(a,b) (namebit[(a)&077] & (1<<((b)&037))) +#define quickset(a,b) namebit[(a)&077] |= (1<<((b)&037)) +extern unsigned long namebit[077+1]; + +enum errtype { WARNING, ERROR, FATAL }; + +void expandlex(void); +void fixlex(void); +void setup(int, char **); +int gettokens(Tokenrow *, int); +int comparetokens(Tokenrow *, Tokenrow *); +Source *setsource(char *, int, char *); +void unsetsource(void); +void puttokens(Tokenrow *); +void process(Tokenrow *); +void *domalloc(int); +void dofree(void *); +void error(enum errtype, char *, ...); +void flushout(void); +int fillbuf(Source *); +int trigraph(Source *); +int foldline(Source *); +Nlist *lookup(Token *, int); +void control(Tokenrow *); +void dodefine(Tokenrow *); +void doadefine(Tokenrow *, int); +void doinclude(Tokenrow *); +void doif(Tokenrow *, enum kwtype); +void expand(Tokenrow *, Nlist *); +void builtin(Tokenrow *, int); +int gatherargs(Tokenrow *, Tokenrow **, int *); +void substargs(Nlist *, Tokenrow *, Tokenrow **); +void expandrow(Tokenrow *, char *); +void maketokenrow(int, Tokenrow *); +Tokenrow *copytokenrow(Tokenrow *, Tokenrow *); +Token *growtokenrow(Tokenrow *); +Tokenrow *normtokenrow(Tokenrow *); +void adjustrow(Tokenrow *, int); +void movetokenrow(Tokenrow *, Tokenrow *); +void insertrow(Tokenrow *, int, Tokenrow *); +void peektokens(Tokenrow *, char *); +void doconcat(Tokenrow *); +Tokenrow *stringify(Tokenrow *); +int lookuparg(Nlist *, Token *); +long eval(Tokenrow *, int); +void genline(void); +void setempty(Tokenrow *); +void makespace(Tokenrow *); +char *outnum(char *, int); +int digit(int); +uchar *newstring(uchar *, int, int); +int checkhideset(int, Nlist *); +void prhideset(int); +int newhideset(int, Nlist *); +int unionhideset(int, int); +void iniths(void); +void setobjname(char *); +#define rowlen(tokrow) ((tokrow)->lp - (tokrow)->bp) + +extern char *outp; +extern Token nltoken; +extern Source *cursource; +extern char *curtime; +extern int incdepth; +extern int ifdepth; +extern int ifsatisfied[NIF]; +extern int Mflag; +extern int skipping; +extern int verbose; +extern int Cplusplus; +extern Nlist *kwdefined; +extern Includelist includelist[NINCLUDE]; +extern char wd[]; + +extern int creat(char *, int); +extern int open(char *, int); +extern int close(int); +extern int dup2(int, int); +extern int write(int, char *, size_t); +extern int read(int, char *, size_t); diff --git a/cpp/lex.c b/cpp/lex.c new file mode 100644 index 0000000..bba18cf --- /dev/null +++ b/cpp/lex.c @@ -0,0 +1,571 @@ +#include +#include +#include +#include "cpp.h" + +/* + * lexical FSM encoding + * when in state state, and one of the characters + * in ch arrives, enter nextstate. + * States >= S_SELF are either final, or at least require special action. + * In 'fsm' there is a line for each state X charset X nextstate. + * List chars that overwrite previous entries later (e.g. C_ALPH + * can be overridden by '_' by a later entry; and C_XX is the + * the universal set, and should always be first. + * States above S_SELF are represented in the big table as negative values. + * S_SELF and S_SELFB encode the resulting token type in the upper bits. + * These actions differ in that S_SELF doesn't have a lookahead char, + * S_SELFB does. + * + * The encoding is blown out into a big table for time-efficiency. + * Entries have + * nextstate: 6 bits; ?\ marker: 1 bit; tokentype: 9 bits. + */ + +#define MAXSTATE 32 +#define ACT(tok,act) ((tok<<7)+act) +#define QBSBIT 0100 +#define GETACT(st) (st>>7)&0x1ff + +/* character classes */ +#define C_WS 1 +#define C_ALPH 2 +#define C_NUM 3 +#define C_EOF 4 +#define C_XX 5 + +enum state { + START=0, NUM1, NUM2, NUM3, ID1, ST1, ST2, ST3, COM1, COM2, COM3, COM4, + CC1, CC2, WS1, PLUS1, MINUS1, STAR1, SLASH1, PCT1, SHARP1, + CIRC1, GT1, GT2, LT1, LT2, OR1, AND1, ASG1, NOT1, DOTS1, + S_SELF=MAXSTATE, S_SELFB, S_EOF, S_NL, S_EOFSTR, + S_STNL, S_COMNL, S_EOFCOM, S_COMMENT, S_EOB, S_WS, S_NAME +}; + +int tottok; +int tokkind[256]; +struct fsm { + int state; /* if in this state */ + uchar ch[4]; /* and see one of these characters */ + int nextstate; /* enter this state if +ve */ +}; + +/*const*/ struct fsm fsm[] = { + /* start state */ + START, { C_XX }, ACT(UNCLASS,S_SELF), + START, { ' ', '\t', '\v' }, WS1, + START, { C_NUM }, NUM1, + START, { '.' }, NUM3, + START, { C_ALPH }, ID1, + START, { 'L' }, ST1, + START, { '"' }, ST2, + START, { '\'' }, CC1, + START, { '/' }, COM1, + START, { EOFC }, S_EOF, + START, { '\n' }, S_NL, + START, { '-' }, MINUS1, + START, { '+' }, PLUS1, + START, { '<' }, LT1, + START, { '>' }, GT1, + START, { '=' }, ASG1, + START, { '!' }, NOT1, + START, { '&' }, AND1, + START, { '|' }, OR1, + START, { '#' }, SHARP1, + START, { '%' }, PCT1, + START, { '[' }, ACT(SBRA,S_SELF), + START, { ']' }, ACT(SKET,S_SELF), + START, { '(' }, ACT(LP,S_SELF), + START, { ')' }, ACT(RP,S_SELF), + START, { '*' }, STAR1, + START, { ',' }, ACT(COMMA,S_SELF), + START, { '?' }, ACT(QUEST,S_SELF), + START, { ':' }, ACT(COLON,S_SELF), + START, { ';' }, ACT(SEMIC,S_SELF), + START, { '{' }, ACT(CBRA,S_SELF), + START, { '}' }, ACT(CKET,S_SELF), + START, { '~' }, ACT(TILDE,S_SELF), + START, { '^' }, CIRC1, + + /* saw a digit */ + NUM1, { C_XX }, ACT(NUMBER,S_SELFB), + NUM1, { C_NUM, C_ALPH, '.' }, NUM1, + NUM1, { 'E', 'e' }, NUM2, + NUM1, { '_' }, ACT(NUMBER,S_SELFB), + + /* saw possible start of exponent, digits-e */ + NUM2, { C_XX }, ACT(NUMBER,S_SELFB), + NUM2, { '+', '-' }, NUM1, + NUM2, { C_NUM, C_ALPH }, NUM1, + NUM2, { '_' }, ACT(NUMBER,S_SELFB), + + /* saw a '.', which could be a number or an operator */ + NUM3, { C_XX }, ACT(DOT,S_SELFB), + NUM3, { '.' }, DOTS1, + NUM3, { C_NUM }, NUM1, + + DOTS1, { C_XX }, ACT(UNCLASS, S_SELFB), + DOTS1, { C_NUM }, NUM1, + DOTS1, { '.' }, ACT(ELLIPS, S_SELF), + + /* saw a letter or _ */ + ID1, { C_XX }, ACT(NAME,S_NAME), + ID1, { C_ALPH, C_NUM }, ID1, + + /* saw L (start of wide string?) */ + ST1, { C_XX }, ACT(NAME,S_NAME), + ST1, { C_ALPH, C_NUM }, ID1, + ST1, { '"' }, ST2, + ST1, { '\'' }, CC1, + + /* saw " beginning string */ + ST2, { C_XX }, ST2, + ST2, { '"' }, ACT(STRING, S_SELF), + ST2, { '\\' }, ST3, + ST2, { '\n' }, S_STNL, + ST2, { EOFC }, S_EOFSTR, + + /* saw \ in string */ + ST3, { C_XX }, ST2, + ST3, { '\n' }, S_STNL, + ST3, { EOFC }, S_EOFSTR, + + /* saw ' beginning character const */ + CC1, { C_XX }, CC1, + CC1, { '\'' }, ACT(CCON, S_SELF), + CC1, { '\\' }, CC2, + CC1, { '\n' }, S_STNL, + CC1, { EOFC }, S_EOFSTR, + + /* saw \ in ccon */ + CC2, { C_XX }, CC1, + CC2, { '\n' }, S_STNL, + CC2, { EOFC }, S_EOFSTR, + + /* saw /, perhaps start of comment */ + COM1, { C_XX }, ACT(SLASH, S_SELFB), + COM1, { '=' }, ACT(ASSLASH, S_SELF), + COM1, { '*' }, COM2, + COM1, { '/' }, COM4, + + /* saw "/*", start of comment */ + COM2, { C_XX }, COM2, + COM2, { '\n' }, S_COMNL, + COM2, { '*' }, COM3, + COM2, { EOFC }, S_EOFCOM, + + /* saw the * possibly ending a comment */ + COM3, { C_XX }, COM2, + COM3, { '\n' }, S_COMNL, + COM3, { '*' }, COM3, + COM3, { '/' }, S_COMMENT, + + /* // comment */ + COM4, { C_XX }, COM4, + COM4, { '\n' }, S_NL, + COM4, { EOFC }, S_EOFCOM, + + /* saw white space, eat it up */ + WS1, { C_XX }, S_WS, + WS1, { ' ', '\t', '\v' }, WS1, + + /* saw -, check --, -=, -> */ + MINUS1, { C_XX }, ACT(MINUS, S_SELFB), + MINUS1, { '-' }, ACT(MMINUS, S_SELF), + MINUS1, { '=' }, ACT(ASMINUS,S_SELF), + MINUS1, { '>' }, ACT(ARROW,S_SELF), + + /* saw +, check ++, += */ + PLUS1, { C_XX }, ACT(PLUS, S_SELFB), + PLUS1, { '+' }, ACT(PPLUS, S_SELF), + PLUS1, { '=' }, ACT(ASPLUS, S_SELF), + + /* saw <, check <<, <<=, <= */ + LT1, { C_XX }, ACT(LT, S_SELFB), + LT1, { '<' }, LT2, + LT1, { '=' }, ACT(LEQ, S_SELF), + LT2, { C_XX }, ACT(LSH, S_SELFB), + LT2, { '=' }, ACT(ASLSH, S_SELF), + + /* saw >, check >>, >>=, >= */ + GT1, { C_XX }, ACT(GT, S_SELFB), + GT1, { '>' }, GT2, + GT1, { '=' }, ACT(GEQ, S_SELF), + GT2, { C_XX }, ACT(RSH, S_SELFB), + GT2, { '=' }, ACT(ASRSH, S_SELF), + + /* = */ + ASG1, { C_XX }, ACT(ASGN, S_SELFB), + ASG1, { '=' }, ACT(EQ, S_SELF), + + /* ! */ + NOT1, { C_XX }, ACT(NOT, S_SELFB), + NOT1, { '=' }, ACT(NEQ, S_SELF), + + /* & */ + AND1, { C_XX }, ACT(AND, S_SELFB), + AND1, { '&' }, ACT(LAND, S_SELF), + AND1, { '=' }, ACT(ASAND, S_SELF), + + /* | */ + OR1, { C_XX }, ACT(OR, S_SELFB), + OR1, { '|' }, ACT(LOR, S_SELF), + OR1, { '=' }, ACT(ASOR, S_SELF), + + /* # */ + SHARP1, { C_XX }, ACT(SHARP, S_SELFB), + SHARP1, { '#' }, ACT(DSHARP, S_SELF), + + /* % */ + PCT1, { C_XX }, ACT(PCT, S_SELFB), + PCT1, { '=' }, ACT(ASPCT, S_SELF), + + /* * */ + STAR1, { C_XX }, ACT(STAR, S_SELFB), + STAR1, { '=' }, ACT(ASSTAR, S_SELF), + + /* ^ */ + CIRC1, { C_XX }, ACT(CIRC, S_SELFB), + CIRC1, { '=' }, ACT(ASCIRC, S_SELF), + + -1 +}; + +/* first index is char, second is state */ +/* increase #states to power of 2 to encourage use of shift */ +short bigfsm[256][MAXSTATE]; + +void +expandlex(void) +{ + /*const*/ struct fsm *fp; + int i, j, nstate; + + for (fp = fsm; fp->state>=0; fp++) { + for (i=0; fp->ch[i]; i++) { + nstate = fp->nextstate; + if (nstate >= S_SELF) + nstate = ~nstate; + switch (fp->ch[i]) { + + case C_XX: /* random characters */ + for (j=0; j<256; j++) + bigfsm[j][fp->state] = nstate; + continue; + case C_ALPH: + for (j=0; j<=256; j++) + if ('a'<=j&&j<='z' || 'A'<=j&&j<='Z' + || j=='_') + bigfsm[j][fp->state] = nstate; + continue; + case C_NUM: + for (j='0'; j<='9'; j++) + bigfsm[j][fp->state] = nstate; + continue; + default: + bigfsm[fp->ch[i]][fp->state] = nstate; + } + } + } + /* install special cases for ? (trigraphs), \ (splicing), runes, and EOB */ + for (i=0; i0) + bigfsm[j][i] = ~bigfsm[j][i]; + bigfsm[j][i] &= ~QBSBIT; + } + bigfsm[EOB][i] = ~S_EOB; + if (bigfsm[EOFC][i]>=0) + bigfsm[EOFC][i] = ~S_EOF; + } +} + +void +fixlex(void) +{ + /* do C++ comments? */ + if (Cplusplus==0) + bigfsm['/'][COM1] = bigfsm['x'][COM1]; +} + +/* + * fill in a row of tokens from input, terminated by NL or END + * First token is put at trp->lp. + * Reset is non-zero when the input buffer can be "rewound." + * The value is a flag indicating that possible macros have + * been seen in the row. + */ +int +gettokens(Tokenrow *trp, int reset) +{ + register int c, state, oldstate; + register uchar *ip; + register Token *tp, *maxp; + int runelen; + Source *s = cursource; + int nmac = 0; + extern char outbuf[]; + + tp = trp->lp; + ip = s->inp; + if (reset) { + s->lineinc = 0; + if (ip>=s->inl) { /* nothing in buffer */ + s->inl = s->inb; + fillbuf(s); + ip = s->inp = s->inb; + } else if (ip >= s->inb+(3*INS/4)) { + memmove(s->inb, ip, 4+s->inl-ip); + s->inl = s->inb+(s->inl-ip); + ip = s->inp = s->inb; + } + } + maxp = &trp->bp[trp->max]; + runelen = 1; + for (;;) { + continue2: + if (tp>=maxp) { + trp->lp = tp; + tp = growtokenrow(trp); + maxp = &trp->bp[trp->max]; + } + tp->type = UNCLASS; + tp->hideset = 0; + tp->t = ip; + tp->wslen = 0; + tp->flag = 0; + state = START; + for (;;) { + oldstate = state; + c = *ip; + if ((state = bigfsm[c][state]) >= 0) { + ip += runelen; + runelen = 1; + continue; + } + state = ~state; + reswitch: + switch (state&0177) { + case S_SELF: + ip += runelen; + runelen = 1; + case S_SELFB: + tp->type = GETACT(state); + tp->len = ip - tp->t; + tp++; + goto continue2; + + case S_NAME: /* like S_SELFB but with nmac check */ + tp->type = NAME; + tp->len = ip - tp->t; + nmac |= quicklook(tp->t[0], tp->len>1?tp->t[1]:0); + tp++; + goto continue2; + + case S_WS: + tp->wslen = ip - tp->t; + tp->t = ip; + state = START; + continue; + + default: + if ((state&QBSBIT)==0) { + ip += runelen; + runelen = 1; + continue; + } + state &= ~QBSBIT; + s->inp = ip; + if (c=='?') { /* check trigraph */ + if (trigraph(s)) { + state = oldstate; + continue; + } + goto reswitch; + } + if (c=='\\') { /* line-folding */ + if (foldline(s)) { + s->lineinc++; + state = oldstate; + continue; + } + goto reswitch; + } + error(WARNING, "Lexical botch in cpp"); + ip += runelen; + runelen = 1; + continue; + + case S_EOB: + s->inp = ip; + fillbuf(cursource); + state = oldstate; + continue; + + case S_EOF: + tp->type = END; + tp->len = 0; + s->inp = ip; + if (tp!=trp->bp && (tp-1)->type!=NL && cursource->fd!=-1) + error(WARNING,"No newline at end of file"); + trp->lp = tp+1; + return nmac; + + case S_STNL: + error(ERROR, "Unterminated string or char const"); + case S_NL: + tp->t = ip; + tp->type = NL; + tp->len = 1; + tp->wslen = 0; + s->lineinc++; + s->inp = ip+1; + trp->lp = tp+1; + return nmac; + + case S_EOFSTR: + error(FATAL, "EOF in string or char constant"); + break; + + case S_COMNL: + s->lineinc++; + state = COM2; + ip += runelen; + runelen = 1; + continue; + + case S_EOFCOM: + error(WARNING, "EOF inside comment"); + --ip; + case S_COMMENT: + ++ip; + tp->t = ip; + tp->t[-1] = ' '; + tp->wslen = 1; + state = START; + continue; + } + break; + } + ip += runelen; + runelen = 1; + tp->len = ip - tp->t; + tp++; + } +} + +/* have seen ?; handle the trigraph it starts (if any) else 0 */ +int +trigraph(Source *s) +{ + int c; + + while (s->inp+2 >= s->inl && fillbuf(s)!=EOF) + ; + if (s->inp[1]!='?') + return 0; + c = 0; + switch(s->inp[2]) { + case '=': + c = '#'; break; + case '(': + c = '['; break; + case '/': + c = '\\'; break; + case ')': + c = ']'; break; + case '\'': + c = '^'; break; + case '<': + c = '{'; break; + case '!': + c = '|'; break; + case '>': + c = '}'; break; + case '-': + c = '~'; break; + } + if (c) { + *s->inp = c; + memmove(s->inp+1, s->inp+3, s->inl-s->inp+2); + s->inl -= 2; + } + return c; +} + +int +foldline(Source *s) +{ + while (s->inp+1 >= s->inl && fillbuf(s)!=EOF) + ; + if (s->inp[1] == '\n') { + memmove(s->inp, s->inp+2, s->inl-s->inp+3); + s->inl -= 2; + return 1; + } + return 0; +} + +int +fillbuf(Source *s) +{ + int n; + + if (s->fd<0 || (n=read(s->fd, (char *)s->inl, INS/8)) <= 0) + n = 0; + s->inl += n; + s->inl[0] = s->inl[1]= s->inl[2]= s->inl[3] = EOB; + if (n==0) { + s->inl[0] = s->inl[1]= s->inl[2]= s->inl[3] = EOFC; + return EOF; + } + return 0; +} + +/* + * Push down to new source of characters. + * If fd>0 and str==NULL, then from a file `name'; + * if fd==-1 and str, then from the string. + */ +Source * +setsource(char *name, int fd, char *str) +{ + Source *s = new(Source); + int len; + + s->line = 1; + s->lineinc = 0; + s->fd = fd; + s->filename = name; + s->next = cursource; + s->ifdepth = 0; + cursource = s; + /* slop at right for EOB */ + if (str) { + len = strlen(str); + s->inb = domalloc(len+4); + s->inp = s->inb; + strncpy((char *)s->inp, str, len); + } else { + s->inb = domalloc(INS+4); + s->inp = s->inb; + len = 0; + } + s->inl = s->inp+len; + s->inl[0] = s->inl[1] = EOB; + return s; +} + +void +unsetsource(void) +{ + Source *s = cursource; + + if (s->fd>=0) { + close(s->fd); + dofree(s->inb); + } + cursource = s->next; + /* dofree(s); */ /* Each nlist now points to source it came from */ +} diff --git a/cpp/nlist.c b/cpp/nlist.c new file mode 100644 index 0000000..6eb5fb1 --- /dev/null +++ b/cpp/nlist.c @@ -0,0 +1,166 @@ +#include +#include +#include +#include "cpp.h" + +extern int getopt(int, char *const *, const char *); +extern char *optarg; +extern int optind; +extern int verbose; +extern int Cplusplus; +Nlist *kwdefined; +char wd[128]; + +#define NLSIZE 128 + +static Nlist *nlist[NLSIZE]; + +struct kwtab { + char *kw; + int val; + int flag; +} kwtab[] = { + "if", KIF, ISKW, + "ifdef", KIFDEF, ISKW, + "ifndef", KIFNDEF, ISKW, + "elif", KELIF, ISKW, + "else", KELSE, ISKW, + "endif", KENDIF, ISKW, + "include", KINCLUDE, ISKW, + "define", KDEFINE, ISKW, + "undef", KUNDEF, ISKW, + "line", KLINE, ISKW, + "error", KERROR, ISKW, + "pragma", KPRAGMA, ISKW, + "eval", KEVAL, ISKW, + "defined", KDEFINED, ISDEFINED+ISUNCHANGE, + "__LINE__", KLINENO, ISMAC+ISUNCHANGE, + "__FILE__", KFILE, ISMAC+ISUNCHANGE, + "__DATE__", KDATE, ISMAC+ISUNCHANGE, + "__TIME__", KTIME, ISMAC+ISUNCHANGE, + "__STDC__", KSTDC, ISUNCHANGE, + NULL +}; + +unsigned long namebit[077+1]; +Nlist *np; + +void +setup_kwtab(void) +{ + struct kwtab *kp; + Nlist *np; + Token t; + static Token deftoken[1] = {{ NAME, 0, 0, 0, 7, (uchar*)"defined" }}; + static Tokenrow deftr = { deftoken, deftoken, deftoken+1, 1 }; + + for (kp=kwtab; kp->kw; kp++) { + t.t = (uchar*)kp->kw; + t.len = strlen(kp->kw); + np = lookup(&t, 1); + np->flag = kp->flag; + np->val = kp->val; + if (np->val == KDEFINED) { + kwdefined = np; + np->val = NAME; + np->vp = &deftr; + np->ap = 0; + } + } +} + +Nlist * +lookup(Token *tp, int install) +{ + unsigned int h; + Nlist *np; + uchar *cp, *cpe; + + h = 0; + for (cp=tp->t, cpe=cp+tp->len; cpt==*np->name && tp->len==np->len + && strncmp((char*)tp->t, (char*)np->name, tp->len)==0) + return np; + np = np->next; + } + if (install) { + np = new(Nlist); + np->vp = NULL; + np->ap = NULL; + np->flag = 0; + np->val = 0; + np->len = tp->len; + np->name = newstring(tp->t, tp->len, 0); + np->next = nlist[h]; + np->source = cursource; + nlist[h] = np; + quickset(tp->t[0], tp->len>1? tp->t[1]:0); + return np; + } + return NULL; +} + +void +dumpnlist( FILE *out ) +{ + int i; + Nlist *np; + Token *tp, *lim; + void printtok( Token *, FILE * ); + + for ( i = 0 ; i < NLSIZE ; i++ ) { + np = nlist[i]; + while (np) { + if (np->flag == 1) { + fprintf( out, "#pragma macro \"%s\" %s", + (np->source ? np->source->filename : "" ), + np->name ); + if (np->ap) { + fputc( '(', out ); + tp = np->ap->tp; + lim = np->ap->lp; + while (tp < lim) { + fprintf( out, "%s", tp->t ); + if (++tp != lim) fputc( ',', out ); + } + fputc( ')', out ); + } + fputc( ' ', out ); + if (np->vp) { + tp = np->vp->tp; + lim = np->vp->lp; + while (tp < lim) { + printtok( tp, out ); + ++tp; + } + } + fputc( '\n', out ); + } + np = np->next; + } + } +} + +void +printtok( Token *t, FILE *out ) +{ + char *tbl[] = { 0, 0, 0, 0, 0, 0, "\n", " ", "##", + "==", "!=", "<=", ">=", "<<", ">>", "&&", "||", "++", "--", + "->", "[", "]", "(", ")", ".", "&", "*", "+", "-", + "~", "!", "/", "%", "<", ">", "^", "|", "?", + ":", "=", ",", "#", ";", "{", "}", + "+=", "-=", "*=", "/=", "%=", "^=", "<<=", + ">>=", "|=", "&=", "...", + "##", 0, 0, "-" }; + + if (tbl[t->type] == 0) { + if (t->len > 0) fprintf( out, "%s", t->t ); + else fprintf( out, "XXX" ); + } + else + fprintf( out, "%s", tbl[t->type] ); +} diff --git a/ffigen b/ffigen new file mode 100755 index 0000000..e6c40d7 --- /dev/null +++ b/ffigen @@ -0,0 +1,45 @@ +#!/bin/sh +# +# Copyright (C) 1996 The University of Oregon. All rights reserved. +# +# This file may be freely redistributed in its entirety with or without +# modification provided that this copyright notice is not removed. It +# may not be sold for profit or incorporated in commercial software +# products without the prior written permission of the copyright holder. + +LCCHOME=/home/users/lth/net/lcc +ARCH=sparc/solaris + +TMP=/tmp/ffitmp.$$ +DEFINES="-D__STDC__" +INCLUDES="-I$LCCHOME/include/$ARCH -I/usr/include -I." +output="" +VERBOSE=1 + +if [ $# -lt 1 ]; then + echo "Usage: $0 filename ..." + exit 1 +fi + +for i +do + case $i in + -q) VERBOSE=0 ;; + -I*) INCLUDES="$i $INCLUDES" ;; + -D*) DEFINES="$DEFINES $i" ;; +# -U*) DEFINES="$DEFINES $i" ;; # WRONG + *) output=`basename $i .h`.ffi + if [ $VERBOSE -eq 1 ]; then echo "preprocessing $i"; fi + $LCCHOME/lib/fficpp.bin $INCLUDES $DEFINES $i > $TMP + if [ $? -ne 0 ]; then echo "Aborted!"; exit; fi + if [ $VERBOSE -eq 1 ]; then echo "parsing $i"; fi + $LCCHOME/lib/ffigen.bin -target=null < $TMP > $output + if [ $? -ne 0 ]; then echo "Aborted!"; exit; fi + if [ $VERBOSE -eq 1 ]; then echo "postprocessing $i"; fi + awk '/#pragma macro/ {print "(macro " $3 " \"" $4 "\" \"" $5 "\")"}'\ + $TMP >> $output + rm -f $TMP + ;; + esac +done +exit 0 diff --git a/ffigen.c b/ffigen.c new file mode 100644 index 0000000..c70e479 --- /dev/null +++ b/ffigen.c @@ -0,0 +1,180 @@ +/* ffigen.c + * + * Written by Lars Thomas Hansen (lth@cs.uoregon.edu) + * + * Copyright 1996 The University of Oregon. + * + * These sources are freely redistributable with no restrictions whatsoever, + * except that you may not remove this copyright notice. + */ + +#include +#include +#undef NULL +#include "c.h" + +void print_type( Type t, FILE *out, int attrs ); + +void print_fields( Symbol sym, FILE *out ) +{ + Field f; + + f = sym->u.s.flist; + while (f) { + fprintf( out, "(\"%s\" ", f->name ); + print_type( f->type, out, 0 ); + fprintf( out, ")" ); + f = f->link; + if (f) fprintf( out, " " ); + } +} + +void basetype( FILE *out, char *name, int attrs ) +{ + fprintf( out, "(%s (", name ); + if (attrs == CONST) + fprintf( out, "const" ); + else if (attrs == VOLATILE) + fprintf( out, "volatile" ); + else if (attrs) + fprintf( out, "const volatile" ); + fprintf( out, "))" ); +} + +void print_type( Type t, FILE *out, int attrs ) +{ + Type *a; + + /* Handle special cases */ + if (t == chartype) basetype( out, "char", attrs ); + else if (t == doubletype) basetype( out, "double", attrs ); + else if (t == floattype) basetype( out, "float", attrs ); + else if (t == inttype) basetype( out, "int", attrs ); + else if (t == longdouble) basetype( out, "long-double", attrs ); + else if (t == longtype) basetype( out, "long", attrs ); + else if (t == shorttype) basetype( out, "short", attrs ); + else if (t == signedchar) basetype( out, "signed-char", attrs ); + else if (t == unsignedchar) basetype( out, "unsigned-char", attrs ); + else if (t == unsignedlong) basetype( out, "unsigned-long", attrs ); + else if (t == unsignedshort) basetype( out, "unsigned-short", attrs ); + else if (t == unsignedtype) basetype( out, "unsigned", attrs ); + else if (t == voidtype) basetype( out, "void", attrs ); + + switch (t->op) { + case CHAR : case SHORT : case INT : case UNSIGNED : + case LONG : case FLOAT : case DOUBLE : case VOID : + break; + case ARRAY : + fprintf( out, "(array %d ", t->size/t->type->size ); + print_type( t->type, out, attrs ); + fputc( ')', out ); + break; + case ENUM : + fprintf( out, "(enum-ref \"%s\")", t->u.sym->name ); + break; + case STRUCT : + fprintf( out, "(struct-ref \"%s\")", t->u.sym->name ); + break; + case UNION : + fprintf( out, "(union-ref \"%s\")", t->u.sym->name ); + break; + case POINTER : + fprintf( out, "(pointer " ); + print_type( t->type, out, 0 ); + fprintf( out, ")" ); + break; + case FUNCTION : + fprintf( out, "(function (" ); + a = t->u.f.proto; + if (a) + while (*a) { + print_type( *a, out, 0 ); + if (*++a) fprintf( out, " " ); + } + fprintf( out, ") " ); + print_type( t->type, out, 0 ); + fprintf( out, ")" ); + break; + case CONST : + case VOLATILE : + case CONST+VOLATILE : + print_type( t->type, out, t->op ); + break; + } +} + +void print_global( Symbol s, void *args ) +{ + FILE *out = (FILE*)args; + char *class; + + class = "var"; + if (s->sclass == TYPEDEF) + class = "type"; + else if ((s->sclass == STATIC || s->sclass == EXTERN || s->sclass == AUTO) && + (s->type->op == FUNCTION)) + class = "function"; +/* if (s->type && s->type->op == FUNCTION) printf( "%d\n", s->sclass ); */ + else if (s->sclass == ENUM) + class = "enum-ident"; + + fprintf( out, "(%s \"%s\" \"%s\" ", + class, (s->src.file ? s->src.file : ""), s->name ); + if (s->sclass == ENUM) + fprintf( out, "%d", s->u.value ); + else { + fprintf( out, "\n\t" ); + print_type( s->type, out, 0 ); + } + if (strcmp( class, "type" ) != 0) + switch (s->sclass) { + case STATIC : fprintf( out, " (static)" ); break; + case EXTERN : fprintf( out, " (extern)" ); break; + default : fprintf( out, " ()" ); break; + } + fprintf( out, ")\n", out ); +} + +void print_tag( Symbol s, void *args ) +{ + FILE *out = (FILE*)args; + char *fn; + Symbol *p; + + if (!s->type) return; + fn = (s->src.file ? s->src.file : ""); + if (s->type->op == UNION) + fprintf( out, "(union \"%s\" \"%s\"", fn, s->name ); + else if (s->type->op == STRUCT) + fprintf( out, "(struct \"%s\" \"%s\"", fn, s->name ); + else if (s->type->op == ENUM) { + /* FIXME: print tags and values. */ + fprintf( out, "(enum \"%s\" \"%s\" (", fn, s->name ); + for ( p = s->u.idlist ; *p ; p++ ) + fprintf( out, "(\"%s\" %d)", (*p)->name, (*p)->u.value ); + fprintf( out, "))\n" ); + return; + } + else + return; + fprintf( out, "\n\t(" ); + print_fields( s, out ); + fprintf( out, "))\n" ); +} + +void do_ffigen() +{ + FILE *fp; + +#if 0 + if ((fp = fopen( "SYMBOLS", "w" )) == 0) + error( "can't open SYMBOLS" ); +#else + fp = stdout; +#endif + foreach( globals, GLOBAL, print_global, (void*)fp ); + fflush( fp ); + foreach( types, GLOBAL, print_tag, (void*)fp ); + fclose( fp ); +} + diff --git a/manifesto.ps b/manifesto.ps new file mode 100644 index 0000000..6e463a5 --- /dev/null +++ b/manifesto.ps @@ -0,0 +1,1218 @@ +%!PS-Adobe-2.0 +%%Creator: dvips 5.55 Copyright 1986, 1994 Radical Eye Software +%%Title: manifesto.dvi +%%CreationDate: Wed Feb 7 10:18:32 1996 +%%Pages: 4 +%%PageOrder: Ascend +%%BoundingBox: 0 0 612 792 +%%EndComments +%DVIPSCommandLine: dvips manifesto.dvi +%DVIPSParameters: dpi=300, comments removed +%DVIPSSource: TeX output 1996.02.07:1016 +%%BeginProcSet: tex.pro +/TeXDict 250 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N +/X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72 +mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1} +ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale +isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div +hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul +TR[matrix currentmatrix{dup dup round sub abs 0.00001 lt{round}if} +forall round exch round exch]setmatrix}N /@landscape{/isls true N}B +/@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B +/FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{ +/nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N +string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N +end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{ +/sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0] +N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data dup +length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{ +128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub +get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data +dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N +/rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup +/base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx +0 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff +setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff +.1 sub]{ch-image}imagemask restore}B /D{/cc X dup type /stringtype ne{]} +if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup +length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{ +cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin +0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul +add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore showpage +userdict /eop-hook known{eop-hook}if}N /@start{userdict /start-hook +known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X +/IE 256 array N 0 1 255{IE S 1 string dup 0 3 index put cvn put}for +65781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N /RMat[1 0 0 -1 0 +0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley X /rulex X V}B /V +{}B /RV statusdict begin /product where{pop product dup length 7 ge{0 7 +getinterval dup(Display)eq exch 0 4 getinterval(NeXT)eq or}{pop false} +ifelse}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale rulex ruley false +RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR rulex ruley scale 1 1 +false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave newpath transform +round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg +rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail +{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M} +B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3 M}B /k{ +4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{ +p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p +a}B /bos{/SS save N}B /eos{SS restore}B end +%%EndProcSet +TeXDict begin 40258431 52099146 1000 300 300 +(/nfs/research/paraducks3/lth/ffi/lcc/manifesto.dvi) +@start /Fa 35 118 df<0180038006000C0018003800300070007000E000E000E000E0 +00E000E000E000700070003000380018000C0006000380018009197B9612>40 +D<80C06030181C0C0E0E070707070707070E0E0C1C183060C08008197C9612>I<070007 +000700E738FFF87FF01FC01FC07FF0FFF8E7380700070007000D0E7E9012>I<60F0F060 +0404798312>46 D<060006000E001E00FE00EE000E000E000E000E000E000E000E000E00 +0E000E000E000E00FFE0FFE00B147D9312>49 D<0F803FC070E0E070E038E03840380038 +0030007000E000C00180030006000C00183830387FF87FF80D147E9312>I<0FE03FF078 +38701C201C001C0038007807E007F00038001C000E000E400EE00EE01C78383FF00FC00F +147F9312>I<7FF07FF07000700070007000700070007F807FE06070007000384038E038 +E038E07070E03FC01F000D147E9312>53 D<01F007F80E1C181C381C70007000E7C0EFF0 +F838F01CE00EE00EE00E700E700E301C38381FF007C00F147F9312>II<07C01FF03C78783C701C701C701C38380FE007C03C78701CE00EE00EE00E +E00E701C783C1FF00FE00F147F9312>I<07C01FF038387018E01CE00CE00EE00E701E38 +3E1FEE0FCE000E001C001C7018703870F03FC00F800F147F9312>I<0038007801F003E0 +0F801F003C00F800F000F8003C001F000F8003E001F0007800380D117E9212>60 +D<4000E000F0007C003E000F8007C001E000F8007800F801E007C00F803E007C00F000E0 +0040000D137E9312>62 D<03E007F01E18381C30FC71FE739EE30EE70EE70EE70EE70EE3 +0C739C71F830F038001E0E07FE03F80F147F9312>64 D69 +DI73 D<0FF80FF800E000E000E000E0 +00E000E000E000E000E000E000E000E000E040E0E0E0E1C07F803F000D147E9312>I76 D<3F807FC070E0207000700FF03FF07870E070E070E07070F03F +FE1F3E0F0E7E8D12>97 DI<07F01FF8383870106000E000E000 +E000E0006000703838381FF007E00D0E7E8D12>I<00F800F8003800380038003807B81F +F8387870386038E038E038E038E0386038707838781FFE0FBE0F147F9312>I<07801FE0 +387070706038E038FFF8FFF8E0006000703838381FF007C00D0E7E8D12>I<007E00FF01 +C70382038003807FFEFFFE03800380038003800380038003800380038003803FF83FF810 +14809312>I<0F9E1FFF38E7707070707070707038E03FC03F8070003FE03FF83FFC701E +E00EE00EE00E600C783C1FF00FE010167F8D12>II<06000F00 +0F000600000000000000FF00FF000700070007000700070007000700070007000700FFF0 +FFF00C157D9412>I109 DI +112 D<1FF03FF06070C070E0007F003FE00FF000786018E018F030FFE0DFC00D0E7E8D12 +>115 D<06000E000E000E007FF8FFF80E000E000E000E000E000E000E000E380E380E38 +07F003C00D127F9112>II E /Fb 3 52 df<0C003C00CC000C000C000C000C000C000C000C +000C000C000C000C000C00FF8009107E8F0F>49 D<1F00618040C08060C0600060006000 +C00180030006000C00102020207FC0FFC00B107F8F0F>I<1F00218060C060C000C00080 +01800F00008000400060C060C060804060801F000B107F8F0F>I +E /Fc 3 52 df<0C001C00EC000C000C000C000C000C000C000C000C000C000C000C000C +000C000C000C00FFC00A137D9211>49 D<1F0060C06060F070F030603000700070006000 +C001C00180020004000810101020207FE0FFE00C137E9211>I<0FC03070703870387038 +0038003000E00FC0007000380018001C601CF01CF018E03860701FC00E137F9211>I +E /Fd 46 122 df<60C0F1E0F1E070E01020102020402040408040800B0A7F9612>34 +D<60F0F070101020204040040A7D830A>44 DI<60F0F0600404 +7D830A>I<07C018303018701C600C600CE00EE00EE00EE00EE00EE00EE00EE00EE00E60 +0C600C701C30181C7007C00F157F9412>48 D<0F8030E040708030C038E0384038003800 +700070006000C00180030006000C08080810183FF07FF0FFF00D157E9412>50 +D<0FE030306018701C701C001C00180038006007E000300018000C000E000EE00EE00EC0 +0C401830300FE00F157F9412>I<00300030007000F001F0017002700470087018701070 +20704070C070FFFE0070007000700070007003FE0F157F9412>I<01F00608080C181C30 +1C70006000E000E3E0EC30F018F00CE00EE00EE00E600E600E300C3018183007C00F157F +9412>54 D<07C0183030186018E00CE00CE00EE00EE00E601E301E186E0F8E000E000C00 +1C70187018603020C01F800F157F9412>57 D<001000003800003800003800005C00005C +00005C00008E00008E00008E0001070001070003078002038002038007FFC00401C00401 +C00800E00800E01800E03800F0FE03FE17177F961A>65 DI<00FC100383300E00 +B01C0070380030300030700010600010E00010E00000E00000E00000E00000E00000E000 +106000107000103000203800201C00400E008003830000FC0014177E9619>II< +FFFFE01C00E01C00601C00201C00101C00101C00101C04001C04001C04001C0C001FFC00 +1C0C001C04001C04081C04081C00081C00181C00101C00101C00301C00F0FFFFF015177F +9618>I78 D<00FC000303000E01C01C00E0380070300030700038600018E0001C +E0001CE0001CE0001CE0001CE0001CE0001C7000387000383000303800701C00E00E01C0 +03030000FC0016177E961B>II82 D<0FC4302C601C400CC004C004C004 +E00070007F003FE00FF801FC001C000E0006800680068006C004E008D81087E00F177E96 +14>I<7FFFF8603818403808403808803804803804803804003800003800003800003800 +00380000380000380000380000380000380000380000380000380000380000380007FFC0 +16177F9619>II<204020404080408081008100E1C0F1E0F1E060C00B0A7B9612> +92 D<1FC0386038301038003803F81E3830387038E039E039E07970FF1F1E100E7F8D12> +97 DI<07F01838303870106000E000E000E000E000600070083008183007C00D +0E7F8D10>I<007E00000E00000E00000E00000E00000E00000E00000E00000E0007CE00 +1C3E00300E00700E00600E00E00E00E00E00E00E00E00E00600E00700E00301E00182E00 +07CFC012177F9614>I<0FC0186030307038E018FFF8E000E000E0006000700830101830 +07C00D0E7F8D10>I<03E006700E701C201C001C001C001C001C00FF801C001C001C001C +001C001C001C001C001C001C001C001C00FF800C1780960B>I<0F9E18E3306070707070 +7070306018C02F80200060003FE03FF83FFC600EC006C006C006600C38380FE010157F8D +12>II<183C3C1800000000007C1C1C1C1C1C1C1C1C1C1C1C1CFF081780960A>I< +0300078007800300000000000000000000001F8003800380038003800380038003800380 +03800380038003800380038003804380E300E7007C00091D82960B>IIIII<07C018303018600C600CE00EE00EE00EE00E +E00E701C3018183007C00F0E7F8D12>II114 D<1F4060C0C040C040E000FF007F801FC001E080608060C0 +60E0C09F000B0E7F8D0E>I<080008000800180018003800FF8038003800380038003800 +3800380038403840384038401C800F000A147F930E>II< +FE1F3C0E3C0C1C081C080E100E100720072003C003C003C001800180100E7F8D13>II121 D E /Fe +1 4 df<0C000C008C40EDC07F800C007F80EDC08C400C000C000A0B7D8B10>3 +D E /Ff 35 123 df<183C3C3C0404080810204080060C779C0D>39 +D45 D<00C06000FFC001FF8001FE00010000010000020000 +020000020000020000047800058C00060600040600080600000700000700000600000E00 +000E00700E00700C00E01C0080180080380040300040600021C0001F0000131D7C9B15> +53 D<01FFFE00003C0780003803C0003801C0003801C0003801C0007001C0007003C000 +7003C00070078000E0070000E00E0000E03C0000FFF80001C01C0001C00E0001C00F0001 +C00F0003800F0003800F0003800F0003800F0007001E0007001C0007003C00070078000E +01E000FFFF80001A1C7D9B1D>66 D<0003F020001E0C60003002E000E003C001C001C003 +8001C0070000C00E0000801E0000801C0000803C0000803C000000780000007800000078 +000000F0000000F0000000F0000000F0000000F0000400F0000400F0000400F000080070 +0008007000100038002000180040000C0180000706000001F800001B1E7A9C1E>I<01FF +FFE0003C00E0003800600038004000380040003800400070004000700040007020400070 +200000E0400000E0400000E0C00000FFC00001C0800001C0800001C0800001C080000381 +0100038001000380020003800200070004000700040007000C00070018000E007800FFFF +F0001B1C7D9B1C>69 D<01FFFFC0003C01C0003800C00038008000380080003800800070 +008000700080007020800070200000E0400000E0400000E0C00000FFC00001C0800001C0 +800001C0800001C080000381000003800000038000000380000007000000070000000700 +0000070000000F000000FFF000001A1C7D9B1B>I<0003F020001E0C60003002E000E003 +C001C001C0038001C0070000C00E0000801E0000801C0000803C0000803C000000780000 +007800000078000000F0000000F0000000F001FFC0F0001E00F0001C00F0001C00F0001C +00F0001C00700038007000380038003800180078000C0090000707100001F800001B1E7A +9C20>I<01FFC0003C0000380000380000380000380000700000700000700000700000E0 +0000E00000E00000E00001C00001C00001C00001C0000380000380000380000380000700 +000700000700000700000F0000FFE000121C7E9B10>73 D<01FE0007F8003E000780002E +000F00002E001700002E001700002E002700004E002E00004E004E00004E004E00004E00 +8E00008E011C00008E011C00008E021C00008E021C000107043800010704380001070838 +0001071038000207107000020720700002072070000207407000040740E000040780E000 +040700E0000C0700E0001C0601E000FF861FFC00251C7D9B25>77 +D<01FC03FE001C0070003C0060002E0040002E0040002E00400047008000470080004700 +80004380800083810000838100008181000081C1000101C2000101C2000100E2000100E2 +000200E4000200740002007400020074000400380004003800040038000C0018001C0010 +00FF8010001F1C7D9B1F>I<000F8400304C00403C008018010018030018030018060010 +06001006000007000007000003E00003FC0001FF00007F800007C00001C00001C00000C0 +0000C02000C02000C0600180600180600300600200F00400CC180083E000161E7D9C17> +83 D<7FF0FF800F001C000E0018000E0010000E0010000E0010001C0020001C0020001C +0020001C0020003800400038004000380040003800400070008000700080007000800070 +008000E0010000E0010000E0010000E0020000E0020000E0040000E00400006008000030 +300000104000000F800000191D779B1F>85 DI<03CC +063C0C3C181C3838303870387038E070E070E070E070E0E2C0E2C0E261E462643C380F12 +7B9115>97 D<3F00070007000E000E000E000E001C001C001C001C0039C03E6038303830 +7038703870387038E070E070E070E060E0E0C0C0C1C0618063003C000D1D7B9C13>I<01 +F007080C08181C3838300070007000E000E000E000E000E000E008E010602030C01F000E +127B9113>I<001F80000380000380000700000700000700000700000E00000E00000E00 +000E0003DC00063C000C3C00181C00383800303800703800703800E07000E07000E07000 +E07000E0E200C0E200C0E20061E4006264003C3800111D7B9C15>I<01E007100C101808 +3810701070607F80E000E000E000E000E000E0086010602030C01F000D127B9113>I<00 +03C0000670000C70001C60001C00001C0000380000380000380000380000380003FF8000 +700000700000700000700000700000E00000E00000E00000E00000E00001C00001C00001 +C00001C00001C000038000038000038000030000030000070000C60000E60000CC000078 +00001425819C0D>I<00F3018F030F06070E0E0C0E1C0E1C0E381C381C381C381C383830 +383038187818F00F700070007000E000E0C0C0E1C0C3007E00101A7D9113>I<0FC00001 +C00001C0000380000380000380000380000700000700000700000700000E78000E8C000F +0E000E0E001C0E001C0E001C0E001C0E00381C00381C00381C0038380070388070388070 +7080707100E03200601C00111D7D9C15>I<018003800100000000000000000000000000 +00001C002600470047008E008E000E001C001C001C003800380071007100710072007200 +3C00091C7C9B0D>I<0FC00001C00001C000038000038000038000038000070000070000 +0700000700000E0F000E11000E23800E43801C83001C80001D00001E00003F800039C000 +38E00038E00070E20070E20070E20070E400E06400603800111D7D9C13>107 +D<1F800380038007000700070007000E000E000E000E001C001C001C001C003800380038 +0038007000700070007000E400E400E400E40068003800091D7C9C0B>I<3C1E07802663 +18C04683A0E04703C0E08E0380E08E0380E00E0380E00E0380E01C0701C01C0701C01C07 +01C01C070380380E0388380E0388380E0708380E0710701C0320300C01C01D127C9122> +I<3C3C002646004687004707008E07008E07000E07000E07001C0E001C0E001C0E001C1C +00381C40381C40383840383880701900300E0012127C9117>I<01E007180C0C180C380C +300E700E700EE01CE01CE01CE018E038E030E06060C031801E000F127B9115>I<078700 +04D98008E0C008E0C011C0E011C0E001C0E001C0E00381C00381C00381C0038180070380 +0703000707000706000E8C000E70000E00000E00001C00001C00001C00001C00003C0000 +FF8000131A7F9115>I<3C3C26C2468747078E068E000E000E001C001C001C001C003800 +3800380038007000300010127C9112>114 D<01F006080C080C1C18181C001F001FC00F +F007F0007800386030E030C030806060C01F000E127D9111>I<00C001C001C001C00380 +038003800380FFE00700070007000E000E000E000E001C001C001C001C00384038403840 +388019000E000B1A7D990E>I<1E0300270700470700470700870E00870E000E0E000E0E +001C1C001C1C001C1C001C1C003838803838801838801839001C5900078E0011127C9116 +>I<1E03270747074707870E870E0E0E0E0E1C1C1C1C1C1C1C1C38383838183818381C70 +07F00070007000E0E0C0E1C0818047003C00101A7C9114>121 D<038207C20FEC083810 +08001000200040008001000200040008081008383067F043E081C00F127D9111>I +E /Fg 45 120 df +34 D<00E001E0038007000E001C001C0038003800700070007000E000E000E000E000E0 +00E000E000E000E000700070007000380038001C001C000E000700038001E000E00B217A +9C16>40 DI<01C00001C00001C00001C00071C700F9CF807FFF001FFC0007F00007F000 +1FFC007FFF00F9CF8071C70001C00001C00001C00001C00011127E9516>I<387C7E7E3E +0E1E1C78F060070B798416>44 DI<70F8F8F87005 +05788416>I<000180000380000380000700000700000E00000E00001C00001C00003800 +00380000700000700000E00000E00001C00001C0000380000380000700000700000E0000 +0E00001C00001C0000380000380000700000700000E00000E00000C0000011207E9C16> +I<07E0001FF8003FFC00783E00E00700F00780F003806003800003800003800007000007 +00000E00001C0000380000700000E00001C0000380000F00001E03803803807FFF80FFFF +807FFF8011197E9816>50 D<07E0001FF8003FFC00781E00780700300700000700000700 +000E00003E0007FC0007F00007FC00001E00000700000300000380000380600380F00380 +E00700781E003FFC001FF80007E00011197E9816>I<70F8F8F870000000000000000070 +F8F8F8700512789116>58 D<000180000780001F80003E0000F80001F00007C0000F8000 +3E0000FC0000F00000FC00003E00000F800007C00001F00000F800003E00001F80000780 +00018011157E9616>60 D62 D<00E00001F00001F00001B00001B00003B80003B80003B8000318 +00071C00071C00071C00071C00071C000E0E000E0E000FFE000FFE001FFF001C07001C07 +001C07007F1FC0FF1FE07F1FC013197F9816>65 D<7FFFC0FFFFC07FFFC01C01C01C01C0 +1C01C01C01C01C00001C00001C1C001C1C001FFC001FFC001FFC001C1C001C1C001C0000 +1C00E01C00E01C00E01C00E01C00E07FFFE0FFFFE07FFFE013197F9816>69 +DI<7F1FC0FFBFE07F1FC01C07001C07001C07001C07001C07001C +07001C07001FFF001FFF001FFF001C07001C07001C07001C07001C07001C07001C07001C +07001C07007F1FC0FFBFE07F1FC013197F9816>72 DI76 D<7E1FC0FF3FE07F1FC01D07001D87001D8700 +1D87001DC7001DC7001CC7001CC7001CE7001CE7001CE7001C67001C67001C77001C7700 +1C37001C37001C37001C17007F1F00FF9F007F0F0013197F9816>78 +D<7FE000FFF8007FFC001C1E001C0F001C07001C07001C07001C07001C0F001C1E001FFC +001FF8001FFC001C1C001C0E001C0E001C0E001C0E001C0E201C0E701C0E707F07E0FF87 +E07F03C014197F9816>82 D<07E3001FFF003FFF00781F00F00700E00700E00700E00000 +F000007800003F80001FF00007FC0000FE00000F00000700000380000380600380E00380 +E00700F80F00FFFE00FFFC00C7F00011197E9816>I<7FFFE0FFFFE0FFFFE0E0E0E0E0E0 +E0E0E0E0E0E0E000E00000E00000E00000E00000E00000E00000E00000E00000E00000E0 +0000E00000E00000E00000E00000E00007FC000FFE0007FC0013197F9816>I<7F07F0FF +8FF87F07F01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C +01C01C01C01C01C01C01C01C01C01C01C00E03800E038007070007FF0003FE0000F80015 +19809816>I<7F1F807F3F807F1F800E1E000E1C00073C0007380003B80003F00001F000 +01E00000E00001E00001F00003F00003B80007B800071C00071C000E0E000E0E001C0700 +7F1FC0FF1FE07F1FC013197F9816>88 D<1FE0003FF0007FF800783C00300E00000E0000 +0E0003FE001FFE003E0E00700E00E00E00E00E00E00E00783E007FFFE03FE7E00F83E013 +127E9116>97 D<7E0000FE00007E00000E00000E00000E00000E00000E3E000EFF000FFF +800F83C00F00E00E00E00E00700E00700E00700E00700E00700E00700E00E00F01E00F83 +C00FFF800EFF00063C001419809816>I<03F80FFC1FFE3C1E780C7000E000E000E000E0 +00E000F000700778073E0E1FFC0FF803F010127D9116>I<003F00007F00003F00000700 +00070000070000070003C7000FF7001FFF003C1F00780F00700700E00700E00700E00700 +E00700E00700E00700700F00700F003C1F001FFFE00FE7F007C7E014197F9816>I<03E0 +0FF81FFC3C1E780E7007E007FFFFFFFFFFFFE000E000700778073C0F1FFE0FFC03F01012 +7D9116>I<001F00007F8000FF8001E78001C30001C00001C0007FFF00FFFF00FFFF0001 +C00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C0003F +FE007FFF003FFE0011197F9816>I<03E3C007F7E00FFFE01C1CC0380E00380E00380E00 +380E00380E001C1C000FF8001FF0001BE0003800001800001FFC001FFF003FFF807803C0 +E000E0E000E0E000E0E000E07001C07C07C03FFF800FFE0003F800131C7F9116>I<7E00 +00FE00007E00000E00000E00000E00000E00000E3C000EFE000FFF000F87800F03800E03 +800E03800E03800E03800E03800E03800E03800E03800E03800E03807FC7F0FFE7F87FC7 +F01519809816>I<018003C003C0018000000000000000007FC07FC07FC001C001C001C0 +01C001C001C001C001C001C001C001C001C07FFFFFFF7FFF101A7D9916>I<7E0000FE00 +007E00000E00000E00000E00000E00000E7FE00E7FE00E7FE00E0F000E1E000E3C000E78 +000EF0000FF0000FF8000FBC000F1E000E0E000E07000E07807F87F0FFCFF07F87F01419 +809816>107 DII<7E3C00FEFE007FFF000F87800F03800E03800E03800E03800E03800E0380 +0E03800E03800E03800E03800E03807FC7F0FFE7F87FC7F01512809116>I<03E0000FF8 +001FFC003C1E00780F00700700E00380E00380E00380E00380E00380F00780700700780F +003C1E001FFC000FF80003E00011127E9116>I<7E3E00FEFF007FFF800F83C00F00E00E +00E00E00700E00700E00700E00700E00700E00700E00E00F01E00F83C00FFF800EFF000E +3C000E00000E00000E00000E00000E00000E00007FC000FFE0007FC000141B809116>I< +FF0FC0FF3FE0FF7FE007F04007C000078000078000070000070000070000070000070000 +070000070000070000FFFC00FFFC00FFFC0013127F9116>114 D<0FEC3FFC7FFCF03CE0 +1CE01C70007F801FF007F8003C600EE00EF00EF81EFFFCFFF8C7E00F127D9116>I<0300 +000700000700000700000700007FFF00FFFF00FFFF000700000700000700000700000700 +0007000007000007010007038007038007038007870003FE0001FC0000F80011177F9616 +>I<7E1F80FE3F807E1F800E03800E03800E03800E03800E03800E03800E03800E03800E +03800E03800E03800E0F800FFFF007FBF803E3F01512809116>I119 D E /Fh 70 124 df<007E1F0001C1B1800303 +E3C00703C3C00E03C1800E01C0000E01C0000E01C0000E01C0000E01C0000E01C000FFFF +FC000E01C0000E01C0000E01C0000E01C0000E01C0000E01C0000E01C0000E01C0000E01 +C0000E01C0000E01C0000E01C0000E01C0000E01C0000E01C0000E01C0007F87FC001A1D +809C18>11 D<007E0001C1800301800703C00E03C00E01800E00000E00000E00000E0000 +0E0000FFFFC00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C0 +0E01C00E01C00E01C00E01C00E01C00E01C07F87F8151D809C17>I<003F07E00001C09C +18000380F018000701F03C000E01E03C000E00E018000E00E000000E00E000000E00E000 +000E00E000000E00E00000FFFFFFFC000E00E01C000E00E01C000E00E01C000E00E01C00 +0E00E01C000E00E01C000E00E01C000E00E01C000E00E01C000E00E01C000E00E01C000E +00E01C000E00E01C000E00E01C000E00E01C000E00E01C007FC7FCFF80211D809C23>14 +D<6060F0F0F8F86868080808080808101010102020404080800D0C7F9C15>34 +D<0F0000C0188000C030600380703807006027FB00E0100600E0100C00E0100C00E01018 +00E0101800E0103000E0106000602060007020C00030418000188180000F0303C0000606 +2000060C10000C1C08001818080018380400303804006038040060380400C0380400C038 +04018038040300180803001C0806000C100C000620040003C01E217E9E23>37 +D<60F0F8680808081010204080050C7C9C0C>39 D<004000800100020006000C000C0018 +001800300030007000600060006000E000E000E000E000E000E000E000E000E000E000E0 +00E000600060006000700030003000180018000C000C00060002000100008000400A2A7D +9E10>I<800040002000100018000C000C000600060003000300038001800180018001C0 +01C001C001C001C001C001C001C001C001C001C001C00180018001800380030003000600 +06000C000C00180010002000400080000A2A7E9E10>I<00060000000600000006000000 +060000000600000006000000060000000600000006000000060000000600000006000000 +060000FFFFFFE0FFFFFFE000060000000600000006000000060000000600000006000000 +0600000006000000060000000600000006000000060000000600001B1C7E9720>43 +D<60F0F0701010101020204080040C7C830C>II<60F0F0600404 +7C830C>I<030007003F00C7000700070007000700070007000700070007000700070007 +0007000700070007000700070007000700070007000F80FFF80D1C7C9B15>49 +D<07C01830201C400C400EF00FF80FF807F8077007000F000E000E001C001C0038007000 +6000C00180030006010C01180110023FFE7FFEFFFE101C7E9B15>I<07E01830201C201C +781E780E781E381E001C001C00180030006007E00030001C001C000E000F000F700FF80F +F80FF80FF00E401C201C183007E0101D7E9B15>I<000C00000C00001C00003C00003C00 +005C0000DC00009C00011C00031C00021C00041C000C1C00081C00101C00301C00201C00 +401C00C01C00FFFFC0001C00001C00001C00001C00001C00001C00001C0001FFC0121C7F +9B15>I<300C3FF83FF03FC020002000200020002000200023E024302818301C200E000E +000F000F000F600FF00FF00FF00F800E401E401C2038187007C0101D7E9B15>I<400000 +7FFF807FFF007FFF00400200800400800400800800001000001000002000006000004000 +00C00000C00001C000018000018000038000038000038000038000078000078000078000 +078000078000078000030000111D7E9B15>55 D<60F0F0600000000000000000000060F0 +F06004127C910C>58 D<60F0F0600000000000000000000060F0F0701010101020204080 +041A7C910C>I<0FE03038401CE00EF00EF00EF00E000C001C0030006000C00080018001 +00010001000100010001000000000000000000000003000780078003000F1D7E9C14>63 +D<000600000006000000060000000F0000000F0000000F00000017800000178000001780 +000023C0000023C0000023C0000041E0000041E0000041E0000080F0000080F0000180F8 +000100780001FFF80003007C0002003C0002003C0006003E0004001E0004001E000C001F +001E001F00FF80FFF01C1D7F9C1F>65 DI< +001F808000E0618001801980070007800E0003801C0003801C0001803800018078000080 +7800008070000080F0000000F0000000F0000000F0000000F0000000F0000000F0000000 +F0000000700000807800008078000080380000801C0001001C0001000E00020007000400 +0180080000E03000001FC000191E7E9C1E>IIII<001F8080 +00E0618001801980070007800E0003801C0003801C000180380001807800008078000080 +70000080F0000000F0000000F0000000F0000000F0000000F0000000F000FFF0F0000F80 +700007807800078078000780380007801C0007801C0007800E00078007000B8001801180 +00E06080001F80001C1E7E9C21>III75 +DIII<003F +800000E0E0000380380007001C000E000E001C0007003C00078038000380780003C07800 +03C0700001C0F00001E0F00001E0F00001E0F00001E0F00001E0F00001E0F00001E0F000 +01E0700001C0780003C0780003C0380003803C0007801C0007000E000E0007001C000380 +380000E0E000003F80001B1E7E9C20>II< +FFFF00000F01E0000F0078000F003C000F001C000F001E000F001E000F001E000F001E00 +0F001C000F003C000F0078000F01E0000FFF00000F03C0000F00E0000F00F0000F007800 +0F0078000F0078000F0078000F0078000F0078000F0078100F0078100F0038100F003C20 +FFF01C20000007C01C1D7E9B1F>82 D<07E0801C1980300580700380600180E00180E000 +80E00080E00080F00000F800007C00007FC0003FF8001FFE0007FF0000FF80000F800007 +C00003C00001C08001C08001C08001C0C00180C00180E00300D00200CC0C0083F800121E +7E9C17>I<7FFFFFC0700F01C0600F00C0400F0040400F0040C00F0020800F0020800F00 +20800F0020000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F00 +00000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F00 +00001F800003FFFC001B1C7F9B1E>II87 D<7FF0FFC00FC03E000780180003C0180003E0100001E0200001F0600000F04000 +00788000007D8000003D0000001E0000001F0000000F0000000F8000000F80000013C000 +0023E0000021E0000041F00000C0F8000080780001007C0003003C0002001E0006001F00 +1F003F80FFC0FFF01C1C7F9B1F>I<08081010202040404040808080808080B0B0F8F878 +7830300D0C7A9C15>92 D<1FC000307000783800781C00301C00001C00001C0001FC000F +1C00381C00701C00601C00E01C40E01C40E01C40603C40304E801F870012127E9115>97 +DI<07E00C301878307870306000E0 +00E000E000E000E000E00060007004300418080C3007C00E127E9112>I<003F00000700 +00070000070000070000070000070000070000070000070000070003E7000C1700180F00 +300700700700600700E00700E00700E00700E00700E00700E00700600700700700300700 +180F000C370007C7E0131D7E9C17>I<03E00C301818300C700E6006E006FFFEE000E000 +E000E00060007002300218040C1803E00F127F9112>I<00F8018C071E061E0E0C0E000E +000E000E000E000E00FFE00E000E000E000E000E000E000E000E000E000E000E000E000E +000E000E000E007FE00F1D809C0D>I<00038003C4C00C38C01C3880181800381C00381C +00381C00381C001818001C38000C300013C0001000003000001800001FF8001FFF001FFF +803003806001C0C000C0C000C0C000C06001803003001C0E0007F800121C7F9215>II<18003C003C00180000000000000000 +00000000000000FC001C001C001C001C001C001C001C001C001C001C001C001C001C001C +001C001C00FF80091D7F9C0C>I<00C001E001E000C00000000000000000000000000000 +0FE000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E0 +00E000E000E060E0F0C0F1C061803E000B25839C0D>IIIII<03F0000E1C00180600300300700380600180E001 +C0E001C0E001C0E001C0E001C0E001C06001807003803003001806000E1C0003F0001212 +7F9115>II<03C1000C3300180B00300F00700700700700 +E00700E00700E00700E00700E00700E00700600700700700300F00180F000C370007C700 +000700000700000700000700000700000700000700003FE0131A7E9116>II<1F9030704030C010C010E010F8007F803FE00FF000F880388018C018C018E010D060 +8FC00D127F9110>I<04000400040004000C000C001C003C00FFE01C001C001C001C001C +001C001C001C001C001C101C101C101C101C100C100E2003C00C1A7F9910>IIII<7F8FF00F03800F030007020003840001C80001 +D80000F00000700000780000F800009C00010E00020E000607000403801E07C0FF0FF815 +12809116>II<7FFC70386038407040F040E041C003C003 +8007000F040E041C043C0C380870087038FFF80E127F9112>II +E /Fi 33 122 df<000E00001E00007E0007FE00FFFE00FFFE00F8FE0000FE0000FE0000 +FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000 +FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000 +FE0000FE0000FE007FFFFE7FFFFE7FFFFE17277BA622>49 D<00FF800003FFF0000FFFFC +001F03FE003800FF007C007F80FE003FC0FF003FC0FF003FE0FF001FE0FF001FE07E001F +E03C003FE000003FE000003FC000003FC000007F8000007F000000FE000000FC000001F8 +000003F0000003E00000078000000F0000001E0000003C00E0007000E000E000E001C001 +C0038001C0070001C00FFFFFC01FFFFFC03FFFFFC07FFFFFC0FFFFFF80FFFFFF80FFFFFF +801B277DA622>I<007F800003FFF00007FFFC000F81FE001F00FF003F80FF003F807F80 +3F807F803F807F801F807F800F007F800000FF000000FF000000FE000001FC000001F800 +0007F00000FFC00000FFF0000001FC0000007E0000007F0000007F8000003FC000003FC0 +00003FE000003FE03C003FE07E003FE0FF003FE0FF003FE0FF003FC0FF007FC07E007F80 +7C007F003F01FE001FFFFC0007FFF00000FF80001B277DA622>I<00000E0000001E0000 +003E0000007E000000FE000000FE000001FE000003FE0000077E00000E7E00000E7E0000 +1C7E0000387E0000707E0000E07E0000E07E0001C07E0003807E0007007E000E007E000E +007E001C007E0038007E0070007E00E0007E00FFFFFFF8FFFFFFF8FFFFFFF80000FE0000 +00FE000000FE000000FE000000FE000000FE000000FE000000FE00007FFFF8007FFFF800 +7FFFF81D277EA622>I<000003800000000007C00000000007C0000000000FE000000000 +0FE0000000000FE0000000001FF0000000001FF0000000003FF8000000003FF800000000 +3FF80000000073FC0000000073FC00000000F3FE00000000E1FE00000000E1FE00000001 +C0FF00000001C0FF00000003C0FF80000003807F80000007807FC0000007003FC0000007 +003FC000000E003FE000000E001FE000001E001FF000001C000FF000001FFFFFF000003F +FFFFF800003FFFFFF80000780007FC0000700003FC0000700003FC0000E00001FE0000E0 +0001FE0001E00001FF0001C00000FF0001C00000FF00FFFE001FFFFEFFFE001FFFFEFFFE +001FFFFE2F297EA834>65 D69 DI<00007FE003000003FFFC0700001FFFFF0F00003FF00FFF0000FF8001FF0001 +FE0000FF0003F800003F0007F000003F000FF000001F001FE000000F001FE000000F003F +C000000F003FC0000007007FC0000007007F80000007007F8000000000FF8000000000FF +8000000000FF8000000000FF8000000000FF8000000000FF8000000000FF8000000000FF +8000000000FF8001FFFFF87F8001FFFFF87F8001FFFFF87FC00000FF003FC00000FF003F +C00000FF001FE00000FF001FE00000FF000FF00000FF0007F00000FF0003F80000FF0001 +FE0000FF0000FF8001FF00003FF007BF00001FFFFF1F000003FFFE0F0000007FF003002D +297CA836>I73 +D77 DI82 D<007F806003FFF0E007FFF9E00F807FE01F001FE0 +3E0007E07C0003E07C0001E0FC0001E0FC0001E0FC0000E0FE0000E0FE0000E0FF000000 +FFC000007FFE00007FFFE0003FFFFC001FFFFE000FFFFF8007FFFFC003FFFFE000FFFFE0 +0007FFF000007FF000000FF8000007F8000003F8600001F8E00001F8E00001F8E00001F8 +F00001F0F00001F0F80003F0FC0003E0FF0007C0FFE01F80F3FFFF00E0FFFE00C01FF000 +1D297CA826>I<7FFFFFFFFFC07FFFFFFFFFC07FFFFFFFFFC07F803FC03FC07E003FC007 +C078003FC003C078003FC003C070003FC001C0F0003FC001E0F0003FC001E0E0003FC000 +E0E0003FC000E0E0003FC000E0E0003FC000E0E0003FC000E000003FC0000000003FC000 +0000003FC0000000003FC0000000003FC0000000003FC0000000003FC0000000003FC000 +0000003FC0000000003FC0000000003FC0000000003FC0000000003FC0000000003FC000 +0000003FC0000000003FC0000000003FC0000000003FC0000000003FC0000000003FC000 +0000003FC0000000003FC00000007FFFFFE000007FFFFFE000007FFFFFE0002B287EA730 +>I87 D<01FF800007FFF0000F81F8001FC07E001F +C07E001FC03F000F803F8007003F8000003F8000003F8000003F80000FFF8000FFFF8007 +FC3F800FE03F803F803F803F003F807F003F80FE003F80FE003F80FE003F80FE003F807E +007F807F00DF803F839FFC0FFF0FFC01FC03FC1E1B7E9A21>97 D<001FF80000FFFE0003 +F01F0007E03F800FC03F801F803F803F801F007F800E007F0000007F000000FF000000FF +000000FF000000FF000000FF000000FF000000FF0000007F0000007F0000007F8000003F +8001C01F8001C00FC0038007E0070003F01E0000FFFC00001FE0001A1B7E9A1F>99 +D<00003FF80000003FF80000003FF800000003F800000003F800000003F800000003F800 +000003F800000003F800000003F800000003F800000003F800000003F800000003F80000 +0003F800001FE3F80000FFFBF80003F03FF80007E00FF8000FC007F8001F8003F8003F80 +03F8007F0003F8007F0003F8007F0003F800FF0003F800FF0003F800FF0003F800FF0003 +F800FF0003F800FF0003F800FF0003F8007F0003F8007F0003F8007F0003F8003F8003F8 +001F8003F8000F8007F80007C00FF80003F03BFF8000FFF3FF80003FC3FF80212A7EA926 +>I<003FE00001FFF80003F07E0007C01F000F801F801F800F803F800FC07F000FC07F00 +07C07F0007E0FF0007E0FF0007E0FFFFFFE0FFFFFFE0FF000000FF000000FF0000007F00 +00007F0000007F0000003F8000E01F8000E00FC001C007E0038003F81F0000FFFE00001F +F0001B1B7E9A20>I<0007F0003FFC00FE3E01F87F03F87F03F07F07F07F07F03E07F000 +07F00007F00007F00007F00007F00007F000FFFFC0FFFFC0FFFFC007F00007F00007F000 +07F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F000 +07F00007F00007F00007F00007F00007F0007FFF807FFF807FFF80182A7EA915>I<00FF +81F003FFE7F80FC1FE7C1F80FC7C1F007C383F007E107F007F007F007F007F007F007F00 +7F007F007F007F007F003F007E001F007C001F80FC000FC1F8001FFFE00018FF80003800 +0000380000003C0000003E0000003FFFF8001FFFFF001FFFFF800FFFFFC007FFFFE01FFF +FFF03E0007F07C0001F8F80000F8F80000F8F80000F8F80000F87C0001F03C0001E01F00 +07C00FC01F8003FFFE00007FF0001E287E9A22>II<07000F801FC03FE03FE03FE01FC0 +0F8007000000000000000000000000000000FFE0FFE0FFE00FE00FE00FE00FE00FE00FE0 +0FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE0FFFEFFFEFFFE +0F2B7DAA14>I107 DII +I<003FE00001FFFC0003F07E000FC01F801F800FC03F800FE03F0007E07F0007F07F0007 +F07F0007F0FF0007F8FF0007F8FF0007F8FF0007F8FF0007F8FF0007F8FF0007F8FF0007 +F87F0007F07F0007F03F800FE03F800FE01F800FC00FC01F8007F07F0001FFFC00003FE0 +001D1B7E9A22>I114 D<03FE300FFFF01E03F038 +00F0700070F00070F00070F80070FC0000FFE0007FFE007FFF803FFFE01FFFF007FFF800 +FFF80003FC0000FC60007CE0003CF0003CF00038F80038FC0070FF01E0F7FFC0C1FF0016 +1B7E9A1B>I<00700000700000700000700000F00000F00000F00001F00003F00003F000 +07F0001FFFF0FFFFF0FFFFF007F00007F00007F00007F00007F00007F00007F00007F000 +07F00007F00007F00007F00007F00007F03807F03807F03807F03807F03807F03803F038 +03F87001F86000FFC0001F8015267FA51B>I119 D121 +D E /Fj 36 122 df<00FC000182000703000607000E02000E00000E00000E00000E0000 +0E0000FFFF000E07000E07000E07000E07000E07000E07000E07000E07000E07000E0700 +0E07000E07000E07000E07007F0FE0131A809915>12 D<00800100020004000C00080018 +003000300030006000600060006000E000E000E000E000E000E000E000E000E000E00060 +00600060006000300030003000180008000C00040002000100008009267D9B0F>40 +D<8000400020001000180008000C00060006000600030003000300030003800380038003 +8003800380038003800380038003000300030003000600060006000C0008001800100020 +004000800009267E9B0F>I<60F0F07010101020204080040B7D830B>44 +DI<60F0F06004047D830B>I<003F0201C0C603002E0E001E1C00 +0E1C0006380006780002700002700002F00000F00000F00000F00000F00000F000007000 +027000027800023800041C00041C00080E000803003001C0C0003F00171A7E991C>67 +D69 DI<003F020001C0C600 +03002E000E001E001C000E001C00060038000600780002007000020070000200F0000000 +F0000000F0000000F0000000F0000000F001FFC070000E0070000E0078000E0038000E00 +1C000E001C000E000E000E000300160001C06600003F82001A1A7E991E>I73 D78 +D<007F000001C1C000070070000E0038001C001C003C001E0038000E0078000F00700007 +00F0000780F0000780F0000780F0000780F0000780F0000780F0000780F000078078000F +0078000F0038000E003C001E001C001C000E0038000700700001C1C000007F0000191A7E +991E>I<3F8070C070E020700070007007F01C7030707070E070E071E071E0F171FB1E3C +10107E8F13>97 DI<07F80C1C381C30087000E000E000E0 +00E000E000E0007000300438080C1807E00E107F8F11>I<007E00000E00000E00000E00 +000E00000E00000E00000E00000E00000E0003CE000C3E00380E00300E00700E00E00E00 +E00E00E00E00E00E00E00E00E00E00600E00700E00381E001C2E0007CFC0121A7F9915> +I<07C01C3030187018600CE00CFFFCE000E000E000E0006000300438080C1807E00E107F +8F11>I<01F0031807380E100E000E000E000E000E000E00FFC00E000E000E000E000E00 +0E000E000E000E000E000E000E000E000E007FE00D1A80990C>I<0FCE18733030703870 +3870387038303018602FC02000600070003FF03FFC1FFE600FC003C003C003C003600638 +1C07E010187F8F13>II<18003C003C0018000000000000 +00000000000000FC001C001C001C001C001C001C001C001C001C001C001C001C001C001C +00FF80091A80990A>I108 +DI< +FCF8001D0C001E0E001E0E001C0E001C0E001C0E001C0E001C0E001C0E001C0E001C0E00 +1C0E001C0E001C0E00FF9FC012107F8F15>I<07E01C38300C700E6006E007E007E007E0 +07E007E0076006700E381C1C3807E010107F8F13>II<03C2000C2600381E0030 +0E00700E00E00E00E00E00E00E00E00E00E00E00E00E00700E00700E00381E001C2E0007 +CE00000E00000E00000E00000E00000E00000E00007FC012177F8F14>II<1F2060 +E04020C020C020F0007F003FC01FE000F080708030C030C020F0408F800C107F8F0F>I< +0400040004000C000C001C003C00FFC01C001C001C001C001C001C001C001C001C201C20 +1C201C201C200E4003800B177F960F>II< +FF1F803C06001C04001C04001E0C000E08000E080007100007100007900003A00003A000 +01C00001C00001C00000800011107F8F14>II +II E /Fk 7 117 df<00030000000780000007800000078000000FC000000FC000 +001BE000001BE000001BE0000031F0000031F0000060F8000060F80000E0FC0000C07C00 +00C07C0001803E0001FFFE0003FFFF0003001F0003001F0006000F8006000F800E000FC0 +FFC07FFCFFC07FFC1E1A7F9921>65 D<0FF0001C3C003E1E003E0E003E0F001C0F00000F +0000FF000FCF003E0F007C0F00F80F00F80F00F80F00F817007C27E01FC3E013117F9015 +>97 DI<03FC000F0E001C1F003C1F00781F00780E00F800 +00F80000F80000F80000F800007800007800003C01801C03000F060003FC0011117F9014 +>I114 D<1FB020704030C030C030F000FF807FE03FF807F8003CC00CC00CE0 +0CE008F830CFE00E117F9011>I<06000600060006000E000E001E003FF0FFF01E001E00 +1E001E001E001E001E001E001E181E181E181E181E180F3003E00D187F9711>I +E /Fl 14 118 df<3078FCFC7830060676851A>46 D<003E0001FF8003FFC007C1E00F00 +E01E0F703C3FF0387FF07070F870E07870E078E1C038E1C038E1C038E1C038E1C038E1C0 +38E1C038E1C03870E07070E0707070E0387FE03C3FC01E0F000F003807C0F803FFF001FF +E0003F00151E7E9D1A>64 D<00FF8003FFC00FFFE01F01E03C00C0780000700000700000 +E00000E00000E00000E00000E000007000007000007800703C00701F01F00FFFE003FFC0 +00FE0014157D941A>99 D<001FC0001FC0001FC00001C00001C00001C00001C00001C000 +01C001F1C007FDC00FFFC01E0FC03C07C07803C07001C0E001C0E001C0E001C0E001C0E0 +01C0E001C0E001C07003C07003C03807C03E0FC01FFFFC07FDFC01F1FC161E7E9D1A>I< +01F80007FF000FFF801E07C03C01C07800E07000E0E00070E00070FFFFF0FFFFF0FFFFF0 +E000007000007000007800703C00701F01F00FFFE003FFC000FE0014157D941A>I<01F8 +7C07FFFE0FFFFE1E078C1C03803801C03801C03801C03801C03801C01C03801E07801FFF +001FFE0039F8003800003800001C00001FFF801FFFE03FFFF878007C70001CE0000EE000 +0EE0000EE0000E70001C78003C3E00F81FFFF007FFC001FF0017217F941A>103 +DI108 D110 D<01F00007FC001FFF003E0F803C07807803C070 +01C0E000E0E000E0E000E0E000E0E000E0E000E0F001E07001C07803C03C07803E0F801F +FF0007FC0001F00013157D941A>I<7F83F0FF8FF87FBFFC03FC3C03F01803E00003C000 +03C0000380000380000380000380000380000380000380000380000380000380007FFF00 +FFFF007FFF0016157E941A>114 D<07FB801FFF807FFF80780780E00380E00380E00380 +7800007FC0003FFC0007FE00003F800007806001C0E001C0E001C0F003C0FC0780FFFF00 +EFFE00E3F80012157C941A>I<00C00001C00001C00001C00001C00001C00001C0007FFF +E0FFFFE0FFFFE001C00001C00001C00001C00001C00001C00001C00001C00001C00001C0 +0001C07001C07001C07001C07000E0E000FFE0007FC0001F00141C7F9B1A>II +E /Fm 19 122 df<70F8FCFC7404040404080810102040060F7C840E>44 +D<008003800F80F380038003800380038003800380038003800380038003800380038003 +80038003800380038003800380038003800380038003800380038007C0FFFE0F217CA018 +>49 D<007E0001C1000300800601C00E03C01C03C0180180380000380000780000700000 +700000F0F800F30C00F40600F40300F80380F801C0F001C0F001E0F001E0F001E0F001E0 +F001E07001E07001E07001E03801C03801C01803801C03000C0600070C0001F00013227E +A018>54 D<01F000060C000C0600180700380380700380700380F001C0F001C0F001C0F0 +01E0F001E0F001E0F001E0F001E07001E07003E03803E01805E00C05E00619E003E1E000 +01C00001C00001C0000380000380300300780700780600700C002018001030000FC00013 +227EA018>57 D70 D72 D76 D<7FFFFFF87807807860078018400780084007800840078008C007800C80 +078004800780048007800480078004000780000007800000078000000780000007800000 +078000000780000007800000078000000780000007800000078000000780000007800000 +078000000780000007800000078000000780000007800000078000000FC00003FFFF001E +227EA123>84 D<0FE0001838003C0C003C0E0018070000070000070000070000FF0007C7 +001E07003C0700780700700700F00708F00708F00708F00F087817083C23900FC1E01515 +7E9418>97 D<0E0000FE00001E00000E00000E00000E00000E00000E00000E00000E0000 +0E00000E00000E00000E00000E1F000E61C00E80600F00300E00380E003C0E001C0E001E +0E001E0E001E0E001E0E001E0E001E0E001E0E001C0E003C0E00380F00700C80600C41C0 +083F0017237FA21B>I<01FC000707000C03801C01C03801C07801E07000E0F000E0FFFF +E0F00000F00000F00000F00000F000007000007800203800201C00400E008007030000FC +0013157F9416>101 D<0E0000FE00001E00000E00000E00000E00000E00000E00000E00 +000E00000E00000E00000E00000E00000E1F800E60C00E80E00F00700F00700E00700E00 +700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00 +700E0070FFE7FF18237FA21B>104 D<0E1FC07F00FE60E183801E807201C00F003C00E0 +0F003C00E00E003800E00E003800E00E003800E00E003800E00E003800E00E003800E00E +003800E00E003800E00E003800E00E003800E00E003800E00E003800E00E003800E00E00 +3800E00E003800E0FFE3FF8FFE27157F942A>109 D<0E1F80FE60C01E80E00F00700F00 +700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00 +700E00700E00700E0070FFE7FF18157F941B>I<01FC000707000C01801800C03800E070 +0070700070F00078F00078F00078F00078F00078F00078F000787000707800F03800E01C +01C00E038007070001FC0015157F9418>I<0E3CFE461E8F0F0F0F060F000E000E000E00 +0E000E000E000E000E000E000E000E000E000E000F00FFF010157F9413>114 +D<0F8830786018C018C008C008E008F0007F803FE00FF001F8003C801C800C800CC00CC0 +08E018D0308FC00E157E9413>I<0E0070FE07F01E00F00E00700E00700E00700E00700E +00700E00700E00700E00700E00700E00700E00700E00700E00700E00F00E00F006017003 +827800FC7F18157F941B>117 D121 D E /Fn 1 4 df<00C00000C00000C00000C00000C000C0C0C0F0C3C038 +C7000EDC0003F00000C00003F0000EDC0038C700F0C3C0C0C0C000C00000C00000C00000 +C00000C00012157D9619>3 D E /Fo 19 120 df69 DI<00001FE000800000FFFC01800007 +F00F0180000F80018380003E0000C38000780000278000F00000178001E000000F8003C0 +00000F800780000007800780000003800F00000003801F00000001801E00000001803E00 +000001803C00000001803C00000000807C00000000807C0000000080780000000000F800 +00000000F80000000000F80000000000F80000000000F80000000000F80000000000F800 +00000000F80000000000F80000000000F80000000000F800000FFFFC7800000FFFFC7C00 +00001FC07C0000000F803C0000000F803C0000000F803E0000000F801E0000000F801F00 +00000F800F0000000F80078000000F8007C000000F8003C000000F8001E000000F8000F0 +00001780007C00001780003E00006380000F8000C3800007F00781800000FFFE00800000 +1FF000002E337CB134>I73 D77 DI<00003FC000000001C038 +00000007000E0000001C0003800000380001C00000F00000F00001E00000780003C00000 +3C00038000001C00078000001E000F0000000F000F0000000F001E00000007801E000000 +07803C00000003C03C00000003C07C00000003E07C00000003E07800000001E078000000 +01E0F800000001F0F800000001F0F800000001F0F800000001F0F800000001F0F8000000 +01F0F800000001F0F800000001F0F800000001F0F800000001F0F800000001F07C000000 +03E07C00000003E07C00000003E07C00000003E03C00000003C03E00000007C01E000000 +07801E00000007800F0000000F000F0000000F00078000001E0003C000003C0003C00000 +3C0001E00000780000F00000F00000380001C000001C000380000007000E00000001E078 +000000003FC000002C337CB134>I<00FE00000303C0000C00E00010007000100038003C +003C003E001C003E001E003E001E0008001E0000001E0000001E0000001E00000FFE0000 +FC1E0003E01E000F801E001F001E003E001E003C001E007C001E00F8001E04F8001E04F8 +001E04F8003E04F8003E0478003E047C005E043E008F080F0307F003FC03E01E1F7D9E21 +>97 D<000001E000003FE000003FE0000003E0000001E0000001E0000001E0000001E000 +0001E0000001E0000001E0000001E0000001E0000001E0000001E0000001E0000001E000 +0001E0000001E0001F81E000F061E001C019E0078005E00F0003E00E0003E01E0001E03C +0001E03C0001E07C0001E0780001E0F80001E0F80001E0F80001E0F80001E0F80001E0F8 +0001E0F80001E0F80001E0F80001E0780001E0780001E03C0001E03C0001E01C0001E01E +0003E00E0005E0070009E0038011F000E061FF003F81FF20327DB125>100 +D<003F800000E0E0000380380007003C000E001E001E001E001C000F003C000F007C000F +0078000F8078000780F8000780F8000780FFFFFF80F8000000F8000000F8000000F80000 +00F8000000F8000000780000007C0000003C0000003C0000801E0000800E0001000F0002 +000780020001C00C0000F03000001FC000191F7E9E1D>I<0007E0001C1000383800707C +00E07C01E07C01C03803C00003C00003C00003C00003C00003C00003C00003C00003C000 +03C00003C00003C000FFFFC0FFFFC003C00003C00003C00003C00003C00003C00003C000 +03C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C000 +03C00003C00003C00003C00003C00003C00003C00007E0007FFF007FFF0016327FB114> +I<0F001F801F801F801F800F000000000000000000000000000000000000000000000007 +80FF80FF800F800780078007800780078007800780078007800780078007800780078007 +800780078007800780078007800780078007800FC0FFF8FFF80D307EAF12>105 +D<0780FE0000FF83078000FF8C03C0000F9001E00007A001E00007A000F00007C000F000 +07C000F000078000F000078000F000078000F000078000F000078000F000078000F00007 +8000F000078000F000078000F000078000F000078000F000078000F000078000F0000780 +00F000078000F000078000F000078000F000078000F000078000F000078000F0000FC001 +F800FFFC1FFF80FFFC1FFF80211F7E9E25>110 D<001FC00000F0780001C01C00070007 +000F0007801E0003C01C0001C03C0001E03C0001E0780000F0780000F0780000F0F80000 +F8F80000F8F80000F8F80000F8F80000F8F80000F8F80000F8F80000F8780000F07C0001 +F03C0001E03C0001E01E0003C01E0003C00F00078007800F0001C01C0000F07800001FC0 +001D1F7E9E21>I<0783E0FF8C18FF907C0F907C07A07C07C03807C00007C00007C00007 +800007800007800007800007800007800007800007800007800007800007800007800007 +80000780000780000780000780000780000780000FC000FFFE00FFFE00161F7E9E19> +114 D<01FC100E03301800F0300070600030E00030E00010E00010E00010F00010F80000 +7E00003FF0001FFF000FFFC003FFE0003FF00001F80000F880003C80003C80001CC0001C +C0001CE0001CE00018F00038F00030CC0060C301C080FE00161F7E9E1A>I<0040000040 +0000400000400000400000C00000C00000C00001C00001C00003C00007C0000FC0001FFF +E0FFFFE003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C0 +0003C00003C00003C00003C00003C00003C01003C01003C01003C01003C01003C01003C0 +1003C01001C02001E02000E0400078C0001F00142C7FAB19>I118 DI E end +%%EndProlog +%%BeginSetup +%%Feature: *Resolution 300dpi +TeXDict begin + +%%EndSetup +%%Page: 1 1 +1 0 bop 560 482 a Fo(FFIGEN)22 b(Manifesto)f(and)g(Ov)n(erview)1538 +455 y Fn(\003)823 602 y Fm(Lars)c(Thomas)f(Hansen)818 +660 y Fl(lth@cs.uore)o(gon)o(.e)o(du)869 758 y Fm(F)l(ebruary)g(6,)g +(1996)964 904 y Fk(Abstract)423 966 y Fj(FFIGEN)c(\(F)m(oreign)h(F)m +(unction)h(In)o(terface)f(GENerator\))f(is)h(a)f(program)i(suite)f +(whic)o(h)g(fa-)365 1012 y(cilitates)g(the)e(writing)i(of)d +(translators)j(from)d(C)h(header)h(\014les)g(to)e(foreign)i(function)h +(in)o(terfaces)365 1058 y(for)g(particular)i(language)g(implemen)o +(tation)q(s.)423 1103 y(On)g(a)f(more)h(general)h(lev)o(el,)g(FFIGEN)f +(is)g(a)g(statemen)o(t)g(ab)q(out)g(ho)o(w)g(suc)o(h)g(translators)365 +1149 y(should)f(b)q(e)f(structured)g(for)f(maxim)o(um)h(usabilit)o(y)n +(,)h(namely)g(as)e(a)g(single)i(translator)g(from)e(C)365 +1195 y(to)h(a)g(rational)i(in)o(termediate)h(language)f(and)e(as)h(m)o +(ultiple)h(translators)g(from)e(the)g(in)o(terme-)365 +1240 y(diate)i(language)h(to)e(separate)h(FFI)f(translations.)23 +b(In)14 b(the)g(presen)o(t)h(do)q(cumen)o(t)g(I)f(motiv)n(ate)365 +1286 y(this)19 b(t)o(w)o(o-lev)o(el)h(structure)f(b)o(y)f(arguing)j +(that)d(the)g(man)o(y)h(p)q(olicy)i(questions)f(inheren)o(t)g(in)365 +1332 y(c)o(ho)q(osing)e(a)f(mapping)h(from)e(one)h(language)h(to)e +(another)h(cannot)g(b)q(e)g(accomo)q(dated)g(in)h(a)365 +1377 y(single)c(translator,)f(and)g(that)f(the)g(t)o(w)o(o-lev)o(el)h +(structure)g(promotes)f(signi\014can)o(t)j(co)q(de)d(reuse.)365 +1423 y(Companion)j(do)q(cumen)o(ts)f(presen)o(t)g(the)f(program)h +(suite)g(itself.)262 1560 y Fi(1)69 b(Manifesto)262 1651 +y Fh(Man)o(y)14 b(language)g(implemen)o(tations)e(ha)o(v)o(e)j(mec)o +(hanisms)e(whic)o(h)i(pro)o(vide)g(supp)q(ort)h(for)f(call-outs)262 +1701 y(to)h(other,)h(t)o(ypically)d(more)i(primitiv)o(e,)e(languages.) +24 b(In)17 b(particular,)f(implem)o(en)o(tations)e(of)h(v)o(ery-)262 +1750 y(high-lev)o(el)i(languages)h(lik)o(e)g(Sc)o(heme,)h(Commo)o(n)d +(Lisp,)j(Standard)f(ML,)g(and)h(Hask)o(ell)f(supp)q(ort)262 +1800 y(call-outs)11 b(to)h(system-lev)o(el)g(languages,)g(t)o(ypically) +f(C.)g(Other)j(examples)d(include)i(the)g(supp)q(ort)g(for)262 +1850 y(call-outs)g(to)h(C)g(and)f(assem)o(bly)g(language)g(in)h(C++,)g +(the)h(EXTRINSIC)f(directiv)o(e)g(in)g(HPF,)g(and)262 +1900 y(the)k Fg(<*EXTERNAL*>)d Fh(pragma)g(in)i(DEC)h(SR)o(C)f(Mo)q +(dula-3.)28 b(Mec)o(hanisms)17 b(to)g(call-out)f(to)i(other)262 +1950 y(languages)g(are)g(t)o(ypically)g(called)g Ff(for)n(eign)h +(function)g(interfac)n(es)f Fh(\(FFIs\).)33 b(The)19 +b(purp)q(ose)h(of)e(an)262 2000 y(FFI)d(is)g(often)g(to)g(gain)g +(access)i(to)e(functionalit)o(y)f(whic)o(h)h(is)g(not)g(\(e\016cien)o +(tly\))g(expressible)i(in)e(the)262 2049 y(language)c(itself;)h(other)g +(times)g(the)g(FFI)g(is)g(used)h(to)f(allo)o(w)f(the)i(program)d(to)i +(in)o(terface)h(to)f(existing)262 2099 y(libraries.)324 +2149 y(FFIs)j(are)g(only)f(rarely)h(part)g(of)g(the)g(language)f +(de\014nition;)h(the)g(only)f(examples)g(I)h(can)g(think)262 +2199 y(of)e(are)h(the)g(supp)q(ort)h(for)e(C)h(and)f(assem)o(bly)g(in)g +(C++)h(and)g(the)g(EXTRINSIC)g(directiv)o(e)g(in)g(HPF.)262 +2249 y(More)c(t)o(ypically)m(,)f(eac)o(h)h(language)f(implemen)o +(tation)e(has)j(its)g(o)o(wn)g(idiosyncratic)f(and)h(often)g(ad-ho)q(c) +262 2298 y(mec)o(hanism)e(for)j(supp)q(orting)g(foreign)g(data)f(t)o +(yp)q(es,)i(functions,)g(and)f(v)n(ariables.)16 b(The)11 +b(mec)o(hanisms)p 262 2332 630 2 v 307 2359 a Fe(\003)325 +2370 y Fd(This)j(w)o(ork)f(has)g(b)q(een)f(supp)q(orted)f(b)o(y)i(ARP)m +(A)h(under)e(U.S.)h(Arm)o(y)g(gran)o(t)f(No.)i(D)o(ABT63-94-C-0029,)e +(\\Pro-)262 2410 y(gramming)h(En)o(vironmen)o(ts,)h(Compiler)h(T)m(ec)o +(hnology)g(and)g(Run)o(time)g(Systems)g(for)h(Ob)r(ject)f(Orien)o(ted)g +(P)o(arallel)262 2449 y(Pro)q(cessing".)1039 2574 y Fh(1)p +eop +%%Page: 2 2 +2 1 bop 262 307 a Fh(are)19 b(not)f(standardized)i(probably)d(b)q +(ecause)k(they)e(dep)q(end)h(to)e(a)g(large)h(exten)o(t)g(on)g(the)g +(calling)262 357 y(con)o(v)o(en)o(tions)14 b(of)f(the)i(pro)q(cedure)h +(b)q(eing)e(called,)g(the)g(op)q(erating)g(system)g(on)g(whic)o(h)g +(the)h(program)262 407 y(is)d(running,)g(the)g(arc)o(hitecture)j(of)c +(the)i(mac)o(hine,)e(the)i(data)f(t)o(yp)q(es)h(of)f(the)h(language)e +(b)q(eing)h(called,)262 457 y(the)19 b(v)o(ersion)g(of)f(the)h +(compilers)f(for)g(the)i(host)f(and)f(foreign)g(languages,)h(and)g(so)g +(on.)32 b(\(In)19 b(the)262 506 y(follo)o(wing)14 b(I)i(will)f(refer)j +(to)e(a)h(p)q(oin)o(t)f(in)g(the)h(space)h(made)e(from)e(the)k(pro)q +(duct)f(of)f(the)h(preceding)262 556 y(attributes)g(as)g(a)f +Ff(tar)n(get)p Fh(.\))26 b(Since)17 b(the)g(system)g(dep)q(endencies)i +(are)e(considerable,)h(it)e(is)h(unlik)o(ely)262 606 +y(that)12 b(a)g(fully)f(general)i(and)f(p)q(ortable)h(FFI)f(can)h(b)q +(e)g(de\014ned)h(for)e(a)g(language,)f(and)i(in)f(addition,)f(an)262 +656 y(in)o(terface)f(that)g(w)o(orks)g(with)f(all)g(targets)i(is)f(lik) +o(ely)e(to)i(b)q(e)g(neither)h(functional)e(nor)h(con)o(v)o(enien)o(t.) +17 b(The)262 706 y(c)o(hances)h(for)f(an)o(y)g(p)q(ortable,)g +(standardized)h(language)e(to)h(adopt)g(a)g(non-trivial)f(FFI)h +(therefore)262 756 y(seem)e(sligh)o(t.)23 b(This)16 b(is)g(not)g(to)g +(sa)o(y)f(that)h(an)g(adequate)g(job)g(can't)g(b)q(e)g(done)g(in)g(man) +o(y)e(cases{for)262 805 y(example,)19 b(F)m(ranz)g(Allegro)g(Common)d +(Lisp)j(sp)q(orts)i(a)e(sophisticated)h(FFI)g(whic)o(h)f(supp)q(orts)i +(C)262 855 y(and)13 b(F)m(ortran)g(seemingly)g(v)o(ery)h(w)o(ell{only)d +(that)j(no)f Ff(standar)n(d)h Fh(and)g Ff(gener)n(al)f +Fh(solution)g(is)g(lik)o(ely)g(to)262 905 y(emerge.)324 +955 y(Based)21 b(on)g(these)g(observ)n(ations,)h(an)e(approac)o(h)h(to) +f(in)o(ter-language)g(calling)f(w)o(ould)h(b)q(e)h(to)262 +1005 y(accept)d(the)f(fact)g(that)g(FFIs)g(are)h(implemen)o(tati)o +(on-dep)q(enden)o(t)e(and)h(instead)g(concen)o(trate)h(our)262 +1054 y(e\013ort)f(on)g(a)g(higher)h(lev)o(el)e(of)h(abstraction:)25 +b(that)17 b(of)g(the)h(library)e(in)o(terface.)29 b(Ev)o(en)17 +b(if)g(the)g(FFI)262 1104 y(is)h(target-dep)q(enden)o(t,)k(most)17 +b(of)h(the)i(time)d(the)i(in)o(terface)g(to)g(a)f(library)g(is)h(not)g +(\(whic)o(h)f(is)h(the)262 1154 y(b)q(eaut)o(y)14 b(of)f(an)g(in)o +(terface)h(in)g(the)g(\014rst)g(place\).)19 b(If,)13 +b(for)g(eac)o(h)h(library)m(,)e(there)j(existed)g(a)e(reasonable)262 +1204 y(de\014nition)h(of)h(its)g(in)o(terface,)h(then)g(a)f(program)f +(could)h(tak)o(e)g(that)h(de\014nition)f(and)g(generate)h(FFI)262 +1254 y(co)q(de)f(for)f(the)h(library)e(for)h(a)g(giv)o(en)g(target.)20 +b(This)14 b(is)g(the)h(approac)o(h)f(adv)o(o)q(cated)h(b)o(y)f(the)h +(creators)262 1303 y(of)e(the)h(ILU)g(system)g(\(see)h(section)g(3\).) +324 1353 y(Ho)o(w)o(ev)o(er,)20 b(man)o(ufacturers)f(of)g(libraries)g +(are)g Ff(not)h Fh(distributing)e(reasonable)i(de\014nitions)f(of)262 +1403 y(the)g(in)o(terfaces)i(to)e(their)g(libraries.)34 +b(All)19 b(y)o(ou)g(usually)f(get)i(is)f(a)g(C)g(or)g(C++)h(header)g +(\014le.)34 b(A)262 1453 y(header)21 b(\014le)f(is)g(not)h(a)f +(reasonable)g(de\014nition)g(of)g(the)h(in)o(terface)g(b)q(ecause)h(of) +d(the)i(baggage)f(it)262 1503 y(carries:)30 b(nested)21 +b(include)e(\014les,)i(prepro)q(cessor)h(macros,)d(conditional)f +(compilation,)g(syn)o(tactic)262 1553 y(p)q(eculiarities,)e(implem)o +(en)o(tation)d(language)i(target)h(dep)q(endencies,)j(and)c(so)h(on.)24 +b(In)16 b(the)g(b)q(est)h(of)262 1602 y(all)e(w)o(orlds,)i(the)h(man)o +(ufacturer)e(w)o(ould)h(distribute)g(the)h(in)o(terfaces)g(in)e(an)h +(in)o(terface)h(de\014nition)262 1652 y(language)c(lik)o(e)g(the)i(Ob)r +(ject)h(Managemen)o(t)d(Group's)h(IDL)g(or)g(ILU's)g(ISL,)g(and)g(ma)o +(yb)q(e)f(one)i(da)o(y)262 1702 y(that)d(will)g(b)q(e)h(common.)i(In)d +(the)i(mean)e(time,)f(w)o(e)i(m)o(ust)f(fend)h(for)f(ourselv)o(es.)324 +1752 y(What)e(w)o(e)h(m)o(ust)f(do)g(is)h(to)f(pro)o(vide)h(a)f +(translator)h(whic)o(h)g(tak)o(es)g(as)g(its)f(input)h(not)g(a)f +(reasonable)262 1802 y(de\014nition)16 b(but)h(instead)g(a)g(C)g(or)g +(C++)g(header)h(\014le)f(or)g(set)g(of)g(header)h(\014les,)f(and)g(pro) +q(duces)h(as)262 1851 y(its)c(output)h(the)g(FFI)g(co)q(de)h(for)e(the) +h(library)f(for)g(a)h(giv)o(en)f(target.)21 b(Ho)o(w)o(ev)o(er,)15 +b(suc)o(h)g(a)g(program)e(is)262 1901 y(lik)o(ely)g(to)i(b)q(e)g +(complicated)f(and)h(there)h(will)d(b)q(e)j(one)f(v)o(ersion)g(for)g +(eac)o(h)g(target.)22 b(Main)o(taining)13 b(all)262 1951 +y(these)h(translators)f(will)e(b)q(e)i(an)g(unpleasan)o(t)g(task.)18 +b(W)m(e)12 b(could)g(of)h(course)h(ha)o(v)o(e)e(one)h(translator,)g(to) +262 2001 y(IDL)g(or)g(ISL,)g(and)h(translators)g(from)e(the)i(in)o +(terface)g(language)f(to)g(the)h(FFI,)g(and)f(as)h(w)o(e)g(will)e(see,) +262 2051 y(this)h(is)h(a)g(v)n(ariation)e(on)i(the)g(mec)o(hanism)e +(implem)o(en)o(ted)g(b)o(y)i(FFIGEN.)324 2100 y(An)j(additional)e(imp)q +(ortan)o(t)g(problem)h(is)g(that)h(there)i(is)d(not)h(one)g(but)g(sev)o +(eral)h(translations)262 2150 y(for)c(ev)o(ery)i(target.)21 +b(A)15 b(giv)o(en)f(in)o(terface)h(can)g(b)q(e)h(translated)f(to)g(an)o +(y)f(of)g(sev)o(eral)i(FFIs)f(dep)q(ending)262 2200 y(on)e(the)i +(desired)g Ff(p)n(olicy)e Fh(for)h(the)g(translation.)k(F)m(or)13 +b(example,)f(consider)j(a)f(function)324 2250 y Fg(char)21 +b(*fgets\(char*,)e(int,)i(FILE*\))p Fh(.)262 2300 y(What)c(do)q(es)i +Fg(char*)e Fh(translate)h(to?)31 b(Consider)18 b(the)h(FFI)f(pro)o +(vided)g(b)o(y)g(Chez)g(Sc)o(heme)g(v)o(ersion)262 2350 +y(5.)23 b(It)16 b(has)g(a)g Fg(string)f Fh(t)o(yp)q(e)h(whic)o(h)g(in)f +(a)h(parameter)g(p)q(osition)f(causes)i(the)g(address)g(of)e(the)i +(\014rst)262 2399 y(c)o(haracter)e(of)f(the)h(string)g(argumen)o(t)e +(to)h(b)q(e)h(passed)g(to)g(the)g(function,)e(but)i(whic)o(h)f(in)g +(the)h(return)262 2449 y(p)q(osition)g(causes)i(the)g(c)o(haracters)g +(to)f(b)q(e)g(copied)h(from)d(the)i(storage)g(p)q(oin)o(ted)g(to)g(b)o +(y)g(the)g(return)1039 2574 y(2)p eop +%%Page: 3 3 +3 2 bop 262 307 a Fh(v)n(alue)13 b(\(if)h(not)h Fg(NULL)p +Fh(\))f(in)o(to)g(a)g(fresh)h(Sc)o(heme)g(string.)20 +b(So)14 b(if)g(w)o(e)h(translate)g Fg(char*)f Fh(as)g +Fg(string)p Fh(,)f(w)o(e)262 357 y(end)h(up)g(with:)493 +342 y Fc(1)367 419 y Fg(\(define)21 b(fgets)411 469 y +(\(foreign-function)d("fgets")476 519 y(\(string)j(integer-32)e +(unsigned-32\))476 568 y(string\)\))262 654 y Fh(whic)o(h)e(is)g(exp)q +(ensiv)o(e)h(b)q(ecause)i(the)d(string)h(is)f(\(needlessly\))i(copied)f +(on)f(return.)29 b(On)18 b(the)g(other)262 703 y(hand,)13 +b(w)o(e)h(can)g(treat)h(a)e Fg(char*)g Fh(as)h(\\just)g(a)f(p)q(oin)o +(ter")h(and)g(translate)g(as:)367 765 y Fg(\(define)21 +b(fgets)411 815 y(\(foreign-function)d("fgets")476 865 +y(\(unsigned-32)i(integer-32)f(unsigned-32\))476 915 +y(unsigned-32\)\))262 998 y Fh(but)14 b(this)h(do)q(es)h(not)e(let)h +(us)g(access)i(the)e(c)o(haracters)h(in)f(the)g(bu\013er)h(using)e(Sc)o +(heme's)h(string)f(func-)262 1047 y(tions,)d(since)i(the)g(bu\013er)f +(is)g(not)g(a)g(string.)17 b(In)12 b(the)h(end,)f(it)g(app)q(ears)g +(that)g(no)g(\014xed)h(translation)e(for)262 1097 y Fg(char*)f +Fh(is)h(p)q(ossible;)h(ev)o(en)g(if)e(a)h(\014xed)h(translation)e +(\(and)i(then:)17 b(whic)o(h)11 b(one)h(of)e(them?\))17 +b(is)11 b(adequate)262 1147 y(in)i(most)g(situations,)g(there)i(will)d +(b)q(e)j(sp)q(ecial)f(cases.)1090 1132 y Fc(2)324 1197 +y Fh(The)f(b)q(ottom)e(line)h(is,)g(there)h(is)g(a)f(lot)g(of)f(p)q +(olicy)h(that)h(go)q(es)g(in)o(to)e(a)h(translation)g(in)o(to)g(a)g(sp) +q(eci\014c)262 1247 y(FFI.)h(Hence)i(w)o(e)g(ha)o(v)o(e)e(a)h(slogan)f +(\(the)i(core)f(of)g(the)g(Manifesto\):)365 1338 y(A)g(go)q(o)q(d)g +(foreign)f(function)h(in)o(terface)g(is)g(25\045)f(co)q(de)i(and)e +(75\045)g(p)q(olicy)m(.)324 1429 y(It)e(should)h(b)q(e)g(a)f(goal,)g +(then,)h(to)f(separate)i(the)f(ardous)g(task)g(of)f(parsing)g(and)g(t)o +(yp)q(e-c)o(hec)o(king)i(C)262 1479 y(headers)h(and)f(translating)g +(them)f(in)o(to)h(a)f(rational)g(in)o(termediate)h(form,)e(from)g(the)j +(task)f(of)g(trans-)262 1529 y(lating)f(the)j(in)o(termediate)e(form)g +(in)o(to)g(a)h(FFI)g(sp)q(eci\014cation)h(for)e(a)h(giv)o(en)g(target)g +(and)g(translation)262 1579 y(p)q(olicy)m(.)262 1716 +y Fi(2)69 b(The)22 b(FFIGEN)i(System)262 1807 y Fh(I)18 +b(ha)o(v)o(e)g(written)g(a)g(program,)f(whic)o(h)h(I)g(call)f +Fg(ffigen)p Fh(,)h(whic)o(h)g(tak)o(es)g(as)h(its)f(input)g(a)f(C)h +(header)262 1857 y(\014le)g(and)g(pro)q(duces)i(as)f(its)f(output)h(a)f +(rational)f(translation)g(of)h(the)h(in)o(terface)g(de\014ned)h(b)o(y)e +(the)262 1907 y(header)c(\014le.)j(A)c(rational)f(translation)h(is)g +(one)g(in)f(whic)o(h)h(unnecessary)j(or)d(redundan)o(t)g(syn)o(tax)g +(has)262 1956 y(b)q(een)h(remo)o(v)o(ed,)d(prepro)q(cessor)16 +b(macros)c(ha)o(v)o(e)h(b)q(een)h(expanded,)f(and)g(prepro)q(cessor)j +(conditionals)262 2006 y(ha)o(v)o(e)f(b)q(een)i(resolv)o(ed)g(so)f +(that)f(de\014nitions)h(ha)o(v)o(e)g(b)q(een)h(included)f(or)g +(excluded)g(corrsp)q(ondingly)m(.)262 2056 y(The)f(exact)g(format)e(of) +h(the)h(in)o(termediate)f(co)q(de)i(is)e(describ)q(ed)j(in)d(a)g +(companion)f(do)q(cumen)o(t,)h(the)262 2106 y Ff(FFIGEN)e(User's)f +(Manual)p Fh(.)18 b Fg(ffigen)9 b Fh(functions)i(as)g(the)g +Ff(fr)n(ont-end)g Fh(of)f(a)g(system)h(whic)o(h)g(translates)262 +2156 y(C)i(headers)j(in)o(to)d(foreign)g(function)h(in)o(terfaces.)324 +2206 y(Eac)o(h)j(target)g(system)f(will)g(ha)o(v)o(e)g(one)h(or)g(more) +e(sp)q(eci\014c)j Ff(b)n(ack-ends)g Fh(whic)o(h)e(tak)o(e)h(the)g(in)o +(ter-)262 2255 y(mediate)e(form)g(and)h(pro)q(duce)h(translations)g +(for)f(particular)g(targets)h(and)f(translation)g(p)q(olicies.)p +262 2290 630 2 v 308 2317 a Fb(1)325 2329 y Fd(The)c +Fa(FILE*)e Fd(is)h(translated)e(as)i(an)g Fa(unsigned)k(int)p +Fd(.)308 2356 y Fb(2)325 2368 y Fd(Arguably)m(,)8 b(it)h(w)o(ould)f(ha) +o(v)o(e)g(b)q(een)g(b)q(etter)g(for)g Fa(fgets\(\))f +Fd(to)i(return)f(a)h(truth)f(v)n(alue)f(or)i(the)g(n)o(um)o(b)q(er)e +(of)h(c)o(haracters)262 2408 y(read.)1039 2574 y Fh(3)p +eop +%%Page: 4 4 +4 3 bop 262 307 a Fh(Substan)o(tial)14 b(parts)h(of)f(the)h(bac)o +(k-end)g(co)q(de)h(is)e(largely)g(target-indep)q(enden)o(t)j(and)d(can) +h(therefore)262 357 y(b)q(e)f(shared)h(b)o(y)e(m)o(ultiple)f(bac)o +(k-ends.)324 407 y(I)17 b(ha)o(v)o(e)g(written)h(one)f(bac)o(k-end)h +(to)f(serv)o(e)i(as)e(a)g(sample;)g(it)g(pro)q(duces)i(FFI)f(co)q(de)g +(for)f(Chez)262 457 y(Sc)o(heme)d(v)o(ersion)h(5.)k(It)c(is)f(do)q +(cumen)o(ted)h(in)f(a)g(companion)f(do)q(cumen)o(t,)h +Ff(FFIGEN)h(Back-end)i(for)262 506 y(Chez)d(Scheme)i(V)m(ersion)e(5)p +Fh(.)262 644 y Fi(3)69 b(Related)21 b(W)-6 b(ork)262 +735 y Fh(Kenneth)20 b(B.)e(Russell)h(of)f(MIT)h(has)g(implemen)o(ted)d +(a)j(system)g(called)f(Header2Sc)o(heme)i(whic)o(h)262 +784 y(translates)15 b(C++)f(to)h(the)g(FFI)f(of)g(the)h(SCM)f(Sc)o +(heme)g(system.)19 b(FFIGEN)c(and)f(Header2Sc)o(heme)262 +834 y(are)j(fairly)f(di\013eren)o(t)i(at)f(this)g(p)q(oin)o(t.)28 +b(My)17 b(goal)f(with)h(FFIGEN)g(w)o(as)g(to)g(co)o(v)o(er)h(all)e(of)g +(ANSI)i(C)262 884 y(including)9 b(the)j(prepro)q(cessor)h(in)d(a)h +(reasonable)g(w)o(a)o(y;)f(this)h(is)g(doable)f(b)q(ecause)j(ANSI)e(C)f +(is)h(a)f(small,)262 934 y(\014xed,)16 b(and)f(fairly)f(simple)g +(language.)23 b(C++,)16 b(on)f(the)i(other)f(hand,)g(is)f(a)g(v)o(ery)h +(large,)g(c)o(hanging,)262 984 y(and)10 b(complex)g(language,)g(and)h +(Header2Sc)o(heme)g(therefore)i(handles)e(only)f(part)h(of)g(it)f(at)h +(this)g(time)262 1034 y(\(as)17 b(of)f(v)o(ersion)i(1.2,)e(it)h(do)q +(es)h(not)f(handle)g(prepro)q(cessor)j(macros,)d(t)o(yp)q(edefs,)h(and) +f(en)o(ums\).)27 b(In)262 1083 y(addition,)13 b(m)o(y)h(emphasis)g(w)o +(as)h(on)g(not)g(\014xing)f(p)q(olicy)g(at)h(all,)f(whic)o(h)h(giv)o +(es)g(great)g(freedom)f(\(and)262 1133 y(more)h(w)o(ork\))h(to)g(bac)o +(k-end)g(writers,)i(whereas)f(Russell)f(has)h(mostly)d(\014xed)j(the)f +(p)q(olicy)m(.)24 b(On)17 b(the)262 1183 y(other)g(hand,)f(Header2Sc)o +(heme)h(allo)o(ws)f(some)f(p)q(olicy)h(decisions)h(to)f(b)q(e)h +(expressed)i(in)d(auxiliary)262 1233 y(\014les)h(giv)o(en)g(to)h(the)g +(translator,)g(and)f(I)h(ha)o(v)o(e)f(y)o(et)h(to)f(exp)q(erimen)o(t)g +(with)g(these)i(mec)o(hanisms)d(in)262 1283 y(FFIGEN.)d(Header2Sc)o +(heme)i(is)e(a)o(v)n(ailable)f(from)g(URL)461 1332 y +Fg(http://www-white)o(.med)o(ia.mi)o(t.edu)o(/)19 b(kbrussel/Header2S)o +(cheme)324 1382 y Fh(A)14 b(message)515 1367 y Fc(3)547 +1382 y Fh(p)q(osted)h(to)f(the)h(Usenet)g(group)f Fg(comp.lang.scheme)d +Fh(\(among)h(others\))j(alleged)262 1432 y(that)e(Apple)h(has)g(a)f +(translator)h(for)f(their)h(Dylan)e(implemen)o(tation)e(whic)o(h)k +(will)e(tak)o(e)i(a)f(C)g(header)262 1482 y(\014le)k(and)g(generate)i +(Dylan)e(FFI)h(glue)f(for)g(it.)29 b(I)17 b(kno)o(w)g(nothing)g(else)i +(ab)q(out)e(this)h(system)f(\(but)262 1532 y(w)o(ould)c(appreciate)h +(hearing)g(ab)q(out)g(it)f(from)f(an)o(y)o(one)i(who)g(kno)o(ws\).)324 +1581 y(The)20 b(ILU)g(\(In)o(ter-Language)g(Uni\014cation\))g(system)g +(from)e(Xero)o(x)i(P)m(AR)o(C)f(pro)o(vides)h(cross-)262 +1631 y(language)c(calling)g(functionalit)o(y)g(for)h(mo)q(dules)f(whic) +o(h)h(ha)o(v)o(e)h(in)o(terfaces)g(sp)q(eci\014ed)h(in)e(ISL,)g(the)262 +1681 y(ILU)12 b(in)o(terface)i(de\014nition)e(language.)17 +b(ILU)c(will)e(tak)o(e)i(the)g(in)o(terfaces)h(and)e(pro)q(duce)i +(stubs)g(\(glue,)262 1731 y(as)f(it)g(w)o(ere\))i(for)e(the)h +(languages)f(so)g(that)h(they)g(can)g(call)e(eac)o(h)i(other.)19 +b(The)14 b(ISL)f(\014le)h(sp)q(eci\014es)h(the)262 1781 +y(in)o(terface)g(somewhat)f(abstractly)h(in)f(terms)h(of)f(data)g(t)o +(yp)q(es)i(whic)o(h)f(are)g(meaningful)d(in)j(ISL)f(but)262 +1831 y(whic)o(h)h(ha)o(v)o(e)h(v)n(arious)f(mappings)f(in)h(the)i +(target)f(languages;)g(again,)f(one)h(mapping)d(is)j(assumed)262 +1880 y(to)d(\014t)h(all.)262 2018 y Fi(4)69 b(Ac)n(kno)n(wlegemen)n(ts) +262 2109 y Fh(FFIGEN)16 b(is)h(based)g(on)f(the)h Fg(lcc)f +Fh(ANSI)h(C)f(compiler.)25 b(See)17 b(the)g Ff(FFIGEN)h(User's)e +(Manual)i Fh(for)262 2158 y(full)12 b(ac)o(kno)o(wlegemen)o(ts)h(and)h +(a)g(cop)o(yrigh)o(t)f(notice.)p 262 2411 630 2 v 308 +2437 a Fb(3)325 2449 y Fa(<1996Jan17)o(.12)o(193)o(3.2)o(582)o(5@)o +(che)o(mab)o(s.u)o(ucp)o(>)1039 2574 y Fh(4)p eop +%%Trailer +end +userdict /end-hook known{end-hook}if +%%EOF diff --git a/process.sch b/process.sch new file mode 100644 index 0000000..ef66260 --- /dev/null +++ b/process.sch @@ -0,0 +1,373 @@ +; -*- scheme -*- +; +; Generic program to process output from ffigen. +; Lars Thomas Hansen [lth@cs.uoregon.edu] / January 29, 1996 +; +; Copyright (C) 1996 The University of Oregon. All rights reserved. +; +; This file may be freely redistributed in its entirety with or without +; modification provided that this copyright notice is not removed. It +; may not be sold for profit or incorporated in commercial software +; products without the prior written permission of the copyright holder. +; +; USAGE +; (process ) +; where the file is the output of ffigen. +; +; DESCRIPTION +; There are some general instructions in the section marked CUSTOMIZABLE +; below. +; +; INPUT FORMAT +; Input consists of s-expressions of the following forms: +; -> (function ) +; | (var ) +; | (type ) +; | (struct (( ) ...)) +; | (union (( ) ...)) +; | (enum (( ) ...)) +; | (enum-ident ) +; | (macro ) +; +; -> ( ) +; | (struct-ref ) +; | (union-ref ) +; | (enum-ref ) +; | (function ( ...) ) +; | (pointer ) +; | (array ) +; -> ( ...) +; -> static | extern | const | volatile +; +; -> char | signed-char | unsigned-char | short | unsigned-short +; | int | unsigned | long | unsigned-long | void +; +; -> +; -> +; -> +; -> +; -> +; +; Functions which are known to take no parameters (i.e. t f(void)) have +; one parameter, of type "void". +; +; Functions which have a variable number of arguments have at least one +; defined parameter and a last parameter of type "void". +; +; The ordering of records in the input have little or no relation to the +; relative ordering of declarations in the original source. +; +; Multidimensional arrays are represented as nested array types with the +; leftmost dimension outermost in the expected way; i.e., it looks like +; an array of arrays. +; +; Not all attributes are possible in all places, of course. +; +; Unresolved issues: +; - Handling of bitfields. Might want primitive types (bitfield n) +; and (unsigned-bitfield n), but alignment is a real issue. Another +; option is a field which contains all the bitfield in it: +; (bitfield (i 0 3) (j 3 4) (k 7 10)) says that i starts at bit 0 and +; is 3 bits long, etc. Ditto unsigned. +; - Transmission of compiler-computed alignment and size data in general. +; - Evaluation of macros as far as possible; use of integer values where +; reasonable. + +(define functions '()) ; list of function records +(define vars '()) ; list of var records +(define types '()) ; list of type records +(define structs '()) ; list of struct records +(define unions '()) ; list of union records +(define macros '()) ; list of macro records +(define enums '()) ; list of enum records +(define enum-idents '()) ; list of enum-ident records + +(define source-file #f) ; name of the input file itself +(define filenames '()) ; names of all files in the input + +(define caddddr (lambda (x) (car (cddddr x)))) + +(define warnings 0) + +(define (process filename) + (set! source-file filename) + (set! functions '()) + (set! vars '()) + (set! types '()) + (set! structs '()) + (set! unions '()) + (set! macros '()) + (set! enums '()) + (set! enum-idents '()) + (set! filenames '()) + (set! warnings 0) + (call-with-input-file filename + (lambda (p) + (do ((item (read p) (read p))) + ((eof-object? item) + (process-records) + (newline) + (display warnings) (display " warnings.") (newline) + #t) + (let ((fn (name item))) + (if (not (member fn filenames)) + (set! filenames (cons fn filenames)))) + (case (car item) + ((function) (set! functions (cons item functions))) + ((var) (set! vars (cons item vars))) + ((type) (set! types (cons item types))) + ((struct) (set! structs (cons item structs))) + ((union) (set! unions (cons item unions))) + ((macro) (set! macros (cons item macros))) + ((enum) (set! enums (cons item enums))) + ((enum-ident) (set! enum-idents (cons item enum-idents))) + (else (error 'process "~a" item))))))) + +; Processing after reading. + +(define (process-records) + (select-functions) + (compute-referenced-types) + (generate-translation)) + +; File name utilities. + +(define (strip-extension fn) + (do ((i (- (string-length fn) 1) (- i 1))) + ((or (< i 0) + (char=? (string-ref fn i) #\.) + (char=? (string-ref fn i) #\/)) + (if (and (>= i 0) (char=? (string-ref fn i) #\.)) + (substring fn 0 i) + (string-copy fn))))) + +(define (strip-path fn) + (do ((i (- (string-length fn) 1) (- i 1))) + ((or (< i 0) + (char=? (string-ref fn i) #\/)) + (if (and (>= i 0) (char=? (string-ref fn i) #\/)) + (substring fn (+ i 1) (string-length fn)) + (string-copy fn))))) + +(define (get-path fn) + (let ((x (strip-path fn))) + (if (= (string-length fn) (string-length x)) + x + (substring fn 0 (- (string-length fn) (string-length x)))))) + +; Accessors. +; +; Representation: Each and is represented exactly like it +; was in the input _except_ for the first element. The element is either +; the symbol like it was in the input, or a pair. If it is a pair, then +; the car of the pair is the symbol from the input and the cdr is +; system-internal information. It's a list which currently holds: +; (referenced-bit cached-info) +; +; All other data are represented exactly as in the input. +; +; Some of the generic functions operate on data structures which do not +; have a record-tag (fields, for example). They examine the datum to figure +; out what to do. For example, if the car is a string then it's a field, +; otherwise it's not. + +(define file cadr) ; file name in records which have one + +(define (name x) ; name in records which have one + (if (string? (car x)) + (car x) ; fields + (caddr x))) ; others + +(define (type x) ; type in records which have one + (if (string? (car x)) + (cadr x) ; fields + (cadddr x))) ; others + +(define attrs caddddr) ; attrs in records which have one +(define fields cadddr) ; fields in struct/union type +(define value cadddr) ; value of enum-tag record + +(define (tag x) ; tag in struct-ref/union-ref or struct/union record + (let ((rt (record-tag x))) + (if (or (eq? rt 'struct-ref) + (eq? rt 'union-ref) + (eq? rt 'enum-ref)) + (cadr x) ; refs + (caddr x)))) ; others + +(define arglist cadr) ; function argument list (list of types) +(define (rett x) (caddr x)) ; function return type + +(define (record-tag r) ; always use this. + (if (symbol? (car r)) + (car r) + (caar r))) + +(define (sysinfo r) + (if (symbol? (car r)) + (let ((info (list #f '()))) + (set-car! r (cons (car r) info)) + info) + (cdar r))) + +(define (referenced? x) (car (sysinfo x))) +(define (referenced! x) (set-car! (sysinfo x) #t)) +(define (unreferenced! x) (set-car! (sysinfo x) #f)) + +(define (cache-name r n) + (let ((i (sysinfo r))) + (set-car! (cdr i) (cons n (cadr i))))) + +(define (cached-names r) + (cadr (sysinfo r))) + +; Compute the referenced bit for all referenced structure and union types. +; This may be useful for some systems, and it can be used for getting rid of +; structures included from "incidental" headers, esp. if only some functions +; have been selected. + +(define ref-queue '()) + +(define (compute-referenced-types) + + (define (t-ref t) + (case (record-tag t) + ((function) + (for-each t-ref (arglist t)) + (t-ref (rett t))) + ((struct-ref) + (let ((struct (lookup (tag t) structs))) + (if (not (referenced? struct)) + (begin (referenced! struct) + (set! ref-queue (cons struct ref-queue)))))) + ((union-ref) + (let ((union (lookup (tag t) unions))) + (if (not (referenced? union)) + (begin (referenced! union) + (set! ref-queue (cons union ref-queue)))))) + ((pointer) + (t-ref (cadr t))) + ((array) + (t-ref (caddr t))))) + + (define (struct/union-loop) + (if (not (null? ref-queue)) + (let ((queue ref-queue)) + (set! ref-queue '()) + (for-each (lambda (t) + (for-each (lambda (f) + (t-ref (cadr f))) + (fields t))) + queue) + (struct/union-loop)))) + + (set! ref-queue '()) + (for-each (lambda (f) + (if (referenced? f) + (t-ref (type f)))) + functions) + (for-each (lambda (v) + (t-ref (type v))) + vars) + (struct/union-loop) + #t) + +; Lookup by the 'name' field of whatever it is. + +(define (lookup key items) + (do ((items items (cdr items))) + ((or (null? items) + (string=? key (name (car items)))) + (if (null? items) + #f + (car items))))) + +; Simple macro expander. Given a template (a string) and some arguments +; (a vector of strings) expand the arguments in the template, returning +; a fresh string. If an @ is seen in the template, it must be followed by +; a simple digit which is the index into the argument vector. + +(define (instantiate template args) + + (define (get-arg n) + (reverse! (string->list (vector-ref args n)))) + + (let ((limit (string-length template))) + (let loop ((i 0) (r '())) + (cond ((= i limit) + (list->string (reverse! r))) + ((char=? (string-ref template i) #\@) + (let ((k (- (char->integer (string-ref template (+ i 1))) + (char->integer #\0)))) + (loop (+ i 2) (append (get-arg k) r)))) + (else + (loop (+ i 1) (cons (string-ref template i) r))))))) + +; Given a struct, find the names for the structure. The name is the +; structure tag itself (we'll prefix it by "struct_") and the names of +; any typedef names which refer directly to the structure. + +(define (struct-names struct) + (struct-union-names struct "struct " 'struct-ref)) + +(define (union-names union) + (struct-union-names union "union " 'union-ref)) + +(define (struct-union-names struct/union srctag reffer) + (let ((names '())) + (do ((t types (cdr t))) + ((null? t) names) + (let ((x (type (car t)))) + (if (and (eq? (record-tag x) reffer) + (string=? (tag struct/union) (tag x))) + (set! names (cons (name (car t)) names))))))) + +(define (user-defined-tag? x) + (and (> (string-length x) 0) + (not (char-numeric? (string-ref x 0))))) + +(define warn + (let ((out (current-output-port))) + (lambda (msg . rest) + (set! warnings (+ warnings 1)) + (display "WARNING: " out) + (display msg out) + (for-each (lambda (x) + (display " " out) + (display x out)) + rest) + (newline out)))) + +(define (basic-type? x) + (or (primitive-type? x) + (pointer-type? x))) + +(define (pointer-type? x) + (eq? (record-tag x) 'pointer)) + +(define (primitive-type? x) + (memq (record-tag x) + '(int unsigned short unsigned-short long unsigned-long + double float char signed-char unsigned-char void))) + +(define (array-type? x) + (eq? (record-tag x) 'array)) + +(define (structured-type? x) + (or (eq? (record-tag x) 'struct-ref) + (eq? (record-tag x) 'union-ref))) + +(define canonical-name + (let ((char-canon-case (if (char=? (string-ref (symbol->string 'a) 0) #\a) + char-downcase + char-upcase))) + (lambda (s) + (list->string (map char-canon-case (string->list s)))))) + +(define (struct/union-ref record) + (case (record-tag record) + ((struct) `(struct-ref ,(tag record))) + ((union) `(union-ref ,(tag record))) + (else (error 'struct/union-ref "What's a " record)))) + +; eof diff --git a/src/decl.c b/src/decl.c new file mode 100644 index 0000000..b124248 --- /dev/null +++ b/src/decl.c @@ -0,0 +1,1149 @@ +#include "c.h" + +#define add(x,n) (x > INT_MAX-(n) ? (overflow=1,x) : x+(n)) +#define chkoverflow(x,n) ((void)add(x,n)) +#define bits2bytes(n) (((n) + 7)/8) +static int regcount; + +static List autos, registers; +Symbol cfunc; /* current function */ +Symbol retv; /* return value location for structs */ + +static void checkref ARGS((Symbol, void *)); +static Symbol dclglobal ARGS((int, char *, Type, Coordinate *)); +static Symbol dcllocal ARGS((int, char *, Type, Coordinate *)); +static Symbol dclparam ARGS((int, char *, Type, Coordinate *)); +static Type dclr ARGS((Type, char **, Symbol **, int)); +static Type dclr1 ARGS((char **, Symbol **, int)); +static void decl ARGS((Symbol (*)(int, char *, Type, Coordinate *))); +extern void doconst ARGS((Symbol, void *)); +static void doglobal ARGS((Symbol, void *)); +static void doextern ARGS((Symbol, void *)); +static void exitparams ARGS((Symbol [])); +static void fields ARGS((Type)); +static void funcdefn ARGS((int, char *, Type, Symbol [], Coordinate)); +static void initglobal ARGS((Symbol, int)); +static void oldparam ARGS((Symbol, void *)); +static Symbol *parameters ARGS((Type)); +static Type specifier ARGS((int *)); +static Type structdcl ARGS((int)); +static Type tnode ARGS((int, Type)); + +void program() { + int n; + + level = GLOBAL; + for (n = 0; t != EOI; n++) + if (kind[t] == CHAR || kind[t] == STATIC + || t == ID || t == '*' || t == '(') { + decl(dclglobal); + deallocate(STMT); + if (!(glevel >= 3 || xref)) + deallocate(FUNC); + } else if (t == ';') { + warning("empty declaration\n"); + t = gettok(); + } else { + error("unrecognized declaration\n"); + t = gettok(); + } + if (n == 0) + warning("empty input file\n"); + if (errcnt == 0) do_ffigen(); /* Generate globals information */ +} +static Type specifier(sclass) int *sclass; { + int cls, cons, sign, size, type, vol; + Type ty = NULL; + + cls = vol = cons = sign = size = type = 0; + if (sclass == NULL) + cls = AUTO; + for (;;) { + int *p, tt = t; + switch (t) { + case AUTO: + case REGISTER: if (level <= GLOBAL && cls == 0) + error("invalid use of `%k'\n", t); + p = &cls; t = gettok(); break; + case STATIC: case EXTERN: + case TYPEDEF: p = &cls; t = gettok(); break; + case CONST: p = &cons; t = gettok(); break; + case VOLATILE: p = &vol; t = gettok(); break; + case SIGNED: + case UNSIGNED: p = &sign; t = gettok(); break; + case LONG: + case SHORT: p = &size; t = gettok(); break; + case VOID: case CHAR: case INT: case FLOAT: + case DOUBLE: p = &type; ty = tsym->type; + t = gettok(); break; + case ENUM: p = &type; ty = enumdcl(); break; + case STRUCT: + case UNION: p = &type; ty = structdcl(t); break; + case ID: + if (istypename(t, tsym) && type == 0 + && sign == 0 && size == 0) { + use(tsym, src); + ty = tsym->type; + p = &type; + t = gettok(); + } else + p = NULL; + break; + default: p = NULL; + } + if (p == NULL) + break; + if (*p) + error("invalid use of `%k'\n", tt); + *p = tt; + } + if (sclass) + *sclass = cls; + if (type == 0) { + type = INT; + ty = inttype; + } + if (size == SHORT && type != INT + || size == LONG && type != INT && type != DOUBLE + || sign && type != INT && type != CHAR) + error("invalid type specification\n"); + if (type == CHAR && sign) + ty = sign == UNSIGNED ? unsignedchar : signedchar; + else if (size == SHORT) + ty = sign == UNSIGNED ? unsignedshort : shorttype; + else if (size == LONG && type == DOUBLE) + ty = longdouble; + else if (size == LONG) + ty = sign == UNSIGNED ? unsignedlong : longtype; + else if (sign == UNSIGNED && type == INT) + ty = unsignedtype; + if (cons == CONST) + ty = qual(CONST, ty); + if (vol == VOLATILE) + ty = qual(VOLATILE, ty); + return ty; +} +static void decl(dcl) +Symbol (*dcl) ARGS((int, char *, Type, Coordinate *)); { + int sclass; + Type ty, ty1; + static char stop[] = { CHAR, STATIC, ID, 0 }; + + ty = specifier(&sclass); + if (t == ID || t == '*' || t == '(' || t == '[') { + char *id; + Coordinate pos; + id = NULL; + pos = src; + if (level == GLOBAL) { + Symbol *params = NULL; + ty1 = dclr(ty, &id, ¶ms, 0); + if (params && id && isfunc(ty1) + && (t == '{' || istypename(t, tsym) + || (kind[t] == STATIC && t != TYPEDEF))) { + if (sclass == TYPEDEF) { + error("invalid use of `typedef'\n"); + sclass = EXTERN; + } + if (ty1->u.f.oldstyle) + exitscope(); + funcdefn(sclass, id, ty1, params, pos); + return; + } else if (params) + exitparams(params); + } else + ty1 = dclr(ty, &id, NULL, 0); + for (;;) { + if (Aflag >= 1 && !hasproto(ty1)) + warning("missing prototype\n"); + if (id == NULL) + error("missing identifier\n"); + else if (sclass == TYPEDEF) + { + Symbol p = lookup(id, identifiers); + if (p && p->scope == level) + error("redeclaration of `%s'\n", id); + p = install(id, &identifiers, level, + level < LOCAL ? PERM : FUNC); + p->type = ty1; + p->sclass = TYPEDEF; + p->src = pos; + } + else + (void)(*dcl)(sclass, id, ty1, &pos); + if (t != ',') + break; + t = gettok(); + id = NULL; + pos = src; + ty1 = dclr(ty, &id, NULL, 0); + } + } else if (ty == NULL + || !(isenum(ty) || + isstruct(ty) && (*unqual(ty)->u.sym->name < '1' || *unqual(ty)->u.sym->name > '9'))) + error("empty declaration\n"); + test(';', stop); +} +static Symbol dclglobal(sclass, id, ty, pos) +int sclass; char *id; Type ty; Coordinate *pos; { + Symbol p, q; + + if (sclass == 0) + sclass = AUTO; + else if (sclass != EXTERN && sclass != STATIC) { + error("invalid storage class `%k' for `%t %s'\n", + sclass, ty, id); + sclass = AUTO; + } + p = lookup(id, identifiers); + if (p && p->scope == GLOBAL) { + if (p->sclass != TYPEDEF && eqtype(ty, p->type, 1)) + ty = compose(ty, p->type); + else + error("redeclaration of `%s' previously declared at %w\n", p->name, &p->src); + + if (!isfunc(ty) && p->defined && t == '=') + error("redefinition of `%s' previously defined at %w\n", p->name, &p->src); + + if (p->sclass == EXTERN && sclass == STATIC + || p->sclass == STATIC && sclass == AUTO + || p->sclass == AUTO && sclass == STATIC) + warning("inconsistent linkage for `%s' previously declared at %w\n", p->name, &p->src); + + } + if (p == NULL || p->scope != GLOBAL) { + p = install(id, &globals, GLOBAL, PERM); + p->sclass = sclass; + if (p->sclass != STATIC) { + static int nglobals; + nglobals++; + if (Aflag >= 2 && nglobals == 512) + warning("more than 511 external identifiers\n"); + } + (*IR->defsymbol)(p); + } else if (p->sclass == EXTERN) + p->sclass = sclass; + p->type = ty; + p->src = *pos; + { + Symbol q = lookup(p->name, externals); + if (q && (p->sclass == STATIC + || !eqtype(p->type, q->type, 1))) + warning("declaration of `%s' does not match previous declaration at %w\n", p->name, &q->src); + + } + if (t == '=' && isfunc(p->type)) { + error("illegal initialization for `%s'\n", p->name); + t = gettok(); + initializer(p->type, 0); + } else if (t == '=') + initglobal(p, 0); + else if (p->sclass == STATIC && !isfunc(p->type) + && p->type->size == 0) + error("undefined size for `%t %s'\n", p->type, p->name); + return p; +} +static void initglobal(p, flag) Symbol p; int flag; { + Type ty; + + if (t == '=' || flag) { + if (p->sclass == STATIC) { + for (ty = p->type; isarray(ty); ty = ty->type) + ; + defglobal(p, isconst(ty) ? LIT : DATA); + } else + defglobal(p, DATA); + if (t == '=') + t = gettok(); + ty = initializer(p->type, 0); + if (isarray(p->type) && p->type->size == 0) + p->type = ty; + if (p->sclass == EXTERN) + p->sclass = AUTO; + p->defined = 1; + } +} +void defglobal(p, seg) Symbol p; int seg; { + p->u.seg = seg; + swtoseg(p->u.seg); + if (p->sclass != STATIC) + (*IR->export)(p); + if (level == GLOBAL && glevel > 0 && IR->stabsym) { + (*IR->stabsym)(p); swtoseg(p->u.seg); } + (*IR->global)(p); +} + +static Type dclr(basety, id, params, abstract) +Type basety; char **id; Symbol **params; int abstract; { + Type ty = dclr1(id, params, abstract); + + for ( ; ty; ty = ty->type) + switch (ty->op) { + case POINTER: + basety = ptr(basety); + break; + case FUNCTION: + basety = func(basety, ty->u.f.proto, + ty->u.f.oldstyle); + break; + case ARRAY: + basety = array(basety, ty->size, 0); + break; + case CONST: case VOLATILE: + basety = qual(ty->op, basety); + break; + default: assert(0); + } + if (Aflag >= 2 && basety->size > 32767) + warning("more than 32767 bytes in `%t'\n", basety); + return basety; +} +static Type tnode(op, type) int op; Type type; { + Type ty; + + NEW0(ty, STMT); + ty->op = op; + ty->type = type; + return ty; +} +static Type dclr1(id, params, abstract) +char **id; Symbol **params; int abstract; { + Type ty = NULL; + + switch (t) { + case ID: if (id) + *id = token; + else + error("extraneous identifier `%s'\n", token); + t = gettok(); break; + case '*': t = gettok(); if (t == CONST || t == VOLATILE) { + Type ty1; + ty1 = ty = tnode(t, NULL); + while ((t = gettok()) == CONST || t == VOLATILE) + ty1 = tnode(t, ty1); + ty->type = dclr1(id, params, abstract); + ty = ty1; + } else + ty = dclr1(id, params, abstract); + ty = tnode(POINTER, ty); break; + case '(': t = gettok(); if (abstract + && (t == REGISTER || istypename(t, tsym) || t == ')')) { + Symbol *args; + ty = tnode(FUNCTION, ty); + enterscope(); + if (level > PARAM) + enterscope(); + args = parameters(ty); + exitparams(args); + } else { + ty = dclr1(id, params, abstract); + expect(')'); + if (abstract && ty == NULL + && (id == NULL || *id == NULL)) + return tnode(FUNCTION, NULL); + } break; + case '[': break; + default: return ty; + } + while (t == '(' || t == '[') + switch (t) { + case '(': t = gettok(); { Symbol *args; + ty = tnode(FUNCTION, ty); +enterscope(); +if (level > PARAM) + enterscope(); + args = parameters(ty); + if (params && *params == NULL) + *params = args; + else + exitparams(args); + } + break; + case '[': t = gettok(); { int n = 0; + if (kind[t] == ID) { + n = intexpr(']', 1); + if (n <= 0) { + error("`%d' is an illegal array size\n", n); + n = 1; + } + } else + expect(']'); + ty = tnode(ARRAY, ty); + ty->size = n; } break; + default: assert(0); + } + return ty; +} +static Symbol *parameters(fty) Type fty; { + List list = NULL; + Symbol *params; + + if (kind[t] == STATIC || istypename(t, tsym)) { + int n = 0; + Type ty1 = NULL; + for (;;) { + Type ty; + int sclass = 0; + char *id = NULL; + if (ty1 && t == ELLIPSIS) { + static struct symbol sentinel; + if (sentinel.type == NULL) { + sentinel.type = voidtype; + sentinel.defined = 1; + } + if (ty1 == voidtype) + error("illegal formal parameter types\n"); + list = append(&sentinel, list); + t = gettok(); + break; + } + if (!istypename(t, tsym) && t != REGISTER) + error("missing parameter type\n"); + n++; + ty = dclr(specifier(&sclass), &id, NULL, 1); + if ( ty == voidtype && (ty1 || id) + || ty1 == voidtype) + error("illegal formal parameter types\n"); + if (id == NULL) + id = stringd(n); + if (ty != voidtype) + list = append(dclparam(sclass, id, ty, &src), list); + if (Aflag >= 1 && !hasproto(ty)) + warning("missing prototype\n"); + if (ty1 == NULL) + ty1 = ty; + if (t != ',') + break; + t = gettok(); + } +fty->u.f.proto = newarray(length(list) + 1, + sizeof (Type *), PERM); +params = ltov(&list, FUNC); +for (n = 0; params[n]; n++) + fty->u.f.proto[n] = params[n]->type; +fty->u.f.proto[n] = NULL; + fty->u.f.oldstyle = 0; + } else { + if (t == ID) + for (;;) { + Symbol p; + if (t != ID) { + error("expecting an identifier\n"); + break; + } + p = dclparam(0, token, inttype, &src); + p->defined = 0; + list = append(p, list); + t = gettok(); + if (t != ',') + break; + t = gettok(); + } + params = ltov(&list, FUNC); + fty->u.f.proto = NULL; + fty->u.f.oldstyle = 1; + } + if (t != ')') { + static char stop[] = { CHAR, STATIC, IF, ')', 0 }; + expect(')'); + skipto('{', stop); + } + if (t == ')') + t = gettok(); + return params; +} +static void exitparams(params) Symbol params[]; { + assert(params); + if (params[0] && !params[0]->defined) + error("extraneous old-style parameter list\n"); + if (level > PARAM) + exitscope(); + exitscope(); +} + +static Symbol dclparam(sclass, id, ty, pos) +int sclass; char *id; Type ty; Coordinate *pos; { + Symbol p; + + if (isfunc(ty)) + ty = ptr(ty); + else if (isarray(ty)) + ty = atop(ty); + if (sclass == 0) + sclass = AUTO; + else if (sclass != REGISTER) { + error("invalid storage class `%k' for `%t%s\n", + sclass, ty, stringf(id ? " %s'" : "' parameter", id)); + sclass = AUTO; + } else if (isvolatile(ty) || isstruct(ty)) { + warning("register declaration ignored for `%t%s\n", + ty, stringf(id ? " %s'" : "' parameter", id)); + sclass = AUTO; + } + + p = lookup(id, identifiers); + if (p && p->scope == level) + error("duplicate declaration for `%s' previously declared at %w\n", id, &p->src); + + else + p = install(id, &identifiers, level, FUNC); + p->sclass = sclass; + p->src = *pos; + p->type = ty; + p->defined = 1; + if (t == '=') { + error("illegal initialization for parameter `%s'\n", id); + t = gettok(); + (void)expr1(0); + } + return p; +} +static Type structdcl(op) int op; { + char *tag; + Type ty; + Symbol p; + Coordinate pos; + + t = gettok(); + pos = src; + if (t == ID) { + tag = token; + t = gettok(); + } else + tag = ""; + if (t == '{') { + static char stop[] = { IF, ',', 0 }; + ty = newstruct(op, tag); + ty->u.sym->src = pos; + ty->u.sym->defined = 1; + t = gettok(); + if (istypename(t, tsym)) + fields(ty); + else + error("invalid %k field declarations\n", op); + test('}', stop); + } + else if (*tag && (p = lookup(tag, types)) != NULL + && p->type->op == op) { + ty = p->type; + if (t == ';' && p->scope < level) + ty = newstruct(op, tag); + } + else { + if (*tag == 0) + error("missing %k tag\n", op); + ty = newstruct(op, tag); + } + if (*tag && xref) + use(ty->u.sym, pos); + return ty; +} +static void fields(ty) Type ty; { + { int n = 0; + while (istypename(t, tsym)) { + static char stop[] = { IF, CHAR, '}', 0 }; + Type ty1 = specifier(NULL); + for (;;) { + Field p; + char *id = NULL; + Type fty = dclr(ty1, &id, NULL, 0); + p = newfield(id, ty, fty); + if (Aflag >= 1 && !hasproto(p->type)) + warning("missing prototype\n"); + if (t == ':') { + if (unqual(p->type) != inttype + && unqual(p->type) != unsignedtype) { + error("`%t' is an illegal bit-field type\n", + p->type); + p->type = inttype; + } + t = gettok(); + p->bitsize = intexpr(0, 0); + if (p->bitsize > 8*inttype->size || p->bitsize < 0) { + error("`%d' is an illegal bit-field size\n", + p->bitsize); + p->bitsize = 8*inttype->size; + } else if (p->bitsize == 0 && id) { + warning("extraneous 0-width bit field `%t %s' ignored\n", p->type, id); + + p->name = stringd(genlabel(1)); + } + p->lsb = 1; + } + else if (id == NULL && Xflag && isstruct(p->type)) { + if (Aflag >= 2) + warning("non-ANSI unnamed substructure in `%t'\n", ty); + if (p->type->size == 0) + error("undefined size for field `%t'\n", p->type); + p->name = NULL; + break; + } + else { + if (id == NULL) + error("field name missing\n"); + else if (isfunc(p->type)) + error("`%t' is an illegal field type\n", p->type); + else if (p->type->size == 0) + error("undefined size for field `%t %s'\n", + p->type, id); + } + if (isconst(p->type)) + ty->u.sym->u.s.cfields = 1; + if (isvolatile(p->type)) + ty->u.sym->u.s.vfields = 1; + n++; + if (Aflag >= 2 && n == 128) + warning("more than 127 fields in `%t'\n", ty); + if (t != ',') + break; + t = gettok(); + } + test(';', stop); + } } + { int bits = 0, off = 0, overflow = 0; + Field p, *q = &ty->u.sym->u.s.flist; + ty->align = IR->structmetric.align; + for (p = *q; p; p = p->link) { + int a = p->type->align ? p->type->align : 1; + if (p->lsb) + a = unsignedtype->align; + if (ty->op == UNION) + off = bits = 0; + else if (p->bitsize == 0 || bits == 0 + || bits - 1 + p->bitsize > 8*unsignedtype->size) { + off = add(off, bits2bytes(bits-1)); + bits = 0; + chkoverflow(off, a - 1); + off = roundup(off, a); + } + if (a > ty->align) + ty->align = a; + p->offset = off; + + if (p->lsb) { + if (bits == 0) + bits = 1; + if (IR->little_endian) + p->lsb = bits; + else + p->lsb = 8*unsignedtype->size - bits + 1 + - p->bitsize + 1; + bits += p->bitsize; + } else + off = add(off, p->type->size); + if (off + bits2bytes(bits-1) > ty->size) + ty->size = off + bits2bytes(bits-1); + if (p->name == NULL + || !('1' <= *p->name && *p->name <= '9')) { + *q = p; + q = &p->link; + } + } + *q = NULL; + chkoverflow(ty->size, ty->align - 1); + ty->size = roundup(ty->size, ty->align); + if (overflow) { + error("size of `%t' exceeds %d bytes\n", ty, INT_MAX); + ty->size = INT_MAX&(~(ty->align - 1)); + } + if (Xflag) + checkfields(ty); } +} +static void funcdefn(sclass, id, ty, params, pt) int sclass; +char *id; Type ty; Symbol params[]; Coordinate pt; { + int i, n; + Symbol *callee, *caller, p; + Type rty = freturn(ty); + + if (isstruct(rty) && rty->size == 0) + error("illegal use of incomplete type `%t'\n", rty); + for (n = 0; params[n]; n++) + ; + if (n > 0 && params[n-1]->name == NULL) + params[--n] = NULL; + if (Aflag >= 2 && n > 31) + warning("more than 31 parameters in function `%s'\n", id); + if (ty->u.f.oldstyle) { + caller = params; + callee = newarray(n + 1, sizeof *callee, FUNC); + memcpy(callee, caller, (n+1)*sizeof *callee); + enterscope(); + assert(level == PARAM); + while (kind[t] == STATIC || istypename(t, tsym)) + decl(dclparam); + foreach(identifiers, PARAM, oldparam, callee); + + for (i = 0; (p = callee[i]) != NULL; i++) { + if (!p->defined) + callee[i] = dclparam(0, p->name, inttype, &p->src); + *caller[i] = *p; + caller[i]->sclass = AUTO; + if (unqual(p->type) == floattype) + caller[i]->type = doubletype; + else + caller[i]->type = promote(p->type); + } + p = lookup(id, identifiers); + if (p && p->scope == GLOBAL && isfunc(p->type) + && p->type->u.f.proto) { + Type *proto = p->type->u.f.proto; + for (i = 0; caller[i] && proto[i]; i++) + if (eqtype(unqual(proto[i]), + unqual(caller[i]->type), 1) == 0) + break; + if (proto[i] || caller[i]) + error("conflicting argument declarations for function `%s'\n", id); + + } + else { + Type *proto = newarray(n + 1, sizeof *proto, PERM); + if (Aflag >= 1) + warning("missing prototype for `%s'\n", id); + for (i = 0; i < n; i++) + proto[i] = caller[i]->type; + proto[i] = NULL; + ty = func(rty, proto, 1); + } + } else { + callee = params; + caller = newarray(n + 1, sizeof *caller, FUNC); + for (i = 0; (p = callee[i]) != NULL && p->name; i++) { + NEW(caller[i], FUNC); + *caller[i] = *p; + caller[i]->type = promote(p->type); + caller[i]->sclass = AUTO; + if ('1' <= *p->name && *p->name <= '9') + error("missing name for parameter %d to function `%s'\n", i + 1, id); + + } + caller[i] = NULL; + } + for (i = 0; (p = callee[i]) != NULL; i++) + if (p->type->size == 0) { + error("undefined size for parameter `%t %s'\n", + p->type, p->name); + caller[i]->type = p->type = inttype; + } + p = lookup(id, identifiers); + if (p && isfunc(p->type) && p->defined) + error("redefinition of `%s' previously defined at %w\n", + p->name, &p->src); + cfunc = dclglobal(sclass, id, ty, &pt); + cfunc->u.f.label = genlabel(1); + cfunc->u.f.callee = callee; + cfunc->u.f.pt = src; + cfunc->defined = 1; + if (xref) + use(cfunc, cfunc->src); + if (Pflag) + printproto(cfunc, cfunc->u.f.callee); + if (ncalled >= 0) + ncalled = findfunc(cfunc->name, pt.file); + labels = table(NULL, LABELS); + stmtlabs = table(NULL, LABELS); + refinc = 1.0; + regcount = 0; + codelist = &codehead; + codelist->next = NULL; + definept(NULL); + if (!IR->wants_callb && isstruct(rty)) + retv = genident(AUTO, ptr(rty), PARAM); + compound(0, NULL, 0); + + { + Code cp; + for (cp = codelist; cp->kind < Label; cp = cp->prev) + ; + if (cp->kind != Jump) { + if (rty != voidtype + && (rty != inttype || Aflag >= 1)) + warning("missing return value\n"); + retcode(NULL); + } + } + definelab(cfunc->u.f.label); + definept(NULL); + if (events.exit) + apply(events.exit, cfunc, NULL); + walk(NULL, 0, 0); + exitscope(); + assert(level == PARAM); + foreach(identifiers, level, checkref, NULL); + if (!IR->wants_callb && isstruct(rty)) { + Symbol *a; + a = newarray(n + 2, sizeof *a, FUNC); + a[0] = retv; + memcpy(&a[1], callee, (n+1)*sizeof *callee); + callee = a; + a = newarray(n + 2, sizeof *a, FUNC); + NEW(a[0], FUNC); + *a[0] = *retv; + memcpy(&a[1], caller, (n+1)*sizeof *callee); + caller = a; + } + if (!IR->wants_argb) + for (i = 0; caller[i]; i++) + if (isstruct(caller[i]->type)) { + caller[i]->type = ptr(caller[i]->type); + callee[i]->type = ptr(callee[i]->type); + caller[i]->structarg = callee[i]->structarg = 1; + } + if (glevel > 1) for (i = 0; callee[i]; i++) callee[i]->sclass = AUTO; + if (cfunc->sclass != STATIC) + (*IR->export)(cfunc); + if (glevel && IR->stabsym) { + swtoseg(CODE); (*IR->stabsym)(cfunc); } + swtoseg(CODE); + (*IR->function)(cfunc, caller, callee, cfunc->u.f.ncalls); + if (glevel && IR->stabfend) + (*IR->stabfend)(cfunc, lineno); + outflush(); + foreach(stmtlabs, LABELS, checklab, NULL); + exitscope(); + expect('}'); + labels = stmtlabs = NULL; + retv = NULL; + cfunc = NULL; +} +static void oldparam(p, cl) Symbol p; void *cl; { + int i; + Symbol *callee = cl; + + for (i = 0; callee[i]; i++) + if (p->name == callee[i]->name) { + callee[i] = p; + return; + } + error("declared parameter `%s' is missing\n", p->name); +} +void compound(loop, swp, lev) +int loop, lev; struct swtch *swp; { + Code cp; + int nregs; + + walk(NULL, 0, 0); + cp = code(Blockbeg); + enterscope(); + assert(level >= LOCAL); + autos = registers = NULL; + if (level == LOCAL && IR->wants_callb + && isstruct(freturn(cfunc->type))) { + retv = genident(AUTO, ptr(freturn(cfunc->type)), level); + retv->defined = 1; + retv->ref = 1; + registers = append(retv, registers); + } + if (level == LOCAL && events.entry) + apply(events.entry, cfunc, NULL); + expect('{'); + while (kind[t] == CHAR || kind[t] == STATIC + || istypename(t, tsym) && getchr() != ':') + decl(dcllocal); + { + int i; + Symbol *a = ltov(&autos, STMT); + nregs = length(registers); + for (i = 0; a[i]; i++) + registers = append(a[i], registers); + cp->u.block.locals = ltov(®isters, FUNC); + } + while (kind[t] == IF || kind[t] == ID) + statement(loop, swp, lev); + walk(NULL, 0, 0); + foreach(identifiers, level, checkref, NULL); + { + int i = nregs, j; + Symbol p; + for ( ; (p = cp->u.block.locals[i]) != NULL; i++) { + for (j = i; j > nregs + && cp->u.block.locals[j-1]->ref < p->ref; j--) + cp->u.block.locals[j] = cp->u.block.locals[j-1]; + cp->u.block.locals[j] = p; + } + } + cp->u.block.level = level; + cp->u.block.identifiers = identifiers; + cp->u.block.types = types; + code(Blockend)->u.begin = cp; + if (level > LOCAL) { + exitscope(); + expect('}'); + } +} +static void checkref(p, cl) Symbol p; void *cl; { + if (p->scope >= PARAM + && (isvolatile(p->type) || isfunc(p->type))) + p->addressed = 1; + if (Aflag >= 2 && p->defined && p->ref == 0) { + if (p->sclass == STATIC) + warning("static `%t %s' is not referenced\n", + p->type, p->name); + else if (p->scope == PARAM) + warning("parameter `%t %s' is not referenced\n", + p->type, p->name); + else if (p->scope >= LOCAL && p->sclass != EXTERN) + warning("local `%t %s' is not referenced\n", + p->type, p->name); + } + if (p->sclass == AUTO + && (p->scope == PARAM && regcount == 0 + || p->scope >= LOCAL) + && !p->addressed && isscalar(p->type) && p->ref >= 3.0) + p->sclass = REGISTER; + if (p->scope >= LOCAL && p->sclass == EXTERN) { + Symbol q = lookup(p->name, externals); + assert(q); + q->ref += p->ref; + } + if (level == GLOBAL && p->sclass == STATIC && !p->defined + && isfunc(p->type) && p->ref) + error("undefined static `%t %s'\n", p->type, p->name); + assert(!(level == GLOBAL && p->sclass == STATIC && !p->defined && !isfunc(p->type))); +} +static Symbol dcllocal(sclass, id, ty, pos) +int sclass; char *id; Type ty; Coordinate *pos; { + Symbol p, q; + + if (sclass == 0) + sclass = isfunc(ty) ? EXTERN : AUTO; + else if (isfunc(ty) && sclass != EXTERN) { + error("invalid storage class `%k' for `%t %s'\n", + sclass, ty, id); + sclass = EXTERN; + } else if (sclass == REGISTER + && (isvolatile(ty) || isstruct(ty) || isarray(ty))) { + warning("register declaration ignored for `%t %s'\n", + ty, id); + sclass = AUTO; + } + q = lookup(id, identifiers); + if (q && q->scope >= level + || q && q->scope == PARAM && level == LOCAL) + if (sclass == EXTERN && q->sclass == EXTERN + && eqtype(q->type, ty, 1)) + ty = compose(ty, q->type); + else + error("redeclaration of `%s' previously declared at %w\n", q->name, &q->src); + + assert(level >= LOCAL); + p = install(id, &identifiers, level, FUNC); + p->type = ty; + p->sclass = sclass; + p->src = *pos; + switch (sclass) { + case EXTERN: if (q && q->scope == GLOBAL && q->sclass == STATIC) { + p->sclass = STATIC; + p->scope = GLOBAL; + (*IR->defsymbol)(p); + p->sclass = EXTERN; + p->scope = level; + } else + (*IR->defsymbol)(p); + { + Symbol r = lookup(id, externals); + if (r == NULL) { + r = install(p->name, &externals, GLOBAL, PERM); + r->src = p->src; + r->type = p->type; + r->sclass = p->sclass; + q = lookup(id, globals); + if (q && q->sclass != TYPEDEF && q->sclass != ENUM) + r = q; + } + if (r && !eqtype(r->type, p->type, 1)) + warning("declaration of `%s' does not match previous declaration at %w\n", r->name, &r->src); + + } break; + case STATIC: (*IR->defsymbol)(p); + initglobal(p, 0); + if (!p->defined) + if (p->type->size > 0) { + defglobal(p, BSS); + (*IR->space)(p->type->size); + } else + error("undefined size for `%t %s'\n", + p->type, p->name); + p->defined = 1; break; + case REGISTER: registers = append(p, registers); + regcount++; + p->defined = 1; + break; + case AUTO: autos = append(p, autos); + p->defined = 1; break; + default: assert(0); + } + if (t == '=') { + Tree e; + if (sclass == EXTERN) + error("illegal initialization of `extern %s'\n", id); + t = gettok(); + definept(NULL); + if (isscalar(p->type) + || isstruct(p->type) && t != '{') { + if (t == '{') { + t = gettok(); + e = expr1(0); + expect('}'); + } else + e = expr1(0); + } else { + Symbol t1; + Type ty = p->type, ty1 = ty; + while (isarray(ty1)) + ty1 = ty1->type; + if (!isconst(ty) && (!isarray(ty) || !isconst(ty1))) + ty = qual(CONST, ty); + t1 = genident(STATIC, ty, GLOBAL); + initglobal(t1, 1); + if (isarray(p->type) && p->type->size == 0 + && t1->type->size > 0) + p->type = array(p->type->type, + t1->type->size/t1->type->type->size, 0); + e = idtree(t1); + } + walk(root(asgn(p, e)), 0, 0); + p->ref = 1; + } + if (!isfunc(p->type) && p->defined && p->type->size <= 0) + error("undefined size for `%t %s'\n", p->type, id); + return p; +} +void finalize() { + foreach(externals, GLOBAL, doextern, NULL); + foreach(identifiers, GLOBAL, doglobal, NULL); + foreach(identifiers, GLOBAL, checkref, NULL); + foreach(constants, CONSTANTS, doconst, NULL); +} +static void doextern(p, cl) Symbol p; void *cl; { + Symbol q = lookup(p->name, identifiers); + + if (q) + q->ref += p->ref; + else { + (*IR->defsymbol)(p); + (*IR->import)(p); + } +} +static void doglobal(p, cl) Symbol p; void *cl; { + if (!p->defined && (p->sclass == EXTERN + || isfunc(p->type) && p->sclass == AUTO)) + (*IR->import)(p); + else if (!p->defined && !isfunc(p->type) + && (p->sclass == AUTO || p->sclass == STATIC)) { + if (isarray(p->type) + && p->type->size == 0 && p->type->type->size > 0) + p->type = array(p->type->type, 1, 0); + if (p->type->size > 0) { + defglobal(p, BSS); + (*IR->space)(p->type->size); + } else + error("undefined size for `%t %s'\n", + p->type, p->name); + p->defined = 1; + } + if (Pflag + && !isfunc(p->type) + && !p->generated && p->sclass != EXTERN) + printdecl(p, p->type); +} +void doconst(p, cl) Symbol p; void *cl; { + if (p->u.c.loc) { + assert(p->u.c.loc->u.seg == 0); + defglobal(p->u.c.loc, LIT); + if (isarray(p->type)) + (*IR->defstring)(p->type->size, p->u.c.v.p); + else + (*IR->defconst)(ttob(p->type), p->u.c.v); + p->u.c.loc->defined = 1; + p->u.c.loc = NULL; + } +} +void checklab(p, cl) Symbol p; void *cl; { + if (!p->defined) + error("undefined label `%s'\n", p->name); + p->defined = 1; +} + +Type enumdcl() { + char *tag; + Type ty; + Symbol p; + Coordinate pos; + + t = gettok(); + pos = src; + if (t == ID) { + tag = token; + t = gettok(); + } else + tag = ""; + if (t == '{') { + static char follow[] = { IF, 0 }; + int n = 0, k = -1; + List idlist = 0; + ty = newstruct(ENUM, tag); + t = gettok(); + if (t != ID) + error("expecting an enumerator identifier\n"); + while (t == ID) { + char *id = token; + Coordinate s; + if (tsym && tsym->scope == level) + error("redeclaration of `%s' previously declared at %w\n", + token, &tsym->src); + s = src; + t = gettok(); + if (t == '=') { + t = gettok(); + k = intexpr(0, 0); + } else { + if (k == INT_MAX) + error("overflow in value for enumeration constant `%s'\n", id); + k++; + } + p = install(id, &identifiers, level, level < LOCAL ? PERM : FUNC); + p->src = s; + p->type = ty; + p->sclass = ENUM; + p->u.value = k; + idlist = append(p, idlist); + n++; + if (Aflag >= 2 && n == 128) + warning("more than 127 enumeration constants in `%t'\n", ty); + if (t != ',') + break; + t = gettok(); + if (Aflag >= 2 && t == '}') + warning("non-ANSI trailing comma in enumerator list\n"); + } + test('}', follow); + ty->type = inttype; + ty->size = ty->type->size; + ty->align = ty->type->align; + ty->u.sym->u.idlist = ltov(&idlist, PERM); + ty->u.sym->defined = 1; + } else if ((p = lookup(tag, types)) != NULL && p->type->op == ENUM) { + ty = p->type; + if (t == ';') + error("empty declaration\n"); + } else { + error("unknown enumeration `%s'\n", tag); + ty = newstruct(ENUM, tag); + ty->type = inttype; + } + if (*tag && xref) + use(p, pos); + return ty; +} + +Type typename() { + Type ty = specifier(NULL); + + if (t == '*' || t == '(' || t == '[') { + ty = dclr(ty, NULL, NULL, 1); + if (Aflag >= 1 && !hasproto(ty)) + warning("missing prototype\n"); + } + return ty; +} + diff --git a/src/makefile b/src/makefile new file mode 100644 index 0000000..afc026d --- /dev/null +++ b/src/makefile @@ -0,0 +1,117 @@ +SHELL=/bin/sh +SRC=../../src + +OBJS=alloc.o bind.o dag.o decl.o enode.o error.o expr.o event.o \ + init.o input.o lex.o list.o main.o output.o prof.o profio.o simp.o \ + stmt.o string.o sym.o trace.o tree.o types.o \ + null.o symbolic.o gen.o mips.o sparc.o x86.o + +rcc: $(OBJS) + $(CC) -o $@ $(LDFLAGS) $(OBJS) + +alloc.o: $(SRC)/alloc.c; $(CC) -c $(CFLAGS) $(SRC)/alloc.c +bind.o: $(SRC)/bind.c; $(CC) -c $(CFLAGS) $(SRC)/bind.c +dag.o: $(SRC)/dag.c; $(CC) -c $(CFLAGS) $(SRC)/dag.c +decl.o: $(SRC)/decl.c; $(CC) -c $(CFLAGS) $(SRC)/decl.c +enode.o: $(SRC)/enode.c; $(CC) -c $(CFLAGS) $(SRC)/enode.c +error.o: $(SRC)/error.c; $(CC) -c $(CFLAGS) $(SRC)/error.c +event.o: $(SRC)/event.c; $(CC) -c $(CFLAGS) $(SRC)/event.c +expr.o: $(SRC)/expr.c; $(CC) -c $(CFLAGS) $(SRC)/expr.c +gen.o: $(SRC)/gen.c; $(CC) -c $(CFLAGS) $(SRC)/gen.c +init.o: $(SRC)/init.c; $(CC) -c $(CFLAGS) $(SRC)/init.c +input.o: $(SRC)/input.c; $(CC) -c $(CFLAGS) $(SRC)/input.c +lex.o: $(SRC)/lex.c; $(CC) -c $(CFLAGS) $(SRC)/lex.c +list.o: $(SRC)/list.c; $(CC) -c $(CFLAGS) $(SRC)/list.c +main.o: $(SRC)/main.c; $(CC) -c $(CFLAGS) $(SRC)/main.c +mips.o: $(SRC)/mips.c; $(CC) -c $(CFLAGS) $(SRC)/mips.c +null.o: $(SRC)/null.c; $(CC) -c $(CFLAGS) $(SRC)/null.c +output.o: $(SRC)/output.c; $(CC) -c $(CFLAGS) $(SRC)/output.c +prof.o: $(SRC)/prof.c; $(CC) -c $(CFLAGS) $(SRC)/prof.c +profio.o: $(SRC)/profio.c; $(CC) -c $(CFLAGS) $(SRC)/profio.c +simp.o: $(SRC)/simp.c; $(CC) -c $(CFLAGS) $(SRC)/simp.c +sparc.o: $(SRC)/sparc.c; $(CC) -c $(CFLAGS) $(SRC)/sparc.c +stmt.o: $(SRC)/stmt.c; $(CC) -c $(CFLAGS) $(SRC)/stmt.c +string.o: $(SRC)/string.c; $(CC) -c $(CFLAGS) $(SRC)/string.c +sym.o: $(SRC)/sym.c; $(CC) -c $(CFLAGS) $(SRC)/sym.c +symbolic.o: $(SRC)/symbolic.c; $(CC) -c $(CFLAGS) $(SRC)/symbolic.c +trace.o: $(SRC)/trace.c; $(CC) -c $(CFLAGS) $(SRC)/trace.c +tree.o: $(SRC)/tree.c; $(CC) -c $(CFLAGS) $(SRC)/tree.c +types.o: $(SRC)/types.c; $(CC) -c $(CFLAGS) $(SRC)/types.c +x86.o: $(SRC)/x86.c; $(CC) -c $(CFLAGS) $(SRC)/x86.c + +#$(SRC)/mips.c: $(SRC)/mips.md; lburg <$(SRC)/mips.md >$(SRC)/mips.c +#$(SRC)/sparc.c: $(SRC)/sparc.md;lburg <$(SRC)/sparc.md >$(SRC)/sparc.c +#$(SRC)/x86.c: $(SRC)/x86.md; lburg <$(SRC)/x86.md >$(SRC)/x86.c + +test: tst/8q.s tst/array.s tst/cf.s tst/cq.s tst/cvt.s tst/fields.s \ + tst/front.s tst/incr.s tst/init.s tst/limits.s tst/paranoia.s \ + tst/sort.s tst/spill.s tst/stdarg.s tst/struct.s tst/switch.s \ + tst/wf1.s tst/yacc.s + +T=$(SRC)/../tst +RUN=$(SRC)/run +RCC=rcc +LCC=lcc +CMD=@$(RUN) $(TARGET) + +tst/8q.s: $(RUN) $(RCC) $(T)/8q.c $(T)/8q.0; $(CMD) 8q +tst/array.s: $(RUN) $(RCC) $(T)/array.c $(T)/array.0; $(CMD) array +tst/cf.s: $(RUN) $(RCC) $(T)/cf.c $(T)/cf.0; $(CMD) cf +tst/cq.s: $(RUN) $(RCC) $(T)/cq.c $(T)/cq.0; $(CMD) cq +tst/cvt.s: $(RUN) $(RCC) $(T)/cvt.c $(T)/cvt.0; $(CMD) cvt +tst/fields.s: $(RUN) $(RCC) $(T)/fields.c $(T)/fields.0; $(CMD) fields +tst/front.s: $(RUN) $(RCC) $(T)/front.c $(T)/front.0; $(CMD) front +tst/incr.s: $(RUN) $(RCC) $(T)/incr.c $(T)/incr.0; $(CMD) incr +tst/init.s: $(RUN) $(RCC) $(T)/init.c $(T)/init.0; $(CMD) init +tst/limits.s: $(RUN) $(RCC) $(T)/limits.c $(T)/limits.0; $(CMD) limits +tst/paranoia.s: $(RUN) $(RCC) $(T)/paranoia.c $(T)/paranoia.0;$(CMD) paranoia +tst/sort.s: $(RUN) $(RCC) $(T)/sort.c $(T)/sort.0; $(CMD) sort +tst/spill.s: $(RUN) $(RCC) $(T)/spill.c $(T)/spill.0; $(CMD) spill +tst/stdarg.s: $(RUN) $(RCC) $(T)/stdarg.c $(T)/stdarg.0; $(CMD) stdarg +tst/struct.s: $(RUN) $(RCC) $(T)/struct.c $(T)/struct.0; $(CMD) struct +tst/switch.s: $(RUN) $(RCC) $(T)/switch.c $(T)/switch.0; $(CMD) switch +tst/wf1.s: $(RUN) $(RCC) $(T)/wf1.c $(T)/wf1.0; $(CMD) wf1 +tst/yacc.s: $(RUN) $(RCC) $(T)/yacc.c $(T)/yacc.0; $(CMD) yacc + +OPTS=CC='$(LCC) -B./ -d0.1 -A' \ + CFLAGS='-Wf-target=$(TARGET) -I$(SRC)/../include/`echo $(TARGET)|tr - /` \ + -I$(SRC)' LDFLAGS='$(LDFLAGS)' + +triple: rcc + rm -f *.o + make -f $(SRC)/makefile $(OPTS) + -strip rcc + -od rcc +8 >od2 + rm -f *.o + make -f $(SRC)/makefile $(OPTS) + -strip rcc + -od rcc +8 >od3 + cmp od[23] && rm od[23] + +testclean: + -rm -f tst/*.[12so] + -cd tst; rm -f 8q array cf cq cvt fields front incr init \ + limits paranoia sort spill stdarg struct switch wf1 yacc + +clean: testclean + -rm -f *.o + +clobber: clean + rm -f rcc lburg +# rm -f $(SRC)/mips.c $(SRC)/sparc.c $(SRC)/x86.c + +# The following for FFIGEN +ROOT=../.. + +lcc: + $(MAKE) rcc CC=lcc + +ffigen: ffigen.bin + +ffigen.bin: $(OBJS) ffigen.o + $(CC) -o $@ $(LDFLAGS) $(OBJS) ffigen.o + +$(OBJS) ffigen.o: $(SRC)/c.h $(SRC)/token.h $(SRC)/config.h + +ffigen.o: $(ROOT)/ffigen.c + $(CC) -c $(CFLAGS) -I$(SRC) $(ROOT)/ffigen.c diff --git a/userman.ps b/userman.ps new file mode 100644 index 0000000..5c472ab --- /dev/null +++ b/userman.ps @@ -0,0 +1,1435 @@ +%!PS-Adobe-2.0 +%%Creator: dvips 5.55 Copyright 1986, 1994 Radical Eye Software +%%Title: userman.dvi +%%CreationDate: Wed Feb 7 10:19:45 1996 +%%Pages: 7 +%%PageOrder: Ascend +%%BoundingBox: 0 0 612 792 +%%EndComments +%DVIPSCommandLine: dvips userman.dvi +%DVIPSParameters: dpi=300, comments removed +%DVIPSSource: TeX output 1996.02.07:1019 +%%BeginProcSet: tex.pro +/TeXDict 250 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N +/X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72 +mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1} +ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale +isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div +hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul +TR[matrix currentmatrix{dup dup round sub abs 0.00001 lt{round}if} +forall round exch round exch]setmatrix}N /@landscape{/isls true N}B +/@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B +/FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{ +/nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N +string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N +end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{ +/sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0] +N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data dup +length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{ +128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub +get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data +dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N +/rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup +/base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx +0 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff +setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff +.1 sub]{ch-image}imagemask restore}B /D{/cc X dup type /stringtype ne{]} +if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup +length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{ +cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin +0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul +add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore showpage +userdict /eop-hook known{eop-hook}if}N /@start{userdict /start-hook +known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X +/IE 256 array N 0 1 255{IE S 1 string dup 0 3 index put cvn put}for +65781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N /RMat[1 0 0 -1 0 +0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley X /rulex X V}B /V +{}B /RV statusdict begin /product where{pop product dup length 7 ge{0 7 +getinterval dup(Display)eq exch 0 4 getinterval(NeXT)eq or}{pop false} +ifelse}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale rulex ruley false +RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR rulex ruley scale 1 1 +false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave newpath transform +round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg +rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail +{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M} +B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3 M}B /k{ +4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{ +p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p +a}B /bos{/SS save N}B /eos{SS restore}B end +%%EndProcSet +TeXDict begin 40258431 52099146 1000 300 300 +(/nfs/research/paraducks3/lth/ffi/lcc/userman.dvi) @start +/Fa 1 50 df<0C003C00CC000C000C000C000C000C000C000C000C000C000C000C000C00 +FF8009107E8F0F>49 D E /Fb 1 50 df<0C001C00EC000C000C000C000C000C000C000C +000C000C000C000C000C000C000C000C00FFC00A137D9211>49 D +E /Fc 1 16 df<03C00FF01FF83FFC7FFE7FFEFFFFFFFFFFFFFFFF7FFE7FFE3FFC1FF80F +F003C010107E9115>15 D E /Fd 47 122 df<60C0F1E0F1E070E0102010202040204040 +8040800B0A7F9612>34 D<60F0F070101020204040040A7D830A>44 +DI<60F0F06004047D830A>I<07C018303018701C600C600CE00E +E00EE00EE00EE00EE00EE00EE00EE00E600C600C701C30181C7007C00F157F9412>48 +D<0F8030E040708030C038E0384038003800700070006000C00180030006000C08080810 +183FF07FF0FFF00D157E9412>50 D<0FE030306018701C701C001C00180038006007E000 +300018000C000E000EE00EE00EC00C401830300FE00F157F9412>I<00300030007000F0 +01F001700270047008701870107020704070C070FFFE0070007000700070007003FE0F15 +7F9412>I<01F00608080C181C301C70006000E000E3E0EC30F018F00CE00EE00EE00E60 +0E600E300C3018183007C00F157F9412>54 D<07C0183030186018E00CE00CE00EE00EE0 +0E601E301E186E0F8E000E000C001C70187018603020C01F800F157F9412>57 +D<001000003800003800003800005C00005C00005C00008E00008E00008E000107000107 +0003078002038002038007FFC00401C00401C00800E00800E01800E03800F0FE03FE1717 +7F961A>65 DI<00FC100383300E00B01C0070380030300030700010600010E000 +10E00000E00000E00000E00000E00000E000106000107000103000203800201C00400E00 +8003830000FC0014177E9619>IIII78 +D<00FC000303000E01C01C00E0380070300030700038600018E0001CE0001CE0001CE000 +1CE0001CE0001CE0001C7000387000383000303800701C00E00E01C003030000FC001617 +7E961B>II82 D<0FC4302C601C400CC004C004C004E00070007F003FE0 +0FF801FC001C000E0006800680068006C004E008D81087E00F177E9614>I<7FFFF86038 +184038084038088038048038048038040038000038000038000038000038000038000038 +0000380000380000380000380000380000380000380000380007FFC016177F9619>II<204020404080408081008100E1C0F1E0F1E060C00B0A7B9612>92 +D<1FC0386038301038003803F81E3830387038E039E039E07970FF1F1E100E7F8D12>97 +DI<07F01838303870106000E000E000E000E000600070083008183007C00D0E7F +8D10>I<007E00000E00000E00000E00000E00000E00000E00000E00000E0007CE001C3E +00300E00700E00600E00E00E00E00E00E00E00E00E00600E00700E00301E00182E0007CF +C012177F9614>I<0FC0186030307038E018FFF8E000E000E000600070083010183007C0 +0D0E7F8D10>I<03E006700E701C201C001C001C001C001C00FF801C001C001C001C001C +001C001C001C001C001C001C001C00FF800C1780960B>I<0F9E18E33060707070707070 +306018C02F80200060003FE03FF83FFC600EC006C006C006600C38380FE010157F8D12> +II<183C3C1800000000007C1C1C1C1C1C1C1C1C1C1C1C1CFF081780960A>I<0300 +078007800300000000000000000000001F80038003800380038003800380038003800380 +0380038003800380038003804380E300E7007C00091D82960B>IIIII<07C018303018600C600CE00EE00EE00EE00EE00E +701C3018183007C00F0E7F8D12>II114 D<1F4060C0C040C040E000FF007F801FC001E080608060C060E0 +C09F000B0E7F8D0E>I<080008000800180018003800FF80380038003800380038003800 +380038403840384038401C800F000A147F930E>IIII121 D E /Fe 1 +4 df<0C000C008C40EDC07F800C007F80EDC08C400C000C000A0B7D8B10>3 +D E /Ff 52 125 df<60F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0600000000060F0F0600419 +779816>33 DI<03 +87000387000387000387000387000387007FFFC0FFFFE0FFFFE0070E00070E00070E000E +1C000E1C000E1C000E1C00FFFFE0FFFFE07FFFC01C38001C38001C38001C38001C38001C +380013197F9816>I<30787C3C1C1C1C1C3878F0E040060D789816>39 +D<00E001E0038007000E001C001C0038003800700070007000E000E000E000E000E000E0 +00E000E000E000700070007000380038001C001C000E000700038001E000E00B217A9C16 +>II<01C00001C00001C00001C00001C00001C00001C00001C000FFFF80FFFF80FFFF80 +01C00001C00001C00001C00001C00001C00001C00001C00011137E9516>43 +D45 D<70F8F8F8700505788416>I<000180000380 +000380000700000700000E00000E00001C00001C0000380000380000700000700000E000 +00E00001C00001C0000380000380000700000700000E00000E00001C00001C0000380000 +380000700000700000E00000E00000C0000011207E9C16>I<01800380038007800F807F +80FF807380038003800380038003800380038003800380038003800380038003807FF87F +FC7FF80E197C9816>49 D<387C7C7C38000000000000000038787C7C3C1C1C3870E04006 +18799116>59 D<000180000780001F80003E0000F80001F00007C0000F80003E0000FC00 +00F00000FC00003E00000F800007C00001F00000F800003E00001F800007800001801115 +7E9616>I<7FFF00FFFF80FFFF80000000000000000000000000000000FFFF80FFFF807F +FF00110B7E9116>II<0FE03FF87FFCF01EF00EF00E601E003C007800F001C003800380038003 +8003800300000000000000000003000780078003000F197D9816>I<00F80003FC0007FE +000F07001C3F80387F8078FF8071C3C071C3C0E381C0E381C0E381C0E381C0E381C0E381 +C0E381C071C38071C38078FF00387E001C3C000F03C007FFC003FF0000FC0012197E9816 +>I<7FF800FFFE007FFF001C0F001C07801C03C01C01C01C01C01C01E01C00E01C00E01C +00E01C00E01C00E01C00E01C00E01C00E01C01C01C01C01C03C01C07801C0F807FFF00FF +FE007FF8001319809816>68 D<7FFFC0FFFFC07FFFC01C01C01C01C01C01C01C01C01C00 +001C00001C1C001C1C001FFC001FFC001FFC001C1C001C1C001C00001C00E01C00E01C00 +E01C00E01C00E07FFFE0FFFFE07FFFE013197F9816>II73 D<1FFC003FFE007FFF00780F00F00780E003 +80E00380E00380E00380E00380E00380E00380E00380E00380E00380E00380E00380E003 +80E00380F00780F00780780F007FFF003FFE001FFC0011197E9816>79 +D<7FF800FFFE007FFF001C0F801C03801C03C01C01C01C01C01C01C01C03C01C03801C0F +801FFF001FFE001FF8001C00001C00001C00001C00001C00001C00001C00007F0000FF80 +007F000012197F9816>I<7F07F0FF8FF87F07F01C01C01C01C01C01C01C01C01C01C01C +01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C01C00E03800E +038007070007FF0003FE0000F8001519809816>85 D91 D93 D95 D<1FE0003FF0007FF800783C00300E00000E00000E0003FE001FFE003E0E00700E00 +E00E00E00E00E00E00783E007FFFE03FE7E00F83E013127E9116>97 +D<7E0000FE00007E00000E00000E00000E00000E00000E3E000EFF000FFF800F83C00F00 +E00E00E00E00700E00700E00700E00700E00700E00700E00E00F01E00F83C00FFF800EFF +00063C001419809816>I<03F80FFC1FFE3C1E780C7000E000E000E000E000E000F00070 +0778073E0E1FFC0FF803F010127D9116>I<003F00007F00003F00000700000700000700 +00070003C7000FF7001FFF003C1F00780F00700700E00700E00700E00700E00700E00700 +E00700700F00700F003C1F001FFFE00FE7F007C7E014197F9816>I<03E00FF81FFC3C1E +780E7007E007FFFFFFFFFFFFE000E000700778073C0F1FFE0FFC03F010127D9116>I<00 +1F00007F8000FF8001E78001C30001C00001C0007FFF00FFFF00FFFF0001C00001C00001 +C00001C00001C00001C00001C00001C00001C00001C00001C00001C0003FFE007FFF003F +FE0011197F9816>I<03E3C007F7E00FFFE01C1CC0380E00380E00380E00380E00380E00 +1C1C000FF8001FF0001BE0003800001800001FFC001FFF003FFF807803C0E000E0E000E0 +E000E0E000E07001C07C07C03FFF800FFE0003F800131C7F9116>I<7E0000FE00007E00 +000E00000E00000E00000E00000E3C000EFE000FFF000F87800F03800E03800E03800E03 +800E03800E03800E03800E03800E03800E03800E03807FC7F0FFE7F87FC7F01519809816 +>I<018003C003C0018000000000000000007FC07FC07FC001C001C001C001C001C001C0 +01C001C001C001C001C001C07FFFFFFF7FFF101A7D9916>I<7E0000FE00007E00000E00 +000E00000E00000E00000E7FE00E7FE00E7FE00E0F000E1E000E3C000E78000EF0000FF0 +000FF8000FBC000F1E000E0E000E07000E07807F87F0FFCFF07F87F01419809816>107 +DII< +7E3C00FEFE007FFF000F87800F03800E03800E03800E03800E03800E03800E03800E0380 +0E03800E03800E03807FC7F0FFE7F87FC7F01512809116>I<03E0000FF8001FFC003C1E +00780F00700700E00380E00380E00380E00380E00380F00780700700780F003C1E001FFC +000FF80003E00011127E9116>I<7E3E00FEFF007FFF800F83C00F00E00E00E00E00700E +00700E00700E00700E00700E00700E00E00F01E00F83C00FFF800EFF000E3C000E00000E +00000E00000E00000E00000E00007FC000FFE0007FC000141B809116>I114 D<0FEC3FFC7FFCF03CE01CE01C70007F +801FF007F8003C600EE00EF00EF81EFFFCFFF8C7E00F127D9116>I<0300000700000700 +000700000700007FFF00FFFF00FFFF000700000700000700000700000700000700000700 +0007010007038007038007038007870003FE0001FC0000F80011177F9616>I<7E1F80FE +3F807E1F800E03800E03800E03800E03800E03800E03800E03800E03800E03800E03800E +03800E0F800FFFF007FBF803E3F01512809116>I<7F1FC0FF1FE07F1FC01C07001E0F00 +0E0E000E0E000E0E00071C00071C00071C00071C0003B80003B80003B80001F00001F000 +00E00013127F9116>II<7F +1FC07F3FC07F1FC00F1C00073C0003B80003F00001F00000E00001E00001F00003B80007 +3C00071C000E0E007F1FC0FF3FE07F1FC013127F9116>I<7F1FC0FF9FE07F1FC01C0700 +0E07000E0E000E0E00070E00071C00071C00039C00039C0003980001B80001B80000F000 +00F00000F00000E00000E00000E00001C00079C0007BC0007F80003F00003C0000131B7F +9116>I<3FFFC07FFFC07FFFC0700780700F00701E00003C0000780001F00003E0000780 +000F00001E01C03C01C07801C0FFFFC0FFFFC0FFFFC012127F9116>I124 +D E /Fg 38 123 df45 D<00C06000FFC001FF8001FE0001 +0000010000020000020000020000020000047800058C0006060004060008060000070000 +0700000600000E00000E00700E00700C00E01C0080180080380040300040600021C0001F +0000131D7C9B15>53 D<060F0F06000000000000000000003078F06008127C910D>58 +D<0000180000001800000038000000380000007800000078000000B8000001B800000138 +000002380000023C0000041C0000041C0000081C0000181C0000101C0000201C0000201C +00007FFC0000401C0000801C0001801C0001001C0002001C0002001C0004000E000C000E +001C001E00FF00FFC01A1D7E9C1F>65 D<01FFFE00003C0780003803C0003801C0003801 +C0003801C0007001C0007003C0007003C00070078000E0070000E00E0000E03C0000FFF8 +0001C01C0001C00E0001C00F0001C00F0003800F0003800F0003800F0003800F0007001E +0007001C0007003C00070078000E01E000FFFF80001A1C7D9B1D>I<0003F020001E0C60 +003002E000E003C001C001C0038001C0070000C00E0000801E0000801C0000803C000080 +3C000000780000007800000078000000F0000000F0000000F0000000F0000000F0000400 +F0000400F0000400F0000800700008007000100038002000180040000C01800007060000 +01F800001B1E7A9C1E>I<01FFFE00003C0780003801C0003801C0003800E0003800E000 +7000F00070007000700070007000F000E000F000E000F000E000F000E000F001C001E001 +C001E001C001E001C001C0038003C003800380038007800380070007000E0007001C0007 +003800070070000E01C000FFFF00001C1C7D9B1F>I<01FFFFE0003C00E0003800600038 +004000380040003800400070004000700040007020400070200000E0400000E0400000E0 +C00000FFC00001C0800001C0800001C0800001C080000381010003800100038002000380 +0200070004000700040007000C00070018000E007800FFFFF0001B1C7D9B1C>I<01FFFF +C0003C01C0003800C0003800800038008000380080007000800070008000702080007020 +0000E0400000E0400000E0C00000FFC00001C0800001C0800001C0800001C08000038100 +00038000000380000003800000070000000700000007000000070000000F000000FFF000 +001A1C7D9B1B>I<0003F020001E0C60003002E000E003C001C001C0038001C0070000C0 +0E0000801E0000801C0000803C0000803C000000780000007800000078000000F0000000 +F0000000F001FFC0F0001E00F0001C00F0001C00F0001C00F0001C007000380070003800 +38003800180078000C0090000707100001F800001B1E7A9C20>I<01FFC0003C00003800 +00380000380000380000700000700000700000700000E00000E00000E00000E00001C000 +01C00001C00001C0000380000380000380000380000700000700000700000700000F0000 +FFE000121C7E9B10>73 D<01FE0007F8003E000780002E000F00002E001700002E001700 +002E002700004E002E00004E004E00004E004E00004E008E00008E011C00008E011C0000 +8E021C00008E021C00010704380001070438000107083800010710380002071070000207 +20700002072070000207407000040740E000040780E000040700E0000C0700E0001C0601 +E000FF861FFC00251C7D9B25>77 D<01FC03FE001C0070003C0060002E0040002E004000 +2E0040004700800047008000470080004380800083810000838100008181000081C10001 +01C2000101C2000100E2000100E2000200E4000200740002007400020074000400380004 +003800040038000C0018001C001000FF8010001F1C7D9B1F>I<0007F000001C1C000070 +0E0000E0070001C0038003800380070003800E0003C01E0003C01C0003C03C0003C03C00 +03C0780003C0780003C0780003C0F0000780F0000780F0000780F0000F00F0000F00F000 +0E00F0001E00F0003C0070003800700070007800E0003801C0001C0380000E0E000003F8 +00001A1E7A9C20>I<01FFF800003C0E0000380700003803800038038000380380007007 +80007007800070078000700F0000E00E0000E01C0000E0700000FFC00001C0C00001C060 +0001C0700001C07000038070000380700003807000038070000700F0000700F0400700F0 +400700F0800F007880FFE0790000001E001A1D7D9B1E>82 D<000F8400304C00403C0080 +1801001803001803001806001006001006000007000007000003E00003FC0001FF00007F +800007C00001C00001C00000C00000C02000C02000C0600180600180600300600200F004 +00CC180083E000161E7D9C17>I86 +D<03CC063C0C3C181C3838303870387038E070E070E070E070E0E2C0E2C0E261E462643C +380F127B9115>97 D<3F00070007000E000E000E000E001C001C001C001C0039C03E6038 +3038307038703870387038E070E070E070E060E0E0C0C0C1C0618063003C000D1D7B9C13 +>I<01F007080C08181C3838300070007000E000E000E000E000E000E008E010602030C0 +1F000E127B9113>I<001F80000380000380000700000700000700000700000E00000E00 +000E00000E0003DC00063C000C3C00181C00383800303800703800703800E07000E07000 +E07000E07000E0E200C0E200C0E20061E4006264003C3800111D7B9C15>I<01E007100C +1018083810701070607F80E000E000E000E000E000E0086010602030C01F000D127B9113 +>I<0003C0000670000C70001C60001C00001C0000380000380000380000380000380003 +FF8000700000700000700000700000700000E00000E00000E00000E00000E00001C00001 +C00001C00001C00001C000038000038000038000030000030000070000C60000E60000CC +00007800001425819C0D>I<00F3018F030F06070E0E0C0E1C0E1C0E381C381C381C381C +383830383038187818F00F700070007000E000E0C0C0E1C0C3007E00101A7D9113>I<0F +C00001C00001C0000380000380000380000380000700000700000700000700000E78000E +8C000F0E000E0E001C0E001C0E001C0E001C0E00381C00381C00381C0038380070388070 +3880707080707100E03200601C00111D7D9C15>I<018003800100000000000000000000 +00000000001C002600470047008E008E000E001C001C001C003800380071007100710072 +0072003C00091C7C9B0D>I<0FC00001C00001C000038000038000038000038000070000 +0700000700000700000E0F000E11000E23800E43801C83001C80001D00001E00003F8000 +39C00038E00038E00070E20070E20070E20070E400E06400603800111D7D9C13>107 +D<1F800380038007000700070007000E000E000E000E001C001C001C001C003800380038 +0038007000700070007000E400E400E400E40068003800091D7C9C0B>I<3C1E07802663 +18C04683A0E04703C0E08E0380E08E0380E00E0380E00E0380E01C0701C01C0701C01C07 +01C01C070380380E0388380E0388380E0708380E0710701C0320300C01C01D127C9122> +I<3C3C002646004687004707008E07008E07000E07000E07001C0E001C0E001C0E001C1C +00381C40381C40383840383880701900300E0012127C9117>I<01E007180C0C180C380C +300E700E700EE01CE01CE01CE018E038E030E06060C031801E000F127B9115>I<078700 +04D98008E0C008E0C011C0E011C0E001C0E001C0E00381C00381C00381C0038180070380 +0703000707000706000E8C000E70000E00000E00001C00001C00001C00001C00003C0000 +FF8000131A7F9115>I<3C3C26C2468747078E068E000E000E001C001C001C001C003800 +3800380038007000300010127C9112>114 D<01F006080C080C1C18181C001F001FC00F +F007F0007800386030E030C030806060C01F000E127D9111>I<00C001C001C001C00380 +038003800380FFE00700070007000E000E000E000E001C001C001C001C00384038403840 +388019000E000B1A7D990E>I<1E06270E470E4706870287020E020E021C041C041C041C +0818083808181018200C4007800F127C9113>118 D<1E01832703874703874703838707 +018707010E07010E07011C0E021C0E021C0E021C0E04180C04181C04181C081C1C100C26 +3007C3C018127C911C>I<038207C20FEC08381008001000200040008001000200040008 +081008383067F043E081C00F127D9111>122 D E /Fh 80 123 df<007E1F0001C1B180 +0303E3C00703C3C00E03C1800E01C0000E01C0000E01C0000E01C0000E01C0000E01C000 +FFFFFC000E01C0000E01C0000E01C0000E01C0000E01C0000E01C0000E01C0000E01C000 +0E01C0000E01C0000E01C0000E01C0000E01C0000E01C0000E01C0000E01C0007F87FC00 +1A1D809C18>11 D<007E0001C1800301800703C00E03C00E01800E00000E00000E00000E +00000E0000FFFFC00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E +01C00E01C00E01C00E01C00E01C00E01C00E01C07F87F8151D809C17>I<60F0F0F0F0F0 +F0F060606060606060606060606060000000000060F0F060041E7C9D0C>33 +D<6060F0F0F8F86868080808080808101010102020404080800D0C7F9C15>I<00E00000 +019000000308000003080000070800000708000007080000070800000710000007100000 +072000000740000003C03FE003800F00038006000380040005C0040009C0080010E01000 +30E010006070200060702000E0384000E03C4000E01C8000E00F0020E007002070078040 +3009C0401830E18007C03E001B1F7E9D20>38 D<60F0F8680808081010204080050C7C9C +0C>I<004000800100020006000C000C0018001800300030007000600060006000E000E0 +00E000E000E000E000E000E000E000E000E000E000600060006000700030003000180018 +000C000C00060002000100008000400A2A7D9E10>I<800040002000100018000C000C00 +0600060003000300038001800180018001C001C001C001C001C001C001C001C001C001C0 +01C001C0018001800180038003000300060006000C000C00180010002000400080000A2A +7E9E10>I<00060000000600000006000000060000000600000006000000060000000600 +000006000000060000000600000006000000060000FFFFFFE0FFFFFFE000060000000600 +000006000000060000000600000006000000060000000600000006000000060000000600 +0000060000000600001B1C7E9720>43 D<60F0F0701010101020204080040C7C830C>I< +FFE0FFE00B0280890E>I<60F0F06004047C830C>I<00010003000600060006000C000C00 +0C0018001800180030003000300060006000C000C000C001800180018003000300030006 +0006000C000C000C00180018001800300030003000600060006000C000C00010297E9E15 +>I<03C00C301818300C300C700E60066006E007E007E007E007E007E007E007E007E007 +E007E007E007E00760066006700E300C300C18180C3007E0101D7E9B15>I<030007003F +00C700070007000700070007000700070007000700070007000700070007000700070007 +00070007000700070007000F80FFF80D1C7C9B15>I<07C01830201C400C400EF00FF80F +F807F8077007000F000E000E001C001C00380070006000C00180030006010C0118011002 +3FFE7FFEFFFE101C7E9B15>I<07E01830201C201C781E780E781E381E001C001C001800 +30006007E00030001C001C000E000F000F700FF80FF80FF80FF00E401C201C183007E010 +1D7E9B15>I<000C00000C00001C00003C00003C00005C0000DC00009C00011C00031C00 +021C00041C000C1C00081C00101C00301C00201C00401C00C01C00FFFFC0001C00001C00 +001C00001C00001C00001C00001C0001FFC0121C7F9B15>I<300C3FF83FF03FC0200020 +00200020002000200023E024302818301C200E000E000F000F000F600FF00FF00FF00F80 +0E401E401C2038187007C0101D7E9B15>I<00F0030C06040C0E181E301E300C70007000 +6000E3E0E430E818F00CF00EE006E007E007E007E007E007600760077006300E300C1818 +0C3003E0101D7E9B15>I<4000007FFF807FFF007FFF0040020080040080040080080000 +100000100000200000600000400000C00000C00001C00001800001800003800003800003 +8000038000078000078000078000078000078000078000030000111D7E9B15>I<03E00C +301008200C20066006600660067006780C3E083FB01FE007F007F818FC307E601E600FC0 +07C003C003C003C00360026004300C1C1007E0101D7E9B15>I<03C00C301818300C700C +600EE006E006E007E007E007E007E0076007700F300F18170C2707C700060006000E300C +780C78187010203030C00F80101D7E9B15>I<60F0F0600000000000000000000060F0F0 +6004127C910C>I<60F0F0600000000000000000000060F0F0701010101020204080041A +7C910C>I<0FE03038401CE00EF00EF00EF00E000C001C0030006000C000800180010001 +0001000100010001000000000000000000000003000780078003000F1D7E9C14>63 +D<003F800000C0600003001800040004000800020010000100201F00802070808040E040 +4040C0384041C03840818038208380382083803820838038208380382083803820818038 +2041C0382040C0384040E0784020709880201F0F00100000000800000004000000030001 +E000C01F80003FF0001B1D7E9C20>I<000600000006000000060000000F0000000F0000 +000F00000017800000178000001780000023C0000023C0000023C0000041E0000041E000 +0041E0000080F0000080F0000180F8000100780001FFF80003007C0002003C0002003C00 +06003E0004001E0004001E000C001F001E001F00FF80FFF01C1D7F9C1F>II<001F808000E0618001801980070007800E0003801C00 +03801C00018038000180780000807800008070000080F0000000F0000000F0000000F000 +0000F0000000F0000000F0000000F0000000700000807800008078000080380000801C00 +01001C0001000E000200070004000180080000E03000001FC000191E7E9C1E>IIII<001F808000E0618001801980070007800E0003801C0003801C00 +018038000180780000807800008070000080F0000000F0000000F0000000F0000000F000 +0000F0000000F000FFF0F0000F80700007807800078078000780380007801C0007801C00 +07800E00078007000B800180118000E06080001F80001C1E7E9C21>III<1FFF00F800 +780078007800780078007800780078007800780078007800780078007800780078007800 +787078F878F878F878F0F040E021C01F00101D7F9B15>IIIII<003F8000 +00E0E0000380380007001C000E000E001C0007003C00078038000380780003C0780003C0 +700001C0F00001E0F00001E0F00001E0F00001E0F00001E0F00001E0F00001E0F00001E0 +700001C0780003C0780003C0380003803C0007801C0007000E000E0007001C0003803800 +00E0E000003F80001B1E7E9C20>II<003F +800000E0E0000380380007001C000E000E001C0007003C00078038000380780003C07800 +03C0700001C0F00001E0F00001E0F00001E0F00001E0F00001E0F00001E0F00001E0F000 +01E0700001C0780003C0780003C0380003803C0E07801C1107000E208E0007205C0003A0 +780000F0E020003FE0200000602000003060000038E000003FC000003FC000001F800000 +0F001B257E9C20>II<07E0801C1980300580700380 +600180E00180E00080E00080E00080F00000F800007C00007FC0003FF8001FFE0007FF00 +00FF80000F800007C00003C00001C08001C08001C08001C0C00180C00180E00300D00200 +CC0C0083F800121E7E9C17>I<7FFFFFC0700F01C0600F00C0400F0040400F0040C00F00 +20800F0020800F0020800F0020000F0000000F0000000F0000000F0000000F0000000F00 +00000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F00 +00000F0000000F0000001F800003FFFC001B1C7F9B1E>IIII<7FF0FFC00FC03E000780 +180003C0180003E0100001E0200001F0600000F0400000788000007D8000003D0000001E +0000001F0000000F0000000F8000000F80000013C0000023E0000021E0000041F00000C0 +F8000080780001007C0003003C0002001E0006001F001F003F80FFC0FFF01C1C7F9B1F> +II<08081010202040404040808080808080B0B0F8F878783030 +0D0C7A9C15>92 D<0810204040808080B0F87830050C7D9C0C>96 +D<1FC000307000783800781C00301C00001C00001C0001FC000F1C00381C00701C00601C +00E01C40E01C40E01C40603C40304E801F870012127E9115>II<07E00C301878307870306000E000E000E000E000E000E000 +60007004300418080C3007C00E127E9112>I<003F000007000007000007000007000007 +0000070000070000070000070000070003E7000C1700180F00300700700700600700E007 +00E00700E00700E00700E00700E00700600700700700300700180F000C370007C7E0131D +7E9C17>I<03E00C301818300C700E6006E006FFFEE000E000E000E00060007002300218 +040C1803E00F127F9112>I<00F8018C071E061E0E0C0E000E000E000E000E000E00FFE0 +0E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E007FE00F1D +809C0D>I<00038003C4C00C38C01C3880181800381C00381C00381C00381C001818001C +38000C300013C0001000003000001800001FF8001FFF001FFF803003806001C0C000C0C0 +00C0C000C06001803003001C0E0007F800121C7F9215>II<18003C003C0018000000000000000000000000000000FC001C00 +1C001C001C001C001C001C001C001C001C001C001C001C001C001C001C00FF80091D7F9C +0C>I<00C001E001E000C000000000000000000000000000000FE000E000E000E000E000 +E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E060E0F0C0F1 +C061803E000B25839C0D>IIIII<03F0000E1C00180600300300700380600180E001C0E001C0E001C0E001C0E0 +01C0E001C06001807003803003001806000E1C0003F00012127F9115>II<03C1000C3300180B00300F00700700700700E00700E00700E00700E007 +00E00700E00700600700700700300F00180F000C370007C7000007000007000007000007 +00000700000700000700003FE0131A7E9116>II<1F9030704030C010C0 +10E010F8007F803FE00FF000F880388018C018C018E010D0608FC00D127F9110>I<0400 +0400040004000C000C001C003C00FFE01C001C001C001C001C001C001C001C001C001C10 +1C101C101C101C100C100E2003C00C1A7F9910>IIII<7F8FF00F03800F030007020003840001C80001D80000F000007000007800 +00F800009C00010E00020E000607000403801E07C0FF0FF81512809116>II<7FFC70386038407040F040E041C003C0038007000F040E041C043C0C +380870087038FFF80E127F9112>I E /Fi 43 122 df<1C007F00FF80FF80FF80FF80FF +80FF807F007F007F007F007F007F007F003F003E003E003E003E003E003E003E001C001C +001C001C000000000000000000000000001C003E007F00FF80FF80FF807F003E001C0009 +2A7AA915>33 D45 +D<003F800001FFF00007E0FC000FC07E001F803F001F803F003F001F803F001F807F001F +C07F001FC07F001FC07F001FC0FF001FE0FF001FE0FF001FE0FF001FE0FF001FE0FF001F +E0FF001FE0FF001FE0FF001FE0FF001FE0FF001FE0FF001FE0FF001FE0FF001FE0FF001F +E07F001FC07F001FC07F001FC07F001FC03F001F803F001F801F803F001F803F000FC07E +0007E0FC0001FFF000003F80001B277DA622>48 D<000E00001E00007E0007FE00FFFE00 +FFFE00F8FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE00 +00FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE00 +00FE0000FE0000FE0000FE0000FE0000FE0000FE007FFFFE7FFFFE7FFFFE17277BA622> +I<00FF800003FFF0000FFFFC001F03FE003800FF007C007F80FE003FC0FF003FC0FF003F +E0FF001FE0FF001FE07E001FE03C003FE000003FE000003FC000003FC000007F8000007F +000000FE000000FC000001F8000003F0000003E00000078000000F0000001E0000003C00 +E0007000E000E000E001C001C0038001C0070001C00FFFFFC01FFFFFC03FFFFFC07FFFFF +C0FFFFFF80FFFFFF80FFFFFF801B277DA622>I<007F800003FFF00007FFFC000F81FE00 +1F00FF003F80FF003F807F803F807F803F807F801F807F800F007F800000FF000000FF00 +0000FE000001FC000001F8000007F00000FFC00000FFF0000001FC0000007E0000007F00 +00007F8000003FC000003FC000003FE000003FE03C003FE07E003FE0FF003FE0FF003FE0 +FF003FC0FF007FC07E007F807C007F003F01FE001FFFFC0007FFF00000FF80001B277DA6 +22>I<00000E0000001E0000003E0000007E000000FE000000FE000001FE000003FE0000 +077E00000E7E00000E7E00001C7E0000387E0000707E0000E07E0000E07E0001C07E0003 +807E0007007E000E007E000E007E001C007E0038007E0070007E00E0007E00FFFFFFF8FF +FFFFF8FFFFFFF80000FE000000FE000000FE000000FE000000FE000000FE000000FE0000 +00FE00007FFFF8007FFFF8007FFFF81D277EA622>I<0C0003000F803F000FFFFE000FFF +FC000FFFF8000FFFF0000FFFE0000FFFC0000FFE00000E0000000E0000000E0000000E00 +00000E0000000E0000000E7FC0000FFFF8000F80FC000E003E000C003F0000001F800000 +1FC000001FC000001FE000001FE018001FE07C001FE0FE001FE0FE001FE0FE001FE0FE00 +1FC0FC001FC078003F8078003F803C007F001F01FE000FFFF80003FFF00000FF80001B27 +7DA622>I<0007F000003FFC0000FFFE0001FC0F0003F01F8007E03F800FC03F801FC03F +801F803F803F801F003F8000007F0000007F0000007F000000FF000000FF0FC000FF3FF8 +00FF707C00FFC03E00FFC03F00FF801F80FF801FC0FF001FC0FF001FE0FF001FE0FF001F +E07F001FE07F001FE07F001FE07F001FE03F001FE03F001FC01F801FC01F803F800FC03F +0007E07E0003FFFC0000FFF000003FC0001B277DA622>I<380000003E0000003FFFFFF0 +3FFFFFF03FFFFFF07FFFFFE07FFFFFC07FFFFF807FFFFF0070000E0070000E0070001C00 +E0003800E0007000E000E0000000E0000001C000000380000007800000078000000F0000 +000F0000001F0000001F0000003F0000003E0000003E0000007E0000007E0000007E0000 +007E000000FE000000FE000000FE000000FE000000FE000000FE000000FE000000FE0000 +007C0000003800001C297CA822>I<003FC00001FFF00003FFFC0007C07E000F003F001E +001F001E000F803E000F803E000F803F000F803F000F803FC00F003FF01F001FFC1E001F +FE3C000FFFF80007FFE00003FFF80001FFFC0001FFFE0007FFFF000F0FFF801E03FFC03C +01FFC07C007FE078001FE0F80007E0F80007E0F80003E0F80003E0F80003E0F80003C07C +0003C07C0007803F000F001FC03E000FFFFC0003FFF800007FC0001B277DA622>I<007F +800001FFF00007FFF8000FE0FC001F807E003F803F007F003F007F001F80FF001F80FF00 +1FC0FF001FC0FF001FC0FF001FE0FF001FE0FF001FE0FF001FE07F001FE07F003FE03F00 +3FE01F807FE00F807FE007C1DFE003FF9FE0007E1FE000001FE000001FC000001FC00000 +1FC000003F801F003F803F803F003F803F003F807E003F807C001F01F8001E03F0000FFF +E00007FF800001FE00001B277DA622>I66 D<00003FF001800003FFFE0380000FFFFF87 +80003FF007DF8000FF8001FF8001FE00007F8003FC00003F8007F000001F800FF000000F +801FE0000007801FE0000007803FC0000007803FC0000003807FC0000003807F80000003 +807F8000000000FF8000000000FF8000000000FF8000000000FF8000000000FF80000000 +00FF8000000000FF8000000000FF8000000000FF80000000007F80000000007F80000000 +007FC0000003803FC0000003803FC0000003801FE0000003801FE0000007000FF0000007 +0007F000000E0003FC00001E0001FE00003C0000FF8000F800003FF007E000000FFFFFC0 +000003FFFF000000003FF8000029297CA832>IIII<00007FE003000003FFFC0700001FFFFF0F00003FF00FFF +0000FF8001FF0001FE0000FF0003F800003F0007F000003F000FF000001F001FE000000F +001FE000000F003FC000000F003FC0000007007FC0000007007F80000007007F80000000 +00FF8000000000FF8000000000FF8000000000FF8000000000FF8000000000FF80000000 +00FF8000000000FF8000000000FF8001FFFFF87F8001FFFFF87F8001FFFFF87FC00000FF +003FC00000FF003FC00000FF001FE00000FF001FE00000FF000FF00000FF0007F00000FF +0003F80000FF0001FE0000FF0000FF8001FF00003FF007BF00001FFFFF1F000003FFFE0F +0000007FF003002D297CA836>I73 +D78 D80 +D82 D<7FFFFFFFFFC07FFFFFFFFFC07FFFFFFFFFC07F803FC03FC07E003FC007C078003F +C003C078003FC003C070003FC001C0F0003FC001E0F0003FC001E0E0003FC000E0E0003F +C000E0E0003FC000E0E0003FC000E0E0003FC000E000003FC0000000003FC0000000003F +C0000000003FC0000000003FC0000000003FC0000000003FC0000000003FC0000000003F +C0000000003FC0000000003FC0000000003FC0000000003FC0000000003FC0000000003F +C0000000003FC0000000003FC0000000003FC0000000003FC0000000003FC0000000003F +C0000000003FC00000007FFFFFE000007FFFFFE000007FFFFFE0002B287EA730>84 +D87 D<01FF800007FFF0000F81F8001FC07E001FC0 +7E001FC03F000F803F8007003F8000003F8000003F8000003F80000FFF8000FFFF8007FC +3F800FE03F803F803F803F003F807F003F80FE003F80FE003F80FE003F80FE003F807E00 +7F807F00DF803F839FFC0FFF0FFC01FC03FC1E1B7E9A21>97 DI<001FF80000FFFE0003 +F01F0007E03F800FC03F801F803F803F801F007F800E007F0000007F000000FF000000FF +000000FF000000FF000000FF000000FF000000FF0000007F0000007F0000007F8000003F +8001C01F8001C00FC0038007E0070003F01E0000FFFC00001FE0001A1B7E9A1F>I<0000 +3FF80000003FF80000003FF800000003F800000003F800000003F800000003F800000003 +F800000003F800000003F800000003F800000003F800000003F800000003F800000003F8 +00001FE3F80000FFFBF80003F03FF80007E00FF8000FC007F8001F8003F8003F8003F800 +7F0003F8007F0003F8007F0003F800FF0003F800FF0003F800FF0003F800FF0003F800FF +0003F800FF0003F800FF0003F8007F0003F8007F0003F8007F0003F8003F8003F8001F80 +03F8000F8007F80007C00FF80003F03BFF8000FFF3FF80003FC3FF80212A7EA926>I<00 +3FE00001FFF80003F07E0007C01F000F801F801F800F803F800FC07F000FC07F0007C07F +0007E0FF0007E0FF0007E0FFFFFFE0FFFFFFE0FF000000FF000000FF0000007F0000007F +0000007F0000003F8000E01F8000E00FC001C007E0038003F81F0000FFFE00001FF0001B +1B7E9A20>I<00FF81F003FFE7F80FC1FE7C1F80FC7C1F007C383F007E107F007F007F00 +7F007F007F007F007F007F007F007F007F003F007E001F007C001F80FC000FC1F8001FFF +E00018FF800038000000380000003C0000003E0000003FFFF8001FFFFF001FFFFF800FFF +FFC007FFFFE01FFFFFF03E0007F07C0001F8F80000F8F80000F8F80000F8F80000F87C00 +01F03C0001E01F0007C00FC01F8003FFFE00007FF0001E287E9A22>103 +DI<07000F801FC03FE03FE03FE01FC00F8007000000000000000000000000000000FFE0 +FFE0FFE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE0 +0FE00FE00FE00FE00FE0FFFEFFFEFFFE0F2B7DAA14>I107 DIII<003FE00001FFFC0003F07E000FC01F801F800F +C03F800FE03F0007E07F0007F07F0007F07F0007F0FF0007F8FF0007F8FF0007F8FF0007 +F8FF0007F8FF0007F8FF0007F8FF0007F87F0007F07F0007F03F800FE03F800FE01F800F +C00FC01F8007F07F0001FFFC00003FE0001D1B7E9A22>II114 +D<03FE300FFFF01E03F03800F0700070F00070F00070F80070FC0000FFE0007FFE007FFF +803FFFE01FFFF007FFF800FFF80003FC0000FC60007CE0003CF0003CF00038F80038FC00 +70FF01E0F7FFC0C1FF00161B7E9A1B>I<00700000700000700000700000F00000F00000 +F00001F00003F00003F00007F0001FFFF0FFFFF0FFFFF007F00007F00007F00007F00007 +F00007F00007F00007F00007F00007F00007F00007F00007F00007F03807F03807F03807 +F03807F03807F03803F03803F87001F86000FFC0001F8015267FA51B>II121 D E /Fj 14 118 df<3078FCFC7830060676851A> +46 D<003E0001FF8003FFC007C1E00F00E01E0F703C3FF0387FF07070F870E07870E078 +E1C038E1C038E1C038E1C038E1C038E1C038E1C038E1C03870E07070E0707070E0387FE0 +3C3FC01E0F000F003807C0F803FFF001FFE0003F00151E7E9D1A>64 +D<00FF8003FFC00FFFE01F01E03C00C0780000700000700000E00000E00000E00000E000 +00E000007000007000007800703C00701F01F00FFFE003FFC000FE0014157D941A>99 +D<001FC0001FC0001FC00001C00001C00001C00001C00001C00001C001F1C007FDC00FFF +C01E0FC03C07C07803C07001C0E001C0E001C0E001C0E001C0E001C0E001C0E001C07003 +C07003C03807C03E0FC01FFFFC07FDFC01F1FC161E7E9D1A>I<01F80007FF000FFF801E +07C03C01C07800E07000E0E00070E00070FFFFF0FFFFF0FFFFF0E0000070000070000078 +00703C00701F01F00FFFE003FFC000FE0014157D941A>I<01F87C07FFFE0FFFFE1E078C +1C03803801C03801C03801C03801C03801C01C03801E07801FFF001FFE0039F800380000 +3800001C00001FFF801FFFE03FFFF878007C70001CE0000EE0000EE0000EE0000E70001C +78003C3E00F81FFFF007FFC001FF0017217F941A>103 DI108 D110 D<01F00007FC001FFF003E0F803C07807803C07001C0E000E0E000E0E000E0E000 +E0E000E0E000E0F001E07001C07803C03C07803E0F801FFF0007FC0001F00013157D941A +>I<7F83F0FF8FF87FBFFC03FC3C03F01803E00003C00003C00003800003800003800003 +80000380000380000380000380000380000380007FFF00FFFF007FFF0016157E941A> +114 D<07FB801FFF807FFF80780780E00380E00380E003807800007FC0003FFC0007FE00 +003F800007806001C0E001C0E001C0F003C0FC0780FFFF00EFFE00E3F80012157C941A> +I<00C00001C00001C00001C00001C00001C00001C0007FFFE0FFFFE0FFFFE001C00001C0 +0001C00001C00001C00001C00001C00001C00001C00001C00001C07001C07001C07001C0 +7000E0E000FFE0007FC0001F00141C7F9B1A>II E /Fk 19 122 df<70F8FCFC740404040408 +0810102040060F7C840E>44 D<008003800F80F380038003800380038003800380038003 +800380038003800380038003800380038003800380038003800380038003800380038003 +80038007C0FFFE0F217CA018>49 D<007E0001C1000300800601C00E03C01C03C0180180 +380000380000780000700000700000F0F800F30C00F40600F40300F80380F801C0F001C0 +F001E0F001E0F001E0F001E0F001E07001E07001E07001E03801C03801C01803801C0300 +0C0600070C0001F00013227EA018>54 D<01F000060C000C060018070038038070038070 +0380F001C0F001C0F001C0F001E0F001E0F001E0F001E0F001E07001E07003E03803E018 +05E00C05E00619E003E1E00001C00001C00001C000038000038030030078070078060070 +0C002018001030000FC00013227EA018>57 D70 D72 D76 D<7FFFFFF878078078600780184007800840 +07800840078008C007800C80078004800780048007800480078004000780000007800000 +078000000780000007800000078000000780000007800000078000000780000007800000 +078000000780000007800000078000000780000007800000078000000780000007800000 +078000000FC00003FFFF001E227EA123>84 D<0FE0001838003C0C003C0E001807000007 +0000070000070000FF0007C7001E07003C0700780700700700F00708F00708F00708F00F +087817083C23900FC1E015157E9418>97 D<0E0000FE00001E00000E00000E00000E0000 +0E00000E00000E00000E00000E00000E00000E00000E00000E1F000E61C00E80600F0030 +0E00380E003C0E001C0E001E0E001E0E001E0E001E0E001E0E001E0E001E0E001C0E003C +0E00380F00700C80600C41C0083F0017237FA21B>I<01FC000707000C03801C01C03801 +C07801E07000E0F000E0FFFFE0F00000F00000F00000F00000F000007000007800203800 +201C00400E008007030000FC0013157F9416>101 D<0E0000FE00001E00000E00000E00 +000E00000E00000E00000E00000E00000E00000E00000E00000E00000E1F800E60C00E80 +E00F00700F00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00 +700E00700E00700E00700E00700E0070FFE7FF18237FA21B>104 +D<0E1FC07F00FE60E183801E807201C00F003C00E00F003C00E00E003800E00E003800E0 +0E003800E00E003800E00E003800E00E003800E00E003800E00E003800E00E003800E00E +003800E00E003800E00E003800E00E003800E00E003800E00E003800E0FFE3FF8FFE2715 +7F942A>109 D<0E1F80FE60C01E80E00F00700F00700E00700E00700E00700E00700E00 +700E00700E00700E00700E00700E00700E00700E00700E00700E00700E0070FFE7FF1815 +7F941B>I<01FC000707000C01801800C03800E0700070700070F00078F00078F00078F0 +0078F00078F00078F000787000707800F03800E01C01C00E038007070001FC0015157F94 +18>I<0E3CFE461E8F0F0F0F060F000E000E000E000E000E000E000E000E000E000E000E +000E000E000F00FFF010157F9413>114 D<0F8830786018C018C008C008E008F0007F80 +3FE00FF001F8003C801C800C800CC00CC008E018D0308FC00E157E9413>I<0E0070FE07 +F01E00F00E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00 +700E00700E00700E00F00E00F006017003827800FC7F18157F941B>117 +D121 +D E /Fl 1 4 df<00C00000C00000C00000C00000C000C0C0C0F0C3C038C7000EDC0003 +F00000C00003F0000EDC0038C700F0C3C0C0C0C000C00000C00000C00000C00000C00012 +157D9619>3 D E /Fm 21 122 df<78FCFCFEFE7A020202020204040408081020204007 +147AB112>39 D<00020004000800100030006000C000C0018001800300070006000E000E +000C001C001C001800380038003800700070007000700070007000F000F000E000E000E0 +00E000E000E000E000E000E000E000E000E000E000F000F0007000700070007000700070 +0038003800380018001C001C000C000E000E000600070003000180018000C000C0006000 +3000100008000400020F497AB519>I<800040002000100018000C000600060003000300 +018001C000C000E000E00060007000700030003800380038001C001C001C001C001C001C +001E001E000E000E000E000E000E000E000E000E000E000E000E000E000E001E001E001C +001C001C001C001C001C003800380038003000700070006000E000E000C001C001800300 +0300060006000C00180010002000400080000F497CB519>I69 DI<00001FE000800000FFFC +01800007F00F0180000F80018380003E0000C38000780000278000F00000178001E00000 +0F8003C000000F800780000007800780000003800F00000003801F00000001801E000000 +01803E00000001803C00000001803C00000000807C00000000807C000000008078000000 +0000F80000000000F80000000000F80000000000F80000000000F80000000000F8000000 +0000F80000000000F80000000000F80000000000F80000000000F800000FFFFC7800000F +FFFC7C0000001FC07C0000000F803C0000000F803C0000000F803E0000000F801E000000 +0F801F0000000F800F0000000F80078000000F8007C000000F8003C000000F8001E00000 +0F8000F000001780007C00001780003E00006380000F8000C3800007F00781800000FFFE +008000001FF000002E337CB134>I73 D77 DI80 +D85 D<00FE00000303C0000C00E000100070 +00100038003C003C003E001C003E001E003E001E0008001E0000001E0000001E0000001E +00000FFE0000FC1E0003E01E000F801E001F001E003E001E003C001E007C001E00F8001E +04F8001E04F8001E04F8003E04F8003E0478003E047C005E043E008F080F0307F003FC03 +E01E1F7D9E21>97 D<003F800000E0E0000380380007003C000E001E001E001E001C000F +003C000F007C000F0078000F8078000780F8000780F8000780FFFFFF80F8000000F80000 +00F8000000F8000000F8000000F8000000780000007C0000003C0000003C0000801E0000 +800E0001000F0002000780020001C00C0000F03000001FC000191F7E9E1D>101 +D<0F001F801F801F801F800F000000000000000000000000000000000000000000000007 +80FF80FF800F800780078007800780078007800780078007800780078007800780078007 +800780078007800780078007800780078007800FC0FFF8FFF80D307EAF12>105 +D<0780FF80FF800F80078007800780078007800780078007800780078007800780078007 +800780078007800780078007800780078007800780078007800780078007800780078007 +80078007800780078007800780078007800780078007800FC0FFFCFFFC0E327EB112> +108 D<0780FE001FC000FF83078060F000FF8C03C18078000F9001E2003C0007A001E400 +3C0007A000F4001E0007C000F8001E0007C000F8001E00078000F0001E00078000F0001E +00078000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E00 +078000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E0007 +8000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E000780 +00F0001E00078000F0001E00078000F0001E000FC001F8003F00FFFC1FFF83FFF0FFFC1F +FF83FFF0341F7E9E38>I<0780FE0000FF83078000FF8C03C0000F9001E00007A001E000 +07A000F00007C000F00007C000F000078000F000078000F000078000F000078000F00007 +8000F000078000F000078000F000078000F000078000F000078000F000078000F0000780 +00F000078000F000078000F000078000F000078000F000078000F000078000F000078000 +F000078000F0000FC001F800FFFC1FFF80FFFC1FFF80211F7E9E25>I<0783E0FF8C18FF +907C0F907C07A07C07C03807C00007C00007C00007800007800007800007800007800007 +800007800007800007800007800007800007800007800007800007800007800007800007 +80000780000FC000FFFE00FFFE00161F7E9E19>114 D<01FC100E03301800F030007060 +0030E00030E00010E00010E00010F00010F800007E00003FF0001FFF000FFFC003FFE000 +3FF00001F80000F880003C80003C80001CC0001CC0001CE0001CE00018F00038F00030CC +0060C301C080FE00161F7E9E1A>I<078000F000FF801FF000FF801FF0000F8001F00007 +8000F000078000F000078000F000078000F000078000F000078000F000078000F0000780 +00F000078000F000078000F000078000F000078000F000078000F000078000F000078000 +F000078000F000078000F000078000F000078000F000078001F000078001F000078001F0 +00038002F00003C004F00001C008F800007030FF80001FC0FF80211F7E9E25>117 +D121 D E end +%%EndProlog +%%BeginSetup +%%Feature: *Resolution 300dpi +TeXDict begin + +%%EndSetup +%%Page: 1 1 +1 0 bop 630 219 a Fm(FFIGEN)22 b(User's)g(Man)n(ual)1321 +193 y Fl(\003)780 311 y Fm(\(Preliminary\))749 456 y +Fk(Lars)17 b(Thomas)f(Hansen)744 514 y Fj(lth@cs.uore)o(gon)o(.e)o(du) +795 612 y Fk(F)l(ebruary)g(6,)g(1996)0 791 y Fi(1)69 +b(In)n(tro)r(duction)0 881 y Fh(FFIGEN)19 b(is)g(a)g(program)f(system)h +(whic)o(h)g(facilitates)f(the)i(writing)e(of)h(translators)g(from)f(C)h +(header)h(\014les)f(to)h(foreign)0 931 y(function)g(in)o(terfaces)i +(for)e(particular)h(programming)c(language)j(implemen)o(tatio)o(ns.)36 +b(This)21 b(do)q(cumen)o(t)f(describ)q(es)j(its)0 981 +y(structure)c(and)e(use.)28 b(The)17 b(discussion)h(is)f(aimed)e(at)i +(translator)g(writers;)i(ev)o(ery)o(one)f(else)f(should)g(con\014ne)h +(themselv)o(es)0 1031 y(to)g(section)g(3.)29 b(A)18 b(companion)d(do)q +(cumen)o(t,)j Fg(FFIGEN)h(Manifesto)f(and)i(Overview)p +Fh(,)d(motiv)n(ates)f(the)i(w)o(ork,)g(and)f(other)0 +1081 y(companion)d(do)q(cumen)o(ts)i(describ)q(e)i(sp)q(eci\014c)g +(translator)e(implem)o(en)o(tations.)22 b(In)16 b(particular,)g(the)h +(do)q(cumen)o(t)f Fg(FFIGEN)0 1131 y(Back-end)g(for)e(Chez)h(Scheme)h +(V)m(ersion)e(5)20 b Fh(describ)q(es)c(one)e(translator)g(in)f(detail.) +62 1180 y(FFIGEN)e(is)g(based)h(on)f(the)g Ff(lcc)g Fh(C)g(compiler,)e +(whic)o(h)i(is)g(cop)o(yrigh)o(ted)g(soft)o(w)o(are.)17 +b(See)12 b(section)g(10)e(for)h(a)g(full)e(cop)o(yrigh)o(t)0 +1230 y(notice.)0 1367 y Fi(2)69 b(W)-6 b(riting)22 b(T)-6 +b(ranslators)0 1458 y Fh(T)m(o)15 b(generate)i(a)f(translation)f(of)h +(a)f(header)i(\014le)f(y)o(ou)g(run)g(the)h Ff(ffigen)d +Fh(command)g(to)i(generate)h(an)f(in)o(termediate)f(form)0 +1508 y(of)e(the)i(C)e(header)i(\014les)f(y)o(ou)g(w)o(an)o(t)f(to)h +(translate,)g(and)f(then)i(run)f(the)g(bac)o(k-end)g(on)g(the)g +(resulting)g(\014les)h(to)e(generate)i(the)0 1558 y(foreign)e(function) +h(in)o(terface)g(for)g(the)g(library)m(.)62 1608 y(Y)m(our)h(task,)h +(should)f(y)o(ou)g(c)o(ho)q(ose)h(to)f(accept)i(it,)e(is)g(to)g +(implemen)o(t)e(the)j(target-sp)q(eci\014c)h(parts)f(of)f(the)h(bac)o +(k-end)f(for)0 1658 y(y)o(our)j(particular)g(target)h(\(whic)o(h)f(is)g +(to)g(sa)o(y)m(,)g(com)o(bination)e(of)h(host)i(language)e(implemen)o +(tation,)f(op)q(erating)i(system,)0 1707 y(arc)o(hitecture,)24 +b(foreign)c(language)f(implemen)o(tation,)g(and)h(translation)g(p)q +(olicy\).)38 b(Y)m(ou)20 b(should)g(b)q(e)h(able)f(to)h(use)g(the)0 +1757 y(FFIGEN)14 b(fron)o(t-end)g(and)g(the)g(target-indep)q(enden)o(t) +i(parts)e(of)f(the)i(bac)o(k-end)f(prett)o(y)h(m)o(uc)o(h)e(as)h(they)g +(are.)62 1807 y(Ho)o(w)j(to)f(implemen)o(t)e(the)j(target-sp)q +(eci\014c)i(parts)e(of)f(the)h(bac)o(k-end)h(is)e(discussed)i(in)f +(section)g(6.)26 b(Use)18 b(of)e(the)h(fron)o(t)0 1857 +y(end)d(is)f(describ)q(ed)i(in)e(section)h(3.)k(The)c(in)o(termediate)e +(format)g(is)h(describ)q(ed)i(in)e(section)h(4,)f(and)g(the)h +(target-indep)q(enden)o(t)0 1907 y(parts)j(of)e(the)i(bac)o(k-end)f +(and)g(their)h(in)o(terface)f(to)g(the)h(target-dep)q(enden)o(t)h(part) +e(are)h(describ)q(ed)h(in)d(section)i(5.)25 b(Finally)m(,)0 +1957 y(section)15 b(7)e(co)o(v)o(ers)i(some)e(issues)i(whic)o(h)f(need) +h(to)e(b)q(e)i(tac)o(kled)f(in)f(the)i(future.)0 2094 +y Fi(3)69 b(Running)23 b(FFIGEN)0 2185 y Fh(The)d(command)d +Ff(ffigen)h Fh(is)h(run)h(on)f(a)g(set)i(of)d(header)j(\014les)f(with)f +(prepro)q(cessor)j(option)d(and)g(include)g(\014le)h(options.)0 +2235 y(Argumen)o(ts)f(are)h(pro)q(cessed)i(in)d(order.)36 +b(F)m(or)19 b(eac)o(h)h(header)h(\014le)e(\(t)o(yp)q(e)i +Ff(.h)p Fh(\))e(and)g(all)g(the)h(\014les)g(it)f(includes,)i(a)e +(single)0 2284 y(prepro)q(cessor)d(\014le)e(\(t)o(yp)q(e)h +Ff(.ffi)p Fh(\))e(is)h(pro)q(duced.)62 2334 y(The)h(options)e(are:)21 +2425 y Ff(-Dname[=value])e Fh(De\014ne)j(prepro)q(cessor)j(macro.)21 +2508 y Ff(-Uname)12 b Fh(Unde\014ne)j(prepro)q(cessor)i(macro)p +0 2543 780 2 v 46 2570 a Fe(\003)64 2582 y Fd(This)c(w)o(ork)g(has)f(b) +q(een)g(supp)q(orted)e(b)o(y)j(ARP)m(A)h(under)e(U.S.)h(Arm)o(y)f(gran) +o(t)g(No.)h(D)o(ABT63-94-C-0029,)f(\\Programm)o(ing)e(En)o(vironmen)o +(t)o(s,)0 2621 y(Compiler)g(T)m(ec)o(hnology)f(and)i(Run)o(time)e +(Systems)h(for)h(Ob)r(ject)g(Orien)o(ted)f(P)o(arallel)g(Pro)q +(cessing".)965 2828 y Fh(1)p eop +%%Page: 2 2 +2 1 bop 21 45 a Ff(-Idirectory)14 b Fh(Add)j(directory)g(to)f(the)h +Fg(b)n(e)n(ginning)h Fh(of)d(the)j(list)e(of)f(include)i(\014les.)26 +b(Standard)17 b(directories)h(include)e(the)104 95 y +Ff(lcc)e Fh(include)g(directory)m(,)h Ff(/usr/include)p +Fh(,)c(and)j(the)i(curren)o(t)g(directory)f(\(in)f(that)g(order\).)21 +b(See)15 b(the)h(release)f(notes)104 145 y(for)e(information)e(ab)q +(out)j(ho)o(w)g(to)f(c)o(hange)h(the)h(defaults.)0 229 +y Ff(ffigen)e Fh(p)q(erforms)g(full)g(syn)o(tax)g(and)h(t)o(yp)q(e)h(c) +o(hec)o(ks)g(on)e(its)h(input.)62 278 y(The)d(bac)o(k-end)f(is)g(run)h +(b)o(y)f(starting)g(y)o(our)g(fa)o(v)o(orite)f(Sc)o(heme)h(system)g +(and)g(then)h(loading)e(\014rst)i(the)f(target-indep)q(enden)o(t)0 +328 y(\014le)16 b Ff(process.sch)f Fh(and)h(second)i(the)f(target-dep)q +(enden)o(t)h(part)f(of)f(the)h(translator;)g(in)f(the)h(case)h(of)e +(the)h(Chez)g(Sc)o(heme)0 378 y(bac)o(k-end)c(the)h(\014le)f(is)g +(called)g Ff(chez.sch)p Fh(.)j(Y)m(ou)d(then)g(call)g(the)h(pro)q +(cedure)h Ff(process)c Fh(with)i(the)h(name)e(of)g(the)i +Ff(.ffi)e Fh(\014le)h(to)0 428 y(pro)q(cess,)i(as)f(discussed)i(in)d +(section)i(5.)0 564 y Fi(4)69 b(In)n(termediate)21 b(F)-6 +b(ormat)0 655 y Fh(The)14 b(in)o(termediate)f(format)f(consists)j(of)f +(s-expressions)h(follo)o(wing)d(this)i(gramm)o(ar:)44 +739 y Ff()129 b(->)21 b()g(...)44 788 y()85 +b(->)21 b(\(function)f()g()h()f(\))327 +838 y(|)h(\(var)g()f()h()f(\))327 +888 y(|)h(\(type)g()f()h(\))327 +938 y(|)g(\(struct)g()f()g(\(\()g(\))h +(...\)\))327 988 y(|)g(\(union)g()f()g(\(\()g +(\))h(...\)\))327 1038 y(|)g(\(enum)g()f()h +(\(\()f(\))g(...\)\))327 1087 y(|)h(\(enum-ident)f +()g()g(\))327 1137 y(|)h(\(macro)g()f +()f(\))44 1187 y()129 b(->)21 +b(\()f(\))327 1237 y(|)h(\(struct-ref)f(\))327 +1287 y(|)h(\(union-ref)f(\))327 1336 y(|)h(\(enum-ref)f(\)) +327 1386 y(|)h(\(function)f(\()h(...\))g(\))327 +1436 y(|)g(\(pointer)g(\))327 1486 y(|)g(\(array)g()f +(\))44 1536 y()107 b(->)21 b(\()g(...\))44 +1586 y()129 b(->)21 b(static)g(|)h(extern)e(|)i(const)f(|)g +(volatile)44 1635 y()e(->)i(char)g(|)h(signed-char)e(|)h +(unsigned-char)e(|)j(short)327 1685 y(|)f(unsigned-short)e(|)j(int)f(|) +h(unsigned)e(|)h(long)327 1735 y(|)g(unsigned-long)f(|)h(float)g(|)h +(double)e(|)i(void)44 1785 y()107 b(->)21 b()44 +1835 y()41 b(->)21 b()44 1884 y()129 +b(->)21 b()44 1934 y()129 b(->)21 b()44 +1984 y()e(->)i()44 2034 y()151 +b(->)21 b()0 2118 y Fh(Notes)15 b(relating)e(to)h(the)g +(grammar:)62 2195 y Fc(\017)21 b Ff(...)13 b Fh(means)g(\\zero)i(or)e +(more)g(of)s(")h(the)g(preceding)h(item.)62 2275 y Fc(\017)21 +b Fh(The)13 b(grammar)d(is)j(a)g(little)f(more)g(general)i(than)f(the)h +(actual)e(output)i(language.)i(All)d(structs,)h(unions,)f(and)g(en)o +(ums)104 2325 y(in)e(parameter)g(lists,)h(return)h(t)o(yp)q(es,)g(and)e +(v)n(ariable)g(declarations)h(are)g(enco)q(ded)h(as)f +Ff(struct-ref)p Fh(,)d Ff(union-ref)p Fh(,)h(and)104 +2374 y Ff(enum-ref)p Fh(,)h(resp)q(ectiv)o(ely;)k(structure,)g(union,)e +(and)g(en)o(um)g(t)o(yp)q(e)h(de\014nitions)g(o)q(ccur)g(only)f(in)g +Ff(struct)p Fh(,)f Ff(union)p Fh(,)g(and)104 2424 y Ff(enum)h +Fh(records.)62 2504 y Fc(\017)21 b Fh(The)15 b Ff()f +Fh(\014eld)h(in)f(structs/unions/en)o(ums)i(\(and)f(their)g +Ff(-ref)f Fh(forms\))g(is)g(the)i(tag.)21 b(If)14 b(one)h(of)g(these)h +(t)o(yp)q(es)g(has)104 2554 y(a)e(user-de\014ned)i(tag,)d(then)i(that)g +(tag)e(is)i(used)g(in)e(the)i Ff(struct-ref)d Fh(item)h(for)h(the)h(t)o +(yp)q(e;)g(if)e(the)i(structure)h(had)e(no)104 2604 y(user-de\014ned)19 +b(tag)d(then)i(a)e(tag)h(has)g(b)q(een)g(generated)i(b)o(y)d +Ff(lcc)p Fh(.)26 b(Generated)18 b(tags)f(ha)o(v)o(e)g(the)g(syn)o(tax)g +(of)f(p)q(ositiv)o(e)104 2654 y(in)o(tegers;)i(in)d(particular)h(they)h +(start)g(with)f(a)g(digit.)24 b(There)17 b(is)g(one)f(namespace)g(eac)o +(h)h(for)f(structs,)i(unions,)e(and)104 2704 y(en)o(ums.)965 +2828 y(2)p eop +%%Page: 3 3 +3 2 bop 62 45 a Fc(\017)21 b Ff(typedef)12 b Fh(names)h(are)i(not)e +(used)i(an)o(ywhere:)k(they)14 b(o)q(ccur)h(in)f Ff(type)f +Fh(records)i(only)m(.)62 128 y Fc(\017)21 b Fh(The)14 +b(attributes)h(on)e(primitiv)o(e)f(t)o(yp)q(es)i(are)g +Ff(const)f Fh(or)h Ff(volatile)p Fh(;)d(the)k(attributes)f +Ff(static)f Fh(and)g Ff(extern)g Fh(are)h(used)104 178 +y(only)f(on)h(functions)f(and)h(global)e(v)n(ariables.)62 +261 y Fc(\017)21 b Fh(F)m(unctions)g(whic)o(h)f(are)i(kno)o(wn)e(to)h +(tak)o(e)g(no)g(parameters)g(\(i.e.)f Ff(t)h(f\(void\)\))e +Fh(ha)o(v)o(e)i(one)g(parameter,)h(of)e(t)o(yp)q(e)104 +311 y Ff(\(void)h(\(\)\))p Fh(.)c(The)d(v)o(oid)f(t)o(yp)q(e)i(app)q +(ears)f(in)g(a)f(parameter)h(list)f(only)g(as)h(the)h(last)e(elemen)o +(t.)62 394 y Fc(\017)21 b Fh(F)m(unctions)16 b(whic)o(h)h(tak)o(e)g(a)f +(v)n(ariable)g(n)o(um)o(b)q(er)g(of)g(argumen)o(ts)f(ha)o(v)o(e)i(at)f +(least)h(one)g(de\014ned)h(non-v)o(oid)d(parameter)104 +443 y(and)e(a)h(last)g(parameter)f(of)h(t)o(yp)q(e)g +Ff(\(void)21 b(\(\)\))p Fh(.)62 526 y Fc(\017)g Fh(F)m(unctions)14 +b(for)f(whic)o(h)h(no)g(parameters)g(w)o(ere)g(de\014ned)h(\(i.e.)e +Ff(t)22 b(f\(\))p Fh(\))13 b(ha)o(v)o(e)h(no)g(parameters.)62 +609 y Fc(\017)21 b Fh(The)d(ordering)h(of)e(records)j(in)e(the)h(input) +f(has)g(no)g(relation)g(to)g(the)g(relativ)o(e)g(ordering)h(of)e +(declarations)i(in)e(the)104 659 y(original)12 b(source.)62 +742 y Fc(\017)21 b Fh(The)14 b Ff()e Fh(\014eld)i(in)g(the)g +(arra)o(y)g(is)g(its)g(size.)k(If)c(the)g(size)h(is)f(not)g(kno)o(wn,)f +(it)g(is)h(0.)62 825 y Fc(\017)21 b Fh(Multidimensional)10 +b(arra)o(ys)k(are)h(represen)o(ted)h(as)e(nested)h(arra)o(y)f(t)o(yp)q +(es)g(with)g(the)g(leftmost)e(dimension)g(outermost)104 +875 y(in)h(the)i(exp)q(ected)h(w)o(a)o(y;)c(i.e.,)h(it)g(lo)q(oks)h +(lik)o(e)f(an)g(arra)o(y)h(of)f(arra)o(ys.)62 958 y Fc(\017)21 +b Fh(Arra)o(ys)14 b(are)g(not)g(v)n(alid)f(return)i(t)o(yp)q(es.)62 +1041 y Fc(\017)21 b Fh(Arra)o(y)10 b(parameters)g(lose)h(some)e(seman)o +(tic)g(information)f(in)i(the)g(translation)g(in)g(the)h(curren)o(t)g +(system.)17 b(An)10 b(arra)o(y)g(pa-)104 1091 y(rameter)h +Ff(t)21 b(a[n])10 b Fh(is)h(alw)o(a)o(ys)f(con)o(v)o(erted)j(to)e(a)f +(p)q(oin)o(ter:)17 b Ff(\(pointer)j(t\))11 b Fh(regardless)h(of)f +(whether)h Ff(n)f Fh(is)g(kno)o(wn)f(or)i(not.)104 1141 +y(As)e(exp)q(ected,)h(then,)g(something)d(lik)o(e)g Ff(t)22 +b(a[n][m][o])7 b Fh(gets)j(the)g(parameter)f(t)o(yp)q(e)g +Ff(\(pointer)21 b(\(array)f(m)i(\(array)e(o)i(t\)\)\))p +Fh(.)104 1190 y(Note)13 b(that)f(this)h(only)f(p)q(ertains)h(to)g +(parameter)f(t)o(yp)q(es;)h(v)n(ariables)f(of)g(arra)o(y)h(t)o(yp)q(e)g +(are)g(not)f(con)o(v)o(erted)i(in)e(this)h(man-)104 1240 +y(ner.)24 b(\(The)17 b(seman)o(tic)d(information)f(claimed)h(lost)i(is) +g(the)g(size)g(of)g(the)g(leftmost)e(dimension.)23 b(This)15 +b(lossage)h(ma)o(y)104 1290 y(mak)o(e)c(it)i(imp)q(ossible)e(to)i(p)q +(erform)f(arra)o(y)g(con)o(v)o(ersion)h(at)g(call)f(b)q(oundaries,)h +(for)g(example.\))62 1373 y Fc(\017)21 b Fh(The)16 b(grammar)d(describ) +q(es)k(the)g(curren)o(t)g(format,)d(whic)o(h)i(will)e(c)o(hange:)22 +b(line)15 b(n)o(um)o(b)q(er)g(and)h(column)e(information)104 +1423 y(will)f(b)q(e)i(incorp)q(orated.)22 b(Y)m(ou)14 +b(should)h(alw)o(a)o(ys)e(use)j(the)f(accessor)i(functions)e(de\014ned) +h(in)e(the)h(target-indep)q(enden)o(t)104 1473 y(part)j(of)f(the)h(bac) +o(k-end;)i(see)f(section)f(5.)29 b(The)18 b(grammar)d(do)q(es)j(not)g +(allo)o(w)e(for)h(bit)h(\014elds)g(or)g(quali\014cations)e(on)104 +1522 y(an)o(ything)d(but)h(primitiv)o(e)e(t)o(yp)q(es,)i(but)g(these)h +(will)e(b)q(e)h(accomo)q(dated)f(ev)o(en)o(tually)m(.)0 +1660 y Fi(5)69 b(The)23 b(T)-6 b(arget-Indep)r(enden)n(t)22 +b(Bac)n(k-End)0 1751 y Fh(The)15 b(target-indep)q(enden)o(t)i(bac)o +(k-end)e(is)g(a)g(Sc)o(heme)f(program)g(called)g Ff(process)1289 +1736 y Fb(1)1321 1751 y Fh(whic)o(h)h(reads)h(the)g(in)o(termediate)e +(form)0 1800 y(in)o(to)h(memory)e(and)j(p)q(erforms)f(some)g(initial)e +(pro)q(cessing.)25 b(It)16 b(exp)q(orts)g(some)f(global)f(v)n(ariables) +h(and)h(a)f(n)o(um)o(b)q(er)g(of)g(pro-)0 1850 y(cedures)k(whic)o(h)d +(are)h(used)h(to)e(access)j(the)e(structures)i(in)d(the)h(database)g +(of)f(in)o(termediate)g(records,)j(and)d(imp)q(orts)f(t)o(w)o(o)0 +1900 y(target-dep)q(enden)o(t)h(functions)e(from)e(the)j(target-dep)q +(enden)o(t)h(bac)o(k-end.)i(This)c(section)g(describ)q(es)i(the)f(in)o +(terfaces.)62 1950 y(The)g(global)d(v)n(ariables)h(whic)o(h)h(hold)f +(the)h(database)h(are:)87 2041 y Ff(\(define)21 b(functions)e('\(\)\)) +130 b(;)22 b(list)f(of)g(function)f(records)87 2091 y(\(define)h(vars)f +('\(\)\))239 b(;)22 b(list)f(of)g(var)g(records)87 2141 +y(\(define)g(types)f('\(\)\))217 b(;)22 b(list)f(of)g(type)g(records)87 +2191 y(\(define)g(structs)f('\(\)\))173 b(;)22 b(list)f(of)g(struct)g +(records)87 2240 y(\(define)g(unions)f('\(\)\))195 b(;)22 +b(list)f(of)g(union)g(records)87 2290 y(\(define)g(macros)f('\(\)\))195 +b(;)22 b(list)f(of)g(macro)g(records)87 2340 y(\(define)g(enums)f +('\(\)\))217 b(;)22 b(list)f(of)g(enum)g(records)87 2390 +y(\(define)g(enum-idents)e('\(\)\))86 b(;)22 b(list)f(of)g(enum-ident)f +(records)62 2481 y Fh(Eac)o(h)c(of)f(these)i(con)o(tains)e(a)g(list)g +(of)g(all)f(the)i(records)h(of)e(the)h(t)o(yp)q(e)g(indicated)f(b)o(y)g +(their)h(names.)22 b(Note)16 b(that)f(records)0 2531 +y(ma)o(y)c(lo)q(ok)h(di\013eren)o(t)i(in)o(ternally)d(than)i(in)g(the)g +(de\014ned)h(in)o(termediate)e(form,)f(so)i(accessor)h(functions)f +(\(see)h(b)q(elo)o(w\))f(should)0 2581 y(alw)o(a)o(ys)g(b)q(e)h(used.) +62 2630 y(In)g(addition,)e(there)k(are)e(t)o(w)o(o)f(globals)g(whic)o +(h)h(are)g(set)h(but)f(not)g(used)g(b)o(y)g(the)h(target-indep)q(enden) +o(t)g(bac)o(k-end:)p 0 2665 780 2 v 46 2692 a Fa(1)64 +2704 y Fd(F)m(or)c(the)g(lac)o(k)f(of)h(something)e(b)q(etter.)965 +2828 y Fh(3)p eop +%%Page: 4 4 +4 3 bop 87 45 a Ff(\(define)21 b(source-file)e(#f\))108 +b(;)22 b(name)f(of)g(the)g(input)g(file)g(itself)87 95 +y(\(define)g(filenames)e('\(\)\))130 b(;)22 b(names)f(of)g(all)g(files) +g(in)g(the)h(input)62 185 y Fh(The)17 b(main)e(en)o(try)i(p)q(oin)o(t)f +(to)h(the)g(bac)o(k)g(end)g(is)f(the)h(pro)q(cedure)i +Ff(process)p Fh(,)c(whic)o(h)i(tak)o(es)g(a)f(single)g(\014le)h(name)e +(as)i(an)0 235 y(argumen)o(t.)g Ff(Process)12 b Fh(initializes)h +(globals,)f(reads)j(the)f(\014le,)g(and)g(pro)q(cesses)i(the)f +(records.)87 325 y Ff(\(define)21 b(\(process)f(filename\))g(...\))62 +416 y Fh(Record)12 b(pro)q(cessing)h(consists)g(of)e(some)g(general)h +(analysis)f(and)h(target-sp)q(eci\014c)h(co)q(de)g(generation.)k +(First,)12 b(the)h(target-)0 465 y(sp)q(eci\014c)21 b(pro)q(cedure)h +Ff(select-functions)16 b Fh(is)k(called;)h(it)f(m)o(ust)e(set)j(or)f +(reset)h(the)f(\\referenced")i(bit)d(in)h(eac)o(h)g(record)0 +515 y(dep)q(ending)d(on)f(whether)i(the)f(function)f(is)g(in)o +(teresting)h(to)g(the)g(bac)o(k-end)f(or)h(not.)25 b(After)17 +b(computing)e(reac)o(habilit)o(y)h(of)0 565 y(structured)e(t)o(yp)q(es) +e(and)f(setting)h(the)g(referenced)i(bits)e(of)f(those)h(t)o(yp)q(es)g +(whic)o(h)f(are)h(reac)o(hable,)g(a)g(translation)e(is)i(generated)0 +615 y(b)o(y)i(a)f(call)g(to)h(the)h(bac)o(k-end)f(function)f +Ff(generate-translation)o Fh(,)e(whic)o(h)i(tak)o(es)i(no)e(argumen)o +(ts.)87 705 y Ff(\(define)21 b(\(select-functio)o(ns\))e(...\))87 +755 y(\(define)i(\(generate-trans)o(latio)o(n\))e(...\))62 +845 y Fh(A)g(n)o(um)o(b)q(er)f(of)f(data)i(structure)h(accessors)h(and) +d(m)o(utators)f(are)i(also)f(a)o(v)n(ailable.)30 b(These)19 +b(are)g(generic)h(pro)q(cedures)0 895 y(whic)o(h)14 b(w)o(ork)f(on)h +(all)f(of)g(the)h(record)i(t)o(yp)q(es.)87 985 y Ff(\(define)21 +b(\(file)f(r\))i(...\))217 b(;)21 b(file)g(name)g(of)h(record)87 +1035 y(\(define)f(\(name)f(r\))i(...\))217 b(;)21 b(name)g(in)h +(records)e(which)h(have)g(one)87 1085 y(\(define)g(\(type)f(r\))i +(...\))217 b(;)21 b(type)g(in)h(records)e(which)h(have)g(one)87 +1135 y(\(define)g(\(attrs)f(r\))h(...\))196 b(;)21 b(attrs)g(in)g +(records)g(which)g(have)g(one)87 1184 y(\(define)g(\(fields)f(r\))h +(...\))174 b(;)21 b(fields)g(in)g(struct/union)f(record)87 +1234 y(\(define)h(\(value)f(r\))h(...\))196 b(;)21 b(value)g(of)g +(enum-ident)f(record)87 1284 y(\(define)h(\(tag)f(r\))i(...\))239 +b(;)21 b(tag)h(in)f(struct/union/unio)o(n/-re)o(f)e(record)87 +1384 y(\(define)i(\(referenced?)e(r\))i(...\))65 b(;)21 +b(is)h(record)e(referenced?)87 1434 y(\(define)h(\(referenced!)e(r\))i +(...\))65 b(;)21 b(set)h(referenced)d(bit)87 1483 y(\(define)i +(\(unreferenced!)d(r\))k(...\))f(;)g(reset)g(referenced)f(bit)0 +1574 y Fh(Arguably)12 b(the)i Ff(tag)e Fh(accessor)j(should)e(go)f(a)o +(w)o(a)o(y)g(and)h Ff(name)f Fh(should)h(simply)e(b)q(e)i(used)h(in)f +(its)g(place.)18 b(As)13 b(it)g(is,)f Ff(name)g Fh(is)h(not)0 +1623 y(de\014ned)i(on)f Ff(struct-ref)p Fh(,)d Ff(union-ref)p +Fh(,)g(and)j Ff(enum-ref)e Fh(records.)62 1673 y(The)j(pro)q(cedure)h +Ff(record-tag)c Fh(returns)k(the)f(tag)f(of)f(the)i(record)h(curren)o +(tly)f(b)q(eing)f(held.)19 b(It)c(can)f(also)g(b)q(e)g(applied)g(to)0 +1723 y(t)o(yp)q(es.)87 1813 y Ff(\(define)21 b(\(record-tag)e(r\))i +(...\))87 b(;)21 b(get)h(record)e(tag)62 1904 y Fh(All)f(records)j(can) +e(ha)o(v)o(e)g(bac)o(k-end)g(sp)q(eci\014c)i(v)n(alues)d(attac)o(hed)i +(to)f(them;)h(usually)e(these)j(are)e(cac)o(hed)h(names)e(for)0 +1953 y(op)q(erations)14 b(on)f(structured)j(v)n(alues,)d(so)h(for)f(no) +o(w)g(the)h(pro)q(cedures)i(whic)o(h)e(manipulate)d(the)j(bac)o(k-end)g +(sp)q(eci\014c)h(data)f(are)0 2003 y(called)g Ff(cache-name)d +Fh(to)j(remem)o(b)q(er)f(a)h(v)n(alue)f(and)h Ff(cached-names)d +Fh(to)j(return)h(the)f(list)g(of)f(remem)o(b)q(ered)g(v)n(alues:)87 +2093 y Ff(\(define)21 b(\(cache-name)e(r)j(v\))f(...\))43 +b(;)21 b(remember)f(value)h(in)h(record)87 2143 y(\(define)f +(\(cached-names)e(r\))i(...\))43 b(;)21 b(retrieve)f(remembered)g +(values)0 2234 y Fh(W)m(e)13 b(should)h(probably)f(replace)i(this)f +(with)g(a)f(more)g(general)h(prop)q(ert)o(y-list-lik)o(e)g(mec)o +(hanism.)62 2283 y(In)g(addition,)e(t)o(w)o(o)i(pro)q(cedures)i +(extract)f(parts)f(of)g(function)f(t)o(yp)q(es:)87 2374 +y Ff(\(define)21 b(\(arglist)f(r\))h(...\))152 b(;)21 +b(function)f(argument)h(types)87 2423 y(\(define)g(\(rett)f(r\))i +(...\))217 b(;)21 b(function)f(return)h(type)62 2514 +y Fh(Some)13 b(utilities)g(to)h(deal)f(with)h(\014le)g(names)f(are)h +(also)g(pro)o(vided:)87 2604 y Ff(\(define)21 b(\(strip-extensio)o(n)e +(fn\))i(...\))87 2654 y(\(define)g(\(strip-path)e(fn\))i(...\))87 +2704 y(\(define)g(\(get-path)e(fn\))j(...\))965 2828 +y Fh(4)p eop +%%Page: 5 5 +5 4 bop 62 45 a Fh(A)14 b(string)h(macro)d(expander)j(mak)o(es)e(it)h +(easier)h(to)f(generate)h(C)f(co)q(de,)h(for)f(the)g(bac)o(k)g(ends)h +(that)f(need)h(it.)k(The)14 b(macro)0 95 y(expander)i(is)f(called)f +Ff(instantiate)f Fh(and)i(is)g(called)f(with)h(a)g(string)g(template)f +(and)h(a)f(v)o(ector)i(of)e(argumen)o(ts)h(\(whic)o(h)g(are)0 +145 y(also)f(strings\).)21 b(The)15 b(template)e(con)o(tains)i +(patterns)g(of)f(the)h(form)e Ff(@n)h Fh(where)i Ff(n)e +Fh(is)h(a)f(single)g(digit;)g(when)h(suc)o(h)g(a)f(pattern)0 +195 y(is)g(seen)h(it)e(is)h(replaced)h(with)f(the)g(corresp)q(onding)h +(v)n(alue)e(from)f(the)j(argumen)o(t)e(v)o(ector.)87 +282 y Ff(\(define)21 b(\(instantiate)e(template)h(arguments\))g(...\)) +62 369 y Fh(Tw)o(o)c(pro)q(cedures,)i Ff(struct-names)13 +b Fh(and)j Ff(union-names)p Fh(,)e(tak)o(e)i(a)g(structure)i(\(or)e +(union\))f(and)h(returns)i(a)d(list)h(of)f(all)0 418 +y(the)f(t)o(yp)q(edef)h(names)e(whic)o(h)h(reference)i(the)f(structure) +h(directly)m(.)87 506 y Ff(\(define)21 b(\(struct-names)e(struct\))h +(...\))87 555 y(\(define)h(\(union-names)e(union\))h(...\))62 +642 y Fh(An)14 b(asso)q(ciation)f(function)g(whic)o(h)h(searc)o(hes)h +(one)f(of)f(the)h(record)h(lists)e(for)g(a)h(giv)o(en)f(record)h(b)o(y) +g(the)g Ff(name)f Fh(\014eld)g(is)h(also)0 692 y(a)o(v)n(ailable:)87 +779 y Ff(\(define)21 b(\(lookup)f(key)h(items\))g(...\))62 +866 y Fh(The)16 b(pro)q(cedure)i Ff(user-defined-tag?)12 +b Fh(determines)k(whether)h(a)f(tag)f(w)o(as)h(de\014ned)h(b)o(y)e(the) +i(user)f(or)g(generated)h(b)o(y)0 916 y(the)d(system:)87 +1003 y Ff(\(define)21 b(\(user-defined-t)o(ag?)e(x\))i(...\))62 +1090 y Fh(The)10 b(pro)q(cedure)i Ff(warn)c Fh(tak)o(es)i(some)f +(arbitrary)g(argumen)o(ts)g(and)h(generates)h(a)e(w)o(arning)g(message) +g(on)g(standard)h(output:)87 1177 y Ff(\(define)21 b(\(warn)f(msg)h(.)h +(rest\))f(...\))62 1264 y Fh(Some)14 b(standard)h(predicates)i(tak)o(e) +e(a)g(t)o(yp)q(e)g(and)g(test)h(its)f(kind:)20 b Ff(primitive-type?)11 +b Fh(is)k(true)h(if)e(the)i(argumen)o(t)e(is)h(of)0 1314 +y(a)e(primitiv)o(e)f(t)o(yp)q(e)i(as)f(outlined)g(in)g(the)h(grammar)d +(ab)q(o)o(v)o(e;)i Ff(basic-type?)e Fh(is)i(true)h(if)f(the)h(argumen)o +(t)f(is)g(a)g(primitiv)o(e)e(t)o(yp)q(e)0 1364 y(or)k(a)g(p)q(oin)o +(ter)g(t)o(yp)q(e;)h Ff(array-type?)c Fh(is)j(true)h(if)e(the)i +(argumen)o(t)e(is)h(an)f(arra)o(y)h(t)o(yp)q(e,)g(and)g(\014nally)m(,)e +Ff(structured-type?)f Fh(is)0 1414 y(true)j(if)e(the)h(argumen)o(t)f +(is)h(a)f Ff(structr-ef)f Fh(or)i Ff(union-ref)e Fh(t)o(yp)q(e:)87 +1501 y Ff(\(define)21 b(\(primitive-type)o(?)e(t\))i(...\))87 +1551 y(\(define)g(\(basic-type?)e(t\))i(...\))87 1600 +y(\(define)g(\(array-type?)e(t\))i(...\))87 1650 y(\(define)g +(\(structured-typ)o(e?)e(t\))i(...\))0 1787 y Fi(6)69 +b(W)-6 b(riting)22 b(a)h(T)-6 b(arget-Dep)r(enden)n(t)22 +b(Bac)n(k-End)0 1878 y Fh(T)m(o)9 b(write)h(the)g(target-dep)q(enden)o +(t)h(bac)o(k-end,)g(y)o(ou)e(m)o(ust)f(decide)j(on)e(the)h(p)q(olicy)f +(for)g(the)h(translation)f(and)h(then)g(implem)o(en)o(t)0 +1928 y(the)h(translation.)16 b(The)10 b(p)q(olicy)f(co)o(v)o(ers)i(suc) +o(h)g(issues)g(as:)16 b(whic)o(h)10 b(constructs)i(in)d(C)h(are)g(or)g +(are)h(not)e(handled;)i(the)g(translation)0 1977 y(for)17 +b(eac)o(h)g(handled)g(construct;)j(ho)o(w)d(non-handled)f(constructs)j +(are)f(dealt)f(with)g(\(ignored,)g(detected)i(with)e(w)o(arnings,)0 +2027 y(detected)e(with)e(errors\);)h(ho)o(w)f(to)g(deal)g(with)g +(exceptional)g(cases)i(\(consider)f(the)f Ff(fgets)f +Fh(example)g(from)g(the)h Fg(Manifesto)s Fh(\).)62 2077 +y(F)m(or)k(a)g(concrete)i(example,)e(see)h(the)g(companion)e(do)q +(cumen)o(t)g Fg(FFIGEN)j(Backend)g(for)e(Chez)h(Scheme)h(V)m(ersion)f +(5)6 b Fh(,)0 2127 y(whic)o(h)14 b(addresses)i(man)o(y)c(of)h(the)i(c)o +(hoices)f(to)g(b)q(e)h(made)d(and)i(their)g(p)q(ossible)g(solutions.)0 +2263 y Fi(7)69 b(F)-6 b(uture)23 b(W)-6 b(ork)0 2354 +y Fh(A)14 b(n)o(um)o(b)q(er)f(of)g(features)i Fg(wil)r(l)e +Fh(b)q(e)h(supp)q(orted)i(in)d(the)i(future.)62 2441 +y Fc(\017)21 b Fh(There)c(will)d(b)q(e)j(a)e(line)h(and)f(a)h(column)e +(\014eld)i(in)g(eac)o(h)g(record,)h(giving)e(the)h(source)h(line)f(on)f +(whic)o(h)h(the)h(iden)o(ti\014er)104 2491 y(w)o(as)d(de\014ned.)62 +2572 y Fc(\017)21 b Fh(Bit\014elds)14 b(will)f(b)q(e)h(supp)q(orted.)62 +2654 y Fc(\017)21 b Fh(Quali\014ers)13 b(\(what's)g(no)o(w)f(called)g +(attributes,)i(that)f(is,)f(const)i(and)e(v)o(olatile\))g(will)f(b)q(e) +i(supp)q(orted)h(on)f(all)f(t)o(yp)q(es,)h(not)104 2704 +y(just)h(on)g(primitiv)o(e)d(non-p)q(oin)o(ter)j(t)o(yp)q(es)h(lik)o(e) +e(no)o(w.)965 2828 y(5)p eop +%%Page: 6 6 +6 5 bop 62 45 a Fc(\017)21 b Fh(The)14 b(in)o(termediate)f(represen)o +(tation)j(will)c(include)i(the)h(name)d(of)i(the)g(orignal)e(input)i +(\014le,)g(and)f(its)h(path.)62 127 y Fc(\017)21 b Fh(The)16 +b(in)o(termediate)f(represen)o(tation)j(will)c(include)i(a)g(represen)o +(tation)h(of)f(the)g(include)g(\014le)g(hierarc)o(h)o(y)g(whic)o(h)g(w) +o(as)104 177 y(tra)o(v)o(ersed)f(to)f(pro)q(duce)h(the)f(in)o +(termediate)f(represen)o(tation.)0 266 y(A)h(n)o(um)o(b)q(er)f(of)g +(features)i(will)e(most)g(lik)o(ely)f(b)q(e)j(supp)q(orted,)f(but)g +(need)h(to)f(b)q(e)h(in)o(v)o(estigated:)62 355 y Fc(\017)21 +b Fh(It)14 b(w)o(ould)f(b)q(e)h(nice)h(to)e(retain)h(commen)o(ts.)62 +437 y Fc(\017)21 b Fh(V)m(arious)14 b(p)q(opular)h(extensions)i(to)e(C) +g(are)h(not)f(curren)o(tly)h(supp)q(orted)h(b)o(y)e Ff(lcc)p +Fh(,)f(but)i(w)o(ould)e(b)q(e)i(extremely)f(useful:)104 +487 y Ff(long)21 b(long)16 b Fh(is)h(used)h(extensiv)o(ely)g(in)f(Unix) +f(header)j(\014les,)e(and)g(header)i(\014les)e(for)g(compilers)f(on)h +(PCs)h(often)f(use)104 536 y(the)d(common)d(Microsoft)i(extensions)i +Ff(__huge)p Fh(,)c Ff(__far)p Fh(,)h(and)i Ff(__near)e +Fh(\(and)h(their)h(non-underscore)i(equiv)n(alen)o(ts\).)104 +586 y(Some)h(C)i(compilers)f(supp)q(ort)i Ff(__inline)d +Fh(declarations,)i(and)g(although)f(w)o(e)h(can't)g(generate)h(co)q(de) +g(for)e(in-line)104 636 y(pro)q(cedures)j(w)o(e)d(can)h(at)g(least)g +(parse)g(them)f(if)g(the)h(compiler)e(can)i(cop)q(e)g(with)f +Ff(__inline)p Fh(.)31 b(\()p Ff(__inline)17 b Fh(is)h(the)104 +686 y(easier,)c(since)h(it)e(can)h(b)q(e)h(ignored.)j(The)c(others)h(m) +o(ust)e(sho)o(w)h(up)g(as)f(t)o(yp)q(e)i(quali\014ers)f(or)f(new)i(t)o +(yp)q(es.\))62 768 y Fc(\017)21 b Fh(The)14 b(curren)o(t)h +(shell-program)e(driv)o(er)h(will)e(probably)h(b)q(e)i(replaced)g(b)o +(y)e(something)g(based)h(on)g(the)h(lcc)f(driv)o(er.)62 +850 y Fc(\017)21 b Fh(I'm)14 b(going)h(to)h(exp)q(erimen)o(t)g(with)g +(partial)f(macro)g(application)g(in)g(the)i(fron)o(t)f(end)g(so)h(that) +f(bac)o(k-ends)h(can)f(ha)o(v)o(e)104 900 y(simple)g(supp)q(ort)i(for)g +(macro)e(de\014nitions.)29 b(Curren)o(tly)m(,)18 b(for)g(example,)e(ev) +o(en)j(something)d(as)i(simple)e(as)h(the)i Ff(EOF)104 +950 y Fh(macro)c(will)h(b)q(e)h(ignored)f(b)o(y)h(the)g(Chez)h(Sc)o +(heme)e(bac)o(k-end)i(b)q(ecause)g(its)f(form)e(is)h +Ff("\(-1\)")g Fh(rather)h(than)g(simply)104 999 y Ff("-1")p +Fh(.)62 1081 y Fc(\017)k Fh(Information)16 b(ab)q(out)i(the)h(la)o(y)o +(out)f(of)g(\014elds)h(within)e(structured)k(t)o(yp)q(es)f(should)e(p)q +(ossibly)g(b)q(e)h(emitted;)h(this)f(in-)104 1131 y(formation)14 +b(w)o(ould)j(b)q(e)h(useful)f(to)g(lo)o(w-lev)o(el)f(FFIs)i(whic)o(h)f +(need)h(b)o(yte)f(o\013set)i(and)e(size)h(to)f(access)i(the)e(\014eld)h +(of)e(a)104 1181 y(structure.)0 1270 y(In)e(addition,)e(there)j(are)g +(some)e(issues)i(to)e(in)o(v)o(estigate)h(in)f(a)h(larger)g(p)q(ersp)q +(ectiv)o(e:)62 1359 y Fc(\017)21 b Fh(General)14 b(\(target-indep)q +(enden)o(t\))i(supp)q(ort)e(for)g(useful)g(p)q(olicy)f(mec)o(hanisms.) +62 1441 y Fc(\017)21 b Fh(Ho)o(w)11 b(w)o(ell)f(can)h(the)h(in)o +(termediate)e(language)g(supp)q(ort)i(other)g(fron)o(t-ends?)18 +b(I)11 b(don't)f(w)o(an)o(t)h(to)g(fall)e(in)o(to)i(the)h(UNCOL)104 +1491 y(pit,)18 b(but)g(it)g(w)o(ould)f(b)q(e)h(in)o(teresting)h(to)f +(see)h(ho)o(w)f(languages)f(whic)o(h)h(resem)o(ble)g(C)g(in)f(their)h +(parameter)g(passing)104 1540 y(mec)o(hanisms)13 b(\(P)o(ascal,)h(Mo)q +(dula,)g(Ob)q(eron\))i(could)f(b)q(e)g(mapp)q(ed)f(on)o(to)g(the)i(in)o +(termediate)e(language.)20 b(This)14 b(is)h(not)104 1590 +y(high)d(priorit)o(y)g(with)h(me,)e(ho)o(w)o(ev)o(er.)18 +b(If)13 b(I)f(em)o(bark)g(on)h(supp)q(orting)g(another)g(fron)o(t-end)g +(language)f(it)g(will)g(probably)104 1640 y(b)q(e)i(\(sigh\))g(C++.)0 +1777 y Fi(8)69 b(Please)22 b(Con)n(tribute!)0 1868 y +Fh(My)13 b(goal)g(is)g(to)g(supp)q(ort)i(as)e(man)o(y)f(target)i +(languages)f(as)g(is)h(reasonable,)f(but)h(I)f(can't)h(write)f(all)g +(the)h(translators)g(m)o(yself)0 1918 y(\(I)k(lac)o(k)f(the)i(time)d +(and,)j(in)e(man)o(y)f(cases,)k(the)e(kno)o(wledge\).)30 +b(T)m(argets)18 b(that)g(I)g(will)e(tak)o(e)i(care)h(of)e(include)h +(STk,)h(and,)0 1967 y(if)d(no-one)h(b)q(eats)g(me)f(to)h(it,)g(Scsh,)h +(b)q(oth)f(Sc)o(heme)f(systems.)28 b(Someone)15 b(has)i(already)g(v)o +(olun)o(teered)h(to)e(write)h(the)h(ILU)0 2017 y(bac)o(k-end.)g(Others) +e(are)e(in)o(terested)i(in)d(bac)o(k-ends)i(for)e(Mo)q(dula-3)g(and)h +(Mercury)m(.)62 2067 y(V)m(olun)o(teers)h(for)g(an)o(y)f(translator)g +(bac)o(k-end)h(are)g(w)o(elcome)e(to)i(e-mail)d(me)i(and)g(v)o(olun)o +(teer)h(their)g(help.)20 b(I)14 b(will)f(coac)o(h,)0 +2117 y(co)q(ordinate,)h(and)f(help)h(out)g(as)g(m)o(uc)o(h)f(as)h(p)q +(ossible.)0 2254 y Fi(9)69 b(Credits)0 2345 y Fh(FFIGEN)11 +b(is)f(based)h(on)f(the)i(freely)e(a)o(v)n(ailable)f +Ff(lcc)g Fh(ANSI)i(C)g(compiler,)e(implemen)o(ted)f(b)o(y)i +(Christopher)i(F)m(raser)f(\(of)f(A)m(T&T)0 2395 y(Bell)k(Labs\))g(and) +g(Da)o(vid)e(Hanson)i(\(of)g(Princeton)g(Univ)o(ersit)o(y\).)62 +2444 y(I)c(w)o(ould)f(lik)o(e)f(to)i(thank)f(F)m(raser)h(and)g(Hanson)f +(for)h(pro)q(ducing)f(suc)o(h)i(an)e(excellen)o(t)h(system;)h +Ff(lcc)d Fh(has)i(b)q(een)h(a)e(jo)o(y)g(to)g(w)o(ork)0 +2494 y(with,)j(and)h(their)g(b)q(o)q(ok,)g Fg(A)h(R)n(etar)n(getable)f +(C)h(Compiler:)k(Design)c(and)h(Implementation)p Fh(,)e(made)f(the)h +(implemen)o(tation)d(of)0 2544 y(the)16 b(FFIGEN)g(fron)o(t)g(end)g(in) +g(the)g(matter)f(of)g(roughly)g(a)h(single)f(w)o(ork)h(da)o(y)f(p)q +(ossible.)24 b(W)m(ould)15 b(it)g(b)q(e)h(that)g(all)f(soft)o(w)o(are)0 +2594 y(w)o(as)f(this)g(clean!)0 2704 y(The)g(dev)o(elopmen)o(t)f(of)h +(FFIGEN)g(w)o(as)f(supp)q(orted)j(b)o(y)d(ARP)m(A.)965 +2828 y(6)p eop +%%Page: 7 7 +7 6 bop 0 45 a Fi(10)69 b(Cop)n(yrigh)n(ts)0 136 y Ff(lcc)13 +b Fh(is)h(co)o(v)o(ered)h(b)o(y)e(the)i(follo)o(wing)c(Cop)o(yrigh)o(t) +i(notice:)104 227 y(The)h(authors)g(of)g(this)g(soft)o(w)o(are)g(are)g +(Christopher)h(W.)e(F)m(raser)h(and)g(Da)o(vid)f(R.)f(Hanson.)104 +294 y(Cop)o(yrigh)o(t)e(\(c\))h(1991,1992,199)o(3,1)o(994,)o(1995)c(b)o +(y)j(A)m(T&T,)h(Christopher)g(W.)f(F)m(raser,)i(and)e(Da)o(vid)g(R.)g +(Hanson.)104 344 y(All)j(Righ)o(ts)g(Reserv)o(ed.)104 +410 y(P)o(ermission)k(to)i(use,)h(cop)o(y)m(,)e(mo)q(dify)m(,)f(and)h +(distribute)h(this)g(soft)o(w)o(are)g(for)f(an)o(y)g(purp)q(ose,)i(sub) +r(ject)g(to)f(the)104 460 y(pro)o(visions)f(describ)q(ed)j(b)q(elo)o +(w,)f(without)f(fee)g(is)g(hereb)o(y)h(gran)o(ted,)h(pro)o(vided)e +(that)g(this)g(en)o(tire)h(notice)f(is)104 510 y(included)c(in)f(all)g +(copies)i(of)e(an)o(y)h(soft)o(w)o(are)g(that)g(is)g(or)g(includes)g(a) +g(cop)o(y)g(or)g(mo)q(di\014cation)e(of)h(this)h(soft)o(w)o(are)104 +559 y(and)e(in)h(all)f(copies)h(of)f(the)i(supp)q(orting)f(do)q(cumen)o +(tation)f(for)g(suc)o(h)i(soft)o(w)o(are.)104 626 y(THIS)10 +b(SOFTW)-5 b(ARE)11 b(IS)f(BEING)h(PR)o(O)o(VIDED)f("AS)g(IS",)g +(WITHOUT)g(ANY)h(EXPRESS)g(OR)f(IMPLIED)104 676 y(W)-5 +b(ARRANTY.)10 b(IN)i(P)m(AR)m(TICULAR,)d(NEITHER)j(THE)g(A)o(UTHORS)f +(NOR)g(A)m(T&T)h(MAKE)g(ANY)f(REP-)104 725 y(RESENT)m(A)m(TION)j(OR)h +(W)-5 b(ARRANTY)14 b(OF)h(ANY)g(KIND)g(CONCERNING)f(THE)h(MER)o(CHANT)m +(ABIL-)104 775 y(ITY)f(OF)g(THIS)g(SOFTW)-5 b(ARE)14 +b(OR)g(ITS)g(FITNESS)g(F)o(OR)g(ANY)g(P)m(AR)m(TICULAR)f(PURPOSE.)104 +842 y(lcc)j(is)f(not)g(public-domain)e(soft)o(w)o(are,)i(sharew)o(are,) +i(and)e(it)g(is)h(not)f(protected)i(b)o(y)e(a)h(`cop)o(yleft')e +(agreemen)o(t,)104 892 y(lik)o(e)f(the)h(co)q(de)h(from)d(the)j(F)m +(ree)f(Soft)o(w)o(are)g(F)m(oundation.)104 958 y(lcc)e(is)g(a)o(v)n +(ailable)d(free)k(for)e(y)o(our)h(p)q(ersonal)g(researc)o(h)i(and)e +(instructional)f(use)i(under)g(the)f(`fair)f(use')h(pro)o(visions)104 +1008 y(of)k(the)h(cop)o(yrigh)o(t)f(la)o(w.)24 b(Y)m(ou)16 +b(ma)o(y)m(,)e(ho)o(w)o(ev)o(er,)j(redistribute)h(the)f(lcc)f(in)g +(whole)h(or)f(in)g(part)g(pro)o(vided)h(y)o(ou)104 1058 +y(ac)o(kno)o(wledge)c(its)h(source)i(and)d(include)h(this)g(COPYRIGHT)g +(\014le.)104 1124 y(Y)m(ou)f(ma)o(y)g(not)h(sell)f(lcc)i(or)f(an)o(y)g +(pro)q(duct)h(deriv)o(ed)f(from)f(it)g(in)h(whic)o(h)g(it)g(is)g(a)g +(signi\014can)o(t)f(part)i(of)e(the)i(v)n(alue)104 1174 +y(of)e(the)h(pro)q(duct.)k(Using)c(the)g(lcc)f(fron)o(t)g(end)h(to)g +(build)e(a)h(C)h(syn)o(tax)f(c)o(hec)o(k)o(er)i(is)e(an)g(example)g(of) +f(this)i(kind)f(of)104 1224 y(pro)q(duct.)104 1290 y(Y)m(ou)h(ma)o(y)f +(use)j(parts)g(of)e(lcc)i(in)e(pro)q(ducts)j(as)e(long)f(as)h(y)o(ou)g +(c)o(harge)g(for)g(only)f(those)i(comp)q(onen)o(ts)f(that)g(are)104 +1340 y(en)o(tirely)g(y)o(our)g(o)o(wn)f(and)h(y)o(ou)f(ac)o(kno)o +(wledge)h(the)h(use)f(of)g(lcc)g(clearly)g(in)f(all)g(pro)q(duct)i(do)q +(cumen)o(tation)d(and)104 1390 y(distribution)j(media.)27 +b(Y)m(ou)16 b(m)o(ust)g(state)i(clearly)f(that)g(y)o(our)g(pro)q(duct)h +(uses)h(or)e(is)g(based)h(on)f(parts)g(of)g(lcc)104 1439 +y(and)d(that)f(lcc)i(is)f(a)o(v)n(ailable)d(free)k(of)e(c)o(harge.)19 +b(Y)m(ou)13 b(m)o(ust)g(also)g(request)j(that)e(bug)g(rep)q(orts)h(on)f +(y)o(our)f(pro)q(duct)104 1489 y(b)q(e)j(rep)q(orted)h(to)e(y)o(ou.)23 +b(Using)15 b(the)h(lcc)g(fron)o(t)f(end)h(to)g(build)e(a)i(C)f +(compiler)f(for)h(the)i(Motorola)d(88000)g(c)o(hip)104 +1539 y(and)i(c)o(harging)h(for)f(and)h(distributing)f(only)g(the)h +(88000)f(co)q(de)h(generator)h(is)f(an)f(example)g(of)g(this)g(kind)h +(of)104 1589 y(pro)q(duct.)104 1655 y(Using)f(parts)h(of)f(lcc)g(in)g +(other)h(pro)q(ducts)h(is)e(more)g(problematic.)24 b(F)m(or)16 +b(example,)f(using)h(parts)h(of)f(lcc)h(in)e(a)104 1705 +y(C++)d(compiler)f(could)h(sa)o(v)o(e)g(substan)o(tial)f(time)g(and)h +(e\013ort)h(and)f(therefore)h(con)o(tribute)g(signi\014can)o(tly)e(to)h +(the)104 1755 y(pro\014tabilit)o(y)j(of)h(the)h(pro)q(duct.)27 +b(This)17 b(kind)f(of)g(use,)i(or)e(an)o(y)g(use)i(where)f(others)h +(stand)f(to)g(mak)o(e)e(a)h(pro\014t)104 1805 y(from)c(what)i(is)f +(primarily)f(our)i(w)o(ork,)f(is)g(sub)r(ject)j(to)e(negotiation.)104 +1871 y(Chris)g(F)m(raser)g(/)g(cwf@researc)o(h.att.com)104 +1921 y(Da)o(vid)e(Hanson)i(/)g(drh@cs.princeton.edu)104 +1971 y(F)m(ri)f(Jun)h(17)g(11:57:07)d(EDT)j(1994)965 +2828 y(7)p eop +%%Trailer +end +userdict /end-hook known{end-hook}if +%%EOF