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