home *** CD-ROM | disk | FTP | other *** search
/ Programmer's ROM - The Computer Language Library / programmersrom.iso / ada / message / gmhfuser.doc < prev    next >
Encoding:
Text File  |  1988-05-03  |  86.0 KB  |  1,938 lines

  1. ,print 106
  2. type 86 86 86 86 
  3. ,end
  4.  
  5.                                                        73502-85U/P7046
  6.                                                         15 April 1985
  7.                                              Revised:    3 May   1985
  8.   
  9.  
  10.  
  11.                      Generic Message Handling Facility
  12.  
  13.                              Users Manual
  14.  
  15.  
  16. 1.0 Introduction.
  17.  
  18.     This Users Manual has been developed for users and implementors
  19. of the Generic Message Handling Facility (GMHF). Users are those who
  20. avail themselves of the software to store, retrieve, edit, and print
  21. messages of types for which editors have been instantiated. Implementors
  22. are those who instantiate editors for new message standards. This manual
  23. is intended to provide the information needed to both use the existing
  24. editors and instantiate new editors. Points of contact for additional
  25. information or constructive criticism are:
  26.  
  27.       Tom Vollman or Don McDougall
  28.  
  29.           Veda Incorporated
  30.           2 Three Notch Rd
  31.           Lexington Park, MD 20636
  32.           (301)862-2108
  33.  
  34.           ARPANET => CONTR12 @NOSC-TECR
  35.  
  36. 1.1 Background.
  37.  
  38.     Veda first developed an automated message editing system for 
  39. messages of the RAINFORM standard message format in the BASIC language
  40. in 1980. Subsequently, enhanced versions have been developed in FORTRAN.
  41. Why develop a version in Ada? Doesn't the world have enough message
  42. editors without building one more? In fact, the primary goal of this
  43. effort has not been simply the delivery of one more message editor,
  44. although we hasten to add that we feel a good one has been delivered.
  45. The Ada programming language has powerful facilities for defining
  46. structured data types, and validating elements to be of said types.
  47. In addition, Ada has a powerful generic facility that supports code
  48. reuseability and streamlines the software development process. At the
  49. same time, the military has a number of highly structured message
  50. formats (standards) and is in the process of developing more. Every
  51. command and control (C2) system which is fielded typically requires
  52. one or more editors for such message types. Therefore, research into
  53. how Ada's advanced features can most effectively be applied to message
  54. editors is of more than academic interest. In fact, such research can,
  55. and almost certainly will provide substantial long term cost savings
  56. to the government in terms of reduced software costs for C2 and other
  57. message handling systems. This effort has been one of the initial
  58. research efforts in this area.
  59.  
  60. 1.2 Overview of GMHF Capabilities.
  61.  
  62.     It is important to keep in mind that GMHF has two features: the
  63. capability of editing messages, and the capability of creating editors
  64. for new types of messages. In this paragraph, we provide a brief
  65. overview of GMHF's capabilities in each area. Full details are provided
  66. in the GMHF Functional Description (FD), Veda Rpt no chrono-84U/P7046.
  67. The FD is available on ARPANET, stored in WIS.VEDA.DOCUMENTS. It is
  68. important to note that the FD is an essential part of the user
  69. documentation of GMHF, and as specified in the contract, the information
  70. contained therein is not repeated here. Therefore, a GMHF user should
  71. read the FD prior to using the system.
  72.  
  73. 1.2.1 Message Editing/Handling Capabilities.
  74.  
  75.     GMHF allows a user to store messages, retrieve them, edit them and
  76. obtain hardcopies. The user may utilize all these facilities via a
  77. standalone system. Alternatively, the user may opt to use the editing
  78. functions alone, accessing them directly from his/her own message
  79. storage system.
  80.  
  81.     Once within the editor, standard editing features are implemented:
  82.  
  83.           Next Line
  84.           Previous Line
  85.           Insert Line
  86.           Delete Line
  87.           Edit Line
  88.           Next Field
  89.           Previous Field
  90.           Erase Field
  91.           Classify Message
  92.           End Edit.
  93.  
  94.     These functions are implemented within the context of a three part
  95. CRT display. The top third of the screen displays the current portion of
  96. the message being edited, with the current line highlighted. The center
  97. portion of the screen holds the line being edited and a prompt as to the
  98. required contents of the current field being edited. The bottom portion
  99. of the screen is reserved for amplification of field prompts. It allows
  100. complicated fields, or fields with a wide range of entry choices to be
  101. fully described.
  102.  
  103.     As the user enters or modifies the contents of each field in a line,
  104. those contents are validated. If invalid entries are made, the user is
  105. notified and asked to re-enter valid data. In the case of complex
  106. fields, portions of a field may be individually validated. In this way,
  107. the user knows that when the message is complete, it is also correct
  108. (at least within the bounds defined by the specific implementation).
  109.  
  110.  
  111. 1.2.1 Generic Instantiation Capabilities.
  112.  
  113.     In instantiating the system for a new message type, or in
  114. implementing it on a new host, the implementor has a great deal of
  115. flexibility. The implementor may specify CRT parameters and how he/she
  116. would like the screen partitioned. Complete message structures,
  117. including:
  118.  
  119.           line types and parameters,
  120.           field types and prompts,
  121.           line entry validation,
  122.           display/transmission format.
  123.  
  124. In fact, the implementor may reuse portions of the code so as to have
  125. editors for the same message type which have varying degrees of
  126. validation and fault tolerance.
  127.  
  128.  
  129. 1.3 Security Issues.
  130.  
  131.     Some elements of some government message standards are classified.
  132. In fact, the full implementation of the RAINFORM editor is classified
  133. confidential. Veda has been careful to ensure that none of the
  134. procedures or packages which comprise the general part of the GMHF are
  135. classified. For demonstration purposes, Veda has provided a partial
  136. implementation of the RAINFORM instance which is unclassified and may
  137. be made available to anyone on any computer system, regardless of
  138. classification.
  139.  
  140.     Generally speaking, GMHF is structured in such a way that to
  141. implement a classified message standard, only the data definition and io
  142. packages need be classified. In some cases, the implementor might also
  143. embed classified processing in PACK_LINE, UNPACK_LINE, PARSE_LINE_TYPE,
  144. and/or VALIDATE_LINE_INSERTION (see paragraph 3.3, below). The versions
  145. of those procedures in the RAINFORM instances are unclassified.
  146.  
  147.  
  148. 2.0 How to Use GMHF.
  149.  
  150.     In this section, the details of how to use GMHF are provided. Much
  151. information is contained in the FD, and that information should be read
  152. prior to reading this manual. In particular, the FD describes the
  153. various menus and how the user interfaces with them. This is covered
  154. only briefly here.
  155.  
  156.  
  157. 2.1 Accessing the System in its Standalone Mode.
  158.    
  159.     When accessing the system as a standalone, the user is required to
  160. work with the menu driven man machine interface described in the FD.
  161. In the standalone mode the user is offered a finite number of functions,
  162. which he may access by activating one image,GMHF_DRIVER. This parameter-
  163. less procedure will in turn activate the man machine interface menus
  164. and the user may perform any of the available functions as desired. It
  165. is important to note that while in standalone mode, the system will
  166. only access messages within the internal database.
  167.  
  168.     To activate the system in standalone mode the user must enter:
  169. TEXE GMHF_DRIVER. Where TEXE is the exec for TeleSoft Ada version 2.1.
  170.  
  171.  
  172. 2.2 External Access to GMHF
  173.     There are two basic access methods for the external user. One method
  174. provides direct access to the editors by an external user while the 
  175. other method provides external access to GMHF's internal database. These
  176. two methods are discussed seperately in the following two sections.
  177.  
  178. 2.2.1 Using the Editors from an External Viewpoint.
  179.     When it is desired to use the instantiated editors in some fashion
  180. other than standalone mode, apart from the actual editors, the user is
  181. not provided any man machine interface support. He is instead provided 
  182. a set of tools and a set of instructions of which to follow. The set of
  183. tools and instructions are:  
  184.  
  185.   1) Any user modules which require access to the editors must contain
  186.      "with LINKED_LIST_PROCEDURES;" 
  187.      "with ACCESS_FOR_EXTERNAL_USERS;"
  188.      "with instantiated_editor;" -- this is the package where the editor
  189.                                  -- has been instantiated
  190.      These packages contain the definitions of several data elements
  191.      and subprograms which are required for the interface.
  192.  
  193.   2) The user is responsible for loading the message into the EXTERNAL_
  194.      MESSAGE format as defined in EXTERNAL_INTERFACE. That format is:
  195.      type EXTERNAL_MESSAGE is array(POSITIVE range <>) of LINE_OF_TEXT.
  196.      Where LINE_OF_TEXT is defined as a string length 80.
  197.  
  198.   3) The user is responsible for calling the routine which reformats the
  199.      message into a linked list for editing. The routine is in the 
  200.      EXTERNAL_INTERFACE package and is called 'LOAD_EXTERNAL_MESSAGE_
  201.      INTO_LINKED_LIST'.
  202.  
  203.   4) The user is responsible for activating the editor by calling
  204.      EDITOR from the appropriate package for the message type. 
  205.      i.e. RAINFORM.EDITOR, UNITREP.EDITOR .
  206.  
  207.   5) The user is responsible for calling the routine which reformats the
  208.      message back into the EXTERNAL_MESSAGE type. The routine is in the
  209.      EXTERNAL_INTERFACE package and is called 'RETRIEVE_MESSAGE_FROM_
  210.      LINKED_LIST'.
  211.  
  212.  
  213.   Sample:
  214.  
  215. with LINKED_LIST_PROCEDURES;  use LINKED_LIST_PROCEDURES;
  216. with EXTERNAL_INTERFACE;      use EXTERNAL_INTERFACE;
  217. with RAINFORM_EDITOR;         use RAINFORM_EDITOR;
  218. --
  219. procedure EDIT_MY_MESSAGE is
  220.    CLASSIFICATION   : STRING(1..12);
  221.    MY_MESSAGE       : EXTERNAL_MESSAGE;
  222.    EDITABLE_MESSAGE : MESSAGE;
  223. begin
  224.     .
  225.     .
  226.     . user written to load message into external_message type
  227.     .
  228.     .
  229.    --
  230.    LOAD_EXTERNAL_MESSAGE_INTO_WORKSPACE(CLASSIFICATION, MY_MESSAGE,
  231.                                         EDITABLE_MESSAGE);
  232.    --
  233.    RAINFORM.EDITOR(EDITABLE_MESSAGE);
  234.    --
  235.    RETRIEVE_MESSAGE_FROM_WORKSPACE(CLASSIFICATION, MY_MESSAGE,
  236.                                    EDITABLE_MESSAGE);
  237.    --
  238.     .
  239.     .
  240.     . user written to do with the message what he wants
  241.     .
  242.     .
  243. end EDIT_MY_MESSAGE;
  244.  
  245.  
  246. 2.2.2 External Access to GMHF's Internal Database
  247.     It may be desired to add messages from some external source into
  248. GMHF's internal database or to extract messages from GMHF's internal
  249. database for us by some external source. The user is provided a set
  250. of tools and instructions to support such access to the database.
  251. The set of tools and instructions are:  
  252.  
  253.   1) Any user modules which require access to the database must contain
  254.      "with ACCESS_FOR_EXTERNAL_USERS;"
  255.      These packages contain the definitions of several data elements
  256.      and subprograms which are required for the interface.
  257.  
  258.   2) The user is responsible for loading the message into the EXTERNAL_
  259.      MESSAGE format as defined in ACCESS_FOR_EXTERNAL_USERS. 
  260.      That format is:
  261.       type EXTERNAL_MESSAGE is array(POSITIVE range <>) of LINE_OF_TEXT;
  262.       Where LINE_OF_TEXT is defined as a string length 80.
  263.  
  264.   3) The user is responsible for calling the routines which load and 
  265.      retrieve messages from GMHF's database. There are two routines 
  266.      which perform these functions and they are located in the 
  267.      ACCESS_FOR_EXTERNAL_USERS package. The routines are 
  268.      LOAD_EXTERNAL_MESSAGE_INTO_DATABASE and
  269.      RETRIEVE_MESSAGE_FROM_DATABASE.
  270.  
  271.  
  272.   Sample:
  273.  
  274. with ACCESS_FOR_EXTERNAL_USERS;  use ACCESS_FOR_EXTERNAL_USERS;
  275. --
  276. procedure USE_MY_MESSAGE is
  277.    --
  278.    CLASSIFICATION   : STRING(1..12);
  279.    MESSAGE_TYPE     : STRING(1..10);
  280.    MY_MESSAGE       : EXTERNAL_MESSAGE;
  281.    --
  282. begin
  283.     .
  284.     .
  285.     . user written to load message into external_message type
  286.     .
  287.     .
  288.    --
  289.    if YOU_WANT_TO_LOAD_MESSAGE_IN then
  290.       --
  291.       LOAD_EXTERNAL_MESSAGE_INTO_DATABASE(CLASSIFICATION, MESSAGE_TYPE,
  292.                                           MY_MESSAGE);
  293.       --
  294.       -- in this example all parameters are sent in 
  295.       --
  296.    elsif YOU_WANT_TO_GET_MESSAGE_OUT then
  297.       --
  298.       RETRIEVE_MESSAGE_FROM_DATABASE(CLASSIFICATION, MESSAGE_TYPE,
  299.                                      MESSAGE_NUMBER, MY_MESSAGE);
  300.       --
  301.       -- in this example  message_type and message_number are sent in
  302.       -- classification and my_message are passed out
  303.       --
  304.    end if;
  305.     .
  306.     .
  307.     . user written to do with the message what he wants
  308.     .
  309.     .
  310. end USE_MY_MESSAGE;
  311.  
  312.  
  313. 2.3 Editing a Message.
  314.  
  315.     As described in the FD and in the sections above, once a user has
  316. entered an editor, there are two modes in which it may be operated,
  317. scroll mode and edit mode. We shall discuss these modes separately.
  318. Upon entering the editor, the message and its classification are
  319. displayed, and the first line is displayed in reverse video (backlit).
  320. The backlit line denotes the 'current line'. The user is then placed
  321. in scroll mode, and the system awaits the user's input.
  322.  
  323.     The command key assignments for a VT 100 are given below. All
  324. command keys are implemented for a VT 100 on the numeric keypad. The
  325. user must enter numeric data from the standard numeric keys rather
  326. than the keypad.
  327.  
  328.  
  329.                   -------------------------
  330.                   |PF1  |PF2  |PF3  |PF4  |
  331.                   | end |erase| next| prev|
  332.                   | edit| fld |  fld|  fld|
  333.                   -------------------------
  334.                   |7    |8    |9    |-    |
  335.                   | edit|     | next| prev|
  336.                   | line|     | line| line|
  337.                   -------------------------
  338.                   |4    |5    |6    |,    |
  339.                   |clsfy|     |insrt|delet|
  340.                   | msg |     | line| line|
  341.                   -------------------------
  342.                   |1    |2    |3    |enter|
  343.                   |     |     |     |     |
  344.                   |     |     |     |     |
  345.                   -------------------     |
  346.                   |0          |.    |     |
  347.                   |    tab    | back|comm-|
  348.                   |           |  tab| and |
  349.                   -------------------------
  350.  
  351.  
  352. 2.3.1 Scroll Mode.
  353.  
  354.     When in scroll mode, the user may scroll through the lines in the
  355. message being edited. The only legal user inputs are the commands:
  356.  
  357.           * classify message
  358.  
  359.           * next line
  360.  
  361.           * prev line
  362.  
  363.           * insert line
  364.  
  365.           * delete line
  366.  
  367.           * edit line.
  368.  
  369.           * end edit
  370.  
  371. Any other user input will be discarded, and the user will be prompted
  372. that an invalid input has been entered.
  373.  
  374. 2.3.1.1 Classify Message.
  375.  
  376.     When the user activates the Classify Message command, the
  377. classification prompt is displayed and the user is asked to enter
  378. either 'UNCLASSIFIED', 'CONFIDENTIAL', 'SECRET', or 'TOP SECRET'.
  379. Upon the user's entry of one of those classifications, the 
  380. classification entered is displayed in the upper left and lower right
  381. hand corners of the crt. It is also stored as the classification for
  382. the current message.
  383.  
  384. 2.3.1.2 Next Line.
  385.  
  386.     When the user activates the Next Line command, one of two things
  387. happens. If the user is not currently at the last line of the message,
  388. the next line becomes the current line. That is, the line which was the
  389. current line is displayed unbacklit, and the next line is displayed
  390. backlit.
  391.  
  392.     If the user is currently on the last line of the message when Next
  393. Line is activated, the prompt which offers the user a choice of line
  394. types is displayed. The user then chooses a line type (much like he
  395. chose a classification) and a model (prototype) line of that type is
  396. displayed as the new current line at the bottom of the message. If the
  397. line has any fields, the editor is placed in edit mode, the prototype
  398. line is displayed in the work area, the first field prompt is displayed
  399. and user input is awaited. Thus one way to get to edit mode is to add a
  400. line to the end of a message. The editor assumes that, if possible, the
  401. user will want to edit it, and behaves accordingly.
  402.  
  403.     The exceptional case is when the user attempts to add a line to the
  404. bottom of a message which is already at maximum length. The user is
  405. prompted that the message is at maximum length and asked to enter some
  406. other command.
  407.  
  408. 2.3.1.3 Previous Line.
  409.  
  410.     When the Previous Line command is activated, the previous line
  411. becomes the current line unless the current line was the first line of
  412. the message. In that case, the user is prompted.
  413.  
  414. 2.3.1.4 Insert Line.
  415.  
  416.     The user may activate the insert line command to insert a line
  417. directly above the current line. If the number of lines in the message
  418. being edited is already at maximum, the user is prompted. If not, the
  419. editor proceeds exactly as if the user had activated the Next Line
  420. command at the bottom of the message. That is, the user is asked to
  421. specify which type of line is to be added, and if that line type is
  422. editable, the edit mode is entered.
  423.  
  424. 2.3.1.5 Delete Line.
  425.  
  426.     When the user activates the Delete Line command, the current line
  427. is deleted, and the message 'repacked'. If there is only one line in the
  428. message, the user is prompted that the last line in a message may not be
  429. deleted. An entire message may be deleted from outside the editor.
  430.  
  431. 2.3.1.6 Edit Line.
  432.  
  433.     When the user activates the Edit Line command, the current line is
  434. moved to the work area and the edit mode is entered. The exceptional
  435. case is when the current line has no fields; that is, it is not
  436. editable. In that case, the user is prompted that a line with no
  437. fields cannot be edited.
  438.  
  439. 2.3.1.7 End Edit.
  440.  
  441.     When the user activates the End Edit command, the editor is exited
  442. and control is transferred to the calling procedure. If the user called
  443. the editor from the System Driver package (using GMHF in its stand alone
  444. mode) he is presented with a menu which allows him to dispose of the
  445. edited message as he sees fit. If the user accessed the editor directly,
  446. it is the responsibility of the accessing routine to deal with the
  447. edited message.
  448.  
  449.  
  450. 2.3.2 Edit Mode.
  451.  
  452.     The main purpose of the scroll mode is to allow the user
  453. to rapidly move through the message to position himself to the line
  454. which he wishes to edit. The purpose of the edit mode is to support
  455. the actual editing of a line. The following are the commands available
  456. to the user while in edit mode:
  457.  
  458.           * next field
  459.  
  460.           * previous field
  461.  
  462.           * erase field
  463.  
  464.           * classify message
  465.  
  466.           * next line
  467.  
  468.           * previous line
  469.  
  470.           * end edit
  471.  
  472.     When the user is in edit mode, he has the opportunity to modify
  473. the contents of the line being edited. However, this can only be done
  474. within the constraints placed upon the message type. For example, if
  475. the implementor has defined a field whose contents must be an integer
  476. between 7 and 32, then the user is not allowed to enter anything else
  477. in such a field.
  478.  
  479.     The editor accepts user input on a field at a time basis. That is,
  480. when the user has entered the (maximum) number of characters in the
  481. current field, the editor accepts them, validates them, and either
  482. prompts the user that the entry was invalid, or moves on to the next
  483. field. It is important to realize that NO CARRIAGE RETURN or ENTER
  484. is necessary. The editor will automatically act when the user has
  485. completed a field by filling it. In many cases, fields are of variable
  486. length, and a user's entry will be fewer characters than the maximum
  487. allowed. In such a case, when the user has completed his desired entry
  488. he may enter any valid command key. The editor accepts the characters
  489. entered, validates them, and then handles the command.
  490.  
  491.     The user is assisted by implementor defined prompts for each field.
  492. The editor underlines the field being edited, and displays the prompt
  493. for that field. A field prompt may be a two part entity. A one line
  494. prompt is displayed under the underlined field. Any desired amplifying
  495. information is displayed in the bottom portion of the crt (amp area).
  496.  
  497. 2.3.2.1 Next Field.
  498.  
  499.     When the Next Field command is activated, the field prompt for the
  500. current field is erased, and the prompt for the next field is displayed.
  501. The cursor is positioned at the beginning of the enterable portion of
  502. the field, and user input is awaited. If the current field is the last
  503. field of the line and Next Field is activated, the editor cycles around
  504. to the first field of the line.
  505.  
  506. 2.3.2.2 Previous Field.
  507.  
  508.     The Previous Field command is analygous to the Next Field command.
  509.  
  510. 2.3.2.3 Erase Field.
  511.  
  512.     The Erase Field command causes the current contents of the field
  513. being edited to be replaced with the contents of an empty field of
  514. that type.
  515.  
  516. 2.3.2.4 Classify Message.
  517.  
  518.     The Classify Message command performs exactly the same function here
  519. as it does in the scroll mode. The only difference is that when the user
  520. has completed classifying the message, the field following the (old)
  521. current field becomes current, is prompted, and may be edited. If the
  522. user was in the middle of a field when the Classify Message key was
  523. struck, the contents of that field are validated prior to activating
  524. the Classify Message command.
  525.  
  526. 2.3.2.5 Next Line.
  527.  
  528.     The Next Line command performs the same here as it does when
  529. activated in scroll mode. The only difference is that prior to
  530. activating the command, the contents of the current line being edited
  531. are validated and saved.
  532.  
  533. 2.3.2.6 Previous Line.
  534.  
  535.     The Previous Line command performs the same here as it does when
  536. activated in scroll mode. The only difference is that prior to
  537. activating the command, the contents of the current line being edited
  538. are validated and saved.
  539.  
  540. 2.3.2.7 End Edit.
  541.  
  542.     The End Edit command performs the same here as it does when
  543. activated in scroll mode. The only difference is that prior to
  544. activating the command, the contents of the current line being edited
  545. are validated and saved.
  546.  
  547.  
  548.  
  549. 3.0 How to Implement New Message Types.
  550.  
  551.     This section describes the steps which must be taken in order to
  552. use the generic definition to implement a message editor for a new
  553. message type. This section can best be read in conjunction with the
  554. Appendices. In addition, a reader should probably browse through the
  555. formal part of the generic definition.
  556.  
  557.     In order to implement a new message type through generic
  558. instantiation, the implementor must complete four steps. Those steps
  559. are described in this section in a logical order of execution. The
  560. first three steps involve preparing the required entities for the
  561. statement which causes the instantiation; the fourth step consists of
  562. those activities required to get the message handling system recompiled
  563. with the new message type integrated into the structure. Should an
  564. implementor desire to implement this system on a terminal which is not
  565. a VT-100 or a VT-100 emulator, a fifth step is required. Finally, this
  566. implementation uses a procedure MAN_MACHINE_INTERFACE.READ_NOECHO which
  567. is based upon a VMS kapse package HOST_LCD_IF. If the system is to be
  568. implemented in another Ada environment, the availability of an
  569. equivalent to HOST_LCD_IF will have to be examined. It is important
  570. to note, that there is no hard requirement for reading without echoing
  571. the terminal input back to the screen. However, it sweetens the user
  572. interface by allowing the use of CTL and ESC sequences for commands
  573. without requiring screen echoes to be erased.
  574.  
  575. 3.1 Line Structure Definition.
  576.  
  577.     To accomplish this first step, there are several tasks which must
  578. be completed. These tasks involve specifying three numeric parameters
  579. of the line structure, giving names to line types and field types, and
  580. defining the details of the line structure in a file. A utility program
  581. is available which creates the file in the required format. An
  582. alternative method for defining the line structures is discussed in
  583. Appendix D. In the alternative method, the line structure is not defined
  584. in a file but is compiled as a constant. This method uses a different
  585. generic definition. The difference is transparent to a user.
  586.  
  587.     The first task is to create those entities which describe the
  588. structure of each of the formatted lines being implemented. This is
  589. done by identifying:
  590.  
  591.          a. The maximum number of fields that occur in any type of line
  592.             being implemented. If some lines have no (changeable) fields
  593.             while others have 1 or 2 or even 27 fields, then the maximum
  594.             number of fields is the number of fields contained in the
  595.             line which has the most fields.
  596.  
  597.          b. Similarly, the maximum number of characters which may occur
  598.             in the longest line must be identified.
  599.  
  600.          c. Finally, the maximum number of lines which may be contained
  601.             in a single message must be specified.
  602.  
  603. These numbers are passed as actual parameters during generic
  604. instantiation. 
  605.  
  606.     The next task in this first step is to provide the generic with a
  607. set of names for the various lines. This is accomplished through an
  608. enumerated type, which is passed to the generic as an actual parameter.
  609. Each line must be represented by a unique item of the enumerated type.
  610. While the names given lines need have no relation to the content
  611. normally associated with a line of that type, one should attempt to
  612. enhance code understandability by using names which relate to content
  613. wherever possible.
  614.  
  615.     The next task is to specify names for each type of field associated
  616. with the message standard. This is done exactly as were the line names.
  617. It is important to note that the same field may be used in many
  618. different lines. Furthermore, it may be used in the same line more than
  619. once. Thus a field is a structural entity in its own right, and by 
  620. defining the structure of fields, we are defining a set of building
  621. blocks  which are used to make up lines. Details on the specification
  622. of line names, field names and field I/O are given in Appendix A.
  623.  
  624.     The final task in this step is to create files which will contain
  625. the structure of each line and the prompts for each line. The
  626. implementor accomplishes this by first creating editable files using
  627. some text editor - we use EDT on the VAX. The format for those files and
  628. detailed instructions on how to build them are given in Appendix B. Upon
  629. completing the creation of the editable files, utilities (see Appendix
  630. B) are run which create the files in formats readable by other GMHF
  631. procedures. As part of the process of creating the editable file and
  632. running the utilities, the user will be asked to specify a name for the
  633. output files which are created by the utilities. These filenames are
  634. passed as actual parameters when instantiating the generic.
  635.  
  636. 3.2 Field I/O.
  637.  
  638.     The unit of information entered by a GMHF user is a field, or in
  639. some cases a component. The most difficult task for an implementor is
  640. the specification of field io. There are two requirements. First, the
  641. user must develop a procedure to be passed as an actual parameter
  642. which matches the formal parameter GET_FIELD. Depending upon the number
  643. and complexity of the fields used in the particular message type being
  644. implemented, this may be a significant task. The task is made simpler
  645. by the various predefined io packages listed in Chapter 14 of the Ada
  646. LRM. The second task is development of a set of field prompts for
  647. display during an editing session. The second task is optional to the
  648. extent that a single standard prompt could be used; that approach
  649. would not take full advantage of the editor's capabilities.
  650.  
  651.     First, the user must develop a GET FIELD routine. This routine has
  652. six parameters:
  653.  
  654.           field_type : in field_name - a variable stating the name of 
  655.                                        the type of field being edited.
  656.  
  657.           field_gotten : in out string - a string containing the current
  658.                                          contents of the field - both
  659.                                          before and after the call to
  660.                                          GET_FIELD.
  661.  
  662.           field_position : in positive - the column number of the first
  663.                                          character of the field on the
  664.                                          screen during editing.
  665.  
  666.           field_length : in positive - the maximum number of characters
  667.                                        possible in a field of this type.
  668.  
  669.           command_gotten : out command - a variable to return any user
  670.                                          entered command to the editor.
  671.  
  672.           command_flag : out boolean - a flag to tell the editor whether
  673.                                        the user entered a command.
  674.  
  675. The first parameter is passed to GET_FIELD so that GET_FIELD will know
  676. what kind of field is to be input. The existing contents of the field
  677. are passed in field_gotten. Whatever the user inputs will modify the
  678. contents of field_gotten which is then returned to the editor. The third
  679. and fourth parameters will (probably) be required by GET_FIELD for
  680. cursor positioning and dimensioning of arrays. The final two fields are
  681. "passed through" GET_FIELD from the READ routine to the editor.
  682.  
  683.     While the implementor may develop any kind of GET_FIELD routine he
  684. or she chooses, Veda has developed a number of procedures which may be
  685. used by GET_FIELD, and which are in fact used by other portions of the
  686. system. A detailed set of implementation recommendations for GET_FIELD
  687. is given in Appendix A; the general structure is discussed here.
  688. GET_FIELD is called by the PROCESS_EDIT_LINE_COMMAND procedure. It
  689. (as we see it) should call the procedure MMIP.READ; READ gets a string
  690. entered by the user. It watches for user entered commands, accepting
  691. them without echoing them to the screen. It returns the user entered
  692. (actually user modified) string, and any command entered. Thus GET_FIELD
  693. can use MMIP.READ to interface with the user and obtain the user's
  694. input. Thus GET_FIELD must only validate the user entered data. If the
  695. data entered were valid, GET_FIELD returns to the editor which processes
  696. the data and any command which might have been entered. If the data did
  697. not represent a valid entry for a field of the type being input, then
  698. GET_FIELD should (probably) prompt the user that the input was invalid,
  699. reset the cursor to the starting position of the field on the screen,
  700. and accept the user's next attempt at entering the data. These latter
  701. functions can be performed using the procedures
  702. MAN_MACHINE_INTERFACE.PROMPT and TERMINAL_DEFINITION.GOTO_CRT_POSITION.
  703.  
  704.     Thus, generally speaking, GET_FIELD may be implemented as a case
  705. statement based upon field type. In each case it either calls MMIP.READ
  706. itself or calls a routine which then calls MMIP.READ. Upon return from
  707. READ, GET_FIELD validates the data and returns to the editor. The data
  708. validation can be performed by reading the data from the field_gotten
  709. string into a variable of the appropriate type and letting Ada raise an
  710. exception if the data are not valid. Again, the details of one
  711. approach to implementing GET_FIELD are given in Appendix A.
  712.  
  713.     The second task in this step is the definition of the field prompts.
  714. When the user is editing some field of a line, he/she may be prompted as
  715. to the desired/required contents of that field. Space is available on
  716. the screen for the display of such prompts. The user must create a file
  717. of field prompts, the name of which is input to the generic as an actual
  718. parameter. This is accomplished in a manner similar to the creation and
  719. naming of the line structure definition file discussed above. Details
  720. are provided in Appendix B.
  721.  
  722. 3.3 Line Handling Procedures.
  723.  
  724.     The third step in implementing GMHF for a new message type is the
  725. implementor's specification of how lines are to be handled. The generic
  726. definition allows the user to pass five procedures as actual parameters,
  727. only two of which are required. 
  728.  
  729.     The first two procedures are PACK_LINE and UNPACK_LINE; defaults
  730. are supplied which are, in essence, null procedures. These procedures
  731. allow the user to edit the line in one format, while storing it in
  732. another. If such flexibility is neither desired nor required, the
  733. defaults may be used. For example, some message standard formats 
  734. define their lines in a fixed format. UNITREP is an example of such
  735. a format. Certain fields always start in certain columns. Other
  736. message standards are more free in their format. One example of
  737. such freeness is the elimination of superfluous blanks from an empty
  738. field, or from a field whose length is variable. The editor allows
  739. the lines to be displayed in their expanded form for user input, but
  740. stored in a more condensed form. RAINFORM is an example of a message
  741. standard with some level of freeness.
  742.  
  743.     When a line is being taken from storage and moved into the workspace
  744. for the user to edit, UNPACK_LINE is called. When the user finishes
  745. editing the line, PACK_LINE is called prior to re-storing it. For
  746. example, if a user is editing line seven of a message with eight or more
  747. lines, and presses the NEXT LINE command key, PACK_LINE will be called
  748. and line seven will be packed and stored. Then line eight will be
  749. retrieved from storage, UNPACK_LINE will be called, and the unpacked
  750. form of line eight will be displayed in the work area for user edit.
  751. Thus the implementor has the option to determine what difference, if
  752. any, there is to be between the stored format of the line, and the
  753. format displayed for editing. Note that it is the packed format which
  754. is displayed in the message area (the top portion) of the screen during
  755. an edit session. In this way the user sees what is being stored. Note
  756. also that both the packed and unpacked versions of the lines are stored
  757. as character strings.
  758.  
  759.     The third procedure which a user may provide is 
  760. VALIDATE_LINE_INSERTION. This procedure is also defined with a 'null'
  761. default, and is thus optional for the implementor. It is called by the
  762. editor when the user has specified the type of a new line to be added to
  763. the message. The implementor can use this procedure to prompt the user
  764. regarding the validity of the line choice specified, or may take
  765. whatever stronger action is required.
  766.  
  767.     The fourth procedure is PARSE_LINE_TYPE and is required. When a
  768. user calls the editor, he/she must specify which message is to be
  769. edited. That message is then  read into the workspace from the external
  770. file by the editor. The file holds each line as a string of variable
  771. length, and reads it into a string of length MAXIMUM_CHARACTERS_PER_
  772. LINE. PARSE_LINE_TYPE is required to determine, based upon the string
  773. of characters which comprise the line, the line type of the line.
  774. PARSE_LINE_TYPE is passed a pointer (access variable) to the string,
  775. and must return a value of type LINE_NAME.
  776.  
  777.     The final procedure is GET_LINE_NAME and it is also required. When
  778. a user asks to insert a line, he must specify which line type he desires
  779. to add to the message. GET_LINE_NAME accepts the user's keyboard entry
  780. as input and validates that it is a legal entry.
  781.  
  782. 3.4 Instantiation and Recompilation.
  783.  
  784.     When the three steps discussed above have been completed, the
  785. implementor can heave a sigh of relief, because he or she is just
  786. about done. The final step is to put all the pieces together and
  787. recompile the system. This is done as follows.
  788.  
  789.     First, package TYPELIST is edited, and a name for the new message
  790. type being implemented is inserted in type AVAILABLE_TYPES. Then a 
  791. package must be created to instantiate the new editor and CALLEDIT.TXT 
  792. must be updated "WITH" the new package and to call the editor upon 
  793. request. In theory, all that information could be placed in one package;
  794. however, certain implementations of Ada place rather stringent
  795. requirements on the size of compilation units. Such restrictions may
  796. require the implementor to further segment components into artificial
  797. subcomponents. Finally, certain GMHF components must be recompiled. The
  798. order of recompilation is given below. A complete discussion of GMHF
  799. recompilation and interpackage dependencies is given in Appendix C.
  800.  
  801.           1. Compile package(s) containing line name and field name
  802.              definitions.
  803.  
  804.           2. Create line structure, field prompt, and prompt
  805.              look-up files.
  806.  
  807.           3. Compile package(s) containing GET_FIELD procedure and
  808.              any associated data types. (There may be several)
  809.  
  810.           4. Compile package(s) containing PACK_LINE, UNPACK_LINE,
  811.              VALIDATE_LINE_INSERTION, PARSE_LINE_TYPE, and
  812.              GET_LINE_TYPE.
  813.  
  814.           5. Recompile TYPELIST.
  815.  
  816.           6. Recompile FILE_ACCESS_PACKAGE (specification & body)
  817.  
  818.           7. Compile new package which instantiates generic 
  819.  
  820.           8. Recompile CALL_EDITOR (specification & body)
  821.  
  822.           9. Recompile PRINT_PACKAGE (specification & body)
  823.  
  824.          10. Recompile GENERAL_MENU_ROUTINES (specification & body)
  825.  
  826.          11. Recompile SYSTEM_DRIVER (specification & body)
  827.  
  828.          12. Recompile the driver procedure GMHF_DRIVER
  829.  
  830.  
  831. 3.5 Reimplementing for a CRT Which Is Not a VT-100 Emulator.
  832.  
  833.     All CRT dependencies are confined to the TERMINAL_DEFINITION
  834. package. These dependencies may be grouped into four general types:
  835. CRT physical size and layout parameters, assignment of user command
  836. keys, CRT related procedures, and menu display files.
  837.  
  838. 3.5.1 CRT Layout.
  839.  
  840.     The implementor may modify the number of rows and columns that
  841. define a particular CRT. Within those parameters, the implementor may
  842. modify the division of the screen into three horizontal slices. It is
  843. important to note that the message area should not start above line 3,
  844. and that the work area must be at least 4 rows deep.
  845.  
  846.     The implementor may change the locations where the message
  847. classification is displayed. In fact, if a specific application does
  848. not deal with messages which may be classified, the implementor may opt
  849. to 'null-out' the procedure CLASSIFICATION_DEFINITION.DISPLAY_
  850. CLASSIFICATION.
  851.  
  852. 3.5.2 User Command Keys.
  853.  
  854.     The present implementation uses escape (ESC) sequences to denote
  855. user commands. As can be seen in sections above, these are implemented
  856. via the numeric keypad on a VT-100 terminal. The same sequences may be
  857. used on virtually any ASCII terminal. However, if for any reason an
  858. implementor wishes to change the assignment of commands to keyset keys,
  859. the types FUNCTION_KEY, SYSTEM_DRIVER_KEYS, and EDIT_FUNCTION_KEYS may
  860. be edited. Furthermore, if the implementor would prefer to use another
  861. character than ESC for a lead-in character (e.g. CTL), the element
  862. START_OF_FUNCTION may have its initialization clause modified.
  863.  
  864. 3.5.3 CRT Procedures. 
  865.  
  866.     Those CRT related procedures used within the GMHF are listed in
  867. the specification of the TERMINAL_DEFINITION package. They should be
  868. easy to modify/emulate on virtually any modern CRT. 
  869.  
  870. 3.5.4 Menu Display Files.
  871.  
  872.     The seven menus used in GMHF are currently stored in the files
  873. EDITMENU.DSP, GMHF.DSP, GMHF1.DSP, GMHF12.DSP, GMHF2.DSP, GMHF3.DSP,
  874. and GMHF31.DSP. These files are intended for use on a VT100, as they
  875. use VT ESC sequences. They may require minor modification if the system
  876. is rehosted on another terminal. The only changes required are for
  877. positioning the cursor and turning on and off the underline attribute.
  878. The latter is not required, but is makes the displays look nicer.
  879.  
  880.  
  881. 4.0 Current GMHF Status.
  882.  
  883. 4.1 Functional Problems (Bugs).
  884.  
  885.     There are no known bugs in GMHF at this time (version 1.0).
  886.  
  887. 4.2 Implementation Compromises (Kludges).
  888.  
  889.     The problems encountered to date which have impacted GMHF system
  890. development and structure include:
  891.  
  892.        * limitation of executable blocks to 32768 bytes
  893.  
  894.        * problems with nested generics
  895.  
  896.        * failure to support incomplete type definitions within generics
  897.  
  898.        * failure to support separate compilation of subunits of generics
  899.  
  900.     These problems have forced the GMHF to be structured in a manner
  901. which is somewhat less than optimal. In particular, the first problem
  902. mentioned above has caused what should be one routine, GET_FIELD to be
  903. broken into several, as discussed in Appendix A, below. Also, the
  904. package GENERIC_MENU_ROUTINES need not exist as a stand-alone package;
  905. its proper place is as a subset of the SYSTEM_DRIVER package.
  906.  
  907.     EDITOR_TYPES would not exist if we could instantiate generics within
  908. a generic. This problem forces us to define parameters which should
  909. actually be dependent upon generic parameters outside of the generic.
  910. This is serious as it requires that 'maximum values' for certain
  911. parameters be 'hard coded' into the system instead of being determined
  912. in an instantiation.
  913.  
  914.     LINKED_LIST_PROCEDURES should be a subpackage of the generic
  915. definition. However, the inability to use incomplete type definitions
  916. within generic definitions makes that, at present, impossible. This
  917. causes the same problem that was mentioned in the last paragraph. In
  918. both cases, additional compilation units are needlessly required; they
  919. do not add to program clarity or structure, rather the opposite.
  920.  
  921.     Separate compilation of generic subunits has not altered the
  922. structure of the GMHF, but has substantially increased the required
  923. debugging time. While that is not a factor for users to be concerned
  924. with, it is for future maintenance personnel.
  925.  
  926.  
  927. 4.3 Alternative Approaches (Improvements/fixes).
  928.  
  929.     Aside from the restructuring implied in the paragraph above, there
  930. are two additional improvements which might be made. First, all
  931. enumerated I/O should be done with minimal user entry. This can be
  932. implemented by displaying the choices in a prompt and having the user
  933. enter a prefix, or by selection from a list. This would be easy to
  934. implement using a package of R.G. Cleaveland.
  935.  
  936.     The second change is not strictly speaking an improvement, but
  937. rather a look at an alternative method of storing the data. Rather
  938. than inputting structured types, and converting to strings, we might
  939. experiment with maintaining the data in structured types. This might
  940. limit the flexibility provided the user on input, but would be an
  941. opportunity to further explore the bounds of how Ada can be used to
  942. implement complex data structures.
  943.  
  944.  
  945.  
  946.  
  947. Appendix A. Defining Data Structures and Implementing GET_FIELD.
  948.  
  949.     In the first section of this appendix, we discuss the various
  950. utilities which are available to support the instantiation process. In
  951. the second section, we present what seems to us to be a well-structured
  952. approach to building and storing the data types and elements needed, and
  953. the GET_FIELD procedure. In the third section we present what we 
  954. actually had to do, due to current compiler constraints.
  955.  
  956.  
  957. A.1 Utilities Available to Support Implementation.
  958.  
  959.     There are three sets of utilities which are available for use by
  960. implementors. The utilities will be of use in generating the procedures
  961. required to implement a new editor. An implementor may have to develop
  962. (and pass as actual parameters to the generic) any or all of:
  963.  
  964.         get_line_name
  965.         get_field
  966.         pack_line
  967.         unpack_line
  968.         validate_line_insertion
  969.         parse_line_type.
  970.  
  971.     While the task of generating the first versions of these routines
  972. was non-trivial, future implementors will benefit from the experiences
  973. of their predecessors. In particular, new versions these programs which
  974. are required for future instantiations may be more easily implemented by
  975. making use of the utilities discussed here. The three types of utilities
  976. are: subprograms which are part of the underlying GMHF system and which
  977. are not message type dependent; subprograms which were developed to
  978. simplify the development of the RAINFORM and Unitrep instances, and
  979. which may have utility in other instantiations; subprograms which
  980. generate the files required for a new message type.
  981.  
  982.     The first set of utilities consists of all those routines which are
  983. visible in the packages: TERMINAL_DEFINITION, MAN_MACHINE_INTERFACE,
  984. CLASSIFICATION_DEFINITION, LINKED_LIST_PROCEDURES, FILE_ACCESS,
  985. PRINT_PROCEDURES, GENERIC_MENU_ROUTINES, SYSTEM_DRIVER, and
  986. EDITOR_TYPES. Those routines in the first two packages listed will
  987. likely be especially useful. They include such utilities as cursor
  988. movement and user prompting which almost certainly will be required
  989. by any implementor.
  990.  
  991.     The second set of utilities consists of the procedures contained
  992. in STATIC_GET_FIELD_UTILITIES and in GENERIC_GET_FIELD_UTILITIES.
  993. These utilities were developed to support the development of the
  994. RAINFORM version of GET_FIELD, and were used in the development of the
  995. Unitrep version. They support integer, decimal, character, and
  996. enumerated type I/O within the GMHF structure for prompts and user
  997. interface via command entries.
  998.  
  999.     The third set of utilities are routines which convert user created
  1000. files into direct access files used by the editor. These programs are
  1001. contained in the package FILE_UTILITIES, and are called by executing
  1002. certain parameterless procedures. Their use is discussed in Appendix B.
  1003.  
  1004.  
  1005. A.2 Recommended Implementation Structure.
  1006.  
  1007.    The simplest way of implementing the data and I/O required for a
  1008. new message standard is presented below. It involves defining objects,
  1009. types, subprograms, and files. The objects and types are discussed
  1010. in this section, as is the GET_FIELD procedure. Other subprograms are
  1011. straightforward but message type dependent. Guidance for those may be
  1012. obtained from the generic definition and by looking at the existing
  1013. RAINFORM and Unitrep examples. The creation of the files is discussed
  1014. in Appendix B, below.
  1015.  
  1016.      package NEW_MESSAGE_DATA is
  1017.  
  1018.         --
  1019.         -- these first three elements are not really required here, and
  1020.         -- could simply be specified as literals in the statement which
  1021.         -- instantiates the generic.
  1022.         --
  1023.    
  1024.         NEW_MESSAGE_MAXIMUM_FIELDS_PER_LINE : positive := ??;
  1025.  
  1026.         NEW_MESSAGE_MAXIMUM_CHARACTERS_PER_LINE : positive := ??;
  1027.  
  1028.         NEW_MESSAGE_MAXIMUM_LINES_PER MESSAGE : positive := ??;
  1029.  
  1030.         --
  1031.         -- We now define the names which we give to the lines in the
  1032.         -- new message type.
  1033.         --
  1034.  
  1035.         type NEW_MESSAGE_LINE_NAMES is (LINE_NAME_1,LINE_NAME_2,
  1036.                          . . . LINE_NAME_N);
  1037.  
  1038.         --
  1039.         -- We now provide the a routine to accept user input of a
  1040.         -- line name.
  1041.         --
  1042.  
  1043.         procedure GET_LINE_NAME(LINE_TYPE : out NEW_MESSAGE_LINE_NAMES);
  1044.         --
  1045.         -- We now define the names which we give to the fields in the
  1046.         -- new message type.
  1047.         --
  1048.  
  1049.         type NEW_MESSAGE_FIELD_NAMES is (FLD_NAME_1, FLD_NAME_2,
  1050.                          . . . FLD_NAME_M);
  1051.  
  1052.         --
  1053.         -- We now define the field types associated with the field
  1054.         -- names. By and large, these field types fall into two
  1055.         -- categories: constrained predefined Ada types, and new
  1056.         -- enumerated types. Veda adopted a convention that for
  1057.         -- enumerated fields, we assigned the most appropriate name
  1058.         -- to FLD_NAME_K (ie. to the corresponding item of
  1059.         -- NEW_MESSAGE_FIELD_NAMES) and named the associated type
  1060.         -- FLD_NAME_K_TYPE (ie. we appended the suffix 'TYPE' to the
  1061.         -- field name given in NEW_MESSAGE_FIELD_NAMES). There may be
  1062.         -- some fields which are in essence records (several components)
  1063.         -- which have as a component an enumerated type. Since the
  1064.         -- component is not named in NEW_MESSAGE_FIELD_NAMES we need not
  1065.         -- append the suffix 'TYPE' after the most appropriate name.
  1066.         --
  1067.         -- For example, LATITUDE might be a field name. Then we could
  1068.         -- have  type LATITUDE_DEGREES is natural range 0..89;
  1069.         --       type LATITUDE_MINUTES is natural range 0..59;
  1070.         --       type NORTH_SOUTH_CARDINAL is (N,S);
  1071.         --
  1072.  
  1073.         --
  1074.         -- having defined all the data types, one can then define the
  1075.         -- I/O routines for these types. Veda has included a package
  1076.         -- GET_FIELD_UTILITIES which contains procedures for getting
  1077.         -- constrained integer, decimal, and character types. It also
  1078.         -- provides a generic definition of a routine for getting 
  1079.         -- enumerated types, and two special purpose generics for
  1080.         -- getting enumerated types for data elements which
  1081.         -- start with digits, or which contain blanks and/or hyphens.
  1082.         -- It is worth noting that all of these routines rely on
  1083.         -- existing Ada routines or generic definitions, which are
  1084.         -- embedded in our procedures. In this way we minimize new
  1085.         -- code development while maintaining an integrated user
  1086.         -- tolerant interface.
  1087.         --
  1088.  
  1089.         --
  1090.         -- Having defined the data structures and I/O routines, we now
  1091.         -- define the GET_FIELD procedure whose format is as follows:
  1092.         --
  1093.         procedure GET_FIELD(FIELD_TYPE : in NEW_MESSAGE_FIELD_NAMES;
  1094.                             FIELD_GOTTEN : in out string;
  1095.                             FIELD_POSITION : in positive;
  1096.                             FIELD_LENGTH : in positive;
  1097.                             COMMAND_GOTTEN : out COMMAND;
  1098.                             COMMAND_FLAG : out boolean) is
  1099.  
  1100.            -- some local data definitions
  1101.         begin
  1102.  
  1103.            COMMAND_FLAG := false;
  1104.            COMMAND_GOTTEN := nil;
  1105.            case FIELD_TYPE is
  1106.          
  1107.               when FIELD_NAME_1  =>
  1108.  
  1109.                  -- statements for getting a field of this type
  1110.  
  1111.               when FIELD_NAME_2  =>
  1112.  
  1113.                  -- statements for getting a field of this type
  1114.  
  1115.            end case;
  1116.  
  1117.         end GET_FIELD;
  1118.  
  1119.      end NEW_MESSAGE_DATA;
  1120.  
  1121.     Obviously, the body of GET_FIELD would go in the body of
  1122. NEW_MESSAGE_DATA; also,the other procedures which are to be passed
  1123. as actual parameters in the instantiation process might also be put
  1124. in this package.
  1125.  
  1126.  
  1127. A.3 Actual RAINFORM Implementation Structure.
  1128.  
  1129.     In the case of the RAINFORM instance, the version of the compiler
  1130. in use (Telesoft 2.1) constrained executable modules (xxx.COD) to
  1131. 32k bytes. The RAINFORM line standard has many line types and even
  1132. more field types. Therefore the structures required for instantion
  1133. are contained in five packages.
  1134.  
  1135.     The line names, field names, and enumerated types are contained
  1136. in mini_lines_and_fields. The procedures which are to be passed as
  1137. actual parameters to the generic definition are found in formal_
  1138. generic_parameters (in honor of what they are to be matched with).
  1139. However, although GET_RAINFORM_FIELD is contained in that package to
  1140. become the actual get_field, it was too big to keep in one place.
  1141. Therefore five subsidiary packages are used: sub_pkg_1, sub_pkg_2, ...
  1142. sub_pkg_5. These subpackages contain the routines required to input
  1143. values of enumerated types. Thus in some cases, GET_RAINFORM_FIELD calls
  1144. procedures in sub_pkg_1 ( or _2 or _3 or _4 or _5).
  1145.  
  1146.     Finally, to support the input of user entered data, several
  1147. utility procedures were developed which are either called by
  1148. GET_RAINFORM_FIELD, or by routines called by GET_RAINFORM_FIELD.
  1149. These are found in static_get_field_utilities. In addition, the
  1150. enumerated io was facilitated by several generic definitions.
  1151. These are found in generic_get_field_utilities. One of the routines
  1152. is general in nature while the others are somewhat dependent upon
  1153. the RAINFORM message data types. Even these last may be useful when
  1154. modified to deal with data types found in other message standards.
  1155.    
  1156.  
  1157. A.4 Generic Message Editor Formal Part.
  1158.  
  1159.    Here we give the formal part of the generic definition.
  1160.  
  1161. ************************************************************************
  1162. package file_generic is
  1163.  
  1164. -- this generic definition reads the line structure from a file
  1165. -- which is passed as a generic parameter
  1166.  
  1167. generic
  1168.  
  1169.    maximum_fields_per_line, maximum_characters_per_line,
  1170.                               maximum_lines_per_message : positive;
  1171.  
  1172.    type line_name is (<>);
  1173.  
  1174.    with procedure get_line_name(line_type : out line_name) is <>;
  1175.  
  1176.    type field_name is (<>); -- and the legal field names.
  1177.  
  1178.    line_structure_file_name : string;
  1179.  
  1180.    prompt_vector_file_name : string; --holds lookup table for field pmts
  1181.  
  1182.    field_prompt_file_name : string;    -- holds field prompts themselves
  1183.  
  1184.    with procedure get_field(field_type : in field_name; 
  1185.                             field_gotten : in out string;
  1186.                             field_position : in positive;
  1187.                             field_length : in positive;
  1188.                             command_gotten : out command;
  1189.                             command_flag : out boolean) is <>;
  1190.  
  1191.    with procedure pack_line(line_to_pack : in out line_of_text;
  1192.                             line_format : in line_definition)
  1193.                                                     is null_procedure;
  1194.  
  1195.    with procedure unpack_line(line_to_unpack : in out line_of_text;
  1196.                               line_format : in line_definition)
  1197.                                                      is null_procedure;
  1198.  
  1199.    with procedure validate_line_insertion is null_procedure;
  1200.  
  1201.    with procedure parse_line_type(pointer_to_line : node;
  1202.                          line_type_found : out line_name);
  1203.  
  1204.    package filed_generic_message_editor is
  1205.  
  1206.       --
  1207.       -- in the real generic, there are some variables defined here.
  1208.       --
  1209.  
  1210.       procedure editor(message_passed : in out message);
  1211.  
  1212.    end filed_generic_message_editor;
  1213.  
  1214. end file_generic;
  1215.  
  1216.  
  1217.  
  1218.  
  1219. Appendix B. Creating the Line Structure, Field Prompt, and
  1220.             Lookup Table Files.
  1221.  
  1222.     I.  Creating Line Structure File
  1223.  
  1224.         General Purpose:  A sequential file must be created which 
  1225.             contains definitions of all Line Types for a particular
  1226.             message type. This file can be easily edited using a line
  1227.             or full screen editor (e.g. EDT). The data file will be
  1228.             validated and processed into a direct access file for use
  1229.             by the editior.
  1230.  
  1231.         Specific Process: 
  1232.           1) editing source file - Edit a file with the name of your
  1233.             choice but with suffix '.sce' (e.g.  RAINFORM.SCE). For 
  1234.             each unique line of the particular message type, enter
  1235.             the required information in the following format:
  1236.  
  1237.    -----------------------------------------------------------------
  1238.     record #        information
  1239.    ----------    ---------------------------------------------------
  1240.       n          line_name
  1241.       n + 1      number_of_fields
  1242.       n + 2      prototype_line
  1243.       n + 3      field_name    position   length    required_flag
  1244.       n + 4      field_name    position   length    required_flag
  1245.        .              .           .          .           .
  1246.        .              .           .          .           .
  1247.  
  1248.    -----------------------------------------------------------------
  1249.       
  1250.    Where: line_name- is a value from the enumerated type which contains
  1251.           all line_names for the message type
  1252.           
  1253.           number_of_fields- may range from 0 to the maximum fields per
  1254.           line for the message type
  1255.  
  1256.           prototype_line- string enclosed in quotation marks. This 
  1257.           string should represent how the line would look with no data
  1258.           entered in it. There is no set length for a prototype_line
  1259.           but the length may not exceed the maximum characters per line
  1260.           for the message type. If the prototype_line can not be fit on
  1261.           one line, the continuation character '&' may be used to 
  1262.           signify continuation on the next line. The '&' must be the 
  1263.           next character following the closing '"' of the first line
  1264.           of text for the prototype_line.
  1265.           ( e.g. "SAMPLE PROTO LINE /   /    / WITH "&
  1266.                  "A CONTINUATION ONTO THE NEXT LINE "
  1267.    
  1268.        ----
  1269.        |
  1270.        |  field_name- is a value from the enumerated type which contains
  1271.        |  all field_names for the message type
  1272.        |
  1273.        |  position- integer representing where in the prototype line
  1274. need   |  this field begins
  1275. this   |
  1276. for   -|  length- integer representing the length of the field
  1277. each   |
  1278. field  |  required_flag- boolean value which is set to true if an entry 
  1279.        |  into the field is required for the line to be valid. Set to
  1280.        |  false if the field isn't required
  1281.        |
  1282.        ----
  1283.  
  1284.           2) Once the data has been entered for each line of the message
  1285.              type, the file should be saved. The user then must prepare
  1286.              the file formatting routines which process the file and 
  1287.              place the data in a direct access file. The steps for 
  1288.              doing so are as follows:
  1289.                i) Edit the file linefield.sp. This file should be a 
  1290.                   package specification which contains the following:
  1291.                   - an enumerated type LIST_OF_LINES which contains the
  1292.                     line names for all lines of the message type
  1293.                   - an enumerated type LIST_OF_FIELDS which contains the
  1294.                     field names for the message type.
  1295.                   - a positive constant MAXIMUM_FIELDS_PER_LINE
  1296.                   - a positive constant MAXIMUM_CHARACTERS_PER_LINE
  1297.               ii) Compile the file linefield.sp then compile the file
  1298.                   buildfile.txt
  1299.              iii) Execute the program LINE_MAKER. This will validate
  1300.                   and reformat the source file you have edited. If you
  1301.                   have any errors in the source file the program will
  1302.                   kickout with an appropriate error message, usally 
  1303.                   having to due with an illegal line name or field name.
  1304.                   The error message will specify the line number in the 
  1305.                   source file which the error was raised. Once the file
  1306.                   is completely validated and reformatted, the end 
  1307.                   product will be a file of the same name as the source
  1308.                   but with a '.DES' suffix. The process is then 
  1309.                   complete. The filename may then be passed as an actual
  1310.                   parameter for the instantiation of a new editor.
  1311.  
  1312.  
  1313.     II. Creating Prompt File
  1314.  
  1315.         General Purpose:  A file must be created which contains text for
  1316.             each prompt to be displayed during an edit session. The
  1317.             prompts are used to aid a user in editing a message by
  1318.             providing specific information about the field currently
  1319.             being edited. This file can be easily edited using a line or
  1320.             full screen editor (e.g. EDT). The data file will be
  1321.             processed into a direct access file for use by the editor.
  1322.  
  1323.         Specific Process: 
  1324.             1) editing source file - Edit a file with the name of your
  1325.             choice but with suffix '.sce' (e.g.  RFPROMPT.SCE). For 
  1326.             each unique prompt of the particular message type, enter
  1327.             the required information in the following format:
  1328.    -----------------------------------------------------------------
  1329.     record #        information
  1330.    ----------    ---------------------------------------------------
  1331.       n          prompt_text
  1332.       n + 1      number_of_amp_prompts
  1333.       n + 2      row,column,amp_prompt_text
  1334.       n + 3      row,column,amp_prompt_text
  1335.        .              .           .          .           .
  1336.        .              .           .          .           .
  1337.  
  1338.    -----------------------------------------------------------------
  1339.  
  1340.    Where: prompt_text - is a text string enclosed in '"'. This string 
  1341.           of text will appear in the work area of the edit screen, 
  1342.           centered underneath the field for which it supports.
  1343.           
  1344.           number_of_amp_prompts - may range from 0 up to the maximum
  1345.           number of amp lines that will fit on the screen - at present
  1346.           with a VT-100 that maximum is 5. This number represents how
  1347.           many amp prompts are to follow for this particular field
  1348.           prompt.
  1349.  
  1350.        ----
  1351.        |
  1352.        |  row- integer representing what row on the crt the amp 
  1353.        |  text will appear
  1354.        |
  1355.        |  column- integer representing what column on the crt the amp
  1356. need   |  text will begin being displayed
  1357. this   |
  1358. for   -|  amp_prompt_text- text_string enclosed in '"'. This text will 
  1359. each   |  appear in the amp area of the edit screen at the location
  1360. amp    |  specified by row and column
  1361.        |  
  1362.        |  
  1363.        |
  1364.        ----
  1365.  
  1366.    Note:  There are two prompts which are required in this file, a
  1367.           prompt which displays the list of possible classifications
  1368.           for the messages and a prompt with the list of available line
  1369.           names for the message type being instantiated. You may look 
  1370.           at the existing '.sce' files for examples of these prompts.
  1371.       
  1372.      2) Once the data has been entered for each prompt of the message
  1373.              type, the file should be saved. Then execute the program 
  1374.              PROMPT_MAKER. This will validate and reformat the source 
  1375.              file you have edited. If you have any errors in the source
  1376.              file the program will kickout with an appropriate error 
  1377.              message. The error message will specify the line number in
  1378.              the source file which the error was raised. Once the file
  1379.              is completely validated and reformatted, the end product 
  1380.              will be a file of the same name as the source but with a 
  1381.              '.DES' suffix. The process is then complete. The filename 
  1382.              may then be passed as an actual parameter for the 
  1383.              instantiation of a new editor.
  1384.  
  1385.  
  1386.  
  1387.     III.Creating Look_up Table File
  1388.  
  1389.         General Purpose:  A sequential file must be created which 
  1390.             contains a cross reference between each line and the field
  1391.             prompts associated with the fields of the line. This file 
  1392.             can be easily edited using a line or full screen editor 
  1393.             (e.g. EDT). The data file will be processed into a direct 
  1394.             access file for use by the editor.
  1395.  
  1396.         Specific Process: 
  1397.             1) editing source file - Edit a file with the name of your
  1398.             choice but with suffix '.sce' (e.g.  RFLUT.SCE). For 
  1399.             each unique line of the particular message type, enter
  1400.             the required information in the following format:
  1401.  
  1402.    -----------------------------------------------------------------
  1403.     record #        information
  1404.    ----------    ---------------------------------------------------
  1405.       n          line_name,prompt_record_number,prompt_record_number...
  1406.        .              .           .          .           .
  1407.        .              .           .          .           .
  1408.  
  1409.    -----------------------------------------------------------------
  1410.  
  1411.    Where: line_name - is the line name for which the prompts support.
  1412.           
  1413.  
  1414. need     ----
  1415. one      |
  1416. for      |    prompt_record_number -represents the record number in the 
  1417. each     |    prompt '.des' file where the prompt for the particular
  1418. field of |    field is located.
  1419. line     |
  1420.          ----
  1421.  
  1422.    Note: The first entry in this file should be:
  1423.          SPECIAL, classification_record_number, line_names_record_number
  1424.       
  1425.           2) Once the data has been entered for each line of the message
  1426.              type, the file should be saved. The user then must prepare
  1427.              the file formatting routines which process the file and 
  1428.              place the data in a direct access file. The steps for 
  1429.              doing so are as follows:
  1430.                i) Edit the file linefield.sp. This file should be a 
  1431.                   package specification which contains the following:
  1432.                   - an enumerated type LIST_OF_LINES which contains the
  1433.                     line names for all lines of the message type
  1434.                   - an enumerated type LIST_OF_FIELDS which contains the
  1435.                     field names for the message type.
  1436.                   - a positive constant MAXIMUM_FIELDS_PER_LINE
  1437.                   - a positive constant MAXIMUM_CHARACTERS_PER_LINE
  1438.                   (*** NOTE  You may already have done this for the ***)
  1439.                   (*** structure file. DO NOT repeat it if so.      ***)
  1440.               ii) Compile the file linefield.sp then compile the file
  1441.                   buildlut.txt
  1442.              iii) Execute the program LUT_MAKER. This will validate
  1443.                   and reformat the source file you have edited. If you
  1444.                   have any errors in the source file the program will
  1445.                   kickout with an appropriate error message, usally 
  1446.                   having to due with an illegal line name or field name.
  1447.                   The error message will specify the line number in the 
  1448.                   source file which the error was raised. Once the file
  1449.                   is completely validated and reformatted, the end 
  1450.                   product will be a file of the same name as the source
  1451.                   but with a '.DES' suffix. The process is then 
  1452.                   complete. The filename may then be passed as an actual
  1453.                   parameter for the instantiation of a new editor.
  1454.  
  1455.  
  1456. Appendix C. Package Interdependencies and Recompilation Order.
  1457.  
  1458.     In this section we attempt to specify and to describe graphically
  1459. the interdependencies between the various GMHF packages. Each package
  1460. has potentially a specification part and a body. The dependencies are
  1461. specified for each. Since the dependencies are being provided to ease
  1462. recompilation, dependencies upon such packages as TEXT_IO and DIRECT_IO
  1463. are not listed.
  1464.  
  1465. file name      package name                  dependencies
  1466. -------------  ---------------------------   ---------------------------
  1467. TERMDEF.SP     terminal_definition           none
  1468.  
  1469. TERMDEF.TXT    terminal_definition           none
  1470.  
  1471. MMIP.SP        man_machine_interface         none
  1472.  
  1473. MMIP.TXT       man_machine_interface         host_lcd_if (VMS)
  1474.                                              terminal_definition
  1475.  
  1476. TYPELIST.SP    type_list                     none
  1477.  
  1478. CLASS.SP       classification_definition     none
  1479.  
  1480. CLASS.TXT      classification_definition     terminal_definition
  1481.                                              man_machine_interface
  1482.  
  1483. LNKLST.SP      linked_list_procedures        classification_definition
  1484.  
  1485. LNKLST.TXT     linked_list_procedures        man_machine_interface
  1486.  
  1487. FAP.SP         file_access                   type_list
  1488.                                              linked_list_procedures
  1489.  
  1490. FAP.TXT        file_access                   terminal_definition
  1491.                                              man_machine_interface
  1492.                                              classification_definition
  1493.  
  1494. PP.SP          print_procedures              type_list
  1495.                                              linked_list_procedures
  1496.                                              file_access
  1497.  
  1498. PP.TXT         print_procedures              man_machine_interface
  1499.                                              classification_definition
  1500.  
  1501.  
  1502. EDITTYPES.SP   editor_types                  terminal_definition
  1503.                                              linked_list_procedures
  1504.  
  1505. EDITTYPES.TXT  editor_types                  none
  1506.  
  1507. GENFILE.TXT    file_generic                  man_machine_interface
  1508.                                              linked_list_procedures
  1509. Note : filed_generic is the                  editor_types
  1510.                     generic definition       -- in body --
  1511.                                              terminal_definition
  1512.                                              classification_definition
  1513.                                              file_access
  1514.  
  1515. GENMENU.SP     generic_menu_routines         terminal_definition
  1516.                                              file_access
  1517.                                              linked_list_procedures
  1518.  
  1519. GENMENU.TXT    generic_menu_routines         man_machine_interface
  1520.  
  1521. CALLEDIT.SP    call_editor                   file_access
  1522.                                              linked_list_procedures
  1523.  
  1524. CALLEDIT.TXT   call_editor                   type_list
  1525.                                              * each of the packages
  1526.                                              * which contain
  1527.                                              * instances of an
  1528.                                              * editor
  1529.  
  1530. SDP.SP         system_driver                 generic_menu_routines
  1531.  
  1532. SDP.TXT        system_driver                 terminal_definition
  1533.                                              man_machine_interface
  1534.                                              type_list
  1535.                                              linked_list_procedures
  1536.                                              file_access
  1537.                                              print_procedures
  1538.                                              classification_definition
  1539.                                              call_editor
  1540.  
  1541. GMHF.TXT       gmhf_driver                   terminal_definition
  1542.                                              man_machine_interface
  1543.                                              general_menu_routines
  1544.                                              system_driver
  1545.  
  1546.  
  1547.  
  1548. As can be seen from the list, and the figure below, when a new editor is
  1549. instantiated, type_list must be edited and it, file_access, and
  1550. print_package recompiled. Then a 'with' clause for the package
  1551. containing the new instance must be added to the body of call_editor,
  1552. and the bodies of call_editor and system_driver recompiled.
  1553.  
  1554. Below, we describe the Rainform and Unitrep implementations. First, we
  1555. list some utility packages which can be of much use in implementing a
  1556. new message type.
  1557.  
  1558. ------------------------------------------------------------------------
  1559. ------------------------------------------------------------------------
  1560.  
  1561. these are utilities - they can be used to help generate a 'get_field'
  1562. and to build the several files needed to instantiate an editor
  1563. ---------------------------------------------------------------------
  1564.  
  1565. MINIGFU.TXT    generic_get_field_utilities   terminal_definition
  1566.                                              man_machine_interface -also
  1567.                                              message type dependent
  1568.  
  1569. STATICGFU.SP   static_get_field_utilities    man_machine_interface
  1570.  
  1571. STATICGFU.TXT  static_get_field_utilities    none
  1572.  
  1573. BUILDFILE.SP   line definition file          none
  1574.                creation utility              
  1575.  
  1576. BUILDFILE.TXT  line definition file          line_field_lists
  1577.                creation utility              (linefield.sp)
  1578.  
  1579. BUILDPMT.SP    prompt file                   none
  1580.                creation utility
  1581.  
  1582. BUILDPMT.TXT   prompt file                   none
  1583.                creation utility
  1584.  
  1585. BUILDLUT.SP    look-up table file            none
  1586.                creation utility              
  1587.  
  1588. BUILDLUT.TXT   look-up table file            line_field_lists
  1589.                creation utility              (linefield.sp)
  1590.  
  1591.  
  1592. ------------------------------------------------------------------------
  1593. ------------------------------------------------------------------------
  1594.  
  1595. these are the Rainform implementation packages
  1596. ----------------------------------------------
  1597.  
  1598. LNSANDFDS.SP   mini_lines_and_fields         none
  1599.  
  1600. SUBGRF1.TXT    sub_pkg_1                     terminal_definition
  1601.                                              man_machine_interface
  1602.                                              mini_lines_and_fields
  1603.                                              generic_get_field_utilities
  1604.  
  1605. SUBGRF2.TXT    sub_pkg_2                     terminal_definition
  1606.                                              man_machine_interface
  1607.                                              mini_lines_and_fields
  1608.                                              generic_get_field_utilities
  1609.  
  1610. SUBGRF3.TXT    sub_pkg_3                     terminal_definition
  1611.                                              man_machine_interface
  1612.                                              mini_lines_and_fields
  1613.                                              static_get_field_utilities
  1614.                                              generic_get_field_utilities
  1615.  
  1616. SUBGRF4.TXT    sub_pkg_4                     terminal_definition
  1617.                                              man_machine_interface
  1618.                                              mini_lines_and_fields
  1619.                                              static_get_field_utilities
  1620.                                              generic_get_field_utilities
  1621.  
  1622. SUBGRF5.TXT    sub_pkg_5                     terminal_definition
  1623.                                              man_machine_interface
  1624.                                              mini_lines_and_fields
  1625.                                              generic_get_field_utilities
  1626.  
  1627. FGPARAMS.SP    formal_generic_parameters     man_machine_interface
  1628.                                              linked_list_procedures
  1629.                                              mini_lines_and_fields
  1630.  
  1631. FGPARAMS.TXT   formal_generic_parameters     terminal_definition
  1632.                                              sub_pkg_1
  1633.                                              sub_pkg_2
  1634.                                              sub_pkg_3
  1635.                                              sub_pkg_4
  1636.                                              sub_pkg_5
  1637.                                              generic_get_field_utilities
  1638.                                              static_get_field_utilities
  1639.  
  1640. FGP2.SP    more_formal_generic_parameters    editor_types
  1641.                                              linked_list_procedures
  1642.  
  1643. FGP2.TXT   more_formal_generic_parameters    terminal_definition
  1644.                                              man_machine_interface
  1645.  
  1646. RFEDITOR.TXT   rf_editor                     classification_definition
  1647.                                              linked_list_procedures
  1648.                                              file_generic
  1649.                                              mini_lines_and_fields
  1650.                                              formal_generic_parameters
  1651.                                           more_formal_generic_parameters
  1652.  
  1653. Rainform Data Files
  1654. -------------------
  1655. RAINFORM.SCE                 RAINFORM.DES
  1656. RNPROMPT.SCE                 RNPROMPT.DES
  1657. RNPMTLUT.SCE                 RNPMTLUT.DES
  1658.  
  1659. ------------------------------------------------------------------------
  1660.  
  1661. these are the Unitrep implementation packages
  1662. ----------------------------------------------
  1663.  
  1664. URLNSFLDS.SP   Unitrep_lines_and_fields      none
  1665.  
  1666. URFLDTYPS.SP   Unitrep_field_types           none
  1667.  
  1668. URPROCS.SP     UR_procedures                 Unitrep_lines_and_fields
  1669.  
  1670. URPROCS.TXT    UR_procedures                 Unitrep_field_types
  1671.  
  1672. UNITREP.SP     Unitrep_interface             man_machine_interface
  1673.                                              linked_list_procedures
  1674.                                              Unitrep_lines_and_fields
  1675.  
  1676. UNITREP.TXT    Unitrep_interface             terminal_definition
  1677.                                              static_get_field_utilities
  1678.                                              UR_procedures
  1679.                                              Unitrep_field_types
  1680.  
  1681. UREDITOR.TXT   UR_editor                     Unitrep_lines_and_fields
  1682.                                              Unitrep_interface
  1683.                                              file_generic
  1684.  
  1685. Unitrep Data Files
  1686. -------------------
  1687. UNITREP1.SCE
  1688. UNITREP2.SCE                UNITREP.DES
  1689. URPROMPT.SCE                URPROMPT.DES
  1690. URPMTLUT.SCE                URPMTLUT.DES
  1691.  
  1692.  
  1693. ------------------------------------------------------------------------
  1694.  
  1695. these are external user interface packages
  1696. ------------------------------------------
  1697.  
  1698.  
  1699. EXTRNUSR.SP    access_for_external_users     linked_list_procedures
  1700.  
  1701. EXTRNUSR.TXT   access_for_external_users     type_list
  1702.                                              classification_definition
  1703.                                              file_access
  1704.  
  1705.  
  1706.  
  1707. ________________________________________________________________________
  1708.  
  1709.     In the figure below, if a package is linked to another by a with
  1710. clause, a line is drawn from the dependent package to the independent
  1711. package. If the with clause appears in the specification part of the
  1712. dependent package, the line appears on the left side of the graph
  1713. (from the 'spec' side). If the with clause is attached to the body of
  1714. the dependent package, the line is drawn from the right side of the
  1715. graph ( the 'body' side). The graph is drawn in an increasing order of
  1716. dependencies.
  1717.  
  1718.  
  1719. package name                  spec   body
  1720. ------------                  ----   ----
  1721.  
  1722.                               ---------------
  1723.                               |      |      |
  1724. terminal_definition   |-------|      |      |<-----------------|
  1725.                       |       |      |      | | |   |     |  | |
  1726.                       |       --------------- | |   |     |  | |
  1727.                       |                       | |   |     |  | |
  1728.                       |                       | |   |     |  | |
  1729.                       |       --------------- | |   |     |  | |
  1730.                       |       |      |      |-/ |   |     |  | |
  1731. man_machine_        |-^------>|      |      |   |   |     |  | |
  1732.         interface   | |       |      |      |<------------|  | |
  1733.                     | |       ---------------   | | | | | |  | |
  1734.                     | |                         | | | | | |  | |
  1735.                     | |                         | | | | | |  | |
  1736.                     | |       --------          |_|_|_|_| |  | |
  1737.                     | |       |      |         /| | | | |\|  | |
  1738. typelist            | |       |      |<-------x | | | | | x  | | (loop
  1739.                     | | |---> |      |          | | | | | |  | |  over
  1740.                     | | | |   --------          | | | | | |  | |     5)
  1741.                     | | | |                     | | | | | |  | |
  1742.                     | | | |                     | | | | | |  | |
  1743.                     | | | |   ---------------   | | | | | |  | |
  1744.                     | | | |   |      |      |--/  | | | | |  | |
  1745. classification_     | | | |   |      |      |     | | | | |  | |
  1746.        definition   | | | | ->|      |      |<----^-|-|-^-|--^-| (loop
  1747.                     | | | | | ---------------     | | | | |  | |  over
  1748.                     | | | | |                     | | | | |  | |  1- 3 
  1749.                     | | | | |                     | | | | |  | | times)
  1750.                     | | | | | ---------------     | | | | |  | |
  1751.                     | | | | |<|      |      |----/  |_|_| |  | |
  1752. linked_list_        | | | |   |      |      |      /| | |\|  | |
  1753.        procedures   |-^-|-|-->|      |      |<----x | | | x--| | (loop
  1754.                     | | |||   ---------------       | | | |  | |  over
  1755.                     | | |||                         | | | |  | |     3)
  1756.                     | | |||                         | | | |  | |
  1757.                     | | |||   ---------------       | | | |  | |
  1758.                     | | || \--|      |      |------/  | | |  | |
  1759. file_access_        | | ||    |      |      |         | | |  | |
  1760.          package    | |-||--->|      |      |<--------^-^-|--^-| (loop
  1761.                     | | ||    ---------------         | | |  | |  over
  1762.                     | | ||                            | | |  | |  1 - 3
  1763.                     | | ||                            | | |  | |  times)
  1764.                     | | ||    ---------------         | | |  | |
  1765.                     | | \^----|      |      |--------/  | |  | |
  1766. print_package       | |  |    |      |      |           | |  | |
  1767.                     | |  |    |      |      |<----------^-|  | |  (loop
  1768.                     | |  |    ---------------           | |  | |   over
  1769.                     | |  |                              | |  | |   1)
  1770.                     | |  |                              | |  | |
  1771.                     | |  |    ---------------           | |  | |
  1772.                     | \--^----|      |      |-----------/ |  | |
  1773. generic_menu_       |    |    |      |      |             |  | |
  1774.         routines    |    |  ->|      |      |             |  | |
  1775.                     |    |  | ---------------             |  | |
  1776.                     |    |  |                             |  | |
  1777.                     |    |  |                             |  | |
  1778.                     |    |  |                             |  | |
  1779.                     |    |  | ---------------             |  | |
  1780.                     |    |  | |      |      |-------------^-/  |
  1781. editor_types        |----^--^>|      |      |             |    |
  1782.                     |    |  | |      |      |             |    |
  1783.                     |    |  | ---------------             |    |
  1784.                     |    |  |                             |    |
  1785.                     |    |  |                             |    |  
  1786.                     |    |  | ---------------             |    |
  1787.                     |    |  | |      |      |             |    |
  1788. filed_generic       \----^--^-|      |      |-------------^---/
  1789.                          |  | |      |      |             |
  1790.                          |  | ---------------             |        to
  1791.                          |  |                             |     typelist
  1792.                          |  | ---------------             |  all editors
  1793.                          |  | |      |      |             |        /
  1794. call_editor              \--^-|      |      |-------------^-------/
  1795.                             | |      |      |<------------|
  1796.                             | ---------------             |
  1797.                             |                             |
  1798.                             | ---------------             |
  1799.                             \-|      |      |-------------/
  1800. system_driver_                |      |      |
  1801.          package              |      |      |
  1802.                               ---------------
  1803.                                 ^
  1804.                                 |
  1805. procedure GMHF_driver ----------/
  1806.  
  1807.  
  1808.  
  1809. Appendix D. An Alternate Version of the Generic Definition.
  1810.  
  1811.     At present, there are two versions of the generic definition. In the
  1812. 'standard' version, the message type being implemented has its line
  1813. structure defined in a file. It reads records of that file on a direct
  1814. access basis depending upon which line is being edited. The structure of
  1815. the current line is kept in a record of type LINE_DEFINITION which is
  1816. defined in the package EDITOR-TYPES. The original design called for the
  1817. entire line structure definition to be held in an array of elements of
  1818. type LINE_DEFINITION. In fact, one object of such an array would be
  1819. declared and initialized as a constant. That constant would then be
  1820. passed to the generic definition as a parameter, in place of the line
  1821. structure file name.
  1822.  
  1823.     This structure is implemented as follows:
  1824.  
  1825.           1) define a package within which an element of type
  1826.              LINE_DEFINITION_ARRAY is declared and initialized as
  1827.              shown:
  1828.  
  1829. LINE : LINE_DEFINITION_ARRAY:=(
  1830. --
  1831. --ACFT
  1832. (5,
  1833. "ACFT/      /     /      /   NM/                                      ",
  1834.   ((2,     6,   6,     false),
  1835.    (2,     13,  5,     false),
  1836.    (6,     19,  6,     false),
  1837.    (5,     26,  3,     false),
  1838.    (2,     32,  38,    false), others => (27,1,1,false)) ),
  1839. --
  1840. --ADD
  1841. (0,
  1842. "ADD                                                                  ",
  1843.  (others => (27,1,1,false))),
  1844. --
  1845. --AFTER
  1846. (0,
  1847. "AFTER                                                                ",
  1848.  (others => (27,1,1,false))),
  1849. --
  1850. --AMBTN
  1851. (17,
  1852. "AMBTN/   /    /   /   /   /    /  /  /  /    /  /  /  /    /  /  /   ",
  1853.   ((21,  7,  3,      true),
  1854.    (9,  11,  4,      true),
  1855.    (5,  16,  3,      true),
  1856.    (5,  20,  3,      true),
  1857.    (5,  24,  3,      true),
  1858.    (9,  28,  4,      false),
  1859.    (5,  33,  2,      false),
  1860.    (5,  36,  2,      false),
  1861.    (5,  39,  2,      false),
  1862.    (9,  42,  4,      false),
  1863.    (5,  47,  2,      false),
  1864.    (5,  50,  2,      false),
  1865.    (5,  53,  2,      false),
  1866.    (9,  56,  4,      false),
  1867.    (5,  61,  2,      false),
  1868.    (5,  64,  2,      false),
  1869.    (5,  67,  2,      false), others => (27,1,1,false))),
  1870. --
  1871. --AREA_LL
  1872. (8,
  1873. "AREA/      /       /      /       /      /       /      /            ",
  1874.   ((11,  6,   6,      true),
  1875.    (12,  13,  7,      true),
  1876.    (11,  21,  6,      true),
  1877.    (12,  28,  7,      true),
  1878.    (11,  36,  6,      true),
  1879.    (12,  43,  7,      true),
  1880.    (11,  51,  6,      false),
  1881.    (12,  58,  7,      false),others => (27,1,1,false))),
  1882. --
  1883. --AREA_C
  1884. (3,
  1885. "AREA/      /       /   NM                                            ",
  1886.   ((11,   6,  6,      true),
  1887.    (12,  13,  7,      true),
  1888.    ( 5,  21,  3,      true),others => (27,1,1,false))),
  1889. --
  1890. --AREA_A
  1891. (1,
  1892. "AREA/A-                                                              ",
  1893.   (( 2,   8, 12,      true),others => (27,1,1,false))),
  1894. --
  1895. --ASSOC
  1896. (1,
  1897. "ASSOC/                                                               ",
  1898.   (( 2,   7, 63,      false),others => (27,1,1,false))),
  1899. --
  1900. -- WEX
  1901. (11,
  1902. "WEX/      Z /   /      /       /    NM/   T/   K/    / /    F/       ",
  1903.   (( 3,   5,   8,     true),
  1904.    (20,  14,   3,     true),
  1905.    (11,  18,   6,     true),
  1906.    (12,  25,   7,     true),
  1907.    ( 5,  33,   4,     true),
  1908.    ( 7,  40,   3,     true),
  1909.    ( 5,  45,   3,     true),
  1910.    (26,  50,   4,     true),
  1911.    ( 7,  55,   1,     true),
  1912.    (17,  57,   4,     true),
  1913.    ( 7,  63,   1,     false),others => (27,1,1,false))),
  1914.  
  1915. --FREE
  1916. (1,
  1917. "                                                                     ",
  1918.   (( 2,   1, 69,      false),others => (27,1,1,false))),
  1919.  others =>(0,
  1920. "                                                                     ",
  1921. (others => (27,1,1,false)))   );
  1922.  
  1923.  
  1924.           2) 'with' the package defined above to the package in which
  1925.              COMPILED_GENERIC is instantiated, and pass the name of
  1926.              the element of type LINE_DEFINITION_ARRAY (in the example
  1927.              - LINE) as an actual parameter.
  1928.  
  1929.           3) note that in EDITOR_TYPES, the definition of LINE_
  1930.              DEFINITION_ARRAY is dependent on its index. This might
  1931.              require modification.
  1932.  
  1933.           4) use the editor created just as you would an editor
  1934.              created using FILED_GENERIC in the 'standard' fashion.
  1935.  
  1936.  
  1937.  
  1938.