Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58578 - in branches/release: . boost boost/algorithm/string boost/archive boost/config boost/filesystem boost/functional/hash boost/fusion boost/graph boost/integer boost/interprocess boost/intrusive boost/iostreams boost/math boost/numeric/ublas boost/program_options boost/property_tree boost/python boost/regex boost/serialization boost/signals boost/signals2 boost/system boost/thread boost/tr1 boost/type_traits boost/unordered boost/utility boost/variant boost/wave doc libs libs/config libs/filesystem libs/functional/hash libs/fusion libs/graph_parallel libs/integer libs/interprocess libs/intrusive libs/iostreams libs/math libs/mpl/doc/refmanual libs/mpl/doc/src/refmanual libs/numeric/ublas libs/numeric/ublas/doc libs/program_options libs/property_tree libs/python libs/regex libs/regex/doc libs/serialization libs/signals libs/signals2 libs/spirit libs/spirit/benchmarks/qi libs/spirit/classic/example libs/spirit/doc libs/spirit/doc/qi libs/spirit/example libs/spirit/example/karma libs/spirit/example/lex/static_lexer libs/spirit/example/qi libs/spirit/phoenix libs/spirit/test libs/spirit/test/karma libs/spirit/test/lex libs/spirit/test/qi libs/static_assert libs/system libs/thread libs/thread/doc libs/timer libs/tr1 libs/type_traits libs/unordered libs/utility libs/wave more people status tools tools/boostbook tools/build/v2 tools/inspect tools/quickbook tools/quickbook/detail tools/quickbook/test tools/regression tools/release tools/wave wiki
From: hartmut.kaiser_at_[hidden]
Date: 2009-12-29 22:38:59


Author: hkaiser
Date: 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
New Revision: 58578
URL: http://svn.boost.org/trac/boost/changeset/58578

Log:
Spirit: merging from trunk
Added:
   branches/release/libs/spirit/benchmarks/qi/Jamfile
      - copied unchanged from r58533, /trunk/libs/spirit/benchmarks/qi/Jamfile
   branches/release/libs/spirit/example/karma/quoted_strings.cpp
      - copied unchanged from r58501, /trunk/libs/spirit/example/karma/quoted_strings.cpp
   branches/release/libs/spirit/example/qi/nabialek.cpp
      - copied unchanged from r57721, /trunk/libs/spirit/example/qi/nabialek.cpp
   branches/release/libs/spirit/example/qi/typeof.cpp
      - copied, changed from r57724, /trunk/libs/spirit/example/qi/typeof.cpp
   branches/release/libs/spirit/test/lex/regression003_generate_switch.cpp (contents, props changed)
   branches/release/libs/spirit/test/lex/regression003_switch.cpp (contents, props changed)
Properties modified:
   branches/release/ (props changed)
   branches/release/CMakeLists.txt (props changed)
   branches/release/INSTALL (props changed)
   branches/release/Jamroot (props changed)
   branches/release/LICENSE_1_0.txt (props changed)
   branches/release/boost/ (props changed)
   branches/release/boost-build.jam (props changed)
   branches/release/boost.css (props changed)
   branches/release/boost.png (props changed)
   branches/release/boost/algorithm/string/ (props changed)
   branches/release/boost/archive/ (props changed)
   branches/release/boost/config/ (props changed)
   branches/release/boost/filesystem/ (props changed)
   branches/release/boost/functional/hash/ (props changed)
   branches/release/boost/fusion/ (props changed)
   branches/release/boost/graph/ (props changed)
   branches/release/boost/integer/ (props changed)
   branches/release/boost/interprocess/ (props changed)
   branches/release/boost/intrusive/ (props changed)
   branches/release/boost/iostreams/ (props changed)
   branches/release/boost/math/ (props changed)
   branches/release/boost/numeric/ublas/ (props changed)
   branches/release/boost/program_options/ (props changed)
   branches/release/boost/property_tree/ (props changed)
   branches/release/boost/python/ (props changed)
   branches/release/boost/regex/ (props changed)
   branches/release/boost/serialization/ (props changed)
   branches/release/boost/signals/ (props changed)
   branches/release/boost/signals2/ (props changed)
   branches/release/boost/system/ (props changed)
   branches/release/boost/thread/ (props changed)
   branches/release/boost/thread.hpp (props changed)
   branches/release/boost/tr1/ (props changed)
   branches/release/boost/type_traits/ (props changed)
   branches/release/boost/unordered/ (props changed)
   branches/release/boost/utility/value_init.hpp (props changed)
   branches/release/boost/variant/ (props changed)
   branches/release/boost/version.hpp (props changed)
   branches/release/boost/wave/ (props changed)
   branches/release/bootstrap.bat (props changed)
   branches/release/bootstrap.sh (props changed)
   branches/release/doc/ (props changed)
   branches/release/index.htm (props changed)
   branches/release/index.html (props changed)
   branches/release/libs/ (props changed)
   branches/release/libs/config/ (props changed)
   branches/release/libs/filesystem/ (props changed)
   branches/release/libs/functional/hash/ (props changed)
   branches/release/libs/fusion/ (props changed)
   branches/release/libs/graph_parallel/ (props changed)
   branches/release/libs/integer/ (props changed)
   branches/release/libs/interprocess/ (props changed)
   branches/release/libs/intrusive/ (props changed)
   branches/release/libs/iostreams/ (props changed)
   branches/release/libs/libraries.htm (props changed)
   branches/release/libs/maintainers.txt (props changed)
   branches/release/libs/math/ (props changed)
   branches/release/libs/mpl/doc/refmanual/broken-compiler-workarounds.html (props changed)
   branches/release/libs/mpl/doc/refmanual/categorized-index-concepts.html (props changed)
   branches/release/libs/mpl/doc/refmanual/cfg-no-preprocessed-headers.html (props changed)
   branches/release/libs/mpl/doc/refmanual/composition-and-argument-binding.html (props changed)
   branches/release/libs/mpl/doc/refmanual/data-types-concepts.html (props changed)
   branches/release/libs/mpl/doc/refmanual/data-types-miscellaneous.html (props changed)
   branches/release/libs/mpl/doc/refmanual/extensible-associative-sequence.html (props changed)
   branches/release/libs/mpl/doc/refmanual/inserter-class.html (props changed)
   branches/release/libs/mpl/doc/refmanual/tag-dispatched-metafunction.html (props changed)
   branches/release/libs/mpl/doc/refmanual/trivial-metafunctions-summary.html (props changed)
   branches/release/libs/mpl/doc/src/refmanual/Iterators-Iterator.rst (props changed)
   branches/release/libs/numeric/ublas/ (props changed)
   branches/release/libs/numeric/ublas/doc/ (props changed)
   branches/release/libs/program_options/ (props changed)
   branches/release/libs/property_tree/ (props changed)
   branches/release/libs/python/ (props changed)
   branches/release/libs/regex/ (props changed)
   branches/release/libs/regex/doc/ (props changed)
   branches/release/libs/serialization/ (props changed)
   branches/release/libs/signals/ (props changed)
   branches/release/libs/signals2/ (props changed)
   branches/release/libs/spirit/ (props changed)
   branches/release/libs/spirit/classic/example/ (props changed)
   branches/release/libs/spirit/doc/ (props changed)
   branches/release/libs/spirit/example/ (props changed)
   branches/release/libs/spirit/phoenix/ (props changed)
   branches/release/libs/spirit/test/ (props changed)
   branches/release/libs/spirit/test/qi/optional.cpp (props changed)
   branches/release/libs/static_assert/ (props changed)
   branches/release/libs/system/ (props changed)
   branches/release/libs/thread/ (props changed)
   branches/release/libs/thread/doc/ (props changed)
   branches/release/libs/timer/ (props changed)
   branches/release/libs/tr1/ (props changed)
   branches/release/libs/type_traits/ (props changed)
   branches/release/libs/unordered/ (props changed)
   branches/release/libs/utility/swap.html (props changed)
   branches/release/libs/utility/value_init.htm (props changed)
   branches/release/libs/utility/value_init_test.cpp (props changed)
   branches/release/libs/wave/ (props changed)
   branches/release/more/ (props changed)
   branches/release/people/ (props changed)
   branches/release/rst.css (props changed)
   branches/release/status/ (props changed)
   branches/release/tools/ (props changed)
   branches/release/tools/boostbook/ (props changed)
   branches/release/tools/build/v2/ (props changed)
   branches/release/tools/inspect/ (props changed)
   branches/release/tools/quickbook/ (props changed)
   branches/release/tools/regression/ (props changed)
   branches/release/tools/release/ (props changed)
   branches/release/tools/wave/ (props changed)
   branches/release/wiki/ (props changed)
