]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/wave/samples/cpp_tokens/instantiate_cpp_grammar.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / wave / samples / cpp_tokens / instantiate_cpp_grammar.cpp
1 /*=============================================================================
2 Boost.Wave: A Standard compliant C++ preprocessor library
3
4 Sample: prints out the preprocessed tokens returned by the pp iterator
5 Explicit instantiation of the cpp_grammar parsing function
6
7 http://www.boost.org/
8
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 =============================================================================*/
13
14 #include "cpp_tokens.hpp" // config data
15
16 #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0
17
18 #include <string>
19 #include <list>
20
21 #include <boost/wave/token_ids.hpp>
22
23 #include "slex_token.hpp"
24 #include "slex_iterator.hpp"
25
26 #include <boost/wave/grammars/cpp_grammar.hpp>
27
28 ///////////////////////////////////////////////////////////////////////////////
29 //
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)
34 //
35 ///////////////////////////////////////////////////////////////////////////////
36
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> >
40 token_sequence_type;
41
42 template struct boost::wave::grammars::cpp_grammar_gen<lexer_type, token_sequence_type>;
43
44 #endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0
45