| 1 |
<pre>Network Working Group Bob Anderson |
| 2 |
Request for Comments: 138 Rand |
| 3 |
NIC 6715 Vint Cerf |
| 4 |
UCLA |
| 5 |
Eric Harslem |
| 6 |
John Heafner |
| 7 |
Rand |
| 8 |
Jim Madden |
| 9 |
U. of Illinois |
| 10 |
Bob Metcalfe |
| 11 |
MIT |
| 12 |
Arie Shoshani |
| 13 |
SDC |
| 14 |
Jim White |
| 15 |
UCSB |
| 16 |
David Wood |
| 17 |
Mitre |
| 18 |
28 April 1971 |
| 19 |
|
| 20 |
<span class="h1">STATUS REPORT ON PROPOSED DATA RECONFIGURATION SERVICE</span> |
| 21 |
|
| 22 |
CONTENTS |
| 23 |
<a href="#appendix-I">I</a>. INTRODUCTION ................................. <a href="#page-2">2</a> |
| 24 |
|
| 25 |
Purpose of this RFC .......................... <a href="#page-2">2</a> |
| 26 |
Motivation ................................... <a href="#page-2">2</a> |
| 27 |
|
| 28 |
II. OVERVIEW OF DATA RECONFIGURATION SERVICE ..... <a href="#page-3">3</a> |
| 29 |
|
| 30 |
Elements of Data Reconfiguration Service ..... <a href="#page-3">3</a> |
| 31 |
Conceptual Network Connections ............... <a href="#page-3">3</a> |
| 32 |
Connection Protocols and Message Formats ..... <a href="#page-4">4</a> |
| 33 |
Example Connection Configurations ............ <a href="#page-6">6</a> |
| 34 |
|
| 35 |
III. THE FORM MACHINE ............................. <a href="#page-7">7</a> |
| 36 |
|
| 37 |
Input/Output Stream and Forms ................ <a href="#page-7">7</a> |
| 38 |
Form Machine BNF Syntax ...................... <a href="#page-7">7</a> |
| 39 |
Alternate Specification of Form Machine Syntax 8 |
| 40 |
Forms ........................................ <a href="#page-9">9</a> |
| 41 |
Rules ........................................ <a href="#page-10">10</a> |
| 42 |
Terms ........................................ <a href="#page-10">10</a> |
| 43 |
|
| 44 |
Term Format 1 .............................. <a href="#page-11">11</a> |
| 45 |
Term Format 2 .............................. <a href="#page-11">11</a> |
| 46 |
Term Format 3 .............................. <a href="#page-13">13</a> |
| 47 |
Term Format 4 .............................. <a href="#page-13">13</a> |
| 48 |
Application of a Term ...................... <a href="#page-14">14</a> |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
<span class="grey">Anderson, et al. [Page 1]</span></pre> |
| 53 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span> |
| 54 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 55 |
|
| 56 |
|
| 57 |
Restrictions and Interpretations of |
| 58 |
Term Functions ........................... <a href="#page-14">14</a> |
| 59 |
Term and Rule Sequencing ..................... <a href="#page-16">16</a> |
| 60 |
|
| 61 |
IV. EXAMPLES ..................................... <a href="#page-16">16</a> |
| 62 |
|
| 63 |
Remarks ...................................... <a href="#page-16">16</a> |
| 64 |
Field Insertion .............................. <a href="#page-17">17</a> |
| 65 |
Deletion ..................................... <a href="#page-17">17</a> |
| 66 |
Variable Length Records ...................... <a href="#page-17">17</a> |
| 67 |
String Length Computation .................... <a href="#page-18">18</a> |
| 68 |
Transposition ................................ <a href="#page-18">18</a> |
| 69 |
Character Packing and Unpacking .............. <a href="#page-18">18</a> |
| 70 |
|
| 71 |
V. PROPOSED USES OF DATA RECONFIGURATION SERVICE 19 |
| 72 |
|
| 73 |
VI. IMPLEMENTATION PLANS ......................... <a href="#page-20">20</a> |
| 74 |
|
| 75 |
<a href="#appendix-A">Appendix A</a> ......................................... <a href="#page-21">21</a> |
| 76 |
|
| 77 |
Note 1 to the DRS Working Group .............. <a href="#page-21">21</a> |
| 78 |
Note 2 to the DRS Working Group .............. <a href="#page-22">22</a> |
| 79 |
|
| 80 |
<span class="h2"><a class="selflink" id="appendix-I" href="#appendix-I">I</a>. INTRODUCTION</span> |
| 81 |
|
| 82 |
PURPOSE OF THIS RFC |
| 83 |
|
| 84 |
The purpose of this RFC is to describe, in part, a proposed Network |
| 85 |
experiment and to solicit comments on any aspect of the experiment. |
| 86 |
The experiment involves a software mechanism to reformat Network data |
| 87 |
streams. The mechanism can be adapted to numerous Network |
| 88 |
application programs. We hope that the results of the experiment |
| 89 |
will lead to a further standard service that embodies the principles |
| 90 |
described in this RFC. We would like comments on the |
| 91 |
appropriateness of this work as a Network experiment and also |
| 92 |
comments on particular Network data reformatting needs that could not |
| 93 |
easily be accomplished using these techniques. |
| 94 |
|
| 95 |
MOTIVATION |
| 96 |
|
| 97 |
Application programs require specific data I/O formats yet the |
| 98 |
formats are different from program to program. We take the position |
| 99 |
that the Network should adapt to the individual program requirements |
| 100 |
rather than changing each program to comply with a standard. This |
| 101 |
position doesn't preclude the use of standards that describe the |
| 102 |
formats of regular message contents; it is merely an interpretation |
| 103 |
of a standard as being a desirable mode of operation but not a |
| 104 |
necessary one. |
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
<span class="grey">Anderson, et al. [Page 2]</span></pre> |
| 109 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span> |
| 110 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 111 |
|
| 112 |
|
| 113 |
In addition to differing program requirements, a format mismatch |
| 114 |
problem occurs where users wish to employ many different kinds of |
| 115 |
consoles to attach to a single service program. It is desirable to |
| 116 |
have the Network adapt to individual console configurations rather |
| 117 |
than requiring unique software packages for each console |
| 118 |
transformation. |
| 119 |
|
| 120 |
One approach to providing adaptation is for those sites with |
| 121 |
substantial computing power to offer a data reconfiguration service; |
| 122 |
a proposed example of such a service is described here. |
| 123 |
|
| 124 |
The envisioned modus operandi of the service is that an applications |
| 125 |
programmer defines _forms_ that describe data reconfigurations. The |
| 126 |
service stores the forms by name. At a later time, a user (perhaps a |
| 127 |
non-programmer) employs the service to accomplish a particular |
| 128 |
transformation of a Network data stream, simply by calling the form |
| 129 |
by name. |
| 130 |
|
| 131 |
We have attempted to provide a notation tailored to some specifically |
| 132 |
needed instances of data reformatting while keeping the notation and |
| 133 |
its underlying implementation within some utility range that is |
| 134 |
bounded on the lower end by a notation expressive enough to make the |
| 135 |
experimental service useful, and that is bounded on the upper end by |
| 136 |
a notation short of a general purpose programming language. |
| 137 |
|
| 138 |
|
| 139 |
II. OVERVIEW OF THE DATA RECONFIGURATION SERVICE |
| 140 |
|
| 141 |
ELEMENTS OF THE DATA RECONFIGURATION SERVICE |
| 142 |
|
| 143 |
An implementation of the Data Reconfiguration Service (DRS) includes |
| 144 |
modules for connection protocols, a handler of some requests that can |
| 145 |
be made of the service, a compiler and/or interpreter (called the |
| 146 |
Form Machine) to act on those requests, and a file storage module for |
| 147 |
saving and retrieving definitions of data reconfigurations (forms). |
| 148 |
This section highlights connection protocols and requests. The next |
| 149 |
section covers the Form Machine language in some detail. File |
| 150 |
storage is not described in this document because it is transparent |
| 151 |
to the use of the service and its implementation is different at each |
| 152 |
DRS host. |
| 153 |
|
| 154 |
CONCEPTUAL NETWORK CONNECTIONS |
| 155 |
|
| 156 |
There are three conceptual Network connections to the DRS, see Fig. |
| 157 |
1. |
| 158 |
|
| 159 |
1) The control connection (CC) is between an originating user |
| 160 |
and the DRS. A form specifying data reconfiguration is |
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
<span class="grey">Anderson, et al. [Page 3]</span></pre> |
| 165 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span> |
| 166 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 167 |
|
| 168 |
|
| 169 |
defined over this connection and is applied to data passing |
| 170 |
over the two connections described below. |
| 171 |
2) The user connection (UC) is between a user process and the |
| 172 |
DRS. |
| 173 |
3) The server connection (SC) is between the DRS and the |
| 174 |
serving process. |
| 175 |
|
| 176 |
Since the goal is to adapt the Network to user and server processes, |
| 177 |
a minimum of requirements are imposed on the UC and SC. |
| 178 |
|
| 179 |
|
| 180 |
+-------------+ CC +-----------+ SC +-----------+ |
| 181 |
| ORIGINATING +--------+ DRS +--------+ SERVER | |
| 182 |
| USER | ^ | | ^ | PROCESS | |
| 183 |
+-------------+ | +------+----+ | +-----------+ |
| 184 |
| / | |
| 185 |
Telnet / <------ Simplex or Duplex |
| 186 |
Protocol UC/ Connections |
| 187 |
Connection / |
| 188 |
/ |
| 189 |
+-----+-----+ |
| 190 |
| USER | |
| 191 |
| PROCESS | |
| 192 |
+-----------+ |
| 193 |
|
| 194 |
Figure 1. DRS Network Connections |
| 195 |
|
| 196 |
|
| 197 |
CONNECTION PROTOCOLS AND MESSAGE FORMATS |
| 198 |
|
| 199 |
Over a control connection the dialog is directly between an |
| 200 |
originating user and the DRS. Here the user is defining forms or |
| 201 |
assigning forms to connections for reformatting. |
| 202 |
|
| 203 |
The user connects to the DRS via the initial connection protocol |
| 204 |
(ICP) specified in NWG/RFC #80, version 1. Rather than going through |
| 205 |
a logger, the user calls on a particular socket on which the DRS |
| 206 |
always listens. DRS switches the user to another socket pair. |
| 207 |
|
| 208 |
Messages sent over a control connection are of the types and formats |
| 209 |
to be specified for TELNET. Thus, a user at a terminal should be |
| 210 |
able to connect to a DRS via his local TELNET, for example, as shown |
| 211 |
in Fig. 2. |
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
|
| 220 |
<span class="grey">Anderson, et al. [Page 4]</span></pre> |
| 221 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span> |
| 222 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 223 |
|
| 224 |
|
| 225 |
+--------------+ |
| 226 |
+--------+ CC | | |
| 227 |
+-------+ TELNET +-------+ DRS | |
| 228 |
| +--------+ | | |
| 229 |
| +--------------+ |
| 230 |
+----------+---------+ |
| 231 |
| USER | |
| 232 |
|(TERMINAL OR PROGRAM| |
| 233 |
+--------------------+ |
| 234 |
|
| 235 |
Figure 2. A TELNET Connection to DRS |
| 236 |
|
| 237 |
When a user connects to DRS he supplies a six-character user ID (UID) |
| 238 |
as a qualifier to guarantee the uniqueness of his form names. He |
| 239 |
will have (at least) the following commands: |
| 240 |
|
| 241 |
1. DEFFORM (name) |
| 242 |
2. ENDFORM (name) |
| 243 |
|
| 244 |
These two commands define a form, the text of which is |
| 245 |
chronologically entered between them. The (name) is six |
| 246 |
characters. The form is stored in the DRS local file |
| 247 |
system. |
| 248 |
|
| 249 |
3. PURGE (name) |
| 250 |
|
| 251 |
The named form, as qualified by the current UID, is purged |
| 252 |
from the DRS file system. |
| 253 |
|
| 254 |
4. LISTNAMES (UID) |
| 255 |
|
| 256 |
The unqualified names of all forms assigned to UID are |
| 257 |
returned. |
| 258 |
|
| 259 |
5. LISTFORM (name) |
| 260 |
|
| 261 |
The source text of a named form is returned. |
| 262 |
|
| 263 |
6. DUPLEXCONNECT (user site, user send, user receive, |
| 264 |
user method, server site, server |
| 265 |
send, server receive, server method, |
| 266 |
user-to-server form, server-to-user form) |
| 267 |
|
| 268 |
7. SIMPLEXCONNECT (send site, send socket, send |
| 269 |
method, receive site, receive |
| 270 |
socket, receive method, form) |
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
<span class="grey">Anderson, et al. [Page 5]</span></pre> |
| 277 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span> |
| 278 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 279 |
|
| 280 |
|
| 281 |
Either one, both, or neither of the two parties specified in 6 or 7 |
| 282 |
may be at the same host as the party issuing the request. Sites and |
| 283 |
sockets specify user and server for the connection. Method indicates |
| 284 |
the way in which the connection is established. Three options are |
| 285 |
provided: |
| 286 |
1) Site/socket already connected to DRS as a dummy |
| 287 |
control connection. (A dummy control connection |
| 288 |
should not also be the real control connection.) |
| 289 |
2) Connect via standard ICP. (Only for command no. 6.) |
| 290 |
3) Connect directly via STR, RTS. |
| 291 |
|
| 292 |
EXAMPLE CONNECTION CONFIGURATIONS |
| 293 |
|
| 294 |
There are basically two modes of DRS operation: 1) the user wishes to |
| 295 |
establish a DRS UC/SC connection(s) between two programs and 2) the |
| 296 |
user wants to establish the same connection(s) where he (his |
| 297 |
terminal) is at the end of the UC or the SC. The latter case is |
| 298 |
appropriate when the user wishes to interact from his terminal with |
| 299 |
the serving process (e.g., a logger). |
| 300 |
|
| 301 |
In the first case (Fig. 1, where the originating user is either a |
| 302 |
terminal or a program) the user issues the appropriate CONNECT |
| 303 |
command. The UC/SC can be simplex or duplex. |
| 304 |
|
| 305 |
The second case has two possible configurations, shown in Figs. 3 and |
| 306 |
4. |
| 307 |
|
| 308 |
+--------+ CC +--------+ +------+ |
| 309 |
| +------+ | SC | | |
| 310 |
+------+ /| TELNET | UC | DRS +------+ SP | |
| 311 |
| |/ | +------+ | | | |
| 312 |
| USER | /+--------+ +--------+ +------+ |
| 313 |
| |/ |
| 314 |
+------+ |
| 315 |
|
| 316 |
Figure 3. Use of Dummy Control Connection |
| 317 |
|
| 318 |
+--------+ |
| 319 |
+------+ /| USER | CC +--------+ +------+ |
| 320 |
| |/ | SIDE +------+ | SC | | |
| 321 |
| USER | +--------+ UC | DRS +------+ SP | |
| 322 |
| |\ | SERVING+------+ | | | |
| 323 |
+------+ \| SIDE | +--------+ +------+ |
| 324 |
+--------+ |
| 325 |
|
| 326 |
Figure 4. Use of Server TELNET |
| 327 |
|
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
<span class="grey">Anderson, et al. [Page 6]</span></pre> |
| 333 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span> |
| 334 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 335 |
|
| 336 |
|
| 337 |
In Fig. 3 the user instructs his TELNET to make two duplex |
| 338 |
connections to DRS. One is used for control information (the CC) and |
| 339 |
the other is a dummy. When he issues the CONNECT he references the |
| 340 |
dummy duplex connection (UC) using the "already connected" option. |
| 341 |
|
| 342 |
In Fig. 4 the user has his TELNET (user side) call the DRS. When he |
| 343 |
issues the CONNECT the DRS calls the TELNET (server side) which |
| 344 |
accepts the call on behalf of the console. This distinction is known |
| 345 |
only to the user since to the DRS the configuration in Fig. 4 appears |
| 346 |
identical to that in Fig. 1. Two points should be noted: |
| 347 |
|
| 348 |
1) TELNET protocol is needed only to define forms and direct |
| 349 |
connections. It is not required for the using and serving |
| 350 |
processes. |
| 351 |
2) The using and serving processes need only a minimum of |
| 352 |
modification for Network use, i.e., an NCP interface. |
| 353 |
|
| 354 |
|
| 355 |
III. THE FORM MACHINE |
| 356 |
|
| 357 |
INPUT/OUTPUT STREAMS AND FORMS |
| 358 |
|
| 359 |
This section describes the syntax and semantics of forms that specify |
| 360 |
the data reconfigurations. The Form Machine gets an input stream, |
| 361 |
reformats the input stream according to a form describing the |
| 362 |
reconfiguration, and emits the reformatted data as an output stream. |
| 363 |
|
| 364 |
In reading this section it will be helpful to envision the |
| 365 |
application of a form to the data stream as depicted in Fig. 5. An |
| 366 |
input stream pointer identifies the position of data (in the input |
| 367 |
stream) that is being analyzed at any given time by a part of the |
| 368 |
form. Likewise, an output stream pointer locates data being emitted |
| 369 |
in the output stream. |
| 370 |
|
| 371 |
|
| 372 |
/\/\ /\/\ |
| 373 |
^ | | FORM | | ^ |
| 374 |
| | | ----------------- | | | |
| 375 |
| | | +- ----------------- -+ | | | |
| 376 |
| | | | CURRENT PART OF | | | | |
| 377 |
INPUT | |<= CURRENT < ----------------- > CURRENT => | | OUTPUT |
| 378 |
STREAM | | POINTER | FORM BEING APPLIED | POINTER | | STREAM |
| 379 |
| | +- ----------------- -+ | | |
| 380 |
| | ----------------- | | |
| 381 |
| | ----------------- | | |
| 382 |
| | ----------------- | | |
| 383 |
\/\/ \/\/ |
| 384 |
Figure 5. Application of Form to Data Streams |
| 385 |
|
| 386 |
|
| 387 |
|
| 388 |
<span class="grey">Anderson, et al. [Page 7]</span></pre> |
| 389 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span> |
| 390 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 391 |
|
| 392 |
|
| 393 |
FORM MACHINE BNF SYNTAX |
| 394 |
|
| 395 |
form ::= rule | rule form |
| 396 |
|
| 397 |
rule ;;= label inputstream outputstream ; |
| 398 |
|
| 399 |
label ::= INTEGER | <null> |
| 400 |
|
| 401 |
inputstream ::= terms | <null> |
| 402 |
|
| 403 |
terms ::= term | terms , term |
| 404 |
|
| 405 |
outputstream ::= : terms | <null> |
| 406 |
|
| 407 |
term ::= identifier | identifier descriptor | |
| 408 |
descriptor | comparator |
| 409 |
|
| 410 |
identifier ::= an alpha character followed by 0 to 3 |
| 411 |
alphamerics |
| 412 |
|
| 413 |
descriptor ::= (replicationexpression , datatype , |
| 414 |
valueexpression , lengthexpression control) |
| 415 |
|
| 416 |
comparator ::= (value connective value control) | |
| 417 |
(identifier .<=>. control) |
| 418 |
|
| 419 |
replicationexpression ::= arithmeticexpression | <null> |
| 420 |
|
| 421 |
datatype ::= B | O | X | E | A |
| 422 |
|
| 423 |
valueexpression ::= value | <null> |
| 424 |
|
| 425 |
lengthexpression ::= # | arithmeticexpression | <null> |
| 426 |
|
| 427 |
connective ::= .LE. | .LT. | .GE. | .GT. | .EQ. | .NE. |
| 428 |
|
| 429 |
value ::= literal | arithmeticexpression |
| 430 |
|
| 431 |
arithmeticexpression ::= primary | primary operator |
| 432 |
arithmeticexpression |
| 433 |
|
| 434 |
primary ::= identifier | L(identifier) | V(identifier) | |
| 435 |
INTEGER |
| 436 |
|
| 437 |
operator ::= + | - | * | / |
| 438 |
|
| 439 |
literal ::= literaltype "string" |
| 440 |
|
| 441 |
|
| 442 |
|
| 443 |
|
| 444 |
<span class="grey">Anderson, et al. [Page 8]</span></pre> |
| 445 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span> |
| 446 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 447 |
|
| 448 |
|
| 449 |
literaltype ::= B | O | X | E | A |
| 450 |
|
| 451 |
string ::= from 0 to 256 characters |
| 452 |
|
| 453 |
control ::= : options | <null> |
| 454 |
|
| 455 |
options ::= S(where) | F(where) | U(where) | |
| 456 |
S(where) , F(where) | |
| 457 |
F(where) , S(where) |
| 458 |
|
| 459 |
where ::= arithmeticexpression | R(arithmeticexpression) |
| 460 |
|
| 461 |
|
| 462 |
|
| 463 |
ALTERNATE SPECIFICATION OF FORM MACHINE SYNTAX |
| 464 |
|
| 465 |
infinity |
| 466 |
form ::= {rule} |
| 467 |
1 |
| 468 |
1 1 1 |
| 469 |
rule ::= {INTEGER} {terms} {:terms} ; |
| 470 |
0 0 0 |
| 471 |
infinity |
| 472 |
terms ::= term {,term} |
| 473 |
0 |
| 474 |
1 |
| 475 |
term ::= identifier | {identifier} descriptor |
| 476 |
0 |
| 477 |
| comparator |
| 478 |
1 |
| 479 |
descriptor ::= ({arithmeticexpression} , datatype , |
| 480 |
0 |
| 481 |
1 1 1 |
| 482 |
{value} , {lengthexpression} {:options} |
| 483 |
0 0 0 |
| 484 |
1 |
| 485 |
comparator ::= (value connective value {:options} ) | |
| 486 |
0 |
| 487 |
1 |
| 488 |
(identifier .<=. value {:options} ) |
| 489 |
0 |
| 490 |
connective ::= .LE. | .LT. | .GE. | .GT. | .EQ. | .NE. |
| 491 |
|
| 492 |
lengthexpression ::= # | arithmeticexpression |
| 493 |
|
| 494 |
datatype ::= B | O | X | E | A |
| 495 |
|
| 496 |
value ::= literal | arithmeticexpression |
| 497 |
|
| 498 |
|
| 499 |
|
| 500 |
<span class="grey">Anderson, et al. [Page 9]</span></pre> |
| 501 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span> |
| 502 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 503 |
|
| 504 |
|
| 505 |
infinity |
| 506 |
arithmeticexpression ::= primary {operator primary} |
| 507 |
0 |
| 508 |
operator ::= + | - | * | / |
| 509 |
|
| 510 |
primary ::= identifier | L(identifier) | |
| 511 |
V(identifier) | INTEGER |
| 512 |
256 |
| 513 |
literal ::= literaltype "{CHARACTER} " |
| 514 |
0 |
| 515 |
literaltype ::= B | O | X | A | E |
| 516 |
1 |
| 517 |
options ::= S(where) {,F(where)} | |
| 518 |
0 |
| 519 |
1 |
| 520 |
F(where) {,S(where)} | U(where) |
| 521 |
0 |
| 522 |
|
| 523 |
where ::= arithmeticexpression | |
| 524 |
R(arithmeticexpression) |
| 525 |
3 |
| 526 |
identifier ::= ALPHABETIC {ALPHAMERIC} |
| 527 |
0 |
| 528 |
|
| 529 |
FORMS |
| 530 |
|
| 531 |
A form is an ordered set of rules. |
| 532 |
|
| 533 |
form ::= rule | rule form |
| 534 |
|
| 535 |
The current rule is applied to the current position of the input |
| 536 |
stream. If the (input stream part of a) rule fails to correctly |
| 537 |
describe the contents of the current input then another rule is made |
| 538 |
current and applied to the current position of the input stream. The |
| 539 |
next rule to be made current is either explicitly specified by the |
| 540 |
current term in the current rule or it is the next sequential rule by |
| 541 |
default. Flow of control is more fully described under TERM AND RULE |
| 542 |
SEQUENCING. |
| 543 |
|
| 544 |
If the (input stream part of a) rule succeeds in correctly describing |
| 545 |
the current input stream, then some data may be emitted at the |
| 546 |
current position in the output stream according to the rule. The |
| 547 |
input and output stream pointers are advanced over the described and |
| 548 |
emitted data, respectively, and the next rule is applied to the now |
| 549 |
current position of the input stream. |
| 550 |
|
| 551 |
Application of the form is terminated when an explicit return |
| 552 |
(R(arithmeticexpression)) is encountered in a rule. The user and |
| 553 |
|
| 554 |
|
| 555 |
|
| 556 |
<span class="grey">Anderson, et al. [Page 10]</span></pre> |
| 557 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span> |
| 558 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 559 |
|
| 560 |
|
| 561 |
server connections are closed and the return code |
| 562 |
(arithmeticexpression) is sent to the originating user. |
| 563 |
|
| 564 |
RULES |
| 565 |
|
| 566 |
A rule is a replacement, comparison, and/or an assignment operation |
| 567 |
of the form shown below. |
| 568 |
|
| 569 |
rule ::= label inputstream outputstream ; |
| 570 |
|
| 571 |
A label is the name of a rule and it exists so that the rule may be |
| 572 |
referenced elsewhere in the form for explicit rule transfer of |
| 573 |
control. Labels are of the form below. |
| 574 |
|
| 575 |
label ::= INTEGER | <null> |
| 576 |
|
| 577 |
The optional integer labels are in the range 0 >= INTEGER >= 9999. |
| 578 |
The rules need not be labeled in ascending numerical order. |
| 579 |
|
| 580 |
TERMS |
| 581 |
|
| 582 |
The inputstream (describing the input stream to be matched) and the |
| 583 |
outputstream (describing data to be emitted in the output stream) |
| 584 |
consist of zero or more terms and are of the form shown below. |
| 585 |
|
| 586 |
inputstream ::= terms | <null> |
| 587 |
outputstream ::= :terms | <null> |
| 588 |
terms ::= term | terms , term |
| 589 |
|
| 590 |
Terms are of one of four formats as indicated below. |
| 591 |
|
| 592 |
term ::= identifier | identifier descriptor | |
| 593 |
descriptor | comparator |
| 594 |
|
| 595 |
Term Format 1 |
| 596 |
|
| 597 |
The first term format is shown below. |
| 598 |
|
| 599 |
identifier |
| 600 |
|
| 601 |
The identifier is a symbolic reference to a previously identified |
| 602 |
term (term format 2) in the form. It takes on the same attributes |
| 603 |
(value, length, type) as the term by that name. Term format 1 is |
| 604 |
normally used to emit data in the output stream. |
| 605 |
|
| 606 |
Identifiers are formed by an alpha character followed by 0 to 3 |
| 607 |
alphameric characters. |
| 608 |
|
| 609 |
|
| 610 |
|
| 611 |
|
| 612 |
<span class="grey">Anderson, et al. [Page 11]</span></pre> |
| 613 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span> |
| 614 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 615 |
|
| 616 |
|
| 617 |
Term Format 2 |
| 618 |
|
| 619 |
The second term format is shown below. |
| 620 |
|
| 621 |
identifier descriptor |
| 622 |
|
| 623 |
Term format 2 is generally used as an input stream term but can be |
| 624 |
used as an output stream term. |
| 625 |
|
| 626 |
A descriptor is defined as shown below. |
| 627 |
|
| 628 |
descriptor ::= (replicationexpression, datatype, |
| 629 |
valueexpression, lengthexpression |
| 630 |
control) |
| 631 |
|
| 632 |
The identifier is the symbolic name of the term in the usual |
| 633 |
programming language sense. It takes on the type, length, and value |
| 634 |
attributes of the term and it may be referenced elsewhere in the |
| 635 |
form. |
| 636 |
|
| 637 |
The replication expression is defined below. |
| 638 |
|
| 639 |
replicationexpression ::= arithmeticexpression | <null> |
| 640 |
arithmeticexpression ::= primary | primary operator |
| 641 |
arithmeticexpression |
| 642 |
operator ::= + | - | * | / |
| 643 |
primary ::= identifier | L(identifier) | V(identifier) | |
| 644 |
INTEGER |
| 645 |
|
| 646 |
The replication expression is a repeat function applied to the |
| 647 |
combined data type and value expression. It expresses the number of |
| 648 |
times that the value (of the data type/value expression) is to be |
| 649 |
repeated within the field length denoted by the data type/length |
| 650 |
expression. |
| 651 |
|
| 652 |
A null replication expression has the value of one. Arithmetic |
| 653 |
expressions are evaluated from left-to-right with no precedence. (It |
| 654 |
is anticipated that this interpretation might be changed, if |
| 655 |
necessary.) |
| 656 |
|
| 657 |
The L(identifier) is a length operator that generates a 32-bit binary |
| 658 |
integer corresponding to the length of the term named. The |
| 659 |
V(identifier) is a value operator that generates a 32-bit binary |
| 660 |
integer corresponding to the value of the term named. (See |
| 661 |
Restrictions and Interpretations of Term Functions.) The value |
| 662 |
operator is intended to convert character strings to their numerical |
| 663 |
correspondents. |
| 664 |
|
| 665 |
|
| 666 |
|
| 667 |
|
| 668 |
<span class="grey">Anderson, et al. [Page 12]</span></pre> |
| 669 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span> |
| 670 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 671 |
|
| 672 |
|
| 673 |
The data type is defined below. |
| 674 |
|
| 675 |
datatype ::= B | O | X | E | A |
| 676 |
|
| 677 |
The data type describes the kind of data that the term represents. |
| 678 |
(It is expected that additional data types, such as floating point |
| 679 |
and user-defined types, will be added as needed.) |
| 680 |
|
| 681 |
Data Type Meaning Unit Length |
| 682 |
|
| 683 |
B Bit string 1 bit |
| 684 |
O Bit string 3 bits |
| 685 |
X Bit string 4 bits |
| 686 |
E EBCDIC character 8 bits |
| 687 |
A Network ASCII character 8 bits |
| 688 |
|
| 689 |
The value expression is defined below. |
| 690 |
|
| 691 |
valueexpression ::= value | <null> |
| 692 |
value ::= literal | arithmeticexpression |
| 693 |
literal ::= literaltype "string" |
| 694 |
literaltype ::= B | O | X | E | A |
| 695 |
|
| 696 |
The value expression is the unit value of a term expressed in the |
| 697 |
format indicated by the data type. It is repeated according to the |
| 698 |
replication expression, in a field whose length is constrained by the |
| 699 |
length expression. |
| 700 |
|
| 701 |
A null value expression in the input stream defaults to the data |
| 702 |
present in the input stream. The data must comply with the datatype |
| 703 |
attribute, however. |
| 704 |
|
| 705 |
A null value expression generates padding according to Restrictions |
| 706 |
and Interpretations of Term Functions. |
| 707 |
|
| 708 |
The length expression is defined below. |
| 709 |
|
| 710 |
lengthexpression ::= # | arithmeticexpression | <null> |
| 711 |
|
| 712 |
The length expression states the length of the field containing the |
| 713 |
value expression as expanded by the replication expression. If the |
| 714 |
value of the length expression is less then the length implied by the |
| 715 |
expanded value expression, then the expanded value expression is |
| 716 |
truncated, see Restrictions and Interpretations of Term Functions. |
| 717 |
|
| 718 |
The terminal symbol # means an arbitrary length, explicitly |
| 719 |
terminated by the value of the next term. The # is legal only in the |
| 720 |
input stream and not in the output stream. |
| 721 |
|
| 722 |
|
| 723 |
|
| 724 |
<span class="grey">Anderson, et al. [Page 13]</span></pre> |
| 725 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span> |
| 726 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 727 |
|
| 728 |
|
| 729 |
If the length expression is less than or equal to zero, the term |
| 730 |
succeeds but the appropriate stream pointer is not advanced. |
| 731 |
Positive lengths cause the appropriate stream pointer to be advanced |
| 732 |
if the term otherwise succeeds. |
| 733 |
|
| 734 |
Control is defined under TERM AND RULE SEQUENCING. |
| 735 |
|
| 736 |
Term Format 3 |
| 737 |
|
| 738 |
Term format 3 is shown below. |
| 739 |
|
| 740 |
descriptor |
| 741 |
|
| 742 |
It is identical to term format 2 with the omission of the identifier. |
| 743 |
Term format 3 is generally used in the output stream. It is used in |
| 744 |
the input stream where input data is to be passed over but not |
| 745 |
retained for emission or later reference. |
| 746 |
|
| 747 |
Term Format 4 |
| 748 |
|
| 749 |
The fourth term format is shown below. |
| 750 |
|
| 751 |
comparator ::= (value connective value control) | |
| 752 |
(identifier .<=. value control) |
| 753 |
value ::= literal | arithmeticexpression |
| 754 |
literal ::= literaltype "string" |
| 755 |
literaltype ::= B | O | X | E | A |
| 756 |
string ::= from 0 to 256 characters |
| 757 |
connective ::= .LE. | .LT. | .GE. | .GT. | .EQ. | .NE. |
| 758 |
|
| 759 |
The fourth term format is used for assignment and comparison. |
| 760 |
|
| 761 |
The assignment operator .<=. assigns the value to the identifier. |
| 762 |
The connectives have their usual meaning. Values to be compared must |
| 763 |
have the same type and length attributes or an error condition arises |
| 764 |
and the form fails. |
| 765 |
|
| 766 |
The Application of a Term |
| 767 |
|
| 768 |
The elements of a term are applied by the following sequence of |
| 769 |
steps. |
| 770 |
|
| 771 |
1. The data type and value expression together specify a unit |
| 772 |
value, call it x. |
| 773 |
|
| 774 |
2. The replication expression specifies the number of times x |
| 775 |
is to be repeated (or copied) in concatenated fashion. The |
| 776 |
value of the concatenated xs becomes, say, y of length L1. |
| 777 |
|
| 778 |
|
| 779 |
|
| 780 |
<span class="grey">Anderson, et al. [Page 14]</span></pre> |
| 781 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span> |
| 782 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 783 |
|
| 784 |
|
| 785 |
3. The data type and the length expression together specify a |
| 786 |
field length of the input area (call it L2) that begins at |
| 787 |
the current stream pointer position. |
| 788 |
|
| 789 |
4. The value of y is truncated to y' if L1 > L2. Call the |
| 790 |
truncated length L1'. |
| 791 |
|
| 792 |
5. If the term is an input stream term, then the value y' of |
| 793 |
length L1' is compared to the input value beginning at the |
| 794 |
current input pointer position. |
| 795 |
|
| 796 |
6. If the values are identical over the length L1' then the |
| 797 |
input value of length L2 (may be greater than L1') starting |
| 798 |
at the current pointer position in the input area, becomes |
| 799 |
the value of the term. |
| 800 |
|
| 801 |
In an output stream term, the procedure is the same except that the |
| 802 |
source of input is the value of the term(s) named in the value |
| 803 |
expression and the data is emitted in the output stream. |
| 804 |
|
| 805 |
The above procedure is modified to include a one term look-ahead |
| 806 |
where lengths are indefinite because of the arbitrary symbol, #. |
| 807 |
|
| 808 |
Restrictions and Interpretations of Term Functions |
| 809 |
|
| 810 |
1. Terms specifying indefinite lengths, through the use of the # |
| 811 |
symbol must be separated by some type-specific data such as a |
| 812 |
literal. (A literal isn't specifically required, however. An |
| 813 |
arbitrary number of ASCII characters could be terminated by a |
| 814 |
non-ASCII character.) # is legal only in the input stream, not |
| 815 |
in the output stream. |
| 816 |
|
| 817 |
2. Truncation and padding is as follows: |
| 818 |
a) Character to character (A <--> E) conversion is left |
| 819 |
justified and truncated or padded on the right with blanks. |
| 820 |
b) Character to numeric and numeric to numeric conversions are |
| 821 |
right-justified and truncated or padded on the left with |
| 822 |
zeros. |
| 823 |
c) Numeric to character conversion is right-justified and |
| 824 |
left-padded with blanks. |
| 825 |
|
| 826 |
3. The following are ignored in a form definition over the control |
| 827 |
connection. |
| 828 |
a) TAB, carriage return, etc. |
| 829 |
b) blanks except within quotes. |
| 830 |
c) /* string */ is treated as comments except within quotes. |
| 831 |
|
| 832 |
4. The following defaults prevail where the term part is omitted. |
| 833 |
|
| 834 |
|
| 835 |
|
| 836 |
<span class="grey">Anderson, et al. [Page 15]</span></pre> |
| 837 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span> |
| 838 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 839 |
|
| 840 |
|
| 841 |
a) The replication expression defaults to one. |
| 842 |
b) The data type defaults to type B. |
| 843 |
c) The value expression of an input stream term defaults to |
| 844 |
the value found in the input stream, but the input stream |
| 845 |
must conform to data type and length expression. The value |
| 846 |
expression of an output stream term defaults to padding |
| 847 |
only. |
| 848 |
d) The length expression defaults to the size of the quantity |
| 849 |
determined by replication expression, data type, and value |
| 850 |
expression. |
| 851 |
e) Control defaults to the next sequential term if a term is |
| 852 |
successfully applied; else control defaults to the next |
| 853 |
sequential rule. If _where_ evaluates to an undefined |
| 854 |
_label_ the form fails. |
| 855 |
|
| 856 |
5. Arithmetic expressions are evaluated left-to-right with no |
| 857 |
precedence. |
| 858 |
|
| 859 |
6. The following limits prevail. |
| 860 |
|
| 861 |
a) Binary lengths are <= 32 bits |
| 862 |
b) Character strings are <= 256 8-bit characters |
| 863 |
c) Identifier names are <= 4 characters |
| 864 |
d) Maximum number of identifiers is <= 256 |
| 865 |
e) Label integers are >= 0 and <= 9999 |
| 866 |
|
| 867 |
7. Value and length operators product 32-bit binary integers. The |
| 868 |
value operator is currently intended for converting A or E type |
| 869 |
decimal character strings to their binary correspondents. For |
| 870 |
example, the value of E'12' would be 0......01100. The value |
| 871 |
of E'AB' would cause the form to fail. |
| 872 |
|
| 873 |
|
| 874 |
|
| 875 |
|
| 876 |
|
| 877 |
|
| 878 |
|
| 879 |
|
| 880 |
|
| 881 |
|
| 882 |
|
| 883 |
|
| 884 |
|
| 885 |
|
| 886 |
|
| 887 |
|
| 888 |
|
| 889 |
|
| 890 |
|
| 891 |
|
| 892 |
<span class="grey">Anderson, et al. [Page 16]</span></pre> |
| 893 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-17" ></span> |
| 894 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 895 |
|
| 896 |
|
| 897 |
TERM AND RULE SEQUENCING |
| 898 |
|
| 899 |
Sequencing may be explicitly controlled by including control in a |
| 900 |
term. |
| 901 |
|
| 902 |
control ::= :options | <null> |
| 903 |
options ::= S(where) | F(where) | U(where) |
| 904 |
S(where) , F(where) | |
| 905 |
F(where) , S(where) |
| 906 |
|
| 907 |
where ::= arithmeticexpression | R(arithmeticexpression) |
| 908 |
|
| 909 |
S, F, and U denote success, fail, and unconditional transfers, |
| 910 |
respectively. _Where_ evaluates to a _rule_ label, thus transfer can |
| 911 |
be effected from within a rule (at the end of a term) to the |
| 912 |
beginning of another rule. R means terminate the form and return the |
| 913 |
evaluated expression to the initiator over the control connection (if |
| 914 |
still open). |
| 915 |
|
| 916 |
If terms are not explicitly sequenced, the following defaults |
| 917 |
prevail. |
| 918 |
|
| 919 |
1) When a term fails go to the next sequential rule. |
| 920 |
2) When a term succeeds go to the next sequential |
| 921 |
term within the rule. |
| 922 |
(3) At the end of a rule, go to the next sequential |
| 923 |
rule. |
| 924 |
|
| 925 |
Note in the following example, the correlation between transfer of |
| 926 |
control and movement of the input pointer. |
| 927 |
|
| 928 |
1 XYZ(,B,,8:S(2),F(3)) : XYZ ; |
| 929 |
2 . . . . . . . |
| 930 |
3 . . . . . . . |
| 931 |
|
| 932 |
The value of XYZ will never be emitted in the output stream since |
| 933 |
control is transferred out of the rule upon either success or |
| 934 |
failure. If the term succeeds, the 8 bits of input will be assigned |
| 935 |
as the value of XYZ and rule 2 will then be applied to the same input |
| 936 |
stream data. That is, since the complete rule 1 was not successfully |
| 937 |
applied, then the input stream pointer is not advanced. |
| 938 |
|
| 939 |
|
| 940 |
|
| 941 |
|
| 942 |
|
| 943 |
|
| 944 |
|
| 945 |
|
| 946 |
|
| 947 |
|
| 948 |
<span class="grey">Anderson, et al. [Page 17]</span></pre> |
| 949 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-18" ></span> |
| 950 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 951 |
|
| 952 |
|
| 953 |
IV. EXAMPLES |
| 954 |
|
| 955 |
REMARKS |
| 956 |
|
| 957 |
The following examples (forms and also single rules) are simple |
| 958 |
representative uses of the Form Machine. The examples are expressed |
| 959 |
in a term-per-line format only to aid the explanation. Typically, a |
| 960 |
single rule might be written as a single line. |
| 961 |
|
| 962 |
FIELD INSERTION |
| 963 |
|
| 964 |
To insert a field, separate the input into the two terms to allow the |
| 965 |
inserted field between them. For example, to do line numbering for a |
| 966 |
121 character/line printer with a leading carriage control character, |
| 967 |
use the following form. |
| 968 |
|
| 969 |
(NUMB.<=>.1); /*initialize line number counter to one*/ |
| 970 |
1 CC(,E,,1:F(R(99))), /*pick up control character and save |
| 971 |
as CC*/ |
| 972 |
/*return a code of 99 upon exhaustion*/ |
| 973 |
LINE(,E,,121 : F(R(98))) /*save text as LINE*/ |
| 974 |
:CC, /*emit control character*/ |
| 975 |
(,E,NUMB,2), /*emit counter in first two columns*/ |
| 976 |
(,E,E".",1), /*emit period after line number*/ |
| 977 |
(,E,LINE,117), /*emit text, truncated in 117 byte field*/ |
| 978 |
(NUMB.<=.NUMB+1:U(1)); /*increment line counter and go to |
| 979 |
rule one*/;; |
| 980 |
|
| 981 |
DELETION |
| 982 |
|
| 983 |
Data to be deleted should be isolated as separate terms on the left, |
| 984 |
so they may be omitted (by not emitting them) on the right. |
| 985 |
|
| 986 |
(,B,,8), /*isolate 8 bits to ignore*/ |
| 987 |
SAVE(,A,,10) /*extract 10 ASCII characters from |
| 988 |
input stream*/ |
| 989 |
:(,E,SAVE,); /*emit the characters in SAVE as EBCDIC |
| 990 |
characters whose length defaults to the |
| 991 |
length of SAVE, i.e., 10, and advance to |
| 992 |
the next rule*/ |
| 993 |
|
| 994 |
In the above example, if either input stream term fails, |
| 995 |
the next sequential rule is applied. |
| 996 |
|
| 997 |
VARIABLE LENGTH RECORDS |
| 998 |
|
| 999 |
Some devices, terminals and programs generate variable length |
| 1000 |
records. To following rule picks up variable length EBCDIC records |
| 1001 |
|
| 1002 |
|
| 1003 |
|
| 1004 |
<span class="grey">Anderson, et al. [Page 18]</span></pre> |
| 1005 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-19" ></span> |
| 1006 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 1007 |
|
| 1008 |
|
| 1009 |
and translates them to ASCII. |
| 1010 |
|
| 1011 |
CHAR(,E,,#), /*pick up all (an arbitrary number of) |
| 1012 |
EBCDIC characters in the input stream*/ |
| 1013 |
(,X,X"FF",2) /*followed by a hexadecimal literal, |
| 1014 |
FF (terminal signal)*/ |
| 1015 |
:(,A,CHAR,), /*emit them as ASCII*/ |
| 1016 |
(,X,X"25",2); /*emit an ASCII carriage return*/ |
| 1017 |
|
| 1018 |
STRING LENGTH COMPUTATION |
| 1019 |
|
| 1020 |
It is often necessary to prefix a length field to an arbitrarily long |
| 1021 |
character string. The following rule prefixes an EBCDIC string with |
| 1022 |
a one-byte length field. |
| 1023 |
|
| 1024 |
Q(,E,,#), /*pick up all EBCDIC characters*/ |
| 1025 |
TS(,X,X"FF",2) /*followed by a hexadecimal literal, FF*/ |
| 1026 |
:(,B,L(Q)+2,8), /*emit the length of the characters |
| 1027 |
plus the length of the literal plus |
| 1028 |
the length of the count field itself, |
| 1029 |
in an 8-bit field*/ |
| 1030 |
Q, */emit the characters*/ |
| 1031 |
TS; */emit the terminal*/ |
| 1032 |
|
| 1033 |
TRANSPOSITION |
| 1034 |
|
| 1035 |
It is often desirable to reorder fields, such as the following |
| 1036 |
example. |
| 1037 |
|
| 1038 |
Q(,E,,20), R(,E,,10) , S(,E,,15), T(,E,,5) : R, T, S, Q ; |
| 1039 |
|
| 1040 |
The terms are emitted in a different order. |
| 1041 |
|
| 1042 |
CHARACTER PACKING AND UNPACKING |
| 1043 |
|
| 1044 |
In systems such as HASP, repeated sequences of characters are packed |
| 1045 |
into a count followed by the character, for more efficient storage |
| 1046 |
and transmission. The first form packs multiple characters and the |
| 1047 |
|
| 1048 |
|
| 1049 |
|
| 1050 |
|
| 1051 |
|
| 1052 |
|
| 1053 |
|
| 1054 |
|
| 1055 |
|
| 1056 |
|
| 1057 |
|
| 1058 |
|
| 1059 |
|
| 1060 |
<span class="grey">Anderson, et al. [Page 19]</span></pre> |
| 1061 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-20" ></span> |
| 1062 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 1063 |
|
| 1064 |
|
| 1065 |
second unpacks them. |
| 1066 |
/*form to pack EBCDIC streams*/ |
| 1067 |
/*returns 99 if OK, input exhausted*/ |
| 1068 |
/*returns 98 if illegal EBCDIC*/ |
| 1069 |
/*look for terminal signal FF which is not a legal EBCDIC*/ |
| 1070 |
/*duplication count must be 0-254*/ |
| 1071 |
1 (,X,X"FF",2 : S(R(99))) ; |
| 1072 |
/*pick up the EBCDIC and initialize count/* |
| 1073 |
CHAR(,E,,1 : F(R(98))) , (CNT .<=. 1) ; |
| 1074 |
/*count consecutive EBCDICs like CHAR*/ |
| 1075 |
2 (,E,CHAR,1 : F(3)) , (CNT .<=. CNT+1 : U(2)) ; |
| 1076 |
/*emit count and current character*/ |
| 1077 |
3 : (,B,CNT,8), CHAR, (:U(1)); |
| 1078 |
/*end of form*/;; |
| 1079 |
|
| 1080 |
/*form to unpack EBCDIC streams*/ |
| 1081 |
/*look for terminal*/ |
| 1082 |
1 (,X,X"FF",2 : S(R(99))) ; |
| 1083 |
/*emit character the number of times indicated*/ |
| 1084 |
/*by the counter contents*/ |
| 1085 |
CNT(,B,,8), CHAR(,E,,1) : (CNT,E,CHAR,CNT:U(1)); |
| 1086 |
/*failure of form*/ |
| 1087 |
(:U(R(98))) ;; |
| 1088 |
|
| 1089 |
|
| 1090 |
<span class="h2"><a class="selflink" id="appendix-V" href="#appendix-V">V</a>. PROPOSED USES OF DATA RECONFIGURATION SERVICE</span> |
| 1091 |
|
| 1092 |
The following are some proposed uses of the DRS that were submitted |
| 1093 |
by the sites indicated. |
| 1094 |
|
| 1095 |
UCLA |
| 1096 |
1. Pack/unpack text files. |
| 1097 |
2. Preprocessor to scan META compiler input. |
| 1098 |
3. Perhaps graphics. |
| 1099 |
|
| 1100 |
MIT |
| 1101 |
1. Reformatting within file transfer service. |
| 1102 |
2. Character conversions. |
| 1103 |
3. Possible graphics service (Evans and Sutherland output |
| 1104 |
format). |
| 1105 |
4. Reformat arguments of subroutines remote to each other. |
| 1106 |
|
| 1107 |
U. OF ILLINOIS |
| 1108 |
1. Dependent upon remote use of DRS for many remote |
| 1109 |
services. |
| 1110 |
|
| 1111 |
SDC |
| 1112 |
1. Would be essential to data transfer in general. |
| 1113 |
|
| 1114 |
|
| 1115 |
|
| 1116 |
<span class="grey">Anderson, et al. [Page 20]</span></pre> |
| 1117 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-21" ></span> |
| 1118 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 1119 |
|
| 1120 |
|
| 1121 |
2. Could be used in relation to data management language. |
| 1122 |
|
| 1123 |
UCSB |
| 1124 |
1. Checkout of I/O formats of file system. |
| 1125 |
2. Debugging Network services in general. |
| 1126 |
3. Mapping their services into future standards. |
| 1127 |
|
| 1128 |
RAND |
| 1129 |
1. To describe RJO/RJE message formats at UCSB. |
| 1130 |
2. To describe RJS message formats at UCLA. |
| 1131 |
3. To adapt Network to existing services, in general. |
| 1132 |
|
| 1133 |
MITRE |
| 1134 |
1. Character conversions. |
| 1135 |
2. Testing data formats going into data bases for correct |
| 1136 |
field formatting. |
| 1137 |
|
| 1138 |
VI. IMPLEMENTATION PLANS |
| 1139 |
|
| 1140 |
Four sites currently plan to implement and offer the service on an |
| 1141 |
experimental basis. |
| 1142 |
|
| 1143 |
1. MIT Implementation of forms interpreter in MIDAS |
| 1144 |
(assembly). Perhaps Tree Meta compiler of |
| 1145 |
forms. Implementation on PDP-10. |
| 1146 |
|
| 1147 |
2. UCLA Implementation on SIGMA-7 employing META-7 |
| 1148 |
to compile forms. |
| 1149 |
|
| 1150 |
3. UCSB Implementation on 360/75. |
| 1151 |
|
| 1152 |
4. RAND Initial implementation on 360/65; compiler to be written |
| 1153 |
in graphics CPS; compiled intermediate forms to be |
| 1154 |
interpreted by assembler language subroutine. Later |
| 1155 |
implemented on PDP-10. |
| 1156 |
|
| 1157 |
In addition to the above sites, the University of Illinois and Mitre |
| 1158 |
plan to experiment with the service. |
| 1159 |
|
| 1160 |
|
| 1161 |
|
| 1162 |
|
| 1163 |
|
| 1164 |
|
| 1165 |
|
| 1166 |
|
| 1167 |
|
| 1168 |
|
| 1169 |
|
| 1170 |
|
| 1171 |
|
| 1172 |
<span class="grey">Anderson, et al. [Page 21]</span></pre> |
| 1173 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-22" ></span> |
| 1174 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 1175 |
|
| 1176 |
|
| 1177 |
APPENDIX A |
| 1178 |
|
| 1179 |
Note 1 to the DRS Working Group |
| 1180 |
|
| 1181 |
As you recall, we spent considerable time in discussing the use and |
| 1182 |
meaning of the arbitrary symbol, #. To summarize, it was clear that |
| 1183 |
inclusion of the # in both replication and length expressions led to |
| 1184 |
ambiguities. We settled on its restricted use in the length |
| 1185 |
expression of an input term, although no one was entirely satisfied |
| 1186 |
with this definition. |
| 1187 |
|
| 1188 |
Recently, Jim White has again commented on the #. Jim feels that it |
| 1189 |
is curious that one can pick up an arbitrary number of EBCDIC |
| 1190 |
characters, for example, but can't pick up an arbitrary number of |
| 1191 |
specific EBCDIC characters such as EBCDIC A's. Jim feels that a more |
| 1192 |
natural way to interpret the length, value, and replication |
| 1193 |
expressions would be as the IBM OS assembler interprets the |
| 1194 |
attributes of the pseudo instruction, define constant (CD). |
| 1195 |
|
| 1196 |
The IBM OS assembler uses the following format. |
| 1197 |
|
| 1198 |
1 2 3 4 |
| 1199 |
duplication type modifiers nominal value |
| 1200 |
factor |
| 1201 |
|
| 1202 |
The duplication factor, if specified, causes the constant to be |
| 1203 |
generated the number of times indicated by the factor. The type |
| 1204 |
defines the type of constant being specified. Modifiers describe the |
| 1205 |
length, scaling, and exponent of the constant. Nominal value |
| 1206 |
supplies the constant described by the subfields that precede it. |
| 1207 |
|
| 1208 |
Assume that we use the # only as a duplication factor (replication |
| 1209 |
expression). Hence, in the example of the form to pack EBCDIC |
| 1210 |
characters, the counter and looping can be eliminated. |
| 1211 |
|
| 1212 |
CHAR(,E,,1) ; |
| 1213 |
LEN(#,#,CHAR,1) : (,B,L(LEN)+1,*) , CHAR ; |
| 1214 |
|
| 1215 |
The interpretation is that the data type, length expression, and |
| 1216 |
value expression make up the unit value. This quantity can then be |
| 1217 |
replicated. As our document now stands, only the data type and value |
| 1218 |
expression make up the unit value. |
| 1219 |
|
| 1220 |
The application of a term according to Jim's suggestion is as |
| 1221 |
follows. |
| 1222 |
1. The data type, value expression, and length expression together |
| 1223 |
specify a unit value, call it x. |
| 1224 |
|
| 1225 |
|
| 1226 |
|
| 1227 |
|
| 1228 |
<span class="grey">Anderson, et al. [Page 22]</span></pre> |
| 1229 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-23" ></span> |
| 1230 |
<span class="grey"><a href="./rfc138">RFC 138</a> Data Reconfiguration Service April 1971</span> |
| 1231 |
|
| 1232 |
|
| 1233 |
2. The replication expression specifies the number of times x is to |
| 1234 |
be repeated. The value of the concatenated xs becomes y of |
| 1235 |
length L. |
| 1236 |
3. If the term is an input stream term then the value beginning at |
| 1237 |
the current input pointer position. |
| 1238 |
4. If the input value satisfies the constraints of y over length L |
| 1239 |
then the input value of length L becomes the value of the term. |
| 1240 |
|
| 1241 |
Note 2 to the DRS Working Group |
| 1242 |
|
| 1243 |
There has been recent debate of whether the input pointer should be |
| 1244 |
advanced upon successful completion of a rule (as it now is defined) |
| 1245 |
or upon successful completion of each term. See the example on page |
| 1246 |
22. If the input pointer is advanced upon successful completion of a |
| 1247 |
term, then rules become equivalent to terms. |
| 1248 |
|
| 1249 |
I would like to for us to discuss at the SJCC both the term |
| 1250 |
attributes and the input pointer advance issues. |
| 1251 |
|
| 1252 |
John |
| 1253 |
|
| 1254 |
|
| 1255 |
[ This RFC was put into machine readable form for entry ] |
| 1256 |
[ into the online RFC archives by Katsunori Tanaka 4/99 ] |
| 1257 |
|
| 1258 |
|
| 1259 |
|
| 1260 |
|
| 1261 |
|
| 1262 |
|
| 1263 |
|
| 1264 |
|
| 1265 |
|
| 1266 |
|
| 1267 |
|
| 1268 |
|
| 1269 |
|
| 1270 |
|
| 1271 |
|
| 1272 |
|
| 1273 |
|
| 1274 |
|
| 1275 |
|
| 1276 |
|
| 1277 |
|
| 1278 |
|
| 1279 |
|
| 1280 |
|
| 1281 |
|
| 1282 |
|
| 1283 |
|
| 1284 |
Anderson, et al. [Page 23] |
| 1285 |
</pre> |