Update of /cvsroot/boost/boost/boost/xpressive/detail/static/productions
In directory
sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20098/detail/static/productions
Modified Files:
marker_transform.hpp productions.hpp quant_transforms.hpp
Log Message:
experimental xpressive actions
Index: marker_transform.hpp
===================================================================
RCS file:
/cvsroot/boost/boost/boost/xpressive/detail/static/productions/marker_transform.hpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- marker_transform.hpp 3 Feb 2007 00:14:33 -0000 1.16
+++ marker_transform.hpp 22 Mar 2007 17:37:16 -0000 1.17
@@ -95,6 +95,18 @@
}
};
+
///////////////////////////////////////////////////////////////////////////////
+ // marker_transform
+ struct marker_transform
+ : proto::conditional_transform
+ <
+ is_marker_predicate
+ , marker_replace_transform
+ , marker_insert_transform
+ >
+ {
+ };
+
}}}
#endif
Index: productions.hpp
===================================================================
RCS file:
/cvsroot/boost/boost/boost/xpressive/detail/static/productions/productions.hpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- productions.hpp 3 Feb 2007 00:14:33 -0000 1.13
+++ productions.hpp 22 Mar 2007 17:37:16 -0000 1.14
@@ -42,25 +42,48 @@
};
///////////////////////////////////////////////////////////////////////////////
- //
+ // action_transform
+ // turn A[B] into (mark_begin(n) >> A >> mark_end(n) >>
action_matcher<B>(n))
struct action_transform
{
- template<typename Expr, typename, typename>
+ template<typename Expr, typename State, typename Visitor>
struct apply
{
+ typedef typename proto::result_of::left<Expr>::type expr_type;
+ typedef typename proto::result_of::right<Expr>::type action_type;
+
+ typedef typename marker_transform::
+ template apply<expr_type, State, Visitor>::type
+ marked_expr_type;
+
typedef typename proto::right_shift
<
- typename Expr::arg0_type
- , typename Expr::arg1_type
+ marked_expr_type
+ , typename proto::terminal<action_matcher<action_type> >::type
>::type type;
};
template<typename Expr, typename State, typename Visitor>
static typename apply<Expr, State, Visitor>::type
- call(Expr const &expr, State const &, Visitor &)
+ call(Expr const &expr, State const &state, Visitor &visitor)
{
- typename apply<Expr, State, Visitor>::type that =
- {expr.cast().arg0, expr.cast().arg1};
+ typedef apply<Expr, State, Visitor> apply_type;
+ typedef typename apply_type::action_type action_type;
+
+ typename apply_type::marked_expr_type marked_expr =
+ marker_transform::call(proto::left(expr), state, visitor);
+
+ typename apply_type::type that =
+ {
+ marked_expr
+ , {
+ action_matcher<action_type>
+ (
+ proto::right(expr)
+ , proto::arg(proto::left(marked_expr)).mark_number_
+ )
+ }
+ };
return that;
}
};
Index: quant_transforms.hpp
===================================================================
RCS file:
/cvsroot/boost/boost/boost/xpressive/detail/static/productions/quant_transforms.hpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- quant_transforms.hpp 3 Feb 2007 00:14:33 -0000 1.16
+++ quant_transforms.hpp 22 Mar 2007 17:37:16 -0000 1.17
@@ -164,12 +164,7 @@
struct repeater_transform
: proto::compose_transforms
<
- proto::conditional_transform
- <
- is_marker_predicate
- , marker_replace_transform
- , marker_insert_transform
- >
+ marker_transform
, repeater_insert_transform<Greedy, Min, Max>
>
{
-------------------------------------------------------------------------
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