Text files modified:
   branches/release/libs/spirit/doc/acknowledgments.qbk | 9 +++-
   branches/release/libs/spirit/doc/qi/string.qbk | 6 +++
   branches/release/libs/spirit/doc/spirit2.qbk | 4 +-
   branches/release/libs/spirit/example/karma/Jamfile | 1
   branches/release/libs/spirit/example/karma/auto_facilities.cpp | 5 +-
   branches/release/libs/spirit/example/lex/static_lexer/word_count_generate.cpp | 2
   branches/release/libs/spirit/example/lex/static_lexer/word_count_lexer_generate.cpp | 2
   branches/release/libs/spirit/example/lex/static_lexer/word_count_lexer_static.hpp | 31 +++++++++++------
   branches/release/libs/spirit/example/lex/static_lexer/word_count_static.hpp | 31 +++++++++++------
   branches/release/libs/spirit/example/qi/Jamfile | 3 +
   branches/release/libs/spirit/example/qi/iter_pos_parser.cpp | 2
   branches/release/libs/spirit/example/qi/reference.cpp | 48 +++++++++++++++++++++++++-
   branches/release/libs/spirit/example/qi/typeof.cpp | 10 +++++
   branches/release/libs/spirit/test/Jamfile | 2 +
   branches/release/libs/spirit/test/karma/binary.cpp | 71 ++++++++++++++++++++++++++++++++++++++++
   branches/release/libs/spirit/test/karma/char.cpp | 17 +++++++++
   branches/release/libs/spirit/test/karma/int_numerics.cpp | 13 +++++++
   branches/release/libs/spirit/test/karma/maxwidth.cpp | 28 +++++++-------
   branches/release/libs/spirit/test/karma/real_numerics.cpp | 19 +++++++++-
   branches/release/libs/spirit/test/karma/repeat.cpp | 15 ++++++++
   branches/release/libs/spirit/test/karma/sequence.cpp | 18 +++++++++-
   branches/release/libs/spirit/test/karma/test.hpp | 24 ++++++------
   branches/release/libs/spirit/test/lex/matlib.h | 2
   branches/release/libs/spirit/test/lex/regression003_generate.cpp | 3 +
   branches/release/libs/spirit/test/qi/attribute.cpp | 2
   branches/release/libs/spirit/test/qi/repeat.cpp | 15 ++++++++
   branches/release/libs/spirit/test/qi/sequence.cpp | 26 ++++++++++++++
   branches/release/libs/spirit/test/qi/symbols.cpp | 37 ++++++++++++++++++++
   branches/release/tools/quickbook/Jamfile.v2 | 8 ++++
   branches/release/tools/quickbook/code_snippet.hpp | 2 +
   branches/release/tools/quickbook/detail/actions.cpp | 3 +
   branches/release/tools/quickbook/detail/actions.hpp | 7 +--
   branches/release/tools/quickbook/test/Jamfile.v2 | 2
   branches/release/tools/quickbook/test/heading.gold | 2
   34 files changed, 395 insertions(+), 75 deletions(-)

Modified: branches/release/libs/spirit/doc/acknowledgments.qbk
==============================================================================
--- branches/release/libs/spirit/doc/acknowledgments.qbk (original)
+++ branches/release/libs/spirit/doc/acknowledgments.qbk 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -34,6 +34,9 @@
 version of this documentation together with Andreas Haberstroh. Chris
 did a lot especially at the last minute when we are about to release.
 
+[*Michael Caisse] also for last minute editing work on the 2.1 release
+documentation.
+
 [*Tobias Schwinger] for proposing expectation points and GCC port of an
 early version.
 
@@ -65,9 +68,9 @@
 participating in the discussions, being early adopters of pre-release
 versions of Spirit2 from the very start and helping out in various tasks
 such as helping with support, bug tracking, benchmarking and testing,
-etc. The list include: [*Michael Caisse], [*Larry Evans], [*Richard
-Webb], [*Martin Wille], [*Dan Marsden], [*Cedric Venet], [*Allan
-Odgaard], [*Matthias Vallentin], [*Justinas V.D.], [*Darid Tromer].
+etc. The list include: [*Larry Evans], [*Richard Webb], [*Martin Wille],
+[*Dan Marsden], [*Cedric Venet], [*Allan Odgaard], [*Matthias
+Vallentin], [*Justinas V.D.], [*Darid Tromer].
 
 [*Joao Abecasis] for his early support and involvement in Spirit2
 development and for disturbing my peace every once in a while for a

Modified: branches/release/libs/spirit/doc/qi/string.qbk
==============================================================================
--- branches/release/libs/spirit/doc/qi/string.qbk (original)
+++ branches/release/libs/spirit/doc/qi/string.qbk 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -187,6 +187,7 @@
     [[`s1`...`sN`] [A __string__.]]
     [[`d1`...`dN`] [Objects of type `T`.]]
     [[`f`] [A callable function or function object.]]
+ [[`f`, `l`] [`ForwardIterator` first/last pair.]]
 ]
 
 [heading Expression Semantics]
@@ -220,6 +221,11 @@
                                     with symbol, `s`. If `sym` does not already
                                     contain such an object, `find` returns a null
                                     pointer.]]
+ [[`sym.prefix_find(f, l)`] [Return a pointer to the object associated
+ with longest symbol that matches the beginning
+ of the range `[f, l)`, and updates `f` to point
+ to one past the end of that match. If no symbol matches,
+ then return a null pointer, and `f` is unchanged.]]
     [[`sym.for_each(f)`] [For each symbol in `sym`, `s`, a
                                     `std::basic_string<Char>` with associated data,
                                     `d`, an object of type `T`, invoke `f(s, d)`.]]

Modified: branches/release/libs/spirit/doc/spirit2.qbk
==============================================================================
--- branches/release/libs/spirit/doc/spirit2.qbk (original)
+++ branches/release/libs/spirit/doc/spirit2.qbk 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -57,7 +57,7 @@
 [def __boost_bind__ [@boost:/libs/bind/index.html Boost.Bind]]
 [def __boost_lambda__ [@boost:/libs/lambda/index.html Boost.Lambda]]
 [def __boost_tuples__ [@boost:/libs/tuple/index.html Boost.Tuples]]
-[def __boost_proto__ [@boost:/libs/proto/doc/html/proto.html Boost.Proto]]
+[def __boost_proto__ [@boost:/doc/html/proto.html Boost.Proto]]
 [def __boost_format__ [@boost:/libs/format/index.html Boost.Format]]
 [def __boost_any__ [@boost:/libs/any/index.html Boost.Any]]
 
@@ -68,7 +68,7 @@
 
 [def __mpl_boolean_constant__ [@boost:/libs/mpl/doc/refmanual/integral-constant.html MPL Boolean Constant]]
 [def __mpl_int_constant__ [@boost:/libs/mpl/doc/refmanual/integral-constant.html MPL Integral Constant]]
-[def __mpl_fwd_sequence__ [@boost:/libs/mpl/doc/refmanual/http://www.boost.org/doc/libs/1_40_0/libs/mpl/doc/refmanual/forward-sequence.html MPL Forward Sequence]]
+[def __mpl_fwd_sequence__ [@boost:/libs/mpl/doc/refmanual/forward-sequence.html MPL Forward Sequence]]
 
 [def __fixme__ *FIXME*]
 

Modified: branches/release/libs/spirit/example/karma/Jamfile
==============================================================================
--- branches/release/libs/spirit/example/karma/Jamfile (original)
+++ branches/release/libs/spirit/example/karma/Jamfile 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -30,4 +30,5 @@
 exe karma_reorder_struct : reorder_struct.cpp ;
 exe karma_escaped_string : escaped_string.cpp ;
 exe simple_columns_directive : simple_columns_directive.cpp ;
+exe quoted_strings : quoted_strings.cpp ;
 

Modified: branches/release/libs/spirit/example/karma/auto_facilities.cpp
==============================================================================
--- branches/release/libs/spirit/example/karma/auto_facilities.cpp (original)
+++ branches/release/libs/spirit/example/karma/auto_facilities.cpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -33,7 +33,6 @@
 #include <boost/fusion/include/array.hpp>
 
 #include <boost/spirit/include/karma.hpp>
-#include <boost/mpl/print.hpp>
 
 using namespace boost::spirit;
 using namespace boost::spirit::ascii;
@@ -52,7 +51,9 @@
     // (the ':') which normally gets embedded in the proto expression by
     // reference only. The deep copy converts the proto tree to hold this by
     // value. The deep copy operation can be left out for simpler proto
- // expressions (not containing references to temporaries).
+ // expressions (not containing references to temporaries). Alternatively
+ // you could use the proto::make_expr() facility to build the required
+ // proto expression.
     template <>
     struct create_generator<std::pair<int const, std::string> >
     {

Modified: branches/release/libs/spirit/example/lex/static_lexer/word_count_generate.cpp
==============================================================================
--- branches/release/libs/spirit/example/lex/static_lexer/word_count_generate.cpp (original)
+++ branches/release/libs/spirit/example/lex/static_lexer/word_count_generate.cpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -40,6 +40,6 @@
     // The suffix "wc" used below results in a type lexertl::static_::lexer_wc
     // to be generated, which needs to be passed as a template parameter to the
     // lexertl::static_lexer template (see word_count_static.cpp).
- return lex::lexertl::generate_static(word_count, out, "wc") ? 0 : -1;
+ return lex::lexertl::generate_static_dfa(word_count, out, "wc") ? 0 : -1;
 }
 //]

Modified: branches/release/libs/spirit/example/lex/static_lexer/word_count_lexer_generate.cpp
==============================================================================
--- branches/release/libs/spirit/example/lex/static_lexer/word_count_lexer_generate.cpp (original)
+++ branches/release/libs/spirit/example/lex/static_lexer/word_count_lexer_generate.cpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -40,6 +40,6 @@
     // The suffix "wcl" used below results in a type lexertl::static_::lexer_wcl
     // to be generated, which needs to be passed as a template parameter to the
     // lexertl::static_lexer template (see word_count_lexer_static.cpp).
- return lex::lexertl::generate_static(word_count, out, "wcl") ? 0 : -1;
+ return lex::lexertl::generate_static_dfa(word_count, out, "wcl") ? 0 : -1;
 }
 //]

Modified: branches/release/libs/spirit/example/lex/static_lexer/word_count_lexer_static.hpp
==============================================================================
--- branches/release/libs/spirit/example/lex/static_lexer/word_count_lexer_static.hpp (original)
+++ branches/release/libs/spirit/example/lex/static_lexer/word_count_lexer_static.hpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -6,8 +6,8 @@
 
 // Auto-generated by boost::lexer, do not edit
 
-#if !defined(BOOST_SPIRIT_LEXER_NEXT_TOKEN_WCL_SEP_10_2009_20_29_30)
-#define BOOST_SPIRIT_LEXER_NEXT_TOKEN_WCL_SEP_10_2009_20_29_30
+#if !defined(BOOST_SPIRIT_LEXER_NEXT_TOKEN_WCL_NOV_10_2009_17_20_29)
+#define BOOST_SPIRIT_LEXER_NEXT_TOKEN_WCL_NOV_10_2009_17_20_29
 
 #include <boost/detail/iterator.hpp>
 #include <boost/spirit/home/support/detail/lexer/char_traits.hpp>
@@ -31,7 +31,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 // this function returns the next matched token
 template<typename Iterator>
-std::size_t next_token_wcl (std::size_t &start_state_, Iterator const& start_,
+std::size_t next_token_wcl (std::size_t& /*start_state_*/, bool& /*bol_*/,
     Iterator &start_token_, Iterator const& end_, std::size_t& unique_id_)
 {
     enum {end_state_index, id_index, unique_id_index, state_index, bol_index,
@@ -81,9 +81,13 @@
         1, 65538, 2, 0, 0, 0, 0, 0,
         0, 0 };
 
- if (start_token_ == end_) return 0;
+ if (start_token_ == end_)
+ {
+ unique_id_ = npos;
+ return 0;
+ }
 
- const std::size_t *ptr_ = dfa_ + dfa_alphabet_;
+ std::size_t const* ptr_ = dfa_ + dfa_alphabet_;
     Iterator curr_ = start_token_;
     bool end_state_ = *ptr_ != 0;
     std::size_t id_ = *(ptr_ + id_index);
@@ -127,27 +131,32 @@
 // this defines a generic accessors for the information above
 struct lexer_wcl
 {
- // version number of compatible static lexer engine
- enum { static_version = 65536 };
+ // version number and feature-set of compatible static lexer engine
+ enum
+ {
+ static_version = 65536,
+ supports_bol = false,
+ supports_eol = false
+ };
 
     // return the number of lexer states
- static std::size_t const state_count()
+ static std::size_t state_count()
     {
         return lexer_state_count_wcl;
     }
 
     // return the name of the lexer state as given by 'idx'
- static char const* const state_name(std::size_t idx)
+ static char const* state_name(std::size_t idx)
     {
         return lexer_state_names_wcl[idx];
     }
 
     // return the next matched token
     template<typename Iterator>
- static std::size_t next(std::size_t &start_state_, Iterator const& start_
+ static std::size_t next(std::size_t &start_state_, bool& bol_
       , Iterator &start_token_, Iterator const& end_, std::size_t& unique_id_)
     {
- return next_token_wcl(start_state_, start_, start_token_, end_, unique_id_);
+ return next_token_wcl(start_state_, bol_, start_token_, end_, unique_id_);
     }
 };
 

Modified: branches/release/libs/spirit/example/lex/static_lexer/word_count_static.hpp
==============================================================================
--- branches/release/libs/spirit/example/lex/static_lexer/word_count_static.hpp (original)
+++ branches/release/libs/spirit/example/lex/static_lexer/word_count_static.hpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -6,8 +6,8 @@
 
 // Auto-generated by boost::lexer, do not edit
 
-#if !defined(BOOST_SPIRIT_LEXER_NEXT_TOKEN_WC_SEP_10_2009_20_29_29)
-#define BOOST_SPIRIT_LEXER_NEXT_TOKEN_WC_SEP_10_2009_20_29_29
+#if !defined(BOOST_SPIRIT_LEXER_NEXT_TOKEN_WC_NOV_10_2009_17_20_04)
+#define BOOST_SPIRIT_LEXER_NEXT_TOKEN_WC_NOV_10_2009_17_20_04
 
 #include <boost/detail/iterator.hpp>
 #include <boost/spirit/home/support/detail/lexer/char_traits.hpp>
@@ -31,7 +31,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 // this function returns the next matched token
 template<typename Iterator>
-std::size_t next_token_wc (std::size_t &start_state_, Iterator const& start_,
+std::size_t next_token_wc (std::size_t& /*start_state_*/, bool& /*bol_*/,
     Iterator &start_token_, Iterator const& end_, std::size_t& unique_id_)
 {
     enum {end_state_index, id_index, unique_id_index, state_index, bol_index,
@@ -81,9 +81,13 @@
         1, 65537, 2, 0, 0, 0, 0, 0,
         0, 0 };
 
- if (start_token_ == end_) return 0;
+ if (start_token_ == end_)
+ {
+ unique_id_ = npos;
+ return 0;
+ }
 
- const std::size_t *ptr_ = dfa_ + dfa_alphabet_;
+ std::size_t const* ptr_ = dfa_ + dfa_alphabet_;
     Iterator curr_ = start_token_;
     bool end_state_ = *ptr_ != 0;
     std::size_t id_ = *(ptr_ + id_index);
@@ -127,27 +131,32 @@
 // this defines a generic accessors for the information above
 struct lexer_wc
 {
- // version number of compatible static lexer engine
- enum { static_version = 65536 };
+ // version number and feature-set of compatible static lexer engine
+ enum
+ {
+ static_version = 65536,
+ supports_bol = false,
+ supports_eol = false
+ };
 
     // return the number of lexer states
- static std::size_t const state_count()
+ static std::size_t state_count()
     {
         return lexer_state_count_wc;
     }
 
     // return the name of the lexer state as given by 'idx'
- static char const* const state_name(std::size_t idx)
+ static char const* state_name(std::size_t idx)
     {
         return lexer_state_names_wc[idx];
     }
 
     // return the next matched token
     template<typename Iterator>
- static std::size_t next(std::size_t &start_state_, Iterator const& start_
+ static std::size_t next(std::size_t &start_state_, bool& bol_
       , Iterator &start_token_, Iterator const& end_, std::size_t& unique_id_)
     {
- return next_token_wc(start_state_, start_, start_token_, end_, unique_id_);
+ return next_token_wc(start_state_, bol_, start_token_, end_, unique_id_);
     }
 };
 

Modified: branches/release/libs/spirit/example/qi/Jamfile
==============================================================================
--- branches/release/libs/spirit/example/qi/Jamfile (original)
+++ branches/release/libs/spirit/example/qi/Jamfile 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -64,3 +64,6 @@
     mini_c/mini_cd.cpp
     ;
 
+exe nabialek : nabialek.cpp ;
+exe typeof : typeof.cpp ;
+

Modified: branches/release/libs/spirit/example/qi/iter_pos_parser.cpp
==============================================================================
--- branches/release/libs/spirit/example/qi/iter_pos_parser.cpp (original)
+++ branches/release/libs/spirit/example/qi/iter_pos_parser.cpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -7,7 +7,7 @@
 // component can be written. We develop a custom parser exposing the current
 // iterator position as its attribute.
 //
-// For more information see: http://spirit.sourceforge.net/home/
+// For more information see: http://spirit.sourceforge.net/home/?page_id=567
 
 #include <boost/spirit/include/qi_parse_attr.hpp>
 #include <boost/spirit/include/qi_char.hpp>

Modified: branches/release/libs/spirit/example/qi/reference.cpp
==============================================================================
--- branches/release/libs/spirit/example/qi/reference.cpp (original)
+++ branches/release/libs/spirit/example/qi/reference.cpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -1070,7 +1070,6 @@
         using boost::spirit::qi::little_dword;
         using boost::spirit::qi::little_qword;
         
- boost::uint8_t uc;
         boost::uint16_t us;
         boost::uint32_t ui;
 //<-
@@ -1114,7 +1113,6 @@
         using boost::spirit::qi::big_dword;
         using boost::spirit::qi::big_qword;
         
- boost::uint8_t uc;
         boost::uint16_t us;
         boost::uint32_t ui;
 //<-
@@ -1150,6 +1148,52 @@
         //]
     }
    
+ // rule
+ {
+ //[reference_rule
+ //`Some using declarations:
+ using boost::spirit::qi::rule;
+ using boost::spirit::qi::int_;
+ using boost::spirit::qi::locals;
+ using boost::spirit::qi::_1;
+ using boost::spirit::qi::_a;
+ using boost::spirit::ascii::alpha;
+ using boost::spirit::ascii::char_;
+ using boost::spirit::ascii::space_type;
+
+ /*`Basic rule:
+ */
+ rule<char const*> r;
+ r = int_;
+ test_parser("123", r);
+
+ /*`Rule with synthesized attribute:
+ */
+ rule<char const*, int()> ra;
+ ra = int_;
+ int i;
+ test_parser_attr("123", ra, i);
+ assert(i == 123);
+
+ /*`Rule with skipper and synthesized attribute:
+ */
+ rule<char const*, std::vector<int>(), space_type> rs;
+ rs = *int_;
+ std::vector<int> v;
+ test_phrase_parser_attr("123 456 789", rs, v);
+ assert(v[0] == 123);
+ assert(v[1] == 456);
+ assert(v[2] == 789);
+
+ /*`Rule with one local variable:
+ */
+ rule<char const*, locals<char> > rl;
+ rl = alpha[_a = _1] >> char_(_a); // get two identical characters
+ test_parser("aa", rl); // pass
+ test_parser("ax", rl); // fail
+ //]
+ }
+
     // grammar
     {
         using client::num_list;

Copied: branches/release/libs/spirit/example/qi/typeof.cpp (from r57724, /trunk/libs/spirit/example/qi/typeof.cpp)
==============================================================================
--- /trunk/libs/spirit/example/qi/typeof.cpp (original)
+++ branches/release/libs/spirit/example/qi/typeof.cpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -13,6 +13,14 @@
 ///////////////////////////////////////////////////////////////////////////////
 // Main program
 ///////////////////////////////////////////////////////////////////////////////
+
+#define BOOST_SPIRIT_AUTO(domain_, name, expr) \
+ typedef BOOST_TYPEOF(expr) name##_expr_type; \
+ BOOST_SPIRIT_ASSERT_MATCH( \
+ boost::spirit::domain_::domain, name##_expr_type); \
+ BOOST_AUTO(name, boost::proto::deep_copy(expr)); \
+ //
+
 int
 main()
 {
@@ -21,7 +29,7 @@
     using boost::spirit::qi::parse;
     typedef std::string::const_iterator iterator_type;
     
- BOOST_AUTO(comment, "/*" >> *(char_ - "*/") >> "*/");
+ BOOST_SPIRIT_AUTO(qi, comment, "/*" >> *(char_ - "*/") >> "*/");
 
     std::string str = "/*This is a comment*/";
     std::string::const_iterator iter = str.begin();

Modified: branches/release/libs/spirit/test/Jamfile
==============================================================================
--- branches/release/libs/spirit/test/Jamfile (original)
+++ branches/release/libs/spirit/test/Jamfile 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -132,6 +132,8 @@
     [ run lex/regression002.cpp : : : : lex_regression002 ]
     [ run lex/regression003_generate.cpp : $(LEX_DIR)/matlib_static.h : : : lex_regression003_generate ]
     [ run lex/regression003.cpp : : : <dependency>.//lex_regression003_generate : lex_regression003 ]
+ [ run lex/regression003_generate_switch.cpp : $(LEX_DIR)/matlib_static_switch.h : : : lex_regression003_generate_switch ]
+ [ run lex/regression003_switch.cpp : : : <dependency>.//lex_regression003_generate_switch : lex_regression003_switch ]
     [ run lex/regression004.cpp : : : : lex_regression004 ]
     [ run lex/regression005.cpp : : : : lex_regression005 ]
 

Modified: branches/release/libs/spirit/test/karma/binary.cpp
==============================================================================
--- branches/release/libs/spirit/test/karma/binary.cpp (original)
+++ branches/release/libs/spirit/test/karma/binary.cpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -8,6 +8,7 @@
 
 #include <boost/spirit/include/karma_binary.hpp>
 #include <boost/spirit/include/karma_generate.hpp>
+#include <boost/spirit/include/karma_phoenix_attributes.hpp>
 
 #include <boost/spirit/include/phoenix_core.hpp>
 #include <boost/spirit/include/phoenix_operator.hpp>
@@ -184,5 +185,75 @@
 #endif
     }
 
+// we support Phoenix attributes only starting with V2.2
+#if SPIRIT_VERSION >= 0x2020
+ { // test Phoenix expression attributes, only supported if
+ // karma_phoenix_attributes.hpp is included
+ namespace phoenix = boost::phoenix;
+
+#ifdef BOOST_LITTLE_ENDIAN
+ BOOST_TEST(binary_test("\x01", 1, byte_, phoenix::val(0x01)));
+ BOOST_TEST(binary_test("\x01\0x02", 2, byte_, phoenix::val(0x0201)));
+ BOOST_TEST(binary_test("\x01\x02\x03\x04", 4, dword,
+ phoenix::val(0x04030201)));
+
+ boost::uint8_t v8 (0x01);
+ BOOST_TEST(binary_test("\x01", 1, byte_, phoenix::ref(v8)));
+ BOOST_TEST(binary_test("\x02", 1, byte_, ++phoenix::ref(v8)));
+
+ boost::uint16_t v16 (0x0201);
+ BOOST_TEST(binary_test("\x01\x02", 2, word, phoenix::ref(v16)));
+ BOOST_TEST(binary_test("\x02\x02", 2, word, ++phoenix::ref(v16)));
+
+ boost::uint32_t v32 (0x04030201);
+ BOOST_TEST(binary_test("\x01\x02\x03\x04", 4, dword, phoenix::ref(v32)));
+ BOOST_TEST(binary_test("\x02\x02\x03\x04", 4, dword, ++phoenix::ref(v32)));
+
+#ifdef BOOST_HAS_LONG_LONG
+ BOOST_TEST(binary_test("\x01\x02\x03\x04\x05\x06\x07\x08", 8, qword,
+ phoenix::val(0x0807060504030201LL)));
+
+ boost::uint64_t v64 (0x0807060504030201LL);
+ BOOST_TEST(binary_test("\x01\x02\x03\x04\x05\x06\x07\x08", 8, qword,
+ phoenix::ref(v64)));
+ BOOST_TEST(binary_test("\x02\x02\x03\x04\x05\x06\x07\x08", 8, qword,
+ ++phoenix::ref(v64)));
+#endif
+
+#else // BOOST_LITTLE_ENDIAN
+
+ BOOST_TEST(binary_test("\x01", 1, byte_, phoenix::val(0x01)));
+ BOOST_TEST(binary_test("\x01\x02", 2, byte_,
+ phoenix::val(boost::uint16_t(0x0102))));
+ BOOST_TEST(binary_test("\x01\x02\x03\x04", 4, dword,
+ phoenix::val(0x01020304)));
+
+ boost::uint8_t v8 (0x01);
+ BOOST_TEST(binary_test("\x01", 1, byte_, phoenix::ref(v8)));
+ BOOST_TEST(binary_test("\x02", 1, byte_, ++phoenix::ref(v8)));
+
+ boost::uint16_t v16 (0x0102);
+ BOOST_TEST(binary_test("\x01\x02", 2, word, phoenix::ref(v16)));
+ BOOST_TEST(binary_test("\x01\x03", 2, word, ++phoenix::ref(v16)));
+
+ boost::uint32_t v32 (0x01020304);
+ BOOST_TEST(binary_test("\x01\x02\x03\x04", 4, dword, phoenix::ref(v32)));
+ BOOST_TEST(binary_test("\x01\x02\x03\x05", 4, dword, ++phoenix::ref(v32)));
+
+#ifdef BOOST_HAS_LONG_LONG
+ BOOST_TEST(binary_test("\x01\x02\x03\x04\x05\x06\x07\x08", 8, qword,
+ phoenix::val(0x0102030405060708LL)));
+
+ boost::uint64_t v64 (0x0102030405060708LL);
+ BOOST_TEST(binary_test("\x01\x02\x03\x04\x05\x06\x07\x08", 8, qword,
+ phoenix::ref(v64)));
+ BOOST_TEST(binary_test("\x01\x02\x03\x04\x05\x06\x07\x09", 8, qword,
+ ++phoenix::ref(v64)));
+#endif
+
+#endif
+ }
+#endif
+
     return boost::report_errors();
 }

Modified: branches/release/libs/spirit/test/karma/char.cpp
==============================================================================
--- branches/release/libs/spirit/test/karma/char.cpp (original)
+++ branches/release/libs/spirit/test/karma/char.cpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -11,6 +11,7 @@
 #include <boost/spirit/include/karma_char.hpp>
 #include <boost/spirit/include/karma_generate.hpp>
 #include <boost/spirit/include/karma_action.hpp>
+#include <boost/spirit/include/karma_phoenix_attributes.hpp>
 
 #include <boost/spirit/include/phoenix_core.hpp>
 #include <boost/spirit/include/phoenix_operator.hpp>
@@ -282,5 +283,21 @@
         BOOST_TEST(!test(L"", wide::char_(L'y'), w));
     }
 
+// we support Phoenix attributes only starting with V2.2
+#if SPIRIT_VERSION >= 0x2020
+ // yes, we can use phoenix expressions as attributes as well
+ // but only if we include karma_phoenix_attributes.hpp
+ {
+ namespace ascii = boost::spirit::ascii;
+ namespace phoenix = boost::phoenix;
+
+ BOOST_TEST(test("x", ascii::char_, phoenix::val('x')));
+
+ char c = 'x';
+ BOOST_TEST(test("x", ascii::char_, phoenix::ref(c)));
+ BOOST_TEST(test("y", ascii::char_, ++phoenix::ref(c)));
+ }
+#endif
+
     return boost::report_errors();
 }

Modified: branches/release/libs/spirit/test/karma/int_numerics.cpp
==============================================================================
--- branches/release/libs/spirit/test/karma/int_numerics.cpp (original)
+++ branches/release/libs/spirit/test/karma/int_numerics.cpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -21,6 +21,7 @@
 #include <boost/spirit/include/karma_numeric.hpp>
 #include <boost/spirit/include/karma_directive.hpp>
 #include <boost/spirit/include/karma_action.hpp>
+#include <boost/spirit/include/karma_phoenix_attributes.hpp>
 
 #include <limits>
 #include "test.hpp"
@@ -91,6 +92,18 @@
         BOOST_TEST(test(expected_minval, gen(minval), optmin));
         BOOST_TEST(test(expected_maxval, gen(maxval), optmax));
 
+// we support Phoenix attributes only starting with V2.2
+#if SPIRIT_VERSION >= 0x2020
+ // Phoenix expression tests (only supported while including
+ // karma_phoenix_attributes.hpp
+ namespace phoenix = boost::phoenix;
+
+ BOOST_TEST(test("1", gen, phoenix::val(1)));
+
+ T val = 1;
+ BOOST_TEST(test("1", gen, phoenix::ref(val)));
+ BOOST_TEST(test("2", gen, ++phoenix::ref(val)));
+#endif
     }
 };
 

Modified: branches/release/libs/spirit/test/karma/maxwidth.cpp
==============================================================================
--- branches/release/libs/spirit/test/karma/maxwidth.cpp (original)
+++ branches/release/libs/spirit/test/karma/maxwidth.cpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -44,20 +44,20 @@
     }
 
     {
-// std::string str;
-// BOOST_TEST(test("01234567",
-// maxwidth(8, std::back_inserter(str))[lit("01234567")]) &&
-// str.empty());
-//
-// str = "";
-// BOOST_TEST(test("0123456",
-// maxwidth(8, std::back_inserter(str))[lit("0123456")]) &&
-// str.empty());
-//
-// str = "";
-// BOOST_TEST(test("01234567",
-// maxwidth(8, std::back_inserter(str))[lit("012345678")]) &&
-// str == "8");
+ std::string str;
+ BOOST_TEST(test("01234567",
+ maxwidth(8, std::back_inserter(str))[lit("01234567")]) &&
+ str.empty());
+
+ str = "";
+ BOOST_TEST(test("0123456",
+ maxwidth(8, std::back_inserter(str))[lit("0123456")]) &&
+ str.empty());
+
+ str = "";
+ BOOST_TEST(test("01234567",
+ maxwidth(8, std::back_inserter(str))[lit("012345678")]) &&
+ str == "8");
     }
 
     {

Modified: branches/release/libs/spirit/test/karma/real_numerics.cpp
==============================================================================
--- branches/release/libs/spirit/test/karma/real_numerics.cpp (original)
+++ branches/release/libs/spirit/test/karma/real_numerics.cpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -14,6 +14,7 @@
 #include <boost/spirit/include/karma_numeric.hpp>
 #include <boost/spirit/include/karma_generate.hpp>
 #include <boost/spirit/include/karma_directive.hpp>
+#include <boost/spirit/include/karma_phoenix_attributes.hpp>
 
 #include <boost/spirit/include/phoenix_core.hpp>
 #include <boost/spirit/include/phoenix_operator.hpp>
@@ -34,8 +35,8 @@
     static int floatfield(T) { return base_type::fmtflags::scientific; }
 };
 
-// ///////////////////////////////////////////////////////////////////////////////
-// // policy for real_generator, which forces the fixed notation
+///////////////////////////////////////////////////////////////////////////////
+// policy for real_generator, which forces the fixed notation
 template <typename T>
 struct fixed_policy : boost::spirit::karma::real_policies<T>
 {
@@ -541,5 +542,19 @@
         BOOST_TEST(test("1.0", double_(1.0), v));
     }
 
+// we support Phoenix attributes only starting with V2.2
+#if SPIRIT_VERSION >= 0x2020
+ { // Phoenix expression tests (requires to include
+ // karma_phoenix_attributes.hpp)
+ namespace phoenix = boost::phoenix;
+
+ BOOST_TEST(test("1.0", double_, phoenix::val(1.0)));
+
+ double d = 1.2;
+ BOOST_TEST(test("1.2", double_, phoenix::ref(d)));
+ BOOST_TEST(test("2.2", double_, ++phoenix::ref(d)));
+ }
+#endif
+
     return boost::report_errors();
 }

Modified: branches/release/libs/spirit/test/karma/repeat.cpp
==============================================================================
--- branches/release/libs/spirit/test/karma/repeat.cpp (original)
+++ branches/release/libs/spirit/test/karma/repeat.cpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -16,6 +16,7 @@
 #include <boost/spirit/include/karma_action.hpp>
 #include <boost/spirit/include/karma_nonterminal.hpp>
 #include <boost/spirit/include/karma_auxiliary.hpp>
+#include <boost/spirit/include/karma_phoenix_attributes.hpp>
 #include <boost/spirit/include/support_argument.hpp>
 #include <boost/spirit/include/phoenix_core.hpp>
 #include <boost/spirit/include/phoenix_operator.hpp>
@@ -160,6 +161,20 @@
         BOOST_TEST(!test("", repeat(4, inf)[r], v3));
     }
 
+// we support Phoenix attributes only starting with V2.2
+#if SPIRIT_VERSION >= 0x2020
+ {
+ namespace ascii = boost::spirit::ascii;
+ namespace phoenix = boost::phoenix;
+
+ char c = 'a';
+ BOOST_TEST(test("bcd", repeat(3)[ascii::char_[_1 = ++phoenix::ref(c)]]));
+
+ c = 'a';
+ BOOST_TEST(test("bcd", repeat(3)[ascii::char_], ++phoenix::ref(c)));
+ }
+#endif
+
     return boost::report_errors();
 }
 

Modified: branches/release/libs/spirit/test/karma/sequence.cpp
==============================================================================
--- branches/release/libs/spirit/test/karma/sequence.cpp (original)
+++ branches/release/libs/spirit/test/karma/sequence.cpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -103,8 +103,8 @@
                 upper[lit("begin") << "nend"], char(' ')));
 
             BOOST_TEST(test("Aa ", left_align[char_('A') << 'a']));
-// BOOST_TEST(test(" Aa ", center[char_('A') << 'a']));
-// BOOST_TEST(test(" Aa", right_align[char_('A') << 'a']));
+ BOOST_TEST(test(" Aa ", center[char_('A') << 'a']));
+ BOOST_TEST(test(" Aa", right_align[char_('A') << 'a']));
         }
 
         {
@@ -163,6 +163,20 @@
         BOOST_TEST(test(">1,2,3,4", '>' << r, v));
     }
 
+ {
+ namespace karma = boost::spirit::karma;
+ typedef spirit_test::output_iterator<char>::type outiter_type;
+
+ karma::rule<outiter_type, std::string()> e = karma::string;
+ karma::rule<outiter_type, std::vector<std::string>()> l = e << *(',' << e);
+
+ std::vector<std::string> v;
+ v.push_back("abc1");
+ v.push_back("abc2");
+ v.push_back("abc3");
+ BOOST_TEST(test("abc1,abc2,abc3", l, v));
+ }
+
     return boost::report_errors();
 }
 

Modified: branches/release/libs/spirit/test/karma/test.hpp
==============================================================================
--- branches/release/libs/spirit/test/karma/test.hpp (original)
+++ branches/release/libs/spirit/test/karma/test.hpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -96,7 +96,7 @@
     ///////////////////////////////////////////////////////////////////////////
     template <typename Char, typename Generator, typename Attribute>
     inline bool test(Char const *expected, Generator const& g,
- Attribute const &attr)
+ Attribute const &attrib)
     {
         namespace karma = boost::spirit::karma;
         typedef std::basic_string<Char> string_type;
@@ -107,7 +107,7 @@
 
         string_type generated;
         std::back_insert_iterator<string_type> outit(generated);
- bool result = karma::generate(outit, g, attr);
+ bool result = karma::generate(outit, g, attrib);
 
         print_if_failed("test", result, generated, expected);
         return result && generated == expected;
@@ -115,7 +115,7 @@
 
     template <typename Char, typename Generator, typename Attribute>
     inline bool test(std::basic_string<Char> const& expected, Generator const& g,
- Attribute const &attr)
+ Attribute const &attrib)
     {
         namespace karma = boost::spirit::karma;
         typedef std::basic_string<Char> string_type;
@@ -126,7 +126,7 @@
 
         string_type generated;
         std::back_insert_iterator<string_type> outit(generated);
- bool result = karma::generate(outit, g, attr);
+ bool result = karma::generate(outit, g, attrib);
 
         print_if_failed("test", result, generated, expected);
         return result && generated == expected;
@@ -175,7 +175,7 @@
     template <typename Char, typename Generator, typename Attribute,
         typename Delimiter>
     inline bool test_delimited(Char const *expected, Generator const& g,
- Attribute const &attr, Delimiter const& d)
+ Attribute const &attrib, Delimiter const& d)
     {
         namespace karma = boost::spirit::karma;
         typedef std::basic_string<Char> string_type;
@@ -186,7 +186,7 @@
 
         string_type generated;
         std::back_insert_iterator<string_type> outit(generated);
- bool result = karma::generate_delimited(outit, g, d, attr);
+ bool result = karma::generate_delimited(outit, g, d, attrib);
 
         print_if_failed("test_delimited", result, generated, expected);
         return result && generated == expected;
@@ -195,7 +195,7 @@
     template <typename Char, typename Generator, typename Attribute,
         typename Delimiter>
     inline bool test_delimited(std::basic_string<Char> const& expected,
- Generator const& g, Attribute const &attr, Delimiter const& d)
+ Generator const& g, Attribute const &attrib, Delimiter const& d)
     {
         namespace karma = boost::spirit::karma;
         typedef std::basic_string<Char> string_type;
@@ -206,7 +206,7 @@
 
         string_type generated;
         std::back_insert_iterator<string_type> outit(generated);
- bool result = karma::generate_delimited(outit, g, d, attr);
+ bool result = karma::generate_delimited(outit, g, d, attrib);
 
         print_if_failed("test_delimited", result, generated, expected);
         return result && generated == expected;
@@ -236,7 +236,7 @@
     template <typename Generator, typename Attribute>
     inline bool
     binary_test(char const *expected, std::size_t size,
- Generator const& g, Attribute const &attr)
+ Generator const& g, Attribute const &attrib)
     {
         namespace karma = boost::spirit::karma;
         typedef std::basic_string<char> string_type;
@@ -247,7 +247,7 @@
 
         string_type generated;
         std::back_insert_iterator<string_type> outit(generated);
- bool result = karma::generate(outit, g, attr);
+ bool result = karma::generate(outit, g, attrib);
 
         return result && !std::memcmp(generated.c_str(), expected, size);
     }
@@ -276,7 +276,7 @@
     template <typename Generator, typename Attribute, typename Delimiter>
     inline bool
     binary_test_delimited(char const *expected, std::size_t size,
- Generator const& g, Attribute const &attr, Delimiter const& d)
+ Generator const& g, Attribute const &attrib, Delimiter const& d)
     {
         namespace karma = boost::spirit::karma;
         typedef std::basic_string<char> string_type;
@@ -287,7 +287,7 @@
 
         string_type generated;
         std::back_insert_iterator<string_type> outit(generated);
- bool result = karma::generate_delimited(outit, g, d, attr);
+ bool result = karma::generate_delimited(outit, g, d, attrib);
 
         return result && !std::memcmp(generated.c_str(), expected, size);
     }

Modified: branches/release/libs/spirit/test/lex/matlib.h
==============================================================================
--- branches/release/libs/spirit/test/lex/matlib.h (original)
+++ branches/release/libs/spirit/test/lex/matlib.h 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -83,7 +83,7 @@
         this->self("A")
             = token_def_('[') [set_lexer_state("B")]
             | ','
- | token_def_(']') [ set_lexer_state("INITIAL")]
+ | token_def_(']') [set_lexer_state("INITIAL")]
             ;
 
         this->self("B")

Modified: branches/release/libs/spirit/test/lex/regression003_generate.cpp
==============================================================================
--- branches/release/libs/spirit/test/lex/regression003_generate.cpp (original)
+++ branches/release/libs/spirit/test/lex/regression003_generate.cpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -26,6 +26,7 @@
     matlib_type matrix(results);
 
     std::ofstream out(argc < 2 ? "matlib_static.h" : argv[1]);
- BOOST_TEST(boost::spirit::lex::lexertl::generate_static(matrix, out, "matlib"));
+ BOOST_TEST(boost::spirit::lex::lexertl::generate_static_dfa(matrix, out, "matlib"));
     return boost::report_errors();
 }
+

Added: branches/release/libs/spirit/test/lex/regression003_generate_switch.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/spirit/test/lex/regression003_generate_switch.cpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -0,0 +1,33 @@
+// Copyright (c) 2001-2009 Hartmut Kaiser
+// Copyright (c) 2009 Carl Barron
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/spirit/include/lex_lexertl.hpp>
+#include <boost/spirit/include/lex_generate_static_lexertl.hpp>
+
+#include <fstream>
+#include <vector>
+
+#include "matlib.h"
+
+int main(int argc, char* argv[])
+{
+ std::vector<std::vector<double> > results;
+
+ typedef std::string::iterator iter;
+ typedef boost::spirit::lex::lexertl::actor_lexer<
+ boost::spirit::lex::lexertl::token<iter>
+ > lexer_type;
+
+ typedef matlib_tokens<lexer_type> matlib_type;
+ matlib_type matrix(results);
+
+ std::ofstream out(argc < 2 ? "matlib_static_switch.h" : argv[1]);
+ BOOST_TEST(boost::spirit::lex::lexertl::generate_static_switch(
+ matrix, out, "matlib_switch"));
+ return boost::report_errors();
+}
+

Added: branches/release/libs/spirit/test/lex/regression003_switch.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/spirit/test/lex/regression003_switch.cpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -0,0 +1,50 @@
+// Copyright (c) 2001-2009 Hartmut Kaiser
+// Copyright (c) 2009 Carl Barron
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/spirit/include/lex_static_lexertl.hpp>
+
+#include <iostream>
+#include <string>
+#include <vector>
+#include <exception>
+
+#include "matlib_static_switch.h"
+#include "matlib.h"
+
+void test_matrix(std::vector<std::vector<double> > const& x)
+{
+ BOOST_TEST(x.size() == 3);
+ BOOST_TEST(x[0].size() == 2 && x[0][0] == 1 && x[0][1] == 2);
+ BOOST_TEST(x[1].size() == 1 && x[1][0] == 3);
+ BOOST_TEST(x[2].size() == 3 && x[2][0] == 4 && x[2][1] == 5 && x[2][2] == 6);
+}
+
+int main()
+{
+ std::string input("[[1,2][3][4,5,6]]");
+ std::vector<std::vector<double> > results;
+
+ typedef std::string::iterator iter;
+ typedef boost::spirit::lex::lexertl::static_actor_lexer<
+ boost::spirit::lex::lexertl::token<iter>,
+ boost::spirit::lex::lexertl::static_::lexer_matlib_switch
+ > lexer_type;
+
+ typedef matlib_tokens<lexer_type> matlib_type;
+ matlib_type matrix(results);
+ iter first = input.begin();
+
+ try {
+ BOOST_TEST(boost::spirit::lex::tokenize(first, input.end(), matrix));
+ test_matrix(results);
+ }
+ catch (std::runtime_error const& e) {
+ std::cerr << e.what() << '\n';
+ BOOST_TEST(false);
+ }
+ return boost::report_errors();
+}

Modified: branches/release/libs/spirit/test/qi/attribute.cpp
==============================================================================
--- branches/release/libs/spirit/test/qi/attribute.cpp (original)
+++ branches/release/libs/spirit/test/qi/attribute.cpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -8,9 +8,9 @@
 
 #include <boost/config/warning_disable.hpp>
 #include <boost/detail/lightweight_test.hpp>
+
 #include <boost/fusion/include/struct.hpp>
 #include <boost/fusion/include/nview.hpp>
-#include <boost/mpl/print.hpp>
 
 #include <boost/spirit/include/qi_char.hpp>
 #include <boost/spirit/include/qi_string.hpp>

Modified: branches/release/libs/spirit/test/qi/repeat.cpp
==============================================================================
--- branches/release/libs/spirit/test/qi/repeat.cpp (original)
+++ branches/release/libs/spirit/test/qi/repeat.cpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -156,6 +156,21 @@
         BOOST_TEST(test_attr("b b b b", omit[repeat(4)[char_('b')]], s, space) && s == "bbbb");
     }
 
