Update of /cvsroot/boost/boost/libs/xpressive/proto/doc
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14377
Modified Files:
calculator.qbk extensibility.qbk preface.qbk proto.qbk
protodoc.boostbook
Log Message:
fix bug in extensibility example
Index: calculator.qbk
===================================================================
RCS file: /cvsroot/boost/boost/libs/xpressive/proto/doc/calculator.qbk,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- calculator.qbk 29 Mar 2007 22:19:39 -0000 1.6
+++ calculator.qbk 4 Apr 2007 01:28:58 -0000 1.7
@@ -200,7 +200,7 @@
double operator()(proto::tag::terminal, placeholder1) const
{
return this->d1_;
- }
+ }
double operator()(proto::tag::terminal, placeholder2) const
{
Index: extensibility.qbk
===================================================================
RCS file: /cvsroot/boost/boost/libs/xpressive/proto/doc/extensibility.qbk,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- extensibility.qbk 29 Mar 2007 22:19:39 -0000 1.3
+++ extensibility.qbk 4 Apr 2007 01:28:58 -0000 1.4
@@ -204,37 +204,30 @@
// expression, and combines the result.
template<typename Size = std::size_t>
struct lazy_subscript_context
- : proto::context< lazy_subscript_context<Size> >
{
- typedef lazy_subscript_context<Size> this_type;
-
lazy_subscript_context(Size subscript)
: subscript_(subscript)
{}
- // Use the default context for all the operations ...
- template<typename Sig>
- struct result
- : proto::context< this_type >::template result<Sig>
+ // Use default_eval for all the operations ...
+ template<typename Expr, typename Tag = typename Expr::tag_type>
+ struct eval
+ : proto::default_eval<Expr, lazy_subscript_context>
{};
// ... except for terminals, which we index with our subscript
- template<typename This, typename Vector>
- struct result<This(proto::tag::terminal, Vector &)>
+ template<typename Expr>
+ struct eval<Expr, proto::tag::terminal>
{
- typedef typename Vector::value_type type;
- };
-
- using proto::context< this_type >::operator();
+ typedef typename proto::result_of::arg<Expr>::type::value_type
result_type;
- template<typename Vector>
- typename Vector::value_type
- operator()(proto::tag::terminal, Vector &expr)
- {
- return expr[this->subscript_];
- }
+ template<typename Expr>
+ result_type operator()( Expr const & expr, lazy_subscript_context
& ctx ) const
+ {
+ return proto::arg( expr )[ ctx.subscript_ ];
+ }
+ };
- private:
Size subscript_;
};
Index: preface.qbk
===================================================================
RCS file: /cvsroot/boost/boost/libs/xpressive/proto/doc/preface.qbk,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- preface.qbk 11 Jan 2007 22:04:26 -0000 1.2
+++ preface.qbk 4 Apr 2007 01:28:58 -0000 1.3
@@ -59,4 +59,7 @@
is similar to Fusion data structures in many respects, and is interoperable
with Fusion's iterators and algorithms.
+The syntax for the pattern-matching features of `proto::matches<>` is inspired
+by MPL's lambda expressions.
+
[endsect]
Index: proto.qbk
===================================================================
RCS file: /cvsroot/boost/boost/libs/xpressive/proto/doc/proto.qbk,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- proto.qbk 28 Mar 2007 19:48:54 -0000 1.10
+++ proto.qbk 4 Apr 2007 01:28:58 -0000 1.11
@@ -66,7 +66,7 @@
[def _vararg_ [classref boost::proto::vararg `vararg<>`]]
[def _default_context_ [classref boost::proto::default_context
`default_context`]]
[def _callable_context_ [classref boost::proto::callable_context
`callable_context<>`]]
-[def _generate_ [classref boost::proto:generate `generate<>`]]
+[def _generate_ [classref boost::proto::generate `generate<>`]]
[include preface.qbk]
Index: protodoc.boostbook
===================================================================
RCS file: /cvsroot/boost/boost/libs/xpressive/proto/doc/protodoc.boostbook,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- protodoc.boostbook 29 Mar 2007 22:19:39 -0000 1.8
+++ protodoc.boostbook 4 Apr 2007 01:28:58 -0000 1.9
@@ -124,6 +124,9 @@
</template><specialization><template-arg>Expr</template-arg><template-arg>Context</template-arg><template-arg>proto::tag::mem_ptr</template-arg><template-arg>2</template-arg></specialization><typedef
name="result_type"><type><emphasis>unspecified</emphasis></type></typedef><method-group
name="public member functions"><method name="operator()"
cv="const"><type>result_type</type><parameter name="expr"><paramtype>Expr
&</paramtype></parameter><parameter name="ctx"><paramtype>Context
&</paramtype></parameter></method></method-group></struct-specialization><struct-specialization
name="default_eval"><template>
<template-type-parameter name="Expr"/>
<template-type-parameter name="Context"/>
+
</template><specialization><template-arg>Expr</template-arg><template-arg>Context</template-arg><template-arg>proto::tag::assign</template-arg><template-arg>2</template-arg></specialization><typedef
name="result_type"><type><emphasis>unspecified</emphasis></type></typedef><method-group
name="public member functions"><method name="operator()"
cv="const"><type>result_type</type><parameter name="expr"><paramtype>Expr
&</paramtype></parameter><parameter name="ctx"><paramtype>Context
&</paramtype></parameter></method></method-group></struct-specialization><struct-specialization
name="default_eval"><template>
+ <template-type-parameter name="Expr"/>
+ <template-type-parameter name="Context"/>
</template><specialization><template-arg>Expr</template-arg><template-arg>Context</template-arg><template-arg>proto::tag::left_shift_assign</template-arg><template-arg>2</template-arg></specialization><typedef
name="result_type"><type><emphasis>unspecified</emphasis></type></typedef><method-group
name="public member functions"><method name="operator()"
cv="const"><type>result_type</type><parameter name="expr"><paramtype>Expr
&</paramtype></parameter><parameter name="ctx"><paramtype>Context
&</paramtype></parameter></method></method-group></struct-specialization><struct-specialization
name="default_eval"><template>
<template-type-parameter name="Expr"/>
<template-type-parameter name="Context"/>
@@ -157,9 +160,6 @@
</template><specialization><template-arg>Expr</template-arg><template-arg>Context</template-arg><template-arg>proto::tag::terminal</template-arg><template-arg>1</template-arg></specialization><typedef
name="result_type"><type>mpl::if_< is_const < Expr >, typename
<classname>proto::result_of::arg</classname>< Expr >::const_reference,
typename <classname>proto::result_of::arg</classname>< Expr >::reference
>::<classname>type</classname></type></typedef><method-group name="public
member functions"><method name="operator()"
cv="const"><type>result_type</type><parameter name="expr"><paramtype>Expr
&</paramtype></parameter><parameter name=""><paramtype>Context
&</paramtype></parameter></method></method-group></struct-specialization><struct-specialization
name="default_eval"><template>
<template-type-parameter name="Expr"/>
<template-type-parameter name="Context"/>
-
</template><specialization><template-arg>Expr</template-arg><template-arg>Context</template-arg><template-arg>proto::tag::assign</template-arg><template-arg>2</template-arg></specialization><typedef
name="result_type"><type><emphasis>unspecified</emphasis></type></typedef><method-group
name="public member functions"><method name="operator()"
cv="const"><type>result_type</type><parameter name="expr"><paramtype>Expr
&</paramtype></parameter><parameter name="ctx"><paramtype>Context
&</paramtype></parameter></method></method-group></struct-specialization><struct-specialization
name="default_eval"><template>
- <template-type-parameter name="Expr"/>
- <template-type-parameter name="Context"/>
</template><specialization><template-arg>Expr</template-arg><template-arg>Context</template-arg><template-arg>proto::tag::post_inc</template-arg><template-arg>1</template-arg></specialization><typedef
name="result_type"><type><emphasis>unspecified</emphasis></type></typedef><method-group
name="public member functions"><method name="operator()"
cv="const"><type>result_type</type><parameter name="expr"><paramtype>Expr
&</paramtype></parameter><parameter name="ctx"><paramtype>Context
&</paramtype></parameter></method></method-group></struct-specialization><struct-specialization
name="default_eval"><template>
<template-type-parameter name="Expr"/>
<template-type-parameter name="Context"/>
@@ -717,9 +717,9 @@
<template-type-parameter name="Context"/>
</template><struct name="result"><template>
<template-type-parameter name="Expr"/>
- </template><typedef
name="type"><type><emphasis>unspecified</emphasis></type></typedef></struct><method-group
name="public member functions"><method name="operator()"
cv="const"><type><classname>result</classname>< Expr
>::<classname>type</classname></type><template>
+ </template><typedef name="type"><type>Context::template eval< typename
remove_reference< Expr >::type
>::result_type</type></typedef></struct><method-group name="public member
functions"><method name="operator()"
cv="const"><type><classname>result</classname>< Expr
>::<classname>type</classname></type><template>
<template-type-parameter name="Expr"/>
- </template><parameter name="expr"><paramtype>Expr const
&</paramtype></parameter></method></method-group><constructor><parameter
name="ctx"><paramtype>Context
&</paramtype></parameter></constructor></struct><function
name="children_of"><type><classname>children</classname>< Expr
></type><template>
+ </template><parameter name="expr"><paramtype>Expr
&</paramtype></parameter></method></method-group><constructor><parameter
name="ctx"><paramtype>Context
&</paramtype></parameter></constructor></struct><function
name="children_of"><type><classname>children</classname>< Expr
></type><template>
<template-type-parameter name="Expr"/>
</template><parameter name="expr"><paramtype>Expr
&</paramtype></parameter></function></namespace></namespace></header><header
name="boost/xpressive/proto/generate.hpp"><para>Contains definition of
generate<> class template, which end users can specialize for generating
domain-specific expression wrappers. </para><namespace name="boost"><namespace
name="proto"><struct name="generate"><template>
<template-type-parameter name="Domain"/>
@@ -1655,7 +1655,30 @@
<template-type-parameter name="Expr"/>
<template-type-parameter name="State"/>
<template-type-parameter name="Visitor"/>
- </template><parameter name="expr"><paramtype>Expr const
&</paramtype></parameter><parameter name=""><paramtype>State const
&</paramtype></parameter><parameter name="visitor"><paramtype>Visitor
&</paramtype></parameter></method></method-group></struct></namespace></namespace></namespace></header><header
name="boost/xpressive/proto/transform/construct.hpp"><para>For constructing an
arbitrary type from a bunch of transforms. This assumes that all the grammars
corresponding to the transforms are equivalent; that is, that they match the
same expressions. </para><namespace name="boost"><namespace
name="proto"><namespace name="transform"><struct-specialization
name="construct"><template>
+ </template><parameter name="expr"><paramtype>Expr const
&</paramtype></parameter><parameter name=""><paramtype>State const
&</paramtype></parameter><parameter name="visitor"><paramtype>Visitor
&</paramtype></parameter></method></method-group></struct></namespace></namespace></namespace></header><header
name="boost/xpressive/proto/transform/compose.hpp"><para>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.
</para><namespace name="boost"><namespace name="proto"><namespace
name="transform"><struct name="compose"><template>
+ <template-type-parameter name="Grammar1"/>
+ <template-type-parameter name="Grammar2"/>
+ </template><struct name="apply"><template>
+ <template-type-parameter name="Expr"/>
+ <template-type-parameter name="State"/>
+ <template-type-parameter name="Visitor"/>
+ </template><typedef name="type"><type>Grammar2::template
<classname>apply</classname>< typename Grammar1::template
<classname>apply</classname>< Expr, State, Visitor >::type, State,
Visitor >::type</type></typedef></struct><method-group name="public member
functions"/><constructor/><method-group name="public static functions"><method
name="call" cv=""><type>static <classname>apply</classname>< Expr, State,
Visitor >::<classname>type</classname></type><template>
+ <template-type-parameter name="Expr"/>
+ <template-type-parameter name="State"/>
+ <template-type-parameter name="Visitor"/>
+ </template><parameter name="expr"><paramtype>Expr const
&</paramtype></parameter><parameter name="state"><paramtype>State const
&</paramtype></parameter><parameter name="visitor"><paramtype>Visitor
&</paramtype></parameter></method></method-group></struct></namespace></namespace></namespace></header><header
name="boost/xpressive/proto/transform/conditional.hpp"><para>A special-purpose
proto transform for selecting between two transforms based on a compile-time
predicate. </para><namespace name="boost"><namespace name="proto"><namespace
name="transform"><struct name="conditional"><template>
+ <template-type-parameter name="Predicate"/>
+ <template-type-parameter name="Grammar0"/>
+ <template-type-parameter name="Grammar1"/>
+ </template><struct name="apply"><template>
+ <template-type-parameter name="Expr"/>
+ <template-type-parameter name="State"/>
+ <template-type-parameter name="Visitor"/>
+ </template><typedef name="grammar_type"><type>mpl::if_< typename
mpl::apply1< Predicate, Expr >::type, Grammar0, Grammar1
>::type</type></typedef><typedef name="type"><type>grammar_type::template
<classname>apply</classname>< Expr, State, Visitor
>::type</type></typedef></struct><method-group name="public member
functions"/><constructor/><method-group name="public static functions"><method
name="call" cv=""><type>static <classname>apply</classname>< Expr, State,
Visitor >::<classname>type</classname></type><template>
+ <template-type-parameter name="Expr"/>
+ <template-type-parameter name="State"/>
+ <template-type-parameter name="Visitor"/>
+ </template><parameter name="expr"><paramtype>Expr const
&</paramtype></parameter><parameter name="state"><paramtype>State const
&</paramtype></parameter><parameter name="visitor"><paramtype>Visitor
&</paramtype></parameter></method></method-group><data-member
name="mpl_assertion_in_line_28" specifiers="static"><type>const
std::size_t</type></data-member></struct></namespace></namespace></namespace></header><header
name="boost/xpressive/proto/transform/construct.hpp"><para>For constructing an
arbitrary type from a bunch of transforms. This assumes that all the grammars
corresponding to the transforms are equivalent; that is, that they match the
same expressions. </para><namespace name="boost"><namespace
name="proto"><namespace name="transform"><struct-specialization
name="construct"><template>
<template-type-parameter name="Type"/>
<template-type-parameter name="Grammar0"/>
</template><specialization><template-arg>Type</template-arg><template-arg>Grammar0</template-arg><template-arg>void</template-arg><template-arg>void</template-arg><template-arg>void</template-arg><template-arg>void</template-arg><template-arg>void</template-arg></specialization><struct-specialization
name="construct"><template>
-------------------------------------------------------------------------
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