placeholders.hpp 3.1 KB

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