The input to lnt2lotos is a LOTOS NT file, which
must have the extension .lnt. If the user does not specify the extension
.lnt on the command line, it will be appended automatically and lnt2lotos
will read filename.lnt as input. External C code can be provided by auxiliary
files, namely filename.tnt for data type definitions and filename.fnt for
function definitions.
Typically, the input should have been pre-processed by lpp before being passed to lnt2lotos. The pre-processor expands extended notation such as literal numbers and strings, which is not accepted by lnt2lotos directly.
The output is a LOTOS library or LOTOS specification.
When lnt2lotos is called with the -root option and the name of an instantiation,
or when the input specification contains a process called MAIN without
value parameters, lnt2lotos will generate a LOTOS specification. In all
other cases, lnt2lotos will generate a LOTOS library. Two auxiliary files
are also generated, namely filename.t, which contains C code for external
data types, and filename.f, which contains C code for external functions.
Note that filename.t includes filename.tnt (if present), and that filename.f
includes filename.fnt (if present).
To avoid confusion between source code
and generated code, all output files created by lnt2lotos will be placed
in a special directory that lnt2lotos creates if it does not exist already.
If the creation of the direcory fails, lnt2lotos issues an error message
and stops. The name of this directory is either given by the environment
variable $LNTGEN, if this variable is set, or is ./LNTGEN. Note that ./LNTGEN
(or $LNTGEN) is created relative to the directory from which the user calls
lnt2lotos, not relative to the directory containing the input file.
The
name of the input file is used to construct the names of the output files,
with the particular rule that all letters are turned to upper case when
constructing the names of .lib files. For an input file example.lnt, lnt2lotos
creates the LOTOS library EXAMPLE.lib or the LOTOS specification example.lotos,
and two auxiliary files example.t and example.f. To avoid clashes between
generated files and user-written files, lnt2lotos writes a special tag at
the beginning of each generated file. This tag is a comment containing the
name and the version of lnt2lotos that generated the file. lnt2lotos uses
this tag for two purposes:
P [G1, ..., Gn] of process P with gate identifiers [G1, ..., Gn]
lnt2lotos would produce a specification specification P [G1, ..., Gn] : exit
with a behaviour behaviour P [G1, ..., Gn] where .... If the list of gates [G1,
..., Gn] is omitted, the list of formal gate parameters of the process P is
used instead. The process P, of which there can be exactly one (processes
cannot be overloaded in LOTOS NT), should have no value parameters at all.
If the option ``-root -'' is specified (that is, the instantiation is specified
as ``-''), this indicates that there is no main process (even if there is a
process called MAIN), and lnt2lotos will generate a LOTOS library.