cpp_has_include_grammar_gen.hpp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*=============================================================================
  2. Boost.Wave: A Standard compliant C++ preprocessor library
  3. http://www.boost.org/
  4. Copyright (c) 2001-2012 Hartmut Kaiser. 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. #if !defined(BOOST_CPP_HAS_INCLUDE_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED)
  9. #define BOOST_CPP_HAS_INCLUDE_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED
  10. #include <boost/wave/wave_config.hpp>
  11. #include <list>
  12. #include <boost/spirit/include/classic_parser.hpp>
  13. #include <boost/pool/pool_alloc.hpp>
  14. #include <boost/wave/util/unput_queue_iterator.hpp>
  15. // this must occur after all of the includes and before any code appears
  16. #ifdef BOOST_HAS_ABI_HEADERS
  17. #include BOOST_ABI_PREFIX
  18. #endif
  19. // suppress warnings about dependent classes not being exported from the dll
  20. #ifdef BOOST_MSVC
  21. #pragma warning(push)
  22. #pragma warning(disable : 4251 4231 4660)
  23. #endif
  24. ///////////////////////////////////////////////////////////////////////////////
  25. namespace boost {
  26. namespace wave {
  27. namespace grammars {
  28. template <typename LexIteratorT>
  29. struct BOOST_WAVE_DECL has_include_grammar_gen
  30. {
  31. typedef typename LexIteratorT::token_type token_type;
  32. typedef std::list<token_type, boost::fast_pool_allocator<token_type> >
  33. token_sequence_type;
  34. // The parse_operator_has_include function is instantiated manually twice to
  35. // simplify the explicit specialization of this template. This way the user
  36. // has only to specify one template parameter (the lexer iterator type) to
  37. // correctly formulate the required explicit specialization.
  38. // This results in no code overhead, because otherwise the function would be
  39. // generated by the compiler twice anyway.
  40. typedef boost::wave::util::unput_queue_iterator<
  41. typename token_sequence_type::iterator, token_type, token_sequence_type>
  42. iterator1_type;
  43. typedef boost::wave::util::unput_queue_iterator<
  44. LexIteratorT, token_type, token_sequence_type>
  45. iterator2_type;
  46. // parse the operator has_include and return the found qualified name
  47. static boost::spirit::classic::parse_info<iterator1_type>
  48. parse_operator_has_include (iterator1_type const &first,
  49. iterator1_type const &last, token_sequence_type &found_qualified_name,
  50. bool &is_quoted_filename, bool &is_system);
  51. static boost::spirit::classic::parse_info<iterator2_type>
  52. parse_operator_has_include (iterator2_type const &first,
  53. iterator2_type const &last, token_sequence_type &found_qualified_name,
  54. bool &is_quoted_filename, bool &is_system);
  55. };
  56. ///////////////////////////////////////////////////////////////////////////////
  57. } // namespace grammars
  58. } // namespace wave
  59. } // namespace boost
  60. #ifdef BOOST_MSVC
  61. #pragma warning(pop)
  62. #endif
  63. // the suffix header occurs after all of the code
  64. #ifdef BOOST_HAS_ABI_HEADERS
  65. #include BOOST_ABI_SUFFIX
  66. #endif
  67. #endif // !defined(BOOST_CPP_HAS_INCLUDE_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED)