genom3
generates the source code of the software components described in
the formal description file.gen input file.
The input file.gen is expected to contain the description of the services, input and output ports, data types definitions and execution contexts of a software component, written in the dotgen language.
The dotgen specification is first processed by a C preprocessor before it is
parsed by genom3
and transformed into an abstract syntax tree. The program used
as a C preprocessor can be changed with the CPP
environment variable.
genom3
accepts -I
and -D
options that are passed inchanged to
the cpp program.
The abstract syntax tree is exported in a format suitable to a
generator engine that is in charge of a template execution for
actual source code generation. The generator engine provides a scripting
language and a set of procedures for use by templates. The directory where
source code for the generator engine is searched can be changed with the
-s
option.
Templates are a set of source files that serve as the basis for source code
generation. Templates source files are interpreted by the generator engine. They
can contain code written in the scripting language provided by the generator
engine, that computes generated output, or regular source code that is appended
directly to the generated code. Intermediate files and scripts are saved in a
temporary directory before they are copied to the final destination
directory. The -T
option changes the path of the temporary
directory. The -d
option will keep all temporary files instead of
deleting them once the program terminates. This is useful only for template
development and debugging.
The choice of a template depends on the kind of source code that is wanted by
the user. Refer to the documentation of the templates for a description on what
they do. The names of the available templates can be listed with the -l
option. The directory in which templates are looked for can be changed with the
-t
option.
The genom3
program accepts general options that affect the general program
behaviour. genom3
can also pass template options to the template. These
options will only affect the template behaviour.