From a2557cce9656e65ea7bde2e5e9540e9737f31d4e Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Fri, 4 Jun 2010 06:02:29 +0000 Subject: [PATCH] start of phoenix-3 core [SVN r62422] --- include/boost/phoenix/core.hpp | 12 +++ include/boost/phoenix/core/actor.hpp | 45 +++++++++++ include/boost/phoenix/core/actor_result.hpp | 30 ++++++++ include/boost/phoenix/core/domain.hpp | 25 +++++++ include/boost/phoenix/core/meta_grammar.hpp | 82 +++++++++++++++++++++ include/boost/phoenix/placeholder.txt | 0 include/boost/phoenix/version.hpp | 18 +++++ 7 files changed, 212 insertions(+) create mode 100644 include/boost/phoenix/core.hpp create mode 100644 include/boost/phoenix/core/actor.hpp create mode 100644 include/boost/phoenix/core/actor_result.hpp create mode 100644 include/boost/phoenix/core/domain.hpp create mode 100644 include/boost/phoenix/core/meta_grammar.hpp delete mode 100644 include/boost/phoenix/placeholder.txt create mode 100644 include/boost/phoenix/version.hpp diff --git a/include/boost/phoenix/core.hpp b/include/boost/phoenix/core.hpp new file mode 100644 index 0000000..d5c9375 --- /dev/null +++ b/include/boost/phoenix/core.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + 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) + ==============================================================================*/ +#ifndef PHOENIX_CORE_HPP +#define PHOENIX_CORE_HPP + +#include + +#endif diff --git a/include/boost/phoenix/core/actor.hpp b/include/boost/phoenix/core/actor.hpp new file mode 100644 index 0000000..aaf7e4c --- /dev/null +++ b/include/boost/phoenix/core/actor.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2005-2010 Joel de Guzman + Copyright (c) 2010 Eric Niebler + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef PHOENIX_CORE_ACTOR_HPP +#define PHOENIX_CORE_ACTOR_HPP + +#include + +namespace boost { namespace phoenix +{ + //////////////////////////////////////////////////////////////////////////// + // The actor class. The main thing! In phoenix, everything is an actor + // This class is responsible for full function evaluation. Partial + // function evaluation involves creating a hierarchy of actor objects. + //////////////////////////////////////////////////////////////////////////// + template + struct actor + { + BOOST_PROTO_BASIC_EXTENDS(Expr, actor, phoenix_domain) + BOOST_PROTO_EXTENDS_ASSIGN() + BOOST_PROTO_EXTENDS_SUBSCRIPT() + + template + struct result : actor_result {}; + + typedef actor actor_type; + + template + typename boost::result_of::type + operator()(A0 const& a0) const + { + BOOST_PROTO_ASSERT_MATCHES(*this, eval_grammar); + fusion::vector args(a0); + return eval(*this, args); + } + + /*... more...*/ + }; +}} + +#endif diff --git a/include/boost/phoenix/core/actor_result.hpp b/include/boost/phoenix/core/actor_result.hpp new file mode 100644 index 0000000..19161b5 --- /dev/null +++ b/include/boost/phoenix/core/actor_result.hpp @@ -0,0 +1,30 @@ +/*============================================================================= + Copyright (c) 2005-2010 Joel de Guzman + Copyright (c) 2010 Eric Niebler + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef PHOENIX_CORE_ACTOR_RESULT_HPP +#define PHOENIX_CORE_ACTOR_RESULT_HPP + +#include +#include + +namespace boost { namespace phoenix +{ + //////////////////////////////////////////////////////////////////////////// + // Return type computation + //////////////////////////////////////////////////////////////////////////// + template + struct actor_result; + + template