]> git.sesse.net Git - casparcg/blob - dependencies/boost/boost/wave/grammars/cpp_defined_grammar_gen.hpp
Manually merged pull request #222
[casparcg] / dependencies / boost / boost / wave / grammars / cpp_defined_grammar_gen.hpp
1 /*=============================================================================
2     Boost.Wave: A Standard compliant C++ preprocessor library
3
4     http://www.boost.org/
5
6     Copyright (c) 2001-2011 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
11 #if !defined(CPP_DEFINED_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED)
12 #define CPP_DEFINED_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED
13
14 #include <boost/wave/wave_config.hpp>
15
16 #include <list>
17
18 #include <boost/spirit/include/classic_parser.hpp>
19 #include <boost/pool/pool_alloc.hpp>
20
21 #include <boost/wave/util/unput_queue_iterator.hpp>
22
23 // this must occur after all of the includes and before any code appears
24 #ifdef BOOST_HAS_ABI_HEADERS
25 #include BOOST_ABI_PREFIX
26 #endif
27
28 // suppress warnings about dependent classes not being exported from the dll
29 #ifdef BOOST_MSVC
30 #pragma warning(push)
31 #pragma warning(disable : 4251 4231 4660)
32 #endif
33
34 ///////////////////////////////////////////////////////////////////////////////
35 namespace boost {
36 namespace wave { 
37 namespace grammars {
38
39 template <typename LexIteratorT>
40 struct BOOST_WAVE_DECL defined_grammar_gen
41 {
42     typedef typename LexIteratorT::token_type token_type;
43     typedef std::list<token_type, boost::fast_pool_allocator<token_type> >
44         token_sequence_type;
45
46 //  The parse_operator_defined function is instantiated manually twice to 
47 //  simplify the explicit specialization of this template. This way the user 
48 //  has only to specify one template parameter (the lexer iterator type) to 
49 //  correctly formulate the required explicit specialization.
50 //  This results in no code overhead, because otherwise the function would be
51 //  generated by the compiler twice anyway.
52
53     typedef boost::wave::util::unput_queue_iterator<
54             typename token_sequence_type::iterator, token_type, token_sequence_type>
55         iterator1_type;
56
57     typedef boost::wave::util::unput_queue_iterator<
58             LexIteratorT, token_type, token_sequence_type>
59         iterator2_type;
60         
61 //  parse the operator defined and return the found qualified name
62     static boost::spirit::classic::parse_info<iterator1_type> 
63     parse_operator_defined (iterator1_type const &first, 
64         iterator1_type const &last, token_sequence_type &found_qualified_name);
65
66     static boost::spirit::classic::parse_info<iterator2_type> 
67     parse_operator_defined (iterator2_type const &first, 
68         iterator2_type const &last, token_sequence_type &found_qualified_name);
69 };
70
71 ///////////////////////////////////////////////////////////////////////////////
72 }   // namespace grammars
73 }   // namespace wave
74 }   // namespace boost
75
76 #ifdef BOOST_MSVC
77 #pragma warning(pop)
78 #endif
79
80 // the suffix header occurs after all of the code
81 #ifdef BOOST_HAS_ABI_HEADERS
82 #include BOOST_ABI_SUFFIX
83 #endif
84
85 #endif // !defined(CPP_DEFINED_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED)