instantiate_cpp_grammar.cpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*=============================================================================
  2. Boost.Wave: A Standard compliant C++ preprocessor library
  3. Sample: IDL oriented preprocessor
  4. Explicit instantiation of the cpp_grammar template
  5. http://www.boost.org/
  6. Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost
  7. Software License, Version 1.0. (See accompanying file
  8. LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. =============================================================================*/
  10. #include "idl.hpp"
  11. #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0
  12. #include <string>
  13. #include <list>
  14. #include <boost/wave/token_ids.hpp>
  15. #include <boost/wave/cpplexer/cpp_lex_token.hpp>
  16. #include "idllexer/idl_lex_iterator.hpp"
  17. #include <boost/wave/grammars/cpp_grammar.hpp>
  18. ///////////////////////////////////////////////////////////////////////////////
  19. //
  20. // Explicit instantiation of the cpp_grammar_gen template with the correct
  21. // token type. This instantiates the corresponding pt_parse function, which
  22. // in turn instantiates the cpp_grammar object
  23. // (see wave/grammars/cpp_grammar.hpp)
  24. //
  25. ///////////////////////////////////////////////////////////////////////////////
  26. typedef boost::wave::cpplexer::lex_token<> token_type;
  27. typedef boost::wave::idllexer::lex_iterator<token_type> lexer_type;
  28. typedef std::list<token_type, boost::fast_pool_allocator<token_type> >
  29. token_sequence_type;
  30. template struct boost::wave::grammars::cpp_grammar_gen<lexer_type, token_sequence_type>;
  31. #endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0