Commit | Line | Data |
---|---|---|
970ed795 | 1 | <!-- |
3abe9331 | 2 | Copyright (c) 2000-2015 Ericsson Telecom AB |
970ed795 EL |
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>interleave</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="integer.html" alt="previous"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td> | |
26 | <td><a href="isbound.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>interleave</h1> | |
33 | <hr align="left" width="75%"> | |
34 | <p>The statement denotes branching of test behavior due to the reception and handling of communication and/or timer events and/or the termination of parallel test components. The sequence of the | |
35 | events does not matter. The individual alternatives (or branches) contain an event or "receiving operation", which can be successful or unsuccessful ("condition") and end by an | |
36 | optional statement block. | |
37 | <p>Opposed to alt statement, where only a single alternative is taken, all branches of the interleave statement must "happen". | |
38 | <p>Related keyword:</p> | |
39 | <ul> | |
40 | <li><a href="alt.html"><b><font face="Courier New" color="#003258" size="4">alt</font></b></a></li> | |
41 | </ul> | |
42 | <hr align="left" width="50%"> | |
43 | <div align="center"> | |
44 | <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4"> | |
45 | <tr> | |
46 | <td width="100%"> | |
47 | <h3 align="left"><font face="Courier New" color="#003258" size="5"><b>interleave {<br> | |
48 | []</b></font> [<i>condition</i>] <font face="Courier New" color="#003258" size="5"><b>{</b></font> [<i>statement_block</i>] <font face="Courier New" color="#003258" size="5"><b>}<br> | |
49 | </b></font> ...<font face="Courier New" color="#003258" size="5"><b><br> | |
50 | };</b></font> </h3> | |
51 | </td> | |
52 | </tr> | |
53 | </table> | |
54 | </div> | |
55 | <ul> | |
56 | <li> | |
57 | <p>The <font face="Courier New" color="#003258" size="4"><b>interleave</b></font> keywords introduces the branching definition.</p> | |
58 | </li> | |
59 | <li> | |
60 | <p>Each branch begins with a pair of brackets (the brackets must be empty).</p> | |
61 | </li> | |
62 | <li> | |
63 | <p><i>condition</i> may be a communication or a timer event or the termination of a parallel test component. The following operations may be written here: <a href="receive.html"><b><font | |
64 | face="Courier New" color="#003258" size="4">receive</font></b></a>, <a href="trigger.html"><b><font face="Courier New" color="#003258" size="4">trigger</font></b></a>, <a href="getcall.html"><b><font | |
65 | face="Courier New" color="#003258" size="4">getcall</font></b></a>, <a href="catch.html"><b><font face="Courier New" color="#003258" size="4">catch</font></b></a>, <a href="check.html"><b><font | |
66 | face="Courier New" color="#003258" size="4">check</font></b></a>, <a href="timeout.html"><b><font face="Courier New" color="#003258" size="4">timeout</font></b></a> and <a href="done.html"><b><font | |
67 | face="Courier New" color="#003258" size="4">done</font></b></a>.</p> | |
68 | </li> | |
69 | <li>The optional <i>statement_block</i> contains one or more statements separated by semicolons. When empty, the curly brackets must be written. | |
70 | <P>The use of iterative statements (for, while, do-while, etc.) is forbidden inside the statement block. | |
71 | <P>Neither direct altstep invocation, nor default activation are permitted. | |
72 | <P>Function calls, which contain communication operations, shall also be avoided inside the statement block of interleave statement. | |
73 | </li> | |
74 | <li> | |
75 | <p><b>...</b> indicates that several branches may occur in the <font face="Courier New" color="#003258" size="4"><b>interleave</b></font> body. There is no separator between them.</p> | |
76 | </li> | |
77 | </ul> | |
78 | <hr align="left" width="50%"> | |
79 | <p>Example: | |
80 | <p><font face="Courier New">interleave { <br> | |
81 | [] L1_PCO.receive (tr_Sig1)<br> | |
82 | { <br> | |
83 | L1_PCO.send (t_Sig2);<br> | |
84 | L1_PCO.receive(tr_Sig3)<br> | |
85 | } <br> | |
86 | [] L2_PCO.receive (tr_Sig4) <br> | |
87 | { <br> | |
88 | L2_PCO.send (t_Sig5);<br> | |
89 | L2_PCO.receive(tr_Sig6);<br> | |
90 | L2_PCO.send (t_Sig7)<br> | |
91 | } <br> | |
92 | };</font> | |
93 | <p>The reception events on ports L1_PCO and L2_PCO may happen in arbitrary order. The possible orderings of <i>incoming</i> messages are: | |
94 | <p><code> tr_Sig1, tr_Sig3, tr_Sig4, tr_Sig6<BR> | |
95 | tr_Sig1, tr_Sig4, tr_Sig3, tr_Sig6<BR> | |
96 | tr_Sig1, tr_Sig4, tr_Sig6, tr_Sig3<BR> | |
97 | tr_Sig4, tr_Sig1, tr_Sig3, tr_Sig6<BR> | |
98 | tr_Sig4, tr_Sig1, tr_Sig6, tr_Sig3<BR> | |
99 | tr_Sig4, tr_Sig6, tr_Sig1, tr_Sig3 </code> | |
100 | <hr align="left" width="25%"> | |
101 | <hr align="left" width="25%"> | |
102 | <p><a HREF="BNF.html#interleavedconstruct">BNF definition</a> of <font face="Courier New"> interleave</font></p> | |
103 | </body> | |
104 | </html> |