Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69214 - in sandbox/SOC/2010/phoenix3: boost/phoenix/core boost/phoenix/core/detail libs/phoenix/doc libs/phoenix/doc/examples libs/phoenix/doc/html libs/phoenix/doc/html/phoenix libs/phoenix/doc/html/phoenix/examples libs/phoenix/doc/html/phoenix/inside libs/phoenix/doc/html/phoenix/inside/expression libs/phoenix/doc/html/phoenix/modules libs/phoenix/doc/html/phoenix/modules/core libs/phoenix/doc/html/phoenix/modules/stl libs/phoenix/doc/html/phoenix/starter_kit libs/phoenix/example
From: thom.heller_at_[hidden]
Date: 2011-02-23 14:24:40


Author: theller
Date: 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
New Revision: 69214
URL: http://svn.boost.org/trac/boost/changeset/69214

Log:
added transformation example
Added:
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/examples/transforming.qbk (contents, props changed)
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/examples/transforming_the_expression_tree.html (contents, props changed)
   sandbox/SOC/2010/phoenix3/libs/phoenix/example/invert.cpp (contents, props changed)
Text files modified:
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/expression.hpp | 14 ++++++++++++--
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/expression.hpp | 1 +
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/is_actor.hpp | 10 ++++++++++
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/examples.qbk | 1 +
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/index.html | 16 +++++++++-------
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix-doc_HTML.manifest | 1 +
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/basics.html | 10 +++++-----
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/examples.html | 2 ++
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/examples/adding_an_expression.html | 6 +++---
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/examples/extending_actors.html | 8 ++++----
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/actions.html | 8 ++++----
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/actor.html | 18 +++++++++---------
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/expression.html | 4 ++--
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/expression/boost_phoenix_define_expression.html | 10 +++++-----
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/expression/boost_phoenix_define_expression_ext.html | 10 +++++-----
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/expression/boost_phoenix_define_expression_ext_vararg.html | 10 +++++-----
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/expression/boost_phoenix_define_expression_vararg.html | 10 +++++-----
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/core/arguments.html | 8 ++++----
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/core/references.html | 4 ++--
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/core/values.html | 2 +-
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/operator.html | 12 ++++++------
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/stl/algorithm.html | 6 +++---
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/stl/container.html | 4 ++--
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/organization.html | 6 +++---
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/starter_kit.html | 2 +-
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/starter_kit/lazy_functions.html | 4 ++--
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/starter_kit/lazy_operators.html | 2 +-
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/starter_kit/values.html | 4 ++--
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/wrap_up.html | 6 +++---
   sandbox/SOC/2010/phoenix3/libs/phoenix/doc/phoenix3.qbk | 3 ++-
   30 files changed, 115 insertions(+), 87 deletions(-)

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/expression.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/expression.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/expression.hpp 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -21,6 +21,7 @@
 #include <boost/preprocessor/tuple/elem.hpp>
 #include <boost/preprocessor/enum_params.hpp>
 #include <boost/preprocessor/repeat_from_to.hpp>
+#include <iostream>
 
 #define BOOST_PHOENIX_DEFINE_EXPRESSION(NAME_SEQ, SEQ) \
     BOOST_PHOENIX_DEFINE_EXPRESSION_BASE( \
@@ -83,6 +84,15 @@
     namespace tag \
     { \
         struct BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) {}; \
+ std::ostream &operator<<( \
+ std::ostream & os \
+ , BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))) \
+ { \
+ os << BOOST_PP_STRINGIZE( \
+ BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) \
+ ); \
+ return os; \
+ } \
     } \
     namespace expression \
     { \
@@ -123,7 +133,7 @@
 #define BOOST_PHOENIX_DEFINE_EXPRESSION_EXPRESSION_DEFAULT(NAME_SEQ, GRAMMAR_SEQ, D) \
         template <BOOST_PHOENIX_typename_A(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ))> \
         struct BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) \
- : expr< \
+ : boost::phoenix::expr< \
                 tag:: BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) \
               , BOOST_PP_ENUM_PARAMS(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ), A)> \
         {}; \
@@ -150,7 +160,7 @@
             BOOST_PP_ADD(N, BOOST_PP_SEQ_SIZE(BOOST_PP_TUPLE_ELEM(2, 1, NAME))) \
         ) \
