1 ///////////////////////////////////////////////////////////////////////////////
4 // Copyright 2004 Eric Niebler. Distributed under the Boost
5 // Software License, Version 1.0. (See accompanying file
6 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 #ifndef BOOST_XPRESSIVE_DETAIL_STATIC_PLACEHOLDERS_HPP_EAN_10_04_2005
9 #define BOOST_XPRESSIVE_DETAIL_STATIC_PLACEHOLDERS_HPP_EAN_10_04_2005
11 // MS compatible compilers support #pragma once
12 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
17 #include <boost/shared_ptr.hpp>
18 #include <boost/xpressive/detail/core/quant_style.hpp>
19 #include <boost/xpressive/detail/core/regex_impl.hpp>
21 namespace boost
{ namespace xpressive
{ namespace detail
24 ///////////////////////////////////////////////////////////////////////////////
25 // literal_placeholder
27 template<typename Char
, bool Not
>
28 struct literal_placeholder
29 : quant_style_fixed_width
<1>
31 typedef mpl::bool_
<Not
> not_type
;
34 literal_placeholder(Char ch
)
40 ///////////////////////////////////////////////////////////////////////////////
43 template<typename Char
>
44 struct string_placeholder
45 : quant_style_fixed_unknown_width
47 std::basic_string
<Char
> str_
;
49 string_placeholder(std::basic_string
<Char
> const &str
)
55 ///////////////////////////////////////////////////////////////////////////////
58 struct mark_placeholder
59 : quant_style_fixed_unknown_width
63 mark_placeholder(int mark_number
)
64 : mark_number_(mark_number
)
69 ///////////////////////////////////////////////////////////////////////////////
72 template<typename BidiIter
, bool ByRef
>
73 struct regex_placeholder
74 : quant_style
<quant_variable_width
, unknown_width
, mpl::false_
>
76 shared_ptr
<regex_impl
<BidiIter
> > impl_
;
78 regex_placeholder(shared_ptr
<regex_impl
<BidiIter
> > const &impl
)
84 ///////////////////////////////////////////////////////////////////////////////
85 // posix_charset_placeholder
87 struct posix_charset_placeholder
88 : quant_style_fixed_width
<1>
93 posix_charset_placeholder(char const *name
)
100 ///////////////////////////////////////////////////////////////////////////////
101 // assert_word_placeholder
103 template<typename Cond
>
104 struct assert_word_placeholder
105 : quant_style_assertion
109 ///////////////////////////////////////////////////////////////////////////////
112 template<typename Char
>
113 struct range_placeholder
114 : quant_style_fixed_width
<1>
120 range_placeholder(Char ch_min
, Char ch_max
)
128 ///////////////////////////////////////////////////////////////////////////////
129 // assert_bol_placeholder
131 struct assert_bol_placeholder
132 : quant_style_assertion
136 ///////////////////////////////////////////////////////////////////////////////
137 // assert_eol_placeholder
139 struct assert_eol_placeholder
140 : quant_style_assertion
144 ///////////////////////////////////////////////////////////////////////////////
145 // logical_newline_placeholder
147 struct logical_newline_placeholder
148 : quant_style_variable_width
152 ///////////////////////////////////////////////////////////////////////////////
155 struct self_placeholder
156 : quant_style
<quant_variable_width
, unknown_width
, mpl::false_
>
160 }}} // namespace boost::xpressive::detail