Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62422 - in sandbox/SOC/2010/phoenix3/boost/phoenix: . core
From: joel_at_[hidden]
Date: 2010-06-04 02:02:32


Author: djowel
Date: 2010-06-04 02:02:29 EDT (Fri, 04 Jun 2010)
New Revision: 62422
URL: http://svn.boost.org/trac/boost/changeset/62422

Log:
start of phoenix-3 core
Added:
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/
   sandbox/SOC/2010/phoenix3/boost/phoenix/core.hpp (contents, props changed)
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor.hpp (contents, props changed)
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor_result.hpp (contents, props changed)
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/domain.hpp (contents, props changed)
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/meta_grammar.hpp (contents, props changed)
   sandbox/SOC/2010/phoenix3/boost/phoenix/version.hpp (contents, props changed)
Removed:
   sandbox/SOC/2010/phoenix3/boost/phoenix/placeholder.txt

Added: sandbox/SOC/2010/phoenix3/boost/phoenix/core.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core.hpp 2010-06-04 02:02:29 EDT (Fri, 04 Jun 2010)
@@ -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 <boost/spirit/home/phoenix/version.hpp>
+
+#endif

Added: sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor.hpp 2010-06-04 02:02:29 EDT (Fri, 04 Jun 2010)
@@ -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 <boost/proto/proto.hpp>
+
+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 <class Expr>
+ struct actor
+ {
+ BOOST_PROTO_BASIC_EXTENDS(Expr, actor<Expr>, phoenix_domain)
+ BOOST_PROTO_EXTENDS_ASSIGN()
+ BOOST_PROTO_EXTENDS_SUBSCRIPT()
+
+ template <class Sig>
+ struct result : actor_result<Sig> {};
+
+ typedef actor<Expr> actor_type;
+
+ template <class A0>
+ typename boost::result_of<actor_type(A0 const&)>::type
+ operator()(A0 const& a0) const
+ {
+ BOOST_PROTO_ASSERT_MATCHES(*this, eval_grammar);
+ fusion::vector<A0 const&> args(a0);
+ return eval(*this, args);
+ }
+
+ /*... more...*/
+ };
+}}
+
+#endif

Added: sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor_result.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor_result.hpp 2010-06-04 02:02:29 EDT (Fri, 04 Jun 2010)
@@ -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 <boost/phoenix/core/meta_grammar.hpp>
+#include <boost/fusion/container/vector.hpp>
+
+namespace boost { namespace phoenix
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // Return type computation
+ ////////////////////////////////////////////////////////////////////////////
+ template<class Sig>
+ struct actor_result;
+
+ template <template Actor, template A0>
+ struct actor_result<Actor(A0)>
+ : boost::result_of<eval_grammar(Actor&, fusion::vector<A0>&)>
+ {};
+
+ /*... more ...*/
+}}
+
+#endif

Added: sandbox/SOC/2010/phoenix3/boost/phoenix/core/domain.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/domain.hpp 2010-06-04 02:02:29 EDT (Fri, 04 Jun 2010)
@@ -0,0 +1,25 @@
+/*=============================================================================
+ 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_DOMAIN_HPP
+#define PHOENIX_CORE_DOMAIN_HPP
+
+#include <boost/proto/proto.hpp>
+
+namespace boost { namespace phoenix
+{
+ template <typename Expr>
+ struct actor;
+
+ struct phoenix_domain
+ : proto::domain<
+ proto::pod_generator<actor>,
+ proto::_, proto::default_domain>
+ {};
+}}
+
+#endif

Added: sandbox/SOC/2010/phoenix3/boost/phoenix/core/meta_grammar.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/meta_grammar.hpp 2010-06-04 02:02:29 EDT (Fri, 04 Jun 2010)
@@ -0,0 +1,82 @@
+/*=============================================================================
+ 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_META_GRAMMAR_HPP
+#define PHOENIX_CORE_META_GRAMMAR_HPP
+
+#include <boost/proto/proto.hpp>
+
+namespace boost { namespace phoenix
+{
+ ////////////////////////////////////////////////////////////////////////////
+ // Our meta-grammar and expression evaluator
+ ////////////////////////////////////////////////////////////////////////////
+ struct eval_grammar
+ : proto::switch_<struct eval_cases>
+ {};
+
+ ////////////////////////////////////////////////////////////////////////////
+ // A function object we can call
+ ////////////////////////////////////////////////////////////////////////////
+ eval_grammar const eval = eval_grammar();
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Open ended grammar dispatch allows us to extend the grammar
+ // without modifying the code
+ ////////////////////////////////////////////////////////////////////////////
+ struct eval_cases
+ {
+ template <class Tag>
+ struct case_ : proto::_default<eval_grammar> {};
+ };
+
+ ////////////////////////////////////////////////////////////////////////////
+ // A dummy terminal that, when evaluated, returns the current state.
+ ////////////////////////////////////////////////////////////////////////////
+ struct env
+ {};
+
+ ////////////////////////////////////////////////////////////////////////////
+ // wrapper for a Fusion extension evaluator function. Keep this POD.
+ ////////////////////////////////////////////////////////////////////////////
+ template <class Fun>
+ struct funcwrap
+ {
+ typedef Fun type;
+ };
+
+ // Handling for terminals, with the special case for env terminals.
+ struct func_grammar
+ : proto::or_<
+ proto::when<
+ proto::terminal<funcwrap<proto::_> >,
+ mpl::deref<proto::_value>()>
+ , proto::when<proto::terminal<env>, proto::_state>
+ , proto::_
+ >
+ {};
+
+ // Handling for function invocations. When _child0 is a
+ // funcwrap<>, don't evaluate the other child nodes. Just
+ // pass then unevaluated to the function.
+ template <>
+ struct eval_cases::case_<proto::tag::function>
+ : proto::or_<
+ proto::when<
+ proto::function<
+ proto::terminal<funcwrap<proto::_> >
+ , proto::terminal<env>
+ , proto::vararg<eval_grammar>
+ >
+ , proto::_default<func_grammar>
+ >
+ , proto::_default<eval_grammar>
+ >
+ {};
+}}
+
+#endif

Deleted: sandbox/SOC/2010/phoenix3/boost/phoenix/placeholder.txt
==============================================================================

Added: sandbox/SOC/2010/phoenix3/boost/phoenix/version.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/version.hpp 2010-06-04 02:02:29 EDT (Fri, 04 Jun 2010)
@@ -0,0 +1,18 @@
+/*=============================================================================
+ Copyright (c) 2005-2008 Hartmut Kaiser
+ Copyright (c) 2005-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_VERSION_HPP
+#define PHOENIX_VERSION_HPP
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// This is the version of the library
+//
+///////////////////////////////////////////////////////////////////////////////
+#define BOOST_PHOENIX_VERSION 0x3000 // 3.0.0
+
+#endif


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