Merge github.com:eclipse/titan.core
[deliverable/titan.core.git] / help / info / with.html
CommitLineData
970ed795 1<!--
d44e3c4f 2 Copyright (c) 2000-2016 Ericsson Telecom AB
970ed795
EL
3 All rights reserved. This program and the accompanying materials
4 are made available under the terms of the Eclipse Public License v1.0
5 which accompanies this distribution, and is available at
6 http://www.eclipse.org/legal/epl-v10.html
d44e3c4f 7
8 Contributors:
9 Baji, Laszlo
10 Balasko, Jeno
11 Farkas, Laszlo
12 Szabados, Kristof
13-->
970ed795
EL
14<html>
15<head>
16<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
17<meta http-equiv="Content-Language" content="en-us">
18<title>with</title>
19</head>
20<body bgcolor="#DAD3C5" vlink="#0094D2" link="#003258">
21<table align="left" border="0" cellspacing="0" cellpadding="0" valign=top>
22 <tr>
23 <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>
24 </tr>
25</table>
26<table border="0" align="right" cellpadding="0" cellspacing="0">
27 <tr>
28 <td><a href="../titan_main.html" alt="contents"><img border="0" src="../images/ao.jpg" width="53" height="40"></a></td>
29 <td><a href="../titan_index.html" alt="index"><img border="0" src="../images/up.jpg" width="53" height="40"></a></td>
30 <td><a href="while.html" alt="previous"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td>
31 <td><a href="xor.html" alt="next"><img border="0" src="../images/right.jpg" width="53" height="40"></a></td>
32 </tr>
33</table>
34<p><br clear="all">
35</p>
36<hr>
37<h1>with</h1>
38<hr align="left" width="75%">
39<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.
40<p>There are four kinds of attributes:
41<ul>
42 <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>
43 <li><b><font face="Courier New" color="#003258" size="4">encode</font></b>: allows references to specific encoding rules;&nbsp;</li>
44 <li><b><font face="Courier New" color="#003258" size="4">variant</font></b>: allows references to specific encoding variants;&nbsp;</li>
45 <li><b><font face="Courier New" color="#003258" size="4">extension</font></b>: allows the specification of user-defined attributes.</li>
46</ul>
47<p>Related keywords:</p>
48<ul>
49 <li><a href="display.html"><b><font face="Courier New" color="#003258" size="4">display</font></b></a></li>
50 <li><a href="encode.html"><b><font face="Courier New" color="#003258" size="4">encode</font></b></a></li>
51 <li><a href="extension.html"><b><font face="Courier New" color="#003258" size="4">extension</font></b></a></li>
52 <li><a href="override.html"><b><font face="Courier New" color="#003258" size="4">override</font></b></a></li>
53 <li><a href="variant.html"><b><font face="Courier New" color="#003258" size="4">variant</font></b></a>:</li>
54</ul>
55<hr align="left" width="50%">
56<div align="center">
57<center>
58<table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
59 <tr>
60 <td width="100%">
61 <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
62 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>
63 ] [ <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"
64 size="5"><b>&quot;</b></font><i>argument</i><b><font face="Courier New" color="#003258" size="5">&quot;};</font></b></h3>
65 </td>
66 </tr>
67</table>
68</center>
69</div>
70<ul>
71 <li>
72 <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>
73 </li>
74 <li>
75 <p>the optional <i>qualifier</i> points out the entity for which the argument is valid.</p>
76 </li>
77 <li>
78 <p><i>argument</i> is a free-text string specifying the actual attribute.</p>
79 </li>
80</ul>
81<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
82argument.&nbsp;<br>
83When an attribute has more than one arguments, the arguments are separated by commas.</p>
84<hr align="left" width="50%">
85<p>Example 1:
86<p><font face="Courier New">type record SinlgeRecord {&nbsp;<br>
87&nbsp;&nbsp;&nbsp;bitstring fram,<br>
88&nbsp;&nbsp;&nbsp;bitstring till<br>
89} with { variant (fram) &quot;FIELDLENGTH(2)&quot; }</font>
90<p>The first field of the record (fram) will be coded on 2 bits.</p>
91<hr align="left" width="25%">
92<p>Example 2:
93<p><font face="Courier New">type octetstring OCT10 with { variant &quot;ALIGN(left)&quot;; variant &quot;FIELDLENGTH(10)&quot; }</font>
94<p>The octetstring OCT10 will be coded left-aligned on ten bits.</p>
95<hr align="left" width="25%">
96<p>Example 3:
97<p><font face="Courier New">type integer NewInt with { variant &quot;FIELDLENGTH(8), BITORDERINFIELD(msb)&quot; }</font>
98<p>The type NewInt will be coded on eight bit and the most significant bit will be sent first.</p>
99<hr align="left" width="25%">
100<hr align="left" width="25%">
101<p><a HREF="BNF.html#withstatement">BNF definition</a> of <font face="Courier New"> with</font></p>
102</body>
103</html>
This page took 0.027412 seconds and 5 git commands to generate.