Update of /cvsroot/boost/boost/boost/xpressive/proto
In directory
sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28762/boost/xpressive/proto
Modified Files:
matches.hpp proto_fwd.hpp
Log Message:
add proto::not_ and proto::switch_, clean up xpressive's use_simple_repeat
Index: matches.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/matches.hpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- matches.hpp 12 Mar 2007 22:11:30 -0000 1.38
+++ matches.hpp 6 Apr 2007 21:03:09 -0000 1.39
@@ -26,6 +26,7 @@
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
#include <boost/config.hpp>
#include <boost/mpl/or.hpp>
+ #include <boost/mpl/not.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/aux_/template_arity.hpp>
@@ -229,6 +230,18 @@
: mpl::apply1<Pred, Expr>::type
{};
+ // handle proto::not_
+ template<typename Expr, typename Grammar>
+ struct matches_impl<Expr, not_<Grammar> >
+ : mpl::not_<matches_impl<Expr, typename Grammar::type> >
+ {};
+
+ // handle proto::switch_
+ template<typename Expr, typename Cases>
+ struct matches_impl<Expr, switch_<Cases> >
+ : matches_impl<Expr, typename Cases::template case_<Expr>::type>
+ {};
+
}
template<typename Expr, typename Grammar>
@@ -278,6 +291,24 @@
}
};
+ template<typename Cases>
+ struct switch_
+ {
+ typedef switch_ type;
+
+ template<typename Expr, typename State, typename Visitor>
+ struct apply
+ : Cases::template case_<Expr>::template apply<Expr, State,
Visitor>
+ {};
+
+ template<typename Expr, typename State, typename Visitor>
+ static typename apply<Expr, State, Visitor>::type
+ call(Expr const &expr, State const &state, Visitor &visitor)
+ {
+ return Cases::template case_<Expr>::call(expr, state, visitor);
+ }
+ };
+
struct _ : has_identity_transform
{
typedef _ type;
@@ -289,6 +320,12 @@
typedef if_ type;
};
+ template<typename Pred>
+ struct not_ : has_identity_transform
+ {
+ typedef not_ type;
+ };
+
template<typename Grammar>
struct vararg
: Grammar
Index: proto_fwd.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/proto_fwd.hpp,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- proto_fwd.hpp 26 Mar 2007 20:28:54 -0000 1.57
+++ proto_fwd.hpp 6 Apr 2007 21:03:09 -0000 1.58
@@ -230,6 +230,12 @@
template<typename Pred>
struct if_;
+ template<typename Cases>
+ struct switch_;
+
+ template<typename Grammar>
+ struct not_;
+
template<typename Expr, typename Grammar, typename Return = void>
struct if_matches;
-------------------------------------------------------------------------
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