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