PageRenderTime 19ms CodeModel.GetById 12ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/spirit/home/classic/meta/fundamental.hpp

http://hadesmem.googlecode.com/
C++ Header | 56 lines | 23 code | 12 blank | 21 comment | 0 complexity | 2f59aed04d0feef60d18f093f48d4f94 MD5 | raw file
 1/*=============================================================================
 2    Copyright (c) 2002-2003 Hartmut Kaiser
 3    http://spirit.sourceforge.net/
 4
 5  Distributed under the Boost Software License, Version 1.0. (See accompanying
 6  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 7=============================================================================*/
 8#if !defined(BOOST_SPIRIT_FUNDAMENTAL_HPP)
 9#define BOOST_SPIRIT_FUNDAMENTAL_HPP
10
11#include <boost/spirit/home/classic/namespace.hpp>
12#include <boost/spirit/home/classic/meta/impl/fundamental.ipp>
13
14namespace boost { namespace spirit {
15
16BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
17
18    ///////////////////////////////////////////////////////////////////////////
19    //
20    //  Helper template for counting the number of nodes contained in a
21    //  given parser type.
22    //  All parser_category type parsers are counted as nodes.
23    //
24    ///////////////////////////////////////////////////////////////////////////
25    template <typename ParserT>
26    struct node_count {
27
28        typedef typename ParserT::parser_category_t parser_category_t;
29        typedef typename impl::nodes<parser_category_t>
30            ::template count<ParserT, mpl::int_<0> > count_t;
31
32        BOOST_STATIC_CONSTANT(int, value = count_t::value);
33    };
34
35    ///////////////////////////////////////////////////////////////////////////
36    //
37    //  Helper template for counting the number of leaf nodes contained in a
38    //  given parser type.
39    //  Only plain_parser_category type parsers are counted as leaf nodes.
40    //
41    ///////////////////////////////////////////////////////////////////////////
42    template <typename ParserT>
43    struct leaf_count {
44
45        typedef typename ParserT::parser_category_t parser_category_t;
46        typedef typename impl::leafs<parser_category_t>
47            ::template count<ParserT, mpl::int_<0> > count_t;
48
49        BOOST_STATIC_CONSTANT(int, value = count_t::value);
50    };
51
52BOOST_SPIRIT_CLASSIC_NAMESPACE_END
53
54}} // namespace BOOST_SPIRIT_CLASSIC_NS
55
56#endif // !defined(BOOST_SPIRIT_FUNDAMENTAL_HPP)