]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/wave/samples/cpp_tokens/instantiate_cpp_grammar.cpp
1 /*=============================================================================
2 Boost.Wave: A Standard compliant C++ preprocessor library
4 Sample: prints out the preprocessed tokens returned by the pp iterator
5 Explicit instantiation of the cpp_grammar parsing function
9 Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
10 Software License, Version 1.0. (See accompanying file
11 LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
12 =============================================================================*/
14 #include "cpp_tokens.hpp" // config data
16 #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0
21 #include <boost/wave/token_ids.hpp>
23 #include "slex_token.hpp"
24 #include "slex_iterator.hpp"
26 #include <boost/wave/grammars/cpp_grammar.hpp>
28 ///////////////////////////////////////////////////////////////////////////////
30 // Explicit instantiation of the cpp_grammar_gen template with the correct
31 // token type. This instantiates the corresponding pt_parse function, which
32 // in turn instantiates the cpp_grammar object
33 // (see wave/grammars/cpp_grammar.hpp)
35 ///////////////////////////////////////////////////////////////////////////////
37 typedef boost::wave::cpplexer::slex_token
<> token_type
;
38 typedef boost::wave::cpplexer::slex::slex_iterator
<token_type
> lexer_type
;
39 typedef std::list
<token_type
, boost::fast_pool_allocator
<token_type
> >
42 template struct boost::wave::grammars::cpp_grammar_gen
<lexer_type
, token_sequence_type
>;
44 #endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0