IBM
Contents Index Previous Next



TTCN Suite Preprocessor


The TTCN Suite preprocessor is a text processor that manipulates the text of a TTCN table as part of the first phase of Analyzing. TTCN Suite preprocessor allows you to produce different ETS code depending on the flags set. The syntax of TTCN Suite preprocessor directives is similar to directives for a C preprocessor:

#if <expr>
....
[#else]
...
#endif

<expr> ::= defined(<flag>) | '!' <expr> | <expr> 
'||' <expr> | <expr> '&&' <expr> | (expr)

Figure 209 : Example of preprocessor directives

These directives can be used in every editable field, not different from TTCN and ASN.1 definitions. The `#if' directive and its corresponding `#endif' directive must be placed within the same field, except when they are used in the body of a TTCN table that may consist of several rows. In this case it is allowed to use directives `#if', `#else' and `#endif' in separate rows, and only one such directive in the first field is allowed in such a row. The scope of such a directive will be all rows between.

The defined flags for Analysis and Code Generation are set in the Analyzer options (see The Analyzer Dialog) The flags can also be set via options `-i' and `-I' from a command line session (see Running the TTCN to C Compiler from the Command Line).


http://www.ibm.com/rational
Contents Index Previous Next