compiler(1)

๐Ÿ’– compiler(1) ๐Ÿ’–

manual section 1 ยท TTCN-3 Tools ยท bestie edition ๐ŸŽ€

okay so. hi. welcome to compiler(1), the TTCN-3 Tools glow-up of a manual page, and honestly? she's iconic. this is the quick-reference for the TTCN-3 and ASN.1 to C++ translator (and yes she also does JSON schema now, we love a multi-hyphenate ๐Ÿ‘‘).


โœจ NAME โœจ

compiler โ€” TTCN-3 and ASN.1 to C++ translator. she takes your TTCN-3 and your ASN.1 and turns them into C++, no cap. ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

like, here's how you actually call her:

compiler [ -abcdDeEfFghiIjklLMnNpqrRsStuwxXyY0 ] [ -V  verb_level ] [ -J
 file ] [ -K  file ] [ -z  file ] [ -o  dir ] [ -P  top_level_pdu ] ...
[ -Q n ] [ -U none|type|'number' ] [ -T ] module.ttcn ...  [ -A ]
module.asn ...  [ - module.ttcn ... module.asn ... ]

or

compiler -v

or

compiler --ttcn2json [ -jf ] [ -T ] module.ttcn ...  [ -A ] module.asn
...  [ - schema.json  ]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so 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. she's giving โœจutilityโœจ, she's giving ๐Ÿซถ handyโœจ.

ngl, real talk: this page only summarizes the meaning of all command line options. that's it, that's the assignment. it is not the whole lore.

if you want the full deep dive โ€” the lore, the backstory, the whole main-character arc โ€” please consult the Programmer's Technical Reference for TITAN TTCN-3 Test Executor. she's the director's cut. ๐ŸŽฌ

to be continued, bestie โ€” there's more of this page coming ๐Ÿ‘€๐Ÿ’–

โœจ OPTIONS โœจ

