instantiate_defined_grammar.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*=============================================================================
  2. Boost.Wave: A Standard compliant C++ preprocessor library
  3. Sample: Collect token statistics
  4. Explicit instantiation of the defined_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 "token_statistics.hpp"
  11. #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0
  12. #include <string>
  13. #include <boost/wave/token_ids.hpp>
  14. #include <boost/wave/cpplexer/cpp_lex_token.hpp>
  15. #include "xlex_iterator.hpp"
  16. #include <boost/wave/grammars/cpp_defined_grammar.hpp>
  17. ///////////////////////////////////////////////////////////////////////////////
  18. //
  19. // Explicit instantiation of the defined_grammar_gen template
  20. // with the correct token type. This instantiates the corresponding parse
  21. // function, which in turn instantiates the defined_grammar
  22. // object (see wave/grammars/cpp_defined_grammar.hpp)
  23. //
  24. ///////////////////////////////////////////////////////////////////////////////
  25. typedef boost::wave::cpplexer::xlex::xlex_iterator<
  26. boost::wave::cpplexer::lex_token<> >
  27. lexer_type;
  28. template struct boost::wave::grammars::defined_grammar_gen<lexer_type>;
  29. #endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0