|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r53964 - in trunk/libs/spirit/doc: abstracts html html/spirit html/spirit/abstracts html/spirit/lex html/spirit/lex/abstracts html/spirit/lex/reference html/spirit/lex/tutorials html/spirit/qi html/spirit/qi/quick_reference
From: joel_at_[hidden]
Date: 2009-06-15 23:59:02
Author: djowel
Date: 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
New Revision: 53964
URL: http://svn.boost.org/trac/boost/changeset/53964
Log:
Doc updates
Text files modified:
trunk/libs/spirit/doc/abstracts/syntax_diagram.qbk | 45 ++++++++
trunk/libs/spirit/doc/html/index.html | 29 ++--
trunk/libs/spirit/doc/html/spirit/abstracts.html | 99 +++++++++++++++++-
trunk/libs/spirit/doc/html/spirit/abstracts/parsing_expression_grammar.html | 10
trunk/libs/spirit/doc/html/spirit/acknowledgments.html | 2
trunk/libs/spirit/doc/html/spirit/faq.html | 2
trunk/libs/spirit/doc/html/spirit/introduction.html | 8
trunk/libs/spirit/doc/html/spirit/karma.html | 6
trunk/libs/spirit/doc/html/spirit/lex.html | 8
trunk/libs/spirit/doc/html/spirit/lex/abstracts.html | 6
trunk/libs/spirit/doc/html/spirit/lex/abstracts/lexer_states.html | 6
trunk/libs/spirit/doc/html/spirit/lex/abstracts/lexer_static_model.html | 4
trunk/libs/spirit/doc/html/spirit/lex/abstracts/lexer_tokenizing.html | 213 ++++++++++++++++++++++++++++++++++++++-
trunk/libs/spirit/doc/html/spirit/lex/reference.html | 6
trunk/libs/spirit/doc/html/spirit/lex/reference/lexer_class.html | 8
trunk/libs/spirit/doc/html/spirit/lex/tutorials/lexer_quickstart1.html | 16 +-
trunk/libs/spirit/doc/html/spirit/lex/tutorials/lexer_quickstart2.html | 165 ++++++++++++++++++++++++++----
trunk/libs/spirit/doc/html/spirit/lex/tutorials/lexer_quickstart3.html | 43 ++++---
trunk/libs/spirit/doc/html/spirit/qi.html | 68 ++++++------
trunk/libs/spirit/doc/html/spirit/qi/quick_reference.html | 4
trunk/libs/spirit/doc/html/spirit/qi/quick_reference/compound_attribute_rules.html | 2
trunk/libs/spirit/doc/html/spirit/qi/quick_reference/phoenix.html | 2
trunk/libs/spirit/doc/html/spirit/what_s_new.html | 8
23 files changed, 602 insertions(+), 158 deletions(-)
Modified: trunk/libs/spirit/doc/abstracts/syntax_diagram.qbk
==============================================================================
--- trunk/libs/spirit/doc/abstracts/syntax_diagram.qbk (original)
+++ trunk/libs/spirit/doc/abstracts/syntax_diagram.qbk 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -13,6 +13,11 @@
[def __sd_sequence__ [$../images/sequence.png]]
[def __sd_choice__ [$../images/alternative.png]]
[def __sd_optional__ [$../images/optional.png]]
+[def __sd_plus__ [$../images/plus.png]]
+[def __sd_kleene__ [$../images/kleene.png]]
+[def __sd_predicate__ [$../images/predicate.png]]
+[def __sd_and_predicate__ [$../images/and_predicate.png]]
+[def __sd_not_predicate__ [$../images/not_predicate.png]]
In the following section, we will deal with Parsing Expression Grammars
(PEG), a variant of Extended Backus-Naur Form (EBNF) with a different
@@ -24,7 +29,7 @@
charts. Also, the one to one mapping between the diagrams and functions
make it ideal for representing __rd__ parsers.
-[heading Elements of a Syntax Diagram]
+[heading Elements]
All diagrams have one entry and exit point. Arrows connect all possible
paths through the grammar from the entry point to the exit point.
@@ -43,6 +48,8 @@
[:__sd_non_terminals__]
+[heading Constructs]
+
The most basic composition is the Sequence. B follows A:
[:__sd_sequence__]
@@ -58,6 +65,42 @@
[:__sd_optional__]
+Now, the loops. We have the zero-or-more and one-or-more:
+
+[:__sd_kleene__]
+[:__sd_plus__]
+
+Take note that, as in PEG, these behave greedily. If there is another
+'A' just before the end-point, it will always fail because the preceding
+loop has already exhausted all the 'A's and there is nothing more to
+get. This is a crucial difference between PEG and general Context Free
+Grammars (PEGs). This behavior is quite obvious with syntax diagrams as
+they resemble flow-charts.
+
+[heading Predicates]
+
+Now, the following are Syntax Diagram versions PEG predicates. While
+these are not really included in usual Syntax Diagrams, we have it here
+to closely follow PEGs.
+
+First, we introduce a new element, the Predicate:
+
+[:__sd_predicate__]
+
+This is similar to the conditionals in flow charts where the 'No' branch
+is absent and always signals a failed parse.
+
+We have two versions of the predicate, the /And-Predicate/ and the
+/Not-Predicate/:
+
+[:__sd_and_predicate__]
+[:__sd_not_predicate__]
+
+The /And-Predicate/ tries the predicate, P, and succeeds if P succeeds,
+or otherwise fail. The opposite is true with the /Not-Predicate/. It
+tries the predicate, P, and fails if P succeeds, or otherwise succeeds.
+Both versions do a look-ahead but do not consume any input regardless if
+P succeeds or not.
[endsect]
Modified: trunk/libs/spirit/doc/html/index.html
==============================================================================
--- trunk/libs/spirit/doc/html/index.html (original)
+++ trunk/libs/spirit/doc/html/index.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -55,7 +55,7 @@
<dt><span class="section"><a href="spirit/abstracts/parsing_expression_grammar.html">Parsing
Expression Grammar</a></span></dt>
</dl></dd>
-<dt><span class="section">Qi</span></dt>
+<dt><span class="section"> Qi</span></dt>
<dd><dl>
<dt><span class="section">Tutorials</span></dt>
<dd><dl>
@@ -93,7 +93,7 @@
<dt><span class="section">Phoenix</span></dt>
</dl></dd>
</dl></dd>
-<dt><span class="section">Karma</span></dt>
+<dt><span class="section"> Karma</span></dt>
<dd><dl>
<dt><span class="section">Quick Reference</span></dt>
<dd><dl>
@@ -178,11 +178,11 @@
</p>
</blockquote></div>
<a name="spirit.preface.history"></a><h3>
-<a name="id397994"></a>
+<a name="id355261"></a>
<a href="index.html#spirit.preface.history">History</a>
</h3>
<a name="spirit.preface._emphasis_80s__emphasis_"></a><h3>
-<a name="id398008"></a>
+<a name="id398000"></a>
<a href="index.html#spirit.preface._emphasis_80s__emphasis_"><span class="emphasis"><em>80s</em></span></a>
</h3>
<p>
@@ -196,7 +196,7 @@
recursive-descent parser. This worked very well.
</p>
<a name="spirit.preface._emphasis_90s__emphasis_"></a><h3>
-<a name="id398038"></a>
+<a name="id398029"></a>
<a href="index.html#spirit.preface._emphasis_90s__emphasis_"><span class="emphasis"><em>90s</em></span></a>
</h3>
<p>
@@ -240,7 +240,7 @@
here: pre-Spirit.
</p>
<a name="spirit.preface._emphasis_2001_to_2006__emphasis_"></a><h3>
-<a name="id353884"></a>
+<a name="id353888"></a>
<a href="index.html#spirit.preface._emphasis_2001_to_2006__emphasis_"><span class="emphasis"><em>2001
to 2006</em></span></a>
</h3>
@@ -270,7 +270,7 @@
for design and implementation quality, robustness, and reusability.
</p>
<a name="spirit.preface._emphasis_2007__emphasis_"></a><h3>
-<a name="id353937"></a>
+<a name="id355419"></a>
<a href="index.html#spirit.preface._emphasis_2007__emphasis_"><span class="emphasis"><em>2007</em></span></a>
</h3>
<p>
@@ -300,7 +300,7 @@
Templates</a> library called Boost.Proto.
</p>
<a name="spirit.preface.new_ideas__spirit_v2"></a><h3>
-<a name="id355536"></a>
+<a name="id355529"></a>
<a href="index.html#spirit.preface.new_ideas__spirit_v2">New Ideas: Spirit V2</a>
</h3>
<p>
@@ -338,13 +338,12 @@
same underlying component library as for the parser and generator libraries.
</p>
<a name="spirit.preface.how_to_use_this_manual"></a><h3>
-<a name="id355606"></a>
+<a name="id355599"></a>
<a href="index.html#spirit.preface.how_to_use_this_manual">How to use this manual</a>
</h3>
<p>
- Each major section (there are two: <a href="">Qi and
- Karma</a>, and Lex) is roughly divided
- into 3 parts:
+ Each major section (there are 3: Qi, Karma, and Lex)
+ is roughly divided into 3 parts:
</p>
<div class="orderedlist"><ol type="1">
<li>
@@ -369,7 +368,7 @@
icons precede some text to indicate:
</p>
<div class="table">
-<a name="id355672"></a><p class="title"><b>Table 1. Icons</b></p>
+<a name="id355670"></a><p class="title"><b>Table 1. Icons</b></p>
<table class="table" summary="Icons">
<colgroup>
<col>
@@ -454,7 +453,7 @@
Tools</a>.
</p>
<a name="spirit.preface.support"></a><h3>
-<a name="id353447"></a>
+<a name="id353462"></a>
<a href="index.html#spirit.preface.support">Support</a>
</h3>
<p>
@@ -470,7 +469,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: June 13, 2009 at 05:01:54 GMT</small></p></td>
+<td align="left"><p><small>Last revised: June 16, 2009 at 03:57:03 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
Modified: trunk/libs/spirit/doc/html/spirit/abstracts.html
==============================================================================
--- trunk/libs/spirit/doc/html/spirit/abstracts.html (original)
+++ trunk/libs/spirit/doc/html/spirit/abstracts.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -47,16 +47,15 @@
a variant of Extended Backus-Naur Form (EBNF) with a different interpretation.
It is easier to understand PEG using Syntax Diagrams. Syntax diagrams represent
a grammar graphically. It was used extensibly by Niklaus Wirth
- <sup>[<a name="id414438" href="#ftn.id414438">1</a>]</sup>
+ <sup>[<a name="id414442" href="#ftn.id414442">1</a>]</sup>
in the "Pascal User Manual". Syntax Diagrams are easily understandable
with programmers due to its similarity to flow charts. Also, the one to one
mapping between the diagrams and functions make it ideal for representing
[Recursive Descent parsers.
</p>
-<a name="spirit.abstracts.syntax_diagram.elements_of_a_syntax_diagram"></a><h4>
-<a name="id414455"></a>
- <a href="abstracts.html#spirit.abstracts.syntax_diagram.elements_of_a_syntax_diagram">Elements
- of a Syntax Diagram</a>
+<a name="spirit.abstracts.syntax_diagram.elements"></a><h4>
+<a name="id414460"></a>
+ Elements
</h4>
<p>
All diagrams have one entry and exit point. Arrows connect all possible paths
@@ -98,6 +97,10 @@
<p>
</p>
</blockquote></div>
+<a name="spirit.abstracts.syntax_diagram.constructs"></a><h4>
+<a name="id414579"></a>
+ Constructs
+ </h4>
<p>
The most basic composition is the Sequence. B follows A:
</p>
@@ -126,7 +129,7 @@
</p>
</blockquote></div>
<p>
- The optional (can be thought of as zero-or-one):
+ The optional (zero-or-one):
</p>
<div class="blockquote"><blockquote class="blockquote">
<p>
@@ -137,10 +140,92 @@
<p>
</p>
</blockquote></div>
+<p>
+ Now, the loops. We have the zero-or-more and one-or-more:
+ </p>
+<div class="blockquote"><blockquote class="blockquote">
+<p>
+ </p>
+<p>
+ <span class="inlinemediaobject"><img src="../images/kleene.png" alt="kleene"></span>
+ </p>
+<p>
+ </p>
+</blockquote></div>
+<div class="blockquote"><blockquote class="blockquote">
+<p>
+ </p>
+<p>
+ <span class="inlinemediaobject"><img src="../images/plus.png" alt="plus"></span>
+ </p>
+<p>
+ </p>
+</blockquote></div>
+<p>
+ Take note that, as in PEG, these behave greedily. If there is another 'A'
+ just before the end-point, it will always fail because the preceding loop
+ has already exhausted all the 'A's and there is nothing more to get. This
+ is a crucial difference between PEG and general Context Free Grammars (PEGs).
+ This behavior is quite obvious with syntax diagrams as they resemble flow-charts.
+ </p>
+<a name="spirit.abstracts.syntax_diagram.predicates"></a><h4>
+<a name="id414757"></a>
+ Predicates
+ </h4>
+<p>
+ Now, the following are Syntax Diagram versions PEG predicates. While these
+ are not really included in usual Syntax Diagrams, we have it here to closely
+ follow PEGs.
+ </p>
+<p>
+ First, we introduce a new element, the Predicate:
+ </p>
+<div class="blockquote"><blockquote class="blockquote">
+<p>
+ </p>
+<p>
+ <span class="inlinemediaobject"><img src="../images/predicate.png" alt="predicate"></span>
+ </p>
+<p>
+ </p>
+</blockquote></div>
+<p>
+ This is similar to the conditionals in flow charts where the 'No' branch
+ is absent and always signals a failed parse.
+ </p>
+<p>
+ We have two versions of the predicate, the <span class="emphasis"><em>And-Predicate</em></span>
+ and the <span class="emphasis"><em>Not-Predicate</em></span>:
+ </p>
+<div class="blockquote"><blockquote class="blockquote">
+<p>
+ </p>
+<p>
+ <span class="inlinemediaobject"><img src="../images/and_predicate.png" alt="and_predicate"></span>
+ </p>
+<p>
+ </p>
+</blockquote></div>
+<div class="blockquote"><blockquote class="blockquote">
+<p>
+ </p>
+<p>
+ <span class="inlinemediaobject"><img src="../images/not_predicate.png" alt="not_predicate"></span>
+ </p>
+<p>
+ </p>
+</blockquote></div>
+<p>
+ The <span class="emphasis"><em>And-Predicate</em></span> tries the predicate, P, and succeeds
+ if P succeeds, or otherwise fail. The opposite is true with the <span class="emphasis"><em>Not-Predicate</em></span>.
+ It tries the predicate, P, and fails if P succeeds, or otherwise succeeds.
+ Both versions do a look-ahead but do not consume any input regardless if
+ P succeeds or not.
+ </p>
</div>
<div class="footnotes">
<br><hr width="100" align="left">
-<div class="footnote"><p><sup>[<a name="ftn.id414438" href="#id414438">1</a>] </sup>
+<div class="footnote"><p><sup>[<a name="ftn.id414442" href="#id414442">1</a>] </sup>
Niklaus Wirth: The Programming Language Pascal. (July 1973)
</p></div>
</div>
Modified: trunk/libs/spirit/doc/html/spirit/abstracts/parsing_expression_grammar.html
==============================================================================
--- trunk/libs/spirit/doc/html/spirit/abstracts/parsing_expression_grammar.html (original)
+++ trunk/libs/spirit/doc/html/spirit/abstracts/parsing_expression_grammar.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -8,7 +8,7 @@
<link rel="home" href="../../index.html" title="Spirit 2.1">
<link rel="up" href="../abstracts.html" title="Abstracts">
<link rel="previous" href="../abstracts.html" title="Abstracts">
-<link rel="next" href="../qi.html" title="Qi">
+<link rel="next" href="../qi.html" title=" Qi">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -45,7 +45,7 @@
[Abstract Syntax Tree) for each PEG grammar.
</p>
<a name="spirit.abstracts.parsing_expression_grammar.sequences"></a><h4>
-<a name="id414705"></a>
+<a name="id414933"></a>
<a href="parsing_expression_grammar.html#spirit.abstracts.parsing_expression_grammar.sequences">Sequences</a>
</h4>
<p>
@@ -74,7 +74,7 @@
</p></td></tr>
</table></div>
<a name="spirit.abstracts.parsing_expression_grammar.alternatives"></a><h4>
-<a name="id414824"></a>
+<a name="id415052"></a>
<a href="parsing_expression_grammar.html#spirit.abstracts.parsing_expression_grammar.alternatives">Alternatives</a>
</h4>
<p>
@@ -107,7 +107,7 @@
about this $$$).
</p>
<a name="spirit.abstracts.parsing_expression_grammar.loops"></a><h4>
-<a name="id414981"></a>
+<a name="id415210"></a>
<a href="parsing_expression_grammar.html#spirit.abstracts.parsing_expression_grammar.loops">Loops</a>
</h4>
<p>
@@ -149,7 +149,7 @@
We will see more of these other mechanisms shortly.
</p>
<a name="spirit.abstracts.parsing_expression_grammar.difference"></a><h4>
-<a name="id415102"></a>
+<a name="id415330"></a>
<a href="parsing_expression_grammar.html#spirit.abstracts.parsing_expression_grammar.difference">Difference</a>
</h4>
<p>
Modified: trunk/libs/spirit/doc/html/spirit/acknowledgments.html
==============================================================================
--- trunk/libs/spirit/doc/html/spirit/acknowledgments.html (original)
+++ trunk/libs/spirit/doc/html/spirit/acknowledgments.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -50,7 +50,7 @@
<span class="bold"><b>FIXME</b></span>: Add more people
</p>
<a name="spirit.acknowledgments.acknowledgements_from_the_spirit_v1__emphasis_classic__emphasis__documentation"></a><h3>
-<a name="id482395"></a>
+<a name="id487188"></a>
<a href="acknowledgments.html#spirit.acknowledgments.acknowledgements_from_the_spirit_v1__emphasis_classic__emphasis__documentation">Acknowledgements
from the Spirit V1 <span class="emphasis"><em>classic</em></span> Documentation</a>
</h3>
Modified: trunk/libs/spirit/doc/html/spirit/faq.html
==============================================================================
--- trunk/libs/spirit/doc/html/spirit/faq.html (original)
+++ trunk/libs/spirit/doc/html/spirit/faq.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -30,7 +30,7 @@
<div></div>
</div>
<a name="spirit.faq.i_m_very_confused_about_the_header_hell_in_my_boost_spirit_directory__what_s_all_this_about_"></a><h3>
-<a name="id480837"></a>
+<a name="id485631"></a>
<a href="faq.html#spirit.faq.i_m_very_confused_about_the_header_hell_in_my_boost_spirit_directory__what_s_all_this_about_">I'm
very confused about the header hell in my boost/spirit directory. What's all
this about?</a>
Modified: trunk/libs/spirit/doc/html/spirit/introduction.html
==============================================================================
--- trunk/libs/spirit/doc/html/spirit/introduction.html (original)
+++ trunk/libs/spirit/doc/html/spirit/introduction.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -137,7 +137,7 @@
<p>
</p>
<a name="spirit.introduction.a_quick_overview_of_parsing_with__emphasis_spirit_qi__emphasis_"></a><h3>
-<a name="id411293"></a>
+<a name="id411298"></a>
<a href="introduction.html#spirit.introduction.a_quick_overview_of_parsing_with__emphasis_spirit_qi__emphasis_">A
Quick Overview of Parsing with <span class="emphasis"><em>Spirit.Qi</em></span></a>
</h3>
@@ -227,7 +227,7 @@
<tt class="computeroutput"><span class="special">;</span></tt>.
</p>
<a name="spirit.introduction.a_quick_overview_of_output_generation_with__emphasis_spirit_karma__emphasis_"></a><h3>
-<a name="id412500"></a>
+<a name="id412505"></a>
<a href="introduction.html#spirit.introduction.a_quick_overview_of_output_generation_with__emphasis_spirit_karma__emphasis_">A
Quick Overview of Output Generation with <span class="emphasis"><em>Spirit.Karma</em></span></a>
</h3>
@@ -260,7 +260,7 @@
of the same <tt class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="keyword">int</span><span class="special">></span></tt>:
</p>
<div class="table">
-<a name="id412938"></a><p class="title"><b>Table 2. Different output formats for `std::vector<int>`</b></p>
+<a name="id412942"></a><p class="title"><b>Table 2. Different output formats for `std::vector<int>`</b></p>
<table class="table" summary="Different output formats for `std::vector<int>`">
<colgroup>
<col>
@@ -345,7 +345,7 @@
next table gives some related examples.
</p>
<div class="table">
-<a name="id413384"></a><p class="title"><b>Table 3. Different data types usable with the output format
+<a name="id413388"></a><p class="title"><b>Table 3. Different data types usable with the output format
`*(int_ << eol)`</b></p>
<table class="table" summary="Different data types usable with the output format
`*(int_ << eol)`">
Modified: trunk/libs/spirit/doc/html/spirit/karma.html
==============================================================================
--- trunk/libs/spirit/doc/html/spirit/karma.html (original)
+++ trunk/libs/spirit/doc/html/spirit/karma.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -1,7 +1,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Karma</title>
+<title> Karma</title>
<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.65.1">
<link rel="home" href="../index.html" title="Spirit 2.1">
@@ -25,7 +25,7 @@
<div class="section" lang="en">
<div class="titlepage">
<div><div><h2 class="title" style="clear: both">
-<a name="spirit.karma"></a>Karma
+<a name="spirit.karma"></a> Karma
</h2></div></div>
<div></div>
</div>
@@ -1002,7 +1002,7 @@
<span class="identifier">b</span></tt> will be <tt class="computeroutput"><span class="identifier">tuple</span><span class="special"><</span><span class="identifier">A</span><span class="special">,</span> <span class="identifier">B</span><span class="special">></span></tt>.
</p>
<div class="table">
-<a name="id456301"></a><p class="title"><b>Table 5. /Spirit.Karma/ compound generator attribute types</b></p>
+<a name="id456546"></a><p class="title"><b>Table 5. /Spirit.Karma/ compound generator attribute types</b></p>
<table class="table" summary="/Spirit.Karma/ compound generator attribute types">
<colgroup>
<col>
Modified: trunk/libs/spirit/doc/html/spirit/lex.html
==============================================================================
--- trunk/libs/spirit/doc/html/spirit/lex.html (original)
+++ trunk/libs/spirit/doc/html/spirit/lex.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -6,7 +6,7 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.65.1">
<link rel="home" href="../index.html" title="Spirit 2.1">
<link rel="up" href="../index.html" title="Spirit 2.1">
-<link rel="previous" href="karma.html" title="Karma">
+<link rel="previous" href="karma.html" title=" Karma">
<link rel="next" href="lex/tutorials.html" title=" Spirit.Lex
Tutorials">
</head>
@@ -105,7 +105,7 @@
</li>
</ul></div>
<a name="spirit.lex.lexer_introduction.why_use_a_separate_lexer_"></a><h4>
-<a name="id461218"></a>
+<a name="id461463"></a>
<a href="lex.html#spirit.lex.lexer_introduction.why_use_a_separate_lexer_">Why
Use a Separate Lexer?</a>
</h4>
@@ -204,7 +204,7 @@
grammar recognizers.
</p>
<a name="spirit.lex.lexer_introduction.advantages_of_using__emphasis_spirit_lex__emphasis_"></a><h4>
-<a name="id461573"></a>
+<a name="id461807"></a>
<a href="lex.html#spirit.lex.lexer_introduction.advantages_of_using__emphasis_spirit_lex__emphasis_">Advantages
of using <span class="emphasis"><em>Spirit.Lex</em></span></a>
</h4>
@@ -253,7 +253,7 @@
application.
</p>
<a name="spirit.lex.lexer_introduction.the_library_structure_of__emphasis_spirit_lex__emphasis_"></a><h4>
-<a name="id461744"></a>
+<a name="id461977"></a>
<a href="lex.html#spirit.lex.lexer_introduction.the_library_structure_of__emphasis_spirit_lex__emphasis_">The
Library Structure of <span class="emphasis"><em>Spirit.Lex</em></span></a>
</h4>
Modified: trunk/libs/spirit/doc/html/spirit/lex/abstracts.html
==============================================================================
--- trunk/libs/spirit/doc/html/spirit/lex/abstracts.html (original)
+++ trunk/libs/spirit/doc/html/spirit/lex/abstracts.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -100,7 +100,7 @@
of the <span class="emphasis"><em>Spirit.Lex</em></span> library.
</p>
<a name="spirit.lex.abstracts.lexer_primitives.lexer_token_values.the_anatomy_of_a_token"></a><h6>
-<a name="id472498"></a>
+<a name="id474330"></a>
<a href="abstracts.html#spirit.lex.abstracts.lexer_primitives.lexer_token_values.the_anatomy_of_a_token">The
Anatomy of a Token</a>
</h6>
@@ -237,7 +237,7 @@
when it is requested for the first time.
</p>
<a name="spirit.lex.abstracts.lexer_primitives.lexer_token_values.the_physiognomy_of_a_token_definition"></a><h6>
-<a name="id473319"></a>
+<a name="id475137"></a>
<a href="abstracts.html#spirit.lex.abstracts.lexer_primitives.lexer_token_values.the_physiognomy_of_a_token_definition">The
Physiognomy of a Token Definition</a>
</h6>
@@ -310,7 +310,7 @@
</td></tr>
</table></div>
<a name="spirit.lex.abstracts.lexer_primitives.lexer_token_values.examples_of_using__link_linkend__spirit_lex_reference_token_class___code__phrase_role__identifier__lexertl_token__phrase__phrase_role__special___lt__gt___phrase___code___link_"></a><h6>
-<a name="id473729"></a>
+<a name="id475547"></a>
<a href="abstracts.html#spirit.lex.abstracts.lexer_primitives.lexer_token_values.examples_of_using__link_linkend__spirit_lex_reference_token_class___code__phrase_role__identifier__lexertl_token__phrase__phrase_role__special___lt__gt___phrase___code___link_">Examples
of using lexertl_token<></a>
</h6>
Modified: trunk/libs/spirit/doc/html/spirit/lex/abstracts/lexer_states.html
==============================================================================
--- trunk/libs/spirit/doc/html/spirit/lex/abstracts/lexer_states.html (original)
+++ trunk/libs/spirit/doc/html/spirit/lex/abstracts/lexer_states.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -30,17 +30,17 @@
<div></div>
</div>
<a name="spirit.lex.abstracts.lexer_states.controlling_the_lexer_state_from_lexer_semantic_actions"></a><h5>
-<a name="id478050"></a>
+<a name="id482844"></a>
<a href="lexer_states.html#spirit.lex.abstracts.lexer_states.controlling_the_lexer_state_from_lexer_semantic_actions">Controlling
the Lexer State from Lexer Semantic Actions</a>
</h5>
<a name="spirit.lex.abstracts.lexer_states.controlling_the_lexer_state_from_parser_semantic_actions"></a><h5>
-<a name="id478077"></a>
+<a name="id482871"></a>
<a href="lexer_states.html#spirit.lex.abstracts.lexer_states.controlling_the_lexer_state_from_parser_semantic_actions">Controlling
the Lexer State from Parser Semantic Actions</a>
</h5>
<a name="spirit.lex.abstracts.lexer_states.using_a_lexer_state_for_the_skip_parser"></a><h5>
-<a name="id478105"></a>
+<a name="id482898"></a>
<a href="lexer_states.html#spirit.lex.abstracts.lexer_states.using_a_lexer_state_for_the_skip_parser">Using
a Lexer State for the Skip Parser</a>
</h5>
Modified: trunk/libs/spirit/doc/html/spirit/lex/abstracts/lexer_static_model.html
==============================================================================
--- trunk/libs/spirit/doc/html/spirit/lex/abstracts/lexer_static_model.html (original)
+++ trunk/libs/spirit/doc/html/spirit/lex/abstracts/lexer_static_model.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -183,7 +183,7 @@
<p>
</p>
<a name="spirit.lex.abstracts.lexer_static_model.generating_the_static_analyzer"></a><h5>
-<a name="id476189"></a>
+<a name="id480984"></a>
<a href="lexer_static_model.html#spirit.lex.abstracts.lexer_static_model.generating_the_static_analyzer">Generating
the Static Analyzer</a>
</h5>
@@ -232,7 +232,7 @@
the next topic (the full generated code can be viewed here).
</p>
<a name="spirit.lex.abstracts.lexer_static_model.modifying_the_dynamic_analyzer"></a><h5>
-<a name="id476655"></a>
+<a name="id481449"></a>
<a href="lexer_static_model.html#spirit.lex.abstracts.lexer_static_model.modifying_the_dynamic_analyzer">Modifying
the Dynamic Analyzer</a>
</h5>
Modified: trunk/libs/spirit/doc/html/spirit/lex/abstracts/lexer_tokenizing.html
==============================================================================
--- trunk/libs/spirit/doc/html/spirit/lex/abstracts/lexer_tokenizing.html (original)
+++ trunk/libs/spirit/doc/html/spirit/lex/abstracts/lexer_tokenizing.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -33,15 +33,212 @@
</h4></div></div>
<div></div>
</div>
-<a name="spirit.lex.abstracts.lexer_tokenizing._tokenize_function_the_tokenize___function"></a><h5>
-<a name="id474539"></a>
- <a href="lexer_tokenizing.html#spirit.lex.abstracts.lexer_tokenizing._tokenize_function_the_tokenize___function">:tokenize_function
- The tokenize() function</a>
+<a name="spirit.lex.abstracts.lexer_tokenizing.the_tokenize_function"></a><h5>
+<a name="id476355"></a>
+ <a href="lexer_tokenizing.html#spirit.lex.abstracts.lexer_tokenizing.the_tokenize_function">The
+ tokenize function</a>
</h5>
-<a name="spirit.lex.abstracts.lexer_tokenizing._generate_static_function_the_generate_static___function"></a><h5>
-<a name="id474566"></a>
- <a href="lexer_tokenizing.html#spirit.lex.abstracts.lexer_tokenizing._generate_static_function_the_generate_static___function">:generate_static_function
- The generate_static() function</a>
+<p>
+ The <tt class="computeroutput"><span class="identifier">tokenize</span><span class="special">()</span></tt>
+ function is a helper function simplifying the usage of a lexer in a standalone
+ fashion. Consider you have a standalone lexer where all the required functionality
+ is implemented inside of lexer semantic actions. A good example for this
+ is the word_count_lexer
+ described in more detail in the section <a href="../tutorials/lexer_quickstart2.html" title=" Quickstart
+ 2 - A better word counter using Spirit.Lex">Lex
+ Quickstart 2 - A better word counter using <span class="emphasis"><em>Spirit.Lex</em></span></a>.
+ As a reminder, here is the token definition class:
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Lexer</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">word_count_tokens</span> <span class="special">:</span> <span class="identifier">lexer</span><span class="special"><</span><span class="identifier">Lexer</span><span class="special">></span>
+<span class="special">{</span>
+ <span class="identifier">word_count_tokens</span><span class="special">()</span>
+ <span class="special">:</span> <span class="identifier">c</span><span class="special">(</span><span class="number">0</span><span class="special">),</span> <span class="identifier">w</span><span class="special">(</span><span class="number">0</span><span class="special">),</span> <span class="identifier">l</span><span class="special">(</span><span class="number">0</span><span class="special">)</span>
+ <span class="special">,</span> <span class="identifier">word</span><span class="special">(</span><span class="string">"[^ \t\n]+"</span><span class="special">)</span> <span class="comment">// define tokens
+</span> <span class="special">,</span> <span class="identifier">eol</span><span class="special">(</span><span class="string">"\n"</span><span class="special">)</span>
+ <span class="special">,</span> <span class="identifier">any</span><span class="special">(</span><span class="string">"."</span><span class="special">)</span>
+ <span class="special">{</span>
+ <span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">lex</span><span class="special">::</span><span class="identifier">_start</span><span class="special">;</span>
+ <span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">lex</span><span class="special">::</span><span class="identifier">_end</span><span class="special">;</span>
+ <span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">ref</span><span class="special">;</span>
+
+ <span class="comment">// associate tokens with the lexer
+</span> <span class="keyword">this</span><span class="special">-></span><span class="identifier">self</span>
+ <span class="special">=</span> <span class="identifier">word</span> <span class="special">[++</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">w</span><span class="special">),</span> <span class="identifier">ref</span><span class="special">(</span><span class="identifier">c</span><span class="special">)</span> <span class="special">+=</span> <span class="identifier">distance</span><span class="special">(</span><span class="identifier">_start</span><span class="special">,</span> <span class="identifier">_end</span><span class="special">)]</span>
+ <span class="special">|</span> <span class="identifier">eol</span> <span class="special">[++</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">c</span><span class="special">),</span> <span class="special">++</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">l</span><span class="special">)]</span>
+ <span class="special">|</span> <span class="identifier">any</span> <span class="special">[++</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">c</span><span class="special">)]</span>
+ <span class="special">;</span>
+ <span class="special">}</span>
+
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">c</span><span class="special">,</span> <span class="identifier">w</span><span class="special">,</span> <span class="identifier">l</span><span class="special">;</span>
+ <span class="identifier">token_def</span><span class="special"><></span> <span class="identifier">word</span><span class="special">,</span> <span class="identifier">eol</span><span class="special">,</span> <span class="identifier">any</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ The construct used to tokenize the given input, while discarding all generated
+ tokens is a common application of the lexer. For this reason <span class="emphasis"><em>Spirit.Lex</em></span>
+ exposes an API function <tt class="computeroutput"><span class="identifier">tokenize</span><span class="special">()</span></tt> minimizing the code required:
+ </p>
+<pre class="programlisting"><span class="comment">// Read input from the given file
+</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">str</span> <span class="special">(</span><span class="identifier">read_from_file</span><span class="special">(</span><span class="number">1</span> <span class="special">==</span> <span class="identifier">argc</span> <span class="special">?</span> <span class="string">"word_count.input"</span> <span class="special">:</span> <span class="identifier">argv</span><span class="special">[</span><span class="number">1</span><span class="special">]));</span>
+
+<span class="identifier">word_count_tokens</span><span class="special"><</span><span class="identifier">lexer_type</span><span class="special">></span> <span class="identifier">word_count_lexer</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">iterator</span> <span class="identifier">first</span> <span class="special">=</span> <span class="identifier">str</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span>
+
+<span class="comment">// Tokenize all the input, while discarding all generated tokens
+</span><span class="keyword">bool</span> <span class="identifier">r</span> <span class="special">=</span> <span class="identifier">tokenize</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">str</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">word_count_lexer</span><span class="special">);</span>
+</pre>
+<p>
+ This code is completely equivalent to the more verbose version as shown
+ in the section <a href="../tutorials/lexer_quickstart2.html" title=" Quickstart
+ 2 - A better word counter using Spirit.Lex">Lex
+ Quickstart 2 - A better word counter using <span class="emphasis"><em>Spirit.Lex</em></span></a>.
+ The function <tt class="computeroutput"><span class="identifier">tokenize</span><span class="special">()</span></tt>
+ will return either if the end of the input has been reached (in this case
+ the return value will be <tt class="computeroutput"><span class="keyword">true</span></tt>),
+ or if the lexer couldn't match any of the token definitions in the input
+ (in this case the return value will be <tt class="computeroutput"><span class="keyword">false</span></tt>
+ and the iterator <tt class="computeroutput"><span class="identifier">first</span></tt>
+ will point to the first not matched character in the input sequence).
+ </p>
+<p>
+ The prototype of this function is:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Iterator</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Lexer</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="identifier">tokenize</span><span class="special">(</span><span class="identifier">Iterator</span><span class="special">&</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">Iterator</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">Lexer</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">lex</span>
+ <span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Lexer</span><span class="special">::</span><span class="identifier">char_type</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">initial_state</span> <span class="special">=</span> <span class="number">0</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b>where:</b></p>
+<dl>
+<dt><span class="term">Iterator& first</span></dt>
+<dd><p>
+ The begin of the input sequence to tokenize. The value of this iterator
+ will be updated by the lexer, pointing to the first not matched character
+ of the input after the function returns.
+ </p></dd>
+<dt><span class="term">Iterator last</span></dt>
+<dd><p>
+ The end of the input sequence to tokenize.
+ </p></dd>
+<dt><span class="term">Lexer const& lex</span></dt>
+<dd><p>
+ The lexer instance to use for tokenization.
+ </p></dd>
+<dt><span class="term">Lexer::char_type const* initial_state</span></dt>
+<dd><p>
+ This optional parameter can be used to specify the initial lexer state
+ fo rthe tokenization.
+ </p></dd>
+</dl>
+</div>
+<p>
+ A second overload of the <tt class="computeroutput"><span class="identifier">tokenize</span><span class="special">()</span></tt> function allows to specify any arbitrary
+ function or function object to be called for each of the generated tokens.
+ For some applications this is very useful, as it might avoid having lexer
+ semantic actions. For an example of how to use this function, please have
+ a look at word_count_functor.cpp:
+ </p>
+<p>
+ </p>
+<p>
+ The main function simply loads the given file into memory (as a <tt class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span></tt>), instantiates an instance of
+ the token definition template using the correct iterator type (<tt class="computeroutput"><span class="identifier">word_count_tokens</span><span class="special"><</span><span class="keyword">char</span> <span class="keyword">const</span><span class="special">*></span></tt>), and finally calls <tt class="computeroutput"><span class="identifier">lex</span><span class="special">::</span><span class="identifier">tokenize</span></tt>, passing an instance of the
+ counter function object. The return value of <tt class="computeroutput"><span class="identifier">lex</span><span class="special">::</span><span class="identifier">tokenize</span><span class="special">()</span></tt> will be <tt class="computeroutput"><span class="keyword">true</span></tt>
+ if the whole input sequence has been successfully tokenized, and <tt class="computeroutput"><span class="keyword">false</span></tt> otherwise.
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">argc</span><span class="special">,</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">argv</span><span class="special">[])</span>
+<span class="special">{</span>
+ <span class="comment">// these variables are used to count characters, words and lines
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">c</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">w</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">l</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
+
+ <span class="comment">// read input from the given file
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">str</span> <span class="special">(</span><span class="identifier">read_from_file</span><span class="special">(</span><span class="number">1</span> <span class="special">==</span> <span class="identifier">argc</span> <span class="special">?</span> <span class="string">"word_count.input"</span> <span class="special">:</span> <span class="identifier">argv</span><span class="special">[</span><span class="number">1</span><span class="special">]));</span>
+
+ <span class="comment">// create the token definition instance needed to invoke the lexical analyzer
+</span> <span class="identifier">word_count_tokens</span><span class="special"><</span><span class="identifier">lexertl</span><span class="special">::</span><span class="identifier">lexer</span><span class="special"><></span> <span class="special">></span> <span class="identifier">word_count_functor</span><span class="special">;</span>
+
+ <span class="comment">// tokenize the given string, the bound functor gets invoked for each of
+</span> <span class="comment">// the matched tokens
+</span> <span class="keyword">char</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">first</span> <span class="special">=</span> <span class="identifier">str</span><span class="special">.</span><span class="identifier">c_str</span><span class="special">();</span>
+ <span class="keyword">char</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">last</span> <span class="special">=</span> <span class="special">&</span><span class="identifier">first</span><span class="special">[</span><span class="identifier">str</span><span class="special">.</span><span class="identifier">size</span><span class="special">()];</span>
+ <span class="keyword">bool</span> <span class="identifier">r</span> <span class="special">=</span> <span class="identifier">tokenize</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">word_count_functor</span><span class="special">,</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">bind</span><span class="special">(</span><span class="identifier">counter</span><span class="special">(),</span> <span class="identifier">_1</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">c</span><span class="special">),</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">w</span><span class="special">),</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">l</span><span class="special">)));</span>
+
+ <span class="comment">// print results
+</span> <span class="keyword">if</span> <span class="special">(</span><span class="identifier">r</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"lines: "</span> <span class="special"><<</span> <span class="identifier">l</span> <span class="special"><<</span> <span class="string">", words: "</span> <span class="special"><<</span> <span class="identifier">w</span>
+ <span class="special"><<</span> <span class="string">", characters: "</span> <span class="special"><<</span> <span class="identifier">c</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="keyword">else</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">rest</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">);</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Lexical analysis failed\n"</span> <span class="special"><<</span> <span class="string">"stopped at: \""</span>
+ <span class="special"><<</span> <span class="identifier">rest</span> <span class="special"><<</span> <span class="string">"\"\n"</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ Here is the prototype of this <tt class="computeroutput"><span class="identifier">tokenize</span><span class="special">()</span></tt> function overload:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Iterator</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Lexer</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">F</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="identifier">tokenize</span><span class="special">(</span><span class="identifier">Iterator</span><span class="special">&</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">Iterator</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">Lexer</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">lex</span><span class="special">,</span> <span class="identifier">F</span> <span class="identifier">f</span>
+ <span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Lexer</span><span class="special">::</span><span class="identifier">char_type</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">initial_state</span> <span class="special">=</span> <span class="number">0</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b>where:</b></p>
+<dl>
+<dt><span class="term">Iterator& first</span></dt>
+<dd><p>
+ The begin of the input sequence to tokenize. The value of this iterator
+ will be updated by the lexer, pointing to the first not matched character
+ of the input after the function returns.
+ </p></dd>
+<dt><span class="term">Iterator last</span></dt>
+<dd><p>
+ The end of the input sequence to tokenize.
+ </p></dd>
+<dt><span class="term">Lexer const& lex</span></dt>
+<dd><p>
+ The lexer instance to use for tokenization.
+ </p></dd>
+<dt><span class="term">F f</span></dt>
+<dd><p>
+ A function or function object to be called for each matched token.
+ This function is expected to have the prototype: <tt class="computeroutput"><span class="keyword">bool</span>
+ <span class="identifier">f</span><span class="special">(</span><span class="identifier">Lexer</span><span class="special">::</span><span class="identifier">token_type</span><span class="special">);</span></tt>
+ and should return <tt class="computeroutput"><span class="keyword">false</span></tt>
+ if the supplied token instance is invald (the <tt class="computeroutput"><span class="identifier">tokenize</span><span class="special">()</span></tt> function will return immediatly).
+ </p></dd>
+<dt><span class="term">Lexer::char_type const* initial_state</span></dt>
+<dd><p>
+ This optional parameter can be used to specify the initial lexer state
+ fo rthe tokenization.
+ </p></dd>
+</dl>
+</div>
+<a name="spirit.lex.abstracts.lexer_tokenizing.the_generate_static_function"></a><h5>
+<a name="id479360"></a>
+ <a href="lexer_tokenizing.html#spirit.lex.abstracts.lexer_tokenizing.the_generate_static_function">The
+ generate_static function</a>
</h5>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
Modified: trunk/libs/spirit/doc/html/spirit/lex/reference.html
==============================================================================
--- trunk/libs/spirit/doc/html/spirit/lex/reference.html (original)
+++ trunk/libs/spirit/doc/html/spirit/lex/reference.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -57,7 +57,7 @@
<div></div>
</div>
<div class="table">
-<a name="id478197"></a><p class="title"><b>Table 6. Regular expressions support</b></p>
+<a name="id482991"></a><p class="title"><b>Table 6. Regular expressions support</b></p>
<table class="table" summary="Regular expressions support">
<colgroup>
<col>
@@ -388,7 +388,7 @@
</p></td></tr>
</table></div>
<a name="spirit.lex.reference.concepts.lexer.regular_expression_precedence"></a><h6>
-<a name="id480288"></a>
+<a name="id485081"></a>
<a href="reference.html#spirit.lex.reference.concepts.lexer.regular_expression_precedence">Regular
Expression Precedence</a>
</h6>
@@ -407,7 +407,7 @@
</li>
</ul></div>
<a name="spirit.lex.reference.concepts.lexer.macros"></a><h6>
-<a name="id480444"></a>
+<a name="id485237"></a>
<a href="reference.html#spirit.lex.reference.concepts.lexer.macros">Macros</a>
</h6>
<p>
Modified: trunk/libs/spirit/doc/html/spirit/lex/reference/lexer_class.html
==============================================================================
--- trunk/libs/spirit/doc/html/spirit/lex/reference/lexer_class.html (original)
+++ trunk/libs/spirit/doc/html/spirit/lex/reference/lexer_class.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -30,22 +30,22 @@
<div></div>
</div>
<a name="spirit.lex.reference.lexer_class.the_lexertl_lexer_class_implementing_the_dynamic_model"></a><h5>
-<a name="id480650"></a>
+<a name="id485444"></a>
<a href="lexer_class.html#spirit.lex.reference.lexer_class.the_lexertl_lexer_class_implementing_the_dynamic_model">The
lexertl_lexer Class Implementing the Dynamic Model</a>
</h5>
<a name="spirit.lex.reference.lexer_class.the_lexertl_actor_lexer_class_implementing_the_dynamic_model"></a><h5>
-<a name="id480677"></a>
+<a name="id485471"></a>
<a href="lexer_class.html#spirit.lex.reference.lexer_class.the_lexertl_actor_lexer_class_implementing_the_dynamic_model">The
lexertl_actor_lexer Class Implementing the Dynamic Model</a>
</h5>
<a name="spirit.lex.reference.lexer_class.the_lexertl_static_lexer_class_implementing_the_static_model"></a><h5>
-<a name="id480704"></a>
+<a name="id485497"></a>
<a href="lexer_class.html#spirit.lex.reference.lexer_class.the_lexertl_static_lexer_class_implementing_the_static_model">The
lexertl_static_lexer Class Implementing the Static Model</a>
</h5>
<a name="spirit.lex.reference.lexer_class.the_lexertl_static_actor_lexer_class_implementing_the_static_model"></a><h5>
-<a name="id480733"></a>
+<a name="id485527"></a>
<a href="lexer_class.html#spirit.lex.reference.lexer_class.the_lexertl_static_actor_lexer_class_implementing_the_static_model">The
lexertl_static_actor_lexer Class Implementing the Static Model</a>
</h5>
Modified: trunk/libs/spirit/doc/html/spirit/lex/tutorials/lexer_quickstart1.html
==============================================================================
--- trunk/libs/spirit/doc/html/spirit/lex/tutorials/lexer_quickstart1.html (original)
+++ trunk/libs/spirit/doc/html/spirit/lex/tutorials/lexer_quickstart1.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -47,7 +47,7 @@
(for the full example code see here: word_count_functor.cpp).
</p>
<a name="spirit.lex.tutorials.lexer_quickstart1.prerequisites"></a><h5>
-<a name="id462184"></a>
+<a name="id462418"></a>
<a href="lexer_quickstart1.html#spirit.lex.tutorials.lexer_quickstart1.prerequisites">Prerequisites</a>
</h5>
<p>
@@ -86,7 +86,7 @@
<p>
</p>
<a name="spirit.lex.tutorials.lexer_quickstart1.defining_tokens"></a><h5>
-<a name="id462531"></a>
+<a name="id462765"></a>
<a href="lexer_quickstart1.html#spirit.lex.tutorials.lexer_quickstart1.defining_tokens">Defining
Tokens</a>
</h5>
@@ -141,7 +141,7 @@
<p>
</p>
<a name="spirit.lex.tutorials.lexer_quickstart1.doing_the_useful_work"></a><h5>
-<a name="id462980"></a>
+<a name="id463213"></a>
<a href="lexer_quickstart1.html#spirit.lex.tutorials.lexer_quickstart1.doing_the_useful_work">Doing
the Useful Work</a>
</h5>
@@ -206,7 +206,7 @@
as well.
</p>
<a name="spirit.lex.tutorials.lexer_quickstart1.pulling_everything_together"></a><h5>
-<a name="id463677"></a>
+<a name="id463911"></a>
<a href="lexer_quickstart1.html#spirit.lex.tutorials.lexer_quickstart1.pulling_everything_together">Pulling
Everything Together</a>
</h5>
@@ -215,10 +215,8 @@
<p>
The main function simply loads the given file into memory (as a <tt class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span></tt>), instantiates an instance of
the token definition template using the correct iterator type (<tt class="computeroutput"><span class="identifier">word_count_tokens</span><span class="special"><</span><span class="keyword">char</span> <span class="keyword">const</span><span class="special">*></span></tt>), and finally calls <tt class="computeroutput"><span class="identifier">lex</span><span class="special">::</span><span class="identifier">tokenize</span></tt>, passing an instance of the
- counter functor defined above. The return value of <tt class="computeroutput"><span class="identifier">lex</span><span class="special">::</span><span class="identifier">tokenize</span></tt>
- will be <tt class="computeroutput"><span class="keyword">true</span></tt> if the whole
- input sequence has been successfully tokenized, and <tt class="computeroutput"><span class="keyword">false</span></tt>
- otherwise.
+ counter function object. The return value of <tt class="computeroutput"><span class="identifier">lex</span><span class="special">::</span><span class="identifier">tokenize</span><span class="special">()</span></tt> will be <tt class="computeroutput"><span class="keyword">true</span></tt>
+ if the whole input sequence has been successfully tokenized, and <tt class="computeroutput"><span class="keyword">false</span></tt> otherwise.
</p>
<p>
</p>
@@ -261,7 +259,7 @@
<p>
</p>
<a name="spirit.lex.tutorials.lexer_quickstart1.comparing__emphasis_spirit_lex__emphasis__with__ulink_url__http___flex_sourceforge_net___flex__ulink_"></a><h5>
-<a name="id464804"></a>
+<a name="id465041"></a>
<a href="lexer_quickstart1.html#spirit.lex.tutorials.lexer_quickstart1.comparing__emphasis_spirit_lex__emphasis__with__ulink_url__http___flex_sourceforge_net___flex__ulink_">Comparing
<span class="emphasis"><em>Spirit.Lex</em></span> with Flex</a>
</h5>
Modified: trunk/libs/spirit/doc/html/spirit/lex/tutorials/lexer_quickstart2.html
==============================================================================
--- trunk/libs/spirit/doc/html/spirit/lex/tutorials/lexer_quickstart2.html (original)
+++ trunk/libs/spirit/doc/html/spirit/lex/tutorials/lexer_quickstart2.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -49,7 +49,7 @@
options along the lines (for the full example code see here: word_count_lexer.cpp).
</p>
<a name="spirit.lex.tutorials.lexer_quickstart2.prerequisites"></a><h5>
-<a name="id465859"></a>
+<a name="id466097"></a>
<a href="lexer_quickstart2.html#spirit.lex.tutorials.lexer_quickstart2.prerequisites">Prerequisites</a>
</h5>
<p>
@@ -123,7 +123,7 @@
<p>
</p>
<a name="spirit.lex.tutorials.lexer_quickstart2.semantic_actions_in__emphasis_spirit_lex__emphasis_"></a><h5>
-<a name="id466749"></a>
+<a name="id466986"></a>
<a href="lexer_quickstart2.html#spirit.lex.tutorials.lexer_quickstart2.semantic_actions_in__emphasis_spirit_lex__emphasis_">Semantic
Actions in <span class="emphasis"><em>Spirit.Lex</em></span></a>
</h5>
@@ -149,12 +149,13 @@
</span> <span class="special">,</span> <span class="identifier">eol</span><span class="special">(</span><span class="string">"\n"</span><span class="special">)</span>
<span class="special">,</span> <span class="identifier">any</span><span class="special">(</span><span class="string">"."</span><span class="special">)</span>
<span class="special">{</span>
+ <span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">lex</span><span class="special">::</span><span class="identifier">_start</span><span class="special">;</span>
+ <span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">lex</span><span class="special">::</span><span class="identifier">_end</span><span class="special">;</span>
<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">ref</span><span class="special">;</span>
- <span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">distance</span><span class="special">;</span>
<span class="comment">// associate tokens with the lexer
</span> <span class="keyword">this</span><span class="special">-></span><span class="identifier">self</span>
- <span class="special">=</span> <span class="identifier">word</span> <span class="special">[++</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">w</span><span class="special">),</span> <span class="identifier">ref</span><span class="special">(</span><span class="identifier">c</span><span class="special">)</span> <span class="special">+=</span> <span class="identifier">distance</span><span class="special">(</span><span class="identifier">_1</span><span class="special">)]</span>
+ <span class="special">=</span> <span class="identifier">word</span> <span class="special">[++</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">w</span><span class="special">),</span> <span class="identifier">ref</span><span class="special">(</span><span class="identifier">c</span><span class="special">)</span> <span class="special">+=</span> <span class="identifier">distance</span><span class="special">(</span><span class="identifier">_start</span><span class="special">,</span> <span class="identifier">_end</span><span class="special">)]</span>
<span class="special">|</span> <span class="identifier">eol</span> <span class="special">[++</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">c</span><span class="special">),</span> <span class="special">++</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">l</span><span class="special">)]</span>
<span class="special">|</span> <span class="identifier">any</span> <span class="special">[++</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">c</span><span class="special">)]</span>
<span class="special">;</span>
@@ -178,31 +179,42 @@
but it is possible to insert any C++ function or function object as long
as it exposes the interface:
</p>
-<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span> <span class="special">(</span><span class="identifier">Range</span> <span class="identifier">r</span><span class="special">,</span> <span class="identifier">Idtype</span> <span class="identifier">id</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">&</span> <span class="identifier">matched</span><span class="special">,</span> <span class="identifier">Context</span><span class="special">&</span> <span class="identifier">ctx</span><span class="special">);</span>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span> <span class="special">(</span><span class="identifier">Iterator</span><span class="special">&</span> <span class="identifier">start</span><span class="special">,</span> <span class="identifier">Iterator</span><span class="special">&</span> <span class="identifier">end</span><span class="special">,</span> <span class="identifier">pass_flag</span><span class="special">&</span> <span class="identifier">matched</span><span class="special">,</span> <span class="identifier">Idtype</span><span class="special">&</span> <span class="identifier">id</span><span class="special">,</span> <span class="identifier">Context</span><span class="special">&</span> <span class="identifier">ctx</span><span class="special">);</span>
</pre>
<div class="variablelist">
<p class="title"><b>where:</b></p>
<dl>
-<dt><span class="term"><tt class="computeroutput"><span class="identifier">Range</span>
- <span class="identifier">r</span></tt></span></dt>
+<dt><span class="term"><tt class="computeroutput"><span class="identifier">Iterator</span><span class="special">&</span> <span class="identifier">start</span></tt></span></dt>
<dd><p>
- This is a <tt class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">iterator_range</span></tt> holding two iterators
- pointing to the matched range in the underlying input sequence. The
- type of the held iterators is the same as specified while defining
- the type of the <tt class="computeroutput"><span class="identifier">lexertl_lexer</span><span class="special"><...></span></tt> (its first template parameter).
+ This is a the iterator pointing to the begin of the matched range in
+ the underlying input sequence. The type of the iterator is the same
+ as specified while defining the type of the <tt class="computeroutput"><span class="identifier">lexertl_lexer</span><span class="special"><...></span></tt> (its first template parameter).
+ The semantic action is allowed to change the value of this iterator
+ influencing, the matched input sequence.
</p></dd>
-<dt><span class="term"><tt class="computeroutput"><span class="identifier">Idtype</span>
- <span class="identifier">id</span></tt></span></dt>
+<dt><span class="term"><tt class="computeroutput"><span class="identifier">Iterator</span><span class="special">&</span> <span class="identifier">end</span></tt></span></dt>
<dd><p>
- This is the token id of the type <tt class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span></tt>
- for the matched token.
+ This is a the iterator pointing to the end of the matched range in
+ the underlying input sequence. The type of the iterator is the same
+ as specified while defining the type of the <tt class="computeroutput"><span class="identifier">lexertl_lexer</span><span class="special"><...></span></tt> (its first template parameter).
+ The semantic action is allowed to change the value of this iterator
+ influencing, the matched input sequence.
</p></dd>
-<dt><span class="term"><tt class="computeroutput"><span class="keyword">bool</span><span class="special">&</span> <span class="identifier">matched</span></tt></span></dt>
+<dt><span class="term"><tt class="computeroutput"><span class="identifier">pass_flag</span><span class="special">&</span> <span class="identifier">matched</span></tt></span></dt>
<dd><p>
- This boolean value is pre/initialized to <tt class="computeroutput"><span class="keyword">true</span></tt>.
- If the functor sets it to <tt class="computeroutput"><span class="keyword">false</span></tt>
- the lexer stops calling any semantic actions attached to this token
- and behaves as if the token has not been matched in the first place.
+ This value is pre/initialized to <tt class="computeroutput"><span class="identifier">pass_normal</span></tt>.
+ If the semantic action sets it to <tt class="computeroutput"><span class="identifier">pass_fail</span></tt>
+ the behaves as if the token has not been matched in the first place.
+ If the semantic action sets this to <tt class="computeroutput"><span class="identifier">pass_ignore</span></tt>
+ the lexer ignores the current token and tries to match a next token
+ from the input.
+ </p></dd>
+<dt><span class="term"><tt class="computeroutput"><span class="identifier">Idtype</span><span class="special">&</span> <span class="identifier">id</span></tt></span></dt>
+<dd><p>
+ This is the token id of the type Idtype (most of the time this will
+ be a <tt class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span></tt>) for the matched token. The
+ semantic action is allowed to change the value of this token id, influencing
+ the if of the created token.
</p></dd>
<dt><span class="term"><tt class="computeroutput"><span class="identifier">Context</span><span class="special">&</span> <span class="identifier">ctx</span></tt></span></dt>
<dd><p>
@@ -217,9 +229,10 @@
When using a C++ function as the semantic action the following prototypes
are allowed as well:
</p>
-<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span> <span class="special">(</span><span class="identifier">Range</span> <span class="identifier">r</span><span class="special">,</span> <span class="identifier">Idtype</span> <span class="identifier">id</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">&</span> <span class="identifier">matched</span><span class="special">);</span>
-<span class="keyword">void</span> <span class="identifier">f</span> <span class="special">(</span><span class="identifier">Range</span> <span class="identifier">r</span><span class="special">,</span> <span class="identifier">Idtype</span> <span class="identifier">id</span><span class="special">);</span>
-<span class="keyword">void</span> <span class="identifier">f</span> <span class="special">(</span><span class="identifier">Range</span> <span class="identifier">r</span><span class="special">);</span>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span> <span class="special">(</span><span class="identifier">Iterator</span><span class="special">&</span> <span class="identifier">start</span><span class="special">,</span> <span class="identifier">Iterator</span><span class="special">&</span> <span class="identifier">end</span><span class="special">,</span> <span class="identifier">pass_flag</span><span class="special">&</span> <span class="identifier">matched</span><span class="special">,</span> <span class="identifier">Idtype</span><span class="special">&</span> <span class="identifier">id</span><span class="special">);</span>
+<span class="keyword">void</span> <span class="identifier">f</span> <span class="special">(</span><span class="identifier">Iterator</span><span class="special">&</span> <span class="identifier">start</span><span class="special">,</span> <span class="identifier">Iterator</span><span class="special">&</span> <span class="identifier">end</span><span class="special">,</span> <span class="identifier">pass_flag</span><span class="special">&</span> <span class="identifier">matched</span><span class="special">);</span>
+<span class="keyword">void</span> <span class="identifier">f</span> <span class="special">(</span><span class="identifier">Iterator</span><span class="special">&</span> <span class="identifier">start</span><span class="special">,</span> <span class="identifier">Iterator</span><span class="special">&</span> <span class="identifier">end</span><span class="special">);</span>
+<span class="keyword">void</span> <span class="identifier">f</span> <span class="special">();</span>
</pre>
<p>
Even if it is possible to write your own function object implementations
@@ -235,7 +248,7 @@
to the internal lexer context.
</p>
<a name="spirit.lex.tutorials.lexer_quickstart2.associating_token_definitions_with_the_lexer"></a><h5>
-<a name="id468107"></a>
+<a name="id468624"></a>
<a href="lexer_quickstart2.html#spirit.lex.tutorials.lexer_quickstart2.associating_token_definitions_with_the_lexer">Associating
Token Definitions with the Lexer</a>
</h5>
@@ -271,6 +284,110 @@
library internally assigns unique numbers to the token definitions, starting
with the constant defined by <tt class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">lex</span><span class="special">::</span><span class="identifier">min_token_id</span></tt>.
</p>
+<a name="spirit.lex.tutorials.lexer_quickstart2.pulling_everything_together"></a><h5>
+<a name="id469051"></a>
+ <a href="lexer_quickstart2.html#spirit.lex.tutorials.lexer_quickstart2.pulling_everything_together">Pulling
+ everything together</a>
+ </h5>
+<p>
+ In order to execute the code defined above we still need to instantiate
+ an instance of the lexer type, feed it from some input sequence and create
+ a pair of iterators allowing to iterate over the token sequence as created
+ by the lexer. This code shows how to achieve these steps:
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">argc</span><span class="special">,</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">argv</span><span class="special">[])</span>
+<span class="special">{</span>
+
+<span class="callout_bug"><a name="spirit4co" href="lexer_quickstart2.html#spirit4"><img src="../../../../../../../doc/src/images/callouts/1.png" alt="1" border="0"></a></span> <span class="keyword">typedef</span> <span class="identifier">lexertl</span><span class="special">::</span><span class="identifier">token</span><span class="special"><</span><span class="keyword">char</span> <span class="keyword">const</span><span class="special">*,</span> <span class="identifier">omitted</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">false_</span><span class="special">></span> <span class="identifier">token_type</span><span class="special">;</span>
+
+<span class="callout_bug"><a name="spirit5co" href="lexer_quickstart2.html#spirit5"><img src="../../../../../../../doc/src/images/callouts/2.png" alt="2" border="0"></a></span> <span class="keyword">typedef</span> <span class="identifier">lexertl</span><span class="special">::</span><span class="identifier">actor_lexer</span><span class="special"><</span><span class="identifier">token_type</span><span class="special">></span> <span class="identifier">lexer_type</span><span class="special">;</span>
+
+<span class="callout_bug"><a name="spirit6co" href="lexer_quickstart2.html#spirit6"><img src="../../../../../../../doc/src/images/callouts/3.png" alt="3" border="0"></a></span> <span class="identifier">word_count_tokens</span><span class="special"><</span><span class="identifier">lexer_type</span><span class="special">></span> <span class="identifier">word_count_lexer</span><span class="special">;</span>
+
+<span class="callout_bug"><a name="spirit7co" href="lexer_quickstart2.html#spirit7"><img src="../../../../../../../doc/src/images/callouts/4.png" alt="4" border="0"></a></span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">str</span> <span class="special">(</span><span class="identifier">read_from_file</span><span class="special">(</span><span class="number">1</span> <span class="special">==</span> <span class="identifier">argc</span> <span class="special">?</span> <span class="string">"word_count.input"</span> <span class="special">:</span> <span class="identifier">argv</span><span class="special">[</span><span class="number">1</span><span class="special">]));</span>
+ <span class="keyword">char</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">first</span> <span class="special">=</span> <span class="identifier">str</span><span class="special">.</span><span class="identifier">c_str</span><span class="special">();</span>
+ <span class="keyword">char</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">last</span> <span class="special">=</span> <span class="special">&</span><span class="identifier">first</span><span class="special">[</span><span class="identifier">str</span><span class="special">.</span><span class="identifier">size</span><span class="special">()];</span>
+
+<span class="callout_bug"><a name="spirit8co" href="lexer_quickstart2.html#spirit8"><img src="../../../../../../../doc/src/images/callouts/5.png" alt="5" border="0"></a></span> <span class="identifier">lexer_type</span><span class="special">::</span><span class="identifier">iterator_type</span> <span class="identifier">iter</span> <span class="special">=</span> <span class="identifier">word_count_lexer</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">);</span>
+ <span class="identifier">lexer_type</span><span class="special">::</span><span class="identifier">iterator_type</span> <span class="identifier">end</span> <span class="special">=</span> <span class="identifier">word_count_lexer</span><span class="special">.</span><span class="identifier">end</span><span class="special">();</span>
+
+<span class="callout_bug"><a name="spirit9co" href="lexer_quickstart2.html#spirit9"><img src="../../../../../../../doc/src/images/callouts/6.png" alt="6" border="0"></a></span> <span class="keyword">while</span> <span class="special">(</span><span class="identifier">iter</span> <span class="special">!=</span> <span class="identifier">end</span> <span class="special">&&</span> <span class="identifier">token_is_valid</span><span class="special">(*</span><span class="identifier">iter</span><span class="special">))</span>
+ <span class="special">++</span><span class="identifier">iter</span><span class="special">;</span>
+
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">iter</span> <span class="special">==</span> <span class="identifier">end</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"lines: "</span> <span class="special"><<</span> <span class="identifier">word_count_lexer</span><span class="special">.</span><span class="identifier">l</span>
+ <span class="special"><<</span> <span class="string">", words: "</span> <span class="special"><<</span> <span class="identifier">word_count_lexer</span><span class="special">.</span><span class="identifier">w</span>
+ <span class="special"><<</span> <span class="string">", characters: "</span> <span class="special"><<</span> <span class="identifier">word_count_lexer</span><span class="special">.</span><span class="identifier">c</span>
+ <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="keyword">else</span> <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">rest</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">);</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Lexical analysis failed\n"</span> <span class="special"><<</span> <span class="string">"stopped at: \""</span>
+ <span class="special"><<</span> <span class="identifier">rest</span> <span class="special"><<</span> <span class="string">"\"\n"</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ </p>
+<div class="calloutlist"><table border="0" summary="Callout list">
+<tr>
+<td width="5%" valign="top" align="left">
+<a name="spirit4"></a> </td>
+<td valign="top" align="left"><p> Specifying <tt class="computeroutput"><span class="identifier">omitted</span></tt> as
+ the token attribute type generates a token class not holding any token
+ attribute at all (not even the iterator range of the matched input sequence),
+ therefore optimizing the token, the lexer, and possibly the parser implementation
+ as much as possible. Specifying <tt class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">false_</span></tt>
+ as the 3rd template parameter generates a token type and an iterator,
+ both holding no lexer state, allowing for even more aggressive optimizations.
+ As a result the token instances contain the token ids as the only data
+ member. </p></td>
+</tr>
+<tr>
+<td width="5%" valign="top" align="left">
+<a name="spirit5"></a> </td>
+<td valign="top" align="left"><p> This defines the lexer type to use </p></td>
+</tr>
+<tr>
+<td width="5%" valign="top" align="left">
+<a name="spirit6"></a> </td>
+<td valign="top" align="left"><p> Create the lexer object instance
+ needed to invoke the lexical analysis </p></td>
+</tr>
+<tr>
+<td width="5%" valign="top" align="left">
+<a name="spirit7"></a> </td>
+<td valign="top" align="left"><p> Read input from the given file,
+ tokenize all the input, while discarding all generated tokens </p></td>
+</tr>
+<tr>
+<td width="5%" valign="top" align="left">
+<a name="spirit8"></a> </td>
+<td valign="top" align="left"><p> Create
+ a pair of iterators returning the sequence of generated tokens </p></td>
+</tr>
+<tr>
+<td width="5%" valign="top" align="left">
+<a name="spirit9"></a> </td>
+<td valign="top" align="left"><p> Here we
+ simply iterate over all tokens, making sure to break the loop if an invalid
+ token gets returned from the lexer </p></td>
+</tr>
+</table></div>
+<p>
+ </p>
+<p>
+ </p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
Modified: trunk/libs/spirit/doc/html/spirit/lex/tutorials/lexer_quickstart3.html
==============================================================================
--- trunk/libs/spirit/doc/html/spirit/lex/tutorials/lexer_quickstart3.html (original)
+++ trunk/libs/spirit/doc/html/spirit/lex/tutorials/lexer_quickstart3.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -74,7 +74,7 @@
code see here: word_count.cpp).
</p>
<a name="spirit.lex.tutorials.lexer_quickstart3.prerequisites"></a><h5>
-<a name="id468685"></a>
+<a name="id470466"></a>
<a href="lexer_quickstart3.html#spirit.lex.tutorials.lexer_quickstart3.prerequisites">Prerequisites</a>
</h5>
<p>
@@ -124,7 +124,7 @@
<p>
</p>
<a name="spirit.lex.tutorials.lexer_quickstart3.defining_tokens"></a><h5>
-<a name="id469290"></a>
+<a name="id471071"></a>
<a href="lexer_quickstart3.html#spirit.lex.tutorials.lexer_quickstart3.defining_tokens">Defining
Tokens</a>
</h5>
@@ -179,7 +179,7 @@
<p>
</p>
<a name="spirit.lex.tutorials.lexer_quickstart3.using_token_definition_instances_as_parsers"></a><h5>
-<a name="id469766"></a>
+<a name="id471545"></a>
<a href="lexer_quickstart3.html#spirit.lex.tutorials.lexer_quickstart3.using_token_definition_instances_as_parsers">Using
Token Definition Instances as Parsers</a>
</h5>
@@ -335,7 +335,7 @@
</p></td></tr>
</table></div>
<a name="spirit.lex.tutorials.lexer_quickstart3.pulling_everything_together"></a><h5>
-<a name="id471101"></a>
+<a name="id472880"></a>
<a href="lexer_quickstart3.html#spirit.lex.tutorials.lexer_quickstart3.pulling_everything_together">Pulling
Everything Together</a>
</h5>
@@ -355,13 +355,13 @@
</p>
<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">argc</span><span class="special">,</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">argv</span><span class="special">[])</span>
<span class="special">{</span>
-<span class="callout_bug"><a name="spirit4co" href="lexer_quickstart3.html#spirit4"><img src="../../../../../../../doc/src/images/callouts/1.png" alt="1" border="0"></a></span> <span class="keyword">typedef</span> <span class="identifier">lexertl</span><span class="special">::</span><span class="identifier">token</span><span class="special"><</span>
+<span class="callout_bug"><a name="spirit10co" href="lexer_quickstart3.html#spirit10"><img src="../../../../../../../doc/src/images/callouts/1.png" alt="1" border="0"></a></span> <span class="keyword">typedef</span> <span class="identifier">lexertl</span><span class="special">::</span><span class="identifier">token</span><span class="special"><</span>
<span class="keyword">char</span> <span class="keyword">const</span><span class="special">*,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">vector</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="special">></span> <span class="identifier">token_type</span><span class="special">;</span>
-<span class="callout_bug"><a name="spirit5co" href="lexer_quickstart3.html#spirit5"><img src="../../../../../../../doc/src/images/callouts/2.png" alt="2" border="0"></a></span> <span class="keyword">typedef</span> <span class="identifier">lexertl</span><span class="special">::</span><span class="identifier">lexer</span><span class="special"><</span><span class="identifier">token_type</span><span class="special">></span> <span class="identifier">lexer_type</span><span class="special">;</span>
+<span class="callout_bug"><a name="spirit11co" href="lexer_quickstart3.html#spirit11"><img src="../../../../../../../doc/src/images/callouts/2.png" alt="2" border="0"></a></span> <span class="keyword">typedef</span> <span class="identifier">lexertl</span><span class="special">::</span><span class="identifier">lexer</span><span class="special"><</span><span class="identifier">token_type</span><span class="special">></span> <span class="identifier">lexer_type</span><span class="special">;</span>
-<span class="callout_bug"><a name="spirit6co" href="lexer_quickstart3.html#spirit6"><img src="../../../../../../../doc/src/images/callouts/3.png" alt="3" border="0"></a></span> <span class="keyword">typedef</span> <span class="identifier">word_count_tokens</span><span class="special"><</span><span class="identifier">lexer_type</span><span class="special">>::</span><span class="identifier">iterator_type</span> <span class="identifier">iterator_type</span><span class="special">;</span>
+<span class="callout_bug"><a name="spirit12co" href="lexer_quickstart3.html#spirit12"><img src="../../../../../../../doc/src/images/callouts/3.png" alt="3" border="0"></a></span> <span class="keyword">typedef</span> <span class="identifier">word_count_tokens</span><span class="special"><</span><span class="identifier">lexer_type</span><span class="special">>::</span><span class="identifier">iterator_type</span> <span class="identifier">iterator_type</span><span class="special">;</span>
<span class="comment">// now we use the types defined above to create the lexer and grammar
</span> <span class="comment">// object instances needed to invoke the parsing process
@@ -372,12 +372,8 @@
</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">str</span> <span class="special">(</span><span class="identifier">read_from_file</span><span class="special">(</span><span class="number">1</span> <span class="special">==</span> <span class="identifier">argc</span> <span class="special">?</span> <span class="string">"word_count.input"</span> <span class="special">:</span> <span class="identifier">argv</span><span class="special">[</span><span class="number">1</span><span class="special">]));</span>
<span class="keyword">char</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">first</span> <span class="special">=</span> <span class="identifier">str</span><span class="special">.</span><span class="identifier">c_str</span><span class="special">();</span>
<span class="keyword">char</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">last</span> <span class="special">=</span> <span class="special">&</span><span class="identifier">first</span><span class="special">[</span><span class="identifier">str</span><span class="special">.</span><span class="identifier">size</span><span class="special">()];</span>
-
- <span class="comment">// Parsing is done based on the the token stream, not the character
-</span> <span class="comment">// stream read from the input. The function `tokenize_and_parse()` wraps
-</span> <span class="comment">// the passed iterator range `[first, last)` by the lexical analyzer and
-</span> <span class="comment">// uses its exposed iterators to parse the toke stream.
-</span> <span class="keyword">bool</span> <span class="identifier">r</span> <span class="special">=</span> <span class="identifier">tokenize_and_parse</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">word_count</span><span class="special">,</span> <span class="identifier">g</span><span class="special">);</span>
+
+<span class="callout_bug"><a name="spirit13co" href="lexer_quickstart3.html#spirit13"><img src="../../../../../../../doc/src/images/callouts/4.png" alt="4" border="0"></a></span> <span class="keyword">bool</span> <span class="identifier">r</span> <span class="special">=</span> <span class="identifier">tokenize_and_parse</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">word_count</span><span class="special">,</span> <span class="identifier">g</span><span class="special">);</span>
<span class="keyword">if</span> <span class="special">(</span><span class="identifier">r</span><span class="special">)</span> <span class="special">{</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"lines: "</span> <span class="special"><<</span> <span class="identifier">g</span><span class="special">.</span><span class="identifier">l</span> <span class="special"><<</span> <span class="string">", words: "</span> <span class="special"><<</span> <span class="identifier">g</span><span class="special">.</span><span class="identifier">w</span>
@@ -400,22 +396,31 @@
<div class="calloutlist"><table border="0" summary="Callout list">
<tr>
<td width="5%" valign="top" align="left">
-<a name="spirit4"></a> </td>
-<td valign="top" align="left"><p> define the token type to be used: <tt class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span></tt>
+<a name="spirit10"></a> </td>
+<td valign="top" align="left"><p> Define the token type to be used: <tt class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span></tt>
is available as the type of the token attribute </p></td>
</tr>
<tr>
<td width="5%" valign="top" align="left">
-<a name="spirit5"></a> </td>
-<td valign="top" align="left"><p> define the lexer type
+<a name="spirit11"></a> </td>
+<td valign="top" align="left"><p> Define the lexer type
to use implementing the state machine </p></td>
</tr>
<tr>
<td width="5%" valign="top" align="left">
-<a name="spirit6"></a> </td>
-<td valign="top" align="left"><p> define the iterator type exposed
+<a name="spirit12"></a> </td>
+<td valign="top" align="left"><p> Define the iterator type exposed
by the lexer type </p></td>
</tr>
+<tr>
+<td width="5%" valign="top" align="left">
+<a name="spirit13"></a> </td>
+<td valign="top" align="left"><p> Parsing is done based on the the token stream, not
+ the character stream read from the input. The function <tt class="computeroutput"><span class="identifier">tokenize_and_parse</span><span class="special">()</span></tt>
+ wraps the passed iterator range <tt class="computeroutput"><span class="special">[</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">)</span></tt>
+ by the lexical analyzer and uses its exposed iterators to parse the toke
+ stream. </p></td>
+</tr>
</table></div>
<p>
</p>
Modified: trunk/libs/spirit/doc/html/spirit/qi.html
==============================================================================
--- trunk/libs/spirit/doc/html/spirit/qi.html (original)
+++ trunk/libs/spirit/doc/html/spirit/qi.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -1,7 +1,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Qi</title>
+<title> Qi</title>
<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.65.1">
<link rel="home" href="../index.html" title="Spirit 2.1">
@@ -26,7 +26,7 @@
<div class="section" lang="en">
<div class="titlepage">
<div><div><h2 class="title" style="clear: both">
-<a name="spirit.qi"></a>Qi
+<a name="spirit.qi"></a> Qi
</h2></div></div>
<div></div>
</div>
@@ -103,7 +103,7 @@
<div></div>
</div>
<a name="spirit.qi.tutorials.quick_start.why_would_you_want_to_use_spirit_qi_"></a><h5>
-<a name="id415218"></a>
+<a name="id415447"></a>
<a href="qi.html#spirit.qi.tutorials.quick_start.why_would_you_want_to_use_spirit_qi_">Why
would you want to use Spirit.Qi?</a>
</h5>
@@ -154,7 +154,7 @@
on how to build parsers from the simplest parser, building up as we go.
</p>
<a name="spirit.qi.tutorials.warming_up.trivial_example__1_parsing_a_number"></a><h5>
-<a name="id415299"></a>
+<a name="id415527"></a>
<a href="qi.html#spirit.qi.tutorials.warming_up.trivial_example__1_parsing_a_number">Trivial
Example #1 Parsing a number</a>
</h5>
@@ -169,7 +169,7 @@
parsers and consistent naming conventions help you keep from going insane!
</p>
<a name="spirit.qi.tutorials.warming_up.trivial_example__2_parsing_two_numbers"></a><h5>
-<a name="id415345"></a>
+<a name="id415573"></a>
<a href="qi.html#spirit.qi.tutorials.warming_up.trivial_example__2_parsing_two_numbers">Trivial
Example #2 Parsing two numbers</a>
</h5>
@@ -202,7 +202,7 @@
</p></td></tr>
</table></div>
<a name="spirit.qi.tutorials.warming_up.trivial_example__3_parsing_one_or_more_numbers"></a><h5>
-<a name="id415433"></a>
+<a name="id415661"></a>
<a href="qi.html#spirit.qi.tutorials.warming_up.trivial_example__3_parsing_one_or_more_numbers">Trivial
Example #3 Parsing one or more numbers</a>
</h5>
@@ -226,7 +226,7 @@
in most places.
</p>
<a name="spirit.qi.tutorials.warming_up.trivial_example__4_parsing_a_comma_delimited_list_of_numbers"></a><h5>
-<a name="id415510"></a>
+<a name="id415738"></a>
<a href="qi.html#spirit.qi.tutorials.warming_up.trivial_example__4_parsing_a_comma_delimited_list_of_numbers">Trivial
Example #4 Parsing a comma-delimited list of numbers</a>
</h5>
@@ -249,7 +249,7 @@
star encloses the complete expression above.
</p>
<a name="spirit.qi.tutorials.warming_up.let_s_parse_"></a><h5>
-<a name="id415686"></a>
+<a name="id415914"></a>
<a href="qi.html#spirit.qi.tutorials.warming_up.let_s_parse_">Let's Parse!</a>
</h5>
<p>
@@ -619,7 +619,7 @@
The examples above can be found here: ../../example/qi/actions.cpp
</p>
<a name="spirit.qi.tutorials.semantic_actions.phoenix"></a><h5>
-<a name="id418146"></a>
+<a name="id418385"></a>
<a href="qi.html#spirit.qi.tutorials.semantic_actions.phoenix">Phoenix</a>
</h5>
<p>
@@ -1188,7 +1188,7 @@
</li>
</ul></div>
<a name="spirit.qi.tutorials.roman_numerals.symbol_table"></a><h5>
-<a name="id423187"></a>
+<a name="id423432"></a>
<a href="qi.html#spirit.qi.tutorials.roman_numerals.symbol_table">Symbol
Table</a>
</h5>
@@ -1320,7 +1320,7 @@
They are all parsers.
</p>
<a name="spirit.qi.tutorials.roman_numerals.rules"></a><h5>
-<a name="id424500"></a>
+<a name="id424745"></a>
<a href="qi.html#spirit.qi.tutorials.roman_numerals.rules">Rules</a>
</h5>
<p>
@@ -1400,7 +1400,7 @@
<pre class="programlisting"><span class="identifier">r</span> <span class="special">=</span> <span class="identifier">double_</span> <span class="special">>></span> <span class="special">*(</span><span class="char">','</span> <span class="special">>></span> <span class="identifier">double_</span><span class="special">);</span>
</pre>
<a name="spirit.qi.tutorials.roman_numerals.grammars"></a><h5>
-<a name="id425083"></a>
+<a name="id425327"></a>
<a href="qi.html#spirit.qi.tutorials.roman_numerals.grammars">Grammars</a>
</h5>
<p>
@@ -1505,7 +1505,7 @@
</li>
</ul></div>
<a name="spirit.qi.tutorials.roman_numerals.let_s_parse_"></a><h5>
-<a name="id426100"></a>
+<a name="id426344"></a>
<a href="qi.html#spirit.qi.tutorials.roman_numerals.let_s_parse_">Let's Parse!</a>
</h5>
<p>
@@ -1709,7 +1709,7 @@
has a <tt class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span></tt> attribute.
</p>
<a name="spirit.qi.tutorials.employee___parsing_into_structs.lexeme"></a><h5>
-<a name="id428379"></a>
+<a name="id428623"></a>
<a href="qi.html#spirit.qi.tutorials.employee___parsing_into_structs.lexeme">Lexeme</a>
</h5>
<pre class="programlisting"><span class="identifier">lexeme</span><span class="special">[</span><span class="char">'"'</span> <span class="special">>></span> <span class="special">+(</span><span class="identifier">char_</span> <span class="special">-</span> <span class="char">'"'</span><span class="special">)</span> <span class="special">>></span> <span class="char">'"'</span><span class="special">];</span>
@@ -1726,7 +1726,7 @@
a double quote.
</p>
<a name="spirit.qi.tutorials.employee___parsing_into_structs.difference"></a><h5>
-<a name="id428535"></a>
+<a name="id428779"></a>
<a href="qi.html#spirit.qi.tutorials.employee___parsing_into_structs.difference">Difference</a>
</h5>
<p>
@@ -1745,7 +1745,7 @@
is just <tt class="computeroutput"><span class="keyword">char</span></tt>.
</p>
<a name="spirit.qi.tutorials.employee___parsing_into_structs.plus"></a><h5>
-<a name="id428693"></a>
+<a name="id428937"></a>
<a href="qi.html#spirit.qi.tutorials.employee___parsing_into_structs.plus">Plus</a>
</h5>
<pre class="programlisting"><span class="special">+</span><span class="identifier">a</span>
@@ -1764,7 +1764,7 @@
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="keyword">char</span><span class="special">></span>
</pre>
<a name="spirit.qi.tutorials.employee___parsing_into_structs.sequence_attribute"></a><h5>
-<a name="id428880"></a>
+<a name="id429123"></a>
<a href="qi.html#spirit.qi.tutorials.employee___parsing_into_structs.sequence_attribute">Sequence
Attribute</a>
</h5>
@@ -1805,7 +1805,7 @@
</p></td></tr>
</table></div>
<a name="spirit.qi.tutorials.employee___parsing_into_structs.attribute_collapsing"></a><h5>
-<a name="id429202"></a>
+<a name="id429446"></a>
<a href="qi.html#spirit.qi.tutorials.employee___parsing_into_structs.attribute_collapsing">Attribute
Collapsing</a>
</h5>
@@ -1837,7 +1837,7 @@
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="keyword">char</span><span class="special">></span>
</pre>
<a name="spirit.qi.tutorials.employee___parsing_into_structs.auto_rules"></a><h5>
-<a name="id429551"></a>
+<a name="id429795"></a>
<a href="qi.html#spirit.qi.tutorials.employee___parsing_into_structs.auto_rules">Auto
Rules</a>
</h5>
@@ -1875,7 +1875,7 @@
directly into the rule's attribute, in-situ.
</p>
<a name="spirit.qi.tutorials.employee___parsing_into_structs.finally"></a><h5>
-<a name="id429995"></a>
+<a name="id430240"></a>
<a href="qi.html#spirit.qi.tutorials.employee___parsing_into_structs.finally">Finally</a>
</h5>
<p>
@@ -1998,7 +1998,7 @@
for testing purposes. "4.toyxml" has an error in it.
</p>
<a name="spirit.qi.tutorials.mini_xml___asts_.first_cut"></a><h5>
-<a name="id430902"></a>
+<a name="id431146"></a>
<a href="qi.html#spirit.qi.tutorials.mini_xml___asts_.first_cut">First Cut</a>
</h5>
<p>
@@ -2074,7 +2074,7 @@
by the placeholder <tt class="computeroutput"><span class="identifier">_val</span></tt>).
</p>
<a name="spirit.qi.tutorials.mini_xml___asts_.alternates"></a><h5>
-<a name="id432502"></a>
+<a name="id432747"></a>
<a href="qi.html#spirit.qi.tutorials.mini_xml___asts_.alternates">Alternates</a>
</h5>
<pre class="programlisting"><span class="identifier">rule</span><span class="special"><</span><span class="identifier">Iterator</span><span class="special">,</span> <span class="identifier">mini_xml_node</span><span class="special">(),</span> <span class="identifier">space_type</span><span class="special">></span> <span class="identifier">node</span><span class="special">;</span>
@@ -2104,7 +2104,7 @@
<span class="special">;</span>
</pre>
<a name="spirit.qi.tutorials.mini_xml___asts_.not_predicate"></a><h5>
-<a name="id432964"></a>
+<a name="id433208"></a>
<a href="qi.html#spirit.qi.tutorials.mini_xml___asts_.not_predicate">Not
Predicate</a>
</h5>
@@ -2131,7 +2131,7 @@
at this point.
</p>
<a name="spirit.qi.tutorials.mini_xml___asts_.inherited_attribute"></a><h5>
-<a name="id433204"></a>
+<a name="id433449"></a>
<a href="qi.html#spirit.qi.tutorials.mini_xml___asts_.inherited_attribute">Inherited
Attribute</a>
</h5>
@@ -2157,7 +2157,7 @@
<tt class="computeroutput"><span class="identifier">_r3</span></tt>, etc. if you have more).
</p>
<a name="spirit.qi.tutorials.mini_xml___asts_.a_lazy_lit"></a><h5>
-<a name="id433484"></a>
+<a name="id433728"></a>
<a href="qi.html#spirit.qi.tutorials.mini_xml___asts_.a_lazy_lit">A Lazy
Lit</a>
</h5>
@@ -2191,7 +2191,7 @@
accessors, provided by Phoenix.
</p>
<a name="spirit.qi.tutorials.mini_xml___asts_.how_it_all_works"></a><h5>
-<a name="id433963"></a>
+<a name="id434208"></a>
<a href="qi.html#spirit.qi.tutorials.mini_xml___asts_.how_it_all_works">How
it all works</a>
</h5>
@@ -2238,7 +2238,7 @@
as <tt class="computeroutput"><span class="identifier">_r1</span></tt>.
</p>
<a name="spirit.qi.tutorials.mini_xml___asts_.the_structures"></a><h5>
-<a name="id434407"></a>
+<a name="id434651"></a>
<a href="qi.html#spirit.qi.tutorials.mini_xml___asts_.the_structures">The
Structures</a>
</h5>
@@ -2271,7 +2271,7 @@
<p>
</p>
<a name="spirit.qi.tutorials.mini_xml___asts_.of_alternates_and_variants"></a><h5>
-<a name="id434675"></a>
+<a name="id434919"></a>
<a href="qi.html#spirit.qi.tutorials.mini_xml___asts_.of_alternates_and_variants">Of
Alternates and Variants</a>
</h5>
@@ -2298,7 +2298,7 @@
of <tt class="computeroutput"><span class="identifier">a</span></tt> and <tt class="computeroutput"><span class="identifier">B</span></tt> is the attribute of <tt class="computeroutput"><span class="identifier">b</span></tt>.
</p>
<a name="spirit.qi.tutorials.mini_xml___asts_.adapting_structs_again"></a><h5>
-<a name="id434941"></a>
+<a name="id435186"></a>
<a href="qi.html#spirit.qi.tutorials.mini_xml___asts_.adapting_structs_again">Adapting
structs again</a>
</h5>
@@ -2324,7 +2324,7 @@
<p>
</p>
<a name="spirit.qi.tutorials.mini_xml___asts_.one_more_take"></a><h5>
-<a name="id435139"></a>
+<a name="id435384"></a>
<a href="qi.html#spirit.qi.tutorials.mini_xml___asts_.one_more_take">One
More Take</a>
</h5>
@@ -2393,7 +2393,7 @@
in the <tt class="computeroutput"><span class="identifier">xml</span></tt> rule:
</p>
<a name="spirit.qi.tutorials.mini_xml___asts_.local_variables"></a><h5>
-<a name="id436383"></a>
+<a name="id436628"></a>
<a href="qi.html#spirit.qi.tutorials.mini_xml___asts_.local_variables">Local
Variables</a>
</h5>
@@ -2459,7 +2459,7 @@
What's new?
</p>
<a name="spirit.qi.tutorials.mini_xml___error_handling.readable_names"></a><h5>
-<a name="id436836"></a>
+<a name="id437081"></a>
<a href="qi.html#spirit.qi.tutorials.mini_xml___error_handling.readable_names">Readable
Names</a>
</h5>
@@ -2478,7 +2478,7 @@
<span class="identifier">end_tag</span><span class="special">.</span><span class="identifier">name</span><span class="special">(</span><span class="string">"end_tag"</span><span class="special">);</span>
</pre>
<a name="spirit.qi.tutorials.mini_xml___error_handling.on_error"></a><h5>
-<a name="id437087"></a>
+<a name="id437332"></a>
<a href="qi.html#spirit.qi.tutorials.mini_xml___error_handling.on_error">On
Error</a>
</h5>
@@ -2616,7 +2616,7 @@
</tbody>
</table></div>
<a name="spirit.qi.tutorials.mini_xml___error_handling.expectation_points"></a><h5>
-<a name="id437758"></a>
+<a name="id438002"></a>
<a href="qi.html#spirit.qi.tutorials.mini_xml___error_handling.expectation_points">Expectation
Points</a>
</h5>
Modified: trunk/libs/spirit/doc/html/spirit/qi/quick_reference.html
==============================================================================
--- trunk/libs/spirit/doc/html/spirit/qi/quick_reference.html (original)
+++ trunk/libs/spirit/doc/html/spirit/qi/quick_reference.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -5,8 +5,8 @@
<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.65.1">
<link rel="home" href="../../index.html" title="Spirit 2.1">
-<link rel="up" href="../qi.html" title="Qi">
-<link rel="previous" href="../qi.html" title="Qi">
+<link rel="up" href="../qi.html" title=" Qi">
+<link rel="previous" href="../qi.html" title=" Qi">
<link rel="next" href="quick_reference/predefined_primitive_parsers.html" title="Predefined
Primitive Parsers">
</head>
Modified: trunk/libs/spirit/doc/html/spirit/qi/quick_reference/compound_attribute_rules.html
==============================================================================
--- trunk/libs/spirit/doc/html/spirit/qi/quick_reference/compound_attribute_rules.html (original)
+++ trunk/libs/spirit/doc/html/spirit/qi/quick_reference/compound_attribute_rules.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -47,7 +47,7 @@
<span class="identifier">b</span></tt> will be <tt class="computeroutput"><span class="identifier">tuple</span><span class="special"><</span><span class="identifier">A</span><span class="special">,</span> <span class="identifier">B</span><span class="special">></span></tt>.
</p>
<div class="table">
-<a name="id444103"></a><p class="title"><b>Table 4. compound parser attribute types</b></p>
+<a name="id444347"></a><p class="title"><b>Table 4. compound parser attribute types</b></p>
<table class="table" summary="compound parser attribute types">
<colgroup>
<col>
Modified: trunk/libs/spirit/doc/html/spirit/qi/quick_reference/phoenix.html
==============================================================================
--- trunk/libs/spirit/doc/html/spirit/qi/quick_reference/phoenix.html (original)
+++ trunk/libs/spirit/doc/html/spirit/qi/quick_reference/phoenix.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -8,7 +8,7 @@
<link rel="up" href="../quick_reference.html" title="Quick Reference">
<link rel="previous" href="semantic_actions.html" title="Semantic
Actions">
-<link rel="next" href="../../karma.html" title="Karma">
+<link rel="next" href="../../karma.html" title=" Karma">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
Modified: trunk/libs/spirit/doc/html/spirit/what_s_new.html
==============================================================================
--- trunk/libs/spirit/doc/html/spirit/what_s_new.html (original)
+++ trunk/libs/spirit/doc/html/spirit/what_s_new.html 2009-06-15 23:59:00 EDT (Mon, 15 Jun 2009)
@@ -30,7 +30,7 @@
<div></div>
</div>
<a name="spirit.what_s_new.spirit_classic"></a><h3>
-<a name="id353522"></a>
+<a name="id353537"></a>
<a href="what_s_new.html#spirit.what_s_new.spirit_classic">Spirit Classic</a>
</h3>
<p>
@@ -69,11 +69,11 @@
for existing applications.
</p>
<a name="spirit.what_s_new.spirit_v2_1"></a><h3>
-<a name="id353581"></a>
+<a name="id353664"></a>
<a href="what_s_new.html#spirit.what_s_new.spirit_v2_1">Spirit V2.1</a>
</h3>
<a name="spirit.what_s_new.what_s_changed_in__emphasis_spirit_qi__emphasis__and__emphasis_spirit_karma__emphasis__from_v2_0_to_2_x"></a><h3>
-<a name="id353605"></a>
+<a name="id353688"></a>
<a href="what_s_new.html#spirit.what_s_new.what_s_changed_in__emphasis_spirit_qi__emphasis__and__emphasis_spirit_karma__emphasis__from_v2_0_to_2_x">What's
changed in <span class="emphasis"><em>Spirit.Qi</em></span> and <span class="emphasis"><em>Spirit.Karma</em></span>
from V2.0 to 2.x</a>
@@ -160,7 +160,7 @@
</li>
</ul></div>
<a name="spirit.what_s_new.what_s_changed_in__emphasis_spirit_lex__emphasis__from_v2_0_to_2_x"></a><h3>
-<a name="id410199"></a>
+<a name="id410213"></a>
<a href="what_s_new.html#spirit.what_s_new.what_s_changed_in__emphasis_spirit_lex__emphasis__from_v2_0_to_2_x">What's
changed in <span class="emphasis"><em>Spirit.Lex</em></span> from V2.0 to 2.x</a>
</h3>
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