Language-machine for data reconfiguration
RFC 83

Document Type RFC - Unknown (December 1970; No errata)
Last updated 2013-03-02
Stream Legacy
Formats plain text pdf html bibtex
Stream Legacy state (None)
Consensus Boilerplate Unknown
RFC Editor Note (None)
IESG IESG state RFC 83 (Unknown)
Telechat date
Responsible AD (None)
Send notices to (None)
Network Working Group                                        R. Anderson
Request for Comments: 83                                      A. Harslem
NIC: 5621                                                     J. Heafner
                                                                    RAND
                                                        18 December 1970

               LANGUAGE-MACHINE FOR DATA RECONFIGURATION

Introduction

   In NWG/RFC #80 we mentioned the needs for data reconfiguration along
   with a complier/executor version of a Form Machine to perform those
   manipulations.

   This note proposes a different approach to the Form Machine.
   Specifically, we describe a syntax-driven interpreter that operates
   on a grammar which is an ordered set of replacement rules.  Following
   the interpreter description are some "real-world" examples of
   required data reconfigurations that must occur between RAND consoles
   and the Remote Job System on the UCLA 360/91.  Lastly, we suggest
   that the Protocol Manager mentioned in NWG/RFC #80 can be simplified
   by using the Form Machine and two system forms (specified a priori in
   the code).

   Caveat:  The Form Machine is not intended to be a general purpose
   programming language.  Note the absence of declaration statements,
   etc.

THE FORM MACHINE

I.  Forms

   A form is an ordered set of rules.

      F = {R1, ...,Rn}

   The first rule (R1) is the rule of highest priority; the last rule
   (Rn) is the rule of lowest priority.

   The form machine gets as input: 1) a list of addresses and lengths
   that delimit the input stream(s); 2) a list of addresses and lengths
   that delimit the output area(s); 3) a pointer to a list of form(s);
   4) a pointer to the starting position of the input stream; and 5) a
   pointer to the starting position of the output area.  The Form
   Machine applies a form to the input string emitting an output string
   in the output area.  The form is applied in the following manner:

Anderson, et. al.                                               [Page 1]
RFC 83                 Language Machine For Data        18 December 1970

      Step 1:  R1 is made the current rule.

      Step 2:  The current rule is applied to the input data.

      Step3:   a) If the rule fails, the rule of priority one lower is
                  made current.

               b) If the rule succeeds, the rule of highest priority is
                  made current

               c) When the rule of lowest priority fails, the form fails
                  and application of the form to the input data
                  terminates.

      Step 4:  Continue at Step 2.

   In addition, during Step 2, if the remainder of the input string is
   insufficient to satisfy a rule, then that rule fails and partial
   results are not emitted.  If a rule fills the output string,
   application of the form is terminated.

II.  Rules

   A rule is a replacement operation of the form:

      left-hand-side -> right-hand-side

   Both sides of a rule consists of a series of zero or more _terms_
   (see below) separated by commas.

   The left-hand-side of the rule is applied to the input string at the
   current position as a pattern-match operation.  If it exactly
   describes the input, 1) the current input position pointer is
   advanced over the matched input, 2) the right-hand-side emits data at
   the current position in the output string, and 3) the current output
   position pointer is advanced over the emitted data.

III.  Terms

   A term is a variable that describes the input string to be matched or
   the output string to be emitted.  A term has three formats.

Anderson, et. al.                                               [Page 2]
RFC 83                 Language Machine For Data        18 December 1970

Term Format 1
+---------------------------------------------------------------------+
|                                                                     |
|     name ( data  replication  .   value     :    length    )        |
|            type   expression    expression      expression          |
|                                                                     |
|_____________________________________________________________________|

   Any of the fields may be absent.

   The _name_ is a symbolic name of the term in the usual programming
   language sense.  It is a single, lower-case alphabetic that is unique
   within a rule.

   The _data type_ describes the kind of data that the term represents.
   It is a member of the set:

         {D, O, X, A, E, B}

      Data types have the following meanings and implied unit lengths:

      Char.       Meaning               Length
      -----       --------              -------
       D          decimal number        1 bit
       O          octal number          3 bits
       X          hexadecimal number    4 bits
       A          ASCII character       8 bits
       E          EBCDIC character      8 bits
Show full document text