instantiate_cpp_exprgrammar.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*=============================================================================
  2. Boost.Wave: A Standard compliant C++ preprocessor library
  3. Sample: prints out the preprocessed tokens returned by the pp iterator
  4. Explicit instantiation of the cpp_expression_grammar parsing
  5. function
  6. http://www.boost.org/
  7. Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
  8. Software License, Version 1.0. (See accompanying file
  9. LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  10. =============================================================================*/
  11. #include "cpp_tokens.hpp" // config data
  12. #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0
  13. #include <string>
  14. #include <boost/wave/token_ids.hpp>
  15. #include "slex_token.hpp"
  16. #include "slex_iterator.hpp"
  17. #include <boost/wave/grammars/cpp_expression_grammar.hpp>
  18. ///////////////////////////////////////////////////////////////////////////////
  19. //
  20. // Explicit instantiation of the expression_grammar_gen template with the
  21. // correct token type. This instantiates the corresponding parse function,
  22. // which in turn instantiates the expression_grammar object (see
  23. // wave/grammars/cpp_expression_grammar.hpp)
  24. //
  25. ///////////////////////////////////////////////////////////////////////////////
  26. typedef boost::wave::cpplexer::slex_token<> token_type;
  27. template struct boost::wave::grammars::expression_grammar_gen<token_type>;
  28. #endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0