CreateSLIB

This option is invoked from the TopBar Constructs pull-down and facilitates the creation of a new library construct in the system library directory - SLIB. A library construct is a specification together with a code module, and this facility assists in the creation of the C code files.

The option is applicable to any analysed specification which is not already present in SLIB; the construct should, however, not SEE any non-renamable SLIB machines.

Two types of library construct may be created:

  1. Create SLIB-Committable construct
  2. Create lower-level SLIB construct
The former enables the created construct to be subsequently introduced into other developments, whereas the latter provides a library construct on which other SLIB constructs may be built (by importing - see below); this one, however, is not made available for direct introduction into other developments.

Importation of lower-level SLIB constructs is achieved through the LIBDEF (.ldf) file - a template is provided, and the IMPORTS clause should be completed as it would in an Abstract Machine Implementation (with parameters set where appropriate); if nothing is being imported, the clause should be removed. Lower level SLIB constructs may themselves import other lower-level constructs.

After the LIBDEF file has been edited, the following prompt appears:

    Create code template files in SRC
Three templates are provided in editors to produce the `.h', `.g' and `.c' files that constitute a library code module. The first contains header information for the code modules of machines which SEE or IMPORT this construct together with the definitions of any operations that are to be in-lined. The second contains module parameterisation information to be used at link-time when the values of module parameters are known. The last file contains the C code of the operations not in-lined in the `.h' file.

Data should be declared in the `.g' file, and declared as `extern' in the .h file. It is recommended that one of the existing SLIB code modules is inspected for guidance (for example `Rename_Nvar').

As much information as possible will have been written to these three files (templates for operations in both the `.h' and `.c' file, and parameter information in the `.g' file).

The prompt:

     Create SLIB construct
is then offered which, when selected, attempts to create the library construct by first compiling the code provided in the three files. If compilation fails the reasons are given in the Display Area and the prompt re-appears. When the compilation succeeds, files are copied from the current ANL CFG TYP and CDE/C directories into the corresponding SLIB directories (so you must have write permission in that directory).

`Cancel' aborts the creation, but preserves the code files in the SRC directory.

See also Remove SLIB Construct.


A full on-line help listing is available in the Contents Page
Also available in the form of a complete Index.
Blogo © B-Core (UK) Limited, Last updated: 22 Feb 2002