Next: , Up: Input file format


5.1 Preprocessing

A dotgen specification consists of one or more files that are preprocessed. The preprocessing is controlled by directives introduced by lines having # as the first character other than white space. Preprocessor directives have their own syntax (namely, the C preprocessor syntax), independent of the dotgen language and not entirely described in this document. For instance, see The C preprocessor for a comprehensive documentation.

The C preprocessor used by GenoM is invoked as a separate process from libexec/genom-pcpp by default. This is the C preprocessor from the pcc project (http://pcc.ludd.ltu.se/). This can be changed by setting the environement variable CPP, See Environment variables. However, note that if you change the default, you will loose some functionalities of the genom-pcpp program. See #pragma requires.

The primary use of the preprocessing facility is to include definitions (especially type definitions) from other dotgen specifications. Directives may appear anywhere in the source file but are not seen nor interpreted by GenoM. For instance, text in files included with a #include directive is treated as if it appeared in the including file. However, the preprocessor outputs some information, also as # directives, that are available to GenoM. These are described in the following sections.