xpressive_fwd.hpp 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. ///////////////////////////////////////////////////////////////////////////////
  2. /// \file xpressive_fwd.hpp
  3. /// Forward declarations for all of xpressive's public data types.
  4. //
  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)
  8. #ifndef BOOST_XPRESSIVE_XPRESSIVE_FWD_HPP_EAN_10_04_2005
  9. #define BOOST_XPRESSIVE_XPRESSIVE_FWD_HPP_EAN_10_04_2005
  10. // MS compatible compilers support #pragma once
  11. #if defined(_MSC_VER)
  12. # pragma once
  13. #endif
  14. #include <string>
  15. #include <boost/config.hpp>
  16. #include <boost/version.hpp>
  17. #include <boost/iterator/iterator_traits.hpp>
  18. #if BOOST_VERSION >= 103500
  19. # define BOOST_PROTO_FUSION_V2
  20. #endif
  21. #if defined(BOOST_NO_STD_LOCALE) & !defined(BOOST_XPRESSIVE_USE_C_TRAITS)
  22. # define BOOST_XPRESSIVE_USE_C_TRAITS
  23. #endif
  24. #if defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_CWCTYPE) || defined(BOOST_NO_STD_WSTRING)
  25. # ifndef BOOST_XPRESSIVE_NO_WREGEX
  26. # define BOOST_XPRESSIVE_NO_WREGEX
  27. # endif
  28. #endif
  29. // Stack protection under MS Windows
  30. // Config logic taken from boost/regex/config.hpp
  31. #ifndef BOOST_XPRESSIVE_HAS_MS_STACK_GUARD
  32. # if (defined(_WIN32) || defined(_WIN64) || defined(_WINCE)) \
  33. && !defined(__GNUC__) \
  34. && !(defined(__BORLANDC__) && (__BORLANDC__ >= 0x600)) \
  35. && !(defined(__MWERKS__) && (__MWERKS__ <= 0x3003))
  36. # define BOOST_XPRESSIVE_HAS_MS_STACK_GUARD 1
  37. # else
  38. # define BOOST_XPRESSIVE_HAS_MS_STACK_GUARD 0
  39. # endif
  40. #endif
  41. #include <boost/proto/proto_fwd.hpp>
  42. namespace boost { namespace xpressive
  43. {
  44. template<typename Char>
  45. struct cpp_regex_traits;
  46. template<typename Char>
  47. struct c_regex_traits;
  48. template<typename Elem>
  49. struct null_regex_traits;
  50. namespace detail
  51. {
  52. template<typename Char>
  53. struct default_regex_traits
  54. {
  55. #ifdef BOOST_XPRESSIVE_USE_C_TRAITS
  56. typedef c_regex_traits<Char> type;
  57. #else
  58. typedef cpp_regex_traits<Char> type;
  59. #endif
  60. };
  61. struct mark_placeholder;
  62. typedef proto::expr<proto::tag::terminal, proto::term<mark_placeholder>, 0> basic_mark_tag;
  63. struct regex_domain;
  64. } // namespace detail
  65. struct mark_tag;
  66. typedef void const *regex_id_type;
  67. struct regex_error;
  68. struct regex_traits_version_1_tag;
  69. struct regex_traits_version_2_tag;
  70. // DEPRECATED
  71. /// INTERNAL ONLY
  72. ///
  73. struct regex_traits_version_1_case_fold_tag;
  74. template<typename Trait>
  75. struct has_fold_case;
  76. template<typename BidiIter>
  77. struct basic_regex;
  78. template<typename BidiIter>
  79. struct match_results;
  80. template<typename BidiIter>
  81. struct regex_iterator;
  82. template<typename BidiIter>
  83. struct regex_token_iterator;
  84. template<typename BidiIter>
  85. struct regex_id_filter_predicate;
  86. template<typename BidiIter>
  87. struct sub_match;
  88. template<typename RegexTraits>
  89. struct compiler_traits;
  90. template<typename Char, typename Impl = typename detail::default_regex_traits<Char>::type>
  91. struct regex_traits;
  92. template
  93. <
  94. typename BidiIter
  95. , typename RegexTraits = regex_traits<typename iterator_value<BidiIter>::type>
  96. , typename CompilerTraits = compiler_traits<RegexTraits>
  97. >
  98. struct regex_compiler;
  99. template<typename T>
  100. struct value;
  101. template<typename T>
  102. struct reference;
  103. template<typename T>
  104. struct local;
  105. template<typename T, int I = 0, typename Dummy = proto::is_proto_expr>
  106. struct placeholder;
  107. namespace op
  108. {
  109. struct at;
  110. struct push;
  111. struct push_back;
  112. struct push_front;
  113. struct pop;
  114. struct pop_back;
  115. struct pop_front;
  116. struct front;
  117. struct back;
  118. struct top;
  119. struct first;
  120. struct second;
  121. struct matched;
  122. struct length;
  123. struct str;
  124. struct insert;
  125. struct make_pair;
  126. template<typename T>
  127. struct as;
  128. template<typename T>
  129. struct static_cast_;
  130. template<typename T>
  131. struct dynamic_cast_;
  132. template<typename T>
  133. struct const_cast_;
  134. template<typename T>
  135. struct construct;
  136. template<typename Except>
  137. struct throw_;
  138. struct unwrap_reference;
  139. }
  140. ///////////////////////////////////////////////////////////////////////////////
  141. // Common typedefs
  142. //
  143. typedef basic_regex<std::string::const_iterator> sregex;
  144. typedef basic_regex<char const *> cregex;
  145. #ifndef BOOST_XPRESSIVE_NO_WREGEX
  146. typedef basic_regex<std::wstring::const_iterator> wsregex;
  147. typedef basic_regex<wchar_t const *> wcregex;
  148. #endif
  149. typedef sub_match<std::string::const_iterator> ssub_match;
  150. typedef sub_match<char const *> csub_match;
  151. #ifndef BOOST_XPRESSIVE_NO_WREGEX
  152. typedef sub_match<std::wstring::const_iterator> wssub_match;
  153. typedef sub_match<wchar_t const *> wcsub_match;
  154. #endif
  155. typedef regex_compiler<std::string::const_iterator> sregex_compiler;
  156. typedef regex_compiler<char const *> cregex_compiler;
  157. #ifndef BOOST_XPRESSIVE_NO_WREGEX
  158. typedef regex_compiler<std::wstring::const_iterator> wsregex_compiler;
  159. typedef regex_compiler<wchar_t const *> wcregex_compiler;
  160. #endif
  161. typedef regex_iterator<std::string::const_iterator> sregex_iterator;
  162. typedef regex_iterator<char const *> cregex_iterator;
  163. #ifndef BOOST_XPRESSIVE_NO_WREGEX
  164. typedef regex_iterator<std::wstring::const_iterator> wsregex_iterator;
  165. typedef regex_iterator<wchar_t const *> wcregex_iterator;
  166. #endif
  167. typedef regex_token_iterator<std::string::const_iterator> sregex_token_iterator;
  168. typedef regex_token_iterator<char const *> cregex_token_iterator;
  169. #ifndef BOOST_XPRESSIVE_NO_WREGEX
  170. typedef regex_token_iterator<std::wstring::const_iterator> wsregex_token_iterator;
  171. typedef regex_token_iterator<wchar_t const *> wcregex_token_iterator;
  172. #endif
  173. typedef match_results<std::string::const_iterator> smatch;
  174. typedef match_results<char const *> cmatch;
  175. #ifndef BOOST_XPRESSIVE_NO_WREGEX
  176. typedef match_results<std::wstring::const_iterator> wsmatch;
  177. typedef match_results<wchar_t const *> wcmatch;
  178. #endif
  179. typedef regex_id_filter_predicate<std::string::const_iterator> sregex_id_filter_predicate;
  180. typedef regex_id_filter_predicate<char const *> cregex_id_filter_predicate;
  181. #ifndef BOOST_XPRESSIVE_NO_WREGEX
  182. typedef regex_id_filter_predicate<std::wstring::const_iterator> wsregex_id_filter_predicate;
  183. typedef regex_id_filter_predicate<wchar_t const *> wcregex_id_filter_predicate;
  184. #endif
  185. }} // namespace boost::xpressive
  186. #endif