compiler(1) TTCN-3 and ASN.1 to C++ translator


compiler [ -abcdfgijlLMpqrRsStuwxXyY ] [ -V verb_level ] [ -K file ] [ -z file ] [ -o dir ] [ -P top_level_pdu ] ... [ -Q n ] [ -U none|type ] [ -T ] module.ttcn ... [ -A ] module.asn ... [ - module.ttcn ... module.asn ... ]
compiler -v
compiler --ttcn2json [ -jf ] [ -T ] module.ttcn ... [ -A ] module.asn ... [ - schema.json ]


This manual page is a quick reference for the TTCN-3 and ASN.1 to C++ (or JSON schema) compiler of the TTCN-3 Test Executor. It only summarizes the meaning of all command line options. For more details please consult the Programmer's Technical Reference for TITAN TTCN-3 Test Executor.


The following options are supported (in alphabetical order):
-A file
Forces the interpretation of file as an ASN.1 module. It is useful when automatic module type detection fails due to some strange language constructs. The option takes exactly one file name as argument. The option must be repeated when used with multiple files. See also: option -T.
Force XER in ASN.1 files
Disables the generation of BER encoder/decoder routines for all ASN.1 types.
Write out checksums in case of error
Treat ASN.1 SEQUENCE/SET fields with DEFAULT values as omit in TTCN-3.
Forces the compiler to overwrite the output files even if they exist or are unchanged.
The compiler error/warning messages will contain only the starting line number and column, in a format compatible with th GNU compiler (gcc). -g takes precedence over -i if both are specified.
The compiler error/warning messages will contain only the line numbers, the column numbers will remain hidden. This option provides backward compatibility with the error message format of earlier versions.
Disables JSON encoder/decoder functions.
-K file
Enables selective code coverage.
Instructs the compiler to generate source file and line information (i.e. #line directives) into the output C++ code so that the C++ compiler error messages refer back to the lines of original TTCN-3 input module.
This option is obsolete and will be removed in future versions as the compiler does not generate erroneous C++ code because of the full semantic analysis.
Instructs the compiler to add source file and line source file and line number information into the generated code to be included in the log during execution.
This option is only a prerequisite for logging the source code information. Options SourceInfoFormat and LogEntityName have also to be set appropriately in section [LOGGING] of the run-time configuration file.
Usage of this option a bit enlarges the size of the generated code and slightly reduces execution speed. This flag is not recommended when the TTCN-3 test suite is used for load generation.
Allows the use of the value omit in template lists and complemented template lists (legacy behavior). If set, an omitted field will match a template list, if the value omit appears in the list, and it will match a complemented template list, if omit is not in the list (the ifpresent attribute can still be used for matching omitted fields). This also affects the ispresent operation and the present template restriction accordingly.
-o dir
The output files (including Test Port skeletons) will be placed into the directory specified by dir. The current working directory is the default otherwise.
Instructs the compiler only to parse the given TTCN-3 and ASN.1 modules. This will detect only the syntax errors because semantic checkings are not performed. The presence of all imported modules is not necessary thus it is allowed (and recommended) to parse the modules one-by-one.
All options that influence the code generation are silently ignored when used together with -p.
Note: This option includes complete syntax checks for TTCN-3 modules, but in ASN.1 there are some special constructs (e.g. the user-defined syntaxes) that cannot be even parsed without semantic analysis. So there is no guarantee that an ASN.1 module is free of syntax errors if it was analyzed with compiler using the -p flag.
-P top_level_pdu...
Defines a top-level pdu. top_level_pdu must have the following format: modulename.identifier. If this switch is used, then only the defined top-level PDU(s) and the referenced assignments are checked and included in code generation, the other ASN.1 assignments are skipped.
Quiet mode. Equivalent with -V 0.
Quits after n errors.
Disables the generation of RAW encoder/decoder routines for all TTCN-3 types.
Use function test runtime (TITAN_RUNTIME_2). The compiler will generate source code for use with function test runtime.
Instructs the compiler to parse the given TTCN-3 and ASN.1 modules and perform semantic analysis on them, but not to generate C++ output. The list of given modules shall be complete so it is not allowed to import from a module that is not in the list. All options that influence the code generation are silently ignored when used together with -s.
Suppresses context information.
Generates Test Port skeleton header and source files for all port types that can be found in TTCN-3 modules. Existing Test Port files will not be overwritten unless the -f option is used.
-T file
Forces the interpretation of file as a TTCN-3 module. See also: option -A.
Forces the compiler to do duplicate underscore characters in all output file names. This option turns on the compatibility mode with versions 1.1 or earlier.
-U none|type
Selects code splitting mode for the generated C++ code.
Prints version and license key information and exits.
-V verb_level
Sets the verbosity bit-mask directly to verb_level (where verb_level is a decimal value between 0 and 65535).

Meaning of bits:

"NOT SUPPORTED" messages.
WARNING messages.
NOTIFY messages.
DEBUG messages.
The debug-bits act like a 3-bits-length number, so the debug level has a value between 0 and 7. It is useful in case of abnormal program termination.

Suppresses all warning messages. Equivalent with -V 4.
Disables the generation of TEXT encoder/decoder routines for all TTCN-3 types.
Disable XER encoder/decoder functions
Disable subtype checking
Enforces legacy behaviour of the "out" function parameters (see refguide).
-z file
Enables profiling and code coverage in the selected TTCN-3 files. The file argument contains a list of TTCN-3 files separated by new lines. Each TTCN-3 file must be among the compiler's TTCN-3 file arguments.
The single dash character as command line argument controls the selective code generation option. After the list of all TTCN-3 and ASN.1 modules a subset of these files can be given separated by a dash. This option instructs the compiler to parse all modules, perform the semantic analysis on the entire module hierarchy, but generate code only for those modules that are listed after the dash again.
It is not allowed to specify a file name after the dash that was not present in the list before the dash. If the single dash is not present in the command line the compiler will generate code for all modules.
Generates a JSON schema from the types defined in the specified TTCN-3 and ASN.1 modules. Must always be the first compiler option. From the previously listed options only -T and -A can be used, instead the JSON schema generator has options of its own:
Only types that have JSON coding enabled are included in the schema.
The schema only validates types that have a JSON encoding or decoding method declared.
- file
The single dash character as command line argument specifies the name of the generated JSON schema file. If it is not present, then the schema file name is generated from the name of the first input file (by replacing its suffix with .json or appending .json to the end of the file).


The compiler exits with a status of zero when no errors were encountered during its operation. A status of one will be returned if syntax or semantic errors were detected in the input modules.


The installation directory where the uncompressed binary package of TTCN-3 Test Executor can be found.
It shall point to the file (NB: not to its directory) that contains the personalized license key for the current user or host.


The compiler does not support all constructs of TTCN-3 Core Language and ASN.1. It reports an error when encountering an unsupported language element. The detailed list of deficiencies and language extensions can be found in the referenced documentation.

For trouble reporting use the tool MHWEB. For TR writers guide please visit the web page:


This manpage is written by Janos Zoltan Szabo, Ericsson Telecom AB
Copyright (c) 2000-2015 Ericsson Telecom AB
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at