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

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.                             DOCUMENTATION OF THE
  23.  
  24.                          PROTOTYPE ADA TOOLS CALLED
  25.  
  26.                           CONSTRUCT AND CREATE_CO
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.                              TABLE OF CONTENTS
  74.  
  75.  
  76.  
  77.  
  78.                                                                  Page
  79.                                                                  ----
  80.       LIST OF ILLUSTRATIONS                                      C-5
  81.  
  82.       1.0  INTRODUCTION                                          C-6
  83.       1.1  Purpose                                               C-6
  84.       1.2  Scope                                                 C-6
  85.  
  86.       2.0  USER INTERFACE WITH TOOLS                             C-7
  87.       2.1  Construct Tool                                        C-7
  88.            2.1.1  Function                                       C-7
  89.            2.1.2  Invocation                                     C-7
  90.            2.1.3  Inputs                                         C-7
  91.            2.1.4  Outputs                                        C-11
  92.       2.2  Create_CO Tool                                        C-15
  93.            2.2.1  Function                                       C-15
  94.            2.2.2  Invocation                                     C-15
  95.            2.2.3  Inputs                                         C-15
  96.            2.2.4  Outputs                                        C-16
  97.  
  98.       3.0  MODIFICATIONS FOR REHOSTING                           C-21
  99.       3.1  Construct Tool                                        C-21
  100.       3.2  Create_CO Tool                                        C-23
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.                            LIST OF ILLUSTRATIONS
  140.  
  141.  
  142.  
  143.       Figure                     Title                      Page
  144.       -----                      -----                      ----
  145.  
  146.         1              Example Graphs from Construct        C-12
  147.  
  148.         2              Example Configuration Object         C-18
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.       1.0  INTRODUCTION
  206.  
  207.  
  208.            The prototype Ada tools, Construct and Create_CO, were
  209.  
  210.       developed for the Worldwide Military Command and Control System
  211.  
  212.       (WWMCCS) Information System (WIS) Joint Program Management
  213.  
  214.       Office to begin a collection of tools which might later be
  215.  
  216.       integrated with the Ada Programming Support Environment for WIS.
  217.  
  218.       The Construct and Create_CO tools provide not only a useful
  219.  
  220.       software development capability but also provide an example of
  221.  
  222.       the use of Ada.
  223.  
  224.  
  225.       1.1  Purpose
  226.  
  227.  
  228.            The purpose of this document is to provide a brief guide
  229.  
  230.       for the use and maintenance of the Construct and Create_CO
  231.  
  232.       tools.
  233.  
  234.  
  235.       1.2  Scope
  236.  
  237.  
  238.            The scope of this document includes a discussion of the
  239.  
  240.       function, invocation, inputs and outputs  of both Construct and
  241.  
  242.       Create_CO.  This discussion reflects the tools as currently
  243.  
  244.       implemented on an Intellimac 7000M/UNIX host with a TeleSoft Ada
  245.  
  246.       compiler.  Information on rehosting the tools is also provided.
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.       2.0  USER INTERFACE WITH TOOLS
  272.  
  273.  
  274.       2.1  Construct Tool
  275.  
  276.  
  277.            2.1.1  Function
  278.  
  279.  
  280.            The function of Construct is to perform the minimal number
  281.  
  282.       of system commands to bring a project up to date given that
  283.  
  284.       changes to project files have occurred.  If a project is already
  285.  
  286.       up to date, Construct will indicate this and no commands will be
  287.  
  288.       performed.  Construct can also be used to supply descriptive
  289.  
  290.       information in the form of dependency graphs and name lists of
  291.  
  292.       project files.
  293.  
  294.  
  295.            The intent of Construct is to provide the foundation for
  296.  
  297.       configuration management in a given programming support
  298.  
  299.       environment.  Even though to date the tool has not been
  300.  
  301.       integrated with any specific environment which includes a
  302.  
  303.       database management system, the terms "database object" or
  304.  
  305.       simply "object" are used interchangeably with the term "file"
  306.  
  307.       throughout this documentation.
  308.  
  309.  
  310.            2.1.2  Invocation
  311.  
  312.  
  313.            To invoke Construct using the TeleSoft Ada compiler on the
  314.  
  315.       Intellimac 7000M, the user enters at the terminal:
  316.  
  317.  
  318.                                run construct
  319.  
  320.            2.1.3  Inputs
  321.  
  322.  
  323.            One input file is required by Construct.  This is the
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.       configuration object which describes the dependencies that exist
  338.  
  339.       among project files.  For example, if a particular Ada package,
  340.  
  341.       say PACKAGE_1, has a context clause for another package, say
  342.  
  343.       PACKAGE_2, then a dependency exists between these two packages
  344.  
  345.       such that PACKAGE_2 must be compiled before compiling PACKAGE_1.
  346.  
  347.       Dependencies specified in the configuration object are not
  348.  
  349.       restricted to Ada source code compilations; any commands
  350.  
  351.       recognized by the given host system and stored in the
  352.  
  353.       configuration object can be invoked using Construct.  However,
  354.  
  355.       for Ada source code files, the configuration object can be
  356.  
  357.       automatically generated by the Create_CO tool.  The procedure
  358.  
  359.       for using Create_CO is discussed in Section 2.2.  If Create_CO
  360.  
  361.       is not used, the configuration object can be manually entered
  362.  
  363.       with an editor.  The syntax which must be followed for manual
  364.  
  365.       creation of the configuration object is discussed in Section
  366.  
  367.       2.2.4.
  368.  
  369.  
  370.            The name of the configuration object is input as an
  371.  
  372.       argument to Construct.  Other arguments to Construct include the
  373.  
  374.       target(s) names and option(s).  The user is prompted for all
  375.  
  376.       three arguments.  A target is a project file which is to be
  377.  
  378.       brought up to date as specified in the configuration object.
  379.  
  380.       The given target does not have to be the highest level object
  381.  
  382.       described in the configuration object; it can also represent a
  383.  
  384.       sub-structure within the project.  The options argument allows
  385.  
  386.       the user to indicate whether system commands should be executed
  387.  
  388.       and/or displayed as well as whether additional graphs and lists
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.       should be generated.
  404.  
  405.  
  406.            At each argument prompt, the user is given 3 attempts to
  407.  
  408.       make a valid entry.  When the argument is a list (e.g., a list
  409.  
  410.       of options), the user is given 3 attempts for each item in the
  411.  
  412.       list.  A list is not a valid entry on any retry.  The following
  413.  
  414.       characters are recognized as separators in a list:  blank,
  415.  
  416.       comma, colon, backslash, semicolon, parenthesis, or double
  417.  
  418.       hyphen.  Note, these characters may not be embedded in the names
  419.  
  420.       of configuration objects or targets.  Error messages are
  421.  
  422.       provided when invalid entries are made.  If the user requires
  423.  
  424.       help on entering a particular argument, a "?" can be entered to
  425.  
  426.       display relevant help information.
  427.  
  428.  
  429.            The configuration object entered as an argument must exist
  430.  
  431.       and be accessible to the user.  If upper/lower case is
  432.  
  433.       significant to the filenaming conventions on the given system as
  434.  
  435.       with UNIX, then this and any other conventions must be observed.
  436.  
  437.       A default configuration object, named "co_file", may be
  438.  
  439.       specified by entering just a carriage return at this prompt.  A
  440.  
  441.       list of configuration objects is an invalid entry.
  442.  
  443.  
  444.            If a carriage return is entered at the prompt for targets,
  445.  
  446.       the default is assumed meaning the first object to appear in the
  447.  
  448.       configuration object will be used.  If a list of targets is
  449.  
  450.       desired, then the list must be explicitly entered by the user
  451.  
  452.       with targets separated by any of the special characters
  453.  
  454.       mentioned above.  Minimal checks are performed on targets at the
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.       input stage of Construct's execution.  Errors such as the target
  470.  
  471.       does not appear in the configuration object or is inaccessible
  472.  
  473.       to the user are not recognized by Construct until after the user
  474.  
  475.       has entered all arguments. Therefore, if an invalid target is
  476.  
  477.       entered by the user, an error message will be displayed but the
  478.  
  479.       user is not given an opportunity to correct the mistake.
  480.  
  481.  
  482.            The set of valid options a user may enter includes:
  483.  
  484.            1) Execute          -  execute the commands needed to update
  485.                                   the system.
  486.  
  487.            2) Cmd_Print        -  print the commands needed  to  update
  488.                                   the system.
  489.  
  490.            3) Top_Down_Graph   -  print  a  textual top-down  graph  of
  491.                                   dependencies for the given target.
  492.  
  493.            4) Bottom_Up_Graph  -  print  a  textual  bottom-up graph of
  494.                                   dependencies for the given target.
  495.  
  496.            5) List             -  print lists of all basic and  derived
  497.                                   names  in  the  given   configuration
  498.                                   object.
  499.  
  500.       To explicitly turn any of the above options off, the prefix
  501.  
  502.       "No_" is entered with the option (e.g., No_Execute).  The list
  503.  
  504.       of default options includes: Execute, Cmd_Print,
  505.  
  506.       No_Top_Down_Graph, No_Bottom_Up_Graph, No_List.  If just a
  507.  
  508.       carriage return is entered at the options prompt, then all the
  509.  
  510.       default options will be used.  To change any of these options,
  511.  
  512.       the user must explicitly enter the appropriate option.  Options
  513.  
  514.       may be entered in mixed case or abbreviated.  If a list of
  515.  
  516.       options is entered, these may be entered in any order.  Should
  517.  
  518.       conflicting options be entered (e.g., No_Execute and Execute),
  519.  
  520.       the last one in the list will be assumed.
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.            2.1.4 Outputs
  536.  
  537.  
  538.            The type of output received from Construct depends upon the
  539.  
  540.       options input as arguments by the user.  If either of the graph
  541.  
  542.       options (i.e., Top_Down_Graph or Bottom_Up_Graph) are entered, a
  543.  
  544.       textual graph of object dependencies is displayed where each
  545.  
  546.       indentation represents another dependency level.  The
  547.  
  548.       Top_Down_Graph illustrates dependencies in such a way that the
  549.  
  550.       highest level object in the graph is dependent upon all lower
  551.  
  552.       level objects.  In the Bottom_Up_Graph, the highest level object
  553.  
  554.       is a dependent of all lower level objects.  Each graph includes
  555.  
  556.       only the dependencies related to the specified target. Figure 1
  557.  
  558.       provides an example of both types of graphs for the same
  559.  
  560.       specified object (in this case, the target is arguments.sym).
  561.  
  562.       The first column of numbers seen in the graphs is the
  563.  
  564.       consecutive line number.  The following numbers which are
  565.  
  566.       enclosed in brackets indicate the line where the current object
  567.  
  568.       is expanded into its own sub-graph, thereby providing a more
  569.  
  570.       concise graph.
  571.  
  572.  
  573.            If the List option is entered, two lists of object names
  574.  
  575.       are displayed. The first is a list of basic names which refer to
  576.  
  577.       objects which can not be machine generated (e.g., text files).
  578.  
  579.       The other list includes derived names which refer to objects
  580.  
  581.       which can be generated given the dependency rules in the
  582.  
  583.       configuration object.  Note that these lists show all the names
  584.  
  585.       which appear in the specified configuration object.
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615. ------------------------------------------------------------------------------
  616.  
  617.  
  618.  
  619.         1      arguments.sym
  620.         2          arguments.text
  621.         3          str_pack.sym
  622.         4      ....    str_pack.text
  623.         5          environs.sym
  624.         6      ....    environs.text
  625.      
  626.  
  627.  
  628.         Top Down Graph
  629.  
  630.  
  631. -----------------------------------------------------------------------------
  632.  
  633.  
  634.         1      arguments.sym
  635.         2          construct.code
  636.         3          bld_graph.sym
  637.         4      ....    construct.code
  638.         5          bld_graph.code
  639.         6          bld_lst.sym
  640.         7 [  3]....    bld_graph.sym
  641.         8      ....    bld_graph.code
  642.         9          bld_lst.code
  643.        10          con_proc.sym
  644.        11      ....    construct.code
  645.        12          con_proc.code
  646.        13          display.sym
  647.        14      ....    construct.code
  648.        15          display.code
  649.  
  650.  
  651.  
  652.          Bottom Up Graph
  653.  
  654.  
  655. ---------------------------------------------------------------------------
  656.  
  657.  
  658.  
  659.                         Figure 1
  660.  
  661.             EXAMPLE GRAPHS FROM CONSTRUCT
  662.  
  663.  
  664.  
  665.  
  666.  
  667.            When the Cmd_Print option is on (i.e., the default
  668.  
  669.       condition), the commands to be invoked by Construct are
  670.  
  671.       displayed in the order they would be performed.  If in addition
  672.  
  673.       the Execute option is set (also the default condition), any
  674.  
  675.       feedback resulting from the execution of tools invoked through
  676.  
  677.       Construct will appear at the terminal.
  678.  
  679.  
  680.            The presence of cycles in the dependency rules of the
  681.  
  682.       configuration object (e.g., a rule stating that the object
  683.  
  684.       "Construct.code" depends upon "Construct.code") is always
  685.  
  686.       determined by Construct. If cycles exist, an error message
  687.  
  688.       showing both the direct and indirect cycles is displayed and
  689.  
  690.       execution of Construct is halted.  For example, the message may
  691.  
  692.       be:
  693.  
  694.  
  695.                 Object_1 <= Object_2 <= Object_3 <= Object_1
  696.  
  697.  
  698.       which indicates that Object_1 is indirectly dependent upon
  699.  
  700.       itself and is therefore a cycle error.
  701.  
  702.  
  703.            Some other error messages are provided during the execution
  704.  
  705.       of Construct.  These generally occur as the result of fatal
  706.  
  707.       errors causing Construct to be aborted.  The messages are self
  708.  
  709.       explanatory and are not discussed individually here. In the
  710.  
  711.       event of an unexplainable error, there are two debugging traces
  712.  
  713.       of Construct's execution which can be used to isolate the
  714.  
  715.       problem.  To produce this output, which is routed to a file
  716.  
  717.       called DUMP_OUTPUT, the options Dump_Tree and/or Process_Dump
  718.  
  719.       must be set during the input of arguments.  Dump_Tree traces the
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.       parsing of the configuration object while Process_Dump traces
  734.  
  735.       the determination of commands to be performed.  Neither of these
  736.  
  737.       options would be used in production runs of Construct but are
  738.  
  739.       briefly mentioned here as Construct is still a prototype tool.
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.       2.2  Create_CO Tool
  800.  
  801.  
  802.            2.2.1 Function
  803.  
  804.  
  805.            Create_CO reads a set of Ada source code files and creates
  806.  
  807.       a configuration object which describes the dependencies that
  808.  
  809.       exist among the files.  The configuration object is formatted so
  810.  
  811.       that it may be read by Construct.  In determining dependencies,
  812.  
  813.       Create_CO observes the filenaming conventions of the TeleSoft
  814.  
  815.       Ada compiler (i.e., filename extensions of .text, .sym, .code)
  816.  
  817.       and the compiler's language restriction that specifications and
  818.  
  819.       bodies of Ada packages reside in the same file.
  820.  
  821.  
  822.            2.2.2  Invocation
  823.  
  824.  
  825.            Create_CO is invoked by entering the command:
  826.  
  827.  
  828.                                run create_co
  829.  
  830.  
  831.            2.2.3 Inputs
  832.  
  833.  
  834.            The inputs to Create_CO must conform to the UNIX operating
  835.  
  836.       system filenaming conventions.  There are two inputs to
  837.  
  838.       Create_CO: the name of the configuration object to be created
  839.  
  840.       and the UNIX filename pattern describing the set of Ada source
  841.  
  842.       code files to be read.  The filename pattern may include the
  843.  
  844.       special characters "*" and "?", and selectors such as "[aeiou]"
  845.  
  846.       which are supported by UNIX.  Both inputs are prompted for as
  847.  
  848.       shown below:
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.                       ENTER CO_FILE_NAME =>
  866.  
  867.                       ENTER NAMES OF FILES TO BE SCANNED =>
  868.  
  869.  
  870.       A typical response to these prompts would be:
  871.  
  872.  
  873.                       ENTER CO_FILE_NAME => co_file
  874.  
  875.                       ENTER NAMES OF FILES TO BE SCANNED => *.text
  876.  
  877.  
  878.       The above responses cause the creation of a configuration object
  879.  
  880.       named co_file which describes the dependencies among all files
  881.  
  882.       in the current directory which end in ".text".
  883.  
  884.  
  885.            Note that the user may create a configuration object from
  886.  
  887.       files in another directory by including the appropriate path in
  888.  
  889.       the filename pattern, for example:
  890.  
  891.  
  892.         ENTER NAMES OF FILE TO BE SCANNED => ada/test_library/*.text
  893.  
  894.  
  895.       However, when files are read from a directory other than the
  896.  
  897.       current working directory, all directory paths are stripped from
  898.  
  899.       the filenames and are not reflected in the configuration object.
  900.  
  901.  
  902.            2.2.4 Outputs
  903.  
  904.  
  905.            Create_CO displays the name of each input file as it is
  906.  
  907.       being processed.  This allows the user to observe Create_CO's
  908.  
  909.       progress and to check that the specified filename pattern
  910.  
  911.       resulted in the correct set of files to be read.  An error
  912.  
  913.       message is reported when Create_CO is unable to access a
  914.  
  915.       particular file and then that file's dependencies are not
  916.  
  917.       included in the configuration object.  If none of the specified
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.       files are accessible, an empty configuration object will result.
  932.  
  933.  
  934.            The primary output of Create_CO is a configuration object
  935.  
  936.       which obeys the syntax recognized by Construct.  An example
  937.  
  938.       configuration object is shown in Figure 2 to illustrate the
  939.  
  940.       following discussion.
  941.  
  942.  
  943.            A configuration object contains one or more dependency
  944.  
  945.       rules.  Each dependency rule consists of the following ordered
  946.  
  947.       parts:
  948.  
  949.  
  950.                    - a list of targets
  951.  
  952.                    - the target list terminator, ":"
  953.  
  954.                    - a list of dependents
  955.  
  956.                    - the dependent list terminator, ";"
  957.  
  958.                    - a list of system commands
  959.  
  960.                    - the command list terminator, "$"
  961.  
  962.  
  963.       The order of dependency rules within the configuration object is
  964.  
  965.       unimportant except that the first rule in the file should have
  966.  
  967.       as its first target the most frequently updated target in order
  968.  
  969.       to facilitate the use of default inputs when running Construct.
  970.  
  971.       Comments may appear anywhere in the configuration file.  There
  972.  
  973.       should be no blank lines in the file.
  974.  
  975.  
  976.            Comments must be in the form of standard Ada comments.
  977.  
  978.       They begin with "--" and are terminated by the end of a line.
  979.  
  980.       Thus, just as in Ada, comments may occur at the end of a line or
  981.  
  982.       on a line by themselves.  All text on the line following the
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005. arguments.sym arguments.code :arguments.text environs.sym str_pack.sym\
  1006.                                host.sym environs.sym;
  1007. ada arguments
  1008. $
  1009. ast_graph.sym ast_graph.code :ast_graph.text calendar.sym str_pack.sym;
  1010. ada ast_graph
  1011. $
  1012. bld_graph.sym bld_graph.code :bld_graph.text bld_lst.sym ast_graph.sym\
  1013.                                str_pack.sym arguments.sym environs.sym;
  1014. ada bld_graph
  1015. $
  1016. bld_lst.sym bld_lst.code :bld_lst.text ast_graph.sym environs.sym\
  1017.                            ast_graph.sym str_pack.sym arguments.sym;
  1018. ada bld_lst
  1019. $
  1020. calendar.sym calendar.code :calendar.text;
  1021. ada calendar
  1022. $
  1023. con_proc.sym con_proc.code :con_proc.text host.sym ast_graph.sym str_pack.sym\
  1024.                              calendar.sym environs.sym arguments.sym;
  1025. ada con_proc
  1026. $
  1027. construct.sym construct.code :construct.text bld_graph.sym display.sym\
  1028.                                arguments.sym con_proc.sym environs.sym;
  1029. ada construct
  1030. $
  1031. create_co.sym create_co.code :create_co.text str_pack.sym host.sym\
  1032.                                environs.sym;
  1033. ada create_co
  1034. $
  1035. display.sym display.code :display.text ast_graph.sym str_pack.sym\
  1036.                            arguments.sym environs.sym;
  1037. ada display
  1038. $
  1039. environs.sym environs.code :environs.text;
  1040. ada environs
  1041. $
  1042. host.sym host.code :host.text str_pack.sym calendar.sym environs.sym;
  1043. ada host
  1044. $
  1045. str_pack.sym str_pack.code :str_pack.text;
  1046. ada str_pack
  1047. $
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.                             Figure  2
  1054.  
  1055.                  EXAMPLE CONFIGURATION OBJECT
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.       "--" will be interpreted as a comment.
  1064.  
  1065.  
  1066.            The target and dependent lists may occur on a single line
  1067.  
  1068.       or on a series of continued lines.  A line is marked as
  1069.  
  1070.       continued when the last character in the line is a backslash
  1071.  
  1072.       ("\").  Objects in either list are separated by any of the
  1073.  
  1074.       following characters:
  1075.  
  1076.  
  1077.                 " "        ","        ":"        "\"
  1078.  
  1079.                 ";"        "("        ")"        "--"
  1080.  
  1081.  
  1082.       All extraneous blanks between objects are ignored.  The first
  1083.  
  1084.       colon in the dependency rule is interpreted as the end of the
  1085.  
  1086.       target list  while subsequent colons are interpreted simply as
  1087.  
  1088.       separators within the dependent list.  A semicolon  within the
  1089.  
  1090.       dependent list is interpreted as the end of the list while
  1091.  
  1092.       semicolons within the target list are interpreted simply as
  1093.  
  1094.       separators.  A typical format for target and dependent lists is:
  1095.  
  1096.  
  1097.                 target_one target_two : dependent_one dependent_two;
  1098.  
  1099.  
  1100.       or for longer lists:
  1101.  
  1102.  
  1103.                 target_one target_two : dependent_one dependent_two\
  1104.                                         dependent_three dependent_four;
  1105.  
  1106.       Note that spacing and the order of objects within a list have no
  1107.  
  1108.       effect on the interpretation of the target and dependent lists.
  1109.  
  1110.  
  1111.            Following each pair of target and dependent lists is a list
  1112.  
  1113.       of system commands.  These commands define the relationships
  1114.  
  1115.       stated in the corresponding pair of target and dependent lists.
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.       The command list may include any command recognized by the host
  1130.  
  1131.       operating system's command language interpreter.  The commands
  1132.  
  1133.       must appear in the list in the order they are to be executed.  A
  1134.  
  1135.       "$" must appear in the first column of the line following the
  1136.  
  1137.       command list in order to mark the end of the command list and
  1138.  
  1139.       therefore the end of that dependency rule.
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.                                   Figure 2
  1244.  
  1245.                         EXAMPLE CONFIGURATION OBJECT
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.       3.0  MODIFICATIONS FOR REHOSTING
  1262.  
  1263.  
  1264.       3.1  Construct Tool
  1265.  
  1266.  
  1267.            The host-specific code in Construct falls into three
  1268.  
  1269.       categories:  tool parameter handling, database object
  1270.  
  1271.       timestamps, and command execution.  These dependencies are
  1272.  
  1273.       isolated in Construct with the package HOST.  Construct utilizes
  1274.  
  1275.       the facilities in HOST without any knowledge of how these
  1276.  
  1277.       facilities are implemented.  In order to rehost Construct on a
  1278.  
  1279.       new system, the package body of HOST must be rewritten for the
  1280.  
  1281.       new system to provide the same functionality without modifying
  1282.  
  1283.       the external interfaces of the package (i.e., the specification
  1284.  
  1285.       part).
  1286.  
  1287.  
  1288.            Parameter handling is not used in this version of
  1289.  
  1290.       Construct; instead the user is prompted for all arguments to
  1291.  
  1292.       Construct.  However, the boolean function HOST.ARGS_EXIST is
  1293.  
  1294.       included in the present code to enable future versions of
  1295.  
  1296.       Construct to allow a non-prompting mode (i.e., Construct is
  1297.  
  1298.       invoked with a complete command line) in addition to the current
  1299.  
  1300.       prompting mode.  This new feature will require that other
  1301.  
  1302.       parameter handling facilities be added to the HOST package.
  1303.  
  1304.  
  1305.            The host operating system must be able to provide Construct
  1306.  
  1307.       with the time that individual files were last modified.  The
  1308.  
  1309.       function HOST.MODIFICATION_TIMESTAMP is passed the name of a
  1310.  
  1311.       file (i.e., a target or dependent object as specified in the
  1312.  
  1313.       configuration object) and it  returns the last-modified time as
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.       the data type CALENDAR.TIME. If HOST.MODIFICATION_TIMESTAMP is
  1328.  
  1329.       unable to determine the last-modified time of the database
  1330.  
  1331.       object (e.g., the file does not exist or is inaccessible), the
  1332.  
  1333.       exception ACCESSIBILITY_ERROR is raised. This exception is
  1334.  
  1335.       handled by PROCESSING_INTERNALS.TIMESTAMPS_OUT_OF_SEQUENCE in
  1336.  
  1337.       the package CON_PROC which is the only subprogram in Construct
  1338.  
  1339.       that uses HOST.MODIFICATION_TIMESTAMP.  Any externally visible
  1340.  
  1341.       changes to HOST.MODIFICATION_TIMESTAMP (e.g., a new exception
  1342.  
  1343.       that may be raised) must be reflected in
  1344.  
  1345.       PROCESSING_INTERNALS.TIMESTAMPS_OUT_OF_SEQUENCE.
  1346.  
  1347.  
  1348.            The timestamp resolution (e.g., milliseconds vs. minutes)
  1349.  
  1350.       does not affect the execution of Construct.  Construct simply
  1351.  
  1352.       determines if one file has been modified more recently than
  1353.  
  1354.       another file (i.e., timestamp1 > timestamp2).  However,
  1355.  
  1356.       timestamp resolution will have an obvious impact on the
  1357.  
  1358.       usefulness of Construct.  For example, if the operating system
  1359.  
  1360.       only recognizes the month that files were modified, many
  1361.  
  1362.       inconsistencies brought about by changes to a project may be
  1363.  
  1364.       left unresolved by Construct.  Any implementation of
  1365.  
  1366.       HOST.MODIFICATION_TIMESTAMP should return as fine a resolution
  1367.  
  1368.       as the underlying system supports.  Also, Construct assumes that
  1369.  
  1370.       the last modified timestamp is a monotonically increasing value,
  1371.  
  1372.       meaning the relational operators "<" and ">" in the package
  1373.  
  1374.       CALENDAR retain their intuitive meaning when used on file
  1375.  
  1376.       timestamps.  This assumption must be preserved in any
  1377.  
  1378.       implementation of HOST.MODIFICATION_ TIMESTAMPS.
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.            Construct must be able to invoke any command recognized by
  1394.  
  1395.       the host's command language interpreter (CLI).  The procedure
  1396.  
  1397.       HOST.EXECUTE_CMDS is passed one line from the a list of commands
  1398.  
  1399.       in a given dependency rule of the configuration object and this
  1400.  
  1401.       procedure in turn passes the entire line as a string to the
  1402.  
  1403.       host's CLI. If an error occurs during the execution of a command
  1404.  
  1405.       (e.g., if the invoked tool terminates abnormally), the exception
  1406.  
  1407.       HOST.EXECUTION_ERROR is raised.  The procedure
  1408.  
  1409.       PROCESSING_INTERNALS.EXECUTE_A_COMMAND traps this exception; it
  1410.  
  1411.       is the only subprogram in Construct that uses HOST.EXECUTE_CMDS.
  1412.  
  1413.  
  1414.            Any implementation of HOST.EXECUTE_CMDS should ensure that
  1415.  
  1416.       all signals, exceptions, etc.  that occur in the execution of
  1417.  
  1418.       the given command do not propagate back to Construct.  Also,
  1419.  
  1420.       HOST.EXECUTE_CMDS should preserve the user's execution
  1421.  
  1422.       environment to the extent possible when executing commands.  For
  1423.  
  1424.       example, global CLI variables, search paths, and access rights
  1425.  
  1426.       should be the same for HOST.EXECUTE_CMDS as those that would be
  1427.  
  1428.       available to the user when entering a command directly.
  1429.  
  1430.  
  1431.       3.2  Create_CO Tool
  1432.  
  1433.  
  1434.            There are two major areas of consideration when rehosting
  1435.  
  1436.       Create_CO: the names of compiler-supplied packages, and the
  1437.  
  1438.       method of determining the Ada source code files to be read.  The
  1439.  
  1440.       first merely requires changes to a list of constants, but the
  1441.  
  1442.       second may require a completely revised approach for obtaining
  1443.  
  1444.       the list of Ada files.  The extent of the revision depends upon
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.       the capabilities of the host environment.
  1460.  
  1461.  
  1462.            The compiler-supplied package names are isolated in the
  1463.  
  1464.       function SYSTEM_NAME.  These package names are declared as
  1465.  
  1466.       character string constants.  The current list of library unit
  1467.  
  1468.       names recognized by Create_CO is: Text_IO, System, Direct_IO,
  1469.  
  1470.       UNIX_Call, Unchecked_Conversion, and Host_LCD_If.  The standard
  1471.  
  1472.       library units Unchecked_Deallocation, Sequential_IO,
  1473.  
  1474.       IO_Exceptions, Low_Level_IO, and Calendar should be added when a
  1475.  
  1476.       validated compiler which includes these units is available.  If
  1477.  
  1478.       a TeleSoft compiler is being used, the two Telesoft-specific
  1479.  
  1480.       library units Arg_Parser and Terminal_IO should  be added. In
  1481.  
  1482.       general, the function SYSTEM_NAME will need to be modified to
  1483.  
  1484.       reflect all library units  supplied by the compiler system on
  1485.  
  1486.       the new host.
  1487.  
  1488.  
  1489.            The code for obtaining the appropriate list of Ada  files
  1490.  
  1491.       to be read is isolated in the procedure GET_LIST_OF_FILENAMES.
  1492.  
  1493.       As currently implemented, this procedure prompts the user for a
  1494.  
  1495.       character string to be used as a UNIX pattern for matching
  1496.  
  1497.       filenames.  A UNIX directory command is created with this
  1498.  
  1499.       pattern such that the output from the directory command is
  1500.  
  1501.       routed to a file named CREATE_CO.TEMP.  The host-specific
  1502.  
  1503.       procedure EXECUTE_CMDS from the  package HOST is called to
  1504.  
  1505.       execute the directory command.  The matching filenames are then
  1506.  
  1507.       read from the file CREATE_CO.TEMP and inserted into a dynamic
  1508.  
  1509.       string.
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.            If the new host environment supports command execution,
  1526.  
  1527.       pattern matching, and redirection of command output to files,
  1528.  
  1529.       this same algorithm may be used with minor modification of
  1530.  
  1531.       character string literals to create the proper directory
  1532.  
  1533.       command.  Otherwise, GET_LIST_OF_FILENAMES must be rewritten to
  1534.  
  1535.       implement some new algorithm.  Possible approaches are to have
  1536.  
  1537.       the user enter all filenames explicitly, or to have the user
  1538.  
  1539.       enter the name of a file which contains the list of source code
  1540.  
  1541.       files to be processed.
  1542.  
  1543.  
  1544.            Create_CO is also dependent upon the format of the
  1545.  
  1546.       configuration file which may change when rehosted to another
  1547.  
  1548.       system.  Separators with special meaning, such as colon,
  1549.  
  1550.       semicolon, and backslash, should be defined as character
  1551.  
  1552.       constants so that they are more easily modified.  Likewise, the
  1553.  
  1554.       compilation command (currently "ada filename") should be
  1555.  
  1556.       parameterized to facilitate rehosting.
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.