Boost logo

Boost-Commit :

From: eric_at_[hidden]
Date: 2007-12-09 20:12:14


Author: eric_niebler
Date: 2007-12-09 20:12:14 EST (Sun, 09 Dec 2007)
New Revision: 41946
URL: http://svn.boost.org/trac/boost/changeset/41946

Log:
simple grammar clean-up
Text files modified:
   branches/proto/v3/boost/xpressive/detail/static/grammar.hpp | 52 ++++++++++-----------------------------
   1 files changed, 14 insertions(+), 38 deletions(-)

Modified: branches/proto/v3/boost/xpressive/detail/static/grammar.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/detail/static/grammar.hpp (original)
+++ branches/proto/v3/boost/xpressive/detail/static/grammar.hpp 2007-12-09 20:12:14 EST (Sun, 09 Dec 2007)
@@ -299,37 +299,13 @@
 
         // Place a head and a tail in sequence, if it's not
         // already in sequence.
- struct in_sequence : transform_base
- {
- template<typename Sig>
- struct result;
-
- template<typename This, typename Matcher, typename Next>
- struct result<This(Matcher, Next)>
- {
- typedef static_xpression<UNCVREF(Matcher), UNCVREF(Next)> type;
- };
-
- template<typename This, typename Matcher, typename Next, typename Next2>
- struct result<This(static_xpression<Matcher, Next>, Next2)>
- {
- typedef static_xpression<Matcher, Next> type;
- };
-
- template<typename Matcher, typename Next>
- static_xpression<Matcher, Next>
- operator()(Matcher const &matcher, Next const &next) const
- {
- return static_xpression<Matcher, Next>(matcher, next);
- }
-
- template<typename Matcher, typename Next, typename Next2>
- static_xpression<Matcher, Next>
- operator()(static_xpression<Matcher, Next> const &xpr, Next2 const &) const
- {
- return xpr;
- }
- };
+ struct in_sequence
+ : if_<
+ is_static_xpression<_>()
+ , _
+ , static_xpression<_, _state>(_, _state)
+ >
+ {};
 
         ///////////////////////////////////////////////////////////////////////////
         // CharLiteral
@@ -596,7 +572,7 @@
         struct add_attrs
           : call<
                 _make_shift_right(
- attr_begin_matcher<MaxAttr(_, _zero(), int())>()
+ attr_begin_matcher<MaxAttr>()
                   , _make_shift_right(
                         _
                       , attr_end_matcher()
@@ -608,7 +584,7 @@
         ///////////////////////////////////////////////////////////////////////////////
         // add_attrs_if
         struct add_attrs_if
- : if_<MaxAttr(_, _zero(), int()), add_attrs, _>
+ : if_<MaxAttr, add_attrs, _>
         {};
 
         ///////////////////////////////////////////////////////////////////////////////
@@ -632,14 +608,14 @@
                             or_<
                                 when<
                                     subscript<_, CheckAssertion>
- , predicate_matcher<DeepCopy(_right, _left, int())>(
- DeepCopy(_right, _left, int())
+ , predicate_matcher<DeepCopy(_right, _left)>(
+ DeepCopy(_right, _left)
                                       , mark_number(_arg(_left(_left)))
                                     )
>
                               , otherwise<
- action_matcher<DeepCopy(_right, _left, int())>(
- DeepCopy(_right, _left, int())
+ action_matcher<DeepCopy(_right, _left)>(
+ DeepCopy(_right, _left)
                                       , mark_number(_arg(_left(_left)))
                                     )
>
@@ -807,7 +783,7 @@
               : when<
                     // _ >> 'a'
                     shift_right<Gram, Gram>
- , reverse_fold_tree<_, _state, in_sequence(as_regex, _state)>
+ , reverse_fold_tree<_, _state, in_sequence(as_regex)>
>
             {};
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk