📄 rfc138.txt
字号:
+--------+ +------+ /| USER | CC +--------+ +------+ | |/ | SIDE +------+ | SC | | | USER | +--------+ UC | DRS +------+ SP | | |\ | SERVING+------+ | | | +------+ \| SIDE | +--------+ +------+ +--------+ Figure 4. Use of Server TELNETAnderson, et al. [Page 6]RFC 138 Data Reconfiguration Service April 1971 In Fig. 3 the user instructs his TELNET to make two duplex connections to DRS. One is used for control information (the CC) and the other is a dummy. When he issues the CONNECT he references the dummy duplex connection (UC) using the "already connected" option. In Fig. 4 the user has his TELNET (user side) call the DRS. When he issues the CONNECT the DRS calls the TELNET (server side) which accepts the call on behalf of the console. This distinction is known only to the user since to the DRS the configuration in Fig. 4 appears identical to that in Fig. 1. Two points should be noted: 1) TELNET protocol is needed only to define forms and direct connections. It is not required for the using and serving processes. 2) The using and serving processes need only a minimum of modification for Network use, i.e., an NCP interface.III. THE FORM MACHINEINPUT/OUTPUT STREAMS AND FORMS This section describes the syntax and semantics of forms that specify the data reconfigurations. The Form Machine gets an input stream, reformats the input stream according to a form describing the reconfiguration, and emits the reformatted data as an output stream. In reading this section it will be helpful to envision the application of a form to the data stream as depicted in Fig. 5. An input stream pointer identifies the position of data (in the input stream) that is being analyzed at any given time by a part of the form. Likewise, an output stream pointer locates data being emitted in the output stream. /\/\ /\/\ ^ | | FORM | | ^ | | | ----------------- | | | | | | +- ----------------- -+ | | | | | | | CURRENT PART OF | | | |INPUT | |<= CURRENT < ----------------- > CURRENT => | | OUTPUTSTREAM | | POINTER | FORM BEING APPLIED | POINTER | | STREAM | | +- ----------------- -+ | | | | ----------------- | | | | ----------------- | | | | ----------------- | | \/\/ \/\/ Figure 5. Application of Form to Data StreamsAnderson, et al. [Page 7]RFC 138 Data Reconfiguration Service April 1971FORM MACHINE BNF SYNTAX form ::= rule | rule form rule ;;= label inputstream outputstream ; label ::= INTEGER | <null> inputstream ::= terms | <null> terms ::= term | terms , term outputstream ::= : terms | <null> term ::= identifier | identifier descriptor | descriptor | comparator identifier ::= an alpha character followed by 0 to 3 alphamerics descriptor ::= (replicationexpression , datatype , valueexpression , lengthexpression control) comparator ::= (value connective value control) | (identifier .<=>. control) replicationexpression ::= arithmeticexpression | <null> datatype ::= B | O | X | E | A valueexpression ::= value | <null> lengthexpression ::= # | arithmeticexpression | <null> connective ::= .LE. | .LT. | .GE. | .GT. | .EQ. | .NE. value ::= literal | arithmeticexpression arithmeticexpression ::= primary | primary operator arithmeticexpression primary ::= identifier | L(identifier) | V(identifier) | INTEGER operator ::= + | - | * | / literal ::= literaltype "string"Anderson, et al. [Page 8]RFC 138 Data Reconfiguration Service April 1971 literaltype ::= B | O | X | E | A string ::= from 0 to 256 characters control ::= : options | <null> options ::= S(where) | F(where) | U(where) | S(where) , F(where) | F(where) , S(where) where ::= arithmeticexpression | R(arithmeticexpression)ALTERNATE SPECIFICATION OF FORM MACHINE SYNTAX infinityform ::= {rule} 1 1 1 1rule ::= {INTEGER} {terms} {:terms} ; 0 0 0 infinityterms ::= term {,term} 0 1term ::= identifier | {identifier} descriptor 0 | comparator 1descriptor ::= ({arithmeticexpression} , datatype , 0 1 1 1 {value} , {lengthexpression} {:options} 0 0 0 1comparator ::= (value connective value {:options} ) | 0 1 (identifier .<=. value {:options} ) 0connective ::= .LE. | .LT. | .GE. | .GT. | .EQ. | .NE.lengthexpression ::= # | arithmeticexpressiondatatype ::= B | O | X | E | Avalue ::= literal | arithmeticexpressionAnderson, et al. [Page 9]RFC 138 Data Reconfiguration Service April 1971 infinityarithmeticexpression ::= primary {operator primary} 0operator ::= + | - | * | /primary ::= identifier | L(identifier) | V(identifier) | INTEGER 256literal ::= literaltype "{CHARACTER} " 0literaltype ::= B | O | X | A | E 1options ::= S(where) {,F(where)} | 0 1 F(where) {,S(where)} | U(where) 0where ::= arithmeticexpression | R(arithmeticexpression) 3identifier ::= ALPHABETIC {ALPHAMERIC} 0FORMS A form is an ordered set of rules. form ::= rule | rule form The current rule is applied to the current position of the input stream. If the (input stream part of a) rule fails to correctly describe the contents of the current input then another rule is made current and applied to the current position of the input stream. The next rule to be made current is either explicitly specified by the current term in the current rule or it is the next sequential rule by default. Flow of control is more fully described under TERM AND RULE SEQUENCING. If the (input stream part of a) rule succeeds in correctly describing the current input stream, then some data may be emitted at the current position in the output stream according to the rule. The input and output stream pointers are advanced over the described and emitted data, respectively, and the next rule is applied to the now current position of the input stream. Application of the form is terminated when an explicit return (R(arithmeticexpression)) is encountered in a rule. The user andAnderson, et al. [Page 10]RFC 138 Data Reconfiguration Service April 1971 server connections are closed and the return code (arithmeticexpression) is sent to the originating user.RULES A rule is a replacement, comparison, and/or an assignment operation of the form shown below. rule ::= label inputstream outputstream ; A label is the name of a rule and it exists so that the rule may be referenced elsewhere in the form for explicit rule transfer of control. Labels are of the form below. label ::= INTEGER | <null> The optional integer labels are in the range 0 >= INTEGER >= 9999. The rules need not be labeled in ascending numerical order.TERMS The inputstream (describing the input stream to be matched) and the outputstream (describing data to be emitted in the output stream) consist of zero or more terms and are of the form shown below. inputstream ::= terms | <null> outputstream ::= :terms | <null> terms ::= term | terms , term Terms are of one of four formats as indicated below. term ::= identifier | identifier descriptor | descriptor | comparatorTerm Format 1 The first term format is shown below. identifier The identifier is a symbolic reference to a previously identified term (term format 2) in the form. It takes on the same attributes (value, length, type) as the term by that name. Term format 1 is normally used to emit data in the output stream. Identifiers are formed by an alpha character followed by 0 to 3 alphameric characters.Anderson, et al. [Page 11]RFC 138 Data Reconfiguration Service April 1971Term Format 2 The second term format is shown below. identifier descriptor Term format 2 is generally used as an input stream term but can be used as an output stream term. A descriptor is defined as shown below. descriptor ::= (replicationexpression, datatype, valueexpression, lengthexpression control) The identifier is the symbolic name of the term in the usual programming language sense. It takes on the type, length, and value attributes of the term and it may be referenced elsewhere in the form. The replication expression is defined below. replicationexpression ::= arithmeticexpression | <null> arithmeticexpression ::= primary | primary operator
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -