$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r57876 - in trunk/boost/spirit: home/karma/detail home/support/detail repository/home repository/home/karma repository/home/karma/string repository/home/qi/primitive repository/include
From: hartmut.kaiser_at_[hidden]
Date: 2009-11-23 18:35:39
Author: hkaiser
Date: 2009-11-23 18:35:38 EST (Mon, 23 Nov 2009)
New Revision: 57876
URL: http://svn.boost.org/trac/boost/changeset/57876
Log:
Spirit: added repository::karma::symbols generator
Added:
   trunk/boost/spirit/repository/home/karma/string/
   trunk/boost/spirit/repository/home/karma/string.hpp   (contents, props changed)
   trunk/boost/spirit/repository/home/karma/string/symbols.hpp   (contents, props changed)
   trunk/boost/spirit/repository/include/karma_string.hpp   (contents, props changed)
   trunk/boost/spirit/repository/include/karma_symbols.hpp   (contents, props changed)
Text files modified: 
   trunk/boost/spirit/home/karma/detail/string_generate.hpp     |   136 +++++++++++++++++++++++---------------- 
   trunk/boost/spirit/home/support/detail/endian.hpp            |     2                                         
   trunk/boost/spirit/repository/home/karma.hpp                 |     1                                         
   trunk/boost/spirit/repository/home/qi/primitive/iter_pos.hpp |     4                                         
   4 files changed, 84 insertions(+), 59 deletions(-)
Modified: trunk/boost/spirit/home/karma/detail/string_generate.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/detail/string_generate.hpp	(original)
+++ trunk/boost/spirit/home/karma/detail/string_generate.hpp	2009-11-23 18:35:38 EST (Mon, 23 Nov 2009)
@@ -13,44 +13,80 @@
 #include <string>
 #include <boost/spirit/home/support/char_class.hpp>
 #include <boost/spirit/home/karma/detail/generate_to.hpp>
