1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Parser Operators</title> 5<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../../../../index.html" title="Spirit 2.5.8"> 8<link rel="up" href="../qi_parsers.html" title="Qi Parsers"> 9<link rel="prev" href="directive.html" title="Parser Directives"> 10<link rel="next" href="action.html" title="Parser Semantic Actions"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="directive.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../qi_parsers.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="action.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h5 class="title"> 27<a name="spirit.qi.quick_reference.qi_parsers.operator"></a><a class="link" href="operator.html" title="Parser Operators">Parser 28 Operators</a> 29</h5></div></div></div> 30<div class="informaltable"><table class="table"> 31<colgroup> 32<col> 33<col> 34<col> 35</colgroup> 36<thead><tr> 37<th> 38 <p> 39 Expression 40 </p> 41 </th> 42<th> 43 <p> 44 Attribute 45 </p> 46 </th> 47<th> 48 <p> 49 Description 50 </p> 51 </th> 52</tr></thead> 53<tbody> 54<tr> 55<td> 56 <p> 57 <a class="link" href="../../reference/operator/not_predicate.html" title="Not-Predicate Parser (!a)"><code class="computeroutput"><span class="special">!</span><span class="identifier">a</span></code></a> 58 </p> 59 </td> 60<td> 61 <p> 62 <code class="computeroutput"><span class="identifier">Unused</span></code> 63 </p> 64 </td> 65<td> 66 <p> 67 Not predicate. If the predicate <code class="computeroutput"><span class="identifier">a</span></code> 68 matches, fail. Otherwise, return a zero length match. 69 </p> 70 </td> 71</tr> 72<tr> 73<td> 74 <p> 75 <a class="link" href="../../reference/operator/and_predicate.html" title="And-Predicate Parser (&a)"><code class="computeroutput"><span class="special">&</span><span class="identifier">a</span></code></a> 76 </p> 77 </td> 78<td> 79 <p> 80 <code class="computeroutput"><span class="identifier">Unused</span></code> 81 </p> 82 </td> 83<td> 84 <p> 85 And predicate. If the predicate <code class="computeroutput"><span class="identifier">a</span></code> 86 matches, return a zero length match. Otherwise, fail. 87 </p> 88 </td> 89</tr> 90<tr> 91<td> 92 <p> 93 <a class="link" href="../../reference/operator/optional.html" title="Optional Parser (-a)"><code class="computeroutput"><span class="special">-</span><span class="identifier">a</span></code></a> 94 </p> 95 </td> 96<td> 97 <p> 98 <code class="computeroutput"><span class="identifier">optional</span><span class="special"><</span><span class="identifier">A</span><span class="special">></span></code> 99 </p> 100 </td> 101<td> 102 <p> 103 Optional. Parse <code class="computeroutput"><span class="identifier">a</span></code> 104 zero or one time 105 </p> 106 </td> 107</tr> 108<tr> 109<td> 110 <p> 111 <a class="link" href="../../reference/operator/kleene.html" title="Kleene Parser (*a)"><code class="computeroutput"><span class="special">*</span><span class="identifier">a</span></code></a> 112 </p> 113 </td> 114<td> 115 <p> 116 <code class="computeroutput"><span class="identifier">vector</span><span class="special"><</span><span class="identifier">A</span><span class="special">></span></code> 117 </p> 118 </td> 119<td> 120 <p> 121 Kleene. Parse <code class="computeroutput"><span class="identifier">a</span></code> 122 zero or more times 123 </p> 124 </td> 125</tr> 126<tr> 127<td> 128 <p> 129 <a class="link" href="../../reference/operator/plus.html" title="Plus Parser (+a)"><code class="computeroutput"><span class="special">+</span><span class="identifier">a</span></code></a> 130 </p> 131 </td> 132<td> 133 <p> 134 <code class="computeroutput"><span class="identifier">vector</span><span class="special"><</span><span class="identifier">A</span><span class="special">></span></code> 135 </p> 136 </td> 137<td> 138 <p> 139 Plus. Parse <code class="computeroutput"><span class="identifier">a</span></code> 140 one or more times 141 </p> 142 </td> 143</tr> 144<tr> 145<td> 146 <p> 147 <a class="link" href="../../reference/operator/alternative.html" title="Alternative Parser (a | b)"><code class="computeroutput"><span class="identifier">a</span> <span class="special">|</span> 148 <span class="identifier">b</span></code></a> 149 </p> 150 </td> 151<td> 152 <p> 153 <code class="computeroutput"><span class="identifier">variant</span><span class="special"><</span><span class="identifier">A</span><span class="special">,</span> 154 <span class="identifier">B</span><span class="special">></span></code> 155 </p> 156 </td> 157<td> 158 <p> 159 Alternative. Parse <code class="computeroutput"><span class="identifier">a</span></code> 160 or <code class="computeroutput"><span class="identifier">b</span></code> 161 </p> 162 </td> 163</tr> 164<tr> 165<td> 166 <p> 167 <a class="link" href="../../reference/operator/sequence.html" title="Sequence Parser (a >> b)"><code class="computeroutput"><span class="identifier">a</span> <span class="special">>></span> 168 <span class="identifier">b</span></code></a> 169 </p> 170 </td> 171<td> 172 <p> 173 <code class="computeroutput"><span class="identifier">tuple</span><span class="special"><</span><span class="identifier">A</span><span class="special">,</span> 174 <span class="identifier">B</span><span class="special">></span></code> 175 </p> 176 </td> 177<td> 178 <p> 179 Sequence. Parse <code class="computeroutput"><span class="identifier">a</span></code> 180 followed by <code class="computeroutput"><span class="identifier">b</span></code> 181 </p> 182 </td> 183</tr> 184<tr> 185<td> 186 <p> 187 <a class="link" href="../../reference/operator/expect.html" title="Expectation Operator (a > b)"><code class="computeroutput"><span class="identifier">a</span> <span class="special">></span> 188 <span class="identifier">b</span></code></a> 189 </p> 190 </td> 191<td> 192 <p> 193 <code class="computeroutput"><span class="identifier">tuple</span><span class="special"><</span><span class="identifier">A</span><span class="special">,</span> 194 <span class="identifier">B</span><span class="special">></span></code> 195 </p> 196 </td> 197<td> 198 <p> 199 Expect. Parse <code class="computeroutput"><span class="identifier">a</span></code> 200 followed by <code class="computeroutput"><span class="identifier">b</span></code>. 201 <code class="computeroutput"><span class="identifier">b</span></code> is expected 202 to match when <code class="computeroutput"><span class="identifier">a</span></code> 203 matches, otherwise, an <code class="computeroutput"><span class="identifier">expectation_failure</span></code> 204 is thrown. 205 </p> 206 </td> 207</tr> 208<tr> 209<td> 210 <p> 211 <a class="link" href="../../reference/operator/difference.html" title="Difference Parser (a - b)"><code class="computeroutput"><span class="identifier">a</span> <span class="special">-</span> 212 <span class="identifier">b</span></code></a> 213 </p> 214 </td> 215<td> 216 <p> 217 <code class="computeroutput"><span class="identifier">A</span></code> 218 </p> 219 </td> 220<td> 221 <p> 222 Difference. Parse <code class="computeroutput"><span class="identifier">a</span></code> 223 but not <code class="computeroutput"><span class="identifier">b</span></code> 224 </p> 225 </td> 226</tr> 227<tr> 228<td> 229 <p> 230 <a class="link" href="../../reference/operator/sequential_or.html" title="Sequential Or Parser (a || b)"><code class="computeroutput"><span class="identifier">a</span> <span class="special">||</span> 231 <span class="identifier">b</span></code></a> 232 </p> 233 </td> 234<td> 235 <p> 236 <code class="computeroutput"><span class="identifier">tuple</span><span class="special"><</span></code> 237 <code class="computeroutput"><span class="identifier">optional</span><span class="special"><</span><span class="identifier">A</span><span class="special">>,</span></code> 238 <code class="computeroutput"><span class="identifier">optional</span><span class="special"><</span><span class="identifier">B</span><span class="special">></span> 239 <span class="special">></span></code> 240 </p> 241 </td> 242<td> 243 <p> 244 Sequential Or. Parse <code class="computeroutput"><span class="identifier">a</span></code> 245 or <code class="computeroutput"><span class="identifier">b</span></code> or <code class="computeroutput"><span class="identifier">a</span></code> followed by <code class="computeroutput"><span class="identifier">b</span></code> 246 </p> 247 </td> 248</tr> 249<tr> 250<td> 251 <p> 252 <a class="link" href="../../reference/operator/list.html" title="List Parser (a % b)"><code class="computeroutput"><span class="identifier">a</span> <span class="special">%</span> 253 <span class="identifier">b</span></code></a> 254 </p> 255 </td> 256<td> 257 <p> 258 <code class="computeroutput"><span class="identifier">vector</span><span class="special"><</span><span class="identifier">A</span><span class="special">></span></code> 259 </p> 260 </td> 261<td> 262 <p> 263 List. Parse <code class="computeroutput"><span class="identifier">a</span></code> 264 delimited <code class="computeroutput"><span class="identifier">b</span></code> 265 one or more times 266 </p> 267 </td> 268</tr> 269<tr> 270<td> 271 <p> 272 <a class="link" href="../../reference/operator/permutation.html" title="Permutation Parser (a ^ b)"><code class="computeroutput"><span class="identifier">a</span> <span class="special">^</span> 273 <span class="identifier">b</span></code></a> 274 </p> 275 </td> 276<td> 277 <p> 278 <code class="computeroutput"><span class="identifier">tuple</span><span class="special"><</span></code> 279 <code class="computeroutput"><span class="identifier">optional</span><span class="special"><</span><span class="identifier">A</span><span class="special">>,</span></code> 280 <code class="computeroutput"><span class="identifier">optional</span><span class="special"><</span><span class="identifier">B</span><span class="special">></span> 281 <span class="special">></span></code> 282 </p> 283 </td> 284<td> 285 <p> 286 Permutation. Parse <code class="computeroutput"><span class="identifier">a</span></code> 287 or <code class="computeroutput"><span class="identifier">b</span></code> or <code class="computeroutput"><span class="identifier">a</span></code> followed by <code class="computeroutput"><span class="identifier">b</span></code> or <code class="computeroutput"><span class="identifier">b</span></code> 288 followed by <code class="computeroutput"><span class="identifier">a</span></code>. 289 </p> 290 </td> 291</tr> 292</tbody> 293</table></div> 294</div> 295<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 296<td align="left"></td> 297<td align="right"><div class="copyright-footer">Copyright © 2001-2011 Joel de Guzman, Hartmut Kaiser<p> 298 Distributed under the Boost Software License, Version 1.0. (See accompanying 299 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 300 </p> 301</div></td> 302</tr></table> 303<hr> 304<div class="spirit-nav"> 305<a accesskey="p" href="directive.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../qi_parsers.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="action.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 306</div> 307</body> 308</html> 309