/usr/share/doc/fweb/html-info/Converting.html is in fweb-doc 1.62-13.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.1, http://www.gnu.org/software/texinfo/ -->
<head>
<title>FWEB: Converting</title>
<meta name="description" content="FWEB: Converting">
<meta name="keywords" content="FWEB: Converting">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-index.html#Concept-index" rel="index" title="Concept index">
<link href="Parameter-index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Hints.html#Hints" rel="up" title="Hints">
<link href="Tips.html#Tips" rel="next" title="Tips">
<link href="Hints.html#Hints" rel="prev" title="Hints">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en">
<a name="Converting"></a>
<div class="header">
<p>
Next: <a href="Tips.html#Tips" accesskey="n" rel="next">Tips</a>, Previous: <a href="Hints.html#Hints" accesskey="p" rel="prev">Hints</a>, Up: <a href="Hints.html#Hints" accesskey="u" rel="up">Hints</a> [<a href="Parameter-index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-index.html#Concept-index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Converting-an-existing-code-to-FWEB"></a>
<h3 class="section">13.1 Converting an existing code to <small>FWEB</small></h3>
<a name="index-Converting-an-existing-code-to-FWEB"></a>
<a name="index-Code_002c-converting-to-FWEB"></a>
<p>To convert an existing code to <small>FWEB</small>, one should do the
following. (The following simple procedure assumes that one puts all the
subroutines into the unnamed module. However, other more elaborate schemes
are possible.)
</p>
<ol>
<li> Place invisible commentary
about the author, version, etc. at the beginning of the source file by
bracketing it with ‘<samp>@z...@x</samp>’. The ‘<samp>@z</samp>’ must be the first two
characters of the file.
</li><li> Next, set the language by including a command such as ‘<samp>@n</samp>’ or
‘<samp>@c++</samp>’.
</li><li> Place an ‘<samp>@a</samp>’ command (switch into unnamed code) before each
program unit (e.g., main <b>program</b>, <b>subroutine</b>, or <b>function</b>).
</li><li> Before each ‘<samp>@a</samp>’, place an ‘<samp>@*</samp>’ or ‘<samp>@ </samp>’<!-- /@w --> command,
followed by TeX documentation about that particular section of code.
</li><li> If you have program units longer than about twelve lines, either
make them function calls, if you can afford the overhead and can impart
sufficient information via the function name, or break them up into shorter
fragments by using named modules. Insert the command ‘<samp>@<Name of
module@></samp>’ in place of the fragment you’re replacing, then put that
fragment somewhere else, prefaced by
‘<samp>@ </samp>’<!-- /@w --> and ‘<samp>@<Name of module@>=</samp>’.
</li><li> Make sure your comments are valid TeX. (One can’t have things
like raw underscores or dollar signs in comments, since those cause TeX
to take special actions.)
</li><li> Beautify and clarify your documentation by using code mode
(enclosing stuff between vertical bars) liberally within your TeX.
</li><li> After you’ve seen the woven output, you may need to go back and
format a few identifiers or section names so that <small>FWEAVE</small> understands them
properly, or you may need to insert some pseudo-semicolons (‘<samp>@;</samp>’),
pseudo-expressions (‘<samp>@e</samp>’), or pseudo-colons (‘<samp>@:</samp>’)
(see <a href="Pseudo_002doperators.html#Pseudo_002doperators">Pseudo-operators</a>).
</li><li> Consider using <small>FWEB</small>’s built-in macro preprocessor (see <a href="Macros.html#Macros">Macros</a>)
to make your code more readable—for example, replace raw numerical
constants by symbolic names.
</li><li> Scientific programmers may benefit from built-in macro-like functions
like <code>$PI</code>; see <a href="Built_002din-functions.html#Built_002din-functions">Built-in functions</a>.
</li><li> If you are a <small>FORTRAN</small> user, for ultimate readability
consider converting to <small>RATFOR</small>. The initial annoyance is getting rid of
column-6 continuations. With the aid of a good editor, this can be done
simply. For example, in <code>emacs</code> one can replace the regular expression
[carriage return, five spaces, something not equal to space, tab, or 0]
with [backslash, carriage return, six spaces]:
<div class="example">
<pre class="example">M-x replace-regexp RET
C-q C-j \.{\ \ \ \ \ }[\^\.\ tab 0]RET
\\\\ C-q C-j \.{\ \ \ \ \ \ }RET
</pre></div>
<p>Get rid of the keywords such as <b>then</b> or <b>end if</b> in favor
of braces. Change singly-quoted character strings to doubly-quoted
ones. The ‘<samp>-nC</samp>’ option (see <a href="_002dnC.html#g_t_002dnC">-nC</a>) may be helpful.
</p>
</li></ol>
<hr>
<div class="header">
<p>
Next: <a href="Tips.html#Tips" accesskey="n" rel="next">Tips</a>, Previous: <a href="Hints.html#Hints" accesskey="p" rel="prev">Hints</a>, Up: <a href="Hints.html#Hints" accesskey="u" rel="up">Hints</a> [<a href="Parameter-index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-index.html#Concept-index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|