-#include <boost/range/iterator_range.hpp>
+#include <boost/range/const_iterator.hpp>
 
 namespace boost { namespace spirit { namespace karma { namespace detail
 {
     ///////////////////////////////////////////////////////////////////////////
-    //  generate a string given by a pointer 
-    template <typename OutputIterator, typename Char>
-    inline bool string_generate(OutputIterator& sink, Char const* str)
+    // pass through character transformation
+    struct pass_through_filter
+    {
+        template <typename Char>
+        Char operator()(Char ch) const
+        {
+            return ch;
+        }
+    };
+
+    template <typename CharEncoding, typename Tag>
+    struct encoding_filter
+    {
+        template <typename Char>
+        Char operator()(Char ch) const
+        {
+            return spirit::char_class::convert<CharEncoding>::to(Tag(), ch);
+        }
+    };
+
+    ///////////////////////////////////////////////////////////////////////////
+    //  generate a string given by a std::string, applying the given filter
+    template <typename OutputIterator, typename Char, typename Filter>
+    inline bool string_generate(OutputIterator& sink, Char const* str
+      , Filter filter)
     {
         for (Char ch = *str; ch != 0; ch = *++str)
         {
-            *sink = ch;
+            *sink = filter(ch);
+            ++sink;
+        }
+        return detail::sink_is_good(sink);
+    }
+
+    template <typename OutputIterator, typename Container, typename Filter>
+    inline bool string_generate(OutputIterator& sink
+      , Container const& c, Filter filter)
+    {
+        typename range_const_iterator<Container>::type end = boost::end(c);
+        for (typename range_const_iterator<Container>::type it = boost::begin(c); 
+             it != end; ++it)
+        {
+            *sink = filter(*it);
             ++sink;
         }
         return detail::sink_is_good(sink);
     }
 
     ///////////////////////////////////////////////////////////////////////////
-    //  generate a string given by a std::string
+    //  generate a string without any transformation
+    template <typename OutputIterator, typename Char>
+    inline bool string_generate(OutputIterator& sink, Char const* str)
+    {
+        return string_generate(sink, str, pass_through_filter());
+    }
+
     template <typename OutputIterator, typename Char, typename Traits
       , typename Allocator>
     inline bool string_generate(OutputIterator& sink
       , std::basic_string<Char, Traits, Allocator> const& str)
     {
-        return string_generate(sink, str.c_str());
+        return string_generate(sink, str.c_str(), pass_through_filter());
     }
 
-    template <typename OutputIterator, typename Iterator>
+    template <typename OutputIterator, typename Container>
     inline bool string_generate(OutputIterator& sink
-      , boost::iterator_range<Iterator> const& r)
+      , Container const& c)
     {
-        Iterator end = r.end();
-        for (Iterator it = r.begin(); it != end; ++it)
-        {
-            *sink = *it;
-            ++sink;
-        }
-        return detail::sink_is_good(sink);
+        return string_generate(sink, c, pass_through_filter());
     }
 
     ///////////////////////////////////////////////////////////////////////////
@@ -58,48 +94,41 @@
     //  given character class and case tag
     template <typename OutputIterator, typename Char, typename CharEncoding
       , typename Tag>
-    inline bool string_generate(OutputIterator& sink, Char const* str
+    inline bool string_generate(OutputIterator& sink
+      , Char const* str
       , CharEncoding, Tag)
     {
-        for (Char ch = *str; ch != 0; ch = *++str)
-        {
-            *sink = spirit::char_class::convert<CharEncoding>::to(Tag(), ch);
-            ++sink;
-        }
-        return detail::sink_is_good(sink);
+        return string_generate(sink, str, encoding_filter<CharEncoding, Tag>());
     }
 
-    template <typename OutputIterator, typename Char>
-    inline bool string_generate(OutputIterator& sink, Char const* str
-      , unused_type, unused_type)
+    template <typename OutputIterator, typename Char
+      , typename CharEncoding, typename Tag
+      , typename Traits, typename Allocator>
+    inline bool string_generate(OutputIterator& sink
+      , std::basic_string<Char, Traits, Allocator> const& str
+      , CharEncoding, Tag)
     {
-        return string_generate(sink, str);
+        return string_generate(sink, str.c_str()
+          , encoding_filter<CharEncoding, Tag>());
     }
 
-    ///////////////////////////////////////////////////////////////////////////
-    //  generate a string given by a std::string, converting according using a 
-    //  given character class and case tag
-    template <typename OutputIterator, typename Char, typename CharEncoding
-      , typename Tag, typename Traits, typename Allocator>
-    inline bool string_generate(OutputIterator& sink
-      , std::basic_string<Char, Traits, Allocator> const& str
-      , CharEncoding ce, Tag tag)
+    template <typename OutputIterator, typename Container
+      , typename CharEncoding, typename Tag>
+    inline bool 
+    string_generate(OutputIterator& sink
+      , Container const& c
+      , CharEncoding, Tag)
     {
-        return string_generate(sink, str.c_str(), ce, tag);
+        return string_generate(sink, c, encoding_filter<CharEncoding, Tag>());
     }
 
-    template <typename OutputIterator, typename Iterator, typename CharEncoding
-      , typename Tag>
+    ///////////////////////////////////////////////////////////////////////////
+    template <typename OutputIterator, typename Char>
     inline bool string_generate(OutputIterator& sink
-      , boost::iterator_range<Iterator> const& r, CharEncoding, Tag)
+      , Char const* str
+      , unused_type, unused_type)
     {
-        Iterator end = r.end();
-        for (Iterator it = r.begin(); it != end; ++it)
-        {
-            *sink = spirit::char_class::convert<CharEncoding>::to(Tag(), *it);
-            ++sink;
-        }
-        return detail::sink_is_good(sink);
+        return string_generate(sink, str, pass_through_filter());
     }
 
     template <typename OutputIterator, typename Char, typename Traits
@@ -108,20 +137,15 @@
       , std::basic_string<Char, Traits, Allocator> const& str
       , unused_type, unused_type)
     {
-        return string_generate(sink, str.c_str());
+        return string_generate(sink, str.c_str(), pass_through_filter());
     }
 
-    template <typename OutputIterator, typename Iterator>
+    template <typename OutputIterator, typename Container>
     inline bool string_generate(OutputIterator& sink
-      , boost::iterator_range<Iterator> const& r, unused_type, unused_type)
+      , Container const& c
+      , unused_type, unused_type)
     {
-        Iterator end = r.end();
-        for (Iterator it = r.begin(); it != end; ++it)
-        {
-            *sink = *it;
-            ++sink;
-        }
-        return detail::sink_is_good(sink);
+        return string_generate(sink, c, pass_through_filter());
     }
 
 }}}}
