Sync with 5.4.0
[deliverable/titan.core.git] / help / info / operators.html
1 <!--
2 Copyright (c) 2000-2015 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>operators</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="on.html" alt="previous"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td>
26 <td><a href="optional.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>TTCN-3 operators</h1>
33 <hr align="left" width="75%">
34 <p>TTCN-3 supports a number of predefined operators that may be used in the terms of TTCN-3 expressions. The predefined operators fall into seven categories:
35 <ol>
36 <li>arithmetic operators;
37 <li>string operators;
38 <li>relational operators;
39 <li>logical operators;
40 <li>bitwise operators;
41 <li>shift operators;
42 <li>rotate operators.
43 </ol>
44 <p>These operators are listed in the following table:
45 <table border=1>
46 <tr>
47 <th>Category</th>
48 <th>Operator</th>
49 <th>Symbol or Keyword</th>
50 </tr>
51 <tr>
52 <td rowspan=6>Arithmetic operators</td>
53 <td>addition</td>
54 <td>+</td>
55 </tr>
56 <tr>
57 <td>substraction</td>
58 <td>-</td>
59 </tr>
60 <tr>
61 <td>multiplication</td>
62 <td>*</td>
63 </tr>
64 <tr>
65 <td>division</td>
66 <td>/</td>
67 </tr>
68 <tr>
69 <td>modulo</td>
70 <td><a href="mod.html">mod</a></td>
71 </tr>
72 <tr>
73 <td>remainder</td>
74 <td><a href="rem.html">rem</a></td>
75 </tr>
76 <tr>
77 <td>String operators</td>
78 <td>concatenation</td>
79 <td>&amp;</td>
80 </tr>
81 <tr>
82 <td rowspan=6>Relational operators</td>
83 <td>equal</td>
84 <td>==</td>
85 </tr>
86 <tr>
87 <td>less than</td>
88 <td>&lt;</td>
89 </tr>
90 <tr>
91 <td>greater than</td>
92 <td>&gt;</td>
93 </tr>
94 <tr>
95 <td>not equal</td>
96 <td>!=</td>
97 </tr>
98 <tr>
99 <td>greater than or equal</td>
100 <td>&gt;=</td>
101 </tr>
102 <tr>
103 <td>less than or equal</td>
104 <td>&lt;=</td>
105 </tr>
106 <tr>
107 <td rowspan=4>Logical operators</td>
108 <td>logical not</td>
109 <td><a href="not.html">not</a></td>
110 </tr>
111 <tr>
112 <td>logical and</td>
113 <td><a href="and.html">and</a></td>
114 </tr>
115 <tr>
116 <td>logical or</td>
117 <td><a href="or.html">or</a></td>
118 </tr>
119 <tr>
120 <td>logical xor</td>
121 <td><a href="xor.html">xor</a></td>
122 </tr>
123 <tr>
124 <td rowspan=4>Bitwise operators</td>
125 <td>bitwise not</td>
126 <td><a href="not4b.html">not4b</a></td>
127 </tr>
128 <tr>
129 <td>bitwise and</td>
130 <td><a href="and4b.html">and4b</a></td>
131 </tr>
132 <tr>
133 <td>bitwise or</td>
134 <td><a href="or4b.html">or4b</a></td>
135 </tr>
136 <tr>
137 <td>bitwise xor</td>
138 <td><a href="xor4b.html">xor4b</a></td>
139 </tr>
140 <tr>
141 <td rowspan=2>Shift operators</td>
142 <td>shift left</td>
143 <td>&lt;&lt;</td>
144 </tr>
145 <tr>
146 <td>shift right</td>
147 <td>&gt;&gt;</td>
148 </tr>
149 <tr>
150 <td rowspan=2>Rotate operators</td>
151 <td>rotate left</td>
152 <td>&lt;@</td>
153 </tr>
154 <tr>
155 <td>rotate right</td>
156 <td>@&gt;</td>
157 </tr>
158 </table>
159 <p>The precedence of these operators is shown in the table below. Within any row in this table, the listed operators have equal precedence. If more than one operator of equal precedence appears in
160 an expression, the operations are evaluated from left to right. Parentheses may be used to group operands in expressions, in which case a parenthesized expression has the highest precedence for
161 evaluation.
162 <table border=1>
163 <tr>
164 <th>Priority</th>
165 <th>Operator type</th>
166 <th>Operator</th>
167 </tr>
168 <tr>
169 <td>highest</td>
170 <td></td>
171 <td>( ... )</td>
172 </tr>
173 <tr>
174 <td rowspan=13></td>
175 <td>Unary</td>
176 <td>+, -</td>
177 </tr>
178 <tr>
179 <td>Binary</td>
180 <td>*, /, <a href="mod.html">mod</a>, <a href="and.html">rem</a></td>
181 </tr>
182 <tr>
183 <td>Binary</td>
184 <td>+, -, &amp;</td>
185 </tr>
186 <tr>
187 <td>Unary</td>
188 <td><a href="not4b.html">not4b</a></td>
189 </tr>
190 <tr>
191 <td>Binary</td>
192 <td><a href="and4b.html">and4b</a></td>
193 </tr>
194 <tr>
195 <td>Binary</td>
196 <td><a href="xor4b.html">xor4b</a></td>
197 </tr>
198 <tr>
199 <td>Binary</td>
200 <td><a href="or4b.html">or4b</a></td>
201 </tr>
202 <tr>
203 <td>Binary</td>
204 <td>&lt;&lt;, &gt;&gt;, &lt;@, @&gt;</td>
205 </tr>
206 <tr>
207 <td>Binary</td>
208 <td>&lt;, &gt;, &lt;=, &gt;=</td>
209 </tr>
210 <tr>
211 <td>Binary</td>
212 <td>==, !=</td>
213 </tr>
214 <tr>
215 <td>Unary</td>
216 <td><a href="not.html">not</a></td>
217 </tr>
218 <tr>
219 <td>Binary</td>
220 <td><a href="and.html">and</a></td>
221 </tr>
222 <tr>
223 <td>Binary</td>
224 <td><a href="xor.html">xor</a></td>
225 </tr>
226 <tr>
227 <td>lowest</td>
228 <td>Binary</td>
229 <td><a href="or.html">or</a></td>
230 </tr>
231 </table>
232 <hr align="left" width="50%">
233 </body>
234 </html>
This page took 0.070248 seconds and 5 git commands to generate.