1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>PrimitiveParser</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="../parser_concepts.html" title="Parser Concepts"> 9<link rel="prev" href="parser.html" title="Parser"> 10<link rel="next" href="unaryparser.html" title="UnaryParser"> 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="parser.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../parser_concepts.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="unaryparser.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.reference.parser_concepts.primitiveparser"></a><a class="link" href="primitiveparser.html" title="PrimitiveParser">PrimitiveParser</a> 28</h5></div></div></div> 29<h6> 30<a name="spirit.qi.reference.parser_concepts.primitiveparser.h0"></a> 31 <span class="phrase"><a name="spirit.qi.reference.parser_concepts.primitiveparser.description"></a></span><a class="link" href="primitiveparser.html#spirit.qi.reference.parser_concepts.primitiveparser.description">Description</a> 32 </h6> 33<p> 34 <span class="emphasis"><em>PrimitiveParser</em></span> is the most basic building block 35 that the client uses to build more complex parsers. 36 </p> 37<h6> 38<a name="spirit.qi.reference.parser_concepts.primitiveparser.h1"></a> 39 <span class="phrase"><a name="spirit.qi.reference.parser_concepts.primitiveparser.refinement_of"></a></span><a class="link" href="primitiveparser.html#spirit.qi.reference.parser_concepts.primitiveparser.refinement_of">Refinement 40 of</a> 41 </h6> 42<div class="blockquote"><blockquote class="blockquote"><p> 43 <a class="link" href="parser.html" title="Parser"><code class="computeroutput"><span class="identifier">Parser</span></code></a> 44 </p></blockquote></div> 45<h6> 46<a name="spirit.qi.reference.parser_concepts.primitiveparser.h2"></a> 47 <span class="phrase"><a name="spirit.qi.reference.parser_concepts.primitiveparser.pre_skip"></a></span><a class="link" href="primitiveparser.html#spirit.qi.reference.parser_concepts.primitiveparser.pre_skip">Pre-skip</a> 48 </h6> 49<p> 50 Upon entry to the <code class="computeroutput"><span class="identifier">parse</span></code> 51 member function, a PrimitiveParser is required to do a pre-skip. Leading 52 <code class="computeroutput"><span class="identifier">skip</span></code> characters/tokens 53 will be skipped prior to parsing. Only PrimitiveParsers are required 54 to perform this pre-skip. This is typically carried out through a call 55 to <code class="computeroutput"><span class="identifier">qi</span><span class="special">::</span><span class="identifier">skip_over</span></code>: 56 </p> 57<pre class="programlisting"><span class="identifier">qi</span><span class="special">::</span><span class="identifier">skip_over</span><span class="special">(</span><span class="identifier">f</span><span class="special">,</span> <span class="identifier">l</span><span class="special">,</span> <span class="identifier">skip</span><span class="special">);</span> 58</pre> 59<h6> 60<a name="spirit.qi.reference.parser_concepts.primitiveparser.h3"></a> 61 <span class="phrase"><a name="spirit.qi.reference.parser_concepts.primitiveparser.type_expressions"></a></span><a class="link" href="primitiveparser.html#spirit.qi.reference.parser_concepts.primitiveparser.type_expressions">Type 62 Expressions</a> 63 </h6> 64<div class="informaltable"><table class="table"> 65<colgroup> 66<col> 67<col> 68</colgroup> 69<thead><tr> 70<th> 71 <p> 72 Expression 73 </p> 74 </th> 75<th> 76 <p> 77 Description 78 </p> 79 </th> 80</tr></thead> 81<tbody><tr> 82<td> 83 <p> 84 <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">is_primitive_parser</span><span class="special"><</span><span class="identifier">P</span><span class="special">>::</span><span class="identifier">type</span></code> 85 </p> 86 </td> 87<td> 88 <p> 89 Metafunction that evaluates to <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">true_</span></code> 90 if a certain type, <code class="computeroutput"><span class="identifier">P</span></code>, 91 is a PrimitiveParser, <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">false_</span></code> 92 otherwise (See <a href="../../../../../../../../libs/mpl/doc/refmanual/integral-constant.html" target="_top">MPL 93 Boolean Constant</a>). 94 </p> 95 </td> 96</tr></tbody> 97</table></div> 98<h6> 99<a name="spirit.qi.reference.parser_concepts.primitiveparser.h4"></a> 100 <span class="phrase"><a name="spirit.qi.reference.parser_concepts.primitiveparser.models"></a></span><a class="link" href="primitiveparser.html#spirit.qi.reference.parser_concepts.primitiveparser.models">Models</a> 101 </h6> 102<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 103<li class="listitem"> 104 <a class="link" href="../auxiliary/attr.html" title="Attribute Parser (attr)"><code class="computeroutput"><span class="identifier">attr</span><span class="special">(</span><span class="identifier">attrib</span><span class="special">)</span></code></a> 105 </li> 106<li class="listitem"> 107 <a class="link" href="../auxiliary/eoi.html" title="End of Input Parser (eoi)"><code class="computeroutput"><span class="identifier">eoi</span></code></a> 108 </li> 109<li class="listitem"> 110 <a class="link" href="../auxiliary/eol.html" title="End of Line Parser (eol)"><code class="computeroutput"><span class="identifier">eol</span></code></a> 111 </li> 112<li class="listitem"> 113 <a class="link" href="../auxiliary/eps.html" title="Epsilon Parser (eps)"><code class="computeroutput"><span class="identifier">eps</span></code></a> 114 </li> 115<li class="listitem"> 116 <a class="link" href="../string/symbols.html" title="Symbols Parser (symbols)"><code class="computeroutput"><span class="identifier">symbols</span><span class="special"><></span></code></a> 117 </li> 118</ul></div> 119</div> 120<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 121<td align="left"></td> 122<td align="right"><div class="copyright-footer">Copyright © 2001-2011 Joel de Guzman, Hartmut Kaiser<p> 123 Distributed under the Boost Software License, Version 1.0. (See accompanying 124 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>) 125 </p> 126</div></td> 127</tr></table> 128<hr> 129<div class="spirit-nav"> 130<a accesskey="p" href="parser.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../parser_concepts.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="unaryparser.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 131</div> 132</body> 133</html> 134