|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r61389 - in trunk/boost/spirit: home/karma home/karma/action home/karma/auxiliary home/karma/detail home/karma/directive home/karma/nonterminal home/karma/operator home/karma/string home/lex/qi home/qi/action home/qi/auxiliary home/qi/binary home/qi/detail home/qi/directive home/qi/nonterminal home/qi/numeric/detail home/qi/operator home/support repository/home/karma/directive repository/home/karma/nonterminal repository/home/qi/directive repository/home/qi/nonterminal
From: hartmut.kaiser_at_[hidden]
Date: 2010-04-18 21:56:22
Author: hkaiser
Date: 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
New Revision: 61389
URL: http://svn.boost.org/trac/boost/changeset/61389
Log:
Spirit: refactored implementation of transform_attribute
Added:
trunk/boost/spirit/home/karma/detail/attributes.hpp (contents, props changed)
trunk/boost/spirit/home/qi/detail/attributes.hpp (contents, props changed)
Text files modified:
trunk/boost/spirit/home/karma/action/action.hpp | 2
trunk/boost/spirit/home/karma/auxiliary/attr_cast.hpp | 2
trunk/boost/spirit/home/karma/auxiliary/eol.hpp | 2
trunk/boost/spirit/home/karma/auxiliary/lazy.hpp | 2
trunk/boost/spirit/home/karma/detail/alternative_function.hpp | 6
trunk/boost/spirit/home/karma/detail/extract_from.hpp | 2
trunk/boost/spirit/home/karma/detail/pass_container.hpp | 2
trunk/boost/spirit/home/karma/directive/buffer.hpp | 2
trunk/boost/spirit/home/karma/directive/center_alignment.hpp | 2
trunk/boost/spirit/home/karma/directive/columns.hpp | 2
trunk/boost/spirit/home/karma/directive/delimit.hpp | 2
trunk/boost/spirit/home/karma/directive/left_alignment.hpp | 2
trunk/boost/spirit/home/karma/directive/maxwidth.hpp | 2
trunk/boost/spirit/home/karma/directive/no_delimit.hpp | 2
trunk/boost/spirit/home/karma/directive/omit.hpp | 2
trunk/boost/spirit/home/karma/directive/repeat.hpp | 2
trunk/boost/spirit/home/karma/directive/right_alignment.hpp | 2
trunk/boost/spirit/home/karma/directive/verbatim.hpp | 2
trunk/boost/spirit/home/karma/nonterminal/rule.hpp | 2
trunk/boost/spirit/home/karma/operator/and_predicate.hpp | 2
trunk/boost/spirit/home/karma/operator/kleene.hpp | 2
trunk/boost/spirit/home/karma/operator/list.hpp | 2
trunk/boost/spirit/home/karma/operator/not_predicate.hpp | 2
trunk/boost/spirit/home/karma/operator/optional.hpp | 2
trunk/boost/spirit/home/karma/operator/plus.hpp | 2
trunk/boost/spirit/home/karma/operator/sequence.hpp | 2
trunk/boost/spirit/home/karma/phoenix_attributes.hpp | 2
trunk/boost/spirit/home/karma/string/symbols.hpp | 14 +-
trunk/boost/spirit/home/lex/qi/plain_token.hpp | 2
trunk/boost/spirit/home/lex/qi/state_switcher.hpp | 2
trunk/boost/spirit/home/qi/action/action.hpp | 2
trunk/boost/spirit/home/qi/auxiliary/attr_cast.hpp | 2
trunk/boost/spirit/home/qi/auxiliary/lazy.hpp | 2
trunk/boost/spirit/home/qi/binary/binary.hpp | 2
trunk/boost/spirit/home/qi/detail/alternative_function.hpp | 2
trunk/boost/spirit/home/qi/detail/assign_to.hpp | 2
trunk/boost/spirit/home/qi/detail/pass_container.hpp | 2
trunk/boost/spirit/home/qi/directive/lexeme.hpp | 2
trunk/boost/spirit/home/qi/directive/repeat.hpp | 2
trunk/boost/spirit/home/qi/directive/skip.hpp | 2
trunk/boost/spirit/home/qi/nonterminal/rule.hpp | 2
trunk/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp | 2
trunk/boost/spirit/home/qi/numeric/detail/real_impl.hpp | 2
trunk/boost/spirit/home/qi/operator/alternative.hpp | 2
trunk/boost/spirit/home/qi/operator/and_predicate.hpp | 2
trunk/boost/spirit/home/qi/operator/difference.hpp | 2
trunk/boost/spirit/home/qi/operator/kleene.hpp | 10 +
trunk/boost/spirit/home/qi/operator/list.hpp | 2
trunk/boost/spirit/home/qi/operator/not_predicate.hpp | 2
trunk/boost/spirit/home/qi/operator/optional.hpp | 2
trunk/boost/spirit/home/qi/operator/permutation.hpp | 2
trunk/boost/spirit/home/qi/operator/plus.hpp | 2
trunk/boost/spirit/home/qi/operator/sequence.hpp | 14 ++
trunk/boost/spirit/home/qi/operator/sequence_base.hpp | 2
trunk/boost/spirit/home/qi/operator/sequential_or.hpp | 2
trunk/boost/spirit/home/support/attributes.hpp | 237 +++------------------------------------
trunk/boost/spirit/repository/home/karma/directive/confix.hpp | 2
trunk/boost/spirit/repository/home/karma/nonterminal/subrule.hpp | 2
trunk/boost/spirit/repository/home/qi/directive/confix.hpp | 2
trunk/boost/spirit/repository/home/qi/directive/distinct.hpp | 2
trunk/boost/spirit/repository/home/qi/nonterminal/subrule.hpp | 2
61 files changed, 107 insertions(+), 286 deletions(-)
Modified: trunk/boost/spirit/home/karma/action/action.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/action/action.hpp (original)
+++ trunk/boost/spirit/home/karma/action/action.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -10,7 +10,7 @@
#pragma once
#endif
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/argument.hpp>
#include <boost/spirit/home/support/context.hpp>
#include <boost/spirit/home/support/unused.hpp>
Modified: trunk/boost/spirit/home/karma/auxiliary/attr_cast.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/auxiliary/attr_cast.hpp (original)
+++ trunk/boost/spirit/home/karma/auxiliary/attr_cast.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -16,7 +16,7 @@
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/auxiliary/attr_cast.hpp>
namespace boost { namespace spirit
Modified: trunk/boost/spirit/home/karma/auxiliary/eol.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/auxiliary/eol.hpp (original)
+++ trunk/boost/spirit/home/karma/auxiliary/eol.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -13,7 +13,7 @@
#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/detail/attributes.hpp>
#include <boost/spirit/home/karma/domain.hpp>
#include <boost/spirit/home/karma/meta_compiler.hpp>
#include <boost/spirit/home/karma/delimit_out.hpp>
Modified: trunk/boost/spirit/home/karma/auxiliary/lazy.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/auxiliary/lazy.hpp (original)
+++ trunk/boost/spirit/home/karma/auxiliary/lazy.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -14,7 +14,7 @@
#include <boost/spirit/home/karma/domain.hpp>
#include <boost/spirit/home/karma/delimit_out.hpp>
#include <boost/spirit/home/karma/meta_compiler.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/lazy.hpp>
Modified: trunk/boost/spirit/home/karma/detail/alternative_function.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/detail/alternative_function.hpp (original)
+++ trunk/boost/spirit/home/karma/detail/alternative_function.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -14,7 +14,7 @@
#include <boost/spirit/home/karma/domain.hpp>
#include <boost/spirit/home/karma/directive/buffer.hpp>
#include <boost/spirit/home/support/unused.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/detail/hold_any.hpp>
#include <boost/spirit/home/karma/detail/output_iterator.hpp>
#include <boost/spirit/home/support/container.hpp>
@@ -114,8 +114,6 @@
traits::compute_compatible_component<Expected, Attribute, domain>
component_type;
- typedef typename component_type::distance distance_type;
-
// if we got passed an empty optional, just fail generation
if (!traits::has_optional_value(attr))
return false;
@@ -124,7 +122,7 @@
// expectations
typename traits::optional_attribute<Attribute>::type attr_ =
traits::optional_value(attr);
- if (attr_.which() != distance_type::value)
+ if (!component_type::is_compatible(attr_.which()))
return false;
// returns true if any of the generators succeed
Added: trunk/boost/spirit/home/karma/detail/attributes.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/spirit/home/karma/detail/attributes.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -0,0 +1,107 @@
+// Copyright (c) 2001-2010 Hartmut Kaiser
+// Copyright (c) 2001-2010 Joel de Guzman
+//
+// 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_KARMA_DETAIL_ATTRIBUTES_APR_18_2010_0453PM)
+#define SPIRIT_KARMA_DETAIL_ATTRIBUTES_APR_18_2010_0453PM
+
+#include <boost/spirit/home/karma/domain.hpp>
+#include <boost/spirit/home/support/attributes.hpp>
+
+///////////////////////////////////////////////////////////////////////////////
+namespace boost { namespace spirit { namespace karma
+{
+ template <typename Exposed, typename Transformed, typename Enable = void>
+ struct transform_attribute
+ {
+ typedef Transformed type;
+ static Transformed pre(Exposed& val)
+ {
+ return Transformed(traits::extract_from<Exposed>(val, unused));
+ }
+ // Karma only, no post() and no fail() required
+ };
+
+ template <typename Exposed, typename Transformed>
+ struct transform_attribute<boost::optional<Exposed> const, Transformed
+ , typename disable_if<is_same<boost::optional<Exposed>, Transformed> >::type>
+ {
+ typedef Transformed const& type;
+ static Transformed const& pre(boost::optional<Exposed> const& val)
+ {
+ return boost::get<Transformed>(val);
+ }
+ };
+
+ template <typename Attribute>
+ struct transform_attribute<Attribute const, Attribute>
+ {
+ typedef Attribute const& type;
+ static Attribute const& pre(Attribute const& val) { return val; }
+ // Karma only, no post() and no fail() required
+ };
+
+ // reference types need special handling
+ template <typename Exposed, typename Transformed>
+ struct transform_attribute<Exposed&, Transformed>
+ : transform_attribute<Exposed, Transformed>
+ {};
+
+ template <typename Exposed, typename Transformed>
+ struct transform_attribute<Exposed const&, Transformed>
+ : transform_attribute<Exposed const, Transformed>
+ {};
+
+ template <typename Attribute>
+ struct transform_attribute<Attribute const&, Attribute>
+ : transform_attribute<Attribute const, Attribute>
+ {};
+
+ // unused_type needs some special handling as well
+ template <>
+ struct transform_attribute<unused_type, unused_type>
+ {
+ typedef unused_type type;
+ static unused_type pre(unused_type) { return unused; }
+ };
+
+ template <>
+ struct transform_attribute<unused_type const, unused_type>
+ : transform_attribute<unused_type, unused_type>
+ {};
+
+ template <typename Attribute>
+ struct transform_attribute<unused_type, Attribute>
+ : transform_attribute<unused_type, unused_type>
+ {};
+
+ template <typename Attribute>
+ struct transform_attribute<unused_type const, Attribute>
+ : transform_attribute<unused_type, unused_type>
+ {};
+
+ template <typename Attribute>
+ struct transform_attribute<Attribute, unused_type>
+ : transform_attribute<unused_type, unused_type>
+ {};
+
+ template <typename Attribute>
+ struct transform_attribute<Attribute const, unused_type>
+ : transform_attribute<unused_type, unused_type>
+ {};
+}}}
+
+///////////////////////////////////////////////////////////////////////////////
+namespace boost { namespace spirit { namespace traits
+{
+ template <typename Exposed, typename Transformed>
+ struct transform_attribute<Exposed, Transformed, karma::domain>
+ : karma::transform_attribute<Exposed, Transformed>
+ {};
+}}}
+
+#endif
+
+
Modified: trunk/boost/spirit/home/karma/detail/extract_from.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/detail/extract_from.hpp (original)
+++ trunk/boost/spirit/home/karma/detail/extract_from.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -12,7 +12,7 @@
#include <boost/spirit/home/phoenix/core/actor.hpp>
#include <boost/spirit/home/support/unused.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/container.hpp>
#include <boost/ref.hpp>
Modified: trunk/boost/spirit/home/karma/detail/pass_container.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/detail/pass_container.hpp (original)
+++ trunk/boost/spirit/home/karma/detail/pass_container.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -12,7 +12,7 @@
#pragma once
#endif
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/container.hpp>
#include <boost/spirit/home/support/detail/hold_any.hpp>
#include <boost/type_traits/is_base_of.hpp>
Modified: trunk/boost/spirit/home/karma/directive/buffer.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/directive/buffer.hpp (original)
+++ trunk/boost/spirit/home/karma/directive/buffer.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -17,7 +17,7 @@
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
namespace boost { namespace spirit
{
Modified: trunk/boost/spirit/home/karma/directive/center_alignment.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/directive/center_alignment.hpp (original)
+++ trunk/boost/spirit/home/karma/directive/center_alignment.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -19,7 +19,7 @@
#include <boost/spirit/home/karma/auxiliary/lazy.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/fusion/include/at.hpp>
Modified: trunk/boost/spirit/home/karma/directive/columns.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/directive/columns.hpp (original)
+++ trunk/boost/spirit/home/karma/directive/columns.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -19,7 +19,7 @@
#include <boost/spirit/home/karma/auxiliary/lazy.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/fusion/include/vector.hpp>
Modified: trunk/boost/spirit/home/karma/directive/delimit.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/directive/delimit.hpp (original)
+++ trunk/boost/spirit/home/karma/directive/delimit.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -18,7 +18,7 @@
#include <boost/spirit/home/karma/auxiliary/lazy.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/fusion/include/vector.hpp>
Modified: trunk/boost/spirit/home/karma/directive/left_alignment.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/directive/left_alignment.hpp (original)
+++ trunk/boost/spirit/home/karma/directive/left_alignment.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -19,7 +19,7 @@
#include <boost/spirit/home/karma/auxiliary/lazy.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/fusion/include/at.hpp>
Modified: trunk/boost/spirit/home/karma/directive/maxwidth.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/directive/maxwidth.hpp (original)
+++ trunk/boost/spirit/home/karma/directive/maxwidth.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -19,7 +19,7 @@
#include <boost/spirit/home/karma/auxiliary/lazy.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/fusion/include/at.hpp>
Modified: trunk/boost/spirit/home/karma/directive/no_delimit.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/directive/no_delimit.hpp (original)
+++ trunk/boost/spirit/home/karma/directive/no_delimit.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -17,7 +17,7 @@
#include <boost/spirit/home/karma/auxiliary/lazy.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
namespace boost { namespace spirit
Modified: trunk/boost/spirit/home/karma/directive/omit.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/directive/omit.hpp (original)
+++ trunk/boost/spirit/home/karma/directive/omit.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -16,7 +16,7 @@
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
namespace boost { namespace spirit
{
Modified: trunk/boost/spirit/home/karma/directive/repeat.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/directive/repeat.hpp (original)
+++ trunk/boost/spirit/home/karma/directive/repeat.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -17,7 +17,7 @@
#include <boost/spirit/home/karma/operator/kleene.hpp>
#include <boost/spirit/home/support/container.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/fusion/include/at.hpp>
Modified: trunk/boost/spirit/home/karma/directive/right_alignment.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/directive/right_alignment.hpp (original)
+++ trunk/boost/spirit/home/karma/directive/right_alignment.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -19,7 +19,7 @@
#include <boost/spirit/home/karma/auxiliary/lazy.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/fusion/include/at.hpp>
Modified: trunk/boost/spirit/home/karma/directive/verbatim.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/directive/verbatim.hpp (original)
+++ trunk/boost/spirit/home/karma/directive/verbatim.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -18,7 +18,7 @@
#include <boost/spirit/home/karma/auxiliary/lazy.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
namespace boost { namespace spirit
Modified: trunk/boost/spirit/home/karma/nonterminal/rule.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/nonterminal/rule.hpp (original)
+++ trunk/boost/spirit/home/karma/nonterminal/rule.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -30,7 +30,7 @@
#include <boost/spirit/home/support/argument.hpp>
#include <boost/spirit/home/support/context.hpp>
#include <boost/spirit/home/support/info.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/nonterminal/extract_param.hpp>
#include <boost/spirit/home/support/nonterminal/locals.hpp>
#include <boost/spirit/home/karma/reference.hpp>
Modified: trunk/boost/spirit/home/karma/operator/and_predicate.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/operator/and_predicate.hpp (original)
+++ trunk/boost/spirit/home/karma/operator/and_predicate.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -15,7 +15,7 @@
#include <boost/spirit/home/karma/meta_compiler.hpp>
#include <boost/spirit/home/karma/generator.hpp>
#include <boost/spirit/home/karma/detail/output_iterator.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
namespace boost { namespace spirit
Modified: trunk/boost/spirit/home/karma/operator/kleene.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/operator/kleene.hpp (original)
+++ trunk/boost/spirit/home/karma/operator/kleene.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -18,7 +18,7 @@
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/container.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/type_traits/add_const.hpp>
Modified: trunk/boost/spirit/home/karma/operator/list.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/operator/list.hpp (original)
+++ trunk/boost/spirit/home/karma/operator/list.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -18,7 +18,7 @@
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/container.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
namespace boost { namespace spirit
{
Modified: trunk/boost/spirit/home/karma/operator/not_predicate.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/operator/not_predicate.hpp (original)
+++ trunk/boost/spirit/home/karma/operator/not_predicate.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -15,7 +15,7 @@
#include <boost/spirit/home/karma/meta_compiler.hpp>
#include <boost/spirit/home/karma/generator.hpp>
#include <boost/spirit/home/karma/detail/output_iterator.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
namespace boost { namespace spirit
Modified: trunk/boost/spirit/home/karma/operator/optional.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/operator/optional.hpp (original)
+++ trunk/boost/spirit/home/karma/operator/optional.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -16,7 +16,7 @@
#include <boost/spirit/home/karma/meta_compiler.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/detail/attributes.hpp>
#include <boost/spirit/home/support/container.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/optional.hpp>
Modified: trunk/boost/spirit/home/karma/operator/plus.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/operator/plus.hpp (original)
+++ trunk/boost/spirit/home/karma/operator/plus.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -18,7 +18,7 @@
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/container.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/type_traits/add_const.hpp>
Modified: trunk/boost/spirit/home/karma/operator/sequence.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/operator/sequence.hpp (original)
+++ trunk/boost/spirit/home/karma/operator/sequence.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -18,7 +18,7 @@
#include <boost/spirit/home/karma/detail/pass_container.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/detail/what_function.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/algorithm/any_if.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/sequence_base_id.hpp>
Modified: trunk/boost/spirit/home/karma/phoenix_attributes.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/phoenix_attributes.hpp (original)
+++ trunk/boost/spirit/home/karma/phoenix_attributes.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -15,7 +15,7 @@
// we support Phoenix attributes only starting with V2.2
#if SPIRIT_VERSION >= 0x2020
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/container.hpp>
#include <boost/spirit/include/phoenix_core.hpp>
Modified: trunk/boost/spirit/home/karma/string/symbols.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/string/symbols.hpp (original)
+++ trunk/boost/spirit/home/karma/string/symbols.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -9,7 +9,7 @@
#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/detail/attributes.hpp>
#include <boost/spirit/home/karma/domain.hpp>
#include <boost/spirit/home/karma/meta_compiler.hpp>
#include <boost/spirit/home/karma/reference.hpp>
@@ -31,7 +31,7 @@
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit { namespace traits
{
- template <typename Attribute, typename T, typename Enable = void>
+ template <typename T, typename Attribute, typename Enable = void>
struct symbols_lookup
{
typedef
@@ -142,7 +142,7 @@
namespace boost { namespace spirit { namespace karma
{
///////////////////////////////////////////////////////////////////////////
- template <typename Attribute, typename T>
+ template <typename T, typename Attribute>
struct symbols_lookup
: mpl::if_<
traits::not_is_unused<T>
@@ -185,7 +185,7 @@
template <
typename Attribute = char, typename T = unused_type
- , typename Lookup = typename symbols_lookup<Attribute, T>::type
+ , typename Lookup = typename symbols_lookup<T, Attribute>::type
, typename CharEncoding = unused_type, typename Tag = unused_type>
struct symbols
: proto::extends<
@@ -330,7 +330,7 @@
, Attr const& attr) const
{
typename Lookup::iterator it = lookup->find(
- traits::symbols_lookup<Attribute, Attr>::call(attr));
+ traits::symbols_lookup<Attr, Attribute>::call(attr));
if (it == lookup->end())
return false;
@@ -571,13 +571,13 @@
, Attr const& attr) const
{
typename Lookup::iterator it = lookup->find(
- traits::symbols_lookup<Attribute, Attr>::call(attr));
+ traits::symbols_lookup<Attr, Attribute>::call(attr));
if (it == lookup->end())
return false;
return karma::detail::generate_encoded<CharEncoding, Tag>::
call(sink
- , traits::symbols_lookup<Attribute, Attr>::call(attr)
+ , traits::symbols_lookup<Attr, Attribute>::call(attr)
, unused) &&
karma::delimit_out(sink, d);
}
Modified: trunk/boost/spirit/home/lex/qi/plain_token.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/qi/plain_token.hpp (original)
+++ trunk/boost/spirit/home/lex/qi/plain_token.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -11,7 +11,7 @@
#endif
#include <boost/spirit/home/support/info.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
#include <boost/spirit/home/qi/skip_over.hpp>
#include <boost/spirit/home/qi/domain.hpp>
Modified: trunk/boost/spirit/home/lex/qi/state_switcher.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/qi/state_switcher.hpp (original)
+++ trunk/boost/spirit/home/lex/qi/state_switcher.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -11,7 +11,7 @@
#endif
#include <boost/spirit/home/support/info.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
#include <boost/spirit/home/support/string_traits.hpp>
#include <boost/spirit/home/qi/skip_over.hpp>
Modified: trunk/boost/spirit/home/qi/action/action.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/action/action.hpp (original)
+++ trunk/boost/spirit/home/qi/action/action.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -13,7 +13,7 @@
#include <boost/spirit/home/qi/meta_compiler.hpp>
#include <boost/spirit/home/qi/parser.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/argument.hpp>
#include <boost/spirit/home/support/context.hpp>
#include <boost/spirit/home/support/unused.hpp>
Modified: trunk/boost/spirit/home/qi/auxiliary/attr_cast.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/auxiliary/attr_cast.hpp (original)
+++ trunk/boost/spirit/home/qi/auxiliary/attr_cast.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -16,7 +16,7 @@
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/auxiliary/attr_cast.hpp>
namespace boost { namespace spirit
Modified: trunk/boost/spirit/home/qi/auxiliary/lazy.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/auxiliary/lazy.hpp (original)
+++ trunk/boost/spirit/home/qi/auxiliary/lazy.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -14,7 +14,7 @@
#include <boost/spirit/home/qi/domain.hpp>
#include <boost/spirit/home/qi/skip_over.hpp>
#include <boost/spirit/home/qi/meta_compiler.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/lazy.hpp>
Modified: trunk/boost/spirit/home/qi/binary/binary.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/binary/binary.hpp (original)
+++ trunk/boost/spirit/home/qi/binary/binary.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -14,7 +14,7 @@
#include <boost/spirit/home/support/common_terminals.hpp>
#include <boost/spirit/home/support/detail/endian.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/qi/parser.hpp>
#include <boost/spirit/home/qi/meta_compiler.hpp>
#include <boost/spirit/home/qi/domain.hpp>
Modified: trunk/boost/spirit/home/qi/detail/alternative_function.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/detail/alternative_function.hpp (original)
+++ trunk/boost/spirit/home/qi/detail/alternative_function.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -14,7 +14,7 @@
#include <boost/spirit/home/qi/domain.hpp>
#include <boost/spirit/home/qi/detail/assign_to.hpp>
#include <boost/spirit/home/support/unused.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/variant.hpp>
#include <boost/mpl/bool.hpp>
Modified: trunk/boost/spirit/home/qi/detail/assign_to.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/detail/assign_to.hpp (original)
+++ trunk/boost/spirit/home/qi/detail/assign_to.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -15,7 +15,7 @@
#include <boost/spirit/home/qi/detail/construct.hpp>
#include <boost/spirit/home/support/unused.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/container.hpp>
#include <boost/spirit/home/phoenix/core/actor.hpp>
#include <boost/ref.hpp>
Added: trunk/boost/spirit/home/qi/detail/attributes.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/spirit/home/qi/detail/attributes.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -0,0 +1,160 @@
+// Copyright (c) 2001-2010 Hartmut Kaiser
+// Copyright (c) 2001-2010 Joel de Guzman
+//
+// 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_QI_DETAIL_ATTRIBUTES_APR_18_2010_0458PM)
+#define SPIRIT_QI_DETAIL_ATTRIBUTES_APR_18_2010_0458PM
+
+#include <boost/spirit/home/qi/domain.hpp>
+#include <boost/spirit/home/support/attributes.hpp>
+
+///////////////////////////////////////////////////////////////////////////////
+namespace boost { namespace spirit { namespace qi
+{
+ template <typename Exposed, typename Transformed>
+ struct default_transform_attribute
+ {
+ typedef Transformed type;
+
+ static Transformed pre(Exposed& val) { return Transformed(); }
+
+ static void post(Exposed& val, Transformed const& attr)
+ {
+ traits::assign_to(attr, val);
+ }
+
+ // fail() will be called by Qi rule's if the rhs failed parsing
+ static void fail(Exposed&) {}
+ };
+
+ // handle case where no transformation is required as the types are the same
+ template <typename Attribute>
+ struct default_transform_attribute<Attribute, Attribute>
+ {
+ typedef Attribute& type;
+ static Attribute& pre(Attribute& val) { return val; }
+ static void post(Attribute&, Attribute const&) {}
+ static void fail(Attribute&) {}
+ };
+
+ template <typename Exposed, typename Transformed>
+ struct proxy_transform_attribute
+ {
+ typedef Transformed type;
+
+ static Transformed pre(Exposed& val) { return Transformed(val); }
+ static void post(Exposed& val, Transformed const& attr) { /* no-op */ }
+
+ // fail() will be called by Qi rule's if the rhs failed parsing
+ static void fail(Exposed&) {}
+ };
+
+ // handle case where no transformation is required as the types are the same
+ template <typename Attribute>
+ struct proxy_transform_attribute<Attribute, Attribute>
+ {
+ typedef Attribute& type;
+ static Attribute& pre(Attribute& val) { return val; }
+ static void post(Attribute&, Attribute const&) {}
+ static void fail(Attribute&) {}
+ };
+
+ // main specialization for Qi
+ template <typename Exposed, typename Transformed, typename Enable = void>
+ struct transform_attribute
+ : mpl::if_<
+ mpl::and_<
+ mpl::not_<is_const<Exposed> >
+ , mpl::not_<is_reference<Exposed> >
+ , traits::is_proxy<Transformed> >
+ , proxy_transform_attribute<Exposed, Transformed>
+ , default_transform_attribute<Exposed, Transformed>
+ >::type
+ {};
+
+ template <typename Exposed, typename Transformed>
+ struct transform_attribute<boost::optional<Exposed>, Transformed
+ , typename disable_if<is_same<boost::optional<Exposed>, Transformed> >::type>
+ {
+ typedef Transformed& type;
+ static Transformed& pre(boost::optional<Exposed>& val)
+ {
+ if (!val)
+ val = Transformed();
+ return boost::get<Transformed>(val);
+ }
+ static void post(boost::optional<Exposed>&, Transformed const&) {}
+ static void fail(boost::optional<Exposed>& val)
+ {
+ val = none_t(); // leave optional uninitialized if rhs failed
+ }
+ };
+
+ // reference types need special handling
+ template <typename Attribute>
+ struct transform_attribute<Attribute&, Attribute>
+ {
+ typedef Attribute& type;
+ static Attribute& pre(Attribute& val) { return val; }
+ static void post(Attribute&, Attribute const&) {}
+ static void fail(Attribute&) {}
+ };
+
+ // unused_type needs some special handling as well
+ template <>
+ struct transform_attribute<unused_type, unused_type>
+ {
+ typedef unused_type type;
+ static unused_type pre(unused_type) { return unused; }
+ static void post(unused_type, unused_type) {}
+ static void fail(unused_type) {}
+ };
+
+ template <>
+ struct transform_attribute<unused_type const, unused_type>
+ : transform_attribute<unused_type, unused_type>
+ {};
+
+ template <typename Attribute>
+ struct transform_attribute<unused_type, Attribute>
+ : transform_attribute<unused_type, unused_type>
+ {};
+
+ template <typename Attribute>
+ struct transform_attribute<unused_type const, Attribute>
+ : transform_attribute<unused_type, unused_type>
+ {};
+
+ template <typename Attribute>
+ struct transform_attribute<Attribute, unused_type>
+ : transform_attribute<unused_type, unused_type>
+ {};
+
+ template <typename Attribute>
+ struct transform_attribute<Attribute const, unused_type>
+ : transform_attribute<unused_type, unused_type>
+ {};
+}}}
+
+///////////////////////////////////////////////////////////////////////////////
+namespace boost { namespace spirit { namespace traits
+{
+ template <typename Exposed, typename Transformed>
+ struct transform_attribute<Exposed, Transformed, qi::domain>
+ : qi::transform_attribute<Exposed, Transformed>
+ {};
+
+ template <typename Exposed, typename Transformed>
+ struct transform_attribute<Exposed&, Transformed, qi::domain>
+ : transform_attribute<Exposed, Transformed, qi::domain>
+ {};
+
+ template <typename Attribute>
+ struct transform_attribute<Attribute&, Attribute, qi::domain>
+ : qi::transform_attribute<Attribute&, Attribute>
+ {};
+}}}
+
+#endif
Modified: trunk/boost/spirit/home/qi/detail/pass_container.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/detail/pass_container.hpp (original)
+++ trunk/boost/spirit/home/qi/detail/pass_container.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -12,7 +12,7 @@
#pragma once
#endif
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/container.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <boost/type_traits/is_convertible.hpp>
Modified: trunk/boost/spirit/home/qi/directive/lexeme.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/directive/lexeme.hpp (original)
+++ trunk/boost/spirit/home/qi/directive/lexeme.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -17,7 +17,7 @@
#include <boost/spirit/home/qi/detail/unused_skipper.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
namespace boost { namespace spirit
Modified: trunk/boost/spirit/home/qi/directive/repeat.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/directive/repeat.hpp (original)
+++ trunk/boost/spirit/home/qi/directive/repeat.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -17,7 +17,7 @@
#include <boost/spirit/home/qi/operator/kleene.hpp>
#include <boost/spirit/home/support/container.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/foreach.hpp>
Modified: trunk/boost/spirit/home/qi/directive/skip.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/directive/skip.hpp (original)
+++ trunk/boost/spirit/home/qi/directive/skip.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -20,7 +20,7 @@
#include <boost/spirit/home/qi/detail/unused_skipper.hpp>
#include <boost/spirit/home/support/container.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/fusion/include/vector.hpp>
Modified: trunk/boost/spirit/home/qi/nonterminal/rule.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/nonterminal/rule.hpp (original)
+++ trunk/boost/spirit/home/qi/nonterminal/rule.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -29,7 +29,7 @@
#include <boost/spirit/home/support/argument.hpp>
#include <boost/spirit/home/support/context.hpp>
#include <boost/spirit/home/support/info.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/nonterminal/extract_param.hpp>
#include <boost/spirit/home/support/nonterminal/locals.hpp>
#include <boost/spirit/home/qi/reference.hpp>
Modified: trunk/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp (original)
+++ trunk/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -15,7 +15,7 @@
#include <boost/detail/iterator.hpp>
#include <boost/spirit/home/support/unused.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/char_encoding/ascii.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#include <boost/utility/enable_if.hpp>
Modified: trunk/boost/spirit/home/qi/numeric/detail/real_impl.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/numeric/detail/real_impl.hpp (original)
+++ trunk/boost/spirit/home/qi/numeric/detail/real_impl.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -17,7 +17,7 @@
#include <limits>
#include <boost/type_traits/is_same.hpp>
#include <boost/spirit/home/support/unused.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/detail/pow10.hpp>
#include <boost/spirit/home/support/detail/sign.hpp>
#include <boost/assert.hpp>
Modified: trunk/boost/spirit/home/qi/operator/alternative.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/operator/alternative.hpp (original)
+++ trunk/boost/spirit/home/qi/operator/alternative.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -15,7 +15,7 @@
#include <boost/spirit/home/qi/detail/alternative_function.hpp>
#include <boost/spirit/home/qi/meta_compiler.hpp>
#include <boost/spirit/home/qi/parser.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/detail/what_function.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/info.hpp>
Modified: trunk/boost/spirit/home/qi/operator/and_predicate.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/operator/and_predicate.hpp (original)
+++ trunk/boost/spirit/home/qi/operator/and_predicate.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -14,7 +14,7 @@
#include <boost/spirit/home/qi/domain.hpp>
#include <boost/spirit/home/qi/meta_compiler.hpp>
#include <boost/spirit/home/qi/parser.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/fusion/include/at.hpp>
Modified: trunk/boost/spirit/home/qi/operator/difference.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/operator/difference.hpp (original)
+++ trunk/boost/spirit/home/qi/operator/difference.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -14,7 +14,7 @@
#include <boost/spirit/home/qi/domain.hpp>
#include <boost/spirit/home/qi/meta_compiler.hpp>
#include <boost/spirit/home/qi/parser.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/fusion/include/at.hpp>
Modified: trunk/boost/spirit/home/qi/operator/kleene.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/operator/kleene.hpp (original)
+++ trunk/boost/spirit/home/qi/operator/kleene.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -14,7 +14,7 @@
#include <boost/spirit/home/qi/meta_compiler.hpp>
#include <boost/spirit/home/qi/parser.hpp>
#include <boost/spirit/home/support/container.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
namespace boost { namespace spirit
@@ -96,6 +96,14 @@
: make_unary_composite<Elements, kleene>
{};
//]
+
+// ///////////////////////////////////////////////////////////////////////////
+// // Define what attributes are compatible with a kleene
+// template <typename Attribute, typename Subject, typename Context, typename Iterator>
+// struct is_attribute_compatible<Attribute, kleene<Subject>, Context, Iterator>
+// : traits::is_container_compatible<qi::domain, Attribute
+// , kleene<Subject>, Context, Iterator>
+// {};
}}}
namespace boost { namespace spirit { namespace traits
Modified: trunk/boost/spirit/home/qi/operator/list.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/operator/list.hpp (original)
+++ trunk/boost/spirit/home/qi/operator/list.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -14,7 +14,7 @@
#include <boost/spirit/home/qi/meta_compiler.hpp>
#include <boost/spirit/home/qi/parser.hpp>
#include <boost/spirit/home/support/container.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <vector>
Modified: trunk/boost/spirit/home/qi/operator/not_predicate.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/operator/not_predicate.hpp (original)
+++ trunk/boost/spirit/home/qi/operator/not_predicate.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -14,7 +14,7 @@
#include <boost/spirit/home/qi/domain.hpp>
#include <boost/spirit/home/qi/meta_compiler.hpp>
#include <boost/spirit/home/qi/parser.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
namespace boost { namespace spirit
Modified: trunk/boost/spirit/home/qi/operator/optional.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/operator/optional.hpp (original)
+++ trunk/boost/spirit/home/qi/operator/optional.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -12,7 +12,7 @@
#endif
#include <boost/spirit/home/support/unused.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/qi/parser.hpp>
#include <boost/spirit/home/qi/meta_compiler.hpp>
Modified: trunk/boost/spirit/home/qi/operator/permutation.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/operator/permutation.hpp (original)
+++ trunk/boost/spirit/home/qi/operator/permutation.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -13,7 +13,7 @@
#include <boost/spirit/home/qi/meta_compiler.hpp>
#include <boost/spirit/home/qi/detail/permute_function.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/algorithm/any_if_ns.hpp>
#include <boost/spirit/home/support/detail/what_function.hpp>
#include <boost/spirit/home/support/info.hpp>
Modified: trunk/boost/spirit/home/qi/operator/plus.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/operator/plus.hpp (original)
+++ trunk/boost/spirit/home/qi/operator/plus.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -14,7 +14,7 @@
#include <boost/spirit/home/qi/meta_compiler.hpp>
#include <boost/spirit/home/qi/parser.hpp>
#include <boost/spirit/home/support/container.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
namespace boost { namespace spirit
Modified: trunk/boost/spirit/home/qi/operator/sequence.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/operator/sequence.hpp (original)
+++ trunk/boost/spirit/home/qi/operator/sequence.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -61,6 +61,20 @@
struct make_composite<proto::tag::shift_right, Elements, Modifiers>
: make_nary_composite<Elements, sequence>
{};
+
+// ///////////////////////////////////////////////////////////////////////////
+// // Define what attributes are compatible with a sequence
+// template <typename Attribute, typename Elements, typename Context, typename Iterator>
+// struct is_attribute_compatible<Attribute, sequence<Elements>, Context, Iterator>
+// : mpl::or_<
+// is_convertible<Attribute
+// , typename traits::attribute_of<sequence<Elements>, Context, Iterator>::type>
+// , traits::is_fusion_sequence_compatible<qi::domain, Attribute
+// , sequence<Elements>, Context, Iterator>
+// , traits::is_container_compatible<qi::domain, Attribute
+// , sequence<Elements>, Context, Iterator>
+// >
+// {};
}}}
namespace boost { namespace spirit { namespace traits
Modified: trunk/boost/spirit/home/qi/operator/sequence_base.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/operator/sequence_base.hpp (original)
+++ trunk/boost/spirit/home/qi/operator/sequence_base.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -13,7 +13,7 @@
#include <boost/spirit/home/qi/domain.hpp>
#include <boost/spirit/home/qi/detail/pass_container.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/algorithm/any_if.hpp>
#include <boost/spirit/home/support/detail/what_function.hpp>
#include <boost/spirit/home/support/unused.hpp>
Modified: trunk/boost/spirit/home/qi/operator/sequential_or.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/operator/sequential_or.hpp (original)
+++ trunk/boost/spirit/home/qi/operator/sequential_or.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -13,7 +13,7 @@
#include <boost/spirit/home/qi/meta_compiler.hpp>
#include <boost/spirit/home/qi/detail/pass_function.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/detail/what_function.hpp>
#include <boost/spirit/home/support/algorithm/any_if_ns.hpp>
#include <boost/fusion/include/as_vector.hpp>
Modified: trunk/boost/spirit/home/support/attributes.hpp
==============================================================================
--- trunk/boost/spirit/home/support/attributes.hpp (original)
+++ trunk/boost/spirit/home/support/attributes.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -121,7 +121,7 @@
{};
}
- template <typename Expected, typename Attribute
+ template <typename Attribute, typename Expected
, typename IsNotVariant = mpl::false_, typename Enable = void>
struct compute_compatible_component_variant
: mpl::or_<
@@ -138,8 +138,8 @@
BOOST_MPL_HAS_XXX_TRAIT_DEF(types)
}
- template <typename Expected, typename Variant>
- struct compute_compatible_component_variant<Expected, Variant, mpl::false_
+ template <typename Variant, typename Expected>
+ struct compute_compatible_component_variant<Variant, Expected, mpl::false_
, typename enable_if<detail::has_types<Variant> >::type>
{
typedef typename traits::variant_type<Variant>::type variant_type;
@@ -162,11 +162,17 @@
typedef typename
mpl::eval_if<type, mpl::deref<iter>, mpl::identity<unused_type> >::type
compatible_type;
+
+ // return whether the given type is compatible with the Expected type
+ static bool is_compatible(int which)
+ {
+ return which == distance::value;
+ }
};
template <typename Expected, typename Attribute, typename Domain>
struct compute_compatible_component
- : compute_compatible_component_variant<Expected, Attribute
+ : compute_compatible_component_variant<Attribute, Expected
, typename spirit::traits::not_is_variant<Attribute, Domain>::type> {};
template <typename Expected, typename Domain>
@@ -508,221 +514,16 @@
};
///////////////////////////////////////////////////////////////////////////
- // transform_attribute
+ // transform_attribute
//
- // Sometimes the user needs to transform the attribute types for certain
- // attributes. This template can be used as a customization point, where
- // the user is able specify specific transformation rules for any attribute
- // type.
- ///////////////////////////////////////////////////////////////////////////
- template <typename Exposed, typename Transformed>
- struct default_transform_attribute
- {
- typedef Transformed type;
-
- static Transformed pre(Exposed& val) { return Transformed(); }
-
- static void post(Exposed& val, Transformed const& attr)
- {
- assign_to(attr, val);
- }
-
- // fail() will be called by Qi rule's if the rhs failed parsing
- static void fail(Exposed&) {}
- };
-
- // handle case where no transformation is required as the types are the same
- template <typename Attribute>
- struct default_transform_attribute<Attribute, Attribute>
- {
- typedef Attribute& type;
- static Attribute& pre(Attribute& val) { return val; }
- static void post(Attribute&, Attribute const&) {}
- static void fail(Attribute&) {}
- };
-
- template <typename Exposed, typename Transformed>
- struct proxy_transform_attribute
- {
- typedef Transformed type;
-
- static Transformed pre(Exposed& val) { return Transformed(val); }
- static void post(Exposed& val, Transformed const& attr) { /* no-op */ }
-
- // fail() will be called by Qi rule's if the rhs failed parsing
- static void fail(Exposed&) {}
- };
-
- // handle case where no transformation is required as the types are the same
- template <typename Attribute>
- struct proxy_transform_attribute<Attribute, Attribute>
- {
- typedef Attribute& type;
- static Attribute& pre(Attribute& val) { return val; }
- static void post(Attribute&, Attribute const&) {}
- static void fail(Attribute&) {}
- };
-
- // main specialization for Qi
- template <typename Exposed, typename Transformed>
- struct transform_attribute<Exposed, Transformed, qi::domain>
- : mpl::if_<
- mpl::and_<
- mpl::not_<is_const<Exposed> >
- , mpl::not_<is_reference<Exposed> >
- , is_proxy<Transformed> >
- , proxy_transform_attribute<Exposed, Transformed>
- , default_transform_attribute<Exposed, Transformed>
- >::type
- {};
-
- template <typename Exposed, typename Transformed>
- struct transform_attribute<optional<Exposed>, Transformed, qi::domain
- , typename disable_if<is_same<optional<Exposed>, Transformed> >::type>
- {
- typedef Transformed& type;
- static Transformed& pre(optional<Exposed>& val)
- {
- if (!val)
- val = Transformed();
- return boost::get<Transformed>(val);
- }
- static void post(optional<Exposed>&, Transformed const&) {}
- static void fail(optional<Exposed>& val)
- {
- val = none_t(); // leave optional uninitialized if rhs failed
- }
- };
-
- // reference types need special handling
- template <typename Exposed, typename Transformed>
- struct transform_attribute<Exposed&, Transformed, qi::domain>
- : transform_attribute<Exposed, Transformed, qi::domain>
- {};
-
- template <typename Attribute>
- struct transform_attribute<Attribute&, Attribute, qi::domain>
- {
- typedef Attribute& type;
- static Attribute& pre(Attribute& val) { return val; }
- static void post(Attribute&, Attribute const&) {}
- static void fail(Attribute&) {}
- };
-
- // unused_type needs some special handling as well
- template <>
- struct transform_attribute<unused_type, unused_type, qi::domain>
- {
- typedef unused_type type;
- static unused_type pre(unused_type) { return unused; }
- static void post(unused_type, unused_type) {}
- static void fail(unused_type) {}
- };
-
- template <>
- struct transform_attribute<unused_type const, unused_type, qi::domain>
- : transform_attribute<unused_type, unused_type, qi::domain>
- {};
-
- template <typename Attribute>
- struct transform_attribute<unused_type, Attribute, qi::domain>
- : transform_attribute<unused_type, unused_type, qi::domain>
- {};
-
- template <typename Attribute>
- struct transform_attribute<unused_type const, Attribute, qi::domain>
- : transform_attribute<unused_type, unused_type, qi::domain>
- {};
-
- template <typename Attribute>
- struct transform_attribute<Attribute, unused_type, qi::domain>
- : transform_attribute<unused_type, unused_type, qi::domain>
- {};
-
- template <typename Attribute>
- struct transform_attribute<Attribute const, unused_type, qi::domain>
- : transform_attribute<unused_type, unused_type, qi::domain>
- {};
-
- ///////////////////////////////////////////////////////////////////////////
- template <typename Exposed, typename Transformed>
- struct transform_attribute<Exposed, Transformed, karma::domain>
- {
- typedef Transformed type;
- static Transformed pre(Exposed& val)
- {
- return Transformed(extract_from<Exposed>(val, unused));
- }
- // Karma only, no post() and no fail() required
- };
-
- template <typename Exposed, typename Transformed>
- struct transform_attribute<Exposed const, Transformed, karma::domain>
- {
- typedef Transformed type;
- static Transformed pre(Exposed const& val)
- {
- return Transformed(extract_from<Exposed>(val, unused));
- }
- // Karma only, no post() and no fail() required
- };
-
- template <typename Attribute>
- struct transform_attribute<Attribute const, Attribute, karma::domain>
- {
- typedef Attribute const& type;
- static Attribute const& pre(Attribute const& val) { return val; }
- // Karma only, no post() and no fail() required
- };
-
- // reference types need special handling
- template <typename Exposed, typename Transformed>
- struct transform_attribute<Exposed&, Transformed, karma::domain>
- : transform_attribute<Exposed, Transformed, karma::domain>
- {};
-
- template <typename Exposed, typename Transformed>
- struct transform_attribute<Exposed const&, Transformed, karma::domain>
- : transform_attribute<Exposed const, Transformed, karma::domain>
- {};
-
- template <typename Attribute>
- struct transform_attribute<Attribute const&, Attribute, karma::domain>
- : transform_attribute<Attribute const, Attribute, karma::domain>
- {};
-
- // unused_type needs some special handling as well
- template <>
- struct transform_attribute<unused_type, unused_type, karma::domain>
- {
- typedef unused_type type;
- static unused_type pre(unused_type) { return unused; }
- };
-
- template <>
- struct transform_attribute<unused_type const, unused_type, karma::domain>
- : transform_attribute<unused_type, unused_type, karma::domain>
- {};
-
- template <typename Attribute>
- struct transform_attribute<unused_type, Attribute, karma::domain>
- : transform_attribute<unused_type, unused_type, karma::domain>
- {};
-
- template <typename Attribute>
- struct transform_attribute<unused_type const, Attribute, karma::domain>
- : transform_attribute<unused_type, unused_type, karma::domain>
- {};
-
- template <typename Attribute>
- struct transform_attribute<Attribute, unused_type, karma::domain>
- : transform_attribute<unused_type, unused_type, karma::domain>
- {};
-
- template <typename Attribute>
- struct transform_attribute<Attribute const, unused_type, karma::domain>
- : transform_attribute<unused_type, unused_type, karma::domain>
- {};
+ // Sometimes the user needs to transform the attribute types for certain
+ // attributes. This template can be used as a customization point, where
+ // the user is able specify specific transformation rules for any attribute
+ // type.
+ ///////////////////////////////////////////////////////////////////////////
+ template <typename Exposed, typename Transformed, typename Domain
+ , typename Enable/* = void*/>
+ struct transform_attribute;
///////////////////////////////////////////////////////////////////////////
template <typename Domain, typename Transformed, typename Exposed>
Modified: trunk/boost/spirit/repository/home/karma/directive/confix.hpp
==============================================================================
--- trunk/boost/spirit/repository/home/karma/directive/confix.hpp (original)
+++ trunk/boost/spirit/repository/home/karma/directive/confix.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -13,7 +13,7 @@
#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/detail/attributes.hpp>
#include <boost/spirit/home/karma/domain.hpp>
#include <boost/spirit/home/karma/meta_compiler.hpp>
Modified: trunk/boost/spirit/repository/home/karma/nonterminal/subrule.hpp
==============================================================================
--- trunk/boost/spirit/repository/home/karma/nonterminal/subrule.hpp (original)
+++ trunk/boost/spirit/repository/home/karma/nonterminal/subrule.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -20,7 +20,7 @@
#include <boost/spirit/home/karma/nonterminal/detail/parameterized.hpp>
#include <boost/spirit/home/support/argument.hpp>
#include <boost/spirit/home/support/assert_msg.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/nonterminal/extract_param.hpp>
Modified: trunk/boost/spirit/repository/home/qi/directive/confix.hpp
==============================================================================
--- trunk/boost/spirit/repository/home/qi/directive/confix.hpp (original)
+++ trunk/boost/spirit/repository/home/qi/directive/confix.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -16,7 +16,7 @@
#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/qi/detail/attributes.hpp>
#include <boost/spirit/repository/home/support/confix.hpp>
Modified: trunk/boost/spirit/repository/home/qi/directive/distinct.hpp
==============================================================================
--- trunk/boost/spirit/repository/home/qi/directive/distinct.hpp (original)
+++ trunk/boost/spirit/repository/home/qi/directive/distinct.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -21,7 +21,7 @@
#include <boost/spirit/home/support/make_component.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/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/string_traits.hpp>
#include <boost/spirit/home/qi/auxiliary/eps.hpp>
#include <boost/spirit/home/qi/auxiliary/lazy.hpp>
Modified: trunk/boost/spirit/repository/home/qi/nonterminal/subrule.hpp
==============================================================================
--- trunk/boost/spirit/repository/home/qi/nonterminal/subrule.hpp (original)
+++ trunk/boost/spirit/repository/home/qi/nonterminal/subrule.hpp 2010-04-18 21:56:14 EDT (Sun, 18 Apr 2010)
@@ -20,7 +20,7 @@
#include <boost/spirit/home/qi/nonterminal/detail/parser_binder.hpp>
#include <boost/spirit/home/support/argument.hpp>
#include <boost/spirit/home/support/assert_msg.hpp>
-#include <boost/spirit/home/support/attributes.hpp>
+#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/info.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/nonterminal/extract_param.hpp>
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