summaryrefslogtreecommitdiff
path: root/web/latexspider/tiedoc.tex
blob: 525ae60b4ebe57d5ac9d2b14f1b50d12266c2be6 (plain)
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
% tiedoc.tex  25 Oct 89

% adapted to CWEB by J.Schrod on 89-10-25

\documentstyle[a4]{article}
\font\mc=cmcsc10
\def\TANGLE{{\tt TANGLE}}
\def\TIE{{\tt TIE}}
\def\WEAVE{{\tt WEAVE}}
\def\WEB{{\tt WEB}}
\def\CWEB{{\mc cweb}}
\def\PASCAL{{\mc Pascal}}
\title{The TIE Processor}
\author{Klaus Guntermann\\
TH Darmstadt\\
Fachbereich Informatik\\
Institut f\"ur Theoretische Informatik}

\date{October 1989}
\begin{document}
\maketitle
\section{Introduction}

To install a program on a computer usually
system dependent changes are needed.
The \WEB\ system allows to describe these changes in a
so called change file.
To incorporate the changes into the program \TANGLE\ processes
the original source file and inserts the changes into the proper places.

Sometimes it is good practice to develop a set of change files to be able to
distinguish between different changes like
program enhancements, bug fixes, system dependent changes 
and output device dependent modifications.
Additionally this allows combinations of changes that can be used with a set of 
programs that share some common features.

The processors \TANGLE\ and \WEAVE\ can handle only one change file.
The combination of change files is done best in another preprocessing step.
\TIE\ is able to create either a new master file or a single change file that 
comprises the effect of all change files.

Since \TIE\ does not know anything about \WEB\ programs but only about the 
structure of change files, it is possible to use this program for other 
programming languages as well.
You just pretend that you want to create a new master file and \TIE\ will go 
and insert all the changes from your change files.



\section{Application}

The current version of \TIE\ accepts a master file and up to 9 change files.
Because in general it is important to use the changes in their proper sequence 
the order of the files must be chosen carefully.

The CWEB version of \TIE{} may be called with the following command
line interface:
%
\begin{verbatim}
   tie -[mc] output_file master_file changefile(s)
\end{verbatim}
%
The option \verb|-m| results in the creation of a new master file,
\verb|-c| yields a new changefile.  Usually wildcards may be used for
the filenames. 

The multiple change files are used as if the single change files were merged 
into the master files step by step.
Thus more than 9 change files might be incorporated by repeated application of 
\TIE.

Please note that even when multiple change files are processed each of the 
files is read only once.
For each of the change files and for the master file there is only one line in 
memory at a time (neglecting operating system buffering).
Thus the storage requirement of \TIE\ does not depend on the size of the change 
files or the size of a single changed section.

\vfill\eject
\def\eof{$\langle$EOF$\rangle$}
\section{Example}

To illustrate the actions \TIE\ performs you may inspect the following example 
that exercises some of the border line cases.

$$\vbox{
\halign{#\hfill\qquad\quad&#\hfill\qquad\quad&#\hfill\qquad\quad&#\hfill\cr
``master''      &{\tt CF1}      &{\tt CF2}      &{\tt CF3}\cr
line 1		&@x		&@x		&@x\cr
line 2		&line 2		&line 1		&changed line 4\cr
line 3		&line 3		&changed line 2	&@y\cr
line 4		&@y		&changed line 3	&final line 4\cr
line 5		&changed line 2	&inserted line	&@z\cr
line 6		&changed line 3	&line 4		&\eof\cr
line 7		&inserted line	&@y\cr
line 8		&@z		&final line 2\cr
line 9		&		&final line 3\cr
line 10		&@x		&changed line 4\cr
\eof		&line 7		&@z\cr
		&@y\cr
		&changed line 7	&@x\cr
		&@z		&changed line 7\cr
		&\eof		&line 8\cr
		&		&@y\cr
		&		&final line 7\cr
		&		&final line 8\cr
		&		&@z\cr
		&		&\eof\cr}
}$$
\vfill\eject
Using these input files and running \TIE\ twice to create a new master file
and a new change file will result in the following output files:

$$\vbox{
\halign{#\hfill\qquad\quad&&#\hfill\qquad\quad\cr
``master''	&``change''\cr
final line 2	&@x\cr
final line 3	&line 1\cr
final line 4	&line 2\cr
line 5		&line 3\cr
line 6		&line 4\cr
final line 7	&@y\cr
final line 8	&final line 2\cr
line 9		&final line 3\cr
line 10		&final line 4\cr
\eof		&@z\cr
		&\cr
		&@x\cr
		&line 7\cr
		&line 8\cr
		&@y\cr
		&final line 7\cr
		&final line 8\cr
		&@z\cr
		&\eof\cr}
}$$
\end{document}