1 ///////////////////////////////////////////////////////////////////////////////
2 /// \file xpressive_fwd.hpp
3 /// Forward declarations for all of xpressive's public data types.
5 // Copyright 2008 Eric Niebler. Distributed under the Boost
6 // Software License, Version 1.0. (See accompanying file
7 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 #ifndef BOOST_XPRESSIVE_XPRESSIVE_FWD_HPP_EAN_10_04_2005
10 #define BOOST_XPRESSIVE_XPRESSIVE_FWD_HPP_EAN_10_04_2005
12 // MS compatible compilers support #pragma once
18 #include <boost/config.hpp>
19 #include <boost/version.hpp>
20 #include <boost/iterator/iterator_traits.hpp>
22 #if BOOST_VERSION >= 103500
23 # define BOOST_PROTO_FUSION_V2
27 #if defined(BOOST_NO_STD_LOCALE) & !defined(BOOST_XPRESSIVE_USE_C_TRAITS)
28 # define BOOST_XPRESSIVE_USE_C_TRAITS
31 #if defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_CWCTYPE) || defined(BOOST_NO_STD_WSTRING)
32 # ifndef BOOST_XPRESSIVE_NO_WREGEX
33 # define BOOST_XPRESSIVE_NO_WREGEX
37 // Stack protection under MS Windows
38 // Config logic taken from boost/regex/config.hpp
39 #ifndef BOOST_XPRESSIVE_HAS_MS_STACK_GUARD
40 # if (defined(_WIN32) || defined(_WIN64) || defined(_WINCE)) \
41 && !(defined(__GNUC__) || defined(__BORLANDC__) && defined(__clang__)) \
42 && !(defined(BOOST_BORLANDC) && (BOOST_BORLANDC >= 0x600)) \
43 && !(defined(__MWERKS__) && (__MWERKS__ <= 0x3003))
44 # define BOOST_XPRESSIVE_HAS_MS_STACK_GUARD 1
46 # define BOOST_XPRESSIVE_HAS_MS_STACK_GUARD 0
50 #include <boost/proto/proto_fwd.hpp>
52 namespace boost { namespace xpressive
55 template<typename Char>
56 struct cpp_regex_traits;
58 template<typename Char>
59 struct c_regex_traits;
61 template<typename Elem>
62 struct null_regex_traits;
66 template<typename Char>
67 struct default_regex_traits
69 #ifdef BOOST_XPRESSIVE_USE_C_TRAITS
70 typedef c_regex_traits<Char> type;
72 typedef cpp_regex_traits<Char> type;
76 struct mark_placeholder;
77 typedef proto::expr<proto::tag::terminal, proto::term<mark_placeholder>, 0> basic_mark_tag;
85 typedef void const *regex_id_type;
89 struct regex_traits_version_1_tag;
91 struct regex_traits_version_2_tag;
96 struct regex_traits_version_1_case_fold_tag;
98 template<typename Trait>
101 template<typename BidiIter>
104 template<typename BidiIter>
105 struct match_results;
107 template<typename BidiIter>
108 struct regex_iterator;
110 template<typename BidiIter>
111 struct regex_token_iterator;
113 template<typename BidiIter>
114 struct regex_id_filter_predicate;
116 template<typename BidiIter>
119 template<typename RegexTraits>
120 struct compiler_traits;
122 template<typename Char, typename Impl = typename detail::default_regex_traits<Char>::type>
128 , typename RegexTraits = regex_traits<typename iterator_value<BidiIter>::type>
129 , typename CompilerTraits = compiler_traits<RegexTraits>
131 struct regex_compiler;
142 template<typename T, int I = 0, typename Dummy = proto::is_proto_expr>
169 struct dynamic_cast_;
174 template<typename Except>
176 struct unwrap_reference;
179 ///////////////////////////////////////////////////////////////////////////////
182 typedef basic_regex<std::string::const_iterator> sregex;
183 typedef basic_regex<char const *> cregex;
185 #ifndef BOOST_XPRESSIVE_NO_WREGEX
186 typedef basic_regex<std::wstring::const_iterator> wsregex;
187 typedef basic_regex<wchar_t const *> wcregex;
190 typedef sub_match<std::string::const_iterator> ssub_match;
191 typedef sub_match<char const *> csub_match;
193 #ifndef BOOST_XPRESSIVE_NO_WREGEX
194 typedef sub_match<std::wstring::const_iterator> wssub_match;
195 typedef sub_match<wchar_t const *> wcsub_match;
198 typedef regex_compiler<std::string::const_iterator> sregex_compiler;
199 typedef regex_compiler<char const *> cregex_compiler;
201 #ifndef BOOST_XPRESSIVE_NO_WREGEX
202 typedef regex_compiler<std::wstring::const_iterator> wsregex_compiler;
203 typedef regex_compiler<wchar_t const *> wcregex_compiler;
206 typedef regex_iterator<std::string::const_iterator> sregex_iterator;
207 typedef regex_iterator<char const *> cregex_iterator;
209 #ifndef BOOST_XPRESSIVE_NO_WREGEX
210 typedef regex_iterator<std::wstring::const_iterator> wsregex_iterator;
211 typedef regex_iterator<wchar_t const *> wcregex_iterator;
214 typedef regex_token_iterator<std::string::const_iterator> sregex_token_iterator;
215 typedef regex_token_iterator<char const *> cregex_token_iterator;
217 #ifndef BOOST_XPRESSIVE_NO_WREGEX
218 typedef regex_token_iterator<std::wstring::const_iterator> wsregex_token_iterator;
219 typedef regex_token_iterator<wchar_t const *> wcregex_token_iterator;
222 typedef match_results<std::string::const_iterator> smatch;
223 typedef match_results<char const *> cmatch;
225 #ifndef BOOST_XPRESSIVE_NO_WREGEX
226 typedef match_results<std::wstring::const_iterator> wsmatch;
227 typedef match_results<wchar_t const *> wcmatch;
230 typedef regex_id_filter_predicate<std::string::const_iterator> sregex_id_filter_predicate;
231 typedef regex_id_filter_predicate<char const *> cregex_id_filter_predicate;
233 #ifndef BOOST_XPRESSIVE_NO_WREGEX
234 typedef regex_id_filter_predicate<std::wstring::const_iterator> wsregex_id_filter_predicate;
235 typedef regex_id_filter_predicate<wchar_t const *> wcregex_id_filter_predicate;
238 }} // namespace boost::xpressive