Modified: trunk/boost/spirit/home/support/detail/endian.hpp
==============================================================================
--- trunk/boost/spirit/home/support/detail/endian.hpp	(original)
+++ trunk/boost/spirit/home/support/detail/endian.hpp	2009-11-23 18:35:38 EST (Mon, 23 Nov 2009)
@@ -16,7 +16,7 @@
 // We need to treat the endian number types as PODs
 #define BOOST_ENDIAN_FORCE_PODNESS
 
-// If Boost has the endian library use it, otherwise use an adapted version 
+// If Boost has the endian library, use it, otherwise use an adapted version 
 // included with Spirit
 #if BOOST_VERSION >= 104300
 #include <boost/integer/endian.hpp>
Modified: trunk/boost/spirit/repository/home/karma.hpp
==============================================================================
--- trunk/boost/spirit/repository/home/karma.hpp	(original)
+++ trunk/boost/spirit/repository/home/karma.hpp	2009-11-23 18:35:38 EST (Mon, 23 Nov 2009)
@@ -13,6 +13,7 @@
 
 #include <boost/spirit/repository/home/karma/directive.hpp>
 #include <boost/spirit/repository/home/karma/nonterminal.hpp>
+#include <boost/spirit/repository/home/karma/string.hpp>
 
 #endif
 
