cpp_predef_macros_gen.hpp 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*=============================================================================
  2. A Standard compliant C++ preprocessor
  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(CPP_PREDEF_MACROS_GEN_HPP_CADB6D2C_76A4_4988_83E1_EFFC6902B9A2_INCLUDED)
  9. #define CPP_PREDEF_MACROS_GEN_HPP_CADB6D2C_76A4_4988_83E1_EFFC6902B9A2_INCLUDED
  10. #include <boost/spirit/include/classic_parse_tree.hpp>
  11. #include <boost/wave/wave_config.hpp>
  12. // this must occur after all of the includes and before any code appears
  13. #ifdef BOOST_HAS_ABI_HEADERS
  14. #include BOOST_ABI_PREFIX
  15. #endif
  16. // suppress warnings about dependent classes not being exported from the dll
  17. #ifdef BOOST_MSVC
  18. #pragma warning(push)
  19. #pragma warning(disable : 4251 4231 4660)
  20. #endif
  21. ///////////////////////////////////////////////////////////////////////////////
  22. namespace boost {
  23. namespace wave {
  24. namespace grammars {
  25. ///////////////////////////////////////////////////////////////////////////////
  26. //
  27. // Here are the node id's of the different node of the cpp_grammar
  28. //
  29. ///////////////////////////////////////////////////////////////////////////////
  30. #define BOOST_WAVE_PLAIN_DEFINE_ID 5
  31. #define BOOST_WAVE_MACRO_PARAMETERS_ID 6
  32. #define BOOST_WAVE_MACRO_DEFINITION_ID 7
  33. ///////////////////////////////////////////////////////////////////////////////
  34. //
  35. // predefined_macros_grammar_gen template class
  36. //
  37. // This template helps separating the compilation of the
  38. // predefined_macros_grammar class from the compilation of the
  39. // main pp_iterator. This is done to safe compilation time.
  40. //
  41. // This class helps parsing command line given macro definitions in a
  42. // similar way, as macros are parsed by the cpp_grammar class.
  43. //
  44. ///////////////////////////////////////////////////////////////////////////////
  45. template <typename LexIteratorT>
  46. struct BOOST_WAVE_DECL predefined_macros_grammar_gen
  47. {
  48. typedef LexIteratorT iterator_type;
  49. // parse the cpp_grammar and return the resulting parse tree
  50. static boost::spirit::classic::tree_parse_info<iterator_type>
  51. parse_predefined_macro (iterator_type const &first, iterator_type const &last);
  52. };
  53. ///////////////////////////////////////////////////////////////////////////////
  54. } // namespace grammars
  55. } // namespace wave
  56. } // namespace boost
  57. #ifdef BOOST_MSVC
  58. #pragma warning(pop)
  59. #endif
  60. // the suffix header occurs after all of the code
  61. #ifdef BOOST_HAS_ABI_HEADERS
  62. #include BOOST_ABI_SUFFIX
  63. #endif
  64. #endif // !defined(CPP_PREDEF_MACROS_GEN_HPP_CADB6D2C_76A4_4988_83E1_EFFC6902B9A2_INCLUDED)