Titan



with


The statement is used to associate attributes with TTCN-3 language elements. The syntax for the argument of the statement (i.e. the actual attributes) is defined as a free text string.

There are four kinds of attributes:

Related keywords:


with { display | encode | variant | extension [ override ] [ (qualifier) ] "argument"};

It is possible to specify several arguments in one with statement by using semicolons to separate the groups of the attribute keyword, qualifier and argument. 
When an attribute has more than one arguments, the arguments are separated by commas.


Example 1:

type record SinlgeRecord { 
   bitstring fram,
   bitstring till
} with { variant (fram) "FIELDLENGTH(2)" }

The first field of the record (fram) will be coded on 2 bits.


Example 2:

type octetstring OCT10 with { variant "ALIGN(left)"; variant "FIELDLENGTH(10)" }

The octetstring OCT10 will be coded left-aligned on ten bits.


Example 3:

type integer NewInt with { variant "FIELDLENGTH(8), BITORDERINFIELD(msb)" }

The type NewInt will be coded on eight bit and the most significant bit will be sent first.



BNF definition of with