1 /*=============================================================================
2 Copyright (c) 2002-2003 Hartmut Kaiser
3 http://spirit.sourceforge.net/
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
11 #include <boost/spirit/home/classic/namespace.hpp>
12 #include <boost/spirit/home/classic/meta/impl/fundamental.ipp>
14 namespace boost { namespace spirit {
16 BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
18 ///////////////////////////////////////////////////////////////////////////
20 // Helper template for counting the number of nodes contained in a
22 // All parser_category type parsers are counted as nodes.
24 ///////////////////////////////////////////////////////////////////////////
25 template <typename ParserT>
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;
32 BOOST_STATIC_CONSTANT(int, value = count_t::value);
35 ///////////////////////////////////////////////////////////////////////////
37 // Helper template for counting the number of leaf nodes contained in a
39 // Only plain_parser_category type parsers are counted as leaf nodes.
41 ///////////////////////////////////////////////////////////////////////////
42 template <typename ParserT>
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;
49 BOOST_STATIC_CONSTANT(int, value = count_t::value);
52 BOOST_SPIRIT_CLASSIC_NAMESPACE_END
54 }} // namespace BOOST_SPIRIT_CLASSIC_NS
56 #endif // !defined(BOOST_SPIRIT_FUNDAMENTAL_HPP)