okay bestie, here's the full menu, in alphabetical order like the original nerds intended ๐Ÿ’… every single one, no skips, we're eating the whole plate ๐Ÿฝ๏ธโœจ

  • -A file โ€” forces the compiler to read file as an ASN.1 module ๐Ÿฆ‹ super handy when the automatic module type detection ghosts you because of some strange language constructs. Takes exactly ONE file name as its argument, so if you've got multiple files you gotta repeat the option for each one. See also: option -T.
  • -a โ€” force XER in ASN.1 files โœจ
  • -b โ€” turns OFF generating BER encoder/decoder routines for all ASN.1 types ๐Ÿšซ
  • -B โ€” lets the selected field in a union value be unbound when you're setting module parameters (the legacy behavior, bestie, we're being retro). A warning pops up whenever a union value receives an unbound selected field, and also when a union with an unbound selected field gets copied ๐Ÿ‘€
  • -c โ€” write out checksums when there's an error ๐Ÿงฎ
  • -d โ€” treat ASN.1 SEQUENCE/SET fields that have DEFAULT values as omit in TTCN-3 ๐Ÿซถ
  • -D โ€” disable generating those user and time information comments in the output C++ code ๐Ÿšซ๐Ÿ•
  • -e โ€” enforce legacy handling of encode and variant attributes ๐Ÿ•ฐ๏ธ
  • -E โ€” tells the variant attribute parser to show warnings instead of errors for unrecognized/erroneous attributes ๐Ÿซฃ
  • -f โ€” forces the compiler to overwrite the output files even if they already exist or are totally unchanged ๐Ÿ”ฅ no more "hmm should I?" energy
  • -F โ€” forces the compiler to generate the FULL C++ classes for records of/sets of basic types (that's boolean, integer, float, bitstring, hexstring, octetstring, charstring and unversal charstring) ๐Ÿ’… without this, only type aliases to pre-generated classes get generated for those types. This also disables the type compatibility between records of/sets of basic types in the Load Test Runtime. big deal, no cap.
  • -g โ€” compiler error/warning messages will contain only the starting line number and column, in a format compatible with the GNU compiler (gcc) ๐Ÿง and heads up: -g takes precedence over -i if you specify both, so -g is the main character here ๐Ÿ‘‘
  • -h โ€” allows unsafe universal charstring to charstring conversion ๐Ÿ˜ญ literally playing with fire but okay
  • -i โ€” compiler error/warning messages will contain only the line numbers, column numbers stay hidden ๐Ÿ™ˆ this one exists for backward compatibility with the error message format of earlier versions
  • -I โ€” enables real-time testing features โฑ๏ธโœจ
  • -j โ€” disables JSON encoder/decoder functions ๐Ÿšซ๐Ÿช„
  • -J file โ€” read a list of input files from the file you provided ๐Ÿ“‹
  • -k โ€” enables object-oriented features ๐Ÿงฌโœจ
  • -K file โ€” enables selective code coverage ๐Ÿ“Š
  • -l โ€” tells the compiler to generate source file and line information (aka #line directives) into the output C++ code so that C++ compiler error messages point back to the lines of the original TTCN-3 input module ๐Ÿ”™
๐Ÿšจ bestie listen: this option is obsolete and will be removed in future versions, since the compiler doesn't generate erroneous C++ code anyway because of the full semantic analysis. rip bozo ๐Ÿ’€
  • -L โ€” tells the compiler to add source file and line number information into the generated code so it can be included in the log during execution ๐Ÿ“ but that's ONLY a prerequisite for logging the source code information. Options SourceInfoFormat and LogEntityName also have to be set appropriately in section [LOGGING] of the runtime configuration file, so don't forget those or it's giving nothing ๐Ÿ’… Using this option enlarges the size of the generated code a bit and slightly reduces execution speed. And it is not recommended when the TTCN-3 test suite is used for load generation ๐ŸŒช๏ธ
  • -M โ€” allows the use of the value omit in template lists and complemented template lists (legacy behavior, we love a throwback). If it's 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.
  • -n โ€” activates the debugger and generates extra code for storing debug information ๐Ÿ›๐Ÿ”
  • -N โ€” ignore UNTAGGED encoding instruction on top level unions (legacy behaviour) ๐Ÿ•ฐ๏ธ
  • -o dir โ€” the output files (including Test Port skeletons ๐Ÿ’€ yes skeletons) will be placed into the directory specified by dir. Otherwise the current working directory is the default.
  • -p โ€” tells the compiler to ONLY parse the given TTCN-3 and ASN.1 modules ๐Ÿ” this detects only syntax errors because semantic checkings are not performed. The presence of all imported modules is not necessary, so it's allowed (and recommended!) to parse the modules one-by-one ๐ŸŽ€ All options that influence 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 can't even be parsed without semantic analysis. So there's no guarantee that an ASN.1 module is free of syntax errors if it was analyzed with compiler using the -p flag. sorry bestie, that's just how it is ๐Ÿ˜ญ
  • -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, and the other ASN.1 assignments are skipped ๐Ÿ’จ
  • -q โ€” quiet mode ๐Ÿคซ equivalent with -V 0.
  • -Qn โ€” quits after n errors โœ‹
  • -r โ€” disables generating RAW encoder/decoder routines for all TTCN-3 types ๐Ÿšซ
  • -R โ€” use function test runtime (TITAN_RUNTIME_2) โš™๏ธ the compiler will generate source code for use with function test runtime.
  • -s โ€” tells the compiler to parse the given TTCN-3 and ASN.1 modules and do semantic analysis on them, but NOT generate C++ output ๐Ÿง ๐Ÿšซ The list of given modules shall be complete, so it is not allowed to import from a module that isn't in the list. All options that influence code generation are silently ignored when used together with -s.
  • -S โ€” suppresses context information ๐Ÿ™ˆ
  • -t โ€” generates Test Port and External Class skeleton header and source files for all port types and external class types that can be found in the input TTCN-3 modules ๐Ÿ’€โœจ Existing Test Port and External Class files will NOT be overwritten unless the -f option is used, so respect the existing files bestie.
  • -T file โ€” forces the compiler to read file as a TTCN-3 module ๐Ÿฆ‹ See also: option -A.
  • -u โ€” 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|'number' โ€” selects the code splitting mode for the generated C++ code ๐Ÿ”ช 'number' should be a positive number between 1 and 999999. If 'number' is present, the files will be sliced into 'number' files ๐Ÿฐ
  • -v โ€” 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 the bits, bestie, listen close:

  • 1: "NOT SUPPORTED" messages ๐Ÿ˜ฌ
  • 2: WARNING messages โš ๏ธ
  • 4: NOTIFY messages ๐Ÿ””
  • 32|16|8: DEBUG messages ๐Ÿ›
    • The debug-bits act like a 3-bits-length number, so the debug level has a value between 0 and 7. It's useful in case of abnormal program termination ๐Ÿ’€
  • -w โ€” suppresses ALL warning messages ๐Ÿค equivalent with -V 4.
  • -x โ€” disables generating TEXT encoder/decoder routines for all TTCN-3 types ๐Ÿšซ๐Ÿ“
  • -X โ€” disable XER encoder/decoder functions ๐Ÿšซ
  • -y โ€” disable subtype checking ๐Ÿšซ๐Ÿ”Ž
  • -Y โ€” 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 ๐Ÿซถ
  • -0 โ€” disables attribute checks for encvalue and decvalue ๐Ÿšซโœ… must be used together with option -s. no solo runs, it's a duo.
  • - โ€” 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 tells 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 wasn't present in the list before the dash. And if the single dash isn't present in the command line at all, the compiler will generate code for all modules. generous queen.
  • --ttcn2json โ€” 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:
    • -j โ€” only types that have JSON coding enabled are included in the schema โœจ
    • -f โ€” 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's 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) ๐Ÿ’…

๐Ÿšช EXIT STATUS ๐Ÿšช

The compiler exits with a status of zero when no errors were encountered during its operation ๐ŸŽ‰ zero, slay, we love to see it.

A status of one will be returned if syntax or semantic errors were detected in the input modules ๐Ÿ˜ญ we do NOT love to see it but it happens.

๐ŸŒธ ENVIRONMENT VARIABLES ๐ŸŒธ

ok so bestie, these are the lil environment thingies the compiler peeks at ๐Ÿ‘€ set them or don't, but if you need them, here's the tea:

  • TTCN3_DIR โ€” this one is the installation directory, like, the place where the uncompressed binary package of the TTCN-3 Test Executor is chillin'. That's where it lives. Go find it there. ๐Ÿ’–
  • TTCN3_LICENSE_FILE โ€” okay this is the important one, pay attention: it has to point to the file, not the directory it's in, that contains the personalized license key for whoever's using it rn โ€” either the current user or the host. NB means nota bene which is fancy latin for "bestie pls read this part". The file itself. Not the folder. The FILE. ๐ŸŽ€

๐Ÿ’€ BUGS ๐Ÿ’€

ngl, this is the part nobody wants to write but somebody has to, so here we go:

The compiler does not support all constructs of TTCN-3 Core Language and ASN.1. Like, not even close to all of them. And when it bumps into a language element it doesn't know how to handle? It just reports an error. That's it. That's the whole vibe. ๐Ÿ˜ญ

If you wanna see the full receipts โ€” the detailed list of deficiencies and language extensions โ€” it's all in the referenced documentation. So go read that, bestie. It's giving "required reading" energy fr fr.

For trouble reporting, use the tool MHWEB. And for the TR writers guide? Please visit the web page: http://ttcn.ericsson.se โœจ


๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘

the required reading list, aka the lore you need to know ๐Ÿ“š:

  • Ericsson document 2/198 17-CRL 113 200 Uen: โ€” Programmer's Technical Reference for TITAN TTCN-3 Test Executor
  • ETSI Standard ES 201-873-1: โ€” Testing and Test Control Notation: TTCN-3 Core Language
  • ITU-T Recommendations X.680-683: โ€” Abstract Syntax Notation One (ASN.1)

all iconic, all worth your time, no cap ๐Ÿซถ


๐ŸŒˆ AUTHOR ๐ŸŒˆ

This manpage is written by Janos Zoltan Szabo, Ericsson Telecom AB. Give them their flowers, they earned them ๐Ÿ’

Copyright (c) 2000-2021 Ericsson Telecom AB

All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 which accompanies this distribution, and is available at https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html โญ


and that's a wrap on compiler(1) bestie!! ๐Ÿ’… this beauty comes to you from Ericsson Telecom AB, dated January 2021, and the page you just read is literally titled compiler(1) โ€” go forth and compile, you absolute main character ๐Ÿ‘‘๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from