> \
- : expr< \
+ : boost::phoenix::expr< \
             tag:: BOOST_PP_TUPLE_ELEM(2, 0, NAME) \
           , BOOST_PHOENIX_A( \
                 BOOST_PP_ADD( \

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/expression.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/expression.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/expression.hpp 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -25,6 +25,7 @@
 #include <boost/phoenix/core/limits.hpp>
 #include <boost/fusion/sequence/intrinsic/at.hpp>
 #include <boost/phoenix/core/detail/expression.hpp>
+#include <boost/phoenix/core/domain.hpp>
 #include <boost/phoenix/support/iterate.hpp>
 #include <boost/preprocessor/comparison/equal.hpp>
 #include <boost/proto/domain.hpp>

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/is_actor.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/is_actor.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/is_actor.hpp 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -27,6 +27,16 @@
         : mpl::false_
     {};
 
+ template <typename T>
+ struct is_actor<T const &>
+ : is_actor<T>
+ {};
+
+ template <typename T>
+ struct is_actor<T &>
+ : is_actor<T>
+ {};
+
     template <typename Expr>
     struct is_actor<actor<Expr> >
         : mpl::true_

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/examples.qbk
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/examples.qbk (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/examples.qbk 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -11,5 +11,6 @@
 
 [include examples/extending_actors.qbk]
 [include examples/adding.qbk]
+[include examples/transforming.qbk]
 
 [endsect]

Added: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/examples/transforming.qbk
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/examples/transforming.qbk 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -0,0 +1,142 @@
+[/==============================================================================
+ Copyright (C) 2001-2010 Joel de Guzman
+ Copyright (C) 2001-2005 Dan Marsden
+ Copyright (C) 2001-2010 Thomas Heller
+
+ 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)
+===============================================================================/]
+
+[section Transforming the Expression Tree]
+
+This example will show how to write __phoenix_actions__ that transform the
+Phoenix AST.
+
+[:
+"/Lisp macros transform the program structure itself, with the full language
+available to express such transformations./"
+
+[@http://en.wikipedia.org/wiki/Lisp_macro#Lisp_macros Wikipedia]
+]
+
+What we want to do is to invert some arithmetic operators, i.e. plus will be
+transformed to minus, minus to plus, multiplication to division and division to
+multiplication.
+
+Let's start with defining our default action:
+
+ struct invert_actions
+ {
+ template <typename Rule>
+ struct when
+ : proto::_ // the default is proto::_
+ {};
+ };
+
+By default, we don't want to do anything, well, not exactly nothing, but just
+return the expression. This is done by
+[@http://www.boost.org/doc/libs/release/doc/html/boost/proto/_.html proto::_]
+which, used as a transform, just passes the current expression along. Making this
+action an identity transform.
+
+[def __proto_make_expr__ [@http://www.boost.org/doc/libs/release/doc/html/boost/proto/functional/make_expr.html `proto::functional::make_expr`]]
+
+So, after the basics are set up, we can start by writing the transformations we
+want to have on our tree:
+
+ // Transform plus to minus
+ template <>
+ struct invert_actions::when<phoenix::rule::plus>
+ : __proto_call__<
+ __proto_make_expr__<proto::tag::minus>(
+ phoenix::evaluator(proto::_left, phoenix::_context)
+ , phoenix::evaluator(proto::_right, phoenix::_context)
+ )
+ >
+ {};
+
+Wow, this looks complicated! Granted you need to know a little bit about __proto__
+(For a good introduction read through the
+ [@http://cpp-next.com/archive/2010/08/expressive-c-introduction/ Expressive C++] series).
+
+What is done is the following:
+
+* The left expression is passed to evaluator (with the current context, that contains our invert_actions)
+* The right expression is passed to evaluator (with the current context, that contains our invert_actions)
+* The result of these two __proto_transforms__ is passed to __proto_make_expr__ which returns the freshly created expression
+
+After you know what is going on, maybe the rest doesn't look so scary anymore:
+
+ // Transform minus to plus
+ template <>
+ struct invert_actions::when<phoenix::rule::minus>
+ : __proto_call__<
+ __proto_make_expr__<proto::tag::plus>(
+ phoenix::evaluator(proto::_left, phoenix::_context)
+ , phoenix::evaluator(proto::_right, phoenix::_context)
+ )
+ >
+ {};
+
+ // Transform multiplies to divides
+ template <>
+ struct invert_actions::when<phoenix::rule::multiplies>
+ : __proto_call__<
+ __proto_make_expr__<proto::tag::divides>(
+ phoenix::evaluator(proto::_left, phoenix::_context)
+ , phoenix::evaluator(proto::_right, phoenix::_context)
+ )
+ >
+ {};
+
+ // Transform divides to multiplies
+ template <>
+ struct invert_actions::when<phoenix::rule::divides>
+ : __proto_call__<
+ __proto_make_expr__<proto::tag::multiplies>(
+ phoenix::evaluator(proto::_left, phoenix::_context)
+ , phoenix::evaluator(proto::_right, phoenix::_context)
+ )
+ >
+ {};
+
+That's it! Now that we have our actions defined, we want to evaluate some of our expressions with them:
+
+ template <typename Expr>
+ // Calculate the result type: our transformed AST
+ typename boost::result_of<
+ phoenix::evaluator(
+ Expr const&
+ , phoenix::result_of::context<int, invert_actions>::type
+ )
+ >::type
+ invert(Expr const & expr)
+ {
+ return
+ // Evaluate it with our actions
+ phoenix::eval(
+ expr
+ , phoenix::context(
+ int()
+ , invert_actions()
+ )
+ );
+ }
+
+Run some tests to see if it is working:
+
+ invert(_1); // --> _1
+ invert(_1 + _2); // --> _1 - _2
+ invert(_1 + _2 - _3); // --> _1 - _2 + _3
+ invert(_1 * _2); // --> _1 / _2
+ invert(_1 * _2 / _3); // --> _1 / _2 * _3
+ invert(_1 * _2 + _3); // --> _1 / _2 - _3
+ invert(_1 * _2 - _3); // --> _1 / _2 + _2
+ invert(if_(_1 * _4)[_2 - _3]); // --> if_(_1 / _4)[_2 - _3]
+ _1 * invert(_2 - _3)); // --> _1 * _2 - _3
+
+__note__ The complete example can be found here: [@../../example/invert.cpp example/invert.cpp]
+
+/Pretty simple .../
+
+[endsect]

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/index.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/index.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/index.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -26,7 +26,7 @@
 </h3></div></div>
 <div><p class="copyright">Copyright &#169; 2002-2005, 2010 Joel de Guzman, Dan Marsden, Thomas Heller</p></div>
 <div><div class="legalnotice">
-<a name="id640059"></a><p>
+<a name="id689826"></a><p>
         Distributed under the Boost Software License, Version 1.0. (See accompanying
         file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
       </p>
@@ -124,6 +124,8 @@
 <dd><dl>
 <dt><span class="section">Extending Actors</span></dt>
 <dt><span class="section">Adding an expression</span></dt>
+<dt><span class="section"><a href="phoenix/examples/transforming_the_expression_tree.html">Transforming
+ the Expression Tree</a></span></dt>
 </dl></dd>
 <dt><span class="section">Wrap Up</span></dt>
 <dt><span class="section">Acknowledgments</span></dt>
@@ -131,7 +133,7 @@
 </dl>
 </div>
 <a name="phoenix.preface"></a><h2>
-<a name="id670756"></a>
+<a name="id720522"></a>
     <a class="link" href="index.html#phoenix.preface">Preface</a>
   </h2>
 <div class="blockquote"><blockquote class="blockquote"><p>
@@ -150,7 +152,7 @@
     <span class="inlinemediaobject"><img src="images/lambda_cpp.png" alt="lambda_cpp"></span>
   </p>
 <a name="phoenix.description"></a><h3>
-<a name="id638863"></a>
+<a name="id688629"></a>
     <a class="link" href="index.html#phoenix.description">Description</a>
   </h3>
 <p>
@@ -168,7 +170,7 @@
     library is organized in highly independent modules and layers.
   </p>
 <a name="phoenix.how_to_use_this_manual"></a><h3>
-<a name="id638910"></a>
+<a name="id688676"></a>
     <a class="link" href="index.html#phoenix.how_to_use_this_manual">How to use this manual</a>
   </h3>
 <p>
@@ -190,7 +192,7 @@
     icons precede some text to indicate:
   </p>
 <div class="table">
-<a name="id638944"></a><p class="title"><b>Table&#160;1.1.&#160;Icons</b></p>
+<a name="id688711"></a><p class="title"><b>Table&#160;1.1.&#160;Icons</b></p>
 <div class="table-contents"><table class="table" summary="Icons">
 <colgroup>
 <col>
@@ -279,12 +281,12 @@
   </p>
 </div>
 <a name="phoenix._emphasis_role__bold___emphasis____to_joel_s_dear_daughter__phoenix__emphasis___emphasis_"></a><h3>
-<a name="id679713"></a>
+<a name="id729479"></a>
     <a class="link" href="index.html#phoenix._emphasis_role__bold___emphasis____to_joel_s_dear_daughter__phoenix__emphasis___emphasis_"><span class="bold"><strong><span class="emphasis"><em>...To Joel's dear daughter, Phoenix</em></span></strong></span></a>
   </h3>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: February 22, 2011 at 14:03:26 GMT</small></p></td>
+<td align="left"><p><small>Last revised: February 23, 2011 at 19:22:42 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix-doc_HTML.manifest
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix-doc_HTML.manifest (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix-doc_HTML.manifest 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -60,6 +60,7 @@
 phoenix/examples.html
 phoenix/examples/extending_actors.html
 phoenix/examples/adding_an_expression.html
+phoenix/examples/transforming_the_expression_tree.html
 phoenix/wrap_up.html
 phoenix/acknowledgments.html
 phoenix/references.html

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/basics.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/basics.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/basics.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -42,7 +42,7 @@
       </p></td></tr>
 </table></div>
 <a name="phoenix.basics.partial_function_application"></a><h4>
-<a name="id683099"></a>
+<a name="id732865"></a>
       <a class="link" href="basics.html#phoenix.basics.partial_function_application">Partial Function
       Application</a>
     </h4>
@@ -94,7 +94,7 @@
       black boxes anymore.
     </p>
 <a name="phoenix.basics.stl_and_higher_order_functions"></a><h4>
-<a name="id683314"></a>
+<a name="id733081"></a>
       <a class="link" href="basics.html#phoenix.basics.stl_and_higher_order_functions">STL and higher
       order functions</a>
     </h4>
@@ -126,7 +126,7 @@
       </p></td></tr>
 </table></div>
 <a name="phoenix.basics.lazy_evaluation"></a><h4>
-<a name="id683525"></a>
+<a name="id733292"></a>
       <a class="link" href="basics.html#phoenix.basics.lazy_evaluation">Lazy Evaluation</a>
     </h4>
 <p>
@@ -181,7 +181,7 @@
 </span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="special">(</span><span class="identifier">arg1</span> <span class="special">%</span> <span class="number">2</span> <span class="special">==</span> <span class="number">1</span><span class="special">)(</span><span class="identifier">y</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="comment">// prints 0 or false
 </span></pre>
 <a name="phoenix.basics.forwarding_function_problem"></a><h4>
-<a name="id684068"></a>
+<a name="id733834"></a>
       <a class="link" href="basics.html#phoenix.basics.forwarding_function_problem">Forwarding Function
       Problem</a>
     </h4>
@@ -222,7 +222,7 @@
       </p></td></tr>
 </table></div>
 <a name="phoenix.basics.polymorphic_functions"></a><h4>
-<a name="id684206"></a>
+<a name="id733972"></a>
       <a class="link" href="basics.html#phoenix.basics.polymorphic_functions">Polymorphic Functions</a>
     </h4>
 <p>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/examples.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/examples.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/examples.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -22,6 +22,8 @@
 <div class="toc"><dl>
 <dt><span class="section">Extending Actors</span></dt>
 <dt><span class="section">Adding an expression</span></dt>
+<dt><span class="section"><a href="examples/transforming_the_expression_tree.html">Transforming
+ the Expression Tree</a></span></dt>
 </dl></div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/examples/adding_an_expression.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/examples/adding_an_expression.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/examples/adding_an_expression.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -7,13 +7,13 @@
 <link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Phoenix 3.0">
 <link rel="up" href="../examples.html" title="Advanced Examples">
 <link rel="prev" href="extending_actors.html" title="Extending Actors">
-<link rel="next" href="../wrap_up.html" title="Wrap Up">
+<link rel="next" href="transforming_the_expression_tree.html" title="Transforming the Expression Tree">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="extending_actors.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../wrap_up.html"><img src="../../images/next.png" alt="Next"></a>
+<a accesskey="p" href="extending_actors.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="transforming_the_expression_tree.html"><img src="../../images/next.png" alt="Next"></a>
 </div>
 <div class="section">
 <div class="titlepage"><div><div><h3 class="title">
@@ -146,7 +146,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="extending_actors.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../wrap_up.html"><img src="../../images/next.png" alt="Next"></a>
+<a accesskey="p" href="extending_actors.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="transforming_the_expression_tree.html"><img src="../../images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/examples/extending_actors.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/examples/extending_actors.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/examples/extending_actors.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -39,7 +39,7 @@
         on how to implement a custom actor which is usable as if it were a STL Container.
       </p>
 <a name="phoenix.examples.extending_actors.requirements"></a><h5>
-<a name="id733042"></a>
+<a name="id782825"></a>
         <a class="link" href="extending_actors.html#phoenix.examples.extending_actors.requirements">Requirements</a>
       </h5>
 <p>
@@ -141,7 +141,7 @@
         Additionally, we want all the operator() overloads of the regular actor.
       </p>
 <a name="phoenix.examples.extending_actors.defining_the_actor"></a><h5>
-<a name="id733355"></a>
+<a name="id783138"></a>
         <a class="link" href="extending_actors.html#phoenix.examples.extending_actors.defining_the_actor">Defining
         the actor</a>
       </h5>
@@ -174,7 +174,7 @@
 <span class="special">};</span>
 </pre>
 <a name="phoenix.examples.extending_actors.using_the_actor"></a><h5>
-<a name="id734240"></a>
+<a name="id784023"></a>
         <a class="link" href="extending_actors.html#phoenix.examples.extending_actors.using_the_actor">Using the
         actor</a>
       </h5>
@@ -231,7 +231,7 @@
         Wow, that was easy!
       </p>
 <a name="phoenix.examples.extending_actors.adding_life_to_the_actor"></a><h5>
-<a name="id734907"></a>
+<a name="id784690"></a>
         <a class="link" href="extending_actors.html#phoenix.examples.extending_actors.adding_life_to_the_actor">Adding
         life to the actor</a>
       </h5>

Added: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/examples/transforming_the_expression_tree.html
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/examples/transforming_the_expression_tree.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -0,0 +1,191 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Transforming the Expression Tree</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Phoenix 3.0">
+<link rel="up" href="../examples.html" title="Advanced Examples">
+<link rel="prev" href="adding_an_expression.html" title="Adding an expression">
+<link rel="next" href="../wrap_up.html" title="Wrap Up">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="adding_an_expression.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../wrap_up.html"><img src="../../images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="phoenix.examples.transforming_the_expression_tree"></a><a class="link" href="transforming_the_expression_tree.html" title="Transforming the Expression Tree">Transforming
+ the Expression Tree</a>
+</h3></div></div></div>
+<p>
+ This example will show how to write <a class="link" href="../inside/actions.html" title="More on Actions">Actions</a>
+ that transform the Phoenix AST.
+ </p>
+<div class="blockquote"><blockquote class="blockquote">
+<p>
+ "<span class="emphasis"><em>Lisp macros transform the program structure itself, with
+ the full language available to express such transformations.</em></span>"
+ </p>
+<p>
+ Wikipedia
+ </p>
+</blockquote></div>
+<p>
+ What we want to do is to invert some arithmetic operators, i.e. plus will
+ be transformed to minus, minus to plus, multiplication to division and division
+ to multiplication.
+ </p>
+<p>
+ Let's start with defining our default action:
+ </p>
+<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">invert_actions</span>
+<span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Rule</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">when</span>
+ <span class="special">:</span> <span class="identifier">proto</span><span class="special">::</span><span class="identifier">_</span> <span class="comment">// the default is proto::_
+</span> <span class="special">{};</span>
+<span class="special">};</span>
+</pre>
+<p>
+ By default, we don't want to do anything, well, not exactly nothing, but
+ just return the expression. This is done by proto::_
+ which, used as a transform, just passes the current expression along. Making
+ this action an identity transform.
+ </p>
+<p>
+ So, after the basics are set up, we can start by writing the transformations
+ we want to have on our tree:
+ </p>
+<pre class="programlisting"><span class="comment">// Transform plus to minus
+</span><span class="keyword">template</span> <span class="special">&lt;&gt;</span>
+<span class="keyword">struct</span> <span class="identifier">invert_actions</span><span class="special">::</span><span class="identifier">when</span><span class="special">&lt;</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">rule</span><span class="special">::</span><span class="identifier">plus</span><span class="special">&gt;</span>
+ <span class="special">:</span> proto::call<span class="special">&lt;</span>
+ proto::functional::make_expr<span class="special">&lt;</span><span class="identifier">proto</span><span class="special">::</span><span class="identifier">tag</span><span class="special">::</span><span class="identifier">minus</span><span class="special">&gt;(</span>
+ <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">evaluator</span><span class="special">(</span><span class="identifier">proto</span><span class="special">::</span><span class="identifier">_left</span><span class="special">,</span> <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">_context</span><span class="special">)</span>
+ <span class="special">,</span> <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">evaluator</span><span class="special">(</span><span class="identifier">proto</span><span class="special">::</span><span class="identifier">_right</span><span class="special">,</span> <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">_context</span><span class="special">)</span>
+ <span class="special">)</span>
+ <span class="special">&gt;</span>
+<span class="special">{};</span>
+</pre>
+<p>
+ Wow, this looks complicated! Granted you need to know a little bit about
+ Boost.Proto
+ (For a good introduction read through the <a href="http://cpp-next.com/archive/2010/08/expressive-c-introduction/" target="_top">Expressive
+ C++</a> series).
+ </p>
+<p>
+ What is done is the following:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ The left expression is passed to evaluator (with the current context,
+ that contains our invert_actions)
+ </li>
+<li class="listitem">
+ The right expression is passed to evaluator (with the current context,
+ that contains our invert_actions)
+ </li>
+<li class="listitem">
+ The result of these two <a href="http://www.boost.org/doc/libs/release/doc/html/Transform.html" target="_top">Proto
+ Transforms</a> is passed to proto::functional::make_expr which returns the
+ freshly created expression
+ </li>
+</ul></div>
+<p>
+ After you know what is going on, maybe the rest doesn't look so scary anymore:
+ </p>
+<pre class="programlisting"><span class="comment">// Transform minus to plus
+</span><span class="keyword">template</span> <span class="special">&lt;&gt;</span>
+<span class="keyword">struct</span> <span class="identifier">invert_actions</span><span class="special">::</span><span class="identifier">when</span><span class="special">&lt;</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">rule</span><span class="special">::</span><span class="identifier">minus</span><span class="special">&gt;</span>
+ <span class="special">:</span> proto::call<span class="special">&lt;</span>
+ proto::functional::make_expr<span class="special">&lt;</span><span class="identifier">proto</span><span class="special">::</span><span class="identifier">tag</span><span class="special">::</span><span class="identifier">plus</span><span class="special">&gt;(</span>
+ <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">evaluator</span><span class="special">(</span><span class="identifier">proto</span><span class="special">::</span><span class="identifier">_left</span><span class="special">,</span> <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">_context</span><span class="special">)</span>
+ <span class="special">,</span> <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">evaluator</span><span class="special">(</span><span class="identifier">proto</span><span class="special">::</span><span class="identifier">_right</span><span class="special">,</span> <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">_context</span><span class="special">)</span>
+ <span class="special">)</span>
+ <span class="special">&gt;</span>
+<span class="special">{};</span>
+
+<span class="comment">// Transform multiplies to divides
+</span><span class="keyword">template</span> <span class="special">&lt;&gt;</span>
+<span class="keyword">struct</span> <span class="identifier">invert_actions</span><span class="special">::</span><span class="identifier">when</span><span class="special">&lt;</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">rule</span><span class="special">::</span><span class="identifier">multiplies</span><span class="special">&gt;</span>
+ <span class="special">:</span> proto::call<span class="special">&lt;</span>
+ proto::functional::make_expr<span class="special">&lt;</span><span class="identifier">proto</span><span class="special">::</span><span class="identifier">tag</span><span class="special">::</span><span class="identifier">divides</span><span class="special">&gt;(</span>
+ <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">evaluator</span><span class="special">(</span><span class="identifier">proto</span><span class="special">::</span><span class="identifier">_left</span><span class="special">,</span> <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">_context</span><span class="special">)</span>
+ <span class="special">,</span> <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">evaluator</span><span class="special">(</span><span class="identifier">proto</span><span class="special">::</span><span class="identifier">_right</span><span class="special">,</span> <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">_context</span><span class="special">)</span>
+ <span class="special">)</span>
+ <span class="special">&gt;</span>
+<span class="special">{};</span>
+
+<span class="comment">// Transform divides to multiplies
+</span><span class="keyword">template</span> <span class="special">&lt;&gt;</span>
+<span class="keyword">struct</span> <span class="identifier">invert_actions</span><span class="special">::</span><span class="identifier">when</span><span class="special">&lt;</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">rule</span><span class="special">::</span><span class="identifier">divides</span><span class="special">&gt;</span>
+ <span class="special">:</span> proto::call<span class="special">&lt;</span>
+ proto::functional::make_expr<span class="special">&lt;</span><span class="identifier">proto</span><span class="special">::</span><span class="identifier">tag</span><span class="special">::</span><span class="identifier">multiplies</span><span class="special">&gt;(</span>
+ <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">evaluator</span><span class="special">(</span><span class="identifier">proto</span><span class="special">::</span><span class="identifier">_left</span><span class="special">,</span> <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">_context</span><span class="special">)</span>
+ <span class="special">,</span> <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">evaluator</span><span class="special">(</span><span class="identifier">proto</span><span class="special">::</span><span class="identifier">_right</span><span class="special">,</span> <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">_context</span><span class="special">)</span>
+ <span class="special">)</span>
+ <span class="special">&gt;</span>
+<span class="special">{};</span>
+</pre>
+<p>
+ That's it! Now that we have our actions defined, we want to evaluate some
+ of our expressions with them:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Expr</span><span class="special">&gt;</span>
+<span class="comment">// Calculate the result type: our transformed AST
+</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">result_of</span><span class="special">&lt;</span>
+ <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">evaluator</span><span class="special">(</span>
+ <span class="identifier">Expr</span> <span class="keyword">const</span><span class="special">&amp;</span>
+ <span class="special">,</span> <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">context</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">invert_actions</span><span class="special">&gt;::</span><span class="identifier">type</span>
+ <span class="special">)</span>
+<span class="special">&gt;::</span><span class="identifier">type</span>
+<span class="identifier">invert</span><span class="special">(</span><span class="identifier">Expr</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">expr</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="keyword">return</span>
+ <span class="comment">// Evaluate it with our actions
+</span> <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">eval</span><span class="special">(</span>
+ <span class="identifier">expr</span>
+ <span class="special">,</span> <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">context</span><span class="special">(</span>
+ <span class="keyword">int</span><span class="special">()</span>
+ <span class="special">,</span> <span class="identifier">invert_actions</span><span class="special">()</span>
+ <span class="special">)</span>
+ <span class="special">);</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Run some tests to see if it is working:
+ </p>
+<pre class="programlisting"><span class="identifier">invert</span><span class="special">(</span><span class="identifier">_1</span><span class="special">);</span> <span class="comment">// --&gt; _1
+</span><span class="identifier">invert</span><span class="special">(</span><span class="identifier">_1</span> <span class="special">+</span> <span class="identifier">_2</span><span class="special">);</span> <span class="comment">// --&gt; _1 - _2
+</span><span class="identifier">invert</span><span class="special">(</span><span class="identifier">_1</span> <span class="special">+</span> <span class="identifier">_2</span> <span class="special">-</span> <span class="identifier">_3</span><span class="special">);</span> <span class="comment">// --&gt; _1 - _2 + _3
+</span><span class="identifier">invert</span><span class="special">(</span><span class="identifier">_1</span> <span class="special">*</span> <span class="identifier">_2</span><span class="special">);</span> <span class="comment">// --&gt; _1 / _2
+</span><span class="identifier">invert</span><span class="special">(</span><span class="identifier">_1</span> <span class="special">*</span> <span class="identifier">_2</span> <span class="special">/</span> <span class="identifier">_3</span><span class="special">);</span> <span class="comment">// --&gt; _1 / _2 * _3
+</span><span class="identifier">invert</span><span class="special">(</span><span class="identifier">_1</span> <span class="special">*</span> <span class="identifier">_2</span> <span class="special">+</span> <span class="identifier">_3</span><span class="special">);</span> <span class="comment">// --&gt; _1 / _2 - _3
+</span><span class="identifier">invert</span><span class="special">(</span><span class="identifier">_1</span> <span class="special">*</span> <span class="identifier">_2</span> <span class="special">-</span> <span class="identifier">_3</span><span class="special">);</span> <span class="comment">// --&gt; _1 / _2 + _2
+</span><span class="identifier">invert</span><span class="special">(</span><span class="identifier">if_</span><span class="special">(</span><span class="identifier">_1</span> <span class="special">*</span> <span class="identifier">_4</span><span class="special">)[</span><span class="identifier">_2</span> <span class="special">-</span> <span class="identifier">_3</span><span class="special">]);</span> <span class="comment">// --&gt; if_(_1 / _4)[_2 - _3]
+</span><span class="identifier">_1</span> <span class="special">*</span> <span class="identifier">invert</span><span class="special">(</span><span class="identifier">_2</span> <span class="special">-</span> <span class="identifier">_3</span><span class="special">));</span> <span class="comment">// --&gt; _1 * _2 - _3
+</span></pre>
+<p>
+ <span class="inlinemediaobject"><img src="../../images/note.png" alt="note"></span> The complete example can be found here: example/invert.cpp
+ </p>
+<p>
+ <span class="emphasis"><em>Pretty simple ...</em></span>
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2002-2005, 2010 Joel de Guzman, Dan Marsden, Thomas Heller<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="adding_an_expression.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../wrap_up.html"><img src="../../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/actions.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/actions.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/actions.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -84,7 +84,7 @@
         how the Phoenix AST will be traversed.
       </p>
 <a name="phoenix.inside.actions.writing_an_action"></a><h5>