Added: trunk/boost/spirit/repository/home/karma/string.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/spirit/repository/home/karma/string.hpp	2009-11-23 18:35:38 EST (Mon, 23 Nov 2009)
@@ -0,0 +1,16 @@
+//  Copyright (c) 2001-2009 Hartmut Kaiser
+//
+//  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)
+
+#if !defined(SPIRIT_REPOSITORY_KARMA_STRING_NOV_23_2009_0326PM)
+#define SPIRIT_REPOSITORY_KARMA_STRING_NOV_23_2009_0326PM
+
+#if defined(_MSC_VER)
+#pragma once
+#endif
+
+#include <boost/spirit/repository/home/karma/string/symbols.hpp>
+
+#endif
+
Added: trunk/boost/spirit/repository/home/karma/string/symbols.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/spirit/repository/home/karma/string/symbols.hpp	2009-11-23 18:35:38 EST (Mon, 23 Nov 2009)
@@ -0,0 +1,513 @@
+//  Copyright (c) 2001-2009 Hartmut Kaiser
+// 
+//  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)
+
+#if !defined(BOOST_SPIRIT_REPOSITORY_KARMA_SYMBOLS_NOV_23_2009_1251PM)
+#define BOOST_SPIRIT_REPOSITORY_KARMA_SYMBOLS_NOV_23_2009_1251PM
+
+#include <boost/spirit/home/support/common_terminals.hpp>
+#include <boost/spirit/home/support/info.hpp>
+#include <boost/spirit/home/support/unused.hpp>
+#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/domain.hpp>
+#include <boost/spirit/home/karma/meta_compiler.hpp>
+#include <boost/spirit/home/karma/reference.hpp>
+#include <boost/spirit/home/karma/delimit_out.hpp>
+#include <boost/spirit/home/karma/detail/get_casetag.hpp>
+#include <boost/spirit/home/karma/detail/string_generate.hpp>
+#include <boost/config.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/mpl/if.hpp>
+#include <map>
+#include <set>
+
+#if defined(BOOST_MSVC)
+# pragma warning(push)
+# pragma warning(disable: 4355) // 'this' : used in base member initializer list warning
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+namespace boost { namespace spirit { namespace repository { namespace karma
+{
+    template <typename Attribute, typename T>
+    struct symbols_lookup
+      : mpl::if_<
+            traits::not_is_unused<T>
+          , std::map<Attribute, T>
+          , std::set<Attribute> 
+        >
+    {};
+
+    ///////////////////////////////////////////////////////////////////////////
+    template <
+        typename Attribute = char, typename T = unused_type
+      , typename Lookup = typename symbols_lookup<Attribute, T>::type
+      , typename CharEncoding = unused_type, typename Tag = unused_type>
+    struct symbols
+      : proto::extends<
+            typename proto::terminal<
+                spirit::karma::reference<
+                    symbols<Attribute, T, Lookup, CharEncoding, Tag> >
+            >::type
+          , symbols<Attribute, T, Lookup, CharEncoding, Tag> >
+      , spirit::karma::generator<
+            symbols<Attribute, T, Lookup, CharEncoding, Tag> >
+    {
+        typedef T value_type;       // the value associated with each entry
+
+        typedef spirit::karma::reference<symbols> reference_;
+        typedef typename proto::terminal<reference_>::type terminal;
+        typedef proto::extends<terminal, symbols> base_type;
+
+        template <typename Context, typename Unused>
+        struct attribute
+        {
+            typedef Attribute type;
+        };
+
+        symbols()
+          : base_type(terminal::make(reference_(*this)))
+          , add(*this)
+          , remove(*this)
+          , lookup(new Lookup())
+        {}
+
+        symbols(symbols const& syms)
+          : base_type(terminal::make(reference_(*this)))
+          , add(*this)
+          , remove(*this)
+          , lookup(syms.lookup)
+        {}
+
+        template <typename CharEncoding_, typename Tag_>
+        symbols(symbols<Attribute, T, Lookup, CharEncoding_, Tag_> const& syms)
+          : base_type(terminal::make(reference_(*this)))
+          , add(*this)
+          , remove(*this)
+          , lookup(syms.lookup)
+        {}
+
+        template <typename Symbols, typename Data>
+        symbols(Symbols const& syms, Data const& data)
+          : base_type(terminal::make(reference_(*this)))
+          , add(*this)
+          , remove(*this)
+          , lookup(new Lookup())
+        {
+            typename range_const_iterator<Symbols>::type si = boost::begin(syms);
+            typename range_const_iterator<Data>::type di = boost::begin(data);
+            while (si != boost::end(syms))
+                add(*si++, *di++);
+        }
+
+        symbols&
+        operator=(symbols const& rhs)
+        {
+            *lookup = *rhs.lookup;
+            return *this;
+        }
+
+        template <typename CharEncoding_, typename Tag_>
+        symbols&
+        operator=(symbols<Attribute, T, Lookup, CharEncoding_, Tag_> const& rhs)
+        {
+            *lookup = *rhs.lookup;
+            return *this;
+        }
+
+        void clear()
+        {
+            lookup->clear();
+        }
+
+        struct adder;
+        struct remover;
+
+        template <typename Attr, typename T_>
+        adder const&
+        operator=(std::pair<Attr, T_> const& p)
+        {
+            lookup->clear();
+            return add(p.first, p.second);
+        }
+
+        template <typename Attr, typename T_>
+        friend adder const&
+        operator+= (symbols& sym, std::pair<Attr, T_> const& p)
+        {
+            return sym.add(p.first, p.second);
+        }
+
+        template <typename Attr>
+        friend remover const&
+        operator-= (symbols& sym, Attr const& attr)
+        {
+            return sym.remove(attr);
+        }
+
+        // non-const version needed to suppress proto's += kicking in
+        template <typename Attr, typename T_>
+        friend adder const&
+        operator+= (symbols& sym, std::pair<Attr, T_>& p)
+        {
+            return sym.add(p.first, p.second);
+        }
+
+        // non-const version needed to suppress proto's -= kicking in
+        template <typename Attr>
+        friend remover const&
+        operator-= (symbols& sym, Attr& str)
+        {
+            return sym.remove(attr);
+        }
+
+        template <typename F>
+        void for_each(F f) const
+        {
+            std::for_each(lookup->begin(), lookup->end(), f);
+        }
+
+        template <typename Attr>
+        value_type* find(Attr const& attr)
+        {
+            typename Lookup::iterator it = lookup->find(attr);
+            return (it != lookup->end()) ? &(*it).second : 0;
+        }
+
+        ///////////////////////////////////////////////////////////////////////
+        template <typename OutputIterator, typename Context, typename Delimiter
+          , typename Attr>
+        bool generate(OutputIterator& sink, Context&, Delimiter const& d
+          , Attr const& attr) const
+        {
+            typename Lookup::iterator it = lookup->find(attr);
+            if (it == lookup->end())
+                return false;
+
+            return spirit::karma::detail::string_generate(
+                       sink, (*it).second, CharEncoding(), Tag()) &&
+                   spirit::karma::delimit_out(sink, d);
+        }
+
+        template <typename Context>
+        info what(Context&) const
+        {
+            return info("symbols");
+        }
+
+        ///////////////////////////////////////////////////////////////////////
+        struct adder
+        {
+            template <typename, typename = unused_type>
+            struct result { typedef adder const& type; };
+
+            adder(symbols& sym)
+              : sym(sym)
+            {
+            }
+
+            template <typename Attr>
+            adder const&
+            operator()(Attr const& attr, T const& val = T()) const
+            {
+                sym.lookup->insert(typename Lookup::value_type(attr, val));
+                return *this;
+            }
+
+            symbols& sym;
+
+        private:
+            // silence MSVC warning C4512: assignment operator could not be generated
+            adder& operator= (adder const&);
+        };
+
+        struct remover
+        {
+            template <typename>
+            struct result { typedef remover const& type; };
+
+            remover(symbols& sym)
+              : sym(sym)
+            {
+            }
+
+            template <typename Attr>
+            remover const&
+            operator()(Attr const& attr) const
+            {
+                sym.lookup->erase(attr);
+                return *this;
+            }
+
+            symbols& sym;
+
+        private:
+            // silence MSVC warning C4512: assignment operator could not be generated
+            remover& operator= (remover const&);
+        };
+
+        adder add;
+        remover remove;
+        shared_ptr<Lookup> lookup;
+    };
+
+    ///////////////////////////////////////////////////////////////////////////
+    // specialization for unused stored type
+    template <
+        typename Attribute, typename Lookup
+      , typename CharEncoding, typename Tag>
+    struct symbols<Attribute, unused_type, Lookup, CharEncoding, Tag>
+      : proto::extends<
+            typename proto::terminal<
+                spirit::karma::reference<
+                    symbols<Attribute, unused_type, Lookup, CharEncoding, Tag> >
+            >::type
+          , symbols<Attribute, unused_type, Lookup, CharEncoding, Tag>
+        >
+      , spirit::karma::generator<
+            symbols<Attribute, unused_type, Lookup, CharEncoding, Tag> >
+    {
+        typedef unused_type value_type;  // the value associated with each entry
+
+        typedef spirit::karma::reference<symbols> reference_;
+        typedef typename proto::terminal<reference_>::type terminal;
+        typedef proto::extends<terminal, symbols> base_type;
+
+        template <typename Context, typename Unused>
+        struct attribute
+        {
+            typedef Attribute type;
+        };
+
+        symbols()
+          : base_type(terminal::make(reference_(*this)))
+          , add(*this)
+          , remove(*this)
+          , lookup(new Lookup())
+        {}
+
+        symbols(symbols const& syms)
+          : base_type(terminal::make(reference_(*this)))
+          , add(*this)
+          , remove(*this)
+          , lookup(syms.lookup)
+        {}
+
+        template <typename CharEncoding_, typename Tag_>
+        symbols(symbols<Attribute, unused_type, Lookup, CharEncoding_, Tag_> const& syms)
+          : base_type(terminal::make(reference_(*this)))
+          , add(*this)
+          , remove(*this)
+          , lookup(syms.lookup)
+        {}
+
+        template <typename Symbols, typename Data>
+        symbols(Symbols const& syms, Data const& data)
+          : base_type(terminal::make(reference_(*this)))
+          , add(*this)
+          , remove(*this)
+          , lookup(new Lookup())
+        {
+            typename range_const_iterator<Symbols>::type si = boost::begin(syms);
+            typename range_const_iterator<Data>::type di = boost::begin(data);
+            while (si != boost::end(syms))
+                add(*si++, *di++);
+        }
+
+        symbols&
+        operator=(symbols const& rhs)
+        {
+            *lookup = *rhs.lookup;
+            return *this;
+        }
+
+        template <typename CharEncoding_, typename Tag_>
+        symbols&
+        operator=(symbols<Attribute, unused_type, Lookup, CharEncoding_, Tag_> const& rhs)
+        {
+            *lookup = *rhs.lookup;
+            return *this;
+        }
+
+        void clear()
+        {
+            lookup->clear();
+        }
+
+        struct adder;
+        struct remover;
+
+        template <typename Attr>
+        adder const&
+        operator=(Attr const& attr)
+        {
+            lookup->clear();
+            return add(attr);
+        }
+
+        template <typename Attr>
+        friend adder const&
+        operator+= (symbols& sym, Attr const& attr)
+        {
+            return sym.add(attr);
+        }
+
+        template <typename Attr>
+        friend remover const&
+        operator-= (symbols& sym, Attr const& attr)
+        {
+            return sym.remove(attr);
+        }
+
+        // non-const version needed to suppress proto's += kicking in
+        template <typename Attr>
+        friend adder const&
+        operator+= (symbols& sym, Attr& attr)
+        {
+            return sym.add(attr);
+        }
+
+        // non-const version needed to suppress proto's -= kicking in
+        template <typename Attr>
+        friend remover const&
+        operator-= (symbols& sym, Attr& str)
+        {
+            return sym.remove(attr);
+        }
+
+        template <typename F>
+        void for_each(F f) const
+        {
+            std::for_each(lookup->begin(), lookup->end(), f);
+        }
+
+        template <typename Attr>
+        value_type* find(Attr const& attr)
+        {
+            typename Lookup::iterator it = lookup->find(attr);
+            return (it != lookup->end()) ? &unused : 0;
+        }
+
+        ///////////////////////////////////////////////////////////////////////
+        template <typename OutputIterator, typename Context, typename Delimiter
+          , typename Attr>
+        bool generate(OutputIterator& sink, Context&, Delimiter const& d
+          , Attr const& attr) const
+        {
+            typename Lookup::iterator it = lookup->find(attr);
+            if (it == lookup->end())
+                return false;
+
+            return spirit::karma::detail::string_generate(
+                       sink, attr, CharEncoding(), Tag()) &&
+                   spirit::karma::delimit_out(sink, d);
+        }
+
+        template <typename Context>
+        info what(Context&) const
+        {
+            return info("symbols");
+        }
+
+        ///////////////////////////////////////////////////////////////////////
+        struct adder
+        {
+            template <typename, typename = unused_type>
+            struct result { typedef adder const& type; };
+
+            adder(symbols& sym)
+              : sym(sym)
+            {
+            }
+
+            template <typename Attr>
+            adder const&
+            operator()(Attr const& attr) const
+            {
+                sym.lookup->insert(attr);
+                return *this;
+            }
+
+            symbols& sym;
+
+        private:
+            // silence MSVC warning C4512: assignment operator could not be generated
+            adder& operator= (adder const&);
+        };
+
+        struct remover
+        {
+            template <typename>
+            struct result { typedef remover const& type; };
+
+            remover(symbols& sym)
+              : sym(sym)
+            {
+            }
+
+            template <typename Attr>
+            remover const&
+            operator()(Attr const& attr) const
+            {
+                sym.lookup->erase(attr);
+                return *this;
+            }
+
+            symbols& sym;
+
+        private:
+            // silence MSVC warning C4512: assignment operator could not be generated
+            remover& operator= (remover const&);
+        };
+
+        adder add;
+        remover remove;
+        shared_ptr<Lookup> lookup;
+    };
+}}}}
+
+namespace boost { namespace spirit { namespace karma
+{
+    ///////////////////////////////////////////////////////////////////////////
+    // Generator generators: make_xxx function (objects)
+    ///////////////////////////////////////////////////////////////////////////
+    template <typename Attribute, typename T, typename Lookup
+      , typename CharEnconding, typename Tag, typename Modifiers>
+    struct make_primitive<
+        reference<
+            repository::karma::symbols<Attribute, T, Lookup, CharEnconding, Tag> >
+      , Modifiers>
+    {
+        static bool const lower = 
+            has_modifier<Modifiers, tag::char_code_base<tag::lower> >::value;
+        static bool const upper = 
+            has_modifier<Modifiers, tag::char_code_base<tag::upper> >::value;
+
+        typedef reference<
+            repository::karma::symbols<Attribute, T, Lookup, CharEnconding, Tag> 
+        > reference_;
+
+        typedef typename mpl::if_c<
+            lower || upper
+          , repository::karma::symbols<
+                Attribute, T, Lookup
+              , typename spirit::detail::get_encoding<
+                    Modifiers, unused_type, lower || upper>::type
+              , typename detail::get_casetag<Modifiers, lower || upper>::type>
+          , reference_>::type
+        result_type;
+
+        result_type operator()(reference_ ref, unused_type) const
+        {
+            return result_type(ref.ref.get());
+        }
+    };
+}}}
+
+#if defined(BOOST_MSVC)
+# pragma warning(pop)
+#endif
+
+#endif
+
Modified: trunk/boost/spirit/repository/home/qi/primitive/iter_pos.hpp
==============================================================================
--- trunk/boost/spirit/repository/home/qi/primitive/iter_pos.hpp	(original)
+++ trunk/boost/spirit/repository/home/qi/primitive/iter_pos.hpp	2009-11-23 18:35:38 EST (Mon, 23 Nov 2009)
@@ -3,8 +3,8 @@
 //  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)
 
