/usr/share/titan/help/info/set.html is in eclipse-titan 6.3.1-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 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 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | <!--
Copyright (c) 2000-2017 Ericsson Telecom AB
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
Baji, Laszlo
Balasko, Jeno
Baranyi, Botond
Csorba, Mate
Farkas, Laszlo
Gecse, Roland
Szabados, Kristof
Szabo, Janos Zoltan – initial implementation
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-us">
<title>set</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="sender.html" alt="previous"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td>
<td><a href="setencode.html" alt="next"><img border="0" src="../images/right.jpg" width="53" height="40"></a></td>
</tr>
</table>
<p><br clear="all">
</p>
<hr>
<h1>set</h1>
<hr align="left" width="75%">
<p>The keyword denotes a structured type representing an unordered sequence of elements, i.e., the ordering of the set fields is not significant. Each element consists of a type and an identifier.
<ul>
<li>The set may contain <a href="#Example 1">optional elements</a> which may or may not be present when assigning value to the constructs.</li>
<li>Element type can be any basic or user-defined data type.</li>
<li>More elements can have same type as long as their identifiers differ.</li>
<li>Elements of the set may be accessed using the <a href="#Example 2">dot notation</a> or <a href="#Example 3">assignment notation</a>.</li>
<li>The <a href="#Example 5">sizeof()</a> predefined function returns the actual size of the set type parameter, constant, variable or template.</li>
<li>The <a href="#Example 6">ispresent()</a> predefined function returns the Boolean value true if the referenced optional field is present in the set.</li>
<li>A <a href="#Example 7">set of the same element type</a> may be defined using the keyword <font face="Courier New" color="#003258" size="4"><b>of</b></font>. </li>
</ul>
<p>Related keywords:</p>
<ul>
<li><a href="address.html"><font face="Courier New" color="#003258" size="4"><b>address</b></font></a></li>
<li><a href="length.html"><font face="Courier New" color="#003258" size="4"><b>length</b></font></a></li>
<li><a href="sizeof.html"><font face="Courier New" color="#003258" size="4"><b>sizeof</b></font></a></li>
<li><a href="of.html"><font face="Courier New" color="#003258" size="4"><b>of</b></font></a></li>
<li><a href="omit.html"><font face="Courier New" color="#003258" size="4"><b>omit</b></font></a></li>
<li><a href="optional.html"><font face="Courier New" color="#003258" size="4"><b>optional</b></font></a></li>
<li><a href="type.html"><font face="Courier New" color="#003258" size="4"><b>type</b></font></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>type set</b> </font> (<i>identifier </i> | <font face="Courier New" color="#003258" size="5"><b>address</b></font>)<font
face="Courier New" color="#003258" size="5"><b> {</b></font> <i>type_reference</i> <i>element_identifier</i> [ <font face="Courier New" color="#003258" size="5"><b>optional</b></font>
] ... <font face="Courier New" color="#003258" size="5"><b>};</b></font></h3>
</td>
</tr>
</table>
</center>
</div>
<ul>
<li>
<p>The <a href="type.html"><font face="Courier New" color="#003258" size="4"><b>type</b></font></a> <font face="Courier New" color="#003258" size="4"><b>set</b></font> keywords
introduce the type definition.</p>
</li>
<li>
<p><i>identifier</i> is the name used to refer to the set. Must begin with a letter, may contain letters, numbers and underscore characters.</p>
</li>
<li>
<p><a href="address.html"><font face="Courier New" color="#003258" size="4"><b>address</b></font></a> is a user defined type to allow addressing specific entities inside the
System Under Test.</p>
</li>
<li>
<p><i>type_reference</i> refers to an already defined (structured or simple) <a href="type.html">type</a>.</p>
</li>
<li>
<p><i>element_identifier</i> identifies the elements of the set. The identifiers must be unique within the same set</p>
</li>
<li>
<p><b>...</b> indicates that <i>type_reference</i> <i>element_identifier</i> pairs may be repeated. They are separated by comma.</p>
</li>
</ul>
<hr align="left" width="75%">
<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>type set</b> </font> [ <font face="Courier New" color="#003258" size="5"><b>length (</b></font><i>set_size</i><font
face="Courier New" color="#003258" size="5"><b>)</b></font> ] <font face="Courier New" color="#003258" size="5"> <b>of</b> </font> <i>type_reference</i> <i>identifier</i> <font
face="Courier New" color="#003258" size="5"><b>};</b></font></h3>
</td>
</tr>
</table>
</center>
</div>
<ul>
<li>
<p>The <a href="type.html"><font face="Courier New" color="#003258" size="4"><b>type</b></font></a> <font face="Courier New" color="#003258" size="4"><b>set of</b></font>
keywords introduce the type definition.</p>
</li>
<li>
<p>The optional <a href="length.html"><font face="Courier New" color="#003258" size="4"><b>length</b></font></a> keyword denotes that the size of the set is restricted.</p>
</li>
<li>
<p><i>set_size</i> is the size restriction. When a single integer value is given, it specifies the exact size of the set. When two integer values are given (separated by two dots), the minimal
and the maximal length of the set are given.</p>
</li>
<li>
<p><i>type_reference</i> refers to an already defined (structured or simple) <a href="type.html">type</a>.</p>
</li>
<li>
<p><i>identifier</i> is the name used to refer to the set. Must begin with a letter, may contain letters, numbers and underscore characters.</p>
</li>
</ul>
<hr align="left" width="50%">
<p><a name="Example 1">Example 1</a>: type definition
<p><font face="Courier New">type set MySetType { <br>
integer Number1 optional,<br>
integer Number2,<br>
charstring String<br>
}</font>
<p>The set called MySetType consists of three elements. There are two fields of type integer having the identifier Number1 (optional) and Number2 . There is one field of type character string and
having the identifier String.</p>
<hr align="left" width="50%">
<p><a name="Example 2">Example 2</a>: dot notation (For the type definition see example 1)
<p><font face="Courier New">var MySetType v_mySet; <br>
v_mySet.Number1 := omit;<br>
v_mySet.Number2 := 12;</font>
<p>The variable v_mySet of type MySetType is defined. The first field (Number1) is omitted and the value 12 is assigned to the field Number2.</p>
<hr align="left" width="50%">
<p><a name="Example 3">Example 3</a>: assignment notation (For the type and variable definition see example 1 & 2)
<p><font face="Courier New">v_mySet := {Number2 := 112};</font>
<p>The value 112 is assigned to the field Number2. </p>
<hr align="left" width="50%">
<p><a name="Example 5">Example 4</a>: the predefined function sizeof()</p>
<p><font face="Courier New">v_mySet := {Number1 := omit, Number2 := 191, String := "s"};<br>
var integer v_Stk := sizeof (v_mySet);</font>
<p>The variable v_Stk equals two as there are two elements in v_mySet (the first one is omitted).</p>
<hr align="left" width="50%">
<p><a name="Example 6">Example 5</a>: the predefined function ispresent()</p>
<p><font face="Courier New">v_mySet := {Number1 := omit, Number2 := 191, String := "s"};<br>
var boolean v_kukuccs := ispresent (v_mySet.Number1);</font>
<p>The variable v_kukuccs equals false as there the referenced element in v_mySet (Number1) is omitted.</p>
<hr align="left" width="50%">
<p><a name="Example 7">Example 6</a>: set of the same element type </p>
<p><font face="Courier New">type set length (3) of integer IntegerList;<br>
var IntegerList v_il := {71, 92, 83};<br>
var integer v_elem := v_il[1];</font>
<p>A set of three integers is defined. The set is called IntegerList. <br>
To assign values to the elements of the set, value list notation is used. The elements of the set will have the value 71, 92 and 83, respectively. <br>
Individual elements of the set may be accessed using the array notation. In the example above the variable v_elem will have the value 92.</p>
<hr align="left" width="25%">
<hr align="left" width="25%">
<p><a HREF="BNF.html#setdef">BNF definition</a> of <font face="Courier New"> set</font><br>
<a HREF="BNF.html#setofdef">BNF definition</a> of <font face="Courier New">set of</font></p>
</body>
</html>
|