4 <title>Quick Reference
</title>
5 <link rel=
"stylesheet" href=
"theme/style.css" type=
"text/css">
9 <table width=
"100%" border=
"0" background=
"theme/bkd2.gif" cellspacing=
"2">
12 <td width=
"85%"> <font size=
"6" face=
"Verdana, Arial, Helvetica, sans-serif"><b>Quick
13 Reference
</b></font></td>
14 <td width=
"112"><a href=
"http://spirit.sf.net"><img src=
"theme/spirit.gif" width=
"112" height=
"48" align=
"right" border=
"0"></a></td>
21 <td width=
"30"><a href=
"../index.html"><img src=
"theme/u_arr.gif" border=
"0"></a></td>
22 <td width=
"30"><a href=
"error_handling.html"><img src=
"theme/l_arr.gif" border=
"0"></a></td>
23 <td width=
"30"><a href=
"includes.html"><img src=
"theme/r_arr.gif" border=
"0"></a></td>
26 <p>This isn't intended to be a full, detailed reference; nor is it intended to
27 be of any use to readers who aren't already familiar with Spirit. It's just
28 a brief reminder of the syntax and behaviour of each component, with links to
29 the full documentation.
</p>
31 <li><strong>Primitive parser generators
</strong> <i>(action arguments are listed
34 <li><a href=
"quickref.html#null_parsers">Null parsers
</a></li>
35 <li><a href=
"quickref.html#character_parsers">Character parsers
</a></li>
36 <li><a href=
"quickref.html#number_parsers">Number parsers
</a></li>
37 <li><a href=
"quickref.html#otherlexeme_parsers">Other lexeme parsers
</a></li>
38 <li><a href=
"quickref.html#text_parsers">Text parsers
</a><br>
43 <li><strong>Other parser elements
</strong>
45 <li><a href=
"quickref.html#compound_parsers">Compound parsers
</a></li>
46 <li><a href=
"quickref.html#general_directives">General directives
</a></li>
47 <li><a href=
"quickref.html#tree_specific_directives">Tree-specific directives
</a><br>
52 <li><strong>Operators
</strong>
54 <li><a href=
"quickref.html#unary_operators">Unary operators
</a></li>
55 <li><a href=
"quickref.html#binary_operators">Binary operators
</a> <i>(in order of precedence)
<br>
70 <td class=
"table_title" colspan=
"3"><a name=
"null_parsers"></a>Null parsers
</td>
73 <td class=
"table_cells"><code><a href=
"primitives.html">end_p
</a></code></td>
74 <td class=
"table_cells">Matches EOF
</td>
75 <td class=
"table_cells"><i>iter,iter
</i></td>
78 <td class=
"table_cells"><code><a href=
"primitives.html">eps_p
</a><br />
79 <a href=
"primitives.html">eps_p
</a>(P)
</code></td>
80 <td class=
"table_cells">Matches without consuming text
</td>
81 <td class=
"table_cells"><i>iter,iter
</i></td>
84 <td class=
"table_cells"><code><a href=
"primitives.html">epsilon_p
</a><br />
85 <a href=
"primitives.html">epsilon_p
</a>(P)
</code></td>
86 <td class=
"table_cells">Synonym for
<b>eps_p
</b></td>
87 <td class=
"table_cells"><i>iter,iter
</i></td>
90 <td class=
"table_cells"><code><a href=
"primitives.html">nothing_p
</a></code></td>
91 <td class=
"table_cells">Always fails
</td>
92 <td class=
"table_cells"><i>iter,iter
</i></td>
96 <td class=
"table_title" colspan=
"3"><a name=
"character_parsers"></a>Character parsers
</td>
99 <td class=
"table_cells"><code><a href=
"primitives.html">alnum_p
</a></code></td>
100 <td class=
"table_cells">Matches any alphanumeric character
</td>
101 <td class=
"table_cells"><i>char
</i></td>
104 <td class=
"table_cells"><code><a href=
"primitives.html">alpha_p
</a></code></td>
105 <td class=
"table_cells">Matches any letter
</td>
106 <td class=
"table_cells"><i>char
</i></td>
109 <td class=
"table_cells"><code><a href=
"primitives.html">anychar_p
</a></code></td>
110 <td class=
"table_cells">Matches any character
</td>
111 <td class=
"table_cells"><i>char
</i></td>
114 <td class=
"table_cells"><code><a href=
"primitives.html">blank_p
</a></code></td>
115 <td class=
"table_cells">Matches a space or tab
</td>
116 <td class=
"table_cells"><i>char
</i></td>
120 <td class=
"table_cells"><code><a href=
"primitives.html">ch_p
</a>(char)
</code></td>
121 <td class=
"table_cells">Matches a character
</td>
122 <td class=
"table_cells"><i>char
</i></td>
126 <td class=
"table_cells"><code><a href=
"character_sets.html">chset_p
</a>(charset)
</code></td>
127 <td class=
"table_cells">Matches a character in the set
</td>
128 <td class=
"table_cells"><i>char
</i></td>
131 <td class=
"table_cells"><code><a href=
"primitives.html">cntrl_p
</a></code></td>
132 <td class=
"table_cells">Matches any control character
</td>
133 <td class=
"table_cells"><i>char
</i></td>
136 <td class=
"table_cells"><code><a href=
"primitives.html">digit_p
</a></code></td>
137 <td class=
"table_cells">Matches any digit
</td>
138 <td class=
"table_cells"><i>char
</i></td>
142 <td class=
"table_cells"><code><a href=
"parametric_parsers.html">f_ch_p
</a>(func)
</code></td>
143 <td class=
"table_cells">Matches a character
</td>
144 <td class=
"table_cells"><i>char
</i></td>
148 <td class=
"table_cells"><code><a href=
"parametric_parsers.html">f_range_p
</a>(func1,
150 <td class=
"table_cells">Matches any character in the inclusive range
</td>
151 <td class=
"table_cells"><i>char
</i></td>
154 <td class=
"table_cells"><code><a href=
"primitives.html">graph_p
</a></code></td>
155 <td class=
"table_cells">Matches any non-space printable character
</td>
156 <td class=
"table_cells"><i>char
</i></td>
159 <td class=
"table_cells"><code><a href=
"primitives.html">lower_p
</a></code></td>
160 <td class=
"table_cells">Matches any lower-case letter
</td>
161 <td class=
"table_cells"><i>char
</i></td>
164 <td class=
"table_cells"><code><a href=
"primitives.html">print_p
</a></code></td>
165 <td class=
"table_cells">Matches any printable character
</td>
166 <td class=
"table_cells"><i>char
</i></td>
169 <td class=
"table_cells"><code><a href=
"primitives.html">punct_p
</a></code></td>
170 <td class=
"table_cells">Matches any punctuation mark
</td>
171 <td class=
"table_cells"><i>char
</i></td>
175 <td class=
"table_cells"><code><a href=
"primitives.html">range_p
</a>(char1,
177 <td class=
"table_cells">Matches any character in the inclusive range
</td>
178 <td class=
"table_cells"><i>char
</i></td>
181 <td class=
"table_cells"><code><a href=
"numerics.html">sign_p
</a></code></td>
182 <td class=
"table_cells">Matches a plus or minus sign
</td>
183 <td class=
"table_cells"><i>bool
</i></td>
186 <td class=
"table_cells"><code><a href=
"primitives.html">space_p
</a></code></td>
187 <td class=
"table_cells">Matches any whitespace character
</td>
188 <td class=
"table_cells"><i>char
</i></td>
191 <td class=
"table_cells"><code><a href=
"primitives.html">upper_p
</a></code></td>
192 <td class=
"table_cells">Matches any upper-case letter
</td>
193 <td class=
"table_cells"><i>char
</i></td>
196 <td class=
"table_cells"><code><a href=
"primitives.html">xdigit_p
</a></code></td>
197 <td class=
"table_cells">Matches any hexadecimal digit
</td>
198 <td class=
"table_cells"><i>char
</i></td>
202 <td class=
"table_title" colspan=
"3"><a name=
"number_parsers"></a>Number parsers
</td>
205 <td class=
"table_cells"><code><a href=
"numerics.html">bin_p
</a></code></td>
206 <td class=
"table_cells">Matches an unsigned binary integer
</td>
207 <td class=
"table_cells"><i>numeric
</i></td>
210 <td class=
"table_cells"><code><a href=
"numerics.html">hex_p
</a></code></td>
211 <td class=
"table_cells">Matches an unsigned hexadecimal integer
</td>
212 <td class=
"table_cells"><i>numeric
</i></td>
215 <td class=
"table_cells"><code><a href=
"numerics.html">int_p
</a></code></td>
216 <td class=
"table_cells">Matches a signed decimal integer
</td>
217 <td class=
"table_cells"><i>numeric
</i></td>
221 <td class=
"table_cells"><code><a href=
"numerics.html">int_parser
</a><type,
222 base, min, max
></code></td>
223 <td class=
"table_cells">Matches a signed integer with
<b>min
</b> to
<b>max
</b> digits
</td>
224 <td class=
"table_cells"><i>numeric
</i></td>
227 <td class=
"table_cells"><code><a href=
"numerics.html">oct_p
</a></code></td>
228 <td class=
"table_cells">Matches an unsigned octal integer
</td>
229 <td class=
"table_cells"><i>numeric
</i></td>
232 <td class=
"table_cells"><code><a href=
"numerics.html">real_p
</a></code></td>
233 <td class=
"table_cells">Matches a floating point number
</td>
234 <td class=
"table_cells"><i>numeric
</i></td>
238 <td class=
"table_cells"><code><a href=
"numerics.html">real_parser
</a><type,
239 policy
></code></td>
240 <td class=
"table_cells">Matches a floating point number
</td>
241 <td class=
"table_cells"><i>numeric
</i></td>
244 <td class=
"table_cells"><code><a href=
"numerics.html">strict_real_p
</a></code></td>
245 <td class=
"table_cells">Matches a floating point number (requires decimal point)
</td>
246 <td class=
"table_cells"><i>numeric
</i></td>
249 <td class=
"table_cells"><code><a href=
"numerics.html">strict_ureal_p
</a></code></td>
250 <td class=
"table_cells">Matches an unsigned FP number (requires decimal point)
</td>
251 <td class=
"table_cells"><i>numeric
</i></td>
254 <td class=
"table_cells"><code><a href=
"numerics.html">uint_p
</a></code></td>
255 <td class=
"table_cells">Matches an unsigned decimal integer
</td>
256 <td class=
"table_cells"><i>numeric
</i></td>
260 <td class=
"table_cells"><code><a href=
"numerics.html">uint_parser
</a><type,
261 base, min, max
></code></td>
262 <td class=
"table_cells">Matches an unsigned integer with
<b>min
</b> to
<b>max
</b> digits
</td>
263 <td class=
"table_cells"><i>numeric
</i></td>
266 <td class=
"table_cells"><code><a href=
"numerics.html">ureal_p
</a></code></td>
267 <td class=
"table_cells">Matches an unsigned FP number
</td>
268 <td class=
"table_cells"><i>numeric
</i></td>
272 <td class=
"table_title" colspan=
"3" id=
"other_lexeme_parsers"><a name=
"otherlexeme_parsers"></a>Other lexeme parsers
</td>
275 <td class=
"table_cells"><code><a href=
"escape_char_parser.html">c_escape_ch_p
</a></code></td>
276 <td class=
"table_cells">Matches a C escape code
</td>
277 <td class=
"table_cells"><i>char
</i></td>
281 <td class=
"table_cells"><code><a href=
"confix.html">comment_p
</a>(string)
<br />
282 <a href=
"confix.html">comment_p
</a> (string1, string2)
</code></td>
283 <td class=
"table_cells">Matches C++ or C-style comments
</td>
284 <td class=
"table_cells"><i>iter,iter
</i></td>
287 <td class=
"table_cells"><code><a href=
"primitives.html">eol_p
</a></code></td>
288 <td class=
"table_cells">Matches CR, LF, or any combination
</td>
289 <td class=
"table_cells"><i>iter,iter
</i></td>
293 <td class=
"table_cells"><code><a href=
"parametric_parsers.html">f_str_p
</a>(func1,
295 <td class=
"table_cells">Matches a string
</td>
296 <td class=
"table_cells"><i>iter,iter
</i></td>
299 <td class=
"table_cells"><code><a href=
"escape_char_parser.html">lex_escape_ch_p
</a></code></td>
300 <td class=
"table_cells">Matches a C escape code or any backslash escape
</td>
301 <td class=
"table_cells"><i>char
</i></td>
305 <td class=
"table_cells"><code><a href=
"regular_expression_parser.html">regex_p
</a>(regex)
</code></td>
306 <td class=
"table_cells">Matches a regular expression
</td>
307 <td class=
"table_cells"><i>iter,iter
</i></td>
311 <td class=
"table_cells"><code><a href=
"primitives.html">str_p
</a>(string)
<br />
312 <a href=
"primitives.html">str_p
</a>(iter1, iter2)
</code></td>
313 <td class=
"table_cells">Matches a string
</td>
314 <td class=
"table_cells"><i>iter,iter
</i></td>
318 <td class=
"table_title" colspan=
"3"><a name=
"text_parsers"></a>Text parsers
</td>
322 <td class=
"table_cells"><code><a href=
"primitives.html">chseq_p
</a>(string)
<br />
323 <a href=
"primitives.html">chseq_p
</a>(iter1, iter2)
</code></td>
324 <td class=
"table_cells">Matches a string, possibly with embedded whitespace
</td>
325 <td class=
"table_cells"><i>iter,iter
</i></td>
329 <td class=
"table_cells"><code><a href=
"parametric_parsers.html">f_chseq_p
</a>(func1,
331 <td class=
"table_cells">Matches a string, possibly with embedded whitespace
</td>
332 <td class=
"table_cells"><i>iter,iter
</i></td>
339 <td width=
"10"> </td>
346 <td class=
"table_title" colspan=
"2"><a name=
"compound_parsers"></a>Compound parsers
</td>
350 <td class=
"table_cells"><code><a href=
"confix.html">confix_p
</a>(open,
351 exp, close)
</code></td>
352 <td class=
"table_cells">Matches
<b>open
>> (exp - close)
>> close
</b></td>
356 <td class=
"table_cells"><code><a href=
"dynamic_parsers.html">do_p
</a>[P].
<a href=
"dynamic_parsers.html">while_p
</a>(cond)
</code></td>
357 <td class=
"table_cells">Matches while a condition is true (at least once)
</td>
361 <td class=
"table_cells"><code><a href=
"dynamic_parsers.html">for_p
</a>(init,
362 cond, step)[P]
</code></td>
363 <td class=
"table_cells">Matches in a loop
</td>
367 <td class=
"table_cells"><code><a href=
"functor_parser.html">functor_parser
</a><func
></code></td>
368 <td class=
"table_cells">Wraps an external parser
</td>
372 <td class=
"table_cells"><code><a href=
"dynamic_parsers.html">if_p
</a>(cond)[P]
<br />
373 <a href=
"dynamic_parsers.html">if_p
</a>(cond)[P].
<a href=
"dynamic_parsers.html">else_p
</a>[P]
</code></td>
374 <td class=
"table_cells">Matches depending on a condition
</td>
378 <td class=
"table_cells"><code><a href=
"the_lazy_parser.html">lazy_p
</a>(P)
</code></td>
379 <td class=
"table_cells">Evaluates a parser at run time
</td>
382 <td class=
"table_cells"><code><a href=
"list_parsers.html">list_p
</a> <br />
383 <a href=
"list_parsers.html">list_p
</a>(del)
<br />
384 <a href=
"list_parsers.html">list_p
</a>(item, del)
<br />
385 <a href=
"list_parsers.html">list_p
</a>(item, del, end)
</code></td>
386 <td class=
"table_cells">Matches a delimited list
</td>
390 <td class=
"table_cells"><code><a href=
"loops.html">repeat_p
</a>(num)[P]
<br />
391 <a href=
"loops.html">repeat_p
</a>(min, max)[P]
<br />
392 <a href=
"loops.html">repeat_p
</a>(min,
<a href=
"loops.html">more
</a>)[P]
</code></td>
393 <td class=
"table_cells">Matches multiple times
</td>
396 <td class=
"table_cells"><code><a href=
"dynamic_parsers.html">while_p
</a> (cond) [P]
</code></td>
397 <td class=
"table_cells">Matches while a condition is true
</td>
401 <td class=
"table_title" colspan=
"2" id=
"general_directives"><a name=
"general_directives"></a>General directives
</td>
405 <td class=
"table_cells"><code><a href=
"directives.html">as_lower_d
</a>[P]
</code></td>
406 <td class=
"table_cells">Converts text to lower case before matching
</td>
410 <td class=
"table_cells"><code><a href=
"refactoring.html">attach_action_d
</a>[(P1
411 op P2)[act]]
</code></td>
412 <td class=
"table_cells">Transforms to
<b>P1 [act] op P2 [act]
</b></td>
416 <td class=
"table_cells"><code><a href=
"directives.html">lexeme_d
</a>[P]
</code></td>
417 <td class=
"table_cells">Turns off whitespace skipping
</td>
421 <td class=
"table_cells"><code><a href=
"directives.html">limit_d
</a>[P](min,
423 <td class=
"table_cells">Matches only if the value is within the range
</td>
427 <td class=
"table_cells"><code><a href=
"directives.html">longest_d
</a>[P]
</code></td>
428 <td class=
"table_cells">Matches the longest of alternatives
</td>
432 <td class=
"table_cells"><code><a href=
"directives.html">max_limit_d
</a>[P](max)
</code></td>
433 <td class=
"table_cells">Matches only if
<b>value
<= max
</b></td>
437 <td class=
"table_cells"><code><a href=
"directives.html">min_limit_d
</a>[P](min)
</code></td>
438 <td class=
"table_cells">Matches only if
<b>value
>= min
</b></td>
442 <td class=
"table_cells"><code><a href=
"refactoring.html">refactor_action_d
</a>[P1
443 [act] op P2]
</code></td>
444 <td class=
"table_cells">Transforms to
<b>(P1 op P2) [act]
</b></td>
448 <td class=
"table_cells"><code><a href=
"refactoring.html">refactor_unary_d
</a>[op1
449 P1 op2 P2]
</code></td>
450 <td class=
"table_cells">Transforms to
<b>op1 (P1 op2 P2)
</b></td>
454 <td class=
"table_cells"><code><a href=
"scoped_lock.html">scoped_lock_d
</a>[P](mutex)
</code></td>
455 <td class=
"table_cells">Locks a mutex while matching
</td>
459 <td class=
"table_cells"><code><a href=
"directives.html">shortest_d
</a>[P]
</code></td>
460 <td class=
"table_cells">Matches the shortest of alternatives
</td>
464 <td class=
"table_title" colspan=
"2"><a name=
"tree_specific_directives"></a>Tree-specific directives
</td>
468 <td class=
"table_cells"><code><a href=
"trees.html">access_node_d
</a>[P]
</code></td>
469 <td class=
"table_cells">Passes node value to action
</td>
473 <td class=
"table_cells"><code><a href=
"trees.html">discard_first_node_d
</a>[P]
</code></td>
474 <td class=
"table_cells">Discards first node
</td>
478 <td class=
"table_cells"><code><a href=
"trees.html">discard_last_node_d
</a>[P]
</code></td>
479 <td class=
"table_cells">Discards last node
</td>
483 <td class=
"table_cells"><code><a href=
"trees.html">discard_node_d
</a>[P]
</code></td>
484 <td class=
"table_cells">Discards the generated node
</td>
488 <td class=
"table_cells"><code><a href=
"trees.html">infix_node_d
</a>[P]
</code></td>
489 <td class=
"table_cells">Discards even-position nodes
</td>
493 <td class=
"table_cells"><code><a href=
"trees.html">inner_node_d
</a>[P]
</code></td>
494 <td class=
"table_cells">Discards first and last nodes
</td>
498 <td class=
"table_cells"><code><a href=
"trees.html">leaf_node_d
</a>[P]
</code></td>
499 <td class=
"table_cells">Generates a single node with no children
</td>
503 <td class=
"table_cells"><code><a href=
"trees.html">no_node_d
</a>[P]
</code></td>
504 <td class=
"table_cells">Does not generate a node
</td>
508 <td class=
"table_cells"><code><a href=
"trees.html">root_node_d
</a>[P]
</code></td>
509 <td class=
"table_cells">Identifies root nodes for an AST
</td>
513 <td class=
"table_cells"><code><a href=
"trees.html">token_node_d
</a>[P]
</code></td>
514 <td class=
"table_cells">Synonym for
<b>leaf_node_d
</b></td>
518 <td class=
"table_title" colspan=
"2"><a name=
"unary_operators"></a>Unary operators
</td>
522 <td class=
"table_cells"><code><a href=
"operators.html">!P
</a></code></td>
523 <td class=
"table_cells">Matches
<b>P
</b> or an empty string
</td>
527 <td class=
"table_cells"><code><a href=
"operators.html">*P
</a></code></td>
528 <td class=
"table_cells">Matches
<b>P
</b> zero or more times
</td>
532 <td class=
"table_cells"><code><a href=
"operators.html">+P
</a></code></td>
533 <td class=
"table_cells">Matches
<b>P
</b> one or more times
</td>
537 <td class=
"table_cells"><code><a href=
"primitives.html">~P
</a></code></td>
538 <td class=
"table_cells">Matches anything that does not match
<b>P
</b></td>
542 <td class=
"table_title" colspan=
"2"><a name=
"binary_operators"></a>Binary operators
</td>
545 <td class=
"table_cells"><code><a href=
"operators.html">P1 % P2
</a></code></td>
546 <td class=
"table_cells">Matches one or more
<b>P1
</b> separated by
<b>P2
</b></td>
549 <td class=
"table_cells"><code><a href=
"operators.html">P1 - P2
</a></code></td>
550 <td class=
"table_cells">Matches
<b>P1
</b> but not
<b>P2
</b></td>
553 <td class=
"table_cells"><code><a href=
"operators.html">P1
>> P2
</a></code></td>
554 <td class=
"table_cells">Matches
<b>P1
</b> followed by
<b>P2
</b></td>
557 <td class=
"table_cells"><code><a href=
"operators.html">P1
& P2
</a></code></td>
558 <td class=
"table_cells">Matches both
<b>P1
</b> and
<b>P2
</b></td>
561 <td class=
"table_cells"><code><a href=
"operators.html">P1 ^ P2
</a></code></td>
562 <td class=
"table_cells">Matches
<b>P1
</b> or
<b>P2
</b>, but not both
</td>
565 <td class=
"table_cells"><code><a href=
"operators.html">P1 | P2
</a></code></td>
566 <td class=
"table_cells">Matches
<b>P1
</b> or
<b>P2
</b></td>
569 <td class=
"table_cells"><code><a href=
"operators.html">P1
&& P2
</a></code></td>
570 <td class=
"table_cells">Synonym for
<b>P1
>> P2
</b></td>
573 <td class=
"table_cells"><code><a href=
"operators.html">P1 || P2
</a></code></td>
574 <td class=
"table_cells">Matches
<b>P1 | P2 | P1
>> P2
</b></td>
589 <td width=
"30"><a href=
"../index.html"><img src=
"theme/u_arr.gif" border=
"0"></a></td>
590 <td width=
"30"><a href=
"error_handling.html"><img src=
"theme/l_arr.gif" border=
"0"></a></td>
591 <td width=
"30"><a href=
"includes.html"><img src=
"theme/r_arr.gif" border=
"0"></a></td>
595 <p class=
"copyright">Copyright
© 2003 Ross Smith
<br>
597 <font size=
"2">Use, modification and distribution is subject to the Boost Software
598 License, Version
1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</font></p>