Update of /cvsroot/boost/boost/boost/xpressive/proto/transform
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28092/proto/transform

Added Files:
        compose.hpp 
Log Message:
transform::compose

--- NEW FILE: compose.hpp ---
///////////////////////////////////////////////////////////////////////////////
/// \file compose.hpp
/// A special-purpose proto transform for composing two transfomations. Given
/// two Grammars, expressions that match the first grammar are transformed
/// according to that grammar, and the result is forwarded to the second
/// for further transformation.
//
//  Copyright 2004 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 BOOST_PROTO_TRANSFORM_COMPOSE_HPP_EAN_04_01_2007
#define BOOST_PROTO_TRANSFORM_COMPOSE_HPP_EAN_04_01_2007

#include <boost/xpressive/proto/detail/prefix.hpp>
#include <boost/xpressive/proto/proto_fwd.hpp>
#include <boost/xpressive/proto/detail/suffix.hpp>

namespace boost { namespace proto { namespace transform
{

    // Composes two transforms
    template<typename Grammar1, typename Grammar2>
    struct compose
      : Grammar1
    {
        compose();

        template<typename Expr, typename State, typename Visitor>
        struct apply
        {
            typedef typename Grammar2::template apply<
                typename Grammar1::template apply<Expr, State, Visitor>::type
              , State
              , Visitor
            >::type type;
        };

        template<typename Expr, typename State, typename Visitor>
        static typename apply<Expr, State, Visitor>::type
        call(Expr const &expr, State const &state, Visitor &visitor)
        {
            return Grammar2::call(Grammar1::call(expr, state, visitor), state, 
visitor);
        }
    };

}}}

#endif


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to