Update of /cvsroot/boost/boost/boost/xpressive/proto2
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25284/proto2
Modified Files:
Tag: PROTO2
arg_traits.hpp fusion.hpp op_base.hpp op_tags.hpp
operators.hpp proto.hpp proto_fwd.hpp proto_typeof.hpp
Log Message:
various renamings
Index: arg_traits.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto2/Attic/arg_traits.hpp,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- arg_traits.hpp 28 Oct 2006 04:31:35 -0000 1.1.2.1
+++ arg_traits.hpp 28 Oct 2006 18:53:43 -0000 1.1.2.2
@@ -29,39 +29,34 @@
{};
template<typename Tag, typename Args, long Arity>
- struct is_op<basic_op<Tag, Args, Arity> >
+ struct is_op<basic_expr<Tag, Args, Arity> >
: mpl::true_
{};
- template<typename Op>
- struct is_op<ref<Op> >
+ template<typename Expr>
+ struct is_op<ref<Expr> >
: mpl::true_
{};
#define BOOST_PROTO2_ARG(z, n, data)\
- typedef typename Op::BOOST_PP_CAT(BOOST_PP_CAT(arg, n), _type)
BOOST_PP_CAT(BOOST_PP_CAT(arg, n), _type);
+ typedef typename Expr::BOOST_PP_CAT(BOOST_PP_CAT(arg, n), _type)
BOOST_PP_CAT(BOOST_PP_CAT(arg, n), _type);
- template<typename Op>
+ template<typename Expr>
struct ref
{
- typedef Op op_type;
- typedef typename Op::tag_type tag_type;
- typedef typename Op::args_type args_type;
- typedef typename Op::arity arity;
+ typedef Expr expr_type;
+ typedef typename Expr::tag_type tag_type;
+ typedef typename Expr::args_type args_type;
+ typedef typename Expr::arity arity;
BOOST_PP_REPEAT(BOOST_PROTO2_MAX_ARITY, BOOST_PROTO2_ARG, _)
- Op const &cast() const
+ Expr const &cast() const
{
- return this->op;
+ return this->expr;
}
- //operator Op const &() const
- //{
- // return this->op;
- //}
-
- Op const &op;
+ Expr const &expr;
};
#undef BOOST_PROTO2_ARG
@@ -78,42 +73,61 @@
typedef T type;
};
- template<typename T, bool IsOp>
- struct as_op_type
- {
- typedef basic_op<noop_tag, mpl::vector1<typename
call_traits<T>::value_type> > type;
- };
-
- template<typename T>
- struct as_op_type<T, true>
+ namespace meta
{
- typedef ref<T> type;
- };
+ template<typename T, bool IsOp>
+ struct as_expr
+ {
+ typedef basic_expr<terminal_tag, mpl::vector1<typename
call_traits<T>::value_type> > type;
+ };
- template<typename T>
- struct as_op_type<ref<T>, true>
- {
- typedef ref<T> type;
- };
+ template<typename T>
+ struct as_expr<T, true>
+ {
+ typedef ref<T> type;
+ };
- template<typename T>
- typename as_op_type<T>::type as_op(T const &t)
- {
- typename as_op_type<T>::type that = {t};
- return that;
+ template<typename T>
+ struct as_expr<ref<T>, true>
+ {
+ typedef ref<T> type;
+ };
}
- template<typename T>
- ref<T> const &as_op(ref<T> const &t)
+ namespace op
{
- return t;
+ struct as_expr
+ {
+ template<typename Sig>
+ struct result;
+
+ template<typename This, typename T>
+ struct result<This(T)>
+ : meta::as_expr<typename meta::value_type<T>::type>
+ {};
+
+ template<typename T>
+ typename meta::as_expr<T>::type operator()(T const &t) const
+ {
+ typename meta::as_expr<T>::type that = {t};
+ return that;
+ }
+
+ template<typename T>
+ ref<T> const &operator()(ref<T> const &t) const
+ {
+ return t;
+ }
+ };
}
+ op::as_expr const as_expr = {};
+
template<typename T>
struct literal
{
typedef typename call_traits<T>::value_type value_type;
- typedef basic_op<noop_tag, mpl::vector1<value_type> > type;
+ typedef basic_expr<terminal_tag, mpl::vector1<value_type> > type;
};
template<typename T>
@@ -124,129 +138,111 @@
}
template<typename Tag, typename T>
- struct unary_op
+ struct unary_expr
{
- typedef basic_op<Tag, mpl::vector1<T> > type;
+ typedef basic_expr<Tag, mpl::vector1<T> > type;
};
template<typename Tag, typename T, typename U>
- struct binary_op
+ struct binary_expr
{
- typedef basic_op<Tag, mpl::vector2<T, U> > type;
+ typedef basic_expr<Tag, mpl::vector2<T, U> > type;
};
- template<typename Op>
+ template<typename Expr>
struct tag_type
{
- typedef typename Op::tag_type type;
+ typedef typename Expr::tag_type type;
};
- template<typename Op>
+ template<typename Expr>
struct arg_type
{
- BOOST_STATIC_ASSERT(1 == Op::arity::value);
- typedef typename Op::arg0_type type;
+ BOOST_STATIC_ASSERT(1 == Expr::arity::value);
+ typedef typename Expr::arg0_type type;
};
- template<typename Op>
+ template<typename Expr>
struct left_type
{
- BOOST_STATIC_ASSERT(2 == Op::arity::value);
- typedef typename Op::arg0_type type;
+ BOOST_STATIC_ASSERT(2 == Expr::arity::value);
+ typedef typename Expr::arg0_type type;
};
- template<typename Op>
+ template<typename Expr>
struct right_type
{
- BOOST_STATIC_ASSERT(2 == Op::arity::value);
- typedef typename Op::arg1_type type;
+ BOOST_STATIC_ASSERT(2 == Expr::arity::value);
+ typedef typename Expr::arg1_type type;
};
- template<typename Op>
- inline typename Op::arg0_type const &arg(Op const &op)
+ template<typename Expr>
+ inline typename Expr::arg0_type const &arg(Expr const &expr)
{
- return op.cast().arg0;
+ return expr.cast().arg0;
}
- template<typename Op>
- inline typename Op::arg0_type const &left(Op const &op)
+ template<typename Expr>
+ inline typename Expr::arg0_type const &left(Expr const &expr)
{
- return op.cast().arg0;
+ return expr.cast().arg0;
}
- template<typename Op>
- inline typename Op::arg1_type const &right(Op const &op)
+ template<typename Expr>
+ inline typename Expr::arg1_type const &right(Expr const &expr)
{
- return op.cast().arg1;
+ return expr.cast().arg1;
}
-
/////////////////////////////////////////////////////////////////////////////////
- //// noop
- //template<typename Arg>
- //basic_op<noop_tag, mpl::vector1<Arg> > const
- //noop(Arg const &arg)
- //{
- // basic_op<noop_tag, mpl::vector1<Arg> > that = {arg};
- // return that;
- //}
-
- //template<typename Arg>
- //basic_op<noop_tag, mpl::vector1<ref<Arg> > > const
- //noop(reference_wrapper<Arg> const &arg)
- //{
- // basic_op<noop_tag, mpl::vector1<ref<Arg> > > that = {{arg.get()}};
- // return that;
- //}
-
///////////////////////////////////////////////////////////////////////////////
- // make_op (unary)
+ // make_expr (unary)
template<typename Tag, typename Arg>
- basic_op<Tag, mpl::vector1<Arg> > const
- make_op(Arg const &arg)
+ basic_expr<Tag, mpl::vector1<Arg> > const
+ make_expr(Arg const &arg)
{
- basic_op<Tag, mpl::vector1<Arg> > that = {arg};
+ basic_expr<Tag, mpl::vector1<Arg> > that = {arg};
return that;
}
template<typename Tag, typename Arg>
- basic_op<Tag, mpl::vector1<ref<Arg> > > const
- make_op(reference_wrapper<Arg> const &arg)
+ basic_expr<Tag, mpl::vector1<ref<Arg> > > const
+ make_expr(reference_wrapper<Arg> const &arg)
{
- basic_op<Tag, mpl::vector1<ref<Arg> > > that = {{arg.get()}};
+ basic_expr<Tag, mpl::vector1<ref<Arg> > > that = {{arg.get()}};
return that;
}
///////////////////////////////////////////////////////////////////////////////
- // make_op (binary)
+ // make_expr (binary)
template<typename Tag, typename Left, typename Right>
- basic_op<Tag, mpl::vector2<Left, Right> > const
- make_op(Left const &left, Right const &right)
+ basic_expr<Tag, mpl::vector2<Left, Right> > const
+ make_expr(Left const &left, Right const &right)
{
- basic_op<Tag, mpl::vector2<Left, Right> > that = {left, right};
+ basic_expr<Tag, mpl::vector2<Left, Right> > that = {left, right};
return that;
}
template<typename Tag, typename Left, typename Right>
- basic_op<Tag, mpl::vector2<ref<Left>, Right> > const
- make_op(reference_wrapper<Left> const &left, Right const &right)
+ basic_expr<Tag, mpl::vector2<ref<Left>, Right> > const
+ make_expr(reference_wrapper<Left> const &left, Right const &right)
{
- basic_op<Tag, mpl::vector2<ref<Left>, Right> > that = {{left.get()},
right};
+ basic_expr<Tag, mpl::vector2<ref<Left>, Right> > that = {{left.get()},
right};
return that;
}
template<typename Tag, typename Left, typename Right>
- basic_op<Tag, mpl::vector2<Left, ref<Right> > > const
- make_op(Left const &left, reference_wrapper<Right> const &right)
+ basic_expr<Tag, mpl::vector2<Left, ref<Right> > > const
+ make_expr(Left const &left, reference_wrapper<Right> const &right)
{
- basic_op<Tag, mpl::vector2<Left, ref<Right> > > that = {left,
{right.get()}};
+ basic_expr<Tag, mpl::vector2<Left, ref<Right> > > that = {left,
{right.get()}};
return that;
}
template<typename Tag, typename Left, typename Right>
- basic_op<Tag, mpl::vector2<ref<Left>, ref<Right> > > const
- make_op(reference_wrapper<Left> const &left, reference_wrapper<Right>
const &right)
+ basic_expr<Tag, mpl::vector2<ref<Left>, ref<Right> > > const
+ make_expr(reference_wrapper<Left> const &left, reference_wrapper<Right>
const &right)
{
- basic_op<Tag, mpl::vector2<ref<Left>, ref<Right> > > that =
{{left.get()}, {right.get()}};
+ basic_expr<Tag, mpl::vector2<ref<Left>, ref<Right> > > that =
{{left.get()}, {right.get()}};
return that;
}
}}
Index: fusion.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto2/Attic/fusion.hpp,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- fusion.hpp 28 Oct 2006 04:31:35 -0000 1.1.2.1
+++ fusion.hpp 28 Oct 2006 18:53:43 -0000 1.1.2.2
@@ -98,24 +98,24 @@
//// struct expand_left_tag
//// {};
////
-//// template<typename OpTag, typename Node, typename State = fusion::nil>
+//// template<typename OpTag, typename Expr, typename State = fusion::nil>
//// struct expand_left_view
-//// : compile_result<Node, State, mpl::void_, expand_left_tag<OpTag> >
+//// : meta::compile<Expr, State, mpl::void_, expand_left_tag<OpTag> >
//// {};
////
-//// template<typename OpTag, typename Node, typename State>
-//// typename expand_left_view<OpTag, Node, State>::type
-//// expand_left(Node const &node, State const &state)
+//// template<typename OpTag, typename Expr, typename State>
+//// typename expand_left_view<OpTag, Expr, State>::type
+//// expand_left(Expr const &expr, State const &state)
//// {
//// mpl::void_ null;
-//// return compile(node, state, null, expand_left_tag<OpTag>());
+//// return compile(expr, state, null, expand_left_tag<OpTag>());
//// }
////
-//// template<typename OpTag, typename Node>
-//// typename expand_left_view<OpTag, Node>::type
-//// expand_left(Node const &node)
+//// template<typename OpTag, typename Expr>
+//// typename expand_left_view<OpTag, Expr>::type
+//// expand_left(Expr const &expr)
//// {
-//// return expand_left<OpTag>(node, fusion::nil());
+//// return expand_left<OpTag>(expr, fusion::nil());
//// }
////
//// struct binary_tree_iterator_tag;
@@ -151,23 +151,23 @@
//// template<typename DomainTag>
//// struct expand_left_compiler
//// {
-//// template<typename Node, typename State, typename Visitor>
+//// template<typename Expr, typename State, typename Visitor>
//// struct apply
-//// : compile_result<
-//// typename left_type<Node>::type
-//// , fusion::cons<Node const &, State>
+//// : meta::compile<
+//// typename left_type<Expr>::type
+//// , fusion::cons<Expr const &, State>
//// , Visitor
//// , DomainTag
//// >
//// {};
////
-//// template<typename Node, typename State, typename Visitor>
-//// static typename apply<Node, State, Visitor>::type
-//// call(Node const &node, State const &state, Visitor &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 proto2::compile(
-//// proto2::left(node)
-//// , fusion::cons<Node const &, State>(node, state)
+//// proto2::left(expr)
+//// , fusion::cons<Expr const &, State>(expr, state)
//// , visitor
//// , DomainTag()
//// );
@@ -176,17 +176,17 @@
////
//// struct cons_ref_compiler
//// {
-//// template<typename Node, typename State, typename Visitor>
+//// template<typename Expr, typename State, typename Visitor>
//// struct apply
//// {
-//// typedef fusion::cons<Node const &, State> type;
+//// typedef fusion::cons<Expr const &, State> type;
//// };
////
-//// template<typename Node, typename State, typename Visitor>
-//// static fusion::cons<Node const &, State>
-//// call(Node const &node, State const &state, Visitor &)
+//// template<typename Expr, typename State, typename Visitor>
+//// static fusion::cons<Expr const &, State>
+//// call(Expr const &expr, State const &state, Visitor &)
//// {
-//// return fusion::cons<Node const &, State>(node, state);
+//// return fusion::cons<Expr const &, State>(expr, state);
//// }
//// };
////
@@ -196,9 +196,9 @@
//// typedef typename tag_type<Sequence>::type tag_type;
//// typedef binary_tree_iterator<typename
expand_left_view<tag_type, Sequence>::type> type;
////
-//// static type call(Sequence const &node)
+//// static type call(Sequence const &expr)
//// {
-//// return type(expand_left<tag_type>(node));
+//// return type(expand_left<tag_type>(expr));
//// }
//// };
////
Index: op_base.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto2/Attic/op_base.hpp,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- op_base.hpp 28 Oct 2006 04:31:35 -0000 1.1.2.1
+++ op_base.hpp 28 Oct 2006 18:53:43 -0000 1.1.2.2
@@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////
/// /file op_base.hpp
-/// Contains definitions of unary_op/</>, binary_op/</> and nary_op/</>,
-/// as well as the is_op/</> and the make_op() helper function.
+/// Contains definitions of unary_expr/</>, binary_expr/</> and nary_op/</>,
+/// as well as the is_op/</> and the make_expr() helper function.
//
// Copyright 2004 Eric Niebler. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
@@ -45,7 +45,7 @@
/**/
#define BOOST_PROTO2_AS_OP(z, n, data)\
- proto2::as_op(BOOST_PP_CAT(a,n))\
+ proto2::as_expr(BOOST_PP_CAT(a,n))\
/**/
#define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PROTO2_MAX_ARITY,
<boost/xpressive/proto2/op_base.hpp>))
@@ -60,9 +60,9 @@
#elif BOOST_PP_ITERATION_DEPTH() == 1
template<typename Tag, typename Args>
- struct basic_op<Tag, Args, BOOST_PP_ITERATION()>
+ struct basic_expr<Tag, Args, BOOST_PP_ITERATION()>
{
- typedef basic_op op_type;
+ typedef basic_expr expr_type;
typedef Tag tag_type;
typedef Args args_type;
typedef mpl::long_<BOOST_PP_ITERATION()> arity;
@@ -70,31 +70,31 @@
BOOST_PP_REPEAT(BOOST_PP_ITERATION(), BOOST_PROTO2_ARG, _)
BOOST_PP_REPEAT_FROM_TO(BOOST_PP_ITERATION(),
BOOST_PROTO2_MAX_ARITY, BOOST_PROTO2_VOID, _)
- basic_op const &cast() const
+ basic_expr const &cast() const
{
return *this;
}
template<typename A>
- basic_op<assign_tag, mpl::vector2<ref<basic_op>, typename
as_op_type<A>::type> > const
+ basic_expr<assign_tag, mpl::vector2<ref<basic_expr>, typename
meta::as_expr<A>::type> > const
operator =(A const &a) const
{
- basic_op<assign_tag, mpl::vector2<ref<basic_op>, typename
as_op_type<A>::type> > that = {{*this}, proto2::as_op(a)};
+ basic_expr<assign_tag, mpl::vector2<ref<basic_expr>, typename
meta::as_expr<A>::type> > that = {{*this}, proto2::as_expr(a)};
return that;
}
template<typename A>
- basic_op<subscript_tag, mpl::vector2<ref<basic_op>, typename
as_op_type<A>::type> > const
+ basic_expr<subscript_tag, mpl::vector2<ref<basic_expr>, typename
meta::as_expr<A>::type> > const
operator [](A const &a) const
{
- basic_op<subscript_tag, mpl::vector2<ref<basic_op>, typename
as_op_type<A>::type> > that = {{*this}, proto2::as_op(a)};
+ basic_expr<subscript_tag, mpl::vector2<ref<basic_expr>,
typename meta::as_expr<A>::type> > that = {{*this}, proto2::as_expr(a)};
return that;
}
- basic_op<function_tag, mpl::vector1<ref<basic_op> > > const
+ basic_expr<function_tag, mpl::vector1<ref<basic_expr> > > const
operator ()() const
{
- basic_op<function_tag, mpl::vector1<ref<basic_op> > > that =
{{*this}};
+ basic_expr<function_tag, mpl::vector1<ref<basic_expr> > > that
= {{*this}};
return that;
}
@@ -106,10 +106,10 @@
#define N BOOST_PP_ITERATION()
template<BOOST_PP_ENUM_PARAMS(N, typename A)>
- basic_op<function_tag, BOOST_PP_CAT(mpl::vector,
BOOST_PP_INC(N))<ref<basic_op> BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(N, typename
as_op_type<A, >::type BOOST_PP_INTERCEPT)> > const
+ basic_expr<function_tag, BOOST_PP_CAT(mpl::vector,
BOOST_PP_INC(N))<ref<basic_expr> BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(N,
typename meta::as_expr<A, >::type BOOST_PP_INTERCEPT)> > const
operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const &a)) const
{
- basic_op<function_tag, BOOST_PP_CAT(mpl::vector,
BOOST_PP_INC(N))<ref<basic_op> BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(N, typename
as_op_type<A, >::type BOOST_PP_INTERCEPT)> > that = {{*this}
BOOST_PP_ENUM_TRAILING(N, BOOST_PROTO2_AS_OP, _)};
+ basic_expr<function_tag, BOOST_PP_CAT(mpl::vector,
BOOST_PP_INC(N))<ref<basic_expr> BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(N,
typename meta::as_expr<A, >::type BOOST_PP_INTERCEPT)> > that = {{*this}
BOOST_PP_ENUM_TRAILING(N, BOOST_PROTO2_AS_OP, _)};
return that;
}
#undef N
Index: op_tags.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto2/Attic/op_tags.hpp,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- op_tags.hpp 28 Oct 2006 04:31:35 -0000 1.1.2.1
+++ op_tags.hpp 28 Oct 2006 18:53:43 -0000 1.1.2.2
@@ -23,7 +23,7 @@
struct binary_tag {};
struct nary_tag {}; // for operator()
- struct noop_tag : unary_tag {};
+ struct terminal_tag : unary_tag {};
struct unary_plus_tag : unary_tag {};
struct unary_minus_tag : unary_tag {};
struct unary_star_tag : unary_tag {};
Index: operators.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto2/Attic/operators.hpp,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- operators.hpp 28 Oct 2006 04:31:35 -0000 1.1.2.1
+++ operators.hpp 28 Oct 2006 18:53:43 -0000 1.1.2.2
@@ -19,36 +19,36 @@
namespace boost { namespace proto2
{
-#define BOOST_PROTO2_UNARY_OP(op, tag)\
+#define BOOST_PROTO2_UNARY_OP(expr, tag)\
template<typename Tag, typename Args, long Arity>\
- inline basic_op<tag, mpl::vector1<ref<basic_op<Tag, Args, Arity> > > >
const\
- operator op(basic_op<Tag, Args, Arity> const &arg)\
+ inline basic_expr<tag, mpl::vector1<ref<basic_expr<Tag, Args, Arity> > > >
const\
+ operator expr(basic_expr<Tag, Args, Arity> const &arg)\
{\
- basic_op<tag, mpl::vector1<ref<basic_op<Tag, Args, Arity> > > > that =
{{arg}};\
+ basic_expr<tag, mpl::vector1<ref<basic_expr<Tag, Args, Arity> > > >
that = {{arg}};\
return that;\
}\
/**/
-#define BOOST_PROTO2_BINARY_OP(op, tag)\
+#define BOOST_PROTO2_BINARY_OP(expr, tag)\
template<typename LTag, typename LArgs, long LArity, typename Right>\
- inline basic_op<tag, mpl::vector2<ref<basic_op<LTag, LArgs, LArity> >,
typename literal<Right>::type> > const\
- operator op(basic_op<LTag, LArgs, LArity> const &left, Right const &right)\
+ inline basic_expr<tag, mpl::vector2<ref<basic_expr<LTag, LArgs, LArity> >,
typename literal<Right>::type> > const\
+ operator expr(basic_expr<LTag, LArgs, LArity> const &left, Right const
&right)\
{\
- basic_op<tag, mpl::vector2<ref<basic_op<LTag, LArgs, LArity> >,
typename literal<Right>::type> > that = {{left}, proto2::lit(right)};\
+ basic_expr<tag, mpl::vector2<ref<basic_expr<LTag, LArgs, LArity> >,
typename literal<Right>::type> > that = {{left}, proto2::lit(right)};\
return that;\
}\
template<typename Left, typename RTag, typename RArgs, long RArity>\
- inline basic_op<tag, mpl::vector2<typename literal<Left>::type,
ref<basic_op<RTag, RArgs, RArity> > > > const\
- operator op(Left const &left, basic_op<RTag, RArgs, RArity> const &right)\
+ inline basic_expr<tag, mpl::vector2<typename literal<Left>::type,
ref<basic_expr<RTag, RArgs, RArity> > > > const\
+ operator expr(Left const &left, basic_expr<RTag, RArgs, RArity> const
&right)\
{\
- basic_op<tag, mpl::vector2<typename literal<Left>::type,
ref<basic_op<RTag, RArgs, RArity> > > > that = {proto2::lit(left), {right}};\
+ basic_expr<tag, mpl::vector2<typename literal<Left>::type,
ref<basic_expr<RTag, RArgs, RArity> > > > that = {proto2::lit(left), {right}};\
return that;\
}\
template<typename LTag, typename LArgs, long LArity, typename RTag,
typename RArgs, long RArity>\
- inline basic_op<tag, mpl::vector2<ref<basic_op<LTag, LArgs, LArity> >,
ref<basic_op<RTag, RArgs, RArity> > > > const\
- operator op(basic_op<LTag, LArgs, LArity> const &left, basic_op<RTag,
RArgs, RArity> const &right)\
+ inline basic_expr<tag, mpl::vector2<ref<basic_expr<LTag, LArgs, LArity> >,
ref<basic_expr<RTag, RArgs, RArity> > > > const\
+ operator expr(basic_expr<LTag, LArgs, LArity> const &left,
basic_expr<RTag, RArgs, RArity> const &right)\
{\
- basic_op<tag, mpl::vector2<ref<basic_op<LTag, LArgs, LArity> >,
ref<basic_op<RTag, RArgs, RArity> > > > that = {{left}, {right}};\
+ basic_expr<tag, mpl::vector2<ref<basic_expr<LTag, LArgs, LArity> >,
ref<basic_expr<RTag, RArgs, RArity> > > > that = {{left}, {right}};\
return that;\
}\
/**/
@@ -95,18 +95,18 @@
BOOST_PROTO2_BINARY_OP(^=, bitxor_assign_tag)
template<typename Tag, typename Args, long Arity>
- inline basic_op<post_inc_tag, mpl::vector1<ref<basic_op<Tag, Args, Arity>
> > > const
- operator ++(basic_op<Tag, Args, Arity> const &arg, int)
+ inline basic_expr<post_inc_tag, mpl::vector1<ref<basic_expr<Tag, Args,
Arity> > > > const
+ operator ++(basic_expr<Tag, Args, Arity> const &arg, int)
{
- basic_op<post_inc_tag, mpl::vector1<ref<basic_op<Tag, Args, Arity> > >
> that = {{arg}};
+ basic_expr<post_inc_tag, mpl::vector1<ref<basic_expr<Tag, Args, Arity>
> > > that = {{arg}};
return that;
}
template<typename Tag, typename Args, long Arity>
- inline basic_op<post_dec_tag, mpl::vector1<ref<basic_op<Tag, Args, Arity>
> > > const
- operator --(basic_op<Tag, Args, Arity> const &arg, int)
+ inline basic_expr<post_dec_tag, mpl::vector1<ref<basic_expr<Tag, Args,
Arity> > > > const
+ operator --(basic_expr<Tag, Args, Arity> const &arg, int)
{
- basic_op<post_dec_tag, mpl::vector1<ref<basic_op<Tag, Args, Arity> > >
> that = {{arg}};
+ basic_expr<post_dec_tag, mpl::vector1<ref<basic_expr<Tag, Args, Arity>
> > > that = {{arg}};
return that;
}
Index: proto.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto2/Attic/proto.hpp,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- proto.hpp 28 Oct 2006 04:31:35 -0000 1.1.2.1
+++ proto.hpp 28 Oct 2006 18:53:43 -0000 1.1.2.2
@@ -17,27 +17,47 @@
namespace boost { namespace proto2
{
-
///////////////////////////////////////////////////////////////////////////////
- // compile_result
- template<typename Node, typename State, typename Visitor, typename
DomainTag>
- struct compile_result
+ namespace meta
{
- typedef typename as_op_type<Node>::type op_type;
- typedef compiler<typename tag_type<op_type>::type, DomainTag> compiler;
- typedef typename compiler::BOOST_NESTED_TEMPLATE apply<op_type, State,
Visitor>::type type;
- };
+ template<typename Expr, typename State, typename Visitor, typename
DomainTag>
+ struct compile
+ {
+ typedef typename meta::as_expr<Expr>::type expr_type;
+ typedef compiler<typename tag_type<expr_type>::type, DomainTag>
compiler;
+ typedef typename compiler::BOOST_NESTED_TEMPLATE apply<expr_type,
State, Visitor>::type type;
+ };
+ }
-
///////////////////////////////////////////////////////////////////////////////
- // compile
- template<typename Node, typename State, typename Visitor, typename
DomainTag>
- typename compile_result<Node, State, Visitor, DomainTag>::type const
- compile(Node const &node, State const &state, Visitor &visitor, DomainTag)
+ namespace op
{
- typedef typename as_op_type<Node>::type op_type;
- typedef compiler<typename tag_type<op_type>::type, DomainTag> compiler;
- return compiler::call(proto2::as_op(node), state, visitor);
+ struct compile
+ {
+ template<typename Sig>
+ struct result;
+
+ template<typename This, typename Expr, typename State, typename
Visitor, typename DomainTag>
+ struct result<This(Expr, State, Visitor, DomainTag)>
+ : meta::compile<
+ typename meta::value_type<Expr>::type
+ , typename meta::value_type<State>::type
+ , typename meta::value_type<Visitor>::type
+ , typename meta::value_type<DomainTag>::type
+ >
+ {};
+
+ template<typename Expr, typename State, typename Visitor, typename
DomainTag>
+ typename meta::compile<Expr, State, Visitor, DomainTag>::type
+ operator()(Expr const &expr, State const &state, Visitor &visitor,
DomainTag) const
+ {
+ typedef typename meta::as_expr<Expr>::type expr_type;
+ typedef compiler<typename tag_type<expr_type>::type,
DomainTag> compiler;
+ return compiler::call(proto2::as_expr(expr), state, visitor);
+ }
+ };
}
+ op::compile const compile = {};
+
}} // namespace boost::proto2
#endif
Index: proto_fwd.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto2/Attic/proto_fwd.hpp,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- proto_fwd.hpp 28 Oct 2006 04:31:35 -0000 1.1.2.1
+++ proto_fwd.hpp 28 Oct 2006 18:53:43 -0000 1.1.2.2
@@ -11,6 +11,8 @@
#include <boost/version.hpp>
#include <boost/mpl/size.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/type_traits/remove_reference.hpp>
#include <boost/mpl/vector/vector10.hpp>
#ifndef BOOST_PROTO2_MAX_ARITY
@@ -25,7 +27,7 @@
struct binary_tag;
struct nary_tag;
- struct noop_tag;
+ struct terminal_tag;
struct unary_plus_tag;
struct unary_minus_tag;
struct unary_star_tag;
@@ -74,36 +76,33 @@
struct function_tag;
template<typename Tag, typename Args, long Arity = mpl::size<Args>::value>
- struct basic_op;
+ struct basic_expr;
- template<typename Op>
+ template<typename Expr>
struct ref;
template<typename Tag, typename Arg>
- struct unary_op;
+ struct unary_expr;
template<typename Tag, typename Left, typename Right>
- struct binary_op;
+ struct binary_expr;
template<typename T>
struct is_op;
- template<typename T, bool IsOp = is_op<T>::value>
- struct as_op_type;
-
- template<typename Node>
+ template<typename Expr>
struct literal;
- template<typename Node>
+ template<typename Expr>
struct arg_type;
- template<typename Node>
+ template<typename Expr>
struct left_type;
- template<typename Node>
+ template<typename Expr>
struct right_type;
- template<typename Node>
+ template<typename Expr>
struct tag_type;
template<typename OpTag, typename DomainTag, typename EnableIf = void>
@@ -149,12 +148,30 @@
template<typename Predicate, typename IfTransform, typename ElseTransform
= identity_transform>
struct conditional_transform;
- template<typename Node, typename State, typename Visitor, typename
DomainTag>
- struct compile_result;
+ namespace meta
+ {
+ template<typename T>
+ struct value_type
+ {
+ typedef typename remove_cv<typename
remove_reference<T>::type>::type type;
+ };
- template<typename Node, typename State, typename Visitor, typename
DomainTag>
- typename compile_result<Node, State, Visitor, DomainTag>::type const
- compile(Node const &node, State const &state, Visitor &visitor, DomainTag
tag_type);
+ template<typename T, bool IsOp = is_op<T>::value>
+ struct as_expr;
+
+ template<typename Expr, typename State, typename Visitor, typename
DomainTag>
+ struct compile;
+ }
+
+ namespace op
+ {
+ struct compile;
+
+ struct as_expr;
+ }
+
+ extern op::compile const compile;
+ extern op::as_expr const as_expr;
}} // namespace boost::proto2
Index: proto_typeof.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto2/Attic/proto_typeof.hpp,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- proto_typeof.hpp 28 Oct 2006 04:31:35 -0000 1.1.2.1
+++ proto_typeof.hpp 28 Oct 2006 18:53:43 -0000 1.1.2.2
@@ -24,7 +24,7 @@
//BOOST_TYPEOF_REGISTER_TYPE(boost::proto2::unary_tag)
//BOOST_TYPEOF_REGISTER_TYPE(boost::proto2::binary_tag)
//BOOST_TYPEOF_REGISTER_TYPE(boost::proto2::nary_tag)
-//BOOST_TYPEOF_REGISTER_TYPE(boost::proto2::noop_tag)
+//BOOST_TYPEOF_REGISTER_TYPE(boost::proto2::terminal_tag)
//BOOST_TYPEOF_REGISTER_TYPE(boost::proto2::unary_plus_tag)
//BOOST_TYPEOF_REGISTER_TYPE(boost::proto2::unary_minus_tag)
//BOOST_TYPEOF_REGISTER_TYPE(boost::proto2::unary_star_tag)
@@ -69,7 +69,7 @@
//BOOST_TYPEOF_REGISTER_TYPE(boost::proto2::subscript_tag)
//BOOST_TYPEOF_REGISTER_TYPE(boost::proto2::function_tag)
//
-//BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto2::unary_op, (typename)(typename))
-//BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto2::binary_op,
(typename)(typename)(typename))
+//BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto2::unary_expr,
(typename)(typename))
+//BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto2::binary_expr,
(typename)(typename)(typename))
//
//#endif
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
|