-#if !defined(ITER_POS_NOV_20_2009_1245PM)
-#define ITER_POS_NOV_20_2009_1245PM
+#if !defined(BOOST_SPIRIT_REPOSITORY_QI_ITER_POS_NOV_20_2009_1245PM)
+#define BOOST_SPIRIT_REPOSITORY_QI_ITER_POS_NOV_20_2009_1245PM
 
 #include <boost/spirit/include/qi_parse.hpp>
 
Added: trunk/boost/spirit/repository/include/karma_string.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/spirit/repository/include/karma_string.hpp	2009-11-23 18:35:38 EST (Mon, 23 Nov 2009)
@@ -0,0 +1,18 @@
+/*=============================================================================
+    Copyright (c) 2001-2009 Joel de Guzman
+    Copyright (c) 2001-2009 Hartmut Kaiser
+    http://spirit.sourceforge.net/
+
+    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)
+=============================================================================*/
+#ifndef BOOST_SPIRIT_INCLUDE_REPOSITORY_KARMA_STRING
+#define BOOST_SPIRIT_INCLUDE_REPOSITORY_KARMA_STRING
+
+#if defined(_MSC_VER)
+#pragma once
+#endif
+
+#include <boost/spirit/repository/home/karma/string.hpp>
+
+#endif
Added: trunk/boost/spirit/repository/include/karma_symbols.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/spirit/repository/include/karma_symbols.hpp	2009-11-23 18:35:38 EST (Mon, 23 Nov 2009)
@@ -0,0 +1,18 @@
+/*=============================================================================
+    Copyright (c) 2001-2009 Joel de Guzman
+    Copyright (c) 2001-2009 Hartmut Kaiser
+    http://spirit.sourceforge.net/
+
+    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)
+=============================================================================*/
+#ifndef BOOST_SPIRIT_REPOSITORY_INCLUDE_KARMA_SYMBOLS
+#define BOOST_SPIRIT_REPOSITORY_INCLUDE_KARMA_SYMBOLS
+
+#if defined(_MSC_VER)
+#pragma once
+#endif
+
+#include <boost/spirit/repository/home/karma/string/symbols.hpp>
+
+#endif