This file is indexed.

/usr/share/titan/help/info/union.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
<!--
 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
  Csorba, Mate
  Farkas, Laszlo
  Forstner, Matyas
  Szabados, Kristof
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-us">
<title>union</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="unichar2oct.html" alt="previous"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td>
    <td><a href="universal.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>union</h1>
<hr align="left" width="75%">
<p>The keyword denotes a structured type: a collection of fields, each one identified by an identifier. Only one of the specified fields will ever be present in an actual union value.&nbsp;
<ul>
  <li>Union types are useful to model a structure which can take one of a finite number of known types.</li>
  <li>Optional elements are forbidden (they do not make sense).</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 union 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 4">ischosen()</a> predefined function returns the value true if and only if the referenced element of the union type is actually selected for the given union.</li>
</ul>
<p>Related keywords:</p>
<ul>
  <li><a href="type.html"><font face="Courier New" color="#003258" size="4"><b>type</b></font></a> &nbsp;</li>
  <li><a href="address.html"><font face="Courier New" color="#003258" size="4"><b>address</b></font></a></li>
  <li><a href="ischosen.html"><b><font face="Courier New" color="#003258" size="4">ischosen</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>type union</b>&nbsp;</font> (<i>identifier&nbsp;</i> | <font face="Courier New" color="#003258" size="5"><b>address</b></font>)<font
      face="Courier New" color="#003258" size="5"><b> {</b></font>&nbsp; <i>type_reference</i>&nbsp; <i>element_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>union</b></font> keywords
  introduce the type definition.</p>
  </li>
  <li>
  <p><i>identifier</i> is the&nbsp;name used to refer to the union. 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 union. The identifiers must be unique within the same union</p>
  </li>
  <li>
  <p><b>...</b> indicates that&nbsp; <i>type_reference</i> <i>element_identifier</i> pairs may be repeated. They are separated by comma.</p>
  </li>
</ul>
<hr align="left" width="50%">
<p>Example 1: type definition
<p><font face="Courier New">type union MyUnionType {&nbsp;<br>
&nbsp;&nbsp;&nbsp;integer Number1,<br>
&nbsp;&nbsp;&nbsp;integer Number2,<br>
&nbsp;&nbsp;&nbsp;charstring String<br>
}</font>
<p>The union called MyUnionType consists of three elements. The first two are both of type integer and have the identifier Number1 and Number2, respectively. The third element is of type character
string and has 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 MyUnionType v_myUnion;&nbsp;<br>
v_myUnion.Number1 := 12;</font>
<p>The variable v_myUnion of type MyUnionType is defined. The value 12 is assigned to the field Number1 making the given field to be the chosen one</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 &amp; 2)
<p><font face="Courier New">v_myUnion := {Number2 := 112};</font>
<p>The value 112 is assigned to the field Number2.&nbsp;</p>
<hr align="left" width="50%">
<p><a name="Example 4">Example 4</a>: the predefined function ischosen&nbsp;
<p><font face="Courier New">var boolean v_whichone := ischosen(v_myUnion.Number1);</font>
<p>The variable v_whichone will have the value true if the field Number1 is chosen (as in example 2).</p>
<hr align="left" width="25%">
<p><a HREF="BNF.html#uniondef">BNF definition</a> of <font face="Courier New"> union</font></p>
</body>
</html>