1 ///////////////////////////////////////////////////////////////////////////////
2 // placeholders.hpp
3 //
4 //  Copyright 2008 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)
7 
8 #ifndef BOOST_XPRESSIVE_DETAIL_STATIC_PLACEHOLDERS_HPP_EAN_10_04_2005
9 #define BOOST_XPRESSIVE_DETAIL_STATIC_PLACEHOLDERS_HPP_EAN_10_04_2005
10 
11 // MS compatible compilers support #pragma once
12 #if defined(_MSC_VER)
13 # pragma once
14 # pragma warning(push)
15 # pragma warning(disable:4510) // default constructor could not be generated
16 # pragma warning(disable:4610) // can never be instantiated - user defined constructor required
17 #endif
18 
19 #include <string>
20 #include <boost/shared_ptr.hpp>
21 #include <boost/xpressive/detail/core/quant_style.hpp>
22 #include <boost/xpressive/detail/core/regex_impl.hpp>
23 
24 namespace boost { namespace xpressive { namespace detail
25 {
26 
27 ///////////////////////////////////////////////////////////////////////////////
28 // mark_placeholder
29 //
30 struct mark_placeholder
31 {
32     BOOST_XPR_QUANT_STYLE(quant_variable_width, unknown_width::value, true)
33 
34     int mark_number_;
35 };
36 
37 ///////////////////////////////////////////////////////////////////////////////
38 // posix_charset_placeholder
39 //
40 struct posix_charset_placeholder
41 {
42     BOOST_XPR_QUANT_STYLE(quant_fixed_width, 1, true)
43 
44     char const *name_;
45     bool not_;
46 };
47 
48 ///////////////////////////////////////////////////////////////////////////////
49 // assert_word_placeholder
50 //
51 template<typename Cond>
52 struct assert_word_placeholder
53 {
54     BOOST_XPR_QUANT_STYLE(quant_none, 0, true)
55 };
56 
57 ///////////////////////////////////////////////////////////////////////////////
58 // range_placeholder
59 //
60 template<typename Char>
61 struct range_placeholder
62 {
63     BOOST_XPR_QUANT_STYLE(quant_fixed_width, 1, true)
64 
65     Char ch_min_;
66     Char ch_max_;
67     bool not_;
68 };
69 
70 ///////////////////////////////////////////////////////////////////////////////
71 // assert_bol_placeholder
72 //
73 struct assert_bol_placeholder
74 {
75     BOOST_XPR_QUANT_STYLE(quant_none, 0, true)
76 };
77 
78 ///////////////////////////////////////////////////////////////////////////////
79 // assert_eol_placeholder
80 //
81 struct assert_eol_placeholder
82 {
83     BOOST_XPR_QUANT_STYLE(quant_none, 0, true)
84 };
85 
86 ///////////////////////////////////////////////////////////////////////////////
87 // logical_newline_placeholder
88 //
89 struct logical_newline_placeholder
90 {
91     BOOST_XPR_QUANT_STYLE(quant_variable_width, unknown_width::value, true)
92 };
93 
94 ///////////////////////////////////////////////////////////////////////////////
95 // self_placeholder
96 //
97 struct self_placeholder
98 {
99     BOOST_XPR_QUANT_STYLE(quant_variable_width, unknown_width::value, false)
100 };
101 
102 ///////////////////////////////////////////////////////////////////////////////
103 // attribute_placeholder
104 //
105 template<typename Nbr>
106 struct attribute_placeholder
107 {
108     BOOST_XPR_QUANT_STYLE(quant_variable_width, unknown_width::value, false)
109 
110     typedef Nbr nbr_type;
nbrboost::xpressive::detail::attribute_placeholder111     static Nbr nbr() { return Nbr(); }
112 };
113 
114 }}} // namespace boost::xpressive::detail
115 
116 #if defined(_MSC_VER)
117 # pragma warning(pop)
118 #endif
119 
120 #endif
121