Chris@16: /*============================================================================= Chris@16: Boost.Wave: A Standard compliant C++ preprocessor library Chris@16: Chris@16: http://www.boost.org/ Chris@16: Chris@16: Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost Chris@16: Software License, Version 1.0. (See accompanying file Chris@16: LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: =============================================================================*/ Chris@16: Chris@16: #if !defined(CPP_GRAMMAR_GEN_HPP_80CB8A59_5411_4E45_B406_62531A12FB99_INCLUDED) Chris@16: #define CPP_GRAMMAR_GEN_HPP_80CB8A59_5411_4E45_B406_62531A12FB99_INCLUDED Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: #include Chris@16: Chris@16: // this must occur after all of the includes and before any code appears Chris@16: #ifdef BOOST_HAS_ABI_HEADERS Chris@16: #include BOOST_ABI_PREFIX Chris@16: #endif Chris@16: Chris@16: // suppress warnings about dependent classes not being exported from the dll Chris@16: #ifdef BOOST_MSVC Chris@16: #pragma warning(push) Chris@16: #pragma warning(disable : 4251 4231 4660) Chris@16: #endif Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: namespace boost { Chris@16: namespace wave { Chris@16: namespace grammars { Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // Here are the node id's of the different node of the cpp_grammar Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: #define BOOST_WAVE_PP_STATEMENT_ID 1 Chris@16: #define BOOST_WAVE_INCLUDE_FILE_ID 2 Chris@16: #define BOOST_WAVE_SYSINCLUDE_FILE_ID 3 Chris@16: #define BOOST_WAVE_MACROINCLUDE_FILE_ID 4 Chris@16: #define BOOST_WAVE_PLAIN_DEFINE_ID 5 Chris@16: #define BOOST_WAVE_MACRO_PARAMETERS_ID 6 Chris@16: #define BOOST_WAVE_MACRO_DEFINITION_ID 7 Chris@16: #define BOOST_WAVE_UNDEFINE_ID 8 Chris@16: #define BOOST_WAVE_IFDEF_ID 9 Chris@16: #define BOOST_WAVE_IFNDEF_ID 10 Chris@16: #define BOOST_WAVE_IF_ID 11 Chris@16: #define BOOST_WAVE_ELIF_ID 12 Chris@16: #define BOOST_WAVE_ELSE_ID 13 Chris@16: #define BOOST_WAVE_ENDIF_ID 14 Chris@16: #define BOOST_WAVE_LINE_ID 15 Chris@16: #define BOOST_WAVE_ERROR_ID 16 Chris@16: #define BOOST_WAVE_WARNING_ID 17 Chris@16: #define BOOST_WAVE_PRAGMA_ID 18 Chris@16: #define BOOST_WAVE_ILLFORMED_ID 19 Chris@16: #define BOOST_WAVE_PPSPACE_ID 20 Chris@16: #define BOOST_WAVE_PPQUALIFIEDNAME_ID 21 Chris@16: #define BOOST_WAVE_REGION_ID 22 Chris@16: #define BOOST_WAVE_ENDREGION_ID 23 Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // cpp_grammar_gen template class Chris@16: // Chris@16: // This template helps separating the compilation of the cpp_grammar Chris@16: // class from the compilation of the main pp_iterator. This is done to Chris@16: // safe compilation time. Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: template Chris@16: struct BOOST_WAVE_DECL cpp_grammar_gen Chris@16: { Chris@16: typedef LexIteratorT iterator_type; Chris@16: typedef typename LexIteratorT::token_type token_type; Chris@16: typedef TokenContainerT token_container_type; Chris@16: typedef typename token_type::position_type position_type; Chris@16: typedef boost::spirit::classic::node_val_data_factory< Chris@16: // boost::spirit::nil_t, Chris@16: // boost::pool_allocator Chris@16: > node_factory_type; Chris@16: Chris@16: // parse the cpp_grammar and return the resulting parse tree Chris@16: static boost::spirit::classic::tree_parse_info Chris@16: parse_cpp_grammar (iterator_type const &first, iterator_type const &last, Chris@16: position_type const &act_pos, bool &found_eof, Chris@16: token_type &found_directive, token_container_type &found_eoltokens); Chris@16: }; Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: } // namespace grammars Chris@16: } // namespace wave Chris@16: } // namespace boost Chris@16: Chris@16: #ifdef BOOST_MSVC Chris@16: #pragma warning(pop) Chris@16: #endif Chris@16: Chris@16: // the suffix header occurs after all of the code Chris@16: #ifdef BOOST_HAS_ABI_HEADERS Chris@16: #include BOOST_ABI_SUFFIX Chris@16: #endif Chris@16: Chris@16: #endif // !defined(CPP_GRAMMAR_GEN_HPP_80CB8A59_5411_4E45_B406_62531A12FB99_INCLUDED)