| 1 |
<HTML> |
| 2 |
|
| 3 |
<!-----------------------------------------------------------------------------> |
| 4 |
<!-- START OF AUTOMATICALLY GENERATED HTML FILE --> |
| 5 |
<!-----------------------------------------------------------------------------> |
| 6 |
<!-- --> |
| 7 |
<!-- This HTML file was generated by the FunnelWeb literate programming --> |
| 8 |
<!-- preprocessor. You can display this file using popular web browsers --> |
| 9 |
<!-- such as Netscape Navigator and Microsoft Internet Explorer. --> |
| 10 |
<!-- --> |
| 11 |
<!-- FunnelWeb is a preprocessor that allows programmers to weave programs --> |
| 12 |
<!-- and their documentation together in a single document. The FunnelWeb --> |
| 13 |
<!-- program analyses such documents producing both program files and --> |
| 14 |
<!-- typeset documentation such as this HTML file. --> |
| 15 |
<!-- --> |
| 16 |
<!-- FunnelWeb was created by Ross N. Williams (www.ross.net) and is --> |
| 17 |
<!-- available free of charge under a GNU General Public Licence. --> |
| 18 |
<!-- The FunnelWeb website can be found at http://www.ross.net/funnelweb/ --> |
| 19 |
<!-- --> |
| 20 |
<!-----------------------------------------------------------------------------> |
| 21 |
|
| 22 |
<HEAD> |
| 23 |
|
| 24 |
<TITLE>Package ex13</TITLE> |
| 25 |
|
| 26 |
<STYLE TYPE="text/css"> |
| 27 |
<!-- |
| 28 |
A {text-decoration: none} |
| 29 |
H1 { font-family: sans-serif; font-size: large } |
| 30 |
H2 { font-family: sans-serif; font-size: medium; font-weight: bold } |
| 31 |
H3 { font-family: sans-serif; font-size: medium } |
| 32 |
H4 { font-family: sans-serif; font-size: small } |
| 33 |
H5 { font-family: sans-serif; font-size: small } |
| 34 |
// --> |
| 35 |
</STYLE> |
| 36 |
|
| 37 |
</HEAD> |
| 38 |
<BODY BGCOLOR=#FFFFFF TEXT=#000000 LINK=#CC0033 VLINK=#CC0033 ALINK=#CC0000> |
| 39 |
|
| 40 |
<P><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD WIDTH=400> |
| 41 |
EX13: This example is used to generate typeset documentation which is |
| 42 |
discussed in the tutorial in the FunnelWeb user's manual. |
| 43 |
|
| 44 |
<P> |
| 45 |
<P></TD></TR></TABLE> |
| 46 |
<P><HR SIZE=4 NOSHADE><P><A NAME="sec_1"></A> |
| 47 |
<H1>1. Table of Contents</H1> |
| 48 |
|
| 49 |
<A HREF="#sec_1">1. Table of Contents</A><BR> |
| 50 |
<A HREF="#sec_2">2. Macros for Moral Support</A><BR> |
| 51 |
<A HREF="#sec_3">3. An Extremely Imperative Stack Abstraction</A><BR> |
| 52 |
<A HREF="#sec_3.1">3.1. Define the Stack</A><BR> |
| 53 |
<A HREF="#sec_3.2">3.2. Push the Stack</A><BR> |
| 54 |
<A HREF="#sec_3.3">3.3. Pop the Stack</A><BR> |
| 55 |
<A HREF="#sec_3.4">3.4. Rough the Stack Up a Bit</A><BR> |
| 56 |
|
| 57 |
<P><HR SIZE=4 NOSHADE><P><A NAME="sec_2"></A> |
| 58 |
<H1>2. Macros for Moral Support</H1> |
| 59 |
<P><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD WIDTH=400> |
| 60 |
|
| 61 |
|
| 62 |
<P>The following macro contain comments that provide moral support in the |
| 63 |
output code. |
| 64 |
|
| 65 |
<P></TD></TR></TABLE> |
| 66 |
<FONT COLOR=#CC0033> |
| 67 |
<P><A NAME="1"></A>1. <A HREF="#6">Programmer's Cheer</A>[<B>M</B>]={<FONT COLOR=#000033><TT><BR> |
| 68 |
-- Shift to the left!<BR> |
| 69 |
-- Shift to the right!<BR> |
| 70 |
-- Pop up, push down!<BR> |
| 71 |
-- Byte! Byte! Byte!<BR> |
| 72 |
-- (From "The New Hacker's Dictionary").<BR> |
| 73 |
</TT> |
| 74 |
</FONT>}<BR> |
| 75 |
</FONT> |
| 76 |
<FONT SIZE=1>This macro is invoked in definitions <A HREF="#6">6</A> and <A HREF="#8">8</A>.</FONT><BR> |
| 77 |
<P><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD WIDTH=400> |
| 78 |
|
| 79 |
|
| 80 |
<P>The next macro is similar but is distributed throughout the program. |
| 81 |
</TD></TR></TABLE> |
| 82 |
<FONT COLOR=#CC0033> |
| 83 |
<P><A NAME="2"></A>2. <A HREF="#10">Hacker's Cheer</A>+={<FONT COLOR=#000033><TT><BR> |
| 84 |
-- Pointer to the left<BR> |
| 85 |
</TT> |
| 86 |
</FONT>}<BR> |
| 87 |
</FONT> |
| 88 |
<FONT SIZE=1>This macro is defined in definitions <A HREF="#2">2</A>, <A HREF="#3">3</A>, <A HREF="#5">5</A>, <A HREF="#7">7</A> and <A HREF="#9">9</A>.</FONT><BR> |
| 89 |
<FONT SIZE=1>This macro is invoked in definition <A HREF="#10">10</A>.</FONT><BR> |
| 90 |
<P><HR SIZE=4 NOSHADE><P><A NAME="sec_3"></A> |
| 91 |
<H1>3. An Extremely Imperative Stack Abstraction</H1> |
| 92 |
<P><HR SIZE=2 NOSHADE><P><A NAME="sec_3.1"></A> |
| 93 |
<H2>3.1. Define the Stack</H2> |
| 94 |
<FONT COLOR=#CC0033> |
| 95 |
<P><A NAME="3"></A>3. <A HREF="#10">Hacker's Cheer</A>+={<FONT COLOR=#000033><TT>-- Pointer to the right<BR> |
| 96 |
</TT> |
| 97 |
</FONT>}<BR> |
| 98 |
</FONT> |
| 99 |
<FONT SIZE=1>This macro is defined in definitions <A HREF="#2">2</A>, <A HREF="#3">3</A>, <A HREF="#5">5</A>, <A HREF="#7">7</A> and <A HREF="#9">9</A>.</FONT><BR> |
| 100 |
<FONT SIZE=1>This macro is invoked in definition <A HREF="#10">10</A>.</FONT><BR> |
| 101 |
<FONT COLOR=#CC0033> |
| 102 |
<P><A NAME="4"></A>4. Stack Type[<B>Z</B>]={<FONT COLOR=#000033><TT>type stack = record ... end;</TT> |
| 103 |
</FONT>}<BR> |
| 104 |
</FONT> |
| 105 |
<FONT SIZE=1>This macro is NEVER invoked.</FONT> |
| 106 |
<P><HR SIZE=2 NOSHADE><P><A NAME="sec_3.2"></A> |
| 107 |
<H2>3.2. Push the Stack</H2> |
| 108 |
<FONT COLOR=#CC0033> |
| 109 |
<P><A NAME="5"></A>5. <A HREF="#10">Hacker's Cheer</A>+={<FONT COLOR=#000033><TT>-- Hack that code<BR> |
| 110 |
</TT> |
| 111 |
</FONT>}<BR> |
| 112 |
</FONT> |
| 113 |
<FONT SIZE=1>This macro is defined in definitions <A HREF="#2">2</A>, <A HREF="#3">3</A>, <A HREF="#5">5</A>, <A HREF="#7">7</A> and <A HREF="#9">9</A>.</FONT><BR> |
| 114 |
<FONT SIZE=1>This macro is invoked in definition <A HREF="#10">10</A>.</FONT><BR> |
| 115 |
<FONT COLOR=#CC0033> |
| 116 |
<P><A NAME="6"></A>6. Push Procedure[<B>Z</B>]={<FONT COLOR=#000033><TT>procedure push(var b:stack; v:value); </TT> |
| 117 |
<A HREF="#1">Programmer's Cheer</A><TT> {...}</TT> |
| 118 |
</FONT>}<BR> |
| 119 |
</FONT> |
| 120 |
<FONT SIZE=1>This macro is NEVER invoked.</FONT> |
| 121 |
<P><HR SIZE=2 NOSHADE><P><A NAME="sec_3.3"></A> |
| 122 |
<H2>3.3. Pop the Stack</H2> |
| 123 |
<FONT COLOR=#CC0033> |
| 124 |
<P><A NAME="7"></A>7. <A HREF="#10">Hacker's Cheer</A>+={<FONT COLOR=#000033><TT>-- Tight! Tight! Tight!<BR> |
| 125 |
</TT> |
| 126 |
</FONT>}<BR> |
| 127 |
</FONT> |
| 128 |
<FONT SIZE=1>This macro is defined in definitions <A HREF="#2">2</A>, <A HREF="#3">3</A>, <A HREF="#5">5</A>, <A HREF="#7">7</A> and <A HREF="#9">9</A>.</FONT><BR> |
| 129 |
<FONT SIZE=1>This macro is invoked in definition <A HREF="#10">10</A>.</FONT><BR> |
| 130 |
<FONT COLOR=#CC0033> |
| 131 |
<P><A NAME="8"></A>8. Pop Procedure[<B>Z</B>]={<FONT COLOR=#000033><TT>procedure pop(var b:stack); </TT> |
| 132 |
<A HREF="#1">Programmer's Cheer</A><TT> {...}</TT> |
| 133 |
</FONT>}<BR> |
| 134 |
</FONT> |
| 135 |
<FONT SIZE=1>This macro is NEVER invoked.</FONT> |
| 136 |
<P><HR SIZE=2 NOSHADE><P><A NAME="sec_3.4"></A> |
| 137 |
<H2>3.4. Rough the Stack Up a Bit</H2> |
| 138 |
<FONT COLOR=#CC0033> |
| 139 |
<P><A NAME="9"></A>9. <A HREF="#10">Hacker's Cheer</A>+={<FONT COLOR=#000033><TT>-- (RNW, 04-Jan-1991).<BR> |
| 140 |
</TT> |
| 141 |
</FONT>}<BR> |
| 142 |
</FONT> |
| 143 |
<FONT SIZE=1>This macro is defined in definitions <A HREF="#2">2</A>, <A HREF="#3">3</A>, <A HREF="#5">5</A>, <A HREF="#7">7</A> and <A HREF="#9">9</A>.</FONT><BR> |
| 144 |
<FONT SIZE=1>This macro is invoked in definition <A HREF="#10">10</A>.</FONT><BR> |
| 145 |
<FONT COLOR=#CC0033> |
| 146 |
<P><A NAME="10"></A>10. Rough Procedure[<B>Z</B>]={<FONT COLOR=#000033><TT>procedure rough(var b:stack); </TT> |
| 147 |
<A HREF="#2">Hacker's Cheer</A><TT> {...}</TT> |
| 148 |
</FONT>}<BR> |
| 149 |
</FONT> |
| 150 |
<FONT SIZE=1>This macro is NEVER invoked.</FONT> |
| 151 |
<FONT COLOR=#CC0033> |
| 152 |
<P><A NAME="11"></A><B>11. File:</B> dummy.txt={<FONT COLOR=#000033><TT>dummy<BR> |
| 153 |
</TT> |
| 154 |
</FONT>}<BR> |
| 155 |
</FONT> |
| 156 |
<FONT SIZE=1>This macro is attached to an output file.</FONT> |
| 157 |
<P> |
| 158 |
<HR SIZE=4 NOSHADE> |
| 159 |
<CENTER><B>End Of File</B></CENTER> |
| 160 |
<HR SIZE=4 NOSHADE> |
| 161 |
</BODY> |
| 162 |
|
| 163 |
<!-----------------------------------------------------------------------------> |
| 164 |
<!-- END OF AUTOMATICALLY GENERATED HTML FILE --> |
| 165 |
<!-----------------------------------------------------------------------------> |
| 166 |
</HTML> |