-<a name="id722285"></a>
+<a name="id772051"></a>
         <a class="link" href="actions.html#phoenix.inside.actions.writing_an_action">Writing an Action</a>
       </h5>
 <p>
@@ -97,9 +97,9 @@
 <span class="keyword">struct</span> <span class="identifier">call</span><span class="special">;</span>
 </pre>
 <p>
- This is similar to <a href="http://www.boost.org/doc/libs/release/doc/html/boost/proto/pass_through.html" target="_top">Proto
- Pass Through Transform</a> but does more. It calls the <code class="computeroutput"><span class="identifier">Fun</span></code> function object passed as template
- parameter with the <code class="computeroutput"><span class="identifier">Context</span></code>
+ This is similar to proto::call but does more. It calls the
+ <code class="computeroutput"><span class="identifier">Fun</span></code> function object passed
+ as template parameter with the <code class="computeroutput"><span class="identifier">Context</span></code>
         and the children of the expression associated with the rule.
       </p>
 <p>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/actor.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/actor.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/actor.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -20,7 +20,7 @@
 <a name="phoenix.inside.actor"></a><a class="link" href="actor.html" title="Actors in Detail">Actors in Detail</a>
 </h3></div></div></div>
 <a name="phoenix.inside.actor.actor"></a><h5>
