Update of /cvsroot/boost/boost/boost/xpressive/detail/static/transforms
In directory
sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31228/detail/static/transforms
Modified Files:
transform.hpp
Added Files:
as_modifier.hpp
Log Message:
support for icase and other modifiers
--- NEW FILE: as_modifier.hpp ---
///////////////////////////////////////////////////////////////////////////////
// as_modifier.hpp
//
// 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_XPRESSIVE_DETAIL_STATIC_TRANSFORMS_AS_MODIFIER_HPP_EAN_04_05_2007
#define BOOST_XPRESSIVE_DETAIL_STATIC_TRANSFORMS_AS_MODIFIER_HPP_EAN_04_05_2007
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include <boost/mpl/sizeof.hpp>
#include <boost/xpressive/detail/detail_fwd.hpp>
#include <boost/xpressive/detail/static/static.hpp>
#include <boost/xpressive/proto/proto.hpp>
#include <boost/xpressive/proto/context.hpp>
#include <boost/xpressive/proto/transform/arg.hpp>
namespace boost { namespace xpressive { namespace detail
{
///////////////////////////////////////////////////////////////////////////////
// as_modifier
template<typename Grammar>
struct as_modifier
: Grammar
{
as_modifier();
template<typename Expr, typename State, typename Visitor>
struct apply
{
typedef typename proto::result_of::arg<typename
proto::result_of::left<Expr>::type>::type modifier_type;
typedef typename modifier_type::BOOST_NESTED_TEMPLATE
apply<Visitor>::type visitor_type;
typedef typename proto::trans::right<Grammar>::template apply<Expr,
State, visitor_type>::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)
{
typedef typename apply<Expr, State, Visitor>::visitor_type
new_visitor_type;
new_visitor_type
new_visitor(proto::arg(proto::left(expr)).call(visitor));
new_visitor.swap(visitor);
scoped_swap<Visitor, new_visitor_type> const undo = {&visitor,
&new_visitor};
detail::ignore_unused(undo);
return proto::trans::right<Grammar>::call(expr, state, new_visitor);
}
};
}}}
#endif
Index: transform.hpp
===================================================================
RCS file:
/cvsroot/boost/boost/boost/xpressive/detail/static/transforms/transform.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- transform.hpp 5 Apr 2007 23:56:25 -0000 1.5
+++ transform.hpp 6 Apr 2007 00:34:31 -0000 1.6
@@ -24,6 +24,7 @@
#include <boost/xpressive/detail/static/transforms/as_marker.hpp>
#include <boost/xpressive/detail/static/transforms/as_set.hpp>
#include <boost/xpressive/detail/static/transforms/as_independent.hpp>
+#include <boost/xpressive/detail/static/transforms/as_modifier.hpp>
#include <boost/xpressive/proto/transform/arg.hpp>
#include <boost/xpressive/proto/transform/compose.hpp>
@@ -139,6 +140,7 @@
proto::trans::reverse_fold<Sequence>
, proto::trans::compose<Composites, Grammar>
, in_sequence<Matchers>
+ , as_modifier<proto::binary_expr<modifier_tag, proto::_, Grammar> >
>
{};
-------------------------------------------------------------------------
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