Update of /cvsroot/boost/boost/boost/xpressive/detail/static
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9395/detail/static
Modified Files:
compile.hpp grammar.hpp modifier.hpp
Log Message:
relatively complete but unoptimized version of XpressiveGrammar
Index: compile.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/detail/static/compile.hpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- compile.hpp 30 Oct 2006 06:39:38 -0000 1.7
+++ compile.hpp 15 Nov 2006 06:35:30 -0000 1.8
@@ -50,9 +50,20 @@
}
///////////////////////////////////////////////////////////////////////////////
+ // pattern for imbued regexes.
+ struct XpressiveLocaleModifier
+ : proto::meta::binary_expr<
+ modifier_tag
+ , proto::meta::terminal<locale_modifier<mpl::_> >
+ , mpl::_
+ >
+ {};
+
+
///////////////////////////////////////////////////////////////////////////////
// static_compile_impl1
template<typename Xpr, typename BidiIter>
- void static_compile_impl1(Xpr const &xpr, shared_ptr<regex_impl<BidiIter>
> const &impl, mpl::false_)
+ typename proto::if_not_matches<Xpr, XpressiveLocaleModifier>::type
+ static_compile_impl1(Xpr const &xpr, shared_ptr<regex_impl<BidiIter> >
const &impl)
{
// use default traits
typedef typename iterator_value<BidiIter>::type char_type;
@@ -64,35 +75,21 @@
///////////////////////////////////////////////////////////////////////////////
// static_compile_impl1
template<typename Xpr, typename BidiIter>
- void static_compile_impl1(Xpr const &xpr, shared_ptr<regex_impl<BidiIter>
> const &impl, mpl::true_)
+ typename proto::if_matches<Xpr, XpressiveLocaleModifier>::type
+ static_compile_impl1(Xpr const &xpr, shared_ptr<regex_impl<BidiIter> >
const &impl)
{
// use specified traits
- typedef typename Xpr::arg0_type::locale_type locale_type;
+ typedef typename proto::meta::arg<typename
proto::meta::left<Xpr>::type>::type::locale_type locale_type;
typedef typename regex_traits_type<locale_type, BidiIter>::type
traits_type;
- static_compile_impl2(proto::right(xpr), impl,
traits_type(proto::left(xpr).getloc()));
+ static_compile_impl2(proto::right(xpr), impl,
traits_type(proto::arg(proto::left(xpr)).getloc()));
}
- template<typename T>
- struct is_locale_modifier
- : mpl::false_
- {};
-
- template<typename Locale>
- struct is_locale_modifier<locale_modifier<Locale> >
- : mpl::true_
- {};
-
///////////////////////////////////////////////////////////////////////////////
// static_compile
template<typename Xpr, typename BidiIter>
void static_compile(Xpr const &xpr, shared_ptr<regex_impl<BidiIter> >
const &impl)
{
- typedef mpl::and_<
- is_same<modifier_tag, typename Xpr::tag_type>
- , is_locale_modifier<typename proto::meta::unref<typename
Xpr::arg0_type>::type>
- > is_imbued;
-
- static_compile_impl1(xpr, impl, is_imbued());
+ static_compile_impl1(xpr, impl);
}
}}} // namespace boost::xpressive::detail
Index: grammar.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/detail/static/grammar.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- grammar.hpp 13 Nov 2006 15:53:45 -0000 1.1
+++ grammar.hpp 15 Nov 2006 06:35:30 -0000 1.2
@@ -52,7 +52,7 @@
struct XpressiveSet
: proto::or_<
- proto::meta::subscript<detail::set_initializer_type, mpl::_>
+ proto::meta::subscript<detail::set_initializer_type,
XpressiveGrammar >
, XpressiveListSet
>
{};
@@ -65,45 +65,81 @@
{};
struct XpressiveTaggedSubExpression
- : proto::meta::assign<detail::basic_mark_tag, mpl::_>
+ : proto::meta::assign< detail::basic_mark_tag, XpressiveGrammar >
{};
- struct XpressiveLiterals
+ struct XpressiveLiteral
: proto::or_<
proto::meta::terminal<std::basic_string<mpl::_, mpl::_, mpl::_> >
+ , proto::meta::terminal<detail::string_placeholder<mpl::_> >
+ , proto::meta::terminal<detail::literal_placeholder<mpl::_, mpl::_> >
, proto::and_<
proto::meta::terminal<mpl::_>
, proto::or_<
- proto::if_<is_integral<proto::meta::arg<mpl::_> > >
- , proto::if_<is_pointer<proto::meta::arg<mpl::_> > >
+ proto::if_<is_integral<proto::meta::arg<mpl::_> > > //
character literal
+ , proto::if_<is_pointer<proto::meta::arg<mpl::_> > > //
ntbs literal
>
>
+ // complemented character literals, as: ~_n or ~as_xpr('a')
+ , proto::and_<
+ proto::meta::complement<proto::meta::terminal<mpl::_> >
+ ,
proto::if_<is_integral<proto::meta::arg<proto::meta::arg<mpl::_> > > >
+ >
+ >
+ {};
+
+ struct XpressiveLookAroundAssertion
+ : proto::or_<
+ proto::meta::unary_expr<detail::lookahead_tag<true>,
XpressiveGrammar >
+ , proto::meta::unary_expr<detail::lookbehind_tag<true>,
XpressiveGrammar >
+ >
+ {};
+
+ struct XpressiveComplementedLookAroundAssertion
+ : proto::or_<
+ proto::meta::complement< XpressiveLookAroundAssertion >
+ , XpressiveLookAroundAssertion
>
{};
+ struct XpressiveIndependentSubExpression
+ : proto::meta::unary_expr<detail::keeper_tag, XpressiveGrammar >
+ {};
+
+ struct XpressiveModifiedSubExpression
+ : proto::meta::binary_expr<detail::modifier_tag, mpl::_,
XpressiveGrammar>
+ {};
+
struct XpressiveTerminal
: proto::or_<
- proto::meta::terminal<detail::epsilon_matcher>
- , proto::meta::terminal<detail::posix_charset_placeholder>
+ proto::meta::terminal<detail::posix_charset_placeholder>
+ ,
proto::meta::complement<proto::meta::terminal<detail::posix_charset_placeholder>
>
, proto::meta::terminal<detail::assert_bos_matcher>
, proto::meta::terminal<detail::assert_eos_matcher>
, proto::or_<
- proto::meta::terminal<detail::assert_bol_placeholder>
+ proto::meta::terminal<detail::epsilon_matcher>
+ , proto::meta::terminal<detail::assert_bol_placeholder>
, proto::meta::terminal<detail::assert_eol_placeholder>
, proto::meta::terminal<detail::assert_word_placeholder<mpl::_> >
- , proto::meta::terminal<detail::literal_placeholder<mpl::_,
mpl::_> >
, proto::or_<
proto::meta::terminal<detail::logical_newline_placeholder>
+ ,
proto::meta::complement<proto::meta::terminal<detail::logical_newline_placeholder>
>
, proto::meta::terminal<detail::any_matcher>
, proto::meta::terminal<detail::self_placeholder>
- , proto::meta::terminal<detail::mark_placeholder>
, proto::or_<
-
proto::meta::terminal<detail::range_placeholder<mpl::_> >
+ proto::meta::terminal<detail::mark_placeholder>
+ ,
proto::meta::terminal<detail::range_placeholder<mpl::_> >
,
proto::meta::terminal<detail::regex_placeholder<mpl::_, mpl::_> >
+ , proto::meta::terminal<xpressive::basic_regex<mpl::_> >
, proto::or_<
- XpressiveLiterals
+ XpressiveLiteral
, XpressiveComplementedSet
, XpressiveTaggedSubExpression
+ , XpressiveComplementedLookAroundAssertion
+ , proto::or_<
+ XpressiveModifiedSubExpression
+ , XpressiveIndependentSubExpression
+ >
>
>
>
Index: modifier.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/detail/static/modifier.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- modifier.hpp 29 Oct 2006 06:14:41 -0000 1.5
+++ modifier.hpp 15 Nov 2006 06:35:30 -0000 1.6
@@ -35,7 +35,7 @@
{
typedef typename proto::meta::binary_expr<
modifier_tag
- , Modifier
+ , typename proto::meta::terminal<Modifier>::type
, typename as_xpr_type<Xpr>::type
>::type type;
};
@@ -44,7 +44,7 @@
typename apply<Xpr>::type const
operator ()(Xpr const &xpr) const
{
- typename apply<Xpr>::type that = {this->mod_, as_xpr(xpr)};
+ typename apply<Xpr>::type that = {{this->mod_}, as_xpr(xpr)};
return that;
}
-------------------------------------------------------------------------
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