-<a name="id713746"></a>
+<a name="id763512"></a>
         <a class="link" href="actor.html#phoenix.inside.actor.actor">Actor</a>
       </h5>
 <p>
@@ -70,7 +70,7 @@
 </span><span class="special">};</span>
 </pre>
 <div class="table">
-<a name="id714264"></a><p class="title"><b>Table&#160;1.9.&#160;Actor Concept Requirements</b></p>
+<a name="id764031"></a><p class="title"><b>Table&#160;1.9.&#160;Actor Concept Requirements</b></p>
 <div class="table-contents"><table class="table" summary="Actor Concept Requirements">
 <colgroup>
 <col>
@@ -136,7 +136,7 @@
 </table></div>
 </div>
 <br class="table-break"><a name="phoenix.inside.actor.function_call_operators"></a><h5>
-<a name="id714566"></a>
+<a name="id764332"></a>
         <a class="link" href="actor.html#phoenix.inside.actor.function_call_operators">Function Call
         Operators</a>
       </h5>
@@ -169,7 +169,7 @@
 </td></tr>
 </table></div>
 <a name="phoenix.inside.actor.context"></a><h5>
-<a name="id714672"></a>
+<a name="id764439"></a>
         <a class="link" href="actor.html#phoenix.inside.actor.context">Context</a>
       </h5>
 <p>
