Debian Codegraph @

tests/ex13.fw

raw
1 EX13: This example is used to generate typeset documentation which is
2 discussed in the tutorial in the FunnelWeb user's manual.
3
4
5 @A@<Table of Contents@>
6
7 @t table_of_contents
8
9 @A@<Macros for Moral Support@>
10
11 The following macro contain comments that provide moral support in the
12 output code.
13
14 @$@<Programmer's Cheer@>@M==@{
15 -- Shift to the left!
16 -- Shift to the right!
17 -- Pop up, push down!
18 -- Byte! Byte! Byte!
19 -- (From "The New Hacker's Dictionary").
20 @}
21
22 The next macro is similar but is distributed throughout the program.
23 @$@<Hacker's Cheer@>+=@{@+-- Pointer to the left@+@}
24
25 @A@<An Extremely Imperative Stack Abstraction@>
26
27 @B@<Define the Stack@>
28 @$@<Hacker's Cheer@>+=@{-- Pointer to the right@+@}
29 @$@<Stack Type@>@Z==@{type stack = record ... end;@}
30
31 @B@<Push the Stack@>
32 @$@<Hacker's Cheer@>+=@{-- Hack that code@+@}
33 @$@<Push Procedure@>@Z==@{@-
34 procedure push(var b:stack; v:value); @<Programmer's Cheer@> {...}@}
35
36 @B@<Pop the Stack@>
37 @$@<Hacker's Cheer@>+=@{-- Tight! Tight! Tight!@+@}
38 @$@<Pop Procedure@>@Z==@{@-
39 procedure pop(var b:stack); @<Programmer's Cheer@> {...}@}
40
41 @B@<Rough the Stack Up a Bit@>
42 @$@<Hacker's Cheer@>+=@{-- (RNW, 04-Jan-1991).@+@}
43 @$@<Rough Procedure@>@Z==@{@-
44 procedure rough(var b:stack); @<Hacker's Cheer@> {...}@}
45
46 @O@<dummy.txt@>==@{dummy@+@}