| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
<html> |
| 16 |
<head> |
| 17 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 18 |
<meta http-equiv="Content-Language" content="en-us"> |
| 19 |
<title>omit</title> |
| 20 |
</head> |
| 21 |
<body bgcolor="#DAD3C5" vlink="#0094D2" link="#003258"> |
| 22 |
<table align="left" border="0" cellspacing="0" cellpadding="0" valign=top> |
| 23 |
<tr> |
| 24 |
<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> |
| 25 |
</tr> |
| 26 |
</table> |
| 27 |
<table border="0" align="right" cellpadding="0" cellspacing="0"> |
| 28 |
<tr> |
| 29 |
<td><a href="../titan_main.html" alt="contents"><img border="0" src="../images/ao.jpg" width="53" height="40"></a></td> |
| 30 |
<td><a href="../titan_index.html" alt="index"><img border="0" src="../images/up.jpg" width="53" height="40"></a></td> |
| 31 |
<td><a href="of.html" alt="previous"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td> |
| 32 |
<td><a href="on.html" alt="next"><img border="0" src="../images/right.jpg" width="53" height="40"></a></td> |
| 33 |
</tr> |
| 34 |
</table> |
| 35 |
<p><br clear="all"> |
| 36 |
</p> |
| 37 |
<hr> |
| 38 |
<h1>omit</h1> |
| 39 |
<hr align="left" width="75%"> |
| 40 |
<p>The <code>omit</code> keyword denotes the missing value. The <code>omit</code> can only be assigned to optional fields of <code>record</code> and <code>set</code> types to indicate that an |
| 41 |
optional field is not present. |
| 42 |
<hr align="left" width="50%"> |
| 43 |
<p>Related keywords:</p> |
| 44 |
<ul> |
| 45 |
<li><a href="optional.html"><b><font face="Courier New" color="#003258" size="4">optional</font></b></a></li> |
| 46 |
<li><a href="record.html"><b><font face="Courier New" color="#003258" size="4">record</font></b></a></li> |
| 47 |
<li><a href="set.html"><b><font face="Courier New" color="#003258" size="4">set</font></b></a></li> |
| 48 |
</ul> |
| 49 |
<hr align="left" width="50%"> |
| 50 |
<div align="center"> |
| 51 |
<center> |
| 52 |
<table border="0" width="90%" bgcolor="#FFB599" cellpadding="4"> |
| 53 |
<tr> |
| 54 |
<td width="100%"> |
| 55 |
<h3 align="center"><font face="Courier New" color="#003258" size="5"><b>omit</b></font></h3> |
| 56 |
</td> |
| 57 |
</tr> |
| 58 |
</table> |
| 59 |
</center> |
| 60 |
</div> |
| 61 |
<hr align="left" width="25%"> |
| 62 |
Example: |
| 63 |
<p><code> module m {<br> |
| 64 |
type record R { integer field1 optional, boolean field2 }<br> |
| 65 |
type set S { integer field1 optional, boolean field2 }<br> |
| 66 |
<br> |
| 67 |
control {<br> |
| 68 |
var R r1 := { omit, false };<br> |
| 69 |
var S s1 := { field1 := omit, field2 := true };<br> |
| 70 |
var S s2;<br> |
| 71 |
<br> |
| 72 |
s2.field1 := omit;<br> |
| 73 |
s2.field2 := false;<br> |
| 74 |
}<br> |
| 75 |
} </code> |
| 76 |
<p>Both type S and R contain an optional field1 element. Variable r1 is initialized using the value list notation; the optional field is omitted. Variable s1 is initialized using the value |
| 77 |
assignment notation; the optional field1 is not present. Finally, variable s2 is not initialized. Its fields are set via normal assignments through field references (i.e. using the dot notation); |
| 78 |
field1 is absent, again. |
| 79 |
<hr align="left" width="25%"> |
| 80 |
<p><a HREF="BNF.html#omitvalue">BNF definition</a> of <font face="Courier New">omit</font></p> |
| 81 |
</body> |
| 82 |
</html> |