@@ -180,7 +180,7 @@
         all information necessary to evaluate the given expression.
       </p>
 <div class="table">
-<a name="id714717"></a><p class="title"><b>Table&#160;1.10.&#160;Context Concept Requirements</b></p>
+<a name="id764484"></a><p class="title"><b>Table&#160;1.10.&#160;Context Concept Requirements</b></p>
 <div class="table-contents"><table class="table" summary="Context Concept Requirements">
 <colgroup>
 <col>
@@ -278,7 +278,7 @@
 </table></div>
 </div>
 <br class="table-break"><a name="phoenix.inside.actor.environment"></a><h5>
-<a name="id715084"></a>
+<a name="id764851"></a>
         <a class="link" href="actor.html#phoenix.inside.actor.environment">Environment</a>
       </h5>
 <p>
@@ -297,7 +297,7 @@
         such as local variables, etc.
       </p>
 <a name="phoenix.inside.actor.actions"></a><h5>
-<a name="id715150"></a>
+<a name="id764916"></a>
         <a class="link" href="actor.html#phoenix.inside.actor.actions">Actions</a>
       </h5>
 <p>
@@ -336,7 +336,7 @@
         on actions</a>.
       </p>
 <a name="phoenix.inside.actor.evaluation"></a><h5>
-<a name="id715433"></a>
+<a name="id765200"></a>
         <a class="link" href="actor.html#phoenix.inside.actor.evaluation">Evaluation</a>
       </h5>
 <pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">evaluator</span>
@@ -367,7 +367,7 @@
 <span class="special">}</span>
 </pre>
 <a name="phoenix.inside.actor.result_of__actor"></a><h5>
-<a name="id715938"></a>
+<a name="id765704"></a>
         <a class="link" href="actor.html#phoenix.inside.actor.result_of__actor">result_of::actor</a>
       </h5>
 <p>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/expression.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/expression.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/expression.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -155,7 +155,7 @@
         </p></td></tr>
 </table></div>
 <a name="phoenix.inside.expression.meta_grammar"></a><h5>
-<a name="id717352"></a>
+<a name="id767118"></a>
         <a class="link" href="expression.html#phoenix.inside.expression.meta_grammar">meta_grammar</a>
       </h5>
 <p>
@@ -183,7 +183,7 @@
         you include this grammar gets extended by various expressions.
       </p>
 <a name="phoenix.inside.expression.example"></a><h5>
-<a name="id717582"></a>
+<a name="id767348"></a>
         <a class="link" href="expression.html#phoenix.inside.expression.example">Example</a>
       </h5>
 <p>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/expression/boost_phoenix_define_expression.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/expression/boost_phoenix_define_expression.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/expression/boost_phoenix_define_expression.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -20,7 +20,7 @@
 <a name="phoenix.inside.expression.boost_phoenix_define_expression"></a><a class="link" href="boost_phoenix_define_expression.html" title="BOOST_PHOENIX_DEFINE_EXPRESSION">BOOST_PHOENIX_DEFINE_EXPRESSION</a>
 </h4></div></div></div>
 <a name="phoenix.inside.expression.boost_phoenix_define_expression.description"></a><h6>
-<a name="id718403"></a>
+<a name="id768169"></a>
           <a class="link" href="boost_phoenix_define_expression.html#phoenix.inside.expression.boost_phoenix_define_expression.description">Description</a>
         </h6>
 <p>
@@ -29,7 +29,7 @@
           create Phoenix Expressions
         </p>
 <a name="phoenix.inside.expression.boost_phoenix_define_expression.synopsis"></a><h6>
-<a name="id718438"></a>
+<a name="id768204"></a>
           <a class="link" href="boost_phoenix_define_expression.html#phoenix.inside.expression.boost_phoenix_define_expression.synopsis">Synopsis</a>
         </h6>
 <pre class="programlisting"><span class="identifier">BOOST_PHOENIX_DEFINE_EXPRESSION</span><span class="special">(</span>
@@ -40,7 +40,7 @@
 <span class="special">)</span>
 </pre>
 <a name="phoenix.inside.expression.boost_phoenix_define_expression.semantics"></a><h6>
-<a name="id718543"></a>
+<a name="id768309"></a>
           <a class="link" href="boost_phoenix_define_expression.html#phoenix.inside.expression.boost_phoenix_define_expression.semantics">Semantics</a>
         </h6>
 <p>
@@ -88,13 +88,13 @@
           This macros also adds a specialization for <code class="computeroutput"><span class="identifier">meta_grammar</span><span class="special">::</span><span class="identifier">case_</span><span class="special">&lt;</span><span class="identifier">tag</span><span class="special">::</span><span class="identifier">name</span><span class="special">&gt;</span></code>.
         </p>
 <a name="phoenix.inside.expression.boost_phoenix_define_expression.header"></a><h6>
-<a name="id719030"></a>
+<a name="id768797"></a>
           <a class="link" href="boost_phoenix_define_expression.html#phoenix.inside.expression.boost_phoenix_define_expression.header">Header</a>
         </h6>
 <pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">phoenix</span><span class="special">/</span><span class="identifier">core</span><span class="special">/</span><span class="identifier">expression</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
 </pre>
 <a name="phoenix.inside.expression.boost_phoenix_define_expression.example"></a><h6>
-<a name="id719112"></a>
+<a name="id768878"></a>
           <a class="link" href="boost_phoenix_define_expression.html#phoenix.inside.expression.boost_phoenix_define_expression.example">Example</a>
         </h6>
 <p>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/expression/boost_phoenix_define_expression_ext.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/expression/boost_phoenix_define_expression_ext.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/expression/boost_phoenix_define_expression_ext.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -20,7 +20,7 @@
 <a name="phoenix.inside.expression.boost_phoenix_define_expression_ext"></a><a class="link" href="boost_phoenix_define_expression_ext.html" title="BOOST_PHOENIX_DEFINE_EXPRESSION_EXT">BOOST_PHOENIX_DEFINE_EXPRESSION_EXT</a>
 </h4></div></div></div>
 <a name="phoenix.inside.expression.boost_phoenix_define_expression_ext.description"></a><h6>
-<a name="id720344"></a>
+<a name="id770110"></a>
           <a class="link" href="boost_phoenix_define_expression_ext.html#phoenix.inside.expression.boost_phoenix_define_expression_ext.description">Description</a>
         </h6>
 <p>
@@ -29,7 +29,7 @@
           create Phoenix Expressions
         </p>
 <a name="phoenix.inside.expression.boost_phoenix_define_expression_ext.synopsis"></a><h6>
-<a name="id720378"></a>
+<a name="id770145"></a>
           <a class="link" href="boost_phoenix_define_expression_ext.html#phoenix.inside.expression.boost_phoenix_define_expression_ext.synopsis">Synopsis</a>
         </h6>
 <pre class="programlisting"><span class="identifier">BOOST_PHOENIX_DEFINE_EXPRESSION_EXT</span><span class="special">(</span>
@@ -43,7 +43,7 @@
 <span class="special">)</span>
 </pre>
 <a name="phoenix.inside.expression.boost_phoenix_define_expression_ext.semantics"></a><h6>
-<a name="id720519"></a>
+<a name="id770286"></a>
           <a class="link" href="boost_phoenix_define_expression_ext.html#phoenix.inside.expression.boost_phoenix_define_expression_ext.semantics">Semantics</a>
         </h6>
 <p>
@@ -92,13 +92,13 @@
           This macros also adds a specialization for <code class="computeroutput"><span class="identifier">meta_grammar</span><span class="special">::</span><span class="identifier">case_</span><span class="special">&lt;</span><span class="identifier">tag</span><span class="special">::</span><span class="identifier">name</span><span class="special">&gt;</span></code>.
         </p>
 <a name="phoenix.inside.expression.boost_phoenix_define_expression_ext.header"></a><h6>
-<a name="id721019"></a>
+<a name="id770786"></a>
           <a class="link" href="boost_phoenix_define_expression_ext.html#phoenix.inside.expression.boost_phoenix_define_expression_ext.header">Header</a>
         </h6>
 <pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">phoenix</span><span class="special">/</span><span class="identifier">core</span><span class="special">/</span><span class="identifier">expression</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
 </pre>
 <a name="phoenix.inside.expression.boost_phoenix_define_expression_ext.example"></a><h6>
-<a name="id721102"></a>
+<a name="id770869"></a>
           <a class="link" href="boost_phoenix_define_expression_ext.html#phoenix.inside.expression.boost_phoenix_define_expression_ext.example">Example</a>
         </h6>
 <pre class="programlisting"><span class="identifier">BOOST_PHOENIX_DEFINE_EXPRESSION_EXT</span><span class="special">(</span>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/expression/boost_phoenix_define_expression_ext_vararg.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/expression/boost_phoenix_define_expression_ext_vararg.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/expression/boost_phoenix_define_expression_ext_vararg.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -20,7 +20,7 @@
 <a name="phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg"></a><a class="link" href="boost_phoenix_define_expression_ext_vararg.html" title="BOOST_PHOENIX_DEFINE_EXPRESSION_EXT_VARARG">BOOST_PHOENIX_DEFINE_EXPRESSION_EXT_VARARG</a>
 </h4></div></div></div>
 <a name="phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg.description"></a><h6>
-<a name="id721264"></a>
+<a name="id771030"></a>
           <a class="link" href="boost_phoenix_define_expression_ext_vararg.html#phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg.description">Description</a>
         </h6>
 <p>
@@ -29,7 +29,7 @@
           create Phoenix Expressions
         </p>
 <a name="phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg.synopsis"></a><h6>
-<a name="id721300"></a>
+<a name="id771066"></a>
           <a class="link" href="boost_phoenix_define_expression_ext_vararg.html#phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg.synopsis">Synopsis</a>
         </h6>
 <pre class="programlisting"><span class="identifier">BOOST_PHOENIX_DEFINE_EXPRESSION_EXT_VARARG</span><span class="special">(</span>
@@ -43,7 +43,7 @@
 <span class="special">)</span>
 </pre>
 <a name="phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg.semantics"></a><h6>
-<a name="id721442"></a>
+<a name="id771208"></a>
           <a class="link" href="boost_phoenix_define_expression_ext_vararg.html#phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg.semantics">Semantics</a>
         </h6>
 <p>
@@ -92,13 +92,13 @@
 <span class="special">}</span>
 </pre>
 <a name="phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg.header"></a><h6>
-<a name="id721908"></a>
+<a name="id771674"></a>
           <a class="link" href="boost_phoenix_define_expression_ext_vararg.html#phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg.header">Header</a>
         </h6>
 <pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">phoenix</span><span class="special">/</span><span class="identifier">core</span><span class="special">/</span><span class="identifier">expression</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
 </pre>
 <a name="phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg.example"></a><h6>
-<a name="id721991"></a>
+<a name="id771757"></a>
           <a class="link" href="boost_phoenix_define_expression_ext_vararg.html#phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg.example">Example</a>
         </h6>
 <p>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/expression/boost_phoenix_define_expression_vararg.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/expression/boost_phoenix_define_expression_vararg.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/inside/expression/boost_phoenix_define_expression_vararg.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -20,7 +20,7 @@
 <a name="phoenix.inside.expression.boost_phoenix_define_expression_vararg"></a><a class="link" href="boost_phoenix_define_expression_vararg.html" title="BOOST_PHOENIX_DEFINE_EXPRESSION_VARARG">BOOST_PHOENIX_DEFINE_EXPRESSION_VARARG</a>
 </h4></div></div></div>
 <a name="phoenix.inside.expression.boost_phoenix_define_expression_vararg.description"></a><h6>
-<a name="id719461"></a>
+<a name="id769227"></a>
           <a class="link" href="boost_phoenix_define_expression_vararg.html#phoenix.inside.expression.boost_phoenix_define_expression_vararg.description">Description</a>
         </h6>
 <p>
@@ -29,7 +29,7 @@
           create Phoenix Expressions
         </p>
 <a name="phoenix.inside.expression.boost_phoenix_define_expression_vararg.synopsis"></a><h6>
-<a name="id719497"></a>
+<a name="id769263"></a>
           <a class="link" href="boost_phoenix_define_expression_vararg.html#phoenix.inside.expression.boost_phoenix_define_expression_vararg.synopsis">Synopsis</a>
         </h6>
 <pre class="programlisting"><span class="identifier">BOOST_PHOENIX_DEFINE_EXPRESSION_VARARG</span><span class="special">(</span>
@@ -42,7 +42,7 @@
 <span class="special">)</span>
 </pre>
 <a name="phoenix.inside.expression.boost_phoenix_define_expression_vararg.semantics"></a><h6>
-<a name="id719628"></a>
+<a name="id769394"></a>
           <a class="link" href="boost_phoenix_define_expression_vararg.html#phoenix.inside.expression.boost_phoenix_define_expression_vararg.semantics">Semantics</a>
         </h6>
 <p>
@@ -90,13 +90,13 @@
 <span class="special">}</span>
 </pre>
 <a name="phoenix.inside.expression.boost_phoenix_define_expression_vararg.header"></a><h6>
-<a name="id720080"></a>
+<a name="id769847"></a>
           <a class="link" href="boost_phoenix_define_expression_vararg.html#phoenix.inside.expression.boost_phoenix_define_expression_vararg.header">Header</a>
         </h6>
 <pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">phoenix</span><span class="special">/</span><span class="identifier">core</span><span class="special">/</span><span class="identifier">expression</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
 </pre>
 <a name="phoenix.inside.expression.boost_phoenix_define_expression_vararg.example"></a><h6>