+ {
+ BOOST_TEST(test("1 2 3", int_ >> repeat(2)[int_], space));
+ BOOST_TEST(!test("1 2", int_ >> repeat(2)[int_], space));
+ }
+
+ {
+ std::vector<char> v;
+ BOOST_TEST(test_attr("1 2 3", int_ >> repeat(2)[int_], v, space));
+ BOOST_TEST(v.size() == 3 && v[0] == 1 && v[1] == 2 && v[2] == 3);
+
+ v.clear();
+ BOOST_TEST(!test_attr("1 2", int_ >> repeat(2)[int_], v, space));
+ BOOST_TEST(v.size() == 1 && v[0] == 1);
+ }
+
     { // actions
         namespace phx = boost::phoenix;
 

Modified: branches/release/libs/spirit/test/qi/sequence.cpp
==============================================================================
--- branches/release/libs/spirit/test/qi/sequence.cpp (original)
+++ branches/release/libs/spirit/test/qi/sequence.cpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -148,6 +148,32 @@
 
     }
 
+ // alternative forms of attributes. Allow sequences to take in
+ // stl containers of stl containers.
+// {
+// // this use case still does not compile, needs some additional work
+//
+// std::vector<std::string> v;
+// BOOST_TEST(test_attr("abc1,abc2,abc3",
+// *~char_(',') >> *(',' >> *~char_(',')), v));
+// BOOST_TEST(v.size() == 3);
+// BOOST_TEST(v[0] == "abc1");
+// BOOST_TEST(v[1] == "abc2");
+// BOOST_TEST(v[2] == "abc3");
+// }
+
+ {
+ std::vector<std::string> v;
+ rule<char const*, std::string()> e = *~char_(',');
+ rule<char const*, std::vector<std::string>()> l = e >> *(',' >> e);
+
+ BOOST_TEST(test_attr("abc1,abc2,abc3", l, v));
+ BOOST_TEST(v.size() == 3);
+ BOOST_TEST(v[0] == "abc1");
+ BOOST_TEST(v[1] == "abc2");
+ BOOST_TEST(v[2] == "abc3");
+ }
+
     {
         std::vector<char> v;
         BOOST_TEST(test_attr("ab", char_ >> -char_, v));

Modified: branches/release/libs/spirit/test/qi/symbols.cpp
==============================================================================
--- branches/release/libs/spirit/test/qi/symbols.cpp (original)
+++ branches/release/libs/spirit/test/qi/symbols.cpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -306,7 +306,44 @@
         BOOST_TEST(const_sym.find("c") && *const_sym.find("c") == 0);
         BOOST_TEST(!const_sym.find("d"));
         
+ char const *str1 = "all";
+ char const *first = str1, *last = str1 + 3;
+ BOOST_TEST(*sym.prefix_find(first, last) == 1 && first == str1 + 1);
+
+ char const *str2 = "dart";
+ first = str2; last = str2 + 4;
+ BOOST_TEST(!sym.prefix_find(first, last) && first == str2);
+ }
+
+ { // Substrings
+
+ symbols<char, int> sym;
+ BOOST_TEST(sym.at("foo") == 0);
+ sym.at("foo") = 1;
+ BOOST_TEST(sym.at("foo") == 1);
+ BOOST_TEST(sym.at("fool") == 0);
+ sym.at("fool") = 2;
+ BOOST_TEST(sym.find("foo") && *sym.find("foo") == 1);
+ BOOST_TEST(sym.find("fool") && *sym.find("fool") == 2);
+ BOOST_TEST(!sym.find("foolish"));
+ BOOST_TEST(!sym.find("foot"));
+ BOOST_TEST(!sym.find("afoot"));
+
+ char const *str, *first, *last;
+ str = "foolish"; first = str; last = str + 7;
+ BOOST_TEST(*sym.prefix_find(first, last) == 2 && first == str + 4);
         
+ first = str; last = str + 4;
+ BOOST_TEST(*sym.prefix_find(first, last) == 2 && first == str + 4);
+
+ str = "food"; first = str; last = str + 4;
+ BOOST_TEST(*sym.prefix_find(first, last) == 1 && first == str + 3);
+
+ first = str; last = str + 3;
+ BOOST_TEST(*sym.prefix_find(first, last) == 1 && first == str + 3);
+
+ first = str; last = str + 2;
+ BOOST_TEST(!sym.prefix_find(first, last) && first == str);
     }
 
     return boost::report_errors();

Modified: branches/release/tools/quickbook/Jamfile.v2
==============================================================================
--- branches/release/tools/quickbook/Jamfile.v2 (original)
+++ branches/release/tools/quickbook/Jamfile.v2 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -8,6 +8,14 @@
 # http://www.boost.org/LICENSE_1_0.txt)
 #==============================================================================
 
+project quickbook
+ : requirements
+ <toolset>gcc:<c++-template-depth>300
+ <toolset>darwin:<c++-template-depth>300
+ <toolset>gcc:<cflags>-g0
+ <toolset>darwin:<cflags>-g0
+ ;
+
 exe quickbook
     :
     detail/quickbook.cpp

Modified: branches/release/tools/quickbook/code_snippet.hpp
==============================================================================
--- branches/release/tools/quickbook/code_snippet.hpp (original)
+++ branches/release/tools/quickbook/code_snippet.hpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -11,7 +11,9 @@
 
 #include <boost/spirit/include/classic_core.hpp>
 #include <boost/spirit/include/classic_actor.hpp>
+#include <boost/bind.hpp>
 #include "./detail/template_stack.hpp"
+#include "./detail/actions.hpp"
 
 namespace quickbook
 {

Modified: branches/release/tools/quickbook/detail/actions.cpp
==============================================================================
--- branches/release/tools/quickbook/detail/actions.cpp (original)
+++ branches/release/tools/quickbook/detail/actions.cpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -25,6 +25,9 @@
 
 namespace quickbook
 {
+ char const* quickbook_get_date = "__quickbook_get_date__";
+ char const* quickbook_get_time = "__quickbook_get_time__";
+
     namespace {
         std::string fully_qualified_id(std::string const& library_id,
             std::string const& qualified_section_id,

Modified: branches/release/tools/quickbook/detail/actions.hpp
==============================================================================
--- branches/release/tools/quickbook/detail/actions.hpp (original)
+++ branches/release/tools/quickbook/detail/actions.hpp 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -286,11 +286,8 @@
         collector& out;
     };
 
- namespace
- {
- char const* quickbook_get_date = "__quickbook_get_date__";
- char const* quickbook_get_time = "__quickbook_get_time__";
- }
+ extern char const* quickbook_get_date;
+ extern char const* quickbook_get_time;
 
     struct do_macro_action
     {

Modified: branches/release/tools/quickbook/test/Jamfile.v2
==============================================================================
--- branches/release/tools/quickbook/test/Jamfile.v2 (original)
+++ branches/release/tools/quickbook/test/Jamfile.v2 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -23,7 +23,7 @@
     [ quickbook-test templates ]
     [ quickbook-test templates_1_4 ]
     [ quickbook-test templates_1_5 ]
- [ quickbook-test xinclude ]
+ #[ quickbook-test xinclude ]
     [ quickbook-test import ]
     [ quickbook-test section_1_4 ]
     [ quickbook-test section_1_5 ]

Modified: branches/release/tools/quickbook/test/heading.gold
==============================================================================
--- branches/release/tools/quickbook/test/heading.gold (original)
+++ branches/release/tools/quickbook/test/heading.gold 2009-12-29 22:38:56 EST (Tue, 29 Dec 2009)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
-<article id="header" last-revision="$Date: 2009/10/11 16:14:06 $" xmlns:xi="http://www.w3.org/2001/XInclude">
+<article id="header" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude">
   <title>Header</title>
   <articleinfo>
   </articleinfo>


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