|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r55171 - in trunk/libs/spirit/repository: doc/html doc/html/spirit_repository doc/html/spirit_repository/karma_components/karma_generator_directives doc/html/spirit_repository/qi_components/qi_parser_directives doc/html/spirit_repository/qi_components/qi_parser_primitives doc/qi test/qi
From: hartmut.kaiser_at_[hidden]
Date: 2009-07-30 14:42:22
Author: hkaiser
Date: 2009-07-25 23:34:48 EDT (Sat, 25 Jul 2009)
New Revision: 55171
URL: http://svn.boost.org/trac/boost/changeset/55171
Log:
Spirit: documentation update
Text files modified:
trunk/libs/spirit/repository/doc/html/index.html | 4
trunk/libs/spirit/repository/doc/html/spirit_repository/karma_components/karma_generator_directives/karma_confix_generator.html | 18 ++--
trunk/libs/spirit/repository/doc/html/spirit_repository/preface.html | 8 +-
trunk/libs/spirit/repository/doc/html/spirit_repository/qi_components/qi_parser_directives/qi_distinct_parser.html | 125 +++++++++++++++++++--------------------
trunk/libs/spirit/repository/doc/html/spirit_repository/qi_components/qi_parser_primitives/qi_flush_multi_pass_parser.html | 16 ++--
trunk/libs/spirit/repository/doc/qi/distinct.qbk | 14 ++--
trunk/libs/spirit/repository/test/qi/distinct.cpp | 8 +-
7 files changed, 95 insertions(+), 98 deletions(-)
Modified: trunk/libs/spirit/repository/doc/html/index.html
==============================================================================
--- trunk/libs/spirit/repository/doc/html/index.html (original)
+++ trunk/libs/spirit/repository/doc/html/index.html 2009-07-25 23:34:48 EDT (Sat, 25 Jul 2009)
@@ -34,7 +34,7 @@
<div><p class="copyright">Copyright © 2001-2009 Joel
de Guzman, Hartmut Kaiser</p></div>
<div><div class="legalnotice" title="Legal Notice">
-<a name="id1000060"></a><p>
+<a name="id1009891"></a><p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
@@ -68,7 +68,7 @@
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: July 26, 2009 at 01:16:08 GMT</small></p></td>
+<td align="left"><p><small>Last revised: July 26, 2009 at 03:33:36 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
Modified: trunk/libs/spirit/repository/doc/html/spirit_repository/karma_components/karma_generator_directives/karma_confix_generator.html
==============================================================================
--- trunk/libs/spirit/repository/doc/html/spirit_repository/karma_components/karma_generator_directives/karma_confix_generator.html (original)
+++ trunk/libs/spirit/repository/doc/html/spirit_repository/karma_components/karma_generator_directives/karma_confix_generator.html 2009-07-25 23:34:48 EDT (Sat, 25 Jul 2009)
@@ -27,7 +27,7 @@
Confix Generator</a>
</h4></div></div></div>
<a name="spirit_repository.karma_components.karma_generator_directives.karma_confix_generator.description"></a><h6>
-<a name="id1007299"></a>
+<a name="id1017098"></a>
<a class="link" href="karma_confix_generator.html#spirit_repository.karma_components.karma_generator_directives.karma_confix_generator.description">Description</a>
</h6>
<p>
@@ -94,20 +94,20 @@
tag using a simple: <code class="computeroutput"><span class="identifier">ol</span><span class="special">[</span><span class="string">"Some text"</span><span class="special">]</span></code> (which results in <code class="computeroutput"><span class="special"><</span><span class="identifier">ol</span><span class="special">></span><span class="identifier">Some</span> <span class="identifier">text</span><span class="special"></</span><span class="identifier">ol</span><span class="special">></span></code>).
</p>
<a name="spirit_repository.karma_components.karma_generator_directives.karma_confix_generator.header"></a><h6>
-<a name="id1008223"></a>
+<a name="id1018022"></a>
<a class="link" href="karma_confix_generator.html#spirit_repository.karma_components.karma_generator_directives.karma_confix_generator.header">Header</a>
</h6>
<pre class="programlisting"><span class="comment">// forwards to <boost/spirit/repository/home/karma/confix.hpp>
</span><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">spirit</span><span class="special">/</span><span class="identifier">repository</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">karma_confix</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
</pre>
<a name="spirit_repository.karma_components.karma_generator_directives.karma_confix_generator.synopsis"></a><h6>
-<a name="id1008296"></a>
+<a name="id1018096"></a>
<a class="link" href="karma_confix_generator.html#spirit_repository.karma_components.karma_generator_directives.karma_confix_generator.synopsis">Synopsis</a>
</h6>
<pre class="programlisting"><span class="identifier">confix</span><span class="special">(</span><span class="identifier">prefix</span><span class="special">,</span> <span class="identifier">suffix</span><span class="special">)[</span><span class="identifier">subject</span><span class="special">]</span>
</pre>
<a name="spirit_repository.karma_components.karma_generator_directives.karma_confix_generator.parameters"></a><h6>
-<a name="id1008344"></a>
+<a name="id1018144"></a>
<a class="link" href="karma_confix_generator.html#spirit_repository.karma_components.karma_generator_directives.karma_confix_generator.parameters">Parameters</a>
</h6>
<div class="informaltable"><table class="table">
@@ -176,7 +176,7 @@
All three parameters can be arbitrary complex generators themselves.
</p>
<a name="spirit_repository.karma_components.karma_generator_directives.karma_confix_generator.attribute"></a><h6>
-<a name="id1008503"></a>
+<a name="id1018302"></a>
<a class="link" href="karma_confix_generator.html#spirit_repository.karma_components.karma_generator_directives.karma_confix_generator.attribute">Attribute</a>
</h6>
<p>
@@ -203,7 +203,7 @@
</p></td></tr>
</table></div>
<a name="spirit_repository.karma_components.karma_generator_directives.karma_confix_generator.example"></a><h6>
-<a name="id1008678"></a>
+<a name="id1018477"></a>
<a class="link" href="karma_confix_generator.html#spirit_repository.karma_components.karma_generator_directives.karma_confix_generator.example">Example</a>
</h6>
<p>
@@ -212,7 +212,7 @@
styles and a function prototype (for the full example code see here: confix.cpp)
</p>
<a name="spirit_repository.karma_components.karma_generator_directives.karma_confix_generator.prerequisites"></a><h6>
-<a name="id1008708"></a>
+<a name="id1018507"></a>
<a class="link" href="karma_confix_generator.html#spirit_repository.karma_components.karma_generator_directives.karma_confix_generator.prerequisites">Prerequisites</a>
</h6>
<p>
@@ -250,7 +250,7 @@
<p>
</p>
<a name="spirit_repository.karma_components.karma_generator_directives.karma_confix_generator.generating_different_comment_styles"></a><h6>
-<a name="id1008952"></a>
+<a name="id1018751"></a>
<a class="link" href="karma_confix_generator.html#spirit_repository.karma_components.karma_generator_directives.karma_confix_generator.generating_different_comment_styles">Generating
Different Comment Styles</a>
</h6>
@@ -302,7 +302,7 @@
*/</span> </code>.
</p>
<a name="spirit_repository.karma_components.karma_generator_directives.karma_confix_generator.generating_a_function_prototype"></a><h6>
-<a name="id1009253"></a>
+<a name="id1019052"></a>
<a class="link" href="karma_confix_generator.html#spirit_repository.karma_components.karma_generator_directives.karma_confix_generator.generating_a_function_prototype">Generating
a Function Prototype</a>
</h6>
Modified: trunk/libs/spirit/repository/doc/html/spirit_repository/preface.html
==============================================================================
--- trunk/libs/spirit/repository/doc/html/spirit_repository/preface.html (original)
+++ trunk/libs/spirit/repository/doc/html/spirit_repository/preface.html 2009-07-25 23:34:48 EDT (Sat, 25 Jul 2009)
@@ -27,7 +27,7 @@
<a name="spirit_repository.preface"></a><a class="link" href="preface.html" title="Preface">Preface</a>
</h2></div></div></div>
<a name="spirit_repository.preface.the_spirit_repository"></a><h4>
-<a name="id1000090"></a>
+<a name="id1009921"></a>
<a class="link" href="preface.html#spirit_repository.preface.the_spirit_repository">The Spirit
Repository</a>
</h4>
@@ -40,7 +40,7 @@
General List</a>.
</p>
<a name="spirit_repository.preface.how_to_use_this_manual"></a><h4>
-<a name="id1000125"></a>
+<a name="id1009956"></a>
<a class="link" href="preface.html#spirit_repository.preface.how_to_use_this_manual">How to use
this manual</a>
</h4>
@@ -49,7 +49,7 @@
icons precede some text to indicate:
</p>
<div class="table">
-<a name="id1000138"></a><p class="title"><b>Table 1. Icons</b></p>
+<a name="id1009969"></a><p class="title"><b>Table 1. Icons</b></p>
<div class="table-contents"><table class="table" summary="Icons">
<colgroup>
<col>
@@ -170,7 +170,7 @@
Tools</a>.
</p>
<a name="spirit_repository.preface.support"></a><h4>
-<a name="id1000380"></a>
+<a name="id1010210"></a>
<a class="link" href="preface.html#spirit_repository.preface.support">Support</a>
</h4>
<p>
Modified: trunk/libs/spirit/repository/doc/html/spirit_repository/qi_components/qi_parser_directives/qi_distinct_parser.html
==============================================================================
--- trunk/libs/spirit/repository/doc/html/spirit_repository/qi_components/qi_parser_directives/qi_distinct_parser.html (original)
+++ trunk/libs/spirit/repository/doc/html/spirit_repository/qi_components/qi_parser_directives/qi_distinct_parser.html 2009-07-25 23:34:48 EDT (Sat, 25 Jul 2009)
@@ -28,7 +28,7 @@
Distinct Parser</a>
</h4></div></div></div>
<a name="spirit_repository.qi_components.qi_parser_directives.qi_distinct_parser.description"></a><h6>
-<a name="id1001682"></a>
+<a name="id1011512"></a>
<a class="link" href="qi_distinct_parser.html#spirit_repository.qi_components.qi_parser_directives.qi_distinct_parser.description">Description</a>
</h6>
<p>
@@ -51,14 +51,14 @@
<p>
It might seem unexpected, but the parser above matches all three inputs
just fine, even if the third input should not match at all! In order to
- avoid the unwanted we are forced to make our rule more complicated, intermixing
- the intended syntactic analysis with semantic verification:
+ avoid the unwanted match we are forced to make our rule more complicated,
+ intermixing the intended syntactic analysis with semantic verification:
</p>
<pre class="programlisting"><span class="identifier">lexeme</span><span class="special">[</span><span class="string">"declare"</span> <span class="special">>></span> <span class="special">&</span><span class="identifier">char_</span><span class="special">(</span><span class="string">"a-zA-Z_0-9"</span><span class="special">)]</span> <span class="special">>></span> <span class="special">-</span><span class="identifier">lit</span><span class="special">(</span><span class="string">":"</span><span class="special">)</span> <span class="special">>></span> <span class="special">*(</span><span class="identifier">char_</span> <span class="special">-</span> <span class="identifier">eol</span><span class="special">)</span>
</pre>
<p>
- (the rule reads as: match declare as long as it's not <span class="emphasis"><em>directly</em></span>
- followed by a valid identifier).
+ (the rule reads as: match <code class="computeroutput"><span class="string">"declare"</span></code>
+ as long as it's not <span class="emphasis"><em>directly</em></span> followed by a valid identifier).
</p>
<p>
The <code class="computeroutput"><span class="identifier">distinct</span><span class="special">[]</span></code>
@@ -70,74 +70,71 @@
<p>
Using the <code class="computeroutput"><span class="identifier">distinct</span><span class="special">[]</span></code>
component instead of the explicit sequence has the advantage of being able
- to encapsulate the tail as separate parser construct. The following code
+ to encapsulate the tail as a separate parser construct. The following code
snippet illustrates the idea (for the full code of this example please
- see distinct.cpp:
+ see distinct.cpp):
</p>
<p>
</p>
<p>
</p>
-<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">distinct</span>
-<span class="special">{</span>
- <span class="keyword">namespace</span> <span class="identifier">spirit</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">;</span>
- <span class="keyword">namespace</span> <span class="identifier">ascii</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">ascii</span><span class="special">;</span>
- <span class="keyword">namespace</span> <span class="identifier">repo</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">repository</span><span class="special">;</span>
-
- <span class="comment">// Define metafunctions allowing to compute the type of the distinct()
-</span> <span class="comment">// and ascii::char_() constructs
-</span> <span class="keyword">namespace</span> <span class="identifier">traits</span>
- <span class="special">{</span>
- <span class="comment">// Metafunction allowing to get the type of any repository::distinct(...)
-</span> <span class="comment">// construct
-</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Tail</span><span class="special">></span>
- <span class="keyword">struct</span> <span class="identifier">distinct_spec</span>
- <span class="special">{</span>
- <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">spirit</span><span class="special">::</span><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">terminal</span><span class="special"><</span>
- <span class="identifier">repository</span><span class="special">::</span><span class="identifier">tag</span><span class="special">::</span><span class="identifier">distinct</span><span class="special">(</span><span class="identifier">Tail</span><span class="special">)</span>
- <span class="special">>::</span><span class="identifier">type</span> <span class="identifier">type</span><span class="special">;</span>
- <span class="special">};</span>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">spirit</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">;</span>
+<span class="keyword">namespace</span> <span class="identifier">ascii</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">ascii</span><span class="special">;</span>
+<span class="keyword">namespace</span> <span class="identifier">repo</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">repository</span><span class="special">;</span>
- <span class="comment">// Metafunction allowing to get the type of any ascii::char_(...) construct
-</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">String</span><span class="special">></span>
- <span class="keyword">struct</span> <span class="identifier">char__spec</span>
- <span class="special">{</span>
- <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">spirit</span><span class="special">::</span><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">terminal</span><span class="special"><</span>
- <span class="identifier">spirit</span><span class="special">::</span><span class="identifier">tag</span><span class="special">::</span><span class="identifier">ascii</span><span class="special">::</span><span class="identifier">char_</span><span class="special">(</span><span class="identifier">String</span><span class="special">)</span>
- <span class="special">>::</span><span class="identifier">type</span> <span class="identifier">type</span><span class="special">;</span>
- <span class="special">};</span>
- <span class="special">};</span>
-
- <span class="comment">// Define a helper function allowing to create a distinct() construct from
-</span> <span class="comment">// an arbitrary tail parser
+<span class="comment">// Define metafunctions allowing to compute the type of the distinct()
+</span><span class="comment">// and ascii::char_() constructs
+</span><span class="keyword">namespace</span> <span class="identifier">traits</span>
+<span class="special">{</span>
+ <span class="comment">// Metafunction allowing to get the type of any repository::distinct(...)
+</span> <span class="comment">// construct
</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Tail</span><span class="special">></span>
- <span class="keyword">inline</span> <span class="keyword">typename</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">distinct_spec</span><span class="special"><</span><span class="identifier">Tail</span><span class="special">>::</span><span class="identifier">type</span>
- <span class="identifier">distinct_spec</span><span class="special">(</span><span class="identifier">Tail</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">tail</span><span class="special">)</span>
+ <span class="keyword">struct</span> <span class="identifier">distinct_spec</span>
<span class="special">{</span>
- <span class="keyword">return</span> <span class="identifier">repo</span><span class="special">::</span><span class="identifier">distinct</span><span class="special">(</span><span class="identifier">tail</span><span class="special">);</span>
- <span class="special">}</span>
+ <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">spirit</span><span class="special">::</span><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">terminal</span><span class="special"><</span>
+ <span class="identifier">repository</span><span class="special">::</span><span class="identifier">tag</span><span class="special">::</span><span class="identifier">distinct</span><span class="special">(</span><span class="identifier">Tail</span><span class="special">)</span>
+ <span class="special">>::</span><span class="identifier">type</span> <span class="identifier">type</span><span class="special">;</span>
+ <span class="special">};</span>
- <span class="comment">// Define a helper function allowing to create a ascii::char_() construct
-</span> <span class="comment">// from an arbitrary string representation
+ <span class="comment">// Metafunction allowing to get the type of any ascii::char_(...) construct
</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">String</span><span class="special">></span>
- <span class="keyword">inline</span> <span class="keyword">typename</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">char__spec</span><span class="special"><</span><span class="identifier">String</span><span class="special">>::</span><span class="identifier">type</span>
- <span class="identifier">char__spec</span><span class="special">(</span><span class="identifier">String</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">str</span><span class="special">)</span>
+ <span class="keyword">struct</span> <span class="identifier">char__spec</span>
<span class="special">{</span>
- <span class="keyword">return</span> <span class="identifier">ascii</span><span class="special">::</span><span class="identifier">char_</span><span class="special">(</span><span class="identifier">str</span><span class="special">);</span>
- <span class="special">}</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">spirit</span><span class="special">::</span><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">terminal</span><span class="special"><</span>
+ <span class="identifier">spirit</span><span class="special">::</span><span class="identifier">tag</span><span class="special">::</span><span class="identifier">ascii</span><span class="special">::</span><span class="identifier">char_</span><span class="special">(</span><span class="identifier">String</span><span class="special">)</span>
+ <span class="special">>::</span><span class="identifier">type</span> <span class="identifier">type</span><span class="special">;</span>
+ <span class="special">};</span>
+<span class="special">};</span>
- <span class="comment">// the following constructs the type of a distinct_spec holding
-</span> <span class="comment">// charset("0-9a-zA-Z_") as its tail parser
-</span> <span class="keyword">typedef</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">char__spec</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">charset_tag_type</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">distinct_spec</span><span class="special"><</span><span class="identifier">charset_tag_type</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">keyword_tag_type</span><span class="special">;</span>
+<span class="comment">// Define a helper function allowing to create a distinct() construct from
+</span><span class="comment">// an arbitrary tail parser
+</span><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Tail</span><span class="special">></span>
+<span class="keyword">inline</span> <span class="keyword">typename</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">distinct_spec</span><span class="special"><</span><span class="identifier">Tail</span><span class="special">>::</span><span class="identifier">type</span>
+<span class="identifier">distinct_spec</span><span class="special">(</span><span class="identifier">Tail</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">tail</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">repo</span><span class="special">::</span><span class="identifier">distinct</span><span class="special">(</span><span class="identifier">tail</span><span class="special">);</span>
+<span class="special">}</span>
- <span class="comment">// Define a new Qi keyword directive usable as a shortcut for a
-</span> <span class="comment">// repository::distinct(char_(std::string("0-9a-zA-Z_")))
-</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="keyword">const</span> <span class="identifier">keyword_spec</span><span class="special">(</span><span class="string">"0-9a-zA-Z_"</span><span class="special">);</span>
- <span class="identifier">keyword_tag_type</span> <span class="keyword">const</span> <span class="identifier">keyword</span> <span class="special">=</span> <span class="identifier">distinct_spec</span><span class="special">(</span><span class="identifier">char__spec</span><span class="special">(</span><span class="identifier">keyword_spec</span><span class="special">));</span>
+<span class="comment">// Define a helper function allowing to create a ascii::char_() construct
+</span><span class="comment">// from an arbitrary string representation
+</span><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">String</span><span class="special">></span>
+<span class="keyword">inline</span> <span class="keyword">typename</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">char__spec</span><span class="special"><</span><span class="identifier">String</span><span class="special">>::</span><span class="identifier">type</span>
+<span class="identifier">char__spec</span><span class="special">(</span><span class="identifier">String</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">str</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">ascii</span><span class="special">::</span><span class="identifier">char_</span><span class="special">(</span><span class="identifier">str</span><span class="special">);</span>
<span class="special">}</span>
+
+<span class="comment">// the following constructs the type of a distinct_spec holding a
+</span><span class="comment">// charset("0-9a-zA-Z_") as its tail parser
+</span><span class="keyword">typedef</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">char__spec</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">charset_tag_type</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">distinct_spec</span><span class="special"><</span><span class="identifier">charset_tag_type</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">keyword_tag_type</span><span class="special">;</span>
+
+<span class="comment">// Define a new Qi 'keyword' directive usable as a shortcut for a
+</span><span class="comment">// repository::distinct(char_(std::string("0-9a-zA-Z_")))
+</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="keyword">const</span> <span class="identifier">keyword_spec</span><span class="special">(</span><span class="string">"0-9a-zA-Z_"</span><span class="special">);</span>
+<span class="identifier">keyword_tag_type</span> <span class="keyword">const</span> <span class="identifier">keyword</span> <span class="special">=</span> <span class="identifier">distinct_spec</span><span class="special">(</span><span class="identifier">char__spec</span><span class="special">(</span><span class="identifier">keyword_spec</span><span class="special">));</span>
</pre>
<p>
</p>
@@ -147,7 +144,7 @@
These definitions define a new Qi parser recognizing keywords! This allows
to rewrite our declaration parser expression as:
</p>
-<pre class="programlisting"><span class="identifier">distinct</span><span class="special">::</span><span class="identifier">keyword</span><span class="special">[</span><span class="string">"declare"</span><span class="special">]</span> <span class="special">>></span> <span class="special">-</span><span class="identifier">lit</span><span class="special">(</span><span class="string">":"</span><span class="special">)</span> <span class="special">>></span> <span class="special">*(</span><span class="identifier">char_</span> <span class="special">-</span> <span class="identifier">eol</span><span class="special">)</span>
+<pre class="programlisting"><span class="identifier">keyword</span><span class="special">[</span><span class="string">"declare"</span><span class="special">]</span> <span class="special">>></span> <span class="special">-</span><span class="identifier">lit</span><span class="special">(</span><span class="string">":"</span><span class="special">)</span> <span class="special">>></span> <span class="special">*(</span><span class="identifier">char_</span> <span class="special">-</span> <span class="identifier">eol</span><span class="special">)</span>
</pre>
<p>
which is much more readable and concise if compared to the original parser
@@ -156,20 +153,20 @@
above.
</p>
<a name="spirit_repository.qi_components.qi_parser_directives.qi_distinct_parser.header"></a><h6>
-<a name="id1005764"></a>
+<a name="id1015563"></a>
<a class="link" href="qi_distinct_parser.html#spirit_repository.qi_components.qi_parser_directives.qi_distinct_parser.header">Header</a>
</h6>
<pre class="programlisting"><span class="comment">// forwards to <boost/spirit/repository/home/qi/distinct.hpp>
</span><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">spirit</span><span class="special">/</span><span class="identifier">repository</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">qi_distinct</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
</pre>
<a name="spirit_repository.qi_components.qi_parser_directives.qi_distinct_parser.synopsis"></a><h6>
-<a name="id1005837"></a>
+<a name="id1015636"></a>
<a class="link" href="qi_distinct_parser.html#spirit_repository.qi_components.qi_parser_directives.qi_distinct_parser.synopsis">Synopsis</a>
</h6>
<pre class="programlisting"><span class="identifier">distinct</span><span class="special">(</span><span class="identifier">tail</span><span class="special">)[</span><span class="identifier">subject</span><span class="special">]</span>
</pre>
<a name="spirit_repository.qi_components.qi_parser_directives.qi_distinct_parser.parameters"></a><h6>
-<a name="id1005877"></a>
+<a name="id1015676"></a>
<a class="link" href="qi_distinct_parser.html#spirit_repository.qi_components.qi_parser_directives.qi_distinct_parser.parameters">Parameters</a>
</h6>
<div class="informaltable"><table class="table">
@@ -222,7 +219,7 @@
All two parameters can be arbitrary complex parsers themselves.
</p>
<a name="spirit_repository.qi_components.qi_parser_directives.qi_distinct_parser.attribute"></a><h6>
-<a name="id1005975"></a>
+<a name="id1015774"></a>
<a class="link" href="qi_distinct_parser.html#spirit_repository.qi_components.qi_parser_directives.qi_distinct_parser.attribute">Attribute</a>
</h6>
<p>
@@ -236,7 +233,7 @@
<pre class="programlisting"><span class="identifier">a</span><span class="special">:</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">b</span><span class="special">:</span> <span class="identifier">B</span> <span class="special">--></span> <span class="identifier">distinct</span><span class="special">(</span><span class="identifier">b</span><span class="special">)[</span><span class="identifier">a</span><span class="special">]:</span> <span class="identifier">A</span>
</pre>
<a name="spirit_repository.qi_components.qi_parser_directives.qi_distinct_parser.example"></a><h6>
-<a name="id1006088"></a>
+<a name="id1015887"></a>
<a class="link" href="qi_distinct_parser.html#spirit_repository.qi_components.qi_parser_directives.qi_distinct_parser.example">Example</a>
</h6>
<p>
@@ -244,7 +241,7 @@
parser. distinct.cpp)
</p>
<a name="spirit_repository.qi_components.qi_parser_directives.qi_distinct_parser.prerequisites"></a><h6>
-<a name="id1006118"></a>
+<a name="id1015917"></a>
<a class="link" href="qi_distinct_parser.html#spirit_repository.qi_components.qi_parser_directives.qi_distinct_parser.prerequisites">Prerequisites</a>
</h6>
<p>
Modified: trunk/libs/spirit/repository/doc/html/spirit_repository/qi_components/qi_parser_primitives/qi_flush_multi_pass_parser.html
==============================================================================
--- trunk/libs/spirit/repository/doc/html/spirit_repository/qi_components/qi_parser_primitives/qi_flush_multi_pass_parser.html (original)
+++ trunk/libs/spirit/repository/doc/html/spirit_repository/qi_components/qi_parser_primitives/qi_flush_multi_pass_parser.html 2009-07-25 23:34:48 EDT (Sat, 25 Jul 2009)
@@ -28,7 +28,7 @@
flush_multi_pass parser</a>
</h4></div></div></div>
<a name="spirit_repository.qi_components.qi_parser_primitives.qi_flush_multi_pass_parser.description"></a><h6>
-<a name="id1000452"></a>
+<a name="id1010282"></a>
<a class="link" href="qi_flush_multi_pass_parser.html#spirit_repository.qi_components.qi_parser_primitives.qi_flush_multi_pass_parser.description">Description</a>
</h6>
<p>
@@ -53,20 +53,20 @@
<code class="computeroutput"><span class="identifier">eps</span></code>).
</p>
<a name="spirit_repository.qi_components.qi_parser_primitives.qi_flush_multi_pass_parser.header"></a><h6>
-<a name="id1000560"></a>
+<a name="id1010390"></a>
<a class="link" href="qi_flush_multi_pass_parser.html#spirit_repository.qi_components.qi_parser_primitives.qi_flush_multi_pass_parser.header">Header</a>
</h6>
<pre class="programlisting"><span class="comment">// forwards to <boost/spirit/repository/home/qi/flush_multi_pass.hpp>
</span><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">spirit</span><span class="special">/</span><span class="identifier">repository</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">qi_flush_multi_pass</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
</pre>
<a name="spirit_repository.qi_components.qi_parser_primitives.qi_flush_multi_pass_parser.synopsis"></a><h6>
-<a name="id1000633"></a>
+<a name="id1010463"></a>
<a class="link" href="qi_flush_multi_pass_parser.html#spirit_repository.qi_components.qi_parser_primitives.qi_flush_multi_pass_parser.synopsis">Synopsis</a>
</h6>
<pre class="programlisting"><span class="identifier">flush_multi_pass</span>
</pre>
<a name="spirit_repository.qi_components.qi_parser_primitives.qi_flush_multi_pass_parser.parameters"></a><h6>
-<a name="id1000654"></a>
+<a name="id1010485"></a>
<a class="link" href="qi_flush_multi_pass_parser.html#spirit_repository.qi_components.qi_parser_primitives.qi_flush_multi_pass_parser.parameters">Parameters</a>
</h6>
<p>
@@ -74,7 +74,7 @@
not require any parameters.
</p>
<a name="spirit_repository.qi_components.qi_parser_primitives.qi_flush_multi_pass_parser.attribute"></a><h6>
-<a name="id1000678"></a>
+<a name="id1010509"></a>
<a class="link" href="qi_flush_multi_pass_parser.html#spirit_repository.qi_components.qi_parser_primitives.qi_flush_multi_pass_parser.attribute">Attribute</a>
</h6>
<p>
@@ -84,7 +84,7 @@
<pre class="programlisting"><span class="identifier">flush_multi_pass</span> <span class="special">--></span> <span class="identifier">unused</span>
</pre>
<a name="spirit_repository.qi_components.qi_parser_primitives.qi_flush_multi_pass_parser.example"></a><h6>
-<a name="id1000728"></a>
+<a name="id1010558"></a>
<a class="link" href="qi_flush_multi_pass_parser.html#spirit_repository.qi_components.qi_parser_primitives.qi_flush_multi_pass_parser.example">Example</a>
</h6>
<p>
@@ -96,7 +96,7 @@
a function prototype (for the full example code see here: flush_multi_pass.cpp)
</p>
<a name="spirit_repository.qi_components.qi_parser_primitives.qi_flush_multi_pass_parser.prerequisites"></a><h6>
-<a name="id1000760"></a>
+<a name="id1010590"></a>
<a class="link" href="qi_flush_multi_pass_parser.html#spirit_repository.qi_components.qi_parser_primitives.qi_flush_multi_pass_parser.prerequisites">Prerequisites</a>
</h6>
<p>
@@ -133,7 +133,7 @@
<p>
</p>
<a name="spirit_repository.qi_components.qi_parser_primitives.qi_flush_multi_pass_parser.clearing_the_internal_buffer"></a><h6>
-<a name="id1000976"></a>
+<a name="id1010806"></a>
<a class="link" href="qi_flush_multi_pass_parser.html#spirit_repository.qi_components.qi_parser_primitives.qi_flush_multi_pass_parser.clearing_the_internal_buffer">Clearing
the internal buffer</a>
</h6>
Modified: trunk/libs/spirit/repository/doc/qi/distinct.qbk
==============================================================================
--- trunk/libs/spirit/repository/doc/qi/distinct.qbk (original)
+++ trunk/libs/spirit/repository/doc/qi/distinct.qbk 2009-07-25 23:34:48 EDT (Sat, 25 Jul 2009)
@@ -26,13 +26,13 @@
It might seem unexpected, but the parser above matches all three inputs just
fine, even if the third input should not match at all! In order to avoid the
-unwanted we are forced to make our rule more complicated, intermixing the
-intended syntactic analysis with semantic verification:
+unwanted match we are forced to make our rule more complicated, intermixing
+the intended syntactic analysis with semantic verification:
lexeme["declare" >> &char_("a-zA-Z_0-9")] >> -lit(":") >> *(char_ - eol)
-(the rule reads as: match declare as long as it's not /directly/ followed by a
-valid identifier).
+(the rule reads as: match `"declare"` as long as it's not /directly/ followed
+by a valid identifier).
The `distinct[]` directive can be used to simplify the rule above, allowing at
the same time to avoid the semantic verification at parse time:
@@ -40,9 +40,9 @@
distinct(char_("a-zA-Z_0-9"))["declare"] >> -lit(":") >> *(char_ - eol)
Using the `distinct[]` component instead of the explicit sequence has the
-advantage of being able to encapsulate the tail as separate parser construct.
+advantage of being able to encapsulate the tail as a separate parser construct.
The following code snippet illustrates the idea (for the full code of this
-example please see [@../../test/qi/distinct.cpp distinct.cpp]:
+example please see [@../../test/qi/distinct.cpp distinct.cpp]):
[import ../test/qi/distinct.cpp]
[qi_distinct_encapsulation]
@@ -50,7 +50,7 @@
These definitions define a new Qi parser recognizing keywords! This allows to
rewrite our declaration parser expression as:
- distinct::keyword["declare"] >> -lit(":") >> *(char_ - eol)
+ keyword["declare"] >> -lit(":") >> *(char_ - eol)
which is much more readable and concise if compared to the original parser
expression. In addition the new `keyword[]` directive has the advantage to be
Modified: trunk/libs/spirit/repository/test/qi/distinct.cpp
==============================================================================
--- trunk/libs/spirit/repository/test/qi/distinct.cpp (original)
+++ trunk/libs/spirit/repository/test/qi/distinct.cpp 2009-07-25 23:34:48 EDT (Sat, 25 Jul 2009)
@@ -23,9 +23,9 @@
using namespace boost;
///////////////////////////////////////////////////////////////////////////////
-//[qi_distinct_encapsulation
namespace distinct
{
+ //[qi_distinct_encapsulation
namespace spirit = boost::spirit;
namespace ascii = boost::spirit::ascii;
namespace repo = boost::spirit::repository;
@@ -73,17 +73,17 @@
return ascii::char_(str);
}
- // the following constructs the type of a distinct_spec holding
+ // the following constructs the type of a distinct_spec holding a
// charset("0-9a-zA-Z_") as its tail parser
typedef traits::char__spec<std::string>::type charset_tag_type;
typedef traits::distinct_spec<charset_tag_type>::type keyword_tag_type;
- // Define a new Qi keyword directive usable as a shortcut for a
+ // Define a new Qi 'keyword' directive usable as a shortcut for a
// repository::distinct(char_(std::string("0-9a-zA-Z_")))
std::string const keyword_spec("0-9a-zA-Z_");
keyword_tag_type const keyword = distinct_spec(char__spec(keyword_spec));
+ //]
}
-//]
///////////////////////////////////////////////////////////////////////////////
int main()
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk