Debian Codegraph @

texk/web2c/tiedir/tiedoc.tex

raw
1 % tiedoc.tex 26 Oct 89
2 %------------------------
3
4 % 89-10-26 js: changed description of user interface which was altered
5 % in the rewrite of TIE in CWEB.
6 % 88-12-?? kg: first release
7
8
9
10 \documentstyle{article}
11
12 \let\mc=\small
13 \def\TANGLE{{\tt TANGLE}}
14 \def\TIE{{\tt TIE}}
15 \def\WEAVE{{\tt WEAVE}}
16 \def\WEB{{\tt WEB}}
17 \def\CWEB{{\mc CWEB}}
18 \def\PASCAL{Pascal}
19
20
21 \begin{document}
22
23 \title{The \TIE{} Processor}
24 \author{Klaus Guntermann\\
25 TH Darmstadt\\
26 Fachbereich Informatik\\
27 Institut f\"ur Theoretische Informatik}
28 \date{October 1989}
29
30 \maketitle
31
32
33
34 \section{Introduction}
35
36 To install a program on a computer usually
37 system dependent changes are needed.
38 The systems of the \WEB{} family allows to describe these changes in a
39 so called change file.
40 To incorporate the changes into the program \TANGLE\ processes
41 the original source file and inserts the changes into the proper places.
42
43 Sometimes it is good practice to develop a set of change files to be able to
44 distinguish between different changes like
45 program enhancements, bug fixes, system dependent changes
46 and output device dependent modifications.
47 Additionally this allows combinations of changes that can be used with a set of
48 programs that share some common features.
49
50 The processors \TANGLE\ and \WEAVE\ can handle only one change file.
51 The combination of change files is done best in another preprocessing step.
52 \TIE\ is able to create either a new master file or a single change file that
53 comprises the effect of all change files.
54
55 Since \TIE\ does not know anything about \WEB\ programs but only about the
56 structure of change files, it is possible to use this program for other
57 programming languages as well.
58 You just pretend that you want to create a new master file and \TIE\ will go
59 and insert all the changes from your change files.
60
61
62
63 \section{Application}
64
65 The current version of \TIE\ accepts a master file and up to 9 change files.
66 Because in general it is important to use the changes in their proper sequence
67 the order of the files must be chosen carefully.
68
69 \TIE{} must be called with at least 4~parameters:
70 %
71 \begin{enumerate}
72
73 \item either the option {\tt -c\/} or {\tt -m}. This option controls if
74 a change file or a master file is created.
75
76 \item the name of the output file.
77
78 \item the name of the master file.
79
80 \item the name(s) of the change file(s). At least one must be present.
81
82 \end{enumerate}
83
84 The multiple change files are used as if the single change files were
85 merged into the master files step by step. Thus more than 9 change
86 files might be incorporated by repeated application of \TIE. Of
87 course you may change the constant {\it max\_file\_index\/} in \TIE{}
88 which defines the maximum number of change files, too.
89
90 Please note that even when multiple change files are processed each of
91 the files is read only once. For each of the change files and for the
92 master file there is only one line in memory at a time (neglecting
93 operating system buffering). Thus the storage requirement of \TIE\
94 does not depend on the size of the change files or the size of a
95 single changed section.
96
97
98 \newpage
99
100
101 \def\eof{$\langle${\mc EOF}$\rangle$}
102 \tabcolsep=1em
103
104
105 \section{Example}
106
107 To illustrate the actions \TIE\ performs you may inspect the following
108 example that exercises some of the border line cases.
109
110 \begin{center}
111 \begin{tabular}{llll}
112 \multicolumn1{c}{\sc Master}&
113 \multicolumn1{c}{\tt CF1}&
114 \multicolumn1{c}{\tt CF2}&
115 \multicolumn1{c}{\tt CF3}\\[1pt]
116 \hline
117 line 1 &@x &@x &@x\\
118 line 2 &line 2 &line 1 &changed line 4\\
119 line 3 &line 3 &changed line 2 &@y\\
120 line 4 &@y &changed line 3 &final line 4\\
121 line 5 &changed line 2 &inserted line &@z\\
122 line 6 &changed line 3 &line 4 &\eof\\
123 line 7 &inserted line &@y\\
124 line 8 &@z &final line 2\\
125 line 9 & &final line 3\\
126 line 10 &@x &changed line 4\\
127 \eof &line 7 &@z\\
128 &@y\\
129 &changed line 7 &@x\\
130 &@z &changed line 7\\
131 &\eof &line 8\\
132 & &@y\\
133 & &final line 7\\
134 & &final line 8\\
135 & &@z\\
136 & &\eof\\
137 \end{tabular}
138 \end{center}
139
140
141 \newpage
142
143
144 Using these input files and running \TIE\ twice to create a new master
145 file and a new change file will result in the following output files:
146
147 \begin{center}
148 \begin{tabular}{ll}
149 \multicolumn1{c}{\sc Master}&
150 \multicolumn1{c}{\sc Change}\\[1pt]
151 \hline
152 final line 2 &@x\\
153 final line 3 &line 1\\
154 final line 4 &line 2\\
155 line 5 &line 3\\
156 line 6 &line 4\\
157 final line 7 &@y\\
158 final line 8 &final line 2\\
159 line 9 &final line 3\\
160 line 10 &final line 4\\
161 \eof &@z\\
162 &\\
163 &@x\\
164 &line 7\\
165 &line 8\\
166 &@y\\
167 &final line 7\\
168 &final line 8\\
169 &@z\\
170 &\eof\\
171 \end{tabular}
172 \end{center}
173
174
175
176 \end{document}