with.html 5.49 KB
Newer Older
Elemer Lelik's avatar
Elemer Lelik committed
1
<!--
balaskoa's avatar
balaskoa committed
2
 Copyright (c) 2000-2020 Ericsson Telecom AB
Elemer Lelik's avatar
Elemer Lelik committed
3
 All rights reserved. This program and the accompanying materials
4
 are made available under the terms of the Eclipse Public License v2.0
Elemer Lelik's avatar
Elemer Lelik committed
5
 which accompanies this distribution, and is available at
6
 https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
Elemer Lelik's avatar
Elemer Lelik committed
7
8
9
10
11
12

 Contributors:
  Baji, Laszlo
  Balasko, Jeno
  Farkas, Laszlo
  Szabados, Kristof
13
  Nagy, Lenard
Elemer Lelik's avatar
Elemer Lelik committed
14
-->
Elemer Lelik's avatar
Elemer Lelik committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-us">
<title>with</title>
</head>
<body bgcolor="#DAD3C5" vlink="#0094D2" link="#003258">
<table align="left" border="0" cellspacing="0" cellpadding="0" valign=top>
  <tr>
    <td width=105 height=40><a href="https://projects.eclipse.org/projects/tools.titan"><img src="../images/titan_transparent.gif" border=0 width=105 height=40 align="left" alt="Titan"></a></td>
  </tr>
</table>
<table border="0" align="right" cellpadding="0" cellspacing="0">
  <tr>
    <td><a href="../titan_main.html" alt="contents"><img border="0" src="../images/ao.jpg" width="53" height="40"></a></td>
    <td><a href="../titan_index.html" alt="index"><img border="0" src="../images/up.jpg" width="53" height="40"></a></td>
    <td><a href="while.html" alt="previous"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td>
balaskoa's avatar
balaskoa committed
32
    <td><a href="with_pwtc.html" alt="next"><img border="0" src="../images/right.jpg" width="53" height="40"></a></td>
Elemer Lelik's avatar
Elemer Lelik committed
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
  </tr>
</table>
<p><br clear="all">
</p>
<hr>
<h1>with</h1>
<hr align="left" width="75%">
<p>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.
<p>There are four kinds of attributes:
<ul>
  <li><b><font face="Courier New" color="#003258" size="4">display</font></b>: allows the specification of display attributes related to specific presentation formats;&nbsp;</li>
  <li><b><font face="Courier New" color="#003258" size="4">encode</font></b>: allows references to specific encoding rules;&nbsp;</li>
  <li><b><font face="Courier New" color="#003258" size="4">variant</font></b>: allows references to specific encoding variants;&nbsp;</li>
  <li><b><font face="Courier New" color="#003258" size="4">extension</font></b>: allows the specification of user-defined attributes.</li>
</ul>
<p>Related keywords:</p>
<ul>
  <li><a href="display.html"><b><font face="Courier New" color="#003258" size="4">display</font></b></a></li>
  <li><a href="encode.html"><b><font face="Courier New" color="#003258" size="4">encode</font></b></a></li>
  <li><a href="extension.html"><b><font face="Courier New" color="#003258" size="4">extension</font></b></a></li>
  <li><a href="override.html"><b><font face="Courier New" color="#003258" size="4">override</font></b></a></li>
  <li><a href="variant.html"><b><font face="Courier New" color="#003258" size="4">variant</font></b></a>:</li>
</ul>
<hr align="left" width="50%">
<div align="center">
<center>
<table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
  <tr>
    <td width="100%">
    <h3 align="center"><font face="Courier New" color="#003258" size="5"><b>with { display</b></font> | <font face="Courier New" color="#003258" size="5"><b>encode</b></font> | <font
      face="Courier New" color="#003258" size="5"><b>variant</b></font> | <font face="Courier New" color="#003258" size="5"><b>extension</b></font> [ <font face="Courier New" color="#003258" size="5"><b>override</b></font>
    ] [ <font face="Courier New" color="#003258" size="5"><b>(</b></font><i>qualifier</i><font face="Courier New" color="#003258" size="5"><b>)</b></font> ] <font face="Courier New" color="#003258"
      size="5"><b>&quot;</b></font><i>argument</i><b><font face="Courier New" color="#003258" size="5">&quot;};</font></b></h3>
    </td>
  </tr>
</table>
</center>
</div>
<ul>
  <li>
  <p>the optional <b><font face="Courier New">override</font></b> directive forces all contained types at all lower scopes to be forced to the specified attribute.</p>
  </li>
  <li>
  <p>the optional <i>qualifier</i> points out the entity for which the argument is valid.</p>
  </li>
  <li>
  <p><i>argument</i> is a free-text string specifying the actual attribute.</p>
  </li>
</ul>
<p>It is possible to specify several arguments in one <b><font face="Courier New">with</font></b> statement by using semicolons to separate the groups of the attribute keyword, qualifier and
argument.&nbsp;<br>
When an attribute has more than one arguments, the arguments are separated by commas.</p>
<hr align="left" width="50%">
<p>Example 1:
<p><font face="Courier New">type record SinlgeRecord {&nbsp;<br>
&nbsp;&nbsp;&nbsp;bitstring fram,<br>
&nbsp;&nbsp;&nbsp;bitstring till<br>
} with { variant (fram) &quot;FIELDLENGTH(2)&quot; }</font>
<p>The first field of the record (fram) will be coded on 2 bits.</p>
<hr align="left" width="25%">
<p>Example 2:
<p><font face="Courier New">type octetstring OCT10 with { variant &quot;ALIGN(left)&quot;; variant &quot;FIELDLENGTH(10)&quot; }</font>
<p>The octetstring OCT10 will be coded left-aligned on ten bits.</p>
<hr align="left" width="25%">
<p>Example 3:
<p><font face="Courier New">type integer NewInt with { variant &quot;FIELDLENGTH(8), BITORDERINFIELD(msb)&quot; }</font>
<p>The type NewInt will be coded on eight bit and the most significant bit will be sent first.</p>
<hr align="left" width="25%">
<hr align="left" width="25%">
<p><a HREF="BNF.html#withstatement">BNF definition</a> of <font face="Courier New"> with</font></p>
</body>
</html>