1 | /*=============================================================================
|
---|
2 | Boost.Wave: A Standard compliant C++ preprocessor library
|
---|
3 |
|
---|
4 | http://www.boost.org/
|
---|
5 |
|
---|
6 | Copyright (c) 2001-2005 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 <list>
|
---|
15 |
|
---|
16 | #include <boost/spirit/core/parser.hpp>
|
---|
17 | #include <boost/pool/pool_alloc.hpp>
|
---|
18 |
|
---|
19 | #include <boost/wave/util/unput_queue_iterator.hpp>
|
---|
20 |
|
---|
21 | ///////////////////////////////////////////////////////////////////////////////
|
---|
22 | namespace boost {
|
---|
23 | namespace wave {
|
---|
24 | namespace grammars {
|
---|
25 |
|
---|
26 | template <typename LexIteratorT>
|
---|
27 | struct defined_grammar_gen
|
---|
28 | {
|
---|
29 | typedef typename LexIteratorT::token_type token_type;
|
---|
30 | typedef std::list<token_type, boost::fast_pool_allocator<token_type> >
|
---|
31 | token_sequence_type;
|
---|
32 |
|
---|
33 | // The parse_operator_define function is instantiated manually twice to
|
---|
34 | // simplify the explicit specialization of this template. This way the user
|
---|
35 | // has only to specify one template parameter (the lexer iterator type) to
|
---|
36 | // correctly formulate the required explicit specialization.
|
---|
37 | // This results in no code overhead, because otherwise the function would be
|
---|
38 | // generated by the compiler twice anyway.
|
---|
39 |
|
---|
40 | typedef boost::wave::util::unput_queue_iterator<
|
---|
41 | typename token_sequence_type::iterator, token_type, token_sequence_type>
|
---|
42 | iterator1_t;
|
---|
43 |
|
---|
44 | typedef boost::wave::util::unput_queue_iterator<
|
---|
45 | LexIteratorT, token_type, token_sequence_type>
|
---|
46 | iterator2_t;
|
---|
47 |
|
---|
48 | // parse the operator defined and return the found qualified name
|
---|
49 | static boost::spirit::parse_info<iterator1_t>
|
---|
50 | parse_operator_defined (iterator1_t const &first, iterator1_t const &last,
|
---|
51 | token_sequence_type &found_qualified_name);
|
---|
52 |
|
---|
53 | static boost::spirit::parse_info<iterator2_t>
|
---|
54 | parse_operator_defined (iterator2_t const &first, iterator2_t const &last,
|
---|
55 | token_sequence_type &found_qualified_name);
|
---|
56 | };
|
---|
57 |
|
---|
58 | ///////////////////////////////////////////////////////////////////////////////
|
---|
59 | } // namespace grammars
|
---|
60 | } // namespace wave
|
---|
61 | } // namespace boost
|
---|
62 |
|
---|
63 | #endif // !defined(CPP_DEFINED_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED)
|
---|