-<a name="id720163"></a>
+<a name="id769930"></a>
           <a class="link" href="boost_phoenix_define_expression_vararg.html#phoenix.inside.expression.boost_phoenix_define_expression_vararg.example">Example</a>
         </h6>
 <pre class="programlisting"><span class="identifier">BOOST_PHOENIX_DEFINE_EXPRESSION_VARARG</span><span class="special">(</span>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/core/arguments.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/core/arguments.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/core/arguments.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -31,7 +31,7 @@
           an imaginary data-bin where a function argument will be placed.
         </p>
 <a name="phoenix.modules.core.arguments.predefined_arguments"></a><h6>
-<a name="id687152"></a>
+<a name="id736918"></a>
           <a class="link" href="arguments.html#phoenix.modules.core.arguments.predefined_arguments">Predefined
           Arguments</a>
         </h6>
@@ -75,7 +75,7 @@
           </p></td></tr>
 </table></div>
 <a name="phoenix.modules.core.arguments.user_defined_arguments"></a><h6>
-<a name="id687677"></a>
+<a name="id737444"></a>
           <a class="link" href="arguments.html#phoenix.modules.core.arguments.user_defined_arguments">User
           Defined Arguments</a>
         </h6>
@@ -97,7 +97,7 @@
 <pre class="programlisting"><span class="identifier">add</span><span class="special">(</span><span class="identifier">arg1</span><span class="special">,</span> <span class="number">6</span><span class="special">)</span>
 </pre>
 <a name="phoenix.modules.core.arguments.evaluating_an_argument"></a><h6>
-<a name="id687829"></a>
+<a name="id737595"></a>
           <a class="link" href="arguments.html#phoenix.modules.core.arguments.evaluating_an_argument">Evaluating
           an Argument</a>
         </h6>
@@ -124,7 +124,7 @@
 <span class="identifier">Hello</span> <span class="identifier">World</span>
 </pre>
 <a name="phoenix.modules.core.arguments.extra_arguments"></a><h6>
-<a name="id688126"></a>
+<a name="id737892"></a>
           <a class="link" href="arguments.html#phoenix.modules.core.arguments.extra_arguments">Extra Arguments</a>
         </h6>
 <p>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/core/references.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/core/references.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/core/references.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -59,7 +59,7 @@
 <pre class="programlisting"><span class="identifier">add_assign</span><span class="special">(</span><span class="identifier">ref</span><span class="special">(</span><span class="identifier">i</span><span class="special">),</span> <span class="number">2</span><span class="special">)</span>
 </pre>
 <a name="phoenix.modules.core.references.evaluating_a_reference"></a><h6>
-<a name="id686750"></a>
+<a name="id736516"></a>
           <a class="link" href="references.html#phoenix.modules.core.references.evaluating_a_reference">Evaluating
           a Reference</a>
         </h6>
@@ -75,7 +75,7 @@
           prints out "3 Hello World"
         </p>
 <a name="phoenix.modules.core.references.constant_references"></a><h6>
-<a name="id686886"></a>
+<a name="id736652"></a>
           <a class="link" href="references.html#phoenix.modules.core.references.constant_references">Constant
           References</a>
         </h6>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/core/values.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/core/values.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/core/values.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -47,7 +47,7 @@
           but, as we'll see later on, there are situations where this is unavoidable.
         </p>
 <a name="phoenix.modules.core.values.evaluating_a_value"></a><h3>
-<a name="id686268"></a>
+<a name="id736034"></a>
           <a class="link" href="values.html#phoenix.modules.core.values.evaluating_a_value">Evaluating
           a Value</a>
         </h3>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/operator.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/operator.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/operator.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -134,18 +134,18 @@
 </span><span class="identifier">val</span><span class="special">(</span><span class="number">1</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="number">3</span><span class="special">;</span> <span class="comment">// Lazily evaluated
 </span></pre>
 <a name="phoenix.modules.operator.supported_operators"></a><h5>
-<a name="id690495"></a>
+<a name="id740261"></a>
         <a class="link" href="operator.html#phoenix.modules.operator.supported_operators">Supported operators</a>
       </h5>
 <a name="phoenix.modules.operator.unary_operators"></a><h5>
-<a name="id690514"></a>
+<a name="id740280"></a>
         <a class="link" href="operator.html#phoenix.modules.operator.unary_operators">Unary operators</a>
       </h5>
 <pre class="programlisting"><span class="identifier">prefix</span><span class="special">:</span> <span class="special">~,</span> <span class="special">!,</span> <span class="special">-,</span> <span class="special">+,</span> <span class="special">++,</span> <span class="special">--,</span> <span class="special">&amp;</span> <span class="special">(</span><span class="identifier">reference</span><span class="special">),</span> <span class="special">*</span> <span class="special">(</span><span class="identifier">dereference</span><span class="special">)</span>
 <span class="identifier">postfix</span><span class="special">:</span> <span class="special">++,</span> <span class="special">--</span>
 </pre>
 <a name="phoenix.modules.operator.binary_operators"></a><h5>
-<a name="id690645"></a>
+<a name="id740411"></a>
         <a class="link" href="operator.html#phoenix.modules.operator.binary_operators">Binary operators</a>
       </h5>
 <pre class="programlisting"><span class="special">=,</span> <span class="special">[],</span> <span class="special">+=,</span> <span class="special">-=,</span> <span class="special">*=,</span> <span class="special">/=,</span> <span class="special">%=,</span> <span class="special">&amp;=,</span> <span class="special">|=,</span> <span class="special">^=,</span> <span class="special">&lt;&lt;=,</span> <span class="special">&gt;&gt;=</span>
@@ -154,7 +154,7 @@
 <span class="special">&amp;&amp;,</span> <span class="special">||,</span> <span class="special">-&gt;*</span>
 </pre>
 <a name="phoenix.modules.operator.ternary_operator"></a><h5>
-<a name="id690846"></a>
+<a name="id740612"></a>
         <a class="link" href="operator.html#phoenix.modules.operator.ternary_operator">Ternary operator</a>
       </h5>
 <pre class="programlisting"><span class="identifier">if_else</span><span class="special">(</span><span class="identifier">c</span><span class="special">,</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">b</span><span class="special">)</span>
@@ -167,7 +167,7 @@
         albeit in a lazy manner.
       </p>
 <a name="phoenix.modules.operator.member_pointer_operator"></a><h5>
-<a name="id690947"></a>
+<a name="id740713"></a>
         <a class="link" href="operator.html#phoenix.modules.operator.member_pointer_operator">Member pointer
         operator</a>
       </h5>
@@ -208,7 +208,7 @@
 <span class="special">(</span><span class="identifier">arg1</span><span class="special">-&gt;*&amp;</span><span class="identifier">A</span><span class="special">::</span><span class="identifier">func</span><span class="special">)(</span><span class="identifier">arg2</span><span class="special">)(</span><span class="identifier">a</span><span class="special">,</span> <span class="identifier">i</span><span class="special">);</span> <span class="comment">// returns a-&gt;func(i)
 </span></pre>
 <a name="phoenix.modules.operator.include_files"></a><h5>
-<a name="id691327"></a>
+<a name="id741094"></a>
         <a class="link" href="operator.html#phoenix.modules.operator.include_files">Include Files</a>
       </h5>
 <div class="informaltable"><table class="table">

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/stl/algorithm.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/stl/algorithm.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/stl/algorithm.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -73,7 +73,7 @@
         </p>
 </div>
 <div class="table">
-<a name="id705217"></a><p class="title"><b>Table&#160;1.6.&#160;Iteration Algorithms</b></p>
+<a name="id754984"></a><p class="title"><b>Table&#160;1.6.&#160;Iteration Algorithms</b></p>
 <div class="table-contents"><table class="table" summary="Iteration Algorithms">
 <colgroup>
 <col>
@@ -128,7 +128,7 @@
 </table></div>
 </div>
 <br class="table-break"><div class="table">
-<a name="id705496"></a><p class="title"><b>Table&#160;1.7.&#160;Querying Algorithms</b></p>
+<a name="id755262"></a><p class="title"><b>Table&#160;1.7.&#160;Querying Algorithms</b></p>
 <div class="table-contents"><table class="table" summary="Querying Algorithms">
 <colgroup>
 <col>
@@ -441,7 +441,7 @@
 </table></div>
 </div>
 <br class="table-break"><div class="table">
-<a name="id707968"></a><p class="title"><b>Table&#160;1.8.&#160;Transformation Algorithms</b></p>
+<a name="id757734"></a><p class="title"><b>Table&#160;1.8.&#160;Transformation Algorithms</b></p>
 <div class="table-contents"><table class="table" summary="Transformation Algorithms">
 <colgroup>
 <col>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/stl/container.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/stl/container.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/modules/stl/container.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -137,7 +137,7 @@
           does not use the member "dot" syntax.
         </p>
 <div class="table">
-<a name="id702166"></a><p class="title"><b>Table&#160;1.4.&#160;Sample usage</b></p>
+<a name="id751932"></a><p class="title"><b>Table&#160;1.4.&#160;Sample usage</b></p>
 <div class="table-contents"><table class="table" summary="Sample usage">
 <colgroup>
 <col>
@@ -215,7 +215,7 @@
         </p>
 </div>
 <div class="table">
-<a name="id702506"></a><p class="title"><b>Table&#160;1.5.&#160;Lazy STL Container Functions</b></p>
+<a name="id752272"></a><p class="title"><b>Table&#160;1.5.&#160;Lazy STL Container Functions</b></p>
 <div class="table-contents"><table class="table" summary="Lazy STL Container Functions">
 <colgroup>
 <col>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/organization.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/organization.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/organization.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -52,7 +52,7 @@
       files. There are no object files to link against.
     </p>
 <a name="phoenix.organization.core"></a><h3>
-<a name="id684598"></a>
+<a name="id734364"></a>
       <a class="link" href="organization.html#phoenix.organization.core">Core</a>
     </h3>
 <p>
@@ -72,7 +72,7 @@
       can again be another expression.
     </p>
 <div class="table">
-<a name="id684636"></a><p class="title"><b>Table&#160;1.2.&#160;Modules</b></p>
+<a name="id734403"></a><p class="title"><b>Table&#160;1.2.&#160;Modules</b></p>
 <div class="table-contents"><table class="table" summary="Modules">
 <colgroup>
 <col>
@@ -200,7 +200,7 @@
       core module is defined in <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">phoenix</span><span class="special">/</span><span class="identifier">core</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>.
     </p>
 <div class="table">
-<a name="id684924"></a><p class="title"><b>Table&#160;1.3.&#160;Includes</b></p>
+<a name="id734691"></a><p class="title"><b>Table&#160;1.3.&#160;Includes</b></p>
 <div class="table-contents"><table class="table" summary="Includes">
 <colgroup>
 <col>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/starter_kit.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/starter_kit.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/starter_kit.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -52,7 +52,7 @@
       into high gear quickly.
     </p>
 <a name="phoenix.starter_kit.functors_everywhere"></a><h4>
-<a name="id679817"></a>
+<a name="id729584"></a>
       <a class="link" href="starter_kit.html#phoenix.starter_kit.functors_everywhere">Functors everywhere</a>
     </h4>
 <p>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/starter_kit/lazy_functions.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/starter_kit/lazy_functions.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/starter_kit/lazy_functions.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -45,7 +45,7 @@
 <span class="identifier">function</span><span class="special">&lt;</span><span class="identifier">is_odd_impl</span><span class="special">&gt;</span> <span class="identifier">is_odd</span><span class="special">;</span>
 </pre>
 <a name="phoenix.starter_kit.lazy_functions.things_to_note_"></a><h5>
-<a name="id682618"></a>
+<a name="id732385"></a>
         <a class="link" href="lazy_functions.html#phoenix.starter_kit.lazy_functions.things_to_note_">Things
         to note:</a>
       </h5>
@@ -75,7 +75,7 @@
         (See function.cpp)
       </p>
 <a name="phoenix.starter_kit.lazy_functions.predefined_lazy_functions"></a><h5>
-<a name="id682796"></a>
+<a name="id732562"></a>
         <a class="link" href="lazy_functions.html#phoenix.starter_kit.lazy_functions.predefined_lazy_functions">Predefined
         Lazy Functions</a>
       </h5>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/starter_kit/lazy_operators.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/starter_kit/lazy_operators.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/starter_kit/lazy_operators.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -69,7 +69,7 @@
       </p>
 </div>
 <a name="phoenix.starter_kit.lazy_operators.first_practical_example"></a><h5>
-<a name="id681545"></a>
+<a name="id731311"></a>
         <a class="link" href="lazy_operators.html#phoenix.starter_kit.lazy_operators.first_practical_example">First
         Practical Example</a>
       </h5>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/starter_kit/values.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/starter_kit/values.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/starter_kit/values.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -32,7 +32,7 @@
         World"</span></code>.
       </p>
 <a name="phoenix.starter_kit.values.lazy_evaluation"></a><h5>
-<a name="id679981"></a>
+<a name="id729748"></a>
         <a class="link" href="values.html#phoenix.starter_kit.values.lazy_evaluation">Lazy Evaluation</a>
       </h5>
 <p>
@@ -64,7 +64,7 @@
         anything and defers the evaluation for later.
       </p>
 <a name="phoenix.starter_kit.values.callbacks"></a><h5>
-<a name="id680206"></a>
+<a name="id729973"></a>
         <a class="link" href="values.html#phoenix.starter_kit.values.callbacks">Callbacks</a>
       </h5>
 <p>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/wrap_up.html
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/wrap_up.html (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/html/phoenix/wrap_up.html 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -6,14 +6,14 @@
 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
 <link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Phoenix 3.0">
 <link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Phoenix 3.0">
-<link rel="prev" href="examples/adding_an_expression.html" title="Adding an expression">
+<link rel="prev" href="examples/transforming_the_expression_tree.html" title="Transforming the Expression Tree">
 <link rel="next" href="acknowledgments.html" title="Acknowledgments">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="examples/adding_an_expression.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="acknowledgments.html"><img src="../images/next.png" alt="Next"></a>
+<a accesskey="p" href="examples/transforming_the_expression_tree.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="acknowledgments.html"><img src="../images/next.png" alt="Next"></a>
 </div>
 <div class="section">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -63,7 +63,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="examples/adding_an_expression.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="acknowledgments.html"><img src="../images/next.png" alt="Next"></a>
+<a accesskey="p" href="examples/transforming_the_expression_tree.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="acknowledgments.html"><img src="../images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/doc/phoenix3.qbk
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/doc/phoenix3.qbk (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/doc/phoenix3.qbk 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -32,7 +32,7 @@
 [def __proto_primitive_transform__ [@http://www.boost.org/doc/libs/release/doc/html/PrimitiveTransform.html Proto Primitive Transform]]
 [def __proto_primitive_transforms__ [@http://www.boost.org/doc/libs/release/doc/html/PrimitiveTransform.html Proto Primitive Transforms]]
 [def __proto_callable__ [@http://www.boost.org/doc/libs/release/doc/html/Callable.html Proto Callable Transform]]
-[def __proto_call__ [@http://www.boost.org/doc/libs/release/doc/html/boost/proto/pass_through.html Proto Pass Through Transform]]
+[def __proto_call__ [@http://www.boost.org/doc/libs/release/doc/html/boost/proto/call.html `proto::call`]]
 [def __haskell__ [@http://www.haskell.org Haskell]]
 [def __mpl__ [@http://www.boost.org/libs/mpl/index.html MPL]]
 [def __bll__ [@http://www.boost.org/libs/lambda/doc/index.html BLL]]
@@ -50,6 +50,7 @@
 [def __boost_result_of__ [@http://www.boost.org/doc/libs/release/libs/utility/utility.htm#result_of Boost.Result Of]]
 [def __phoenix_starter_kit__ [link phoenix.starter_kit Starter Kit]]
 [def __phoenix_modules__ [link phoenix.modules Modules]]
+[def __phoenix_actions__ [link phoenix.inside.actions Actions]]
 [def __phoenix_custom_terminals__ [link phoenix.inside.custom_terminals Custom Terminals]]
 [def __phoenix_placeholder_unification__ [link phoenix.inside.placeholder_unification Placeholder Unification]]
 [def __unspecified__ /unspecified/]

Added: sandbox/SOC/2010/phoenix3/libs/phoenix/example/invert.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/example/invert.cpp 2011-02-23 14:24:36 EST (Wed, 23 Feb 2011)
@@ -0,0 +1,121 @@
+/*==============================================================================
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+
+#include <boost/phoenix/phoenix.hpp>
+#include <boost/phoenix/operator.hpp>
+#include <boost/proto/proto.hpp>
+#include <boost/proto/debug.hpp>
+
+namespace phoenix = boost::phoenix;
+namespace proto = boost::proto;
+
+struct invert_actions
+{
+ template <typename Rule>
+ struct when
+ : proto::_
+ {};
+};
+
+template <>
+struct invert_actions::when<phoenix::rule::plus>
+ : proto::call<
+ proto::functional::make_expr<proto::tag::minus>(
+ phoenix::evaluator(proto::_left, phoenix::_context)
+ , phoenix::evaluator(proto::_right, phoenix::_context)
+ )
+ >
+{};
+
+template <>
+struct invert_actions::when<phoenix::rule::minus>
+ : proto::call<
+ proto::functional::make_expr<proto::tag::plus>(
+ phoenix::evaluator(proto::_left, phoenix::_context)
+ , phoenix::evaluator(proto::_right, phoenix::_context)
+ )
+ >
+{};
+
+template <>
+struct invert_actions::when<phoenix::rule::multiplies>
+ : proto::call<
+ proto::functional::make_expr<proto::tag::divides>(
+ phoenix::evaluator(proto::_left, phoenix::_context)
+ , phoenix::evaluator(proto::_right, phoenix::_context)
+ )
+ >
+{};
+
+template <>
+struct invert_actions::when<phoenix::rule::divides>
+ : proto::call<
+ proto::functional::make_expr<proto::tag::multiplies>(
+ phoenix::evaluator(proto::_left, phoenix::_context)
+ , phoenix::evaluator(proto::_right, phoenix::_context)
+ )
+ >
+{};
+
+template <typename Expr>
+void print_expr(Expr const & expr)
+{
+ std::cout << "before inversion:\n";
+ proto::display_expr(expr);
+ std::cout << "after inversion:\n";
+ proto::display_expr(
+ phoenix::eval(
+ expr
+ , phoenix::context(
+ int()
+ , invert_actions()
+ )
+ )
+ );
+ std::cout << "\n";
+}
+
+template <typename Expr>
+typename boost::result_of<
+ phoenix::evaluator(
+ Expr const&
+ , phoenix::result_of::context<int, invert_actions>::type
+ )
+>::type
+invert(Expr const & expr)
+{
+ return
+ phoenix::eval(
+ expr
+ , phoenix::context(
+ int()
+ , invert_actions()
+ )
+ );
+}
+
+int main()
+{
+ using phoenix::placeholders::_1;
+ using phoenix::placeholders::_2;
+ using phoenix::placeholders::_3;
+ using phoenix::placeholders::_4;
+
+ print_expr(_1);
+ print_expr(_1 + _2);
+ print_expr(_1 + _2 - _3);
+ print_expr(_1 * _2);
+ print_expr(_1 * _2 / _3);
+ print_expr(_1 * _2 + _3);
+ print_expr(_1 * _2 - _3);
+ print_expr(phoenix::if_(_1 * _4)[_2 - _3]);
+
+ print_expr(_1 * invert(_2 - _3